]> git.sesse.net Git - ffmpeg/log
ffmpeg
7 years agoInterplay MVE: Refactor IP packet format
Hein-Pieter van Braam [Sun, 25 Jun 2017 19:59:01 +0000 (21:59 +0200)]
Interplay MVE: Refactor IP packet format

Interplay MVE can contain up to three different frame formats. They
require different streams of information to render a frame. This patch
changes the IP packet format to prepare for the extra frame formats.

Signed-off-by: Hein-Pieter van Braam <hp@tmm.cx>
7 years agoInterplay MVE: Implement MVE SEND_BUFFER operation
Hein-Pieter van Braam [Sun, 25 Jun 2017 19:59:00 +0000 (21:59 +0200)]
Interplay MVE: Implement MVE SEND_BUFFER operation

Interplay MVE movies have a SEND_BUFFER operation. Only after this
command does the current decoding buffer get displayed. This is required
for the other frame formats. They are fixed-size and can't always encode
a full frame worth of pixeldata.

This code prevents half-finished frames from being emitted.

Signed-off-by: Hein-Pieter van Braam <hp@tmm.cx>
7 years agoavcodec/proresenc_kostya: add 4444XQ profile
Paul B Mahol [Mon, 26 Jun 2017 14:30:43 +0000 (16:30 +0200)]
avcodec/proresenc_kostya: add 4444XQ profile

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/ffv1enc: compute the max number of slices and limit by that
Michael Niedermayer [Tue, 27 Jun 2017 11:09:58 +0000 (13:09 +0200)]
avcodec/ffv1enc: compute the max number of slices and limit by that

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavformat: Fix Pro-MPEG non-square matrix
Andreas Håkon [Fri, 13 Jan 2017 12:07:57 +0000 (13:07 +0100)]
avformat: Fix Pro-MPEG non-square matrix

Reviewed-by:vtarca@mobibase.com
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/ffv1enc: Allow less than 2 rows of slices for low vertical resolution
Michael Niedermayer [Mon, 26 Jun 2017 14:14:35 +0000 (16:14 +0200)]
avcodec/ffv1enc: Allow less than 2 rows of slices for low vertical resolution

Fixes: Ticket5548
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/utvideodec: add SIMD for restore_rgb_planes
Paul B Mahol [Mon, 26 Jun 2017 19:31:12 +0000 (21:31 +0200)]
avcodec/utvideodec: add SIMD for restore_rgb_planes

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/utvideodec: decode to GBR(A)P
Paul B Mahol [Mon, 26 Jun 2017 09:29:02 +0000 (11:29 +0200)]
avcodec/utvideodec: decode to GBR(A)P

This is actually internal utvideo format.
Allows to make use of SIMD for median prediction for rgb(a) formats,
thus speeding up decoding.
Simplifies code, eases further developement and maintenance.

Update FATE because of pixel format switch.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter: remove usage of empty header
Paul B Mahol [Sun, 25 Jun 2017 13:29:18 +0000 (15:29 +0200)]
avfilter: remove usage of empty header

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/g722enc: force mono channel layout
Kyle Swanson [Fri, 23 Jun 2017 21:33:07 +0000 (16:33 -0500)]
avcodec/g722enc: force mono channel layout

Signed-off-by: Kyle Swanson <k@ylo.ph>
7 years agoavcodec/jpeg2000dwt: Fix integer overflows in sr_1d97_int()
Michael Niedermayer [Mon, 26 Jun 2017 13:00:52 +0000 (15:00 +0200)]
avcodec/jpeg2000dwt: Fix integer overflows in sr_1d97_int()

Fixes: runtime error: signed integer overflow: 1157259380 + 1157259380 cannot be represented in type 'int'
Fixes: 2365/clusterfuzz-testcase-minimized-6020421927305216
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/jpeg2000dwt: Fix integer overflow in dwt_decode97_int()
Michael Niedermayer [Mon, 26 Jun 2017 13:05:08 +0000 (15:05 +0200)]
avcodec/jpeg2000dwt: Fix integer overflow in dwt_decode97_int()

Fixes: runtime error: signed integer overflow: -163654656 * 256 cannot be represented in type 'int'
Fixes: 2367/clusterfuzz-testcase-minimized-4648678897745920
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/ffv1enc: Try to choose slice count so that slice packet sizes are within...
Michael Niedermayer [Thu, 15 Jun 2017 18:46:32 +0000 (20:46 +0200)]
avcodec/ffv1enc: Try to choose slice count so that slice packet sizes are within the supported size

