Commit Graph

18905 Commits

Author SHA1 Message Date
Vittorio Giovara
ee6280ca12 h264: parse two additional constraint flags 2014-02-28 18:14:34 +01:00
Vittorio Giovara
e70ab7c1f5 h264: add MVCD to the list of High profiles in SPS
Also comment all previous profiles.
2014-02-28 18:14:33 +01:00
Hendrik Leppkes
3aca10bf76 latm: Always reconfigure if no extradata was set previously
AAC LOAS can have new audio config objects in the stream itself.

Make sure the decoder reconfigures itself when the first one arrives
midstream.

Bug-Id: 644
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-02-28 14:51:20 +01:00
Janne Grunau
6e4009d4cd arm: dcadsp: implement decode_hf as external NEON asm 2014-02-28 13:12:19 +01:00
Christophe Gisquet
4cb6964244 dcadec: simplify decoding of VQ high frequencies
The vector dequantization has a test in a loop preventing effective SIMD
implementation. By moving it out of the loop, this loop can be DSPized.

Therefore, modify the current DSP implementation. In particular, the
DSP implementation no longer has to handle null loop sizes.

The decode_hf implementations have following timings:

For x86 Arrandale:
        C  SSE SSE2 SSE4
win32: 260 162  119  104
win64: 242 N/A   89   72

The arm NEON optimizations follow in a later patch as external asm. The
now unused check for the y modifier in arm inline asm is removed from
configure.
2014-02-28 13:03:22 +01:00
Janne Grunau
7686afd049 dca: factorize scaling in inverse ADPCM
Based on a patch from Christophe Gisquet.

Unrolling of the m == 0 case avoids a possible use of the uninitilized
value sum when s->predictor_history is not set. I failed to find a
sample for it. It also reduced the cycle count from 220 to 150 on
sandy bridge, x86_64 linux, gcc 4.8.2 compared to his patch.
2014-02-28 13:00:48 +01:00
Christophe Gisquet
08e3ea60ff x86: synth filter float: implement SSE2 version
Timings for Arrandale:
          C    SSE
win32:  2108   334
win64:  1152   322

Factorizing the inner loop with a call/jmp is a >15 cycles cost, even with
the jmp destination being aligned.

Unrolling for ARCH_X86_64 is a 20 cycles gain.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-02-28 13:00:48 +01:00
Christophe Gisquet
57b1eb9f75 dcadsp: scan coefficients linearly in dca_lfe_fir
This change is inspired by x86 asm where it frees a register.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-02-28 13:00:47 +01:00
Christophe Gisquet
ad507d7907 x86: dcadsp: implement SSE lfe_dir
Results for Arrandale/Windows:
32: 1670 -> 316
64:  728 -> 298

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-02-28 13:00:47 +01:00
Christophe Gisquet
87ec849fe9 dcadec: remove scaling in lfe_interpolation_fir
The scaling factor is constant so it is faster to scale the
FIR coefficients in the tables during compilation.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-02-28 13:00:47 +01:00
Diego Biurrun
a55546f48d proresenc: Reuse proper dsputil infrastructure for FDCT 2014-02-28 11:19:47 +01:00
Diego Biurrun
92e598a57a prores: Drop DSP infrastructure for prores encoder bits
None of the encoder bits are arch-optimized.
2014-02-28 11:17:25 +01:00
Diego Biurrun
d6acefe058 proresenc: Drop unnecessary DCT permutation bits
No permutation is necessary for the FDCT.
2014-02-28 11:00:24 +01:00
Diego Biurrun
b23650491f prores: Use consistent names for DSP arch initialization functions 2014-02-28 10:34:55 +01:00
Diego Biurrun
f2408ec9d7 Give IDCT matrix transpose macro a more descriptive name
This also avoids a macro name clash and related warning on ARM.
2014-02-27 13:38:00 -08:00
Diego Biurrun
a63ac1106d build: Do not redundantly specifiy H.263-related object files for MSMPEG4v*
These are already covered through dependencies specified in configure.
2014-02-26 19:44:55 +01:00
Diego Biurrun
4ec336484d parser: cosmetics: Drop some unnecessary parentheses 2014-02-25 13:40:47 +01:00
Luca Barbato
a1c699659d parser: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-02-25 12:28:33 +01:00
Diego Biurrun
ed61f3ca8a parser: Remove commented-out cruft 2014-02-25 11:59:05 +01:00
Derek Buitenhuis
8aca00cc2b libx265: Properly handled dynamic linking with MSVC
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-02-24 11:07:33 -05:00
Derek Buitenhuis
0f7fa48cf1 libx265: Support SAR
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-02-24 11:07:33 -05:00
Derek Buitenhuis
2142b2efcd libx265: Support 4:4:4
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-02-24 11:06:59 -05:00
Derek Buitenhuis
d00a504b24 libx265: Update API usage
Framerate is now a sane rational instead of an integer, and
inputDepth is changed to what it actually is.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-02-24 15:50:04 +00:00
Anton Khirnov
30517a9f05 Use av_frame_copy() to simplify code where appropriate. 2014-02-24 07:25:07 +01:00
Anton Khirnov
8feac29cc4 lavc: use AVFrame API properly in ff_reget_buffer() 2014-02-24 07:25:07 +01:00
Luca Barbato
8eeacf31c5 hevc: Do not left shift a negative value in hevc_loop_filter_chroma 2014-02-23 14:34:41 +01:00
Luca Barbato
ff486c0f7f hevc: Do not right shift a negative value in get_pcm 2014-02-23 14:34:40 +01:00
Luca Barbato
50c988aa6d hevc: Drop unnecessary shifts in deblocking_filter_CTB
beta_offset is pre-multiplied by 2.
2014-02-23 14:34:34 +01:00
Luca Barbato
d922c5a5fb h264: Fix a typo from the previous commit
f777504f64 changed a - in +

