Commit Graph

35065 Commits

Author SHA1 Message Date
Michael Niedermayer
a008a7cc95 avcodec/ffjni: Fix occured typo
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-09 04:28:37 +01:00
Michael Niedermayer
89862cd734 avcodec/ffjni: Fix ;;
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-09 04:28:37 +01:00
Reimar Döffinger
b60dfae7af aacenc_utils: Use temporary variable.
This ensures gcc does not create unnecessary
loads or stores and possibly even does not vectorize
the negation.
Speeds up mp3 to aac transcoding with default settings
by 10% when using "gcc (Debian 5.3.1-10) 5.3.1 20160224".

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2016-03-08 23:56:51 +01:00
Reimar Döffinger
b91e376390 aacenc: use generational cache instead of resetting.
Approximately 11% faster transcoding from mp3 with
default settings.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2016-03-08 23:56:51 +01:00
Moritz Barsnick
72babb8566 lavc/mjpegdec: avoid printing useless message in default log level
The change of bps from 0 doesn't contain any info useful to the
user. This message is now at info log level only if the original
value is !=0, otherwise pushed back to debug log level. The
original value is displayed additionally.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-08 16:42:34 +01:00
Timo Rothenpieler
f2bdf9d26a avcodec/nvenc: Fix typo and preset error message 2016-03-08 11:18:16 +01:00
Lucas Cooper
fd55470c65 avcodec/nvenc: Add encoder stats
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-03-08 10:41:07 +01:00
Michael Niedermayer
da904faaa5 avcodec: try to document timebase a bit more
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-07 23:00:50 +01:00
Clément Bœsch
2b7a61cbd8 lavc/utils: fix extra ASS sanity check in convert_sub_to_old_ass_form() 2016-03-07 21:48:55 +01:00
Matthieu Bouron
8c24523cc5 lavc/mediacodec: fix chroma width for yuv420p 2016-03-07 14:41:55 +01:00
Matthieu Bouron
81f14884b5 lavc/mjpegdec: avoid unneeded allocation if the frame is to be skipped 2016-03-07 12:36:23 +01:00
Matthieu Bouron
4737fe6907 lavc: add h264 mediacodec decoder 2016-03-07 11:28:29 +01:00
Matthieu Bouron
3ab178516e lavc: add JNI support 2016-03-07 11:17:31 +01:00
Carl Eugen Hoyos
59793785f4 lavc/cfhd: Remove one more \n from avpriv_report_missing_feature(). 2016-03-06 21:38:41 +01:00
Carl Eugen Hoyos
719276b860 lavc/cfhd: Sanitize avpriv_report_missing_feature() usage. 2016-03-06 21:22:47 +01:00
foo86
db44b59980 avcodec/dca: clear X96 channels if nothing was decoded
The first X96 channel set can have more channels than core, causing X96
decoding to be skipped. Clear the number of decoded X96 channels to zero
in this rudimentary case.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-06 18:24:20 +01:00
Kieran Kunhya
247fe3e494 avcodec/cfhd: Fixes cfhd_odd.mov which has a resolution of 496x241
In this case container width/height is better however.
Thanks to koda for the sample
2016-03-06 12:38:07 +00:00
Umair Khan
7d6c264e02 avcodec/alsdec: treat quant_cof as a signed value
Signed-off-by: Umair Khan <omerjerk@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-06 13:11:29 +01:00
Reimar Döffinger
5f5e6033cd bitstream.c: improve init_vlc error messages.
Makes it far easier to spot the issue if e.g.
caused by a typo in the code table.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2016-03-06 12:31:40 +01:00
Reimar Döffinger
0a04c2885f aacenc: avoid double in quantize_bands.
I cannot see any point whatsoever to use
double here instead of float, the results
are likely identical in all cases..
Using float allows for much more
efficient use of SIMD.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2016-03-06 11:49:19 +01:00
Clément Bœsch
0443b2cf79 lavc: restore ABI compatibility with 3.x (sub_text_format)
Regression introduced in 2941282.