Fixes assertion failure

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/ffv1: Increase the maximum number of slices to 1024
Michael Niedermayer [Thu, 15 Jun 2017 18:26:14 +0000 (20:26 +0200)]
avcodec/ffv1: Increase the maximum number of slices to 1024

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agolavc/x86: clear r2 higher bits in ff_sbr_sum_square
Matthieu Bouron [Fri, 23 Jun 2017 14:32:31 +0000 (16:32 +0200)]
lavc/x86: clear r2 higher bits in ff_sbr_sum_square

Suggested-by: James Almer <jamrial@gmail.com>
7 years agoavcodec/proresenc_kostya: enable frame threading
Paul B Mahol [Mon, 26 Jun 2017 07:11:03 +0000 (09:11 +0200)]
avcodec/proresenc_kostya: enable frame threading

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/frame_thread_encoder: Fix AV_OPT_TYPE_STRING handling in priv_data
Michael Niedermayer [Sun, 25 Jun 2017 19:50:15 +0000 (21:50 +0200)]
avcodec/frame_thread_encoder: Fix AV_OPT_TYPE_STRING handling in priv_data

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/proresenc_kostya: use frame metadata instead of avctx
Paul B Mahol [Sun, 25 Jun 2017 22:01:07 +0000 (00:01 +0200)]
avcodec/proresenc_kostya: use frame metadata instead of avctx

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/prores_kostya: increase bits usage when alpha is used
Paul B Mahol [Sat, 24 Jun 2017 14:34:52 +0000 (16:34 +0200)]
avcodec/prores_kostya: increase bits usage when alpha is used

Also fix undefined left shift of negative variable.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter/vf_blend: add extremity blend mode
Paul B Mahol [Sun, 25 Jun 2017 14:39:10 +0000 (16:39 +0200)]
avfilter/vf_blend: add extremity blend mode

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter/vf_waveform: allow alpha output for >8 depth planar rgb inputs
Paul B Mahol [Sun, 25 Jun 2017 11:14:22 +0000 (13:14 +0200)]
avfilter/vf_waveform: allow alpha output for >8 depth planar rgb inputs

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter/vf_overlay: separate functions with main alpha
Paul B Mahol [Sun, 25 Jun 2017 10:07:50 +0000 (12:07 +0200)]
avfilter/vf_overlay: separate functions with main alpha

~5-15% faster overall with main input without alpha.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/hevcdec: Do not check the first ff_init_cabac_decoder() call in hls_decode_en...
Michael Niedermayer [Sun, 25 Jun 2017 02:25:56 +0000 (04:25 +0200)]
avcodec/hevcdec: Do not check the first ff_init_cabac_decoder() call in hls_decode_entry_wpp() for failure

The result of the call is not used in any testcase but breaks some cases if
its failure is considered.

Fixes regression found by jamrial

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/wavpack: Fix integer overflow in wv_unpack_stereo()
Michael Niedermayer [Sat, 24 Jun 2017 22:13:53 +0000 (00:13 +0200)]
avcodec/wavpack: Fix integer overflow in wv_unpack_stereo()

Fixes: runtime error: signed integer overflow: 2080374785 + 2080374784 cannot be represented in type 'int'
Fixes: 2351/clusterfuzz-testcase-minimized-5359403240783872
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/hevc_ps: Fix max_dec_buffer check
Michael Niedermayer [Sat, 24 Jun 2017 22:00:13 +0000 (00:00 +0200)]
avcodec/hevc_ps: Fix max_dec_buffer check

Fixes: runtime error: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int'
Fixes: 2339/clusterfuzz-testcase-minimized-6663164320022528
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavfilter/vf_lut2: add support for gray10 and gray12 pixel formats
Paul B Mahol [Sat, 24 Jun 2017 20:40:32 +0000 (22:40 +0200)]
avfilter/vf_lut2: add support for gray10 and gray12 pixel formats

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/adpcm_data: use uint16_t to handle all values
Paul B Mahol [Sat, 24 Jun 2017 20:27:10 +0000 (22:27 +0200)]
avcodec/adpcm_data: use uint16_t to handle all values

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agolavc/tests/golomb: Add unit test for set_ue_golomb_long.
Jun Zhao [Wed, 14 Jun 2017 02:42:36 +0000 (10:42 +0800)]
lavc/tests/golomb: Add unit test for set_ue_golomb_long.

Add unit test for set_ue_golomb_long.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agolavc/golobm: Add set_ue_golomb_long to support up to 2^32 -2.
Jun Zhao [Wed, 14 Jun 2017 02:35:20 +0000 (10:35 +0800)]
lavc/golobm: Add set_ue_golomb_long to support up to 2^32 -2.