CC: libav-stable@libav.org
2014-02-22 12:26:32 +01:00
Diego Biurrun
dc9e05e279 libvorbis: Give consistent names to all functions, structs, and defines 2014-02-21 11:08:09 +01:00
Vittorio Giovara
f777504f64 h264: Lower bound check for slice offsets
And use the value from the specification.

Sample-Id: 00000451-google
Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-02-20 18:58:38 +01:00
Janne Grunau
9c029f67ca aarch64: use EXTERN_ASM consistently for exported symbols
Based on e3fec3f095 for arm.
2014-02-20 15:24:35 +01:00
Christophe Gisquet
ef010f08ae dca: replace some memcpy by AV_COPY128
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-02-20 14:16:43 +01:00
Janne Grunau
982b596ea6 h264: avoid undefined behavior in chroma motion compensation
Makes fate-h264 pass under valgrind --undef-value-errors=yes with
-cpuflags none. {avg,put}_h264_chroma_mc8_8 approximately 5% faster,
{avg,put}_h264_chroma_mc4_8 2% faster both on x86 and arm.
2014-02-20 14:02:06 +01:00
Diego Biurrun
4bcca3611d mpeg4video_parser: Drop pointless av_-prefix from static function 2014-02-20 04:16:15 -08:00
Diego Biurrun
984e339866 avcodec: Consistently name encoder init functions foo_encode_init 2014-02-20 04:16:15 -08:00
Diego Biurrun
017a06a9ee x86: dsputil: Use correct file name as multiple inclusion guard 2014-02-20 04:16:15 -08:00
Diego Biurrun
ba42c85247 bit_depth_template: Use file name as multiple inclusion guard 2014-02-20 04:16:15 -08:00
Diego Biurrun
61e7c7f27b svq3: Adjust #endif comment 2014-02-20 04:16:15 -08:00
Luca Barbato
521726ff57 hevc: Always consider VLC NALU type mismatch fatal
Sample-Id: 00001667-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-02-19 16:59:40 +01:00
Luca Barbato
175e506332 hevc: Mention the missing SPS in the error message 2014-02-19 16:59:40 +01:00
Diego Biurrun
b23bc95920 x86: dca: Add missing multiple inclusion guards 2014-02-19 10:19:15 +01:00
Luca Barbato
fea6db064b h264: informative error reporting in decode_slice_header()
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-02-18 23:47:55 +01:00
Luca Barbato
96f9fbe109 h264: fix slice_type value reported in decode_slice_header()
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-02-18 23:47:32 +01:00
Diego Biurrun
4d7ab5cfeb doxygen: Add a number of missing function parameter descriptions 2014-02-17 15:36:09 +01:00
Vittorio Giovara
614b9e4db8 h264: use avpriv_request_sample for chroma_format_idc 2014-02-16 23:51:44 +01:00
Diego Biurrun
b339182eba Move all example programs to doc/examples
Also drop support for building examples in library directories.
2014-02-16 21:37:21 +01:00
Maxim Poliakovski
77fbc03265 g2meet: validate bpp and bitmasks in the display info
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2014-02-16 16:32:53 +01:00
Tim Walker
9cd4bc4176 ac3dec: set AV_FRAME_DATA_DOWNMIX_INFO side data. 2014-02-15 22:25:00 +01:00
Tim Walker
9c0e4b3395 ac3: update AC3PreferredStereoDownmixMode.
'11b' is reserved in the A/52 specification,
but newer encoders use it to indicate a Dolby
Pro Logic II compatible Lt/Rt downmix.
2014-02-15 22:24:48 +01:00
Vittorio Giovara
dc971acf4a h264_parser: use enum values in h264_find_frame_end() 2014-02-15 18:29:49 +01:00
Janne Grunau
98fdfa9970 ppc: reduce overreads when loading 8 pixels in altivec dsp functions
Altivec can only load naturally aligned vectors. To handle possibly
unaligned data a second vector is loaded from an offset of the original
location and the data is recovered through a vector permutation.
Overreads are minimal if the offset for second load points to the last
element of data. This is 7 for loading eight 8-bit pixels and overreads
are reduced from 16 bytes to 8 bytes if the pixels are 64-bit aligned.
For unaligned pixels the overread is reduced from 23 bytes to 15 bytes
in the worst case.
2014-02-14 18:34:04 +01:00
Jan Ekström
3fbad00714 utvideoenc: Enable support for multiple slices and use them
The official Ut Video decoder only threads with slices, thus until
now any files encoded by the libavcodec encoder have only been
decodable with a single thread. The default slice count is now
set to subsampled_height / 120.

