1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

18005 Commits

Author SHA1 Message Date
Nicolas Bertrand
886e1b36f5 jpeg2000: Remove unused passes array in Jpeg200Cblk structure
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-13 14:28:48 +02:00
Nicolas Bertrand
f56fe04de3 jpeg2000: Initialize only once mqc arrays
Improves decoding speed.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-13 07:54:12 +02:00
Luca Barbato
3802833bc1 dca: Respect the current limits in the downmixing capabilities
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-12 04:34:49 +02:00
Luca Barbato
f261e50845 dca: Error out on missing DSYNC
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-12 04:34:49 +02:00
Luca Barbato
c82da343e6 pcm: always use codec->id instead of codec_id
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-12 04:34:49 +02:00
Luca Barbato
c0d973c41b vdpau: use the correct namespace for the union
Vdp is used by libvdpau, use AVVDPAU as used for the rest.

Reported-by: Alexis Ballier <aballier@gentoo.org>
2013-07-12 04:34:49 +02:00
Luca Barbato
e9d394f3fa mlpdec: Do not set invalid context in read_restart_header
The faulty values rippled further down the codepath causing a
hard-to-track segfault in the assembly code.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-12 04:34:49 +02:00
Luca Barbato
2b379a9251 mlpdsp: x86: Respect cpuflags 2013-07-12 04:34:49 +02:00
Luca Barbato
3abde1a3b4 pcx: Do not overread source buffer in pcx_rle_decode
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-12 04:34:49 +02:00
Luca Barbato
170fb593c6 pcx: K&R formatting cosmetics 2013-07-12 04:34:49 +02:00
Luca Barbato
d14a26edb7 wmavoice: conceal clearly corrupted blocks
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-10 15:50:06 +02:00
Luca Barbato
f5c48f5ada wmavoice: use init_static_data 2013-07-10 15:49:58 +02:00
Luca Barbato
04e9853a21 wmavoice: return meaningful error codes 2013-07-10 15:49:51 +02:00
Luca Barbato
7d65e960c7 iff: Do not read over the source buffer
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-10 15:24:42 +02:00
Luca Barbato
3865ba7b21 iff: K&R formatting cosmetics 2013-07-10 15:23:51 +02:00
Luca Barbato
4ecdb5ed44 qdm2: Conceal broken samples
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-09 15:57:46 +02:00
Luca Barbato
adadc3f244 qdm2: refactor joined stereo support
qdm2 does support only two channels. Loop over the run once.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-09 15:57:32 +02:00
Luca Barbato
12576afe20 adpcm: Write the correct number of samples for ima-dk4
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-09 10:49:29 +02:00
Luca Barbato
bbf6a4aa20 imc: Catch a division by zero
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-09 10:49:29 +02:00
Luca Barbato
50cf5a7fb7 atrac3: Error on impossible encoding/channel combinations
Joint stereo encoded mono is impossible.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-09 10:49:29 +02:00
Luca Barbato
22e76ec635 atrac3: set the getbits context the right buffer_end
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-09 10:49:29 +02:00
Luca Barbato
874c8a17ac atrac3: fix error handling
decode_tonal_components returns a proper AVERROR.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-09 10:49:29 +02:00
Luca Barbato
744a11c996 qdm2: check and reset dithering index per channel
Checking per subband would have the index exceed the
dithering noise table size.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-07 22:06:35 +02:00
Luca Barbato
76efedeadb qdm2: formatting cosmetics
Apply the usual style plus drop few unnecessary return at the end
of void functions.
2013-07-07 22:06:28 +02:00
Luca Barbato
f054e309c5 qdm2: use init_static_data 2013-07-07 22:06:20 +02:00
Luca Barbato
c4abc9098c vqavideo: check the version
Prevent out of buffer write.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-07 22:04:05 +02:00
Ronald S. Bultje
46d208e1e0 vp8: Wait for prev_frame to parse segment_map before reading it
This fixes occasional failures of vp8-test-vector-010 with frame-level
multithreading enabled.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-07 13:30:29 +03:00
Luca Barbato
4e7f0b082d kmvc: Clip pixel position to valid range
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-06 14:12:45 +02:00
Luca Barbato
8f68977054 kmvc: use fixed sized arrays in the context
Avoid some boilerplate code to dynamically allocate and then free the
buffers.
2013-07-06 14:12:42 +02:00
Luca Barbato
4972e5a186 bitstream_filter: K&R formatting cosmetics 2013-07-05 19:38:24 +02:00
Luca Barbato
6a10142faa indeo: reject negative array indexes
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-04 16:06:11 +02:00
Luca Barbato
6dfacd7ab1 indeo: Cosmetic formatting
Trim some overly long lines.
2013-07-04 16:06:10 +02:00
Luca Barbato
62256010e9 indeo: Refactor ff_ivi_init_tiles and ivi_decode_blocks
Spin large and mostly self contained blocks into stand alone
functions.
2013-07-04 16:06:10 +02:00
Luca Barbato
f6f36ca8ca indeo: Refactor ff_ivi_dec_huff_desc
Spare an indentation level.
2013-07-04 16:06:10 +02:00
Luca Barbato
e6d8acf6a8 indeo: use a typedef for the mc function pointer 2013-07-04 16:06:10 +02:00
Jason Garrett-Glaser
d222f6e39e cabac: x86 version of get_cabac_bypass
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-04 16:06:10 +02:00
Kostya Shishkov
410066986f aic: use chroma scan tables while decoding luma component in progressive mode
For some unclear reason Apple decided to use the same scan tables for luma and
chroma in the progressive mode while using different ones for luma in the
interlaced mode.
2013-07-04 12:09:45 +02:00
Michael Niedermayer
95a57d26d8 jpeg2000: Use the matching coding style struct for transform selection
Fixes a null pointer dereference.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:48 +02:00
Michael Niedermayer
c4604b8792 jpeg2000: Merge rescaling with interleaving in 9/7 IDWT
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:48 +02:00
Michael Niedermayer
22e18ea39e jpeg2000: Optimize output sample conversion
67935 -> 29984 kcycles