add set_ue_golomb_long to support up to 2^32-2.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agolavc/put_bits: Add put_bits64() to support up to 64 bits.
Jun Zhao [Wed, 14 Jun 2017 02:22:10 +0000 (10:22 +0800)]
lavc/put_bits: Add put_bits64() to support up to 64 bits.

put_bits64() can write up to 64 bits into a bitstream.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/hevcdec: Use error path if init_get_bits8() fails
Michael Niedermayer [Sat, 24 Jun 2017 12:46:18 +0000 (14:46 +0200)]
avcodec/hevcdec: Use error path if init_get_bits8() fails

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/hevcdec: check ff_init_cabac_decoder() for failure
Michael Niedermayer [Sat, 24 Jun 2017 12:46:17 +0000 (14:46 +0200)]
avcodec/hevcdec: check ff_init_cabac_decoder() for failure

Fixes: runtime error: left shift of 1965559808 by 4 places cannot be represented in type 'int'
Fixes: 2333/clusterfuzz-testcase-minimized-5223935677300736
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavfilter/vf_overlay: remove rgb option
Paul B Mahol [Sat, 24 Jun 2017 08:30:43 +0000 (10:30 +0200)]
avfilter/vf_overlay: remove rgb option

Its been deprecated for over 3 years.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter/af_headphone: do not free frame that's gonna be reused later
Paul B Mahol [Sat, 24 Jun 2017 16:47:04 +0000 (18:47 +0200)]
avfilter/af_headphone: do not free frame that's gonna be reused later

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter: do not leak AVFrame on failed buffer allocation
Paul B Mahol [Sat, 24 Jun 2017 16:36:46 +0000 (18:36 +0200)]
avfilter: do not leak AVFrame on failed buffer allocation

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavformat/file: increase min/max packet size to 256k for written files
Marton Balint [Sun, 4 Jun 2017 02:25:43 +0000 (04:25 +0200)]
avformat/file: increase min/max packet size to 256k for written files

Buffering more than one packet can be a huge performance improvement for
encoding files with small packets (e.g. wav) over SMB/CIFS.

Acked-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
7 years agoavformat: make flush_packets a tri-state and set it to -1 (auto) by default
Marton Balint [Sun, 4 Jun 2017 02:19:33 +0000 (04:19 +0200)]
avformat: make flush_packets a tri-state and set it to -1 (auto) by default

If flushing is not disabled, then mux.c will signal the end of the packets with
an AVIO_DATA_MARKER_FLUSH_POINT, and aviobuf will be able to decide to flush or
not based on the preferred minimum packet size set by the used protocol.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
7 years agoavformat/aviobuf: add support for specifying minimum packet size and marking flush...
Marton Balint [Sun, 18 Jun 2017 12:38:39 +0000 (14:38 +0200)]
avformat/aviobuf: add support for specifying minimum packet size and marking flush points

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
7 years agoavformat/aviobuf: fix flushing write buffers after seeking backward or forward
Marton Balint [Sat, 3 Jun 2017 23:15:50 +0000 (01:15 +0200)]
avformat/aviobuf: fix flushing write buffers after seeking backward or forward

This patch makes aviobuf work more like traditinal file IO, which is how people
think about it.

For example, in the past, aviobuf only flushed buffers until the current buffer
position, even if more data was written to it previously, and a backward seek
was used to reposition the IO context.

From now, aviobuf will keep track of the written data, so no explicit seek will
be required till the end of the buffer, or till the end of file before flushing.

This fixes at least one regression, fate-vsynth3-flv was broken if
flush_packets option was set to false, an explicit seek was removed in
4e3cc4bdd8acedbcc703607ed0efbb64bb5c3cc4.

Also from now on, if a forward seek in the write buffer were to cause a gap
between the already written data and the new file position, a flush will
happen.

The must_flush varable is also removed, which might have caused needless
flushes with multiple seeks whithin the write buffer. Since we know the amount
of data written to it, we will know when to flush.

Signed-off-by: Marton Balint <cus@passwd.hu>
7 years agodoc: Add VAAPI encoders
Mark Thompson [Sun, 19 Mar 2017 17:30:52 +0000 (17:30 +0000)]
doc: Add VAAPI encoders

(cherry picked from commit 41dda860870fb1566b17f6b0b61922f0ef89be47)

7 years agovaapi_encode: Add VP9 support
Mark Thompson [Mon, 28 Nov 2016 23:54:57 +0000 (23:54 +0000)]
vaapi_encode: Add VP9 support

(cherry picked from commit 0fd91e4bfc00a6609b59d1ce3a9f152184e62601)

7 years agovp9: Add bsf to fix reordering in raw streams
Mark Thompson [Mon, 9 Jan 2017 23:08:49 +0000 (23:08 +0000)]
vp9: Add bsf to fix reordering in raw streams

