ffmpeg.git
3 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>
3 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>
3 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>
3 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>
3 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>
3 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).

3 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>
3 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.

3 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>
3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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.

3 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.

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

3 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

3 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>
3 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

3 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>
3 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>
3 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>
3 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

3 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>
3 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>
3 years agodoc/indevs: Fix German
Timothy Gu [Wed, 25 Nov 2015 02:17:49 +0000 (18:17 -0800)]
doc/indevs: Fix German

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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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).

3 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().

3 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.

3 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>
3 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
3 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>
3 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>
3 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>
3 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>
3 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.

3 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>
3 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>
3 years agopatcheck: Fix false detection of 'mergeable calls' when line is removed
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>
3 years agoRevert "avcodec/dct32_template: fix typo"
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>
3 years agoavcodec/dct32_template: fix typo
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>
3 years agoavcodec/ppc/fdctdsp: use M_SQRT2 instead of ad-hoc SQRT2
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>
3 years agoavcodec/dct32_template: use M_SQRT1_2 instead of actual literal
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>
3 years agoavcodec/cos_tablegen: use M_PI instead of actual literal
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>
3 years agoavcodec/ac3: use M_SQRT1_2, M_SQRT2
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>
3 years agoavfilter/vf_fspp: use M_SQRT1_2, M_SQRT2
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>
3 years agoavformat/mov: use hypot()
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>
3 years agoavcodec/dvdsubdec: Fix types for offset1/2 in ff_dlog()
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>
3 years agoMerge commit '3edac01f79a08635d8d2c08e9410651d9a330d61'
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>
3 years agoMerge commit '4d8f536b535487063a08609636e712ad86d2ad54'
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>
3 years agoMerge commit 'f6c94457b44f41d900cd0991857f54e1f0ccedd6'
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>
3 years agoMerge commit 'd80f0a4ad634b3949b91b85f21fd608c0cddeef7'
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>
3 years agoMerge commit 'ca489564ae150bc41764f175b88151d883e69ae0'
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>
3 years agoMerge commit '79ae1e630b476889c251fc905687a3831b43ab5e'
Derek Buitenhuis [Sun, 22 Nov 2015 17:41:27 +0000 (17:41 +0000)]
Merge commit '79ae1e630b476889c251fc905687a3831b43ab5e'

* commit '79ae1e630b476889c251fc905687a3831b43ab5e':
  avcodec: Define side data type for fallback track

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoMerge commit '7f4ec4364bc4a73036660c1c6a3c4801db524e9e'
Derek Buitenhuis [Sun, 22 Nov 2015 17:19:10 +0000 (17:19 +0000)]
Merge commit '7f4ec4364bc4a73036660c1c6a3c4801db524e9e'

* commit '7f4ec4364bc4a73036660c1c6a3c4801db524e9e':
  avformat: expose av_stream_new_side_data helper

  Conflicts:
      libavformat/internal.h

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoMerge commit '21ab6fd01b9107d7171fc1a77c2bfacff845a97a'
Derek Buitenhuis [Sun, 22 Nov 2015 17:16:13 +0000 (17:16 +0000)]
Merge commit '21ab6fd01b9107d7171fc1a77c2bfacff845a97a'

* commit '21ab6fd01b9107d7171fc1a77c2bfacff845a97a':
  lavf: document that passing valid timestamps to muxers is now mandatory

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoMerge commit '5c30ae1a09b66179e16694f6137658023ed1fef3'
Derek Buitenhuis [Sun, 22 Nov 2015 17:15:21 +0000 (17:15 +0000)]
Merge commit '5c30ae1a09b66179e16694f6137658023ed1fef3'

* commit '5c30ae1a09b66179e16694f6137658023ed1fef3':
  dvdsubdec: Validate the RLE offsets

  Conflicts:
      libavcodec/dvdsubdec.c

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoMerge commit 'eda183287489b2c705843aa373a19c4e46fb2fec'
Derek Buitenhuis [Sun, 22 Nov 2015 17:12:24 +0000 (17:12 +0000)]
Merge commit 'eda183287489b2c705843aa373a19c4e46fb2fec'

* commit 'eda183287489b2c705843aa373a19c4e46fb2fec':
  travis: Enable OSX integration

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoMerge commit '79d89cf2f4b62eeb653fd8139041c87e75f7ca65'
Derek Buitenhuis [Sun, 22 Nov 2015 17:10:42 +0000 (17:10 +0000)]
Merge commit '79d89cf2f4b62eeb653fd8139041c87e75f7ca65'

