Commit Graph

17444 Commits

Author SHA1 Message Date
Anton Khirnov
192f1984b1 lavc: limit maximum number of channels to 63
This is the most that can be represented with the current channel layout
system. This limit should be raised/removed when a better system is
implemented.
2013-03-08 07:39:53 +01:00
Anton Khirnov
15ec0450b4 lavc: allow decoders to override frame parameters. 2013-03-08 07:39:44 +01:00
Anton Khirnov
3b199d29cd lavc decoders: properly initialize AVFrame. 2013-03-08 07:39:37 +01:00
Anton Khirnov
759001c534 lavc decoders: work with refcounted frames. 2013-03-08 07:38:30 +01:00
Anton Khirnov
6e7b50b427 mpegvideo_enc: drop support for reusing the input motion vectors.
This misfeature is most likely completely useless and conflicts with
removing the mpegvideo-specific fields from AVFrame. In the improbable
case it is actually useful, it should be reimplemented in a better way.
2013-03-08 07:37:45 +01:00
Anton Khirnov
7ecc2d403c Move AVFrame from lavc to lavu.
Add AVBuffer-based reference counting API to it.
2013-03-08 07:36:15 +01:00
Anton Khirnov
ad0c9f2d5d lavc: move AVFrame.hwaccel_picture_private to Picture.
This field is private and should not be present in a public struct. It
is only used in DXVA with mpegvideo-based decoders currently.
2013-03-08 07:36:01 +01:00
Anton Khirnov
1a5e913016 pthread: avoid copying input packets when possible. 2013-03-08 07:35:14 +01:00
Anton Khirnov
1afddbe59e avpacket: use AVBuffer to allow refcounting the packets.
This will allow us to avoid copying the packets in many cases.

This breaks ABI.
2013-03-08 07:33:45 +01:00
Alexander Kojevnikov
eae0879d96 mp3dec: Fix VBR bit rate parsing
When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag.

When parsing the stream, don't override the bit rate if it's already set,
otherwise calculate the mean bit rate from parsed frames. This way, the bit
rate will be set correctly both for CBR and VBR streams.

CC:libav-stable@libav.org

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-03-08 07:32:11 +01:00
Diego Biurrun
dbd2a34ba5 build: cosmetics: Group hw accelerator Makefile entries together 2013-03-07 15:36:21 +01:00
Diego Biurrun
5f401b7b71 Add missing error_resilience includes to files that use ER 2013-03-07 15:04:49 +01:00
Martin Storsjö
d88738e403 mpegvideo: Conditionally build error_resilience bits
This breaks the dependency of mpegvideo on error_resilience allowing
compilation of components that depend on the former w/o the latter.
2013-03-07 15:04:49 +01:00
Reimar Döffinger
efa7f42020 Use the avstring.h locale-independent character type functions
Make sure the behavior does not change with the locale.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-07 15:16:36 +02:00
Ronald S. Bultje
54b298fe56 lavc: Deprecate the deinterlace functions in libavcodec
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-07 09:35:24 +02:00
Ronald S. Bultje
64e4386974 h264: Integrate draw_horiz_band into ff_h264_draw_horiz_band
This makes the decoder independent of mpegvideo.

This copy of the draw_horiz_band code is simplified compared to
the "generic" mpegvideo one which still has a number of special
cases for different codecs.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-07 09:31:44 +02:00
Stefano Sabatini
70762508ec lavc: Prettify printing of codec tags containing non alphanumeric characters
Make av_get_codec_tag_string() show codec tag string characters in a more
intelligible ways. For example the ascii char "@" is used as a number, so
should be displayed like "[64]" rather than as a printable character.

Apart alphanumeric chars, only the characters ' ' and '.' are used
literally in codec tags, all the other characters represent numbers.

This also avoids relying on locale-dependent character class functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-07 08:50:29 +02:00
Martin Storsjö
d65522e826 h264: Rename the jpeg_420 pixfmt list to match the common naming structure
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-07 08:40:04 +02:00
Ronald S. Bultje
8d061989dd lavc: Split out ff_hwaccel_pixfmt_list_420[] over individual codecs
Not all hwaccels implement all codecs, so using one single list for
multiple such codecs means some codecs will be represented in the list,
even though they don't actually handle that codec. Copying specific
lists in each codec fixes that.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-06 21:18:50 +02:00
Diego Biurrun
5a4e9fe855 avcodec/internal: Fix #if DECODE_AUDIO / ENCODE_AUDIO name mismatch 2013-03-06 16:48:03 +01:00
Luca Barbato
5cf7c72757 shorten: use the unsigned type where needed
get_uint returns an unsigned value, use an unsigned to store
blocksize to make sure the comparison logic is correct and report
correctly the error for the channel count not supported.
2013-03-06 01:04:02 +01:00
Luca Barbato
4c364eb2b8 shorten: report meaningful errors 2013-03-06 01:04:02 +01:00
Luca Barbato
a2ad554def shorten: K&R formatting cosmetics 2013-03-06 01:04:02 +01:00
Michael Niedermayer
c10da30d84 shorten: set invalid channels count to 0
Prevent the loop shorten_decode_close from writing and freeing out of
the array boundary.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-03-06 01:04:01 +01:00
Luca Barbato
02055b6d40 vorbisdec: check memory allocations 2013-03-06 01:04:01 +01:00
Luca Barbato
4987faee78 h264: check for luma and chroma bit dept being equal
The decoder assumes a single bit depth for all the planes
while the specification allows different bit depths for luma
and chroma.