Takes a raw input stream containing frames with correct timestamps but
possibly out of order and inserts additional show-existing-frame
packets to correct the ordering.

(cherry picked from commit 34e051d16850701694410a0e72e0e4ff3a5ec293)
(cherry picked from commit b43b95f4789b6e60f9684918fd3c0a5f3f18aef6)

Also converted from bitstream to get_bits.

7 years agoffmpeg: Flush output BSFs when encode reaches EOF
Mark Thompson [Tue, 14 Mar 2017 00:39:57 +0000 (00:39 +0000)]
ffmpeg: Flush output BSFs when encode reaches EOF

Before this, output bitstream filters would never see EOF and
therefore would not be able to flush any delayed packets.

(cherry picked from commit f64d1100a54d12c78ce436181bb64229c56da6b3)

7 years agoavcodec/mpeg4videodec: Fix GMC with videos of dimension 1
Michael Niedermayer [Sat, 24 Jun 2017 11:45:35 +0000 (13:45 +0200)]
avcodec/mpeg4videodec: Fix GMC with videos of dimension 1

Fixes: runtime error: shift exponent -1 is negative
Fixes: 2338/clusterfuzz-testcase-minimized-5153426541379584
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agovf_spp: only assign function pointers if permutation matches expectations.
Ronald S. Bultje [Fri, 23 Jun 2017 15:01:38 +0000 (11:01 -0400)]
vf_spp: only assign function pointers if permutation matches expectations.

7 years agoavfilter/vf_overlay: add auto format mode
Paul B Mahol [Sat, 24 Jun 2017 08:18:30 +0000 (10:18 +0200)]
avfilter/vf_overlay: add auto format mode

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agofate: update checksums for fate-lavf-ffm and fate-lavf-mxf
James Almer [Sat, 24 Jun 2017 04:52:09 +0000 (01:52 -0300)]
fate: update checksums for fate-lavf-ffm and fate-lavf-mxf

<@jamrial> durandal_1707: 04aa09c4bc broke fate-lavf-ffm and fate-lavf-mxf
<@durandal_1707> how so?
<@jamrial> one byte changes
<@durandal_1707> jamrial: just update checksums
<@jamrial> durandal_1707: but why did they change at all? the commit you reverted didn't affect them
<@jamrial> why does reverting it affect these tests?
<@jamrial> i don't think updating the checksum without knowing what changed is a good idea
<@durandal_1707> jamrial: the lavfi core is in weird state after removal of recursive code
<@durandal_1707> jamrial: the change is that older ones would get progressive flag set and new one doesnt
<@jamrial> alright

7 years agox86/mdct15: use three operand form for some instructions
James Almer [Sat, 24 Jun 2017 04:44:49 +0000 (01:44 -0300)]
x86/mdct15: use three operand form for some instructions

Fixes compilation with old yasm

7 years agoAdd support for LibOpenJPEG v2.2/git
Reino17 [Fri, 23 Jun 2017 21:49:31 +0000 (23:49 +0200)]
Add support for LibOpenJPEG v2.2/git

Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
7 years agocheckasm: add missing checks to float_dsp's butterflies_float test
James Almer [Sat, 24 Jun 2017 02:38:07 +0000 (23:38 -0300)]
checkasm: add missing checks to float_dsp's butterflies_float test

7 years agomdct15: add assembly optimizations for the 15-point FFT
Rostislav Pehlivanov [Sun, 18 Jun 2017 11:06:30 +0000 (12:06 +0100)]
mdct15: add assembly optimizations for the 15-point FFT

c:    1802 decicycles in fft15,16774635 runs,   2581 skips
avx:   865 decicycles in fft15,16776378 runs,    838 skips

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
7 years agoconfigure: fix assignment of assembler specific flags
James Almer [Fri, 23 Jun 2017 14:32:52 +0000 (11:32 -0300)]
configure: fix assignment of assembler specific flags

If the first assembler to be probed is an old nasm build, X86ASM_DEPFLAGS
will be set and remain so after yasm is ultimately used as fallback.
This results in yasm being called with said nasm specific flags and failing
during actual object assembly but not with configure sanity checks.

Regression since 5cae5a1defa360da076365a786093a749d1ddf4e

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
7 years agoRevert "lavfi/buffersrc: push the frame deeper if requested."
Paul B Mahol [Fri, 23 Jun 2017 14:18:42 +0000 (16:18 +0200)]
Revert "lavfi/buffersrc: push the frame deeper if requested."

Fixes framesync filters with shortest option enabled.

This reverts commit 0ff5567a30be6d7c804e95997ae282d6bacd76c3.

7 years agolavc/videotoolboxenc: fix open videotoolbox bug on iOS8.4
jerett [Fri, 23 Jun 2017 12:58:35 +0000 (08:58 -0400)]
lavc/videotoolboxenc: fix open videotoolbox bug on iOS8.4

Checks for NULL before using object.

Signed-off-by: Rick Kern <kernrj@gmail.com>
7 years agolavc/videotoolboxenc: fix loadVTEncSymbols crash when symbol not found
jerett [Fri, 23 Jun 2017 12:57:18 +0000 (08:57 -0400)]
lavc/videotoolboxenc: fix loadVTEncSymbols crash when symbol not found

Signed-off-by: Rick Kern <kernrj@gmail.com>
7 years agolavc/golomb: add value range comment for set_ue_golomb().
Jun Zhao [Wed, 14 Jun 2017 02:08:58 +0000 (10:08 +0800)]
lavc/golomb: add value range comment for set_ue_golomb().

set_ue_golomb just support 2^16 - 2 at most, becase this function call
put_bits, and put_bits just support write up to 31 bits, when write 32
bit in put_bits, it's will overwrite the bit buffer, and the default
assert level is 0, the av_assert2(n <= 31 && value < (1U << n)) in
put_bits can not be trigger runtime.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/wavpack: Fix integer overflow
Michael Niedermayer [Thu, 22 Jun 2017 23:58:48 +0000 (01:58 +0200)]
avcodec/wavpack: Fix integer overflow

Fixes: runtime error: signed integer overflow: 227511904 + 1964113935 cannot be represented in type 'int'
Fixes: 2331/clusterfuzz-testcase-minimized-6182185830711296
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/takdec: Fix integer overflow
Michael Niedermayer [Thu, 22 Jun 2017 19:21:56 +0000 (21:21 +0200)]
avcodec/takdec: Fix integer overflow

Fixes: runtime error: signed integer overflow: 512 + 2147483146 cannot be represented in type 'int'
Fixes: 2314/clusterfuzz-testcase-minimized-4519333877252096
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/tiff: Update pointer only when the result is used
Michael Niedermayer [Thu, 22 Jun 2017 18:21:05 +0000 (20:21 +0200)]
avcodec/tiff: Update pointer only when the result is used

Fixes: runtime error: signed integer overflow: 538976288 * 32 cannot be represented in type 'int'
Fixes: 2310/clusterfuzz-testcase-minimized-4534784887881728
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoopus_celt: do not use double precision exp2
Rostislav Pehlivanov [Thu, 22 Jun 2017 21:37:53 +0000 (22:37 +0100)]
opus_celt: do not use double precision exp2

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
7 years agoavformat/oggenc: check for stream private data in ogg_free()
James Almer [Thu, 22 Jun 2017 18:51:28 +0000 (15:51 -0300)]
avformat/oggenc: check for stream private data in ogg_free()

Fixes a NULL pointer derefence when ogg_init() returns a failure and
a stream's private data was not yet allocated.

This is a regression since 3c5a53cdfa099bba8bd951f95b85727b4b3b5d68

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
7 years agocheckasm/aarch64: fix tests returning a float
Matthieu Bouron [Mon, 19 Jun 2017 08:55:28 +0000 (10:55 +0200)]
checkasm/aarch64: fix tests returning a float

Avoids overriding the v0 register (which containins the result of the
tested function) in checkasm_call_checked.

7 years agoavcodec/cfhd: Check bpc before setting bpc in context
Michael Niedermayer [Wed, 21 Jun 2017 17:34:31 +0000 (19:34 +0200)]
avcodec/cfhd: Check bpc before setting bpc in context

Fixes: runtime error: shift exponent 32 is too large for 32-bit type 'int'
Fixes: 2306/clusterfuzz-testcase-minimized-5002997392211968
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/cfhd: Fix undefined shift
Michael Niedermayer [Wed, 21 Jun 2017 15:56:34 +0000 (17:56 +0200)]
avcodec/cfhd: Fix undefined shift

Fixes: runtime error: left shift of negative value -1
Fixes: 2303/clusterfuzz-testcase-minimized-5529675273076736
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoconfigure: Move x86 assembler sanity check into assembler probe function
Diego Biurrun [Mon, 22 May 2017 12:48:15 +0000 (12:48 +0000)]
configure: Move x86 assembler sanity check into assembler probe function

This allows for more graceful fallback from NASM to Yasm if the available
NASM version is too old.

