Commit Graph

16064 Commits

Author SHA1 Message Date
Kostya Shishkov
6de226a2b8 indeo3: validate new frame size before resetting decoder 2012-05-15 19:05:39 +02:00
Kostya Shishkov
bc00da2701 indeo3: when freeing buffers, set pointers referencing them to NULL as well 2012-05-15 19:05:39 +02:00
Kostya Shishkov
81064a8045 indeo3: initialise pixel planes on allocation
This prevents decoder from reading garbage from it in case of errors later.
2012-05-15 19:05:39 +02:00
Kostya Shishkov
fc417db3f1 indeo3: ensure that decoded cell data is in 7-bit range as presumed by decoder 2012-05-15 19:05:39 +02:00
Anton Khirnov
e6694659fc libmp3lame: set supported channel layouts. 2012-05-14 21:36:11 +02:00
Diego Biurrun
100c70b048 vcr1: Add vcr1_ prefixes to all static functions with generic names. 2012-05-14 16:19:16 +02:00
Diego Biurrun
a761e5951c vcr1: Fix return type of common_init to match the function pointer signature.
libavcodec/vcr1.c:182: warning: initialization from incompatible pointer type
2012-05-14 16:19:16 +02:00
Diego Biurrun
55da88c5ab vcr1enc: Replace obsolete get_bit_count by put_bits_count/flush_put_bits. 2012-05-14 16:19:14 +02:00
Diego Biurrun
5aad8e80a7 motion-test: remove disabled code 2012-05-14 15:38:43 +02:00
Vitor Sessak
fcc456b829 x86: use more standard construct for setting ASM functions in FFT code
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-05-14 15:38:42 +02:00
Michael Kostylev
ea60dfe284 x86: vc1: drop MMX loop filter implementation, which uses MMX2 instructions. 2012-05-12 14:02:45 +02:00
Mans Rullgard
e54e6f25cf arm/neon: dsputil: use correct size specifiers on vld1/vst1
Change the size specifiers to match the actual element sizes
of the data.  This makes no practical difference with strict
alignment checking disabled (the default) other than somewhat
documenting the code.  With strict alignment checking on, it
avoids trapping the unaligned loads.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-10 22:56:37 +01:00
Mans Rullgard
2eba6898c9 arm: dsputil: prettify some conditional instructions in put_pixels macros
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-10 22:56:09 +01:00
Mans Rullgard
c776531aef vqavideo: change x/y loop counters to the usual pattern
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-10 22:55:42 +01:00
Christophe Gisquet
110d0cdc9d rv40dsp x86: MMX/MMX2/3DNow/SSE2/SSSE3 implementations of MC
Code mostly inspired by vp8's MC, however:
- its MMX2 horizontal filter is worse because it can't take advantage of
  the coefficient redundancy
- that same coefficient redundancy allows better code for non-SSSE3 versions

Benchmark (rounded to tens of unit):
        V8x8  H8x8  2D8x8  V16x16  H16x16  2D16x16
C       445    358   985    1785    1559    3280
MMX*    219    271   478     714     929    1443
SSE2    131    158   294     425     515     892
SSSE3   120    122   248     387     390     763

