Michael Niedermayer
9c8939216b
avcodec/jpeg2000dec: Implement progression order RLCP
...
This works with one of 2 RLCP samples i have, the other appears to also
use selective arithemtic coding bypass which may or may not be the reason why it does
not work
Sample: p0_16.j2k
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
b58a3c8975
avcodec/jpeg2000dec: Print the correct variable in the component error message
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
81471d8246
avcodec/jpeg2000dec: increase tile_parts to 6
...
Fixes Ticket4602
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
213f2da46a
avcodec/jpeg2000dec: Fix shift for RGB(A)48/64
...
Found-by: carl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
0916938a8d
avcodec/jpeg2000dec: Fix gain regression with gray16
...
Found-by: carl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
45db921806
avcodec/jpeg2000dec: Add placeholder for PLT parsing
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
b6ee1912f9
avcodec/jpeg2000dec: Handle Psot = 0
...
Fixes Ticket2869
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
7c9fcdfabd
avcodec/jpeg2000dec: Fix some 5/3 bitexactness issues
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
074159ed70
avcodec/jpeg2000dec: Fix subsampled decoding
...
Fixes part of Ticket3619
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
12ba1b2b4d
avcodec/jpeg2000dec: Check that coords match before applying ICT
...
This avoid potential out of array accesses
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
028c59c17b
avcodec/jpeg2000dec: Fix high bit depth branch sample shift
...
Fix part of Ticket3619
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
f8f155a18a
avcodec/jpeg2000dec: fix boolean operator
...
Fixes CID1271791 #7-6
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Carl Eugen Hoyos
f018b1f3a0
Support YA16 in jpeg 2000.
10 years ago
James Almer
82f8eb5f77
jpeg2000: split off inverse MCT as Jpeg2000DSP
...
This makes the addition of arch optimized functions easier.
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
10 years ago
James Almer
c9f2ec8a34
jpeg2000: split off inverse MCT decoding as Jpeg2000DSP
...
This makes the addition of arch optimized functions easier.
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
Vittorio Giovara
cbc808d726
jpeg2000: enable 4 component pixel formats
...
Bug-Id: 721
CC: libav-stable@libav.org
Sample-Id: 31230.mov
10 years ago
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>
11 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>
11 years ago
Michael Niedermayer
63c0e9077e
avcodec/jpeg2000dec: fix near null pointer dereference
...
Fixes Ticket2840
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 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>
11 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>
11 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>
11 years ago
Michael Niedermayer
db33010483
jpeg2000dec: silence unused variable warning
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
fc6de70c44
jpeg2000dec: Support non subsampled 8bit planar pixel formats
...
Fixes file2.jp2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 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>
11 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
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
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