ffmpeg.git
4 years agoMerge commit '4a0918cae6394e503b17c71f8f171b4a795eb849'
Hendrik Leppkes [Sun, 29 Nov 2015 14:49:31 +0000 (15:49 +0100)]
Merge commit '4a0918cae6394e503b17c71f8f171b4a795eb849'

* commit '4a0918cae6394e503b17c71f8f171b4a795eb849':
  sgienc: Support encoding high bit depth images with RLE

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
4 years agoavfilter/avf_showvolume: Fix "warning: comparison of unsigned expression < 0 is alway...
Michael Niedermayer [Sun, 29 Nov 2015 14:37:05 +0000 (15:37 +0100)]
avfilter/avf_showvolume: Fix "warning: comparison of unsigned expression < 0 is always false"

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoMerge commit '59e3f4e598ae381600ef54e1f6e6a8a5270ac245'
Hendrik Leppkes [Sun, 29 Nov 2015 14:45:47 +0000 (15:45 +0100)]
Merge commit '59e3f4e598ae381600ef54e1f6e6a8a5270ac245'

* commit '59e3f4e598ae381600ef54e1f6e6a8a5270ac245':
  sgienc: Use a local RLE encoding function

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
4 years agoMerge commit '62cc8f4d79dad119e8efeaae080a58a8dcb1e89d'
Hendrik Leppkes [Sun, 29 Nov 2015 14:44:44 +0000 (15:44 +0100)]
Merge commit '62cc8f4d79dad119e8efeaae080a58a8dcb1e89d'

* commit '62cc8f4d79dad119e8efeaae080a58a8dcb1e89d':
  sgienc: Port to bytestream2

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
4 years agoMerge commit '99f40fd02f1870c2dee70977b672da9cb198f0be'
Hendrik Leppkes [Sun, 29 Nov 2015 14:42:33 +0000 (15:42 +0100)]
Merge commit '99f40fd02f1870c2dee70977b672da9cb198f0be'

* commit '99f40fd02f1870c2dee70977b672da9cb198f0be':
  sgienc: Do not end RLE lines with 0s

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
4 years agoMerge commit '4d05e9392f84702e3c833efa86e84c7f1cf5f612'
Hendrik Leppkes [Sun, 29 Nov 2015 14:35:11 +0000 (15:35 +0100)]
Merge commit '4d05e9392f84702e3c833efa86e84c7f1cf5f612'

* commit '4d05e9392f84702e3c833efa86e84c7f1cf5f612':
  libvpxenc: remove some unused ctrl id mappings

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
4 years agoMerge commit '6b7df14251c49331ae7efd4811ec21f4415ccdb5'
Hendrik Leppkes [Sun, 29 Nov 2015 14:33:52 +0000 (15:33 +0100)]
Merge commit '6b7df14251c49331ae7efd4811ec21f4415ccdb5'

* commit '6b7df14251c49331ae7efd4811ec21f4415ccdb5':
  doc: Document better how to use MSYS2

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
4 years agoMerge commit '8375dc1dd101d51baa430f34c0bcadfa37873896'
Hendrik Leppkes [Sun, 29 Nov 2015 14:32:39 +0000 (15:32 +0100)]
Merge commit '8375dc1dd101d51baa430f34c0bcadfa37873896'

* commit '8375dc1dd101d51baa430f34c0bcadfa37873896':
  asfdec: handle the case when the stream index has an invalid value better

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
4 years agoMerge commit 'c12c085be7e86880924249e5cb3f898e45dee134'
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>
4 years agoMerge commit 'c8fa647811371885be421a84a2388529857fed23'
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>
4 years agoMerge commit 'afdff8008149515afebf9992eae84be7d76e6b1e'
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>
4 years agoMerge commit '462a54e2291e1fa18e1f1254d09739dfbb795617'
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>
4 years agoMerge commit '8a9de5c52401aa1e87bdb147524831c640d1ec53'
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>
4 years agoMerge commit 'fc4c27c4edfc6a5f9bc7c696e823652474a65ce8'
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>
4 years agoMerge commit 'e7d7cf86dcaba8eaaed62c80172ff0aff2588c2a'
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>
4 years agoavfilter/avf_showvolume: fix several issues
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>
4 years agoavformat/mlpdec: consider all valid mlp access units when probing
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.

