Commit Graph

42725 Commits

Author SHA1 Message Date
Anton Khirnov
c59fec783d nvenc: generate dts properly
When there is a non-zero decoding delay due to reordering, the first dts
should be lower than the first pts (since the first packet fed to the
decoder does not produce any output).

Use the same scheme used in mpegvideo_enc (which comes from x264
originally) -- wait for first two timestamps and extrapolate linearly to
the past to produce the first dts value.
2016-01-12 09:23:38 +01:00
Anton Khirnov
9d36cab4c0 nvenc: fix encoding with B-frames
When B-frames are enabled and the encoder returns success, all currently
pending buffers immediately become valid and can be returned to the
caller. We can only return one packet at a time, so all the other
pending buffers should be transferred to a new 'ready' fifo, from where
they can be returned in subsequent calls (in which the encoder does not
produce any new output). This bug was hidden by the incorrect testing of
the encoder return value (the return value was overwritten before it was
tested).
2016-01-12 09:23:38 +01:00
Anton Khirnov
aac7d6b284 nvenc: flush the encoder before closing it, as required by the docs
Otherwise, closing the encoder can crash.
2016-01-12 09:23:38 +01:00
Anton Khirnov
ee359c72ef nvenc: rename encoders
Change 'nvenc_<codec>' to '<codec>_nvenc', which is consistent with
other similar decoders and encoders (QSV, MMAL).
2016-01-12 09:23:34 +01:00
Anton Khirnov
39571e86cb nvenc: better error handling
Return proper error codes and print more descriptive error messages.
2016-01-12 09:12:40 +01:00
Anton Khirnov
9cce011b1d movenc-test: stop setting the GLOBAL_HEADER codec flag
This test does no encoding, setting the flag was done just to silence
the warning removed in the previous commit.
2016-01-12 09:12:24 +01:00
Anton Khirnov
521dc78366 mux: drop the warning about global headers
The AVStream codec context is often not (and should not be) the actual
encoding context, so this warning will be spurious in many cases.
2016-01-12 09:12:24 +01:00
Andreas Cadhalpun
fa66237b69 lavc: Use get_bitsz where needed
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-01-11 21:51:11 +01:00
Andreas Cadhalpun
62825236db lavc: Add get_bitsz()
get_bit variant supporting 0-bits reads.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-01-11 21:51:11 +01:00
Vittorio Giovara
81737f42c2 sunrastenc: Properly load codec private options
Initialize the private class field and give the class a more
appropriate name. Add a class member to the codec context.
2016-01-11 15:32:57 -05:00
Kieran Kunhya
46350db737 get_bits: Support max_depth > 2 in GET_RL_VLC_INTERNAL 2016-01-11 15:32:57 -05:00
Clément Bœsch
e8bc642202 lavu: add AV_CEIL_RSHIFT and use it in various places
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-11 15:32:56 -05:00
Clément Bœsch
7570c9e04f swfdec: support compressed swf
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-11 15:32:56 -05:00
Alexandra Hájková
34d45b3616 asfdec: Fix typo in comment
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-01-11 21:00:49 +01:00
Luca Barbato
40d43d25e7 APIchanges: Add missing av_pix_fmt_get_chroma_sub_sample entry 2016-01-11 20:53:12 +01:00
Martin Storsjö
73c8c0341c arm: Fix vfp dead code elimination with have_vfp_vm
This fixes builds with --disable-vfp.

Checking for the armv6 cpu flag is incorrect, since vfpv2 isn't
armv6 specific.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-01-08 23:52:59 +02:00
Martin Storsjö
fec76cd430 checkasm: Check register clobbering on aarch64
This is disabled on iOS, since iOS uses a slightly different ABI
for vararg parameters.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-01-07 09:33:24 +02:00
Martin Storsjö
26ec75aec3 checkasm: Check register clobbering on arm
Use two separate functions, depending on whether VFP/NEON is available.

This is set to require armv5te - it uses blx, which is only available
since armv5t, but we don't have a separate configure item for that.
(It also uses ldrd, which requires armv5te, but this could be avoided
if necessary.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-01-07 09:33:24 +02:00
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
Alexandra Hájková
066281372d asfdec: Remove unused function parameters
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-07 08:20:21 +01:00
Andreas Cadhalpun
2aec600ae7 asfdec: reject size > INT64_MAX in asf_read_unknown
Both avio_skip and detect_unknown_subobject use int64_t for the size
parameter.

This fixes a segmentation fault due to infinite recursion.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Alexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-07 08:20:21 +01:00
Andreas Cadhalpun
c69461d737 asfdec: only set asf_pkt->data_size after sanity checks
Otherwise invalid values are used unchecked in the next run.
This can cause NULL pointer dereferencing.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Alexandra Hájková <alexandra.khirnova@gmail.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
Luca Barbato
63f7f8d1db avconv: Drop an impossible check
EAGAIN is already managed in poll_filters().

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-01-04 16:58:32 +01:00
Luca Barbato
7ebf1b4ada avconv: Simplify poll_filters() return value check
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-01-04 16:58:32 +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
f0f54117c8 checkasm: x86: post commit review fixes
Check the full FPU tag word instead of only the lower half and simplify
the comparison.
Use upper-case function base name as macro name to instantiate both
checked_call variants.
2015-12-29 12:50:38 +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
Diego Biurrun
5049f6b772 rtpdec_jpeg: Coalesce redundant error checks 2015-12-26 10:26:29 +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
489e6add44 checkasm: add fmtconvert tests 2015-12-21 18:58:46 +01:00
Janne Grunau
568a4323fb checkasm: add synth_filter test 2015-12-21 17:40:18 +01:00
Janne Grunau
e71b747e9d checkasm: add tests for dcadsp 2015-12-21 17:40:18 +01:00
Janne Grunau
9d218d573f checkasm: add float comparison util functions 2015-12-21 17:40:18 +01:00
Janne Grunau
711781d7a1 x86: checkasm: check for or handle missing cleanup after MMX instructions
Not every asm routine is expected clear the MMX state after returning.
It is however a requisite for testing floating point code in checkasm.
Annotate functions requiring cleanup with declare_func_emms() and issue
emms after the call. The remaining functions are checked for having  a
cleared MMX state after return.
2015-12-21 17:40:18 +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