Also sets slices to 1 for the Ut Video encoder tests to keep them
green.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-02-14 15:09:39 +00:00
Derek Buitenhuis
4127e6aeb6 libx265: Remove redundant default param call
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-02-14 14:27:45 +00:00
Derek Buitenhuis
41836c4e30 libx265: Fix use of uninitialized input picture
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-02-14 14:27:45 +00:00
Vittorio Giovara
066ad24984 h264_sei: reorder headers
Also drop unused assert.h.
2014-02-14 05:10:58 +01:00
Vittorio Giovara
304e916a92 h264_sei: name buffering period type consistently 2014-02-14 05:08:47 +01:00
Vittorio Giovara
15210354cf h264: drop outdated comments 2014-02-14 05:08:37 +01:00
Vittorio Giovara
3a05767028 h264: store current_sps_id inside the current sps
In preparation for MVC support.
2014-02-14 05:05:46 +01:00
Vittorio Giovara
73e8fab31d h264: print values in case of error
Also make error style consistent and drop redundant information.
2014-02-14 05:05:35 +01:00
Luca Barbato
f8c507f44b h264: Refactor ff_h264_decode_ref_pic_list_reordering
In preparation for MVC support.
2014-02-13 23:34:50 +01:00
Janne Grunau
73eca738ac mpeg12dec: do not add stereo3D side data to a non-existing frame
User data is usually coded before slice data. That means the frame
the user data belongs to is not available while parsing the user data.
The stereo3D side data has to use the same indirection over the private
context as pan scan information and A53 captions.

Bug-Id:632
2014-02-13 13:03:01 +01:00
Janne Grunau
f795a8a8bf h264: make context_count unsigned
Removes the bogus but scary looking warning 'libavcodec/h264.c:4529:49:
warning: array subscript is below array bounds [-Warray-bounds]'.
2014-02-12 15:48:03 +01:00
Derek Buitenhuis
50ea93158d Add libx265 encoder
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-02-12 13:13:17 +00:00
John Stebbins
462d5e8e6c aacdec: set AVFrame sample_rate
AVFrame.sample_rate is set in ff_get_buffer, but aacdec calls
ff_get_buffer before the samplerate is known. So it needs to be
set again before returning the frame.
2014-02-12 12:52:28 +01:00
John Stebbins
52771346dc lavc: set AVFrame pkt_pts and reordered_opaque in reget_buffer
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-02-11 14:25:01 +01:00
Kostya Shishkov
6477449243 g2meet: make JPEG tile decoder operate on 8x8 block mask
This is needed for upcoming Go2Meeting (G2M2/G2M3) decoder.
2014-02-11 12:46:27 +01:00
Maxim Poliakovski
d6d7851801 g2meet: factor out seeking to the chunk end
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2014-02-11 12:46:11 +01:00
Anton Khirnov
77bb0004bb rpza: limit the number of blocks to the total remaining blocks in the frame
Fixes invalid writes.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-10 15:22:28 +01:00
Anton Khirnov
a46dc49744 rpza: move some variables to the blocks where they are used 2014-02-10 15:22:01 +01:00
Anton Khirnov
c7769df178 rpza: use fixed-width int types 2014-02-10 15:21:35 +01:00
Anton Khirnov
e1218ce914 rpza: switch to bytestream2 2014-02-10 15:18:21 +01:00
Luca Barbato
246d3bf0ec hevc: Conceal zero td
It was done only in check_mvset(), while mv_scale() is called also by
dist_scale().