Reviewed-by: Nicolas BERTRAND <nicoinattendu@gmail.com>

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:48 +02:00
Michael Niedermayer
f0552e63a6 jpeg2000: Reset s->numX/Ytiles on tile deallocation
Keep the structure fields more consistent after cleanup.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:48 +02:00
Michael Niedermayer
e11099db20 jpeg2000: Optimize dequantization
Float:   4700 -> 2700 cycles
Integer: 4400 -> 2800 cycles

(sandybridge  i7)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:47 +02:00
Michael Niedermayer
c1dcbc590d jpeg2000: Do not assume a single tile
In preparation of supporting multiple tiles.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:47 +02:00
Michael Niedermayer
53d5d89c1b jpeg2000: Speed up jpeg2000_decode_tile()
Skip processing bands with dimension set to 0.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:47 +02:00
Michael Niedermayer
64f6570c6e jpeg2000: Use EBCOT's CAUSAL and BYPASS mode in decode_cblk()
Speed it up a bit.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:47 +02:00
Michael Niedermayer
d57c737ac3 jpeg2000: Simplify jpeg2000_decode_packets()
Raise PATCHWELCOME error in case of non-implemented progression order.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Nicolas Bertrand <nicoinattendu@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:47 +02:00
Michael Niedermayer
09d5929f37 jpeg2000: Do not crash on NULL node in tag_tree_decode
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:47 +02:00
Michael Niedermayer
aa16bbaf9b jpeg2000: Refactor SOT marker parsing
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:47 +02:00
Luca Barbato
daeb4e3042 jpeg2000: Proper cleanup on failure in decode_frame()
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:47 +02:00
Michael Niedermayer
589e5b52f6 jpeg2000: Use the correct sizeof in memset for T1 data
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:46 +02:00
Michael Niedermayer
5b73916d34 jpeg2000: Simplify init_tile()
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:46 +02:00
Michael Niedermayer
33e665a6ab jpeg2000: Update pixel format support
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:46 +02:00
Michael Niedermayer
db13e02c6f jpeg2000: Compute corrections of sub-band coordinates
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:46 +02:00
Michael Niedermayer
690c8af97b jpeg2000: Remove unneeded variable initialization
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:46 +02:00
Michael Niedermayer
5bf208f659 jpeg2000: Use separate fields for int and float codepaths
Split stepsize and data into int and float variants.
Eliminates a number of casts and simplifies spotting errors.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:46 +02:00
Michael Niedermayer
a458b91cf4 jpeg2000: Split int/float codepaths depending on the DWT
DWT53 is always int, DWT97 is always float.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:46 +02:00
Michael Niedermayer
f9581f1414 jpeg2000: Improve reduced resolution decoding
Correctly scale down the component coordinates and
clean up some redundant code.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:46 +02:00
Michael Niedermayer
952f7ed3c0 jpeg2000: Compute quantization for 'scalar derived' in the correct case.
Scalar derived case is represented by the JPEG2K_QSTY_SI define.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:45 +02:00
Michael Niedermayer
4e11b15534 jpeg2000: Calculate code-block coord in ff_jpeg2000_init_component()
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Nicolas Bertrand <nicoinattendu@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:45 +02:00
Michael Niedermayer
4cbd5ed11b jpeg2000: Fix compute precedence error in lut_gain index
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:45 +02:00
Michael Niedermayer
b44925ae6b jpeg2000: Initialize code blocks structures in precincts to 0
Prevent use of uninitialized memory / valgrind failure.

Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:45 +02:00
Michael Niedermayer
cf04af2086 jpeg2000: Check that we have enough components for MCT
Avoid overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:45 +02:00
Michael Niedermayer
b564784a20 jpeg2000: Check that there is a SOT before SOD
Avoid overreads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:45 +02:00
Michael Niedermayer
2c3901b2c3 jpeg2000: Remove unneeded returns
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:45 +02:00
Michael Niedermayer
ef35d6dbc6 jpeg2000: Propagate error code from get_cox()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:45 +02:00
Michael Niedermayer
78962d3df4 jpeg2000: Check that nreslevels2decode has been initialized before use
Avoid buffer overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:45 +02:00
Michael Niedermayer
86a2602e16 jpeg2000: Drop unused and writeonly fields
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:44 +02:00
Michael Niedermayer
ac921338a4 jpeg2000: Correctly calculate sgnd
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:44 +02:00
Michael Niedermayer
fd54dd028b jpeg2000: check len before parsing header
Avoid overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:44 +02:00
Michael Niedermayer
eae63e3c15 jpeg2000: Check component number in get_coc() and get_qcc()
Avoid overreads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Nicolas Bertrand <nicoinattendu@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:44 +02:00
Michael Niedermayer
17e5d614a8 jpeg2000: Check zero bit-plane validity
Prevent integer overflows.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:44 +02:00
Luca Barbato
7e201d575d jpeg2000: Validate block lengthinc
Currently we are using an array with a static data size.