End result is overall around a 15% speedup for SSSE3 version (on 6 sequences);
all loop filter functions now take around 55% of decoding time, while luma MC
dsp functions are around 6%, chroma ones are 1.3% and biweight around 2.3%.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-05-10 18:42:43 +02:00
Christophe Gisquet
706b998cdc ape: Use unsigned integer maths
This involves a division that should be a shift.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-05-10 16:40:43 +02:00
Mans Rullgard
cbc7d60afa arm: dsputil: fix overreads in put/avg_pixels functions
The vertically interpolating variants of these functions read
ahead one line to optimise the loop.  On the last line processed,
this might be outside the buffer.  Fix these invalid reads by
processing the last line outside the loop.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-10 14:39:34 +01:00
Diego Biurrun
1de53d006b h264: K&R formatting cosmetics for header files (part II/II) 2012-05-10 13:13:44 +02:00
Diego Biurrun
be545b8a34 h264: K&R formatting cosmetics for header files (part I/II) 2012-05-10 13:02:47 +02:00
Diego Biurrun
8ae1914327 vcr1enc: drop pointless empty encode_init() wrapper function 2012-05-09 23:47:37 +02:00
Diego Biurrun
eeeefd5001 vcr1: drop pointless write-only AVCodecContext member from VCR1Context 2012-05-09 23:24:07 +02:00
Diego Biurrun
51c4d87093 vcr1: group encoder code together to save #ifdefs 2012-05-09 23:24:07 +02:00
Diego Biurrun
db1e403cfb vcr1: cosmetics: K&R prettyprinting, typos, parentheses, dead code, comments 2012-05-09 23:24:06 +02:00
Diego Biurrun
c8b4a3999b libxvid: Give more suitable names to libxvid-related files. 2012-05-09 18:18:05 +02:00
Diego Biurrun
5b432d66ce libxvid: Separate libxvid encoder from libxvid rate control code.
This allows compiling the Xvid rate control code without the encoder.
2012-05-09 18:18:05 +02:00
Diego Biurrun
727af82a84 jpeglsdec: Remove write-only variable in ff_jpegls_decode_lse().
libavcodec/jpeglsdec.c:54:9: warning: variable ‘len’ set but not used
2012-05-09 18:12:28 +02:00
Anton Khirnov
c22953b8a3 lavc: check that extended_data is properly set in avcodec_encode_audio2(). 2012-05-09 17:47:11 +02:00
Anton Khirnov
a5117a2444 lavc: pad last audio frame with silence when needed. 2012-05-09 17:46:54 +02:00
Jordi Ortiz
38f06a1415 libschroedingerdec: Change AVPicture to AVFrame and use SchroTag to store pts
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-05-08 16:06:49 -07:00
Alex Converse
40f81769ae options_table: Add some missing #includes to fix "make checkheaders".
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-05-08 20:05:20 +02:00
Kostya Shishkov
464e9ab011 lagarith: add YUY2 decoding support
Unlike other variants, for YUY2 we need to use different prediction:
* on line 0 for luma we should left predict starting from the second pixel
* on line 1 we should left predict first 4 pixels for luma and 2 for chroma
* median prediction employed here is taken directly from HuffYUV
2012-05-08 07:24:31 +02:00
Carl Eugen Hoyos
58637a0b24 Support decoding unaligned rgb24 lagarith.
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-05-08 07:23:44 +02:00
Diego Biurrun
520c1ec699 dv: Split profile handling code into a separate file. 2012-05-07 23:59:49 +02:00
Ronald S. Bultje
64953f67f9 qdm2: clip array indices returned by qdm2_get_vlc().
Prevents subsequent overreads when these numbers are used as indices
in arrays.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-05-07 13:08:36 -04:00
Justin Ruggles
f132248028 avcodec: do not needlessly set packet size to 0 in avcodec_encode_audio2()
It is already set to 0 by av_free_packet()
2012-05-07 12:14:05 -04:00
Justin Ruggles
74e10b6204 avcodec: for audio encoding, reset output packet when it is not valid 2012-05-07 12:14:05 -04:00
Justin Ruggles
fa0319b4fd avcodec: refactor avcodec_encode_audio2() to merge common branches 2012-05-07 12:14:05 -04:00
Justin Ruggles
b461cd4deb avcodec: remove fallbacks for AVCodec.encode() in avcodec_encode_audio2()
We no longer have any audio encoders using AVCodec.encode().
2012-05-07 12:14:04 -04:00
Diego Biurrun
fdc918632f libschroedinger: Switch to function names more in line with Libav style. 2012-05-07 14:31:59 +02:00
Diego Biurrun
9cef0669c4 Move code shared between libdirac and libschroedinger to libschroedinger.
This also involves making some function static and changing the name
prefixes of some functions and structures.
2012-05-07 14:31:59 +02:00
Diego Biurrun
10d2ea2604 h264: Remove a commented-out function pointer typedef. 2012-05-07 14:17:43 +02:00
Diego Biurrun
ea14050642 txd: Remove write-only variable in txd_decode_frame().
libavcodec/txd.c:49:60: warning: variable ‘mipmap_count’ set but not used
2012-05-07 14:17:42 +02:00
Diego Biurrun
246b050f51 mmvideo.c: Remove unused variable in mm_decode_pal().
libavcodec/mmvideo.c:87:9: warning: variable ‘i’ set but not used
2012-05-07 14:17:41 +02:00
Diego Biurrun
dbe6ba55a3 build: cosmetics: Add missing end-of-line backslashes to item lists. 2012-05-07 14:17:40 +02:00
Diego Biurrun
9eb83a56aa build: cosmetics: Split HEADERS/OBJS/PROGS lists into one entry per line. 2012-05-07 14:01:32 +02:00
Diego Biurrun
1f4f752117 libschroedinger: Move a function to avoid a forward declaration. 2012-05-07 10:35:25 +02:00
Sean McGovern
b68c4ac293 pthread: warn on high thread counts
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-05-07 10:35:01 +02:00
Anton Khirnov
828bd088f3 lavc: add sample rate and channel layout to AVFrame.
Rationale is the same as for video width/height etc.
2012-05-07 07:08:03 +02:00
Paul B Mahol
37f4a976b3 zerocodec: check if the previous frame is missing
ZeroCodec relies on the keyframe flag being set in the container, and
prev is the previously decoded frame. A keyframe flags incorrectly set
will lead to this condition.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-05-06 15:47:10 -07:00
Kostya Shishkov
fb5c1aaea6 dfa: use more meaningful return codes 2012-05-06 19:18:27 +02:00
Michael Niedermayer
71a3c59ed7 eatgv: check vector_bits
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-05-06 19:18:02 +02:00
Kostya Shishkov
a390aa0ea4 eatgv: check motion vectors 2012-05-06 19:17:32 +02:00
Diego Biurrun
30b1961c66 Mark a number of variables only used in av_dlog() calls as av_unused.
This fixes a number of unused-but-set gcc warnings.
2012-05-06 18:01:31 +02:00
Diego Biurrun
b2e92e946c dvdec: drop const qualifier from variable to eliminate a warning
libavcodec/dvdec.c:344:12: warning: assignment discards ‘const’ qualifier from pointer target type
2012-05-06 18:01:30 +02:00
Robert Nagy
ad0278661b avcodec: Improve comment for thread_safe_callbacks to avoid misinterpretation.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-05-06 18:00:29 +02:00
Kostya Shishkov
1fdb5649d9 lagarith: make offset array type unsigned
This is logical and also fixes checking for the fourth plane offset.
2012-05-06 09:32:08 +02:00
Kostya Shishkov
8099187e89 dfa: add some checks to ensure that decoder won't write past frame end 2012-05-06 09:31:52 +02:00
Mans Rullgard
96f7590efd aacps: NEON optimisations
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-05 22:04:21 +01:00
Mans Rullgard
47d18d5354 aacps: align some arrays
This is required for SIMD optimisations.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-05 22:04:21 +01:00
Mans Rullgard
bf1945af30 aacps: move some loops to function pointers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-05 22:04:21 +01:00
Jakub Stachowski
ddffe3de43 WMAL: Shift output samples by the specified number of padding zeroes.
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-05-05 12:38:54 +02:00
Mashiat Sarker Shakkhar
363c3a44ff WMAL: Restore removed code in mclms_predict()
Based on observations made by Jakub Stachowski <qbast@go2.pl>

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-05-05 12:38:37 +02:00
Ronald S. Bultje
d2205d6543 png: check bit depth for PAL8/Y400A pixel formats.
Wrong bit depth can lead to invalid rowsize values, which crashes the
decoder further down.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-05-04 16:06:47 -07:00
Alex Converse
37ddd38332 celp filters: Do not read earlier than the start of the 'out' vector.
CC: libav-stable@libav.org
2012-05-04 10:55:31 -07:00
Mans Rullgard
58b2e0f0f2 vqavideo: return error if image size is not a multiple of block size
The decoder assumes in various places that the image size
is a multiple of the block size, and there is no obvious
way to support odd sizes.  Bailing out early if the header
specifies a bad size avoids various errors later on.