Sample-Id: 00001579-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-02-09 19:53:43 +01:00
Kostya Shishkov
e95018b694 dnxhd: Support DNx444
Bug-Id: 99
Bug-Id: videolan/9620
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-02-09 19:53:35 +01:00
Ronald S. Bultje
2f6eec65ac vp8: fix PPC assembly to work if src_stride != dst_stride
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-02-09 18:50:53 +01:00
Janne Grunau
6a8475dc4f asvenc: free avctx->coded_frame on codec close 2014-02-09 18:50:53 +01:00
Martin Storsjö
d6eac2f1bc arm: Remove a stray .fpu directive
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-02-09 18:36:16 +01:00
Alexandra Khirnova
28e508a946 dnxhddec: return proper error code
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-02-09 18:36:16 +01:00
Maxim Poliakovski
bc3f03567a g2meet: rename FRAME_INFO to more appropriate DISPLAY_INFO
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2014-02-09 16:13:23 +01:00
Tim Walker
c1e7de8f62 mlp_parser: fix request_channel_layout behavior.
When request_channel_layout is 0,
all substreams should be decoded.

Thanks to Michael Niedermayer for spotting.

Also fix a mismatch between the parser and
decoder when request_channel_layout is a
subset of Stereo.
2014-02-08 20:10:51 +01:00
Michael Niedermayer
f90a4bfc43 mlpdec: fix request_channel_layout behavior.
When request_channel_layout is 0,
all substreams should be decoded.

Signed-off-by: Tim Walker <tdskywalker@gmail.com>
2014-02-08 20:10:35 +01:00
Kostya Shishkov
cde7df25ef Mirillis FIC video decoder
Does not contain cursor rendering yet.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-02-08 15:04:13 +00:00
Tim Walker
c0c45188e5 mlp: improve request_channel_layout behavior.
Don't decode further substreams if request_channel_layout
is a subset of the current substream's channel_layout.

Before, we would only discard further substreams if
request_channel_layout matched the substream's
channel_layout extactly, thus decoding additional
channels which the caller would probably end up downmixing.
2014-02-08 13:39:37 +01:00
Janne Grunau
5c1c6e8226 dca: include dcadsp.h in {arm,x86}/dca.h for checkheaders 2014-02-08 13:38:36 +01:00
Vittorio Giovara
b141c7b37e h264: give numbers to nalus
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-02-08 13:38:31 +01:00
Janne Grunau
0cffd6fff5 x86: use the inline int8x8_fmul_int32 only if inline SSE2 is availbale
Fixes compilation with MSVC. Also does not rely on on earlier config.h
include but include it directly.
2014-02-08 12:10:56 +01:00
Christophe Gisquet
5fdbfcb5b7 dcadsp: split lfe_dir cases
The x86 runs short on registers because numerous elements are not static.
In addition, splitting them allows more optimized code, at least for x86.

Arm asm changes by Janne Grunau.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-02-07 22:54:18 +01:00
Christophe Gisquet
5b59a9fc61 x86: dcadsp: implement int8x8_fmul_int32
For the callable function (as opposed to the inline one):
         C  SSE  SSE2  SSE4
Win32:  47   42   29    26
Win64:  30   33   25    23
The SSE version is neither compiled nor set for ARCH_X86_64, as the
inlinable function takes over.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-02-07 22:52:40 +01:00
Christophe Gisquet
2bd44cb705 dcadsp: add int8x8_fmul_int32 to dsp context
It is currently declared as a macro who is set to inlinable functions,
among which a Neon and a default C implementations.

Add a DSP parameter to each inline function, unused except by the
default C implementation which calls a function from the DSP context.

