Diego Biurrun
fe4d5fe936
jpeg2000: Mark static data init functions as av_cold
11 years ago
Diego Biurrun
cc8163e1a3
avcodec: more correct printf specifiers
11 years ago
Luca Barbato
1018a92219
jpeg2000: Check block length
...
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years ago
Martin Storsjö
18a245a2ae
jpeg2000dec: Add more checks when parsing headers
...
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Nicolas Bertrand
f56fe04de3
jpeg2000: Initialize only once mqc arrays
...
Improves decoding speed.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
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>
12 years ago
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>
12 years ago
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>
12 years ago
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>
12 years ago
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>
12 years ago
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>
12 years ago
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>
12 years ago
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>
12 years ago
Michael Niedermayer
09d5929f37
jpeg2000: Do not crash on NULL node in tag_tree_decode
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Michael Niedermayer
aa16bbaf9b
jpeg2000: Refactor SOT marker parsing
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Luca Barbato
daeb4e3042
jpeg2000: Proper cleanup on failure in decode_frame()
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Michael Niedermayer
589e5b52f6
jpeg2000: Use the correct sizeof in memset for T1 data
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Michael Niedermayer
5b73916d34
jpeg2000: Simplify init_tile()
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Michael Niedermayer
33e665a6ab
jpeg2000: Update pixel format support
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
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>
12 years ago
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>
12 years ago
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>
12 years ago
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>
12 years ago
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>
12 years ago
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>
12 years ago
Michael Niedermayer
2c3901b2c3
jpeg2000: Remove unneeded returns
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
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>
12 years ago
Michael Niedermayer
86a2602e16
jpeg2000: Drop unused and writeonly fields
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Michael Niedermayer
ac921338a4
jpeg2000: Correctly calculate sgnd
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
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>
12 years ago
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>
12 years ago
Michael Niedermayer
17e5d614a8
jpeg2000: Check zero bit-plane validity
...
Prevent integer overflows.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
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>
12 years ago
Michael Niedermayer
278a923c51
jpeg2000: Validate SIZ parsing
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Michael Niedermayer
d3cb302b88
jpeg2000: Validate SOT parsing
...
Avoid some overreads.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
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>
12 years ago
Luca Barbato
5efadcb8cd
jpeg2000: Clean up return paths and error messages
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Luca Barbato
be3271009e
jpeg2000: Define the maximum decomposition levels
...
And define the resolution levels according.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
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>
12 years ago
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>
12 years ago
Anton Khirnov
7c57a582a0
jpeg2000dec: don't use deprecated PIX_FMT values
12 years ago
Diego Biurrun
a349458e67
jpeg2000dec: Use correct printf length modifier for pointer differences
...
Also eliminate an unnecessary cast. Fixes the following warning:
jpeg2000dec.c:1200:20: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘long long unsigned int’
12 years ago
Janne Grunau
70f9661542
jpeg2000dec: initialize static data just once
12 years ago
Janne Grunau
45a1694fde
jpeg2000dec: cleanup properly after decoding errors
...
Fixes memory leak in fate-redcode-demux.
12 years ago
Nicolas Bertrand
28816f9db8
jpeg2000: Fix uninitialized data errors pointed out by valgrind/memcheck
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years ago
Nicolas Bertrand
2e2d24667a
jpeg2000: Add mutlti-threading support to decoder
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years ago
Janne Grunau
10f1a4d9bd
jpeg2kdec: output is native endian AV_PIX_FMT_XYZ12
12 years ago
Nicolas Bertrand
c81a706381
JPEG 2000 decoder for DCinema
...
Based on the 2007 GSoC project from Kamil Nowosad <k.nowosad@students.mimuw.edu.pl>
Updated to current programming standards, style and many more small
fixes by Diego Biurrun <diego@biurrun.de>.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years ago