4 years agoavcodec/h264_refs: Check that long references match before use
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>
4 years agoavcodec/utils: Clear dimensions in ff_get_buffer() on failure
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>
4 years agoavcodec/utils: Use 64bit for aspect ratio calculation in avcodec_string()
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>
4 years agodoc/filters: extend agate documentation
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>
4 years agoavfilter: add audio compressor filter
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>
4 years agoavfilter: add compensation delay line filter
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>
4 years agoavcodec/hevc: Check max ctb addresses for WPP
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>
4 years agoavcodec/aac_tablegen: get rid of hardcoded tables entirely
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>
4 years agoavcodec/vp3: Fix several memleaks
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>
4 years agoavcodec/vp3: Clear context on reinitialization failure
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>
4 years agoavcodec/hevc: allocate entries unconditionally
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>
4 years agoavcodec/pthread_slice: Allow calling ff_alloc_entries() multiple times to readjust...
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>
4 years agoavcodec/hevc_cabac: Fix multiple integer overflows
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>
4 years agoaacenc: fix broken build with hardcoded tables
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>
4 years agoavcodec/jpeg2000dwt: Check ndeclevels before calling dwt_encode*()
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>
4 years agoavcodec/jpeg2000dwt: Check ndeclevels before calling dwt_decode*()
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>
4 years agoavcodec/aac_tablegen: make exp2_lut static
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>
4 years agoavcodec/hevc: Check entry_point_offsets
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>
4 years agoaac: temporarily un-share aac_table_init AVOnce variable
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>
4 years agoaactab.h: fix comment
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>
4 years agoaactab.h: update and correct comment
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>
4 years agoaacenc: make threadsafe
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>
4 years agoavcodec/cabac: Check initial cabac decoder state
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>
4 years agoavcodec/cabac_functions: Fix "left shift of negative value -31767"
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>
4 years agoavcodec/aac_tablegen: speed up table initialization
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>
4 years agolavf/utils: avoid decoding a frame to get the codec parameters
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).

4 years agoaac_ltp: actually signal LTP as off during EIGHT_SHORT windows
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>
4 years agoaac_ltp: split, reorder and improve prediction algorithm
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.

4 years agoavcodec/faandct: remove L suffixes for floating point literal
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>
4 years agofate: add FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM tests
Matthieu Bouron [Wed, 25 Nov 2015 09:30:15 +0000 (10:30 +0100)]
fate: add FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM tests

4 years agoavfilter/vsrc_mptestsrc: use hypot()
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>
4 years agoavfilter/af_dynaudnorm: remove wasteful pow
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>
4 years agoavfilter/af_afade: improve accuracy and speed of gain computation
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>
4 years agoavutil/lls: speed up performance of solve_lls
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>
4 years agoavfilter/vf_stack: make it possible to stop with shortest stream
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>
4 years agoaaccoder_twoloop: Mark sfdiff as av_unused
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>
4 years agoAAC encoder: fix wrong gain sacalefactor being set
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.

4 years agoAAC encoder: Fix application of M/S with PNS
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.

4 years agofate-run: Fix indentation
Timothy Gu [Thu, 26 Nov 2015 05:03:14 +0000 (21:03 -0800)]
fate-run: Fix indentation

4 years agolavf/http: fix incorrect warning in range requests
Rodger Combs [Sun, 18 Oct 2015 22:50:21 +0000 (17:50 -0500)]
lavf/http: fix incorrect warning in range requests

4 years agoavcodec/pthread_slice: Remove rets_count
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>
4 years agoavcodec/mjpegdec: fix typo on a warning
James Almer [Wed, 25 Nov 2015 22:22:19 +0000 (19:22 -0300)]
avcodec/mjpegdec: fix typo on a warning

4 years agoavfilter: add '.' at and of long filter description where it is missing
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>
4 years agoavfilter: do not leak frame if ff_get_audio_buffer() fails
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>
4 years agoavfilter/af_alimiter: make description a bit longer
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>
4 years agodoc/indevs: fix x11grab options consistency
Stefano Sabatini [Wed, 25 Nov 2015 16:53:58 +0000 (17:53 +0100)]
doc/indevs: fix x11grab options consistency

4 years agoavfilter/af_sidechaincompress: add forgotten option
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>
4 years agoavutil/libm: fix isnan compatibility hack
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>
4 years agodoc/indevs: Fix German
Timothy Gu [Wed, 25 Nov 2015 02:17:49 +0000 (18:17 -0800)]
doc/indevs: Fix German

4 years agoconfigure: Fix pseudo-German
Timothy Gu [Wed, 25 Nov 2015 02:17:38 +0000 (18:17 -0800)]
configure: Fix pseudo-German