* commit '79d89cf2f4b62eeb653fd8139041c87e75f7ca65':
  flacenc: Clamp user-supplied min/max prediction orders

  Conflicts:
      libavcodec/flacenc.c

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoMerge commit '4bb1070c154e49d35805fbcdac9c9e92f702ef96'
Derek Buitenhuis [Sun, 22 Nov 2015 16:55:56 +0000 (16:55 +0000)]
Merge commit '4bb1070c154e49d35805fbcdac9c9e92f702ef96'

* commit '4bb1070c154e49d35805fbcdac9c9e92f702ef96':
  ffv1: Explicitly name the coder type

  Conflicts:
      libavcodec/ffv1.h
      libavcodec/ffv1dec.c
      libavcodec/ffv1enc.c

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoMerge commit '9fd2bf09dbc630484d9e88a1d27f7e8508b70a2c'
Derek Buitenhuis [Sun, 22 Nov 2015 14:38:57 +0000 (14:38 +0000)]
Merge commit '9fd2bf09dbc630484d9e88a1d27f7e8508b70a2c'

These are all no-ops.

* commit '9fd2bf09dbc630484d9e88a1d27f7e8508b70a2c':
  hqx: correct type and size check of info_offset
  dds: disable palette flag for compressed images
  segafilm: Fix current_sample after seeking and avio_seek return type

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoMerge commit '62b4a6f1b9aa83d56701af226adda98faa5ede09'
Derek Buitenhuis [Sun, 22 Nov 2015 14:38:11 +0000 (14:38 +0000)]
Merge commit '62b4a6f1b9aa83d56701af226adda98faa5ede09'

* commit '62b4a6f1b9aa83d56701af226adda98faa5ede09':
  rtmpcrypt: Provide the xtea keys in little endian format for consistency

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoMerge commit '588b6215b4c74945994eb9636b0699028c069ed2'
Derek Buitenhuis [Sun, 22 Nov 2015 14:29:09 +0000 (14:29 +0000)]
Merge commit '588b6215b4c74945994eb9636b0699028c069ed2'

* commit '588b6215b4c74945994eb9636b0699028c069ed2':
  rtmpcrypt: Do the xtea decryption in little endian mode
  xtea: Add functions for little endian mode

  Conflicts:
      libavutil/xtea.c

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agolavc/opusdec: Fix a memleak when reading invalid files.
Carl Eugen Hoyos [Sun, 22 Nov 2015 00:49:18 +0000 (01:49 +0100)]
lavc/opusdec: Fix a memleak when reading invalid files.

Reviewed-by: James Almer
3 years agolavc/rscc: Fix colourspace for codec_tag RSCC.
Carl Eugen Hoyos [Sun, 22 Nov 2015 00:44:18 +0000 (01:44 +0100)]
lavc/rscc: Fix colourspace for codec_tag RSCC.

3 years agoavformat/vpk: check samples_per_block size
Paul B Mahol [Sat, 21 Nov 2015 20:58:24 +0000 (21:58 +0100)]
avformat/vpk: check samples_per_block size

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavformat: add FSB demuxer
Paul B Mahol [Mon, 19 Oct 2015 12:42:56 +0000 (14:42 +0200)]
avformat: add FSB demuxer

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavutil/eval: change sqrt to hypot
Ganesh Ajjanagadde [Sat, 14 Nov 2015 17:04:53 +0000 (12:04 -0500)]
avutil/eval: change sqrt to hypot

This improves the mathematical behavior of hypotenuse computation.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoconfigure+libm.h: add hypot emulation
Ganesh Ajjanagadde [Sat, 14 Nov 2015 16:57:28 +0000 (11:57 -0500)]
configure+libm.h: add hypot emulation

It is known that the naive sqrt(x*x + y*y) approach for computing the
hypotenuse suffers from overflow and accuracy issues, see e.g
http://www.johndcook.com/blog/2010/06/02/whats-so-hard-about-finding-a-hypotenuse/.
This adds hypot support to FFmpeg, a C99 function.

On platforms without hypot, this patch does a reaonable workaround, that
although not as accurate as GNU libm, is readable and does not suffer
from the overflow issue. Improvements can be made separately.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavutil/libm: correct isnan, isinf compat hacks
Ganesh Ajjanagadde [Sun, 15 Nov 2015 00:52:57 +0000 (19:52 -0500)]
avutil/libm: correct isnan, isinf compat hacks

isnan and isinf are actually macros as per the standard. In particular,
the existing implementation has incorrect signature. Furthermore, this
results in undefined behavior for e.g double values outside float range
as per the standard.

This patch corrects the undefined behavior for all usage within FFmpeg.

Note that long double is not handled as it is not used in FFmpeg.
Furthermore, even if at some point long double gets used, it is likely
not needed to modify the macro in practice for usage in FFmpeg. See
below for analysis.