Fixes CVE-2012-0947.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-03 21:40:19 +01:00
Hendrik Leppkes
1d4a01474d mpeg12: fixed parsing in some mpeg2 streams
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-05-03 12:15:52 -04:00
Hendrik Leppkes
ca93f0fa36 Add SMPTE240M transfer characteristics flag.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-05-03 12:15:02 -04:00
Alex Converse
b5da848fac motionpixels: Clip YUV values after applying a gradient.
Prevents illegal reads on truncated and malformed input.

CC: libav-stable@libav.org
2012-05-02 13:06:09 -07:00
Ronald S. Bultje
5eec5a79da jpeg: handle progressive in second field of interlaced.
Progressive data is allocated later in decode_sof(), not allocating
that data leads to NULL dereferences.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-05-02 10:29:51 -07:00
Michael Niedermayer
1f05dcbad2 ituh263dec: Implement enough of Annex O (scalability) to fix a FPE.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-05-02 10:26:05 -07:00
Ronald S. Bultje
2d22d4307d h263: more strictly forbid frame size changes with frame-mt.
Prevents crashes because the old check was incomplete.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-05-02 10:21:34 -07:00
Ronald S. Bultje
732f9fcfe5 h264: additional protection against unsupported size/bitdepth changes.
Fixes crashes in codepaths not covered by original checks.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-05-02 10:19:37 -07:00
Ronald S. Bultje
ac80b812cd tta: prevents overflows for 32bit integers in header.
This prevents sample_rate/data_length from going negative, which
caused various crashes and undefined behaviour further down.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-05-02 10:16:57 -07:00
Ronald S. Bultje
82a0497cf3 vp8: update frame size changes on thread context switches.
This properly synchronizes frame size changes between threads if
subsequent threads abort decoding before frame size is initialized, i.e.
it prevents the thread after that from ping-ponging back to the original
value.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2012-05-02 09:57:12 -07:00
Ronald S. Bultje
bec207f9f9 snowdsp: explicitily state instruction size.
Fixes a compile error with clang at -O0.
2012-05-02 09:57:12 -07:00
Kostya Shishkov
0e23b50821 wmall: fix reconstructing audio with uncoded channels 2012-05-02 18:46:11 +02:00
Mashiat Sarker Shakkhar
c8370e6e35 WMAL cosmetics: fix indentation
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-05-02 18:45:29 +02:00
Hendrik Leppkes
4b7fa553a9 indeo3: fix motion vector validation
The index of the motion vector has to be checked before being
multiplied by 2 for the array index.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-05-01 21:14:18 -04:00
Hendrik Leppkes
ff80c68264 pcm_bluray: set bits_per_raw_sample for > 16-bit
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-05-01 20:59:09 -04:00
Mans Rullgard
4bf2e7c5f1 twinvq: fix out of bounds array access
ModeTab.fmode has only 3 elements, so indexing it with ftype
in the initialier for 'size' is invalid when ftype == FT_PPC.

This fixes crashes with gcc 4.8.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-01 20:17:07 +01:00
Jakub Stachowski
035a394eac WMAL: do not output last frame again if nothing was decoded in current packet
Reviewed-by: Mashiat Sarker Shakkhar <mashiat.sarker@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-05-01 14:34:03 +02:00
Mashiat Sarker Shakkhar
f92f452378 WMAL: do not start decoding if frame does not end in current packet
This fixes decoding of frames which span more than two packets. Tested with
recit24.wma.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-05-01 14:33:31 +02:00
Mans Rullgard
a812ed003f adpcm-thp: fix invalid array indexing
Indexing outside array limits is invalid and breaks with gcc 4.8.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-01 00:21:30 +01:00
Mans Rullgard
c81d1e2390 ppc: add const where needed in scalarproduct_int16_altivec()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-01 00:21:30 +01:00
Mans Rullgard
ce82dad7eb ppc: remove shift parameter from scalarproduct_int16_altivec()
The shift parameter was removed from this interface in 7e1ce6a.
This updates the Altivec implementation to match.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-01 00:21:30 +01:00
Mans Rullgard
4c387c7070 ppc: dsputil: do unaligned block accesses correctly
To load unaligned vector data in the usual way, explicit vec_ld()
should be used rather than dereferencing a pointer to a vector type.
When the VSX extension is enabled, gcc may compile vector pointer
dereferences using the VSX lxvw4x instruction instead of the lvx
instruction typically used with Altivec/VMX.  As the behaviour of
these instructions with unaligned addresses differs, it is important
that only lvx is used here.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-01 00:21:30 +01:00
Mans Rullgard
c75eca9d37 dvenc: do not call dsputil functions with stride not a multiple of 16
Allowing dsputil functions to assume the stride is a multiple of 16
even for smaller block sizes can simplify their implementation.
This appears to be the only place this guarantee is not met.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-01 00:21:30 +01:00
Hendrik Leppkes
85395ba73f avcodec: introduce YCoCg colorspace
Non perceptual color model that aims to have an increase effectiveness
in compression like the normal YCbCr while having near-lossless/lossless
mapping to RGB.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-04-29 14:00:34 -07:00
Luca Barbato
ccc2dfbcdf avcodec: cosmetic cleanup on header
Apply coding style to the structs.
2012-04-29 13:30:40 -07:00
Ronald S. Bultje
b12bf03275 aac sbr: align struct member by 32 byte.
Required because it's used in a call to imdct_half(), which is an AVX
function.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-04-29 13:49:39 -04:00
Mans Rullgard
acb2c79c21 4xm: fix invalid array indexing
Indexing outside arrays is invalid and breaks with gcc 4.8.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-04-29 01:08:37 +01:00
Christophe GISQUET
7fb8b491e5 rv34dsp: factorize a multiplication in the noround inverse transform
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-04-28 11:16:07 -07:00
Christophe Gisquet
d834ab0f2a rv40: perform bitwise checks in loop filter
Down from 95 kcycles to 93 (including all called functions).

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-04-28 11:12:38 -07:00
Ronald S. Bultje
774b681b80 rv34: remove inline keyword from rv34_decode_block().
Force-inlining increases object size by 8kB and causes a 2% slowdown.
2012-04-28 11:10:57 -07:00
Christophe Gisquet
0195ab5f5f rv40: change a logical test into a bitwise one.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-04-28 11:09:32 -07:00
Christophe Gisquet
8802799991 rv34: remove constant parameter
is_block2 was always 0, so just remove it, and change accordingly the code.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-04-28 11:07:50 -07:00
Christophe Gisquet
34e1b07546 rv40: don't always do the full prev_type search
120->100 cycles.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-04-28 11:06:05 -07:00
Christophe GISQUET
e75d1d4f73 dsputil x86: revert a test back to its previous value
Commit 356ee8d caused the initial inversion.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-04-28 11:00:51 -07:00
Christophe Gisquet
fe5ed69dc7 rv34dsp x86: implement MMX2 inverse transform
141 cycles down to 51.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-04-28 10:58:47 -07:00
Roland Scheidegger
9b9df1cdff h264: new assembly version of get_cabac for x86_64 with PIC
This adds a hand-optimized assembly version for get_cabac much like the
existing one, but it works if the table offsets are RIP-relative.
Compared to the non-RIP-relative version this adds 2 lea instructions
and it needs one extra register. get_cabac() gets about 40% faster, for
an overall speedup of about 5%.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-04-28 09:43:25 -07:00