4 years agoavfilter/vsrc_mandelbrot: change sin to sinf for color computation
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>
4 years agoavfilter/vsrc_mandelbrot: avoid sqrt for epsilon calculation
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>
4 years agoavcodec/aacps_tablegen: use hypot()
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>
4 years agoavcodec/aacps_tablegen_template: replace #define by typedef
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>
4 years agoavcodec/aac_defines: replace #define by typedef
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>
4 years agovsrc_mandelbrot: Don't use German in comments
Timothy Gu [Wed, 25 Nov 2015 01:33:07 +0000 (17:33 -0800)]
vsrc_mandelbrot: Don't use German in comments

4 years agolavfi/select: add support for concatdec_select option
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>
4 years agoconcatdec: add option for adding segment start time and duration metadata
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>
4 years agoconcatdec: simplify duration calculation in open_next_file
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>
4 years agoconcatdec: calculate duration early if outpoint is known
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>
4 years agoavcodec/h264_slice: Limit max_contexts when slice_context_count is initialized
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>
4 years agosgienc: Support encoding high bit depth images with RLE
Vittorio Giovara [Fri, 20 Nov 2015 01:17:34 +0000 (02:17 +0100)]
sgienc: Support encoding high bit depth images with RLE

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agosgienc: Use a local RLE encoding function
Vittorio Giovara [Fri, 20 Nov 2015 01:17:33 +0000 (02:17 +0100)]
sgienc: Use a local RLE encoding function

SGI RLE encoding is slighlty different than the one provided by rle
module (especially at high bit depth). The pixel count function however
does not change, so it is simply made library-public.

4 years agosgienc: Port to bytestream2
Vittorio Giovara [Fri, 20 Nov 2015 01:17:32 +0000 (02:17 +0100)]
sgienc: Port to bytestream2

4 years agosgienc: Do not end RLE lines with 0s
Vittorio Giovara [Fri, 20 Nov 2015 01:17:31 +0000 (02:17 +0100)]
sgienc: Do not end RLE lines with 0s

This is never mentioned in the specifications, and decoders work
just as fine without it. Update the fate references since the compressed
file is smaller.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agoMerge commit 'fb8753ada23189076bdf903c1c001c0ca8287fae'
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>
4 years agoavformat/v210: Check width and height
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).

4 years agoavformat/rawvideodec: Rework packet size calculation
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().

4 years agoimgutils: Use designated initializers for AVClass
Timothy Gu [Sat, 21 Nov 2015 04:48:06 +0000 (20:48 -0800)]
imgutils: Use designated initializers for AVClass

More readable and less breakable.

4 years agoavfilter/vsrc_mandelbrot: Fix speed regression
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>
4 years agolavf/rawenc: Recognize more extensions to encode raw hevc.
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
4 years agoavcodec/mpegvideo_enc: Remove slice structured mode from H.263 as well as the code...
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>
4 years agolibvpxenc: remove some unused ctrl id mappings
James Zern [Tue, 20 Oct 2015 05:44:11 +0000 (22:44 -0700)]
libvpxenc: remove some unused ctrl id mappings

VP8E_UPD_ENTROPY, VP8E_UPD_REFERENCE, VP8E_USE_REFERENCE were removed
from libvpx and the remaining values were never used here

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Zern <jzern@google.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
4 years agoavformat/movenc-test: Fix integer overflows
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>
4 years agoswscale/arm: add ff_nv{12,21}_to_{argb,rgba,abgr,bgra}_neon
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>
4 years agodoc: Document better how to use MSYS2
Luca Barbato [Mon, 23 Nov 2015 12:05:09 +0000 (13:05 +0100)]
doc: Document better how to use MSYS2

4 years agoavutil/x86/bswap: Remove warning about bswap intrinsics with msvc.
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>
4 years agoasfdec: handle the case when the stream index has an invalid value better
Alexandra Hájková [Thu, 19 Nov 2015 13:25:41 +0000 (14:25 +0100)]
asfdec: handle the case when the stream index has an invalid value better

The demuxer returned INVALIDDATA and failed to demux the remaining data
when an invalid stream index was read, now it just skips the asf packet
for the stream with an invalid stream index and continues demuxing.

Reported-By: Hendrik Leppkes
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
4 years agodcadec: Do not check for overreads in auxiliary data
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>
4 years agoavutil/motion_vector: export subpel motion information
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.

4 years agooggparsespeex: Fix unchecked malloc
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>
4 years agodoc/filters: mention afifo
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>
4 years agoavfilter/af_afade: add missing fifo write for second stream
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>