Getting long double to work strictly per the spec is significantly harder
since a long double may be an IEEE 128 bit quad (very rare), 80 bit
extended precision value (on GCC/Clang), or simply double (on recent Microsoft).
On the other hand, any potential future usage of long double is likely
for precision (when a platform offers extra precision) and not for range, since
the range anyway varies and is not as portable as IEEE 754 single/double
precision. In such cases, the implicit cast to a double is well defined
and isinf and isnan should work as intended.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavcodec/amr: replace #define by typedef
Ganesh Ajjanagadde [Mon, 16 Nov 2015 22:01:18 +0000 (17:01 -0500)]
avcodec/amr: replace #define by typedef

See e.g https://stackoverflow.com/questions/1666353/are-typedef-and-define-the-same-in-c
for rationale.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavcodec/atrac1: fix decoder: QMF delay compensation should be 39 samples
Daniil Cherednik [Fri, 13 Nov 2015 22:57:25 +0000 (01:57 +0300)]
avcodec/atrac1: fix decoder: QMF delay compensation should be 39 samples

This also adds a new fate test

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/utils: Fix indentation
Timothy Gu [Sat, 21 Nov 2015 05:29:34 +0000 (21:29 -0800)]
avformat/utils: Fix indentation

3 years agoaacsbr: don't call sbr_dequant twice without intermediate read_sbr_data
Andreas Cadhalpun [Fri, 20 Nov 2015 19:15:21 +0000 (20:15 +0100)]
aacsbr: don't call sbr_dequant twice without intermediate read_sbr_data

Doing that doesn't make sense, because the only purpose of sbr_dequant
is to process the data from read_sbr_data.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
3 years agoavformat/rsd: implement seeking
Paul B Mahol [Fri, 20 Nov 2015 19:51:22 +0000 (20:51 +0100)]
avformat/rsd: implement seeking

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavformat/ffmdec: Only return EAGAIN if a server is attached
Michael Niedermayer [Fri, 20 Nov 2015 02:10:11 +0000 (03:10 +0100)]
avformat/ffmdec: Only return EAGAIN if a server is attached

This should fix a infinite loop

Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoffserver: Use AVOption API to access ffm demuxer instead of direct access depending...
Michael Niedermayer [Fri, 20 Nov 2015 02:09:28 +0000 (03:09 +0100)]
ffserver: Use AVOption API to access ffm demuxer instead of direct access depending on ABI

server_attached is newly added so the demuxer knows if there is an attached server
that can update the write index. This is needed to fix a infinite loop

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/ffmdec: Add cleaner API for ffserver to interface without depending on inter...
Michael Niedermayer [Fri, 20 Nov 2015 02:08:34 +0000 (03:08 +0100)]
avformat/ffmdec: Add cleaner API for ffserver to interface without depending on internal ABI

Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoffmpeg: fix -copy_prior_start 0 with -copyts and input -ss
Rodger Combs [Mon, 2 Nov 2015 02:04:25 +0000 (20:04 -0600)]
ffmpeg: fix -copy_prior_start 0 with -copyts and input -ss

Also rearranged the relevant check to reduce code duplication

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/flvenc: Add aac_seq_header_detect and flvflags
Maksym Veremeyenko [Wed, 18 Nov 2015 21:44:08 +0000 (23:44 +0200)]
avformat/flvenc: Add aac_seq_header_detect and flvflags

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoffmpeg: preserve profile for audio stream copy
Maksym Veremeyenko [Wed, 18 Nov 2015 21:44:08 +0000 (23:44 +0200)]
ffmpeg: preserve profile for audio stream copy

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/assdec: allow ASS files starting with empty lines
Clément Bœsch [Fri, 20 Nov 2015 13:38:22 +0000 (14:38 +0100)]
avformat/assdec: allow ASS files starting with empty lines

See https://github.com/mpv-player/mpv/issues/2506

3 years agoavfilter/af_dynaudnorm: use M_PI
Ganesh Ajjanagadde [Wed, 11 Nov 2015 03:26:25 +0000 (22:26 -0500)]
avfilter/af_dynaudnorm: use M_PI

The ad-hoc pi constant has a ludicrous number of digits that offer no
value whatsoever. M_PI is more consistent and readable across the
codebase.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agotests/tiny_ssim: replace #define by typedef
Ganesh Ajjanagadde [Mon, 16 Nov 2015 22:07:58 +0000 (17:07 -0500)]
tests/tiny_ssim: replace #define by typedef

See e.g https://stackoverflow.com/questions/1666353/are-typedef-and-define-the-same-in-c
for rationale.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>