On an Arrandale CPU, gain for an inlined SSE2 function vs. a call:
- Win32: 29 to 26 cycles
- Win64: 25 to 23 cycles

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-02-07 22:51:59 +01:00
Martin Storsjö
5bcbb516f2 arm: Add X() around all references to extern symbols
Don't rely on the fact that an unprefixed label currently exists.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-02-07 15:13:58 +02:00
Ronald S. Bultje
5351964a2b vp8: fix bilinear C code to work if src_stride != dst_stride.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-02-06 22:45:29 +01:00
Martin Storsjö
49ec551595 vp8: Use 2 registers for dst_stride and src_stride in neon bilin filter
Based on a patch by Ronald S. Bultje.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-02-06 09:32:26 +02:00
Vittorio Giovara
a91d3658d9 mpeg: K&R formatting cosmetics
Also adjust header #include order and some comments.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-02-04 22:29:53 +01:00
Anton Khirnov
4c3e1956ee lagarith: reallocate rgb_planes when needed
Fixes invalid writes on pixel format changes.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-04 22:00:27 +01:00
Anton Khirnov
2240e2078d truemotion1: check the header size
Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-04 22:00:13 +01:00
Anton Khirnov
1713eec29a shorten: pad the internal bitstream buffer
Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-04 21:59:57 +01:00
Anton Khirnov
5430839144 eacmv: clear references on frame dimensions change
Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-04 21:59:14 +01:00
Diego Biurrun
190d4a447b avcodec: Suppress deprecation warnings from avcodec_alloc_frame()
The function is itself obsolete and slated for removal.
2014-02-04 13:46:20 +01:00
Vittorio Giovara
d509ae5be0 jvdec: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-02-04 12:35:38 +01:00
Anton Khirnov
1f097d168d h264: reset data partitioning at the beginning of each decode call
Prevents using GetBitContexts with data from previous calls.

Fixes access to freed memory.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-04 11:26:17 +01:00
Anton Khirnov
e46ad30a80 vp8: use a fixed-size edge emu buffer
The reason is the same as for e588615d93

Based on a patch by Ronald S. Bultje <rsbultje@gmail.com>
2014-02-04 11:21:07 +01:00
Jan Ekström
5de64bb34d utvideoenc: Add support for the new BT.709 FourCCs for YCbCr
With cli usage the decoder might have not set the colorspace during
encoder init, manual colorspace override might be needed in such
cases.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-02-04 10:59:28 +01:00
Anton Khirnov
b25e84b739 hevc: check that the VCL NAL types are the same for all slice segments of a frame
Fixes possible invalid memory access for mismatching skipped/non-skipped
slice segments.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Sample-Id: 00001533-google
2014-02-04 10:39:07 +01:00
Luca Barbato
816e5b9970 hevc: Reject impossible slice segment
A dependent slice cannot have address 0.
Prevent an out of array bound load in ff_hevc_cabac_init().

Sample-Id: 00001406-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-02-01 17:04:49 +01:00
Luca Barbato
09e2203b8b hevc: Consider first quantization group any reference to 0, 0
According to my understanding of T-REC-H.265-2013044 chapter 8.6.1.

Sample-Id: 00001438-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-02-01 17:02:35 +01:00
Janne Grunau
7716dd9fbb xvid: switch to xvid mmx idct as soon as possible
The idct implementation cannot be changed after the quantization matrices
are read since it use a different permutaion.

Bug-Id: videolan/7411
2014-01-31 11:09:11 +01:00
Jan Ekström
5312818524 atrac3plus: Make initialization dependant on channel count rather than channel map
Makes it easier to recreate an AVCodecContext for ATRAC3+ decoding,
which is needed in multimedia frameworks, as well as in general cases
where demuxing and decoding are separate entities.
2014-01-31 11:09:10 +01:00
Ronald S. Bultje
9ee9c679a7 x86: videodsp: Fix a bug in a %if statement where we used '%%' instead of '&&'.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-01-30 15:33:23 +01:00
Ronald S. Bultje
51daafb02e x86: videodsp: Properly mark sse2 instructions in emulated_edge_mc as such.
Should fix crashes or corrupt output on pre-SSE2 CPUs when they were
using SSE2-code (e.g. AMD Athlon XP 2400+ or Intel Pentium III) in
hfix or hvar single-edge (left/right) extension functions.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-01-30 15:30:01 +01:00
John Stebbins
23d461fe87 ac3dec: Allow asymmetric application of DRC when drc_scale > 1
Amplification of quiet sounds is enhanced.
Inspired by gbooker's A52Decoder.
2014-01-29 23:26:25 +01:00
Diego Biurrun
54b2ce7418 mpeg: Drop unused parameters from ff_draw_horiz_band() 2014-01-29 16:37:23 +01:00
Janne Grunau
6d93307f8d mpeg12: check scantable indices in all decode_block functions
Add checks to the fast functions used with CODEC_FLAGS2_FAST and move
the check for all other functions to before the invalid memory is
accessed. Fixes https://trac.videolan.org/vlc/ticket/9713 with
CODEC_FLAGS2_FAST.

