Hendrik Leppkes [Sun, 29 Nov 2015 14:32:27 +0000 (15:32 +0100)]
Merge commit '
c12c085be7e86880924249e5cb3f898e45dee134'
* commit '
c12c085be7e86880924249e5cb3f898e45dee134':
dcadec: Do not check for overreads in auxiliary data
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Hendrik Leppkes [Sun, 29 Nov 2015 14:29:41 +0000 (15:29 +0100)]
Merge commit '
c8fa647811371885be421a84a2388529857fed23'
* commit '
c8fa647811371885be421a84a2388529857fed23':
oggparsespeex: Fix unchecked malloc
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Hendrik Leppkes [Sun, 29 Nov 2015 14:28:53 +0000 (15:28 +0100)]
Merge commit '
afdff8008149515afebf9992eae84be7d76e6b1e'
* commit '
afdff8008149515afebf9992eae84be7d76e6b1e':
configure: Clearly state that MSYS native builds are discouraged
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Hendrik Leppkes [Sun, 29 Nov 2015 14:26:51 +0000 (15:26 +0100)]
Merge commit '
462a54e2291e1fa18e1f1254d09739dfbb795617'
* commit '
462a54e2291e1fa18e1f1254d09739dfbb795617':
lavc: Deprecate avctx.rtp_callback field
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Hendrik Leppkes [Sun, 29 Nov 2015 14:24:29 +0000 (15:24 +0100)]
Merge commit '
8a9de5c52401aa1e87bdb147524831c640d1ec53'
* commit '
8a9de5c52401aa1e87bdb147524831c640d1ec53':
doc/encoders: document the QSV option mappings
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Hendrik Leppkes [Sun, 29 Nov 2015 14:22:53 +0000 (15:22 +0100)]
Merge commit '
fc4c27c4edfc6a5f9bc7c696e823652474a65ce8'
* commit '
fc4c27c4edfc6a5f9bc7c696e823652474a65ce8':
qsvenc: expose additional encoding options
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Hendrik Leppkes [Sun, 29 Nov 2015 14:18:08 +0000 (15:18 +0100)]
Merge commit '
e7d7cf86dcaba8eaaed62c80172ff0aff2588c2a'
* commit '
e7d7cf86dcaba8eaaed62c80172ff0aff2588c2a':
qsvenc: support more RC methods
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Paul B Mahol [Sun, 29 Nov 2015 11:37:48 +0000 (12:37 +0100)]
avfilter/avf_showvolume: fix several issues
Fix color fading: previously color could fade to red when
volume level for red color was actually never reached.
Display volume value on right side.
Use red color only if clipping is needed.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Hendrik Leppkes [Mon, 16 Nov 2015 23:28:58 +0000 (00:28 +0100)]
avformat/mlpdec: consider all valid mlp access units when probing
Fixes probing of truehd/mlp files with a lot of frames in between the
major sync frames. The spec allows a distance of up to 128 frames in
between major sync frames, which leads to the probing code not reaching
the desired score.
Michael Niedermayer [Sun, 29 Nov 2015 02:25:41 +0000 (03:25 +0100)]
avcodec/h264_refs: Check that long references match before use
Fixes out of array read
Fixes:
59bb925e90201fa0f87f0a31945d43b5/asan_heap-oob_4a52e5_3388_66027f11e3d072f1e02401ecc6193361.jvt
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Michael Niedermayer [Sat, 28 Nov 2015 19:08:46 +0000 (20:08 +0100)]
avcodec/utils: Clear dimensions in ff_get_buffer() on failure
Fixes out of array access
Fixes:
482d8f2fd17c9f532b586458a33f267c/asan_heap-oob_4a52b6_7417_1d08d477736d66cdadd833d146bb8bae.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Michael Niedermayer [Sat, 28 Nov 2015 16:26:05 +0000 (17:26 +0100)]
avcodec/utils: Use 64bit for aspect ratio calculation in avcodec_string()
Fixes integer overflow
Fixes:
3a45b2ae02f2cf12b7bd99543cdcdae5/asan_heap-oob_1dff502_8022_899f75e1e81046ebd7b6c2394a1419f4.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Paul B Mahol [Sat, 28 Nov 2015 17:17:02 +0000 (18:17 +0100)]
doc/filters: extend agate documentation
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Paul B Mahol [Wed, 25 Nov 2015 10:36:45 +0000 (11:36 +0100)]
avfilter: add audio compressor filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Paul B Mahol [Tue, 24 Nov 2015 10:14:36 +0000 (11:14 +0100)]
avfilter: add compensation delay line filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Michael Niedermayer [Sat, 28 Nov 2015 12:42:05 +0000 (13:42 +0100)]
avcodec/hevc: Check max ctb addresses for WPP
Fixes out of array read
Fixes:
2f95ddd996db8a6281d2e18c184595a7/asan_heap-oob_192fe91_3330_58e4441181e30a66c19f743dcb392347.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Ganesh Ajjanagadde [Fri, 27 Nov 2015 22:01:49 +0000 (17:01 -0500)]
avcodec/aac_tablegen: get rid of hardcoded tables entirely
Commit
96786a12f6df26990bbe7c0ca4592b3731724469 makes runtime
initialization cheap.
Tested with FATE, with/without --enable-hardcoded-tables.
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Michael Niedermayer [Sat, 28 Nov 2015 00:00:54 +0000 (01:00 +0100)]
avcodec/vp3: Fix several memleaks
Fixes:
1536b9b096a8f95b742bae9d3d761cc6/signal_sigsegv_294aaed_4460_b209bd1e7cebe458b53072a44191316d.ogg
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Michael Niedermayer [Fri, 27 Nov 2015 23:23:54 +0000 (00:23 +0100)]
avcodec/vp3: Clear context on reinitialization failure
Fixes null pointer dereference
Fixes:
1536b9b096a8f95b742bae9d3d761cc6/signal_sigsegv_294aaed_2039_8d1797aeb823ea43858d0fa45c9eb899.ogv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Michael Niedermayer [Fri, 27 Nov 2015 22:33:03 +0000 (23:33 +0100)]
avcodec/hevc: allocate entries unconditionally
Fixes out of array access
Fixes:
08664a2a7921ef48172f26495c7455be/asan_heap-oob_23036c6_3301_523388ef84285a0270caf67a43247b59.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Michael Niedermayer [Fri, 27 Nov 2015 22:32:04 +0000 (23:32 +0100)]
avcodec/pthread_slice: Allow calling ff_alloc_entries() multiple times to readjust the entry count
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Michael Niedermayer [Fri, 27 Nov 2015 21:45:46 +0000 (22:45 +0100)]
avcodec/hevc_cabac: Fix multiple integer overflows
Fixes:
04ec80eefa77aecd7a49a442cc02baea/asan_heap-oob_19544fa_3303_1905796cd9d8e15f86d664332caabc00.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Rostislav Pehlivanov [Fri, 27 Nov 2015 21:24:42 +0000 (21:24 +0000)]
aacenc: fix broken build with hardcoded tables
ff_aac_tableinit is a macro in the case of hardcoded tables, so wrap
that up in a function (similar to how the decoder template does it) and
use that as the argument for ff_thread_once().
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Michael Niedermayer [Fri, 27 Nov 2015 20:02:13 +0000 (21:02 +0100)]
avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_encode*()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Michael Niedermayer [Fri, 27 Nov 2015 19:52:39 +0000 (20:52 +0100)]
avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_decode*()
Fixes out of array access
Fixes:
01859c9a9ac6cd60a008274123275574/asan_heap-oob_1dff571_8250_50d3d1611e294c3519fd1fa82198b69b.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Ganesh Ajjanagadde [Fri, 27 Nov 2015 18:21:48 +0000 (13:21 -0500)]
avcodec/aac_tablegen: make exp2_lut static
Suggested-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Michael Niedermayer [Fri, 27 Nov 2015 17:30:05 +0000 (18:30 +0100)]
avcodec/hevc: Check entry_point_offsets
Fixes out of array read
Fixes:
007c4a36608ebdf27ee260ad60a81184/asan_heap-oob_32076b4_2243_116b1cb29d91cc4974d6680e3d10bd91.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Rostislav Pehlivanov [Fri, 27 Nov 2015 17:51:42 +0000 (17:51 +0000)]
aac: temporarily un-share aac_table_init AVOnce variable
AAC-Fixed decoder segfaulted. This commit makes the aac encoder
and decoder init the table twice in case of transcoding again.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Rostislav Pehlivanov [Fri, 27 Nov 2015 15:36:57 +0000 (15:36 +0000)]
aactab.h: fix comment
Previous commit broke it.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Rostislav Pehlivanov [Fri, 27 Nov 2015 15:00:13 +0000 (15:00 +0000)]
aactab.h: update and correct comment
Tables in that file have been used by both for a long time now.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Rostislav Pehlivanov [Fri, 27 Nov 2015 14:52:35 +0000 (14:52 +0000)]
aacenc: make threadsafe
Since the ff_aac_tableinit() can be called by both the encoder and
the decoder (in case of transcoding) this commit shares the AVOnce
variable to prevent this.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Michael Niedermayer [Fri, 27 Nov 2015 12:37:50 +0000 (13:37 +0100)]
avcodec/cabac: Check initial cabac decoder state
Fixes integer overflows
Fixes:
1430e9c43fae47a24c179c7c54f94918/signal_sigsegv_421427_2340_591e9810c7b09efe501ad84638c9e9f8.264
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Found-by: xiedingbao (Ticket4727)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Michael Niedermayer [Fri, 27 Nov 2015 11:11:29 +0000 (12:11 +0100)]
avcodec/cabac_functions: Fix "left shift of negative value -31767"
Fixes:
1430e9c43fae47a24c179c7c54f94918/signal_sigsegv_421427_2340_591e9810c7b09efe501ad84638c9e9f8.264
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Found-by: xiedingbao (Ticket4727)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Ganesh Ajjanagadde [Thu, 26 Nov 2015 18:50:57 +0000 (13:50 -0500)]
avcodec/aac_tablegen: speed up table initialization
This speeds up aac_tablegen to a ludicruous degree (~97%), i.e to the point
where it can be argued that runtime initialization can always be done instead of
hard-coded tables. The only cost is essentially a trivial increase in
the stack size.
Even if one does not care about this, the patch also improves accuracy
as detailed below.
Performance:
Benchmark obtained by looping 10^4 times over ff_aac_tableinit.
Sample benchmark (x86-64, Haswell, GNU/Linux):
old:
1295292 decicycles in ff_aac_tableinit, 512 runs, 0 skips
1275981 decicycles in ff_aac_tableinit, 1024 runs, 0 skips
1272932 decicycles in ff_aac_tableinit, 2048 runs, 0 skips
1262164 decicycles in ff_aac_tableinit, 4096 runs, 0 skips
1256720 decicycles in ff_aac_tableinit, 8192 runs, 0 skips
new:
21112 decicycles in ff_aac_tableinit, 511 runs, 1 skips
21269 decicycles in ff_aac_tableinit, 1023 runs, 1 skips
21352 decicycles in ff_aac_tableinit, 2043 runs, 5 skips
21386 decicycles in ff_aac_tableinit, 4080 runs, 16 skips
21299 decicycles in ff_aac_tableinit, 8173 runs, 19 skips
Accuracy:
The previous code was resulting in needless loss of
accuracy due to the pow being called in succession. As an illustration
of this:
ff_aac_pow34sf_tab[3]
old : 0.
000000000007598092294225
new : 0.
000000000007598091426864
real: 0.
000000000007598091778545
truncated to float
old : 0.
000000000007598092294225
new : 0.
000000000007598091426864
real: 0.
000000000007598091426864
showing that the old value was not correctly rounded. This affects a
large number of elements of the array.
Patch tested with FATE.
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Matthieu Bouron [Tue, 24 Nov 2015 13:14:54 +0000 (14:14 +0100)]
lavf/utils: avoid decoding a frame to get the codec parameters
Avoid decoding a frame to get the codec parameters while the codec
supports FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM. This is particulary useful
to avoid decoding twice images (once in avformat_find_stream_info and
once when the actual decode is made).
Rostislav Pehlivanov [Thu, 26 Nov 2015 18:20:42 +0000 (18:20 +0000)]
aac_ltp: actually signal LTP as off during EIGHT_SHORT windows
This hugely reduces the echo which was introduced with the previous
commit (though likely because previously everything was broken).
Makes LTP actually worthwhile now.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Rostislav Pehlivanov [Thu, 26 Nov 2015 17:40:04 +0000 (17:40 +0000)]
aac_ltp: split, reorder and improve prediction algorithm
This commit attempts to mirror what the decoder does more closely
in addition to fixing some shortcomings.
Ganesh Ajjanagadde [Thu, 26 Nov 2015 14:17:46 +0000 (09:17 -0500)]
avcodec/faandct: remove L suffixes for floating point literal
Should fix issues with ppc, tested by bug reporter.
Reported-by: John Warburton <john@johnwarburton.net>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Matthieu Bouron [Wed, 25 Nov 2015 09:30:15 +0000 (10:30 +0100)]
fate: add FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM tests
Ganesh Ajjanagadde [Sun, 22 Nov 2015 16:50:22 +0000 (11:50 -0500)]
avfilter/vsrc_mptestsrc: use hypot()
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Wed, 25 Nov 2015 04:34:48 +0000 (23:34 -0500)]
avfilter/af_dynaudnorm: remove wasteful pow
This removes wasteful pow(x, 2.0) that although not terribly important
for speed, is still useless.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Wed, 25 Nov 2015 03:56:28 +0000 (22:56 -0500)]
avfilter/af_afade: improve accuracy and speed of gain computation
Gain computation for various curves was being done in a needlessly
inaccurate fashion. Of course these are all subjective curves, but when
a curve is advertised to the user, it should be matched as closely as
possible within the limitations of libm. In particular, the constants
kept here were pretty inaccurate for double precision.
Speed improvements are mainly due to the avoidance of pow, the most
notorious of the libm functions in terms of performance. To be fair, it
is the GNU libm that is among the worst, but it is not really GNU libm's fault
since others simply yield a higher error as measured in ULP.
"Magic" constants are also accordingly documented, since they take at
least a minute of thought for a casual reader.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Tue, 24 Nov 2015 00:05:54 +0000 (19:05 -0500)]
avutil/lls: speed up performance of solve_lls
This is a trivial rewrite of the loops that results in better
prefetching and associated cache efficiency. Essentially, the problem is
that modern prefetching logic is based on finite state Markov memory, a reasonable
assumption that is used elsewhere in CPU's in for instance branch
predictors.
Surrounding loops all iterate forward through the array, making the
predictor think of prefetching in the forward direction, but the
intermediate loop is unnecessarily in the backward direction.
Speedup is nontrivial. Benchmarks obtained by 10^6 iterations within
solve_lls, with START/STOP_TIMER. File is tests/data/fate/flac-16-lpc-cholesky.err.
Hardware: x86-64, Haswell, GNU/Linux.
new:
17291 decicycles in solve_lls, 2096706 runs, 446 skips
17255 decicycles in solve_lls, 4193657 runs, 647 skips
17231 decicycles in solve_lls, 8384997 runs, 3611 skips
17189 decicycles in solve_lls,
16771010 runs, 6206 skips
17132 decicycles in solve_lls,
33544757 runs, 9675 skips
17092 decicycles in solve_lls,
67092404 runs, 16460 skips
17058 decicycles in solve_lls,
134188213 runs, 29515 skips
old:
18009 decicycles in solve_lls, 2096665 runs, 487 skips
17805 decicycles in solve_lls, 4193320 runs, 984 skips
17779 decicycles in solve_lls, 8386855 runs, 1753 skips
18289 decicycles in solve_lls,
16774280 runs, 2936 skips
18158 decicycles in solve_lls,
33548104 runs, 6328 skips
18420 decicycles in solve_lls,
67091793 runs, 17071 skips
18310 decicycles in solve_lls,
134187219 runs, 30509 skips
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Paul B Mahol [Thu, 26 Nov 2015 08:56:43 +0000 (09:56 +0100)]
avfilter/vf_stack: make it possible to stop with shortest stream
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Timothy Gu [Thu, 26 Nov 2015 06:46:09 +0000 (03:46 -0300)]
aaccoder_twoloop: Mark sfdiff as av_unused
Silences warning when building without assertions
Signed-off-by: Claudio Freire <klaussfreire@gmail.com>
Claudio Freire [Thu, 26 Nov 2015 06:37:29 +0000 (03:37 -0300)]
AAC encoder: fix wrong gain sacalefactor being set
In some conditions, where the first band was being zeroed
mainly, the wrong global gain scalefactor would be written
to the stream since it's always taken from the first band
regardless of whether it's been marked as zero or not.
So, always make sure it contians something useful.
Claudio Freire [Thu, 26 Nov 2015 06:27:06 +0000 (03:27 -0300)]
AAC encoder: Fix application of M/S with PNS
When both M/S coding and PNS are enabled, scalefactors
and coding books would be mistakenly clobbered when setting
the M/S flag on PNS'd bands. The flag needs to be set to
signal the generation of correlated noise, but the scalefactors,
coefficients and the coding books need to be kept intact.
Timothy Gu [Thu, 26 Nov 2015 05:03:14 +0000 (21:03 -0800)]
fate-run: Fix indentation
Rodger Combs [Sun, 18 Oct 2015 22:50:21 +0000 (17:50 -0500)]
lavf/http: fix incorrect warning in range requests
Michael Niedermayer [Wed, 18 Nov 2015 23:58:35 +0000 (00:58 +0100)]
avcodec/pthread_slice: Remove rets_count
It appears rets_count is redundant
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
James Almer [Wed, 25 Nov 2015 22:22:19 +0000 (19:22 -0300)]
avcodec/mjpegdec: fix typo on a warning
Paul B Mahol [Wed, 25 Nov 2015 21:22:17 +0000 (22:22 +0100)]
avfilter: add '.' at and of long filter description where it is missing
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Paul B Mahol [Wed, 25 Nov 2015 20:59:33 +0000 (21:59 +0100)]
avfilter: do not leak frame if ff_get_audio_buffer() fails
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Paul B Mahol [Wed, 25 Nov 2015 20:52:36 +0000 (21:52 +0100)]
avfilter/af_alimiter: make description a bit longer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Stefano Sabatini [Wed, 25 Nov 2015 16:53:58 +0000 (17:53 +0100)]
doc/indevs: fix x11grab options consistency
Paul B Mahol [Wed, 25 Nov 2015 11:44:07 +0000 (12:44 +0100)]
avfilter/af_sidechaincompress: add forgotten option
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Ganesh Ajjanagadde [Wed, 25 Nov 2015 02:29:35 +0000 (21:29 -0500)]
avutil/libm: fix isnan compatibility hack
Commit
14ea4151d7c3c26500193f11ac661ed20c7c2b9c had a bug in that the
conversion of the uint64_t result to an int (the return signature) would
lead to implementation defined behavior, and in this case simply
returned 0 for NAN. A fix via AND'ing the result with 1 does the trick,
simply by ensuring a 0 or 1 return value.
Patch tested with FATE on x86-64, GNU/Linux by forcing the compatibility
code via an ifdef hack suggested by Michael.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Timothy Gu [Wed, 25 Nov 2015 02:17:49 +0000 (18:17 -0800)]
doc/indevs: Fix German
Timothy Gu [Wed, 25 Nov 2015 02:17:38 +0000 (18:17 -0800)]
configure: Fix pseudo-German
Ganesh Ajjanagadde [Tue, 24 Nov 2015 18:00:54 +0000 (13:00 -0500)]
avfilter/vsrc_mandelbrot: change sin to sinf for color computation
lrintf is anyway used, suggesting we only care up to floating precision.
Rurthermore, there is a compat hack in avutil/libm for this function,
and it is used in avcodec/aacps_tablegen.h.
This yields a non-negligible speedup. Sample benchmark:
x86-64, Haswell, GNU/Linux:
old (draw_mandelbrot):
274635709 decicycles in draw_mandelbrot, 256 runs, 0 skips
300287046 decicycles in draw_mandelbrot, 512 runs, 0 skips
371819935 decicycles in draw_mandelbrot, 1024 runs, 0 skips
336663765 decicycles in draw_mandelbrot, 2048 runs, 0 skips
581851016 decicycles in draw_mandelbrot, 4096 runs, 0 skips
new (draw_mandelbrot):
269882717 decicycles in draw_mandelbrot, 256 runs, 0 skips
296359285 decicycles in draw_mandelbrot, 512 runs, 0 skips
370076599 decicycles in draw_mandelbrot, 1024 runs, 0 skips
331478354 decicycles in draw_mandelbrot, 2048 runs, 0 skips
571904318 decicycles in draw_mandelbrot, 4096 runs, 0 skips
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Sun, 22 Nov 2015 16:49:15 +0000 (11:49 -0500)]
avfilter/vsrc_mandelbrot: avoid sqrt for epsilon calculation
This rewrites into a similar expression avoiding sqrt. Similarity is
assured since sqrt(x^2 + y^2)/(x+y) lies in [1/sqrt(2), 1] for x, y > 0.
Tested on x86-64, Haswell, GNU/Linux.
Command:
ffmpeg -f lavfi -i mandelbrot -f null -
old (draw_mandelbrot):
277625266 decicycles in draw_mandelbrot, 256 runs, 0 skips
304527322 decicycles in draw_mandelbrot, 512 runs, 0 skips
377593582 decicycles in draw_mandelbrot, 1024 runs, 0 skips
338539499 decicycles in draw_mandelbrot, 2048 runs, 0 skips
583630357 decicycles in draw_mandelbrot, 4096 runs, 0 skips
new (draw_mandelbrot):
274635709 decicycles in draw_mandelbrot, 256 runs, 0 skips
300287046 decicycles in draw_mandelbrot, 512 runs, 0 skips
371819935 decicycles in draw_mandelbrot, 1024 runs, 0 skips
336663765 decicycles in draw_mandelbrot, 2048 runs, 0 skips
581851016 decicycles in draw_mandelbrot, 4096 runs, 0 skips
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Sun, 22 Nov 2015 16:30:52 +0000 (11:30 -0500)]
avcodec/aacps_tablegen: use hypot()
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Mon, 16 Nov 2015 21:59:20 +0000 (16:59 -0500)]
avcodec/aacps_tablegen_template: replace #define by typedef
See e.g https://stackoverflow.com/questions/1666353/are-typedef-and-define-the-same-in-c
for rationale.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Mon, 16 Nov 2015 21:51:30 +0000 (16:51 -0500)]
avcodec/aac_defines: replace #define by typedef
See e.g https://stackoverflow.com/questions/1666353/are-typedef-and-define-the-same-in-c
for rationale.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Timothy Gu [Wed, 25 Nov 2015 01:33:07 +0000 (17:33 -0800)]
vsrc_mandelbrot: Don't use German in comments
Marton Balint [Sat, 24 Oct 2015 19:06:38 +0000 (21:06 +0200)]
lavfi/select: add support for concatdec_select option
This option can be used to select useful frames from an ffconcat file which is
using inpoints and outpoints but where the source files are not intra frame
only.
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
Marton Balint [Sat, 24 Oct 2015 15:16:11 +0000 (17:16 +0200)]
concatdec: add option for adding segment start time and duration metadata
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
Marton Balint [Mon, 9 Nov 2015 22:49:25 +0000 (23:49 +0100)]
concatdec: simplify duration calculation in open_next_file
If duration is still AV_NOPTS_VALUE when opening the next file, we can assume
that outpoint is not set.
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
Marton Balint [Sat, 24 Oct 2015 14:20:41 +0000 (16:20 +0200)]
concatdec: calculate duration early if outpoint is known
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
Michael Niedermayer [Tue, 24 Nov 2015 21:12:37 +0000 (22:12 +0100)]
avcodec/h264_slice: Limit max_contexts when slice_context_count is initialized
Fixes out of array access
Fixes:
1430e9c43fae47a24c179c7c54f94918/signal_sigsegv_421427_2049_f2192b6829ab6e0eefcb035329c03c60.264
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Derek Buitenhuis [Tue, 24 Nov 2015 13:48:28 +0000 (13:48 +0000)]
Merge commit '
fb8753ada23189076bdf903c1c001c0ca8287fae'
* commit '
fb8753ada23189076bdf903c1c001c0ca8287fae':
qsvenc: factor out common options
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Timothy Gu [Sat, 21 Nov 2015 04:49:23 +0000 (20:49 -0800)]
avformat/v210: Check width and height
Fixes a floating point exception when width and height are not supplied
(and therefore are zero).
Timothy Gu [Sat, 21 Nov 2015 05:15:08 +0000 (21:15 -0800)]
avformat/rawvideodec: Rework packet size calculation
Calculate packet size only once, and propagate errors earlier in the chain.
Also remove use of the deprecated av_image_get_buffer_size().
Timothy Gu [Sat, 21 Nov 2015 04:48:06 +0000 (20:48 -0800)]
imgutils: Use designated initializers for AVClass
More readable and less breakable.
Michael Niedermayer [Tue, 24 Nov 2015 01:59:59 +0000 (02:59 +0100)]
avfilter/vsrc_mandelbrot: Fix speed regression
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Carl Eugen Hoyos [Tue, 24 Nov 2015 01:17:54 +0000 (02:17 +0100)]
lavf/rawenc: Recognize more extensions to encode raw hevc.
Requested-by: Mike Brown, brown at mrvideo vidiot com
Michael Niedermayer [Sun, 22 Nov 2015 19:09:11 +0000 (20:09 +0100)]
avcodec/mpegvideo_enc: Remove slice structured mode from H.263 as well as the code automatically enabing it
There is no such thing as a slice structured mode in the original version 1 H.263,
that mode was added in H.263+ in 1998. Also the headers for slice structured mode
are not part of the older version 1 and this would result in unplayable files
An alternative to this patch would be to merge the H263 and H263P AVCodecs and use
other means to distinguish the older and newer versions.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Michael Niedermayer [Mon, 23 Nov 2015 13:25:41 +0000 (14:25 +0100)]
avformat/movenc-test: Fix integer overflows
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Matthieu Bouron [Thu, 5 Nov 2015 13:49:57 +0000 (14:49 +0100)]
swscale/arm: add ff_nv{12,21}_to_{argb,rgba,abgr,bgra}_neon
Signed-off-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
Signed-off-by: Clément Bœsch <clement@stupeflix.com>
Matt Oliver [Mon, 23 Nov 2015 12:03:32 +0000 (23:03 +1100)]
avutil/x86/bswap: Remove warning about bswap intrinsics with msvc.
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
Tim Walker [Sat, 21 Nov 2015 23:02:37 +0000 (00:02 +0100)]
dcadec: Do not check for overreads in auxiliary data
The auxiliary data length field is not reliable,
and incorrect overread errors could be returned
for valid, real-world bitstreams.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Clément Bœsch [Thu, 12 Nov 2015 14:03:07 +0000 (15:03 +0100)]
avutil/motion_vector: export subpel motion information
FATE test changes because of the switch from shift to division.
Derek Buitenhuis [Sun, 22 Nov 2015 18:12:09 +0000 (18:12 +0000)]
oggparsespeex: Fix unchecked malloc
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Paul B Mahol [Mon, 23 Nov 2015 09:42:23 +0000 (10:42 +0100)]
doc/filters: mention afifo
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Paul B Mahol [Mon, 23 Nov 2015 09:37:51 +0000 (10:37 +0100)]
avfilter/af_afade: add missing fifo write for second stream
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Hagen Schmidt [Sat, 21 Nov 2015 23:54:56 +0000 (00:54 +0100)]
patcheck: Fix false detection of 'mergeable calls' when line is removed
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Ganesh Ajjanagadde [Sun, 22 Nov 2015 22:01:12 +0000 (17:01 -0500)]
Revert "avcodec/dct32_template: fix typo"
This reverts commit
82c5f3178930285f84c42ab4b026ee48d53305ec.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Sun, 22 Nov 2015 21:55:45 +0000 (16:55 -0500)]
avcodec/dct32_template: fix typo
Found-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Sat, 21 Nov 2015 14:04:58 +0000 (09:04 -0500)]
avcodec/ppc/fdctdsp: use M_SQRT2 instead of ad-hoc SQRT2
This actually fixes an incorrect float literal. It is believed by
examining the precision that the literals were all pre-computed as
floats, resulting in this needless loss of precision. There is no
benefit to keeping such reduced precision:
1. These constants are used for static array computation, hence
compile-time.
2. They will be treated as doubles anyway, since f specifier was not
present.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Wed, 11 Nov 2015 03:26:25 +0000 (22:26 -0500)]
avcodec/dct32_template: use M_SQRT1_2 instead of actual literal
Fixed point value remains unchanged.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Wed, 11 Nov 2015 03:26:25 +0000 (22:26 -0500)]
avcodec/cos_tablegen: use M_PI instead of actual literal
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Wed, 11 Nov 2015 03:26:25 +0000 (22:26 -0500)]
avcodec/ac3: use M_SQRT1_2, M_SQRT2
This uses M_SQRT1_2, M_SQRT2 instead of the actual literals. This yields
greater precision in some places in avcodec/ac3, while fixed point
values remain unchanged.
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Wed, 11 Nov 2015 03:26:25 +0000 (22:26 -0500)]
avfilter/vf_fspp: use M_SQRT1_2, M_SQRT2
This uses M_SQRT1_2, M_SQRT2 instead of the actual literals. Fixed point
values remain unchanged.
Patch tested with FATE on x86.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Ganesh Ajjanagadde [Sun, 22 Nov 2015 16:15:39 +0000 (11:15 -0500)]
avformat/mov: use hypot()
This simplifies the code.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Michael Niedermayer [Sun, 22 Nov 2015 18:15:19 +0000 (19:15 +0100)]
avcodec/dvdsubdec: Fix types for offset1/2 in ff_dlog()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Derek Buitenhuis [Sun, 22 Nov 2015 17:47:21 +0000 (17:47 +0000)]
Merge commit '
3edac01f79a08635d8d2c08e9410651d9a330d61'
* commit '
3edac01f79a08635d8d2c08e9410651d9a330d61':
qsvenc: fix setting maxrate for VBR
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Derek Buitenhuis [Sun, 22 Nov 2015 17:46:57 +0000 (17:46 +0000)]
Merge commit '
4d8f536b535487063a08609636e712ad86d2ad54'
* commit '
4d8f536b535487063a08609636e712ad86d2ad54':
qsvenc: print the actual video parameters used by MSDK
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Derek Buitenhuis [Sun, 22 Nov 2015 17:46:26 +0000 (17:46 +0000)]
Merge commit '
f6c94457b44f41d900cd0991857f54e1f0ccedd6'
* commit '
f6c94457b44f41d900cd0991857f54e1f0ccedd6':
mpegvideo_enc: enable rtp_mode when multiple slices are used
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Derek Buitenhuis [Sun, 22 Nov 2015 17:43:26 +0000 (17:43 +0000)]
Merge commit '
d80f0a4ad634b3949b91b85f21fd608c0cddeef7'
* commit '
d80f0a4ad634b3949b91b85f21fd608c0cddeef7':
mpevideo_enc: disallow multiple slices for h261 and flv
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Derek Buitenhuis [Sun, 22 Nov 2015 17:41:51 +0000 (17:41 +0000)]
Merge commit '
ca489564ae150bc41764f175b88151d883e69ae0'
* commit '
ca489564ae150bc41764f175b88151d883e69ae0':
movenc: add fallback audio track tref support
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>