Reported-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-05 10:15:35 +01:00
James Almer
a3659ca014 avcodec/cos_tablegen: extend table generation to 17bits
Fixes compilation of fft with hardcoded tables

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-03-05 00:39:53 -03:00
Michael Niedermayer
dec816f92c avcodec/utils: Fix memleak on error in convert_sub_to_old_ass_form()
Fixes CID1355116

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-05 01:50:32 +01:00
Rostislav Pehlivanov
c45b1aa824 vc2enc: minor cosmetic changes
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-04 22:41:20 +00:00
Rostislav Pehlivanov
f21cf2b383 vc2enc: remove useless alignment on slice encoding
This was a leftover from before the slices were encoded in parallel.
Since the put_bits context is initialized per slice aligning it
aferwards is pointless.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-04 22:41:15 +00:00
Rostislav Pehlivanov
b88be742fa vc2enc: do not allocate packet until exact frame size is known
This commit solves most of the crashes and issues with the encoder and
the bitrate setting. Now the encoder will always allocate the absolute
lowest amount of memory regardless of what the bitrate has been set to.
Therefore if a user inputs a very low bitrate the encoder will use the
maximum possible quantization (basically zero out all coefficients),
allocate a packet and encode it. There is no coupling between the
bitrate and the allocation size and so no crashes because the buffer
isn't large enough.

The maximum quantizer was raised to the size of the table now to both
keep the overshoot at ridiculous bitrates low and to improve quality
with higher bit depths (since the coefficients grow larger per transform
quantizing them to the same relative level requires larger quantization
indices).

Since the quantization index start follows the previous quantization
index for that slice, the quantization step was reduced to a static 1
to improve performance. Previously with quant/5 the step was usually
set to 0 upon start (and was later clipped to 1), that isn't a big change.
As the step size increases so does the amount of bits leftover and so
the redistribution algorithm has to iterate more and thus waste more
time.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-04 22:40:58 +00:00
Derek Buitenhuis
a38eadd7e9 Merge commit '5e555f93009f0605db120eec78262d0fe337e645'
AVClass is now a const, the rest are no-op.

* commit '5e555f93009f0605db120eec78262d0fe337e645':
  mpeg12enc: always write closed gops for intra only outputs
  h264: Add an AVClass pointer to H264Context
  libx264: Fix noise_reduction option assignment

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-03-04 16:17:05 +00:00
Michael Niedermayer
305344d89e avcodec/fft: Add revtab32 for FFTs with more than 65536 samples
x86 optimizations are used only for the cases they support (<=65536 samples)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-04 16:05:47 +01:00
Michael Niedermayer
ae76b84221 avcodec: Extend fft to size 2^17
Asked-for-by: durandal_1707

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-04 13:51:42 +01:00
Agatha Hu
362e05f1ea avcodec/nvenc: Fix H264 and HEVC vui info update
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-03-04 10:49:33 +01:00
Michael Niedermayer
fbfd2601f6 avcodec/utils: Fix 'ISO C90 forbids mixed declarations and code'
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-03 21:19:54 +01:00
foo86
00e3717b4a avcodec/dca: simplify condition
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-03 12:35:21 +01:00
foo86
8981348749 avcodec/dca: fix av_cold placement in declarations
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-03 12:35:21 +01:00
Rodger Combs
ecba35bbe3 lavc/videotoolboxenc: remove *_NULLABLE annotations; fixes pre-10.11 build
These macros were added in OS X 10.11, and the file compiles without warnings
on both 10.10 and 10.11 with them removed.

Thanks to mark4o on IRC for pointing out the failure and testing the patch.
2016-03-02 21:44:28 -06:00
Rick Kern
3af71ac3f9 lavc: add VideoToolbox H.264 Encoder
Autodetected by default. Encode using -codec:v h264_videotoolbox.

Signed-off-by: Rick Kern <kernrj@gmail.com>
Signed-off-by: wm4 <nfxjfg@googlemail.com>
2016-03-02 21:19:35 +01:00
Ganesh Ajjanagadde
bd9c58756a lavc/aacenc_utils: replace sqrtf(Q*sqrtf(Q)) by precomputed value
It makes no sense whatsoever to do this at each function call; we
already have a table for this.

Yields a 2x improvement in find_min_book (x86-64, Haswell+GCC):
ffmpeg -i sin.flac -acodec aac -y sin.aac
find_min_book
old
    605 decicycles in find_min_book, 8388453 runs,    155 skips.9x
    606 decicycles in find_min_book,16776912 runs,    304 skips.9x
    607 decicycles in find_min_book,33553819 runs,    613 skips.2x
    607 decicycles in find_min_book,67107668 runs,   1196 skips.3x
    607 decicycles in find_min_book,134215360 runs,   2368 skips3x

new
    359 decicycles in find_min_book, 8388552 runs,     56 skips.3x
    360 decicycles in find_min_book,16777112 runs,    104 skips.1x
    361 decicycles in find_min_book,33554218 runs,    214 skips.4x
    361 decicycles in find_min_book,67108381 runs,    483 skips.5x
    361 decicycles in find_min_book,134216725 runs,   1003 skips5x

and more importantly a non-negligible speedup (~ 8%) to overall AAC encoding:
old:
ffmpeg -i sin.flac -acodec aac -strict -2 -y sin_new.aac  6.82s user 0.03s system 104% cpu 6.565 total
new:
ffmpeg -i sin.flac -acodec aac -strict -2 -y sin_old.aac  6.24s user 0.03s system 104% cpu 5.993 total

This also improves accuracy of the expression by ~ 2 ulp in some cases.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
2016-03-01 22:57:44 -05:00
Wan-Teh Chang
4845f0720e Move the |die| member of FrameThreadContext to PerThreadContext.
This fixes a data race warning by ThreadSanitizer.
FrameThreadContext.die is read by all the worker threads but is not
protected by any mutex. Move it to PerThreadContext so that each worker
thread reads its own copy of |die|, which can then be protected with
PerThreadContext.mutex.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2016-03-01 13:53:47 -05:00
Rostislav Pehlivanov
7bcc57ad99 vc2enc: fix packet underallocation and minimum bitrate with interlacing
This was a regression introduced by commit e7345abe05 which
enabled full use of the allocated packet but due to the overhead of
using field coding the buffer was too small and triggered warnings and
crashes.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-01 13:44:18 +00:00
Rostislav Pehlivanov
41985d40c6 vc2enc: simplify slice cost caching
The fact that now all quantization indices costs are cached justifies
storing 20 more integers in a structure already allocated on heap.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-01 13:04:40 +00:00
Rostislav Pehlivanov
6061b78e83 vc2enc: remove redundant put_padding() and use skip_put_bytes() instead
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-01 11:39:30 +00:00
Michael Niedermayer
0be09f54fb avcodec: Add utils test
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-29 21:44:06 +01:00
Timothy Gu
e3461197b1 x86/vc1dsp: Split the file into MC and loopfilter 2016-02-29 08:46:53 -08:00
Carl Eugen Hoyos
4e05a12a41 lavc/pcxenc: Update format description link. 2016-02-29 12:42:29 +01:00
Michael Niedermayer
3e42c1128f avcodec/libzvbi-teletextdec: Remove unused variable
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-28 23:39:32 +01:00
Rostislav Pehlivanov
e7345abe05 vc2enc: redistribute leftover bytes
This commit redistributes the leftover bytes amongst the top 150 slices
in terms of size (in the hopes that they'll be the ones pretty bitrate
starved).

A more perceptual method would probably need to cut bits off from slices
which don't need much, but that'll be implemented later.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-02-28 19:06:29 +00:00
Rostislav Pehlivanov
bbcd5e99c3 vc2enc: allocate the DWT context with the current plane size
Previously used the luma size only.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-02-28 19:06:29 +00:00
Rostislav Pehlivanov
2f19583911 2enc: clip and warn when user bitrate set too low
The encoder crashed on verly low bitrates since there wasn't enough
space allocated.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-02-28 19:06:29 +00:00
Rostislav Pehlivanov
6e5c6d61bd vc2enc: clip and warn when user bitrate set too low
The encoder crashed on verly low bitrates since there wasn't enough
space allocated.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-02-28 19:06:29 +00:00
Rostislav Pehlivanov
0a2adf0f47 vc2enc: carry over quantization index across frames as a starting point
Previously a global average was used. Using the previous quantizer
resulted in a fairly significant speedup as slice size selection settled
down quicker.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-02-28 19:06:29 +00:00
Rostislav Pehlivanov
fc1d3cbfdc vc2enc: use 32 bits for quantized coefficients LUT
16 bits were definitely not enough and caused artifacts to appear on
images at barely compressed images.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-02-28 19:06:29 +00:00