Diego Biurrun
fe4d5fe936
jpeg2000: Mark static data init functions as av_cold
11 years ago
Carl Eugen Hoyos
ced0d6c14d
Use correct msvc type specifiers for ptrdiff_t and size_t.
...
The Windows runtime aborts if it finds %t or %z.
Fixes ticket #3472 .
Reviewed-by: Ronald Bultje
11 years ago
Diego Biurrun
cc8163e1a3
avcodec: more correct printf specifiers
11 years ago
Lukasz Marek
aeb2905fb7
lavc/jpeg2000dec: silent warning discards qualifiers
...
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
8001e9f7d1
avcodec/jpeg2000dec: fix error detection in pix_fmt_match()
...
Fixes out of array accesses with CODEC_FLAG_EMU_EDGE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
723e7b86ea
avcodec/jpeg2000dec: calculate planar and pixelsize from pixel format descriptor
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
55fa898969
avcodec/jpeg2000dec: zero Jpeg2000QuantStyle structure before use in get_qcd()
...
Fixes: msan_uninit-mem_7f50b84aac30_6823_mjp2.mov
Fixes use of uninitialized memory
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
3d5a5e86be
avcodec/jpeg2000dec: Check precno before using it in JPEG2000_PGOD_CPRL
...
Fixes out of array reads
Fixes: asan_heap-oob_f0de57_6823_mjp2.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
780669ef7c
avcodec/jpeg2000dec: non zero image offsets are not supported
...
Fixes out of array accesses
Fixes Ticket3080
Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
a1b9004b76
avcodec/jpeg2000dec: fix context consistency with too large lowres
...
Fixes out of array accesses
Fixes Ticket2898
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
fe448cd28d
avcodec/jpeg2000dec: prevent out of array accesses in pixel addressing
...
Fixes Ticket2921
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
ac3b01a9c0
avcodec/jpeg2000dec: check transform equality in MCT
...
Fixes null pointer dereference
Fixes Ticket2843
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
Michael Niedermayer
fcd19d6c8d
avcodec/jpeg2000dec: Zero code and quant style
...
This prevents future frames from using half initialized/inconsistent
structures
Fixes assertion failure
Fixes Ticket2897
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
2dd38a1d48
avcodec/jpeg2000dec: move "missing SIZ" check up
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
Clément Bœsch
04427182bc
avcodec: typo fix sepera* → separa*
11 years ago
Michael Niedermayer
e428632c1a
avcodec/jpeg2000dec: print invalid cdx/y values
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Carl Eugen Hoyos
f99f7f4025
Set bits_per_raw_sample when reading j2k frames.
11 years ago
Michael Niedermayer
4ced30908f
avcodec/jpeg2000dec: make SOC finding code more robust
...
Fixes file from Ticket860
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
9a271a9368
jpeg2000: check log2_cblk dimensions
...
Fixes out of array access
Fixes Ticket2895
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
8bb11c3ca7
avcodec/jpeg2000dec: Check cdx/y values more carefully
...
Some invalid values where not handled correctly in the later pixel
format matching code.
Fixes out of array accesses
Fixes Ticket2848
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
63c0e9077e
avcodec/jpeg2000dec: fix near null pointer dereference
...
Fixes Ticket2840
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
5cd57e8758
avcodec/jpeg2000dec: check sample sepration for validity
...
Fixes division by 0
Fixes Ticket2841
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
bff371e34c
jpeg2000dec: simplify jpeg2000_read_bitstream_packets()
...
23 lines less
less error prone as theres no more need to update *_size on every read
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
1434df3b93
jpeg2000dec: Support non subsampled 9-16bit planar pixel formats
...
This applies changes similar to fc6de70c44
to the >8bit codepath
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
db33010483
jpeg2000dec: silence unused variable warning
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
fc6de70c44
jpeg2000dec: Support non subsampled 8bit planar pixel formats
...
Fixes file2.jp2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
99de97cabf
jpeg2000dec: parse CDEF
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Conflicts:
libavcodec/jpeg2000dec.c
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Carl Eugen Hoyos
b39a6bbe7f
Fix pix_fmt detection in the native jpeg2000 decoder.
...
Based on b7a928b
by Michael Bradshaw.
Fixes ticket #2683 .
Reviewed-by: Nicolas Bertrand
12 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
f57119b8e5
jpeg2000: fix overflow in dequantization
...
Fixes decoding of file generated with:
ffmpeg -f lavfi -i smptehdbars=hd720 -pix_fmt rgb48 /tmp/o.jp2
Reviewed-by: Nicolas BERTRAND <nicoinattendu@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Nicolas Bertrand
dd1382ac95
jpeg2000: Initialize only once mqc arrays
...
Increases encoding and decoding speed
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
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
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
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
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
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
aa16bbaf9b
jpeg2000: Refactor SOT marker parsing
...
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
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
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
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
5b73916d34
jpeg2000: Simplify init_tile()
...
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
33e665a6ab
jpeg2000: Update pixel format support
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago