Commit Graph

20466 Commits

Author SHA1 Message Date
Andreas Cadhalpun
fa463aa83a avpacket: fix size check in packet_alloc
The previous check only caught sizes from -AV_INPUT_BUFFER_PADDING_SIZE
to -1.

This fixes ubsan runtime error: signed integer overflow: 2147483647 + 32
cannot be represented in type 'int'

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-07 08:20:21 +01:00
Anton Khirnov
d1cd20e4e3 qsvenc: split encoding frames and reading from the async FIFO
This makes sure all the frames are returned at the end.

Found-By: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
2016-01-07 08:20:21 +01:00
Maxym Dmytrychenko
a6259a6ecb qsvenc: properly handle the warning from MFXVideoCORE_SyncOperation
Same as what is done in 3b6473b43e.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-07 08:20:21 +01:00
Diego Biurrun
2080bea4a7 h264_refs: Remove broken trace debug code 2016-01-03 22:49:56 +01:00
Diego Biurrun
58170b0271 lavc: Add missing #includes for ff_dlog() 2016-01-03 22:49:55 +01:00
Maxym Dmytrychenko
3b6473b43e qsvdec: properly handle the warning from MFXVideoCORE_SyncOperation
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-01 16:09:14 +01:00
Maxym Dmytrychenko
a43905f4ae qsvenc_hevc: improve the default settings
Use 8 B-frames and modify the GOP size to be a multiple of the B-frame
count.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-01 16:09:14 +01:00
Anton Khirnov
9d74012761 h264: improve behaviour with invalid reference lists
Before 741b494fa8, when the reference list
modification description was invalid, the code would substitute the
corresponding reference from the initial ("default") reference list.
After that commit, it will just return an error.

Since there are apparently invalid samples in the wild that used to play
fine with the old code, it is a good idea to re-add some sort of error
resilience here. So, when the reference list modification results in a
missing frame, substitute a previous reference frame for it. The
relevant sample again decodes fine with the same output as previously.
2016-01-01 16:09:14 +01:00
Alexandra Hájková
40d9496773 dca: use defines for subband related constants
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2015-12-31 11:40:32 +01:00
Janne Grunau
8563f98871 x86: use emms after ff_int32_to_float_fmul_scalar_sse
Intel's Instruction Set Reference (as of September 2015) clearly states
that cvtpi2ps switches to MMX state. Actual CPUs do not switch if the
source is a memory location. The Instruction Set Reference from 1999
(Order Number 243191) describes this behaviour but all later versions
I've seen have make no distinction whether MMX registers or memory is
used as source.
The documentation for the matching SSE2 instruction to convert to double
(cvtpi2pd) was fixed (see the valgrind bug
https://bugs.kde.org/show_bug.cgi?id=210264).

It will take time to get a clarification and fixes in place. In the
meantime it makes sense to change ff_int32_to_float_fmul_scalar_sse to
be correct according to the documentation. The vast majority of users
will have SSE2 so a change to the SSE version has little effect.

Fixes fate-checkasm on x86 valgrind targets.

Valgrind 'bug' reported as https://bugs.kde.org/show_bug.cgi?id=357059
2015-12-30 13:37:57 +01:00
Janne Grunau
f4f27e4cf1 x86: zero extend the 32-bit length in int32_to_float_fmul_scalar implicitly
This reverts commit 5dfe4edad6.
2015-12-29 11:42:51 +01:00
Diego Biurrun
69a68593ce Remove stray line breaks from avpriv_{report_missing_feature|request_samples} 2015-12-26 10:28:03 +01:00
Alexandra Hájková
2008f76054 dca: remove unused decode_hf function and quant_d tables
They were superseded with their integer equivalents. Rename integer
decode_hf to decode_hf.
2015-12-24 13:58:18 +01:00
Alexandra Hájková
aebf07075f dca: change the core to work with integer coefficients.
The DCA core decoder converts integer coefficients read from the
bitstream to floats just after reading them (along with dequantization).
All the other steps of the audio reconstruction are done with floats
which makes the output for the DTS lossless extension (XLL)
actually lossy.
This patch changes the DCA core to work with integer coefficients
until QMF. At this point the integer coefficients are converted to floats.
The coefficients for the LFE channel (lfe_data) are not touched.
This is the first step for the really lossless XLL decoding.
2015-12-23 11:50:18 +01:00
Alexandra Hájková
85990140e7 dca: Add math helpers.
They will be used by the integer core decoder.
2015-12-23 11:50:08 +01:00
Janne Grunau
cc29d96d5a arm64: fix inverted register order in transpose_4x4H
Fix related register order issue in ff_h264_idct_add_neon.

Found-by: zjh8890 <243186085@qq.com>
2015-12-21 13:44:20 +01:00
Andreas Cadhalpun
5ea59b1f42 exr: fix out of bounds read in get_code
This macro unconditionally used out[-1], which causes an out of bounds
read, if out is the very beginning of the buffer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-12-16 22:22:06 +01:00
Andreas Cadhalpun
17776638c3 opus: Fix typo causing overflow in silk_stabilize_lsf
Due to this typo max_center can be too large, causing nlsf to be set to
too large values, which in turn can cause nlsf[i - 1] + min_delta[i] to
overflow to a negative value, which is not allowed for nlsf and can
cause an out of bounds read in silk_lsf2lpc.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-12-16 22:19:58 +01:00
Janne Grunau
90b1b9350c arm: add ff_int32_to_float_fmul_array8_neon
Quite a bit faster than int32_to_float_fmul_array8_c calling
ff_int32_to_float_fmul_scalar_neon through FmtConvertContext.
Number of cycles per int32_to_float_fmul_array8 call while decoding
padded.dts on exynos5422:

               before  after   change
cortex-a7:     1270     951    -25%
cortex-a15:     434     285    -34%

checkasm --bench cycle counts:     cortex-a15   cortex-a7
int32_to_float_fmul_array8_c:      1730.4       4384.5
int32_to_float_fmul_array8_neon_c:  571.5       1694.3
int32_to_float_fmul_array8_neon:    374.0       1448.8

Interesting are the differences between
int32_to_float_fmul_array8_neon_c and int32_to_float_fmul_array8_neon.
The former is current behaviour of calling
ff_int32_to_float_fmul_scalar_neon repeatedly from the c function,
The raw numbers differ since checkasm uses different lengths than the
dca decoder.
2015-12-14 16:45:02 +01:00
Janne Grunau
a0fc780a20 arm64: int32_to_float_fmul neon asm
3% faster dts decoding on a cortex-a57.

                                 cortex-a57   cortex-a53
int32_to_float_fmul_array8_c:    1270.9       4475.6
int32_to_float_fmul_array8_neon:  328.6        569.2
int32_to_float_fmul_scalar_c:     928.5       4119.6
int32_to_float_fmul_scalar_neon:  309.1        524.1
2015-12-14 16:45:02 +01:00
Janne Grunau
705f5e5e15 arm64: port synth_filter_float_neon from arm
~25% faster dts decoding overall. The checkasm CPU cycles numbers are
not that useful since synth_filter_float() calls FFTContext.imdct_half().

                         cortex-a57   cortex-a53
synth_filter_float_c:    1866.2       3490.9
synth_filter_float_neon:  915.0       1531.5

With fftc.imdct_half forced to imdct_half_neon:
                         cortex-a57   cortex-a53
synth_filter_float_c:    1718.4       3025.3
synth_filter_float_neon:  926.2       1530.1
2015-12-14 16:45:01 +01:00
Janne Grunau
c33c1fa8af arm64: convert dcadsp neon asm from arm
~2% faster dts decoding overall.

                    cortex-a57   cortex-a53
dca_decode_hf_c:    474.8        1659.9
dca_decode_hf_neon: 225.2         301.1
dca_lfe_fir0_c:     913.2        1537.7
dca_lfe_fir0_neon:  286.8         451.9
dca_lfe_fir1_c:     848.7        1711.5
dca_lfe_fir1_neon:  387.1         506.4
2015-12-14 16:45:01 +01:00
Janne Grunau
e2710e790c arm: add a cpu flag for the VFPv2 vector mode
The vector mode was deprecated in ARMv7-A/VFPv3 and various cpu
implementations do not support it in hardware. Vector mode code will
depending the OS either be emulated in software or result in an illegal
instruction on cpus which does not support it. This was not really
problem in practice since NEON implementations of the same functions are
preferred. It will however become a problem for checkasm which tests
every cpu flag separately.

Since this is a cpu feature newer cpu do not support anymore the
behaviour of this flag differs from the other flags. It can be only
activated by runtime cpu feature selection.
2015-12-14 16:42:35 +01:00
Janne Grunau
5dfe4edad6 x86_64: int32_to_float_fmul_scalar sign extend integer length 2015-12-14 16:42:35 +01:00
Anton Khirnov
de9e199a03 lavc: make avpriv_mpa_decode_header private on next bump
It's not used by anything outside of lavc anymore.
2015-12-12 21:26:29 +01:00
Anton Khirnov
955aec3c7c mpegaudiodecheader: check the header in avpriv_mpegaudio_decode_header
Almost all the places from which this function is called already check
the header manually and in the two that don't (the mp3 muxer) the check
should not cause any problems.
2015-12-12 21:25:42 +01:00
Anton Khirnov
cea1eef25c lavc: get the profile name through the codec descriptor in avcodec_string() 2015-12-12 21:24:29 +01:00
Anton Khirnov
2c6811397b lavc: add profiles to AVCodecDescriptor
The profiles are a property of the codec, so it makes sense to export
them through AVCodecDescriptors, not just the codec implementations.
2015-12-12 21:22:49 +01:00
Anton Khirnov
cdc9ce098e lavc: print the name of the codec, not its implementation, in avcodec_string 2015-12-12 21:21:54 +01:00
Anton Khirnov
458e53f51f mpegvideo_enc: actually add the side data with vbv_delay to the packet
Fixes 2507b5dd67
2015-12-12 21:16:41 +01:00
Dave Yeo
b0b133b8c0 hevcdsp: use a macro for .rodata section
fixes assembling on OS/2

Signed-off-by: Dave Yeo <dave.r.yeo@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-12-11 16:19:30 +01:00
Luca Barbato
81c95eb8ee openh264: Directly include the deprecation guards header
Make easier to avoid compile failure when reworking the internal
headers.
2015-12-08 18:12:33 +01:00
Luca Barbato
34138ece23 log: Use a do {} while (0) for tlog
Avoid the warning `-Wempty-body`.
2015-12-08 11:26:21 +01:00
Vittorio Giovara
c34df42262 sgienc: Make sure to initialize skipped header portions
Fix fate tests with asan. Introduced during bytestream2 porting
(in revision 62cc8f4d79).

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-12-07 11:27:42 -05:00
Vittorio Giovara
16216b713f lavc: Drop exporting 2-pass encoding stats
These variables are coming from mpegvideoenc where are supposedly used
as bit counters on various frame properties. However their use is
unclear as they lack documentation, are available only from a very small
subset of encoders, and they are hardly used in the wild. Also frame_bits
in aacenc is employed in a similar way.

Remove this functionality from AVCodecContex, these variable are mostly
frame properties, and too few encoders support setting them with anything
useful.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-12-07 11:27:42 -05:00
Vittorio Giovara
be00ec832c lavc: Deprecate coder_type and its symbols
Most option values are simply unused or ignored and in practice the
majory of codecs only need to check whether to enable rle or not.

Add appropriate codec private options which better expose the allowed
features.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-12-07 11:01:22 -05:00
Anton Khirnov
f1ccd07680 h264: do not call frame_start() for missing frames
We do not need to do a full setup like for a real frame, just allocate a
buffer and set cur_pic(_ptr).
2015-12-07 11:42:26 +01:00
Anton Khirnov
d6dc5d15af aacdec: fix aac_static_table_init() prototype 2015-12-07 11:42:26 +01:00
Anton Khirnov
68e547ae8b avpacket: use ERANGE instead of EOVERFLOW
EOVERFLOW seems to be unavailable on certain platforms.
2015-12-07 11:42:26 +01:00
Anton Khirnov
e02de9df4b lavc: export Dirac parsing API used by the ogg demuxer as public
Also, stop using AVCodecContext for storing the stream parameters.
2015-12-06 10:28:04 +01:00
Anton Khirnov
825900248b qsvenc: export CPB props side data 2015-12-06 10:25:49 +01:00
Anton Khirnov
1520c6ff05 nvenc: export CPB props side data 2015-12-06 10:25:43 +01:00
Anton Khirnov
2507b5dd67 mpegvideo_enc: export vbv_delay in side data
Deprecate AVCodecContext.vbv_delay
2015-12-06 10:25:23 +01:00
Anton Khirnov
3f5c99fcbb mpegvideo_enc: export CPB props side data 2015-12-06 10:25:08 +01:00
Anton Khirnov
732a37d146 libx264: export CPB props side data 2015-12-06 10:25:00 +01:00
Anton Khirnov
03afb62e83 libvpxenc: export CPB props side data 2015-12-06 10:24:47 +01:00
Anton Khirnov
11c9bd633f libopenh264enc: export CPB props side data 2015-12-06 10:24:21 +01:00
Anton Khirnov
f0b769c16d lavc: add a packet side data type for VBV-like parameters 2015-12-06 10:23:45 +01:00
Anton Khirnov
84adab333c lavc: add stream-global packet side data
This is similar to what is done for AVStream.
2015-12-06 10:22:43 +01:00
Anton Khirnov
31c51f7441 avpacket: add a function for wrapping existing data as side data 2015-12-06 10:22:18 +01:00