Similar to a patch with the same purpose by Michael Niedermayer.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:44 +02:00
Michael Niedermayer
278a923c51 jpeg2000: Validate SIZ parsing
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:44 +02:00
Michael Niedermayer
d3cb302b88 jpeg2000: Validate SOT parsing
Avoid some overreads.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:44 +02:00
Michael Niedermayer
1a3598aae7 jpeg2000: Use bytestream2
Prevent a number of overreads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:43 +02:00
Luca Barbato
5efadcb8cd jpeg2000: Clean up return paths and error messages
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:43 +02:00
Luca Barbato
be3271009e jpeg2000: Define the maximum decomposition levels
And define the resolution levels according.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:43 +02:00
Michael Niedermayer
fbcc03db8f jpeg2000: Check code-block size
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Nicolas Bertrand <nicoinattendu@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:43 +02:00
Luca Barbato
5650e331a7 jpeg2000: Validate resolution levels
There are 32 maximum decomposition levels, thus 33 resolution levels.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-02 20:05:43 +02:00
Luca Barbato
8bd9039900 Revert "indeo5: reject negative motion vectors"
Negative motion vectors are possible.

This reverts commit 1194a41080.
2013-07-01 06:49:46 +02:00
Luca Barbato
b36e1893ef indeo: check for reference when inheriting mvs
The same is done already for qdelta.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-01 04:20:58 +02:00
Luca Barbato
1194a41080 indeo5: reject negative motion vectors
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-01 04:20:51 +02:00
Luca Barbato
dd3754a488 indeo: use proper error code 2013-07-01 04:17:46 +02:00
Luca Barbato
7388c0c586 indeo: Properly forward the error codes
If the tile data size does not match the buffer size it did not
return an AVERROR_INVALIDDATA causing futher corruption later.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-01 04:17:46 +02:00
Loren Merritt
1221bb6239 x86: lpc: fix a segfault in av_evaluate_lls_sse2() 2013-06-30 23:11:19 +00:00
Luca Barbato
6765ee7b9c mjpeg: Check the unescaped size for overflows
And contextually check init_get_bits success and fix the reporting
message.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-06-30 08:48:51 +02:00
Luca Barbato
7520d9779c mjpeg: Move code out of else branch
Simplify the control flow and spare some vertical space.
2013-06-30 08:46:55 +02:00
Luca Barbato
02ec656af7 wmapro: error out on impossible scale factor offsets
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-06-29 18:11:59 +02:00
Luca Barbato
d4a217a408 wmapro: check the min_samples_per_subframe
Must be at least WMAPRO_BLOCK_MIN_SIZE.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-06-29 18:11:40 +02:00
Luca Barbato
183880cfc4 pictor: use the correct logging context
Broken in 6d97484d72
2013-06-29 18:11:12 +02:00
Loren Merritt
c93ccf5a4c lpc: use levinson for the first pass of multipass cholesky
Levinson is faster, and cholesky is only needed if we want to apply different
weights to different samples, which doesn't happen on the first pass.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-29 13:26:52 +02:00
Loren Merritt
502ab21af0 x86: lpc: simd av_update_lls
4x-6x faster on sandybridge

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-29 13:23:57 +02:00
Loren Merritt
41578f70cf lpc: use function pointers, in preparation for asm
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-29 13:23:57 +02:00
Loren Merritt
cc6714bb16 lpc: remove "decay" argument
We never used the rolling-average mode, and this makes av_update_lls 15% faster.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-29 13:23:57 +02:00
Luca Barbato
3822936252 wmapro: check num_vec_coeffs against the actual available buffer
Prevent yet another buffer overwrite.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-06-28 13:16:35 +02:00
Luca Barbato
6652338f43 wmapro: return early on unsupported condition
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-06-28 13:16:00 +02:00
Luca Barbato
e30b068ef7 wmapro: make sure there is room to store the current packet
Prevent horrid and hard to trace struct overwrite.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-06-28 13:15:40 +02:00
Luca Barbato
afe03092dd lavc: move put_bits_left in put_bits.h 2013-06-28 13:14:12 +02:00
Luca Barbato
07c52e2c7c aac: return meaningful errors 2013-06-27 01:22:36 +02:00
Luca Barbato
6d8629aac1 aac: K&R formatting cosmetics 2013-06-27 01:22:06 +02:00