(Cherry-picked from libav commit adfd7892e3b8b40e7a1620f7254459d8e096a9a1)
Signed-off-by: James Almer <jamrial@gmail.com>
7 years agobuild: Prefer NASM assembler over YASM
Diego Biurrun [Thu, 13 Oct 2016 18:33:15 +0000 (18:33 +0000)]
build: Prefer NASM assembler over YASM

NASM is more actively maintained and permits generating dependency information
as a sideeffect of assembling, thus cutting build times in half.

(Cherry-picked from libav commit 57b753b445e23363c997a8ec1c556e0b0f6e9da3)

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agobuild: fix commandline selection of nasm
James Almer [Tue, 20 Jun 2017 22:14:32 +0000 (19:14 -0300)]
build: fix commandline selection of nasm

"nasm --version" works on nasm since around version 2.11 and as
such configure assumed it was yasm.

Based on libav commit f54037da8af2f2aeb5e5633b48434211e6a97fe5 by
Diego Biurrun.

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agobuild: Explicitly set 32-bit/64-bit object formats for nasm/yasm
Diego Biurrun [Wed, 1 Mar 2017 18:42:21 +0000 (18:42 +0000)]
build: Explicitly set 32-bit/64-bit object formats for nasm/yasm

Consistently use object format names with "32" suffix and set object format
to "win64" on Windows x86_64, which fixes assembling with nasm.

(Cherry-picked from libav commit 808ef43597b1e3d6e69a5b9abe2237c8ddb97b44)

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agobuild: Allow generating dependencies as a side-effect of assembling
Diego Biurrun [Thu, 13 Oct 2016 00:45:09 +0000 (00:45 +0000)]
build: Allow generating dependencies as a side-effect of assembling

(Cherry-picked from libav commit 3c0efbd03349ae68d3a25a082222652a102e3fd4)

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agobuild: Generalize yasm/nasm-related variable names
Diego Biurrun [Sat, 8 Oct 2016 14:18:33 +0000 (14:18 +0000)]
build: Generalize yasm/nasm-related variable names

None of them are specific to the YASM assembler.

(Cherry-picked from libav commit 39e208f4d4756367c7cd2d581847e0c1b8a429c1)

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agoavfilter/af_stereotools: add forgotten break
Paul B Mahol [Wed, 21 Jun 2017 17:20:25 +0000 (19:20 +0200)]
avfilter/af_stereotools: add forgotten break

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agomdec: stop preferring the simple IDCT.
Ronald S. Bultje [Wed, 21 Jun 2017 13:01:20 +0000 (09:01 -0400)]
mdec: stop preferring the simple IDCT.

This was added in e3e3c82555e2382125195c1ba9f34b5a43299abc, probably
as a workaround for the fact that the quant table was not permutated
and the IDCT coefficients are, meaning that you'd only get correct
reconstruction if the IDCT permutation was an identity matrix, which
happens to be the case when you use the simple IDCT. The quant table
permutation bug was fixed in 42dd1434bf6a7230e4175c08fcfabc3ba51a0463,
meaning this workaround is no longer necessary.

In practical terms, before 42dd1434bf6a7230e4175c08fcfabc3ba51a0463,
the PSNR between decodes of the fate-mdec using simple (C) or simplemmx
IDCTs was 35. After 42dd1434bf6a7230e4175c08fcfabc3ba51a0463, it's 90.

7 years agomdec: use correctly permutated quant matrix for dequantization.
Ronald S. Bultje [Wed, 21 Jun 2017 12:53:43 +0000 (08:53 -0400)]
mdec: use correctly permutated quant matrix for dequantization.

7 years agoaarch64: vp9 16bpp: Fix assembling with Xcode 6.2 and older
Memphiz [Sun, 18 Jun 2017 10:29:38 +0000 (12:29 +0200)]
aarch64: vp9 16bpp: Fix assembling with Xcode 6.2 and older