CC: libav-stable@libav.org
2014-01-25 21:50:20 +01:00
Janne Grunau
fb0c9d41d6 avutil: remove timer.h include from internal.h
Added libavutil/timer.h include to all files with {START,STOP}_TIMER.
2014-01-25 21:50:20 +01:00
Kostya Shishkov
28e1eed3c2 dxtory: compressed RGB555/RGB565 decoding support 2014-01-24 20:09:51 +01:00
Kostya Shishkov
0e1ad2f591 dxtory: add more compressed and uncompressed modes 2014-01-24 20:09:44 +01:00
Guillaume Martres
50866c8d95 vp9: fix bugs in updating coef probabilities with parallelmode=1
- The memcpy was completely wrong because
s->prob_ctx[s->framectxid].coef is a [4][2][2][6][6][3] array, whereas
s->prob.coef is a [4][2][2][6][6][11] array.
- The additional check was committed to ffmpeg by Ronald S. Bultje.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-24 07:03:11 +01:00
Ronald S. Bultje
bd01412313 vp9: fix mvref finding to adhere to bug in libvpx.
Fixes a particular youtube video that I unfortunately can't share.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-24 07:02:56 +01:00
Martin Storsjö
cff480e49d mpegvideo_enc: Don't call ff_h263dsp_init unconditionally
This fixes builds with e.g. --disable-decoders --disable-encoders
--enable-encoder=mjpeg.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-22 18:42:38 +02:00
Diego Biurrun
19987fa18c bfin: vp3: Mark all binary object sections appropriately
This fixes a leftover from e44d7c659b.
2014-01-22 05:38:15 -08:00
Janne Grunau
ea49f60523 h264: skip chroma edges at the picture boundary while deblocking 4:4:4
This handles macroblock edges for the chroma components in the same way
as for the luma compoment for 4:4:4 streams. The Spec explicitly states
that the deblocking filter is not applied to edges at the boundary of
the picture.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-01-22 13:44:28 +01:00
Anton Khirnov
e0ab5078a7 lavc: do not force the emu edge flag
The default get_buffer2() implementation (and possibly some
user ones) does not allocate edges when this flag is set, which may
expose bugs in some decoders. Until the 10 release is out, it is safer
to remove this part.
2014-01-21 17:54:09 +01:00
Kostya Shishkov
025fd76e1a dxtory: change error code for unexpected slice configuration 2014-01-21 17:47:50 +01:00
Kostya Shishkov
e91a3f1bdb dxtory: correctly handle YUV slices with average odd height 2014-01-21 17:47:50 +01:00
Diego Biurrun
ade4ecb42d dxva2: Use correct printf format strings 2014-01-21 14:42:44 +01:00
Diego Biurrun
766df7ca89 dxva2: Add missing #includes 2014-01-21 14:42:23 +01:00
Sam Lantinga
9d80b1ae95 dxva2: Log errors verbosely
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-21 12:46:29 +01:00
Sam Lantinga
5b2b23f2d6 dxva2: Retry IDirectXVideoDecoder_BeginFrame()
If the function returns E_PENDING retry for a fixed number of times.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-21 12:46:28 +01:00
Luca Barbato
e22ebd04bc hevc: Bound check cu_qp_delta
The T-REC-H.265-2013044 page 91 states it has to be in the range
[-(26 + s->sps->qp_bd_offset / 2), (25 + s->sps->qp_bd_offset / 2)].
2014-01-21 11:59:54 +01:00
Luca Barbato
0d999333f9 hevc: Bound check slice_qp
The T-REC-H.265-2013044 page 79 states it has to be in the range
[-s->sps->qp_bd_offset, 51].

Sample-Id: 00001386-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-01-21 11:59:30 +01:00
Luca Barbato
838740e642 hevc: Prevent some integer overflows
get_ue_golomb_long() returns an unsigned.

Sample-Id: 00001541-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-01-21 11:59:18 +01:00
Guillaume Martres
faf03ecba0 hevc: Remove useless clip
The src buffer should only contain values in the interval
[0, (1 << BIT_DEPTH) - 1].

Since shift = (BIT_DEPTH - 5), src[x] >> shift must be in
the interval [0, 31], so no clip is needed.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-21 11:58:52 +01:00
Guillaume Martres
a246d06fe0 hevc: clip pixels when transquant bypass is used
The reconstructed picture should always be clipped (see section 8.6.5),
previously we did not clip coding units where
cu_transquant_bypass_flag == 1.

Sample-Id: 00001325-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-21 11:58:37 +01:00
Luca Barbato
b37e796082 hevc: Use uint64 to check for tile dimensions
And use unsigned datatypes.

Otherwise it would overflow.

Sample-Id: 00001315-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-01-21 11:57:51 +01:00
Michael Niedermayer
d5c15ebeaf hevc: Fix modulo operations
Keep qp fields within the range.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-21 11:57:43 +01:00
Michael Niedermayer
a7a07cc98a hevc: check that VPS referenced from SPS exists
This matches how its done for SPS/PPS.
Fixes null pointer dereference.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-21 11:57:36 +01:00
Michael Niedermayer
dd2d0039b6 vc1: Always reset numref when parsing a new frame header.
Fixes an issue where the B-frame coding mode switches from interlaced
fields to interlaced frames, causing incorrect decisions in the motion
compensation code and resulting in visual artifacts.

CC: libav-stable@libav.org
Signed-off-by: Tim Walker <tdskywalker@gmail.com>
2014-01-20 23:22:30 +01:00
Anton Khirnov
93c553c71e lavc: deprecate CODEC_FLAG_EMU_EDGE and avcodec_get_edge_width(). 2014-01-20 12:52:28 +01:00
Anton Khirnov
024db24912 mpegvideo: allocate edges when encoding.
Allocating edges will be removed from generic code, so the encoder must
handle this explicitly.
2014-01-20 12:50:14 +01:00
Anton Khirnov
f7e85ee996 lavc: allow the caller to override dimensions in ff_get_buffer()
This will be useful for allocating edges in the encoders.
2014-01-20 12:49:47 +01:00
Tim Walker
0d43b114cc eac3: cosmetics, re-indent. 2014-01-19 19:12:58 +01:00
Tim Walker
ade75fb811 (e)ac3: clip surround mix level indexes.
Values 0-2 are reserved, 3 (-1.5dB) should be used instead.
2014-01-19 19:12:52 +01:00
Tim Walker
c229f571fd (e)ac3: parse and store the Lt/Rt and LFE mix levels. 2014-01-19 19:12:42 +01:00
Tim Walker
1f604f96ea ac3: set default matrix encoding modes in parse_frame_header.
Deduplicates some code.
2014-01-19 19:12:33 +01:00
Anton Khirnov
8b2e5e42bb h264: check that an IDR NAL only contains I slices
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:53:31 +01:00
Anton Khirnov
9ecabd7892 h264: reset num_reorder_frames if it is invalid
An invalid VUI is not considered a fatal error, so the SPS containing it
may still be used. Leaving an invalid value of num_reorder_frames there
can result in writing over the bounds of H264Context.delayed_pic.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:53:06 +01:00
Anton Khirnov
0652e024c6 h264: reset ref count if decoding the slice header fails
Otherwise the ER code might try to use some already freed references.

Fixes possible access to freed memory.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:51:04 +01:00
Anton Khirnov
98cc9efc5f h264: prevent two matching fields from being both a short/long ref combination
Fixes possible access to freed memory.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:42:39 +01:00
Anton Khirnov
00dbff4c3e h264: do not call field_end if we do not have a current picture
Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:42:21 +01:00
Anton Khirnov
7f0e81db3c h264: limit allowed pred modes in ff_h264_check_intra_pred_mode() to 3
Higher modes are not allowed for 16x16/chroma, which is what this
function is used for. Otherwise this function would return 0 (vertical
prediction) for invalid higher modes, which could result in invalid
reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:41:59 +01:00
Anton Khirnov
d1b3fabe69 h264: reset first_field if frame_start() fails for missing refs
In this case we may not have a current frame, while first_field being
set implies we do.

Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:41:24 +01:00