Avoid the possible problems described in CVE-2013-2277

CC: libav-stable@libav.org
2013-03-05 22:18:02 +01:00
Diego Biurrun
c57a593670 hwaccel: consistent name prefixes for start_frame/end_frame/decode_slice
Some hwaccels use name prefixes, some do not, others only use them for
some codecs.  Add prefixes everywhere for consistency.
2013-03-05 11:22:45 +01:00
Anton Khirnov
437211ae73 h264: set ref_count to 0 for intra slices.
CC:libav-stable@libav.org
2013-03-02 10:27:13 +01:00
Anton Khirnov
668e16a0dd h264: on reference overflow, reset the reference count to 0, not 1.
Since decode_slice_header() returns before the reference lists are
constructed, there are zero valid references.

CC:libav-stable@libav.org
2013-03-02 10:27:03 +01:00
Anton Khirnov
e671d3ad6c h264: do not copy ref count/ref2frm when updating per-frame context
They are filled in decode_slice_header() anyway.
2013-03-02 10:26:50 +01:00
Diego Biurrun
e8c52271c4 Revert "Move H264/QPEL specific asm from dsputil.asm to h264_qpel_*.asm."
This reverts commit f90ff772e7.

The code should be put back in h264_qpel_8bit.asm, but unfortunately
it is unconditionally used from dsputil_mmx.c since 71155d7.
2013-02-28 21:50:02 +01:00
Luca Barbato
9d4da474f5 lls: move to the private namespace
The functions are private.
2013-02-28 17:39:24 +01:00
Martin Storsjö
86611ff123 pnm: Use av_pix_fmt_desc_get instead of accessing the array directly
This fixes boken fate tests with MSVC with DLLs, broken since
b5f536d24.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-02-28 18:29:03 +02:00
Diego Biurrun
ebc701993f x86: dsputil: Drop some unused function #defines 2013-02-26 23:36:24 +01:00
Diego Biurrun
845cfc92f9 x86: dsputil: Drop aliasing of ff_put_pixels8_mmx to ff_put_pixels8_mmxext
The external assembly function uses mmxext instructions and should not be
masqueraded as an mmx-only function. Instead, use the mmx-only inline
assembly function.
2013-02-26 23:36:24 +01:00
Diego Biurrun
096cc11ec1 x86: vc1dsp: Move ff_avg_vc1_mspel_mc00_mmxext out of dsputil_mmx.c 2013-02-26 23:36:24 +01:00
Martin Storsjö
31a23a0dc6 x86: dsputil_mmx: Remove leftover inline assembly fragments
These became unused in 71155d7b.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-02-27 00:17:05 +02:00
Diego Biurrun
c242bbd8b6 Remove unnecessary dsputil.h #includes 2013-02-26 00:51:34 +01:00
Diego Biurrun
76b19a3984 Fix a number of incorrect intmath.h #includes. 2013-02-26 00:51:34 +01:00
Justin Ruggles
699d02b839 libschroedinger: cosmetics: rename variable avccontext to avctx
This is consistent with the rest of libavcodec.
2013-02-25 15:15:21 -05:00
Justin Ruggles
09031b4639 vorbisenc: cosmetics: rename variable avccontext to avctx
This is consistent with the rest of libavcodec.
2013-02-25 15:15:21 -05:00
Justin Ruggles
e951b6d94c vorbisdec: cosmetics: rename variable avccontext to avctx
This is consistent with the rest of libavcodec.
2013-02-25 15:15:21 -05:00
Luca Barbato
23bd9ef4b2 vorbisdec: Accept 0 amplitude_bits
The specification does not prevent an encoder to write the amplitude 0
as 0 amplitude_bits.

Our get_bits() implementation might not support a zero sized read
properly, thus the additional branch.
2013-02-25 07:34:00 +01:00
Luca Barbato
5b47c19bfd vorbisdec: Add missing checks
Rate and order must not be 0 even if the specification does not say that
explicitly.
2013-02-25 07:34:00 +01:00
Luca Barbato
fc386f2eea vorbisdec: cosmetics
Use the commonly used "if (!var)" instead of "if (var == 0)".
2013-02-25 07:34:00 +01:00
Michael Niedermayer
11dcecfcca vorbisdec: Error on bark_map_size equal to 0.
The value is used to calculate output LSP curve and a division by zero
and out of array accesses would occur.

CVE-2013-0894

CC: libav-stable@libav.org

Reported-by: Dale Curtis <dalecurtis@chromium.org>
Found-by: inferno@chromium.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-02-25 07:33:59 +01:00
Diego Biurrun
3d035d5a6a dsputil_alpha.h: Add missing stddef.h header to fix standalone compilation 2013-02-24 18:51:40 +01:00
Justin Ruggles
d7c450436f ac3dec: validate channel output mode against channel count
Damaged frames can lead to a mismatch, which can cause a segfault
due to using an incorrect channel mapping.

CC:libav-stable@libav.org
2013-02-23 16:59:39 -05:00
Diego Biurrun
94ee7da08d Remove pointless av_cold attributes in header files
The init functions marked as av_cold have to be executed in any case,
so there is no gain from trying to mark paths leading to such functions
as unlikely.
2013-02-23 20:13:47 +01:00
Kostya Shishkov
b5f536d24b pnm: add high-bitdepth PGMYUV support for both encoder and decoder 2013-02-23 16:49:22 +01:00