Properly use the b.eq form instead of the nonstandard form (which
both gas and newer clang accept though), and expand the register
lists that used a range (which the Xcode 6.2 clang, based on clang
3.5 svn, didn't support).

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9: Fix assembling with Xcode 6.2 and older
Memphiz [Sun, 18 Jun 2017 10:30:16 +0000 (12:30 +0200)]
aarch64: vp9: Fix assembling with Xcode 6.2 and older

Properly use the b.eq/b.ge forms instead of the nonstandard forms
(which both gas and newer clang accept though), and expand the
register list that used a range (which the Xcode 6.2 clang, based
on clang 3.5 svn, didn't support).

This is cherrypicked from libav commit
a970f9de865c84ed5360dd0398baee7d48d04620.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoavcodec/mpegvideo: Use intra_scantable in dct_unquantize_h263_intra_c()
Michael Niedermayer [Mon, 19 Jun 2017 22:37:40 +0000 (00:37 +0200)]
avcodec/mpegvideo: Use intra_scantable in dct_unquantize_h263_intra_c()

Reviewed-by: James Darnley <jdarnley@obe.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/hevc_filter: Fix invalid shift
Michael Niedermayer [Tue, 20 Jun 2017 12:38:34 +0000 (14:38 +0200)]
avcodec/hevc_filter: Fix invalid shift

Fixes: runtime error: left shift of negative value -1
Fixes: 2299/clusterfuzz-testcase-minimized-4843509351710720
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/hevcdec: Check beta and tc offset in hls_slice_header()
Michael Niedermayer [Tue, 20 Jun 2017 12:32:50 +0000 (14:32 +0200)]
avcodec/hevcdec: Check beta and tc offset in hls_slice_header()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/mpeg4videodec: Fix overflow in virtual_ref computation
Michael Niedermayer [Tue, 20 Jun 2017 11:52:06 +0000 (13:52 +0200)]
avcodec/mpeg4videodec: Fix overflow in virtual_ref computation

Fixes: runtime error: signed integer overflow: 262144 * -16120 cannot be represented in type 'int'
Fixes: 2292/clusterfuzz-testcase-minimized-6156080415506432
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/lpc: signed integer overflow in compute_lpc_coefs() (aacdec_fixed)
Michael Niedermayer [Wed, 14 Jun 2017 23:35:49 +0000 (01:35 +0200)]
avcodec/lpc: signed integer overflow in compute_lpc_coefs() (aacdec_fixed)

Fixes: runtime error: signed integer overflow: -1575818955 + -915383657 cannot be represented in type 'int'
Fixes: 2224/clusterfuzz-testcase-minimized-6208559949807616
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoconfigure: Move up the avbuild directory creation
Luca Barbato [Fri, 10 Feb 2017 19:31:34 +0000 (19:31 +0000)]
configure: Move up the avbuild directory creation

The early check for inconsistent in-source vs out-of-source build
cannot generate a config.log otherwise.

(Cherry-picked from libav commit 0ee78020cd41d81eec651acd7fc65906207796f3)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: James Almer <jamrial@gmail.com>
7 years agoavcodec/decode: Update decode_simple_internal() to get the side data correctly.
John Rummell [Wed, 14 Jun 2017 21:43:04 +0000 (14:43 -0700)]
avcodec/decode: Update decode_simple_internal() to get the side data correctly.

Use avci->last_pkt_props to get the side data. Using |pkt| doesn't work
when FF_API_MERGE_SD is set, as the compressed side data is expanded into
|tmp|, leaving the original |pkt| unchanged.

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agoavcodec/x86: allow future 8-bit simple idct to use slightly different coefficients
James Darnley [Mon, 12 Jun 2017 11:32:57 +0000 (12:32 +0100)]
avcodec/x86: allow future 8-bit simple idct to use slightly different coefficients

7 years agoavcodec/mdec: override IDCT choice before initing DSP structs
James Darnley [Sat, 17 Jun 2017 01:13:36 +0000 (03:13 +0200)]
avcodec/mdec: override IDCT choice before initing DSP structs

7 years agoavcodec/x86: modify simple_idct10 macros to add an action paramter
James Darnley [Mon, 12 Jun 2017 10:01:21 +0000 (12:01 +0200)]
avcodec/x86: modify simple_idct10 macros to add an action paramter

7 years agoavcodec/x86: cleanup simple_idct10
James Darnley [Thu, 1 Jun 2017 13:28:29 +0000 (15:28 +0200)]
avcodec/x86: cleanup simple_idct10

Use named arguments for the functions so we can remove a define.  The
stride/linesize argument is now ptrdiff_t type so we no longer need to
sign extend the register.

7 years agoavcodec/x86/mpegenc: support transpose permuation type
James Darnley [Fri, 16 Jun 2017 13:36:16 +0000 (15:36 +0200)]
avcodec/x86/mpegenc: support transpose permuation type

7 years agoavcodec/x86/mpegenc: check IDCT permutation type is a valid value
James Darnley [Fri, 16 Jun 2017 12:53:15 +0000 (14:53 +0200)]
avcodec/x86/mpegenc: check IDCT permutation type is a valid value

7 years agobuild: Add missing idctdsp dependency for clearvideo
Diego Biurrun [Wed, 7 Jun 2017 10:48:00 +0000 (12:48 +0200)]
build: Add missing idctdsp dependency for clearvideo

(cherry picked from commit 2f792cb6703b5b12f2e873bee13f33da8aa9940a)

7 years agoffmpeg: remove misleading and incorrect warning messages
wm4 [Thu, 15 Jun 2017 16:52:14 +0000 (18:52 +0200)]
ffmpeg: remove misleading and incorrect warning messages

It is wrong/incorrect in two aspects:
1. The pixel format is not enough to guarantee that the resulting file
   will be any more compatible with media players.
2. Media players not supporting higher profiles are not necessarily
   outdated (in fact this is simply an arrogant statement that
   libavcodec can handle these particular features).

You could add that there are plenty of other ways to produce widely
incompatible files with ffmpeg, and these don't show any warnings.

What we really want to do here is defaulting to codec profiles that
have wide compatibility, such as main/high for h264. Also, if an
encoder does not accept certain pixfmts, we should automatically
convert them to a pixfmt the encoder can accept. But the existing
message certainly is not appropriate.

It also works for 2 specific encoders only. Extending it for other
cases would result in a lot of special cases, so this is not the
right place.

7 years agoavcodec/x86/mpegvideo: Use intra scantable in dct_unquantize_h263_intra_mmx()
Michael Niedermayer [Mon, 19 Jun 2017 21:47:13 +0000 (23:47 +0200)]
avcodec/x86/mpegvideo: Use intra scantable in dct_unquantize_h263_intra_mmx()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/h264: Fix mix of lossless and lossy MBs decoding
Anton Mitrofanov [Wed, 14 Jun 2017 00:01:56 +0000 (03:01 +0300)]
avcodec/h264: Fix mix of lossless and lossy MBs decoding

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
7 years agoavcodec/h264_mb: Fix 8x8dct in lossless for new versions of x264
Anton Mitrofanov [Tue, 13 Jun 2017 20:37:29 +0000 (23:37 +0300)]
avcodec/h264_mb: Fix 8x8dct in lossless for new versions of x264

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
7 years agoavcodec/h264_cabac: Fix CABAC+8x8dct in 4:4:4
Anton Mitrofanov [Tue, 30 May 2017 23:37:41 +0000 (02:37 +0300)]
avcodec/h264_cabac: Fix CABAC+8x8dct in 4:4:4

Use the correct ctxIdxInc calculation for coded_block_flag.
Keep old behavior for old versions of x264 for backward compatibility.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
7 years agolibavfilter/scale: Populate ow/oh when using 0 as w/h
Kevin Mark [Wed, 14 Jun 2017 05:03:18 +0000 (01:03 -0400)]
libavfilter/scale: Populate ow/oh when using 0 as w/h

The input width and height is known at parse time so there's no
reason ow/oh should not be usable when using 0 as the width or
height expression.

Previously in "scale=0:ow" ow would be set to "0" which works,
conveniently, as "scale=0:0" is perfectly valid input but this breaks
down when you do something like "scale=0:ow/4" which one could
reasonably expect to work as well, but does not as ow is 0 not the
real value.

This change handles the 0 case for w/h immediately so the ow/oh
variables work as expected. Consequently, the rest of the code does
not need to handle 0 input. w/h will always be > 0 or < 0.

The second explicit (int) cast ensures that ow/oh appear as integers
as a user might expect when dealing with pixel dimensions.

Signed-off-by: Kevin Mark <kmark937@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
7 years agodoc/filters: Correct scale doc regarding w/h <= 0
Kevin Mark [Mon, 12 Jun 2017 05:59:05 +0000 (01:59 -0400)]
doc/filters: Correct scale doc regarding w/h <= 0

According to libavfilter/scale.c, if the width and height are both
less than or equal to 0 then the input size is used for both
dimensions. It does not need to be -1. -1:-1 is the same as 0:0 which
is the same as -10:-42, etc.

if (w < 0 && h < 0)
    eval_w = eval_h = 0;

The documentation for the zscale filter has also been updated since the
behavior is identical.

Signed-off-by: Kevin Mark <kmark937@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
7 years agodoc/filters: fix typo
Paul B Mahol [Mon, 19 Jun 2017 17:28:43 +0000 (19:28 +0200)]
doc/filters: fix typo

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter/af_stereotools: add 2 more modes
Paul B Mahol [Mon, 19 Jun 2017 16:59:33 +0000 (18:59 +0200)]
avfilter/af_stereotools: add 2 more modes

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter/af_superequalizer: stop leaking s->out frame
Paul B Mahol [Mon, 19 Jun 2017 16:34:04 +0000 (18:34 +0200)]
avfilter/af_superequalizer: stop leaking s->out frame

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter/af_superequalizer: improve description
Paul B Mahol [Mon, 19 Jun 2017 16:15:51 +0000 (18:15 +0200)]
avfilter/af_superequalizer: improve description

Signed-off-by: Paul B Mahol <onemda@gmail.com>