Luca Barbato
570fcaf332
jpeg2000: Factor out prec init
...
Makes debugging a little simpler.
9 years ago
Luca Barbato
95a41311ac
jpeg2000: Factor out band stepsize initialization
9 years ago
Luca Barbato
7fb93eae43
jpeg2000: Factor out band initialization
9 years ago
Ganesh Ajjanagadde
36f7a37895
avcodec/jpeg2000: comment out unused variable
...
Fixes -Wunused-const-variable from
http://fate.ffmpeg.org/report.cgi?time=20150820031140&slot=arm64-darwin-clang-apple-5.1
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
96e73fa649
avcodec/jpeg2000dec: Merge i_stepsize/2 decoder special case into dequant
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
317be53ca6
avcodec/jpeg2000: Support 32 decomposition levels
...
Fixes Ticket4680
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
c72a831931
avcodec/jpeg2000dec: Support progression order changes
...
Fixes Ticket4657
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
f1e173049e
avcodec/jpeg2000: Remove CBLK limit
...
This also reduces the amount of memory needed
Fixes Ticket4672
The new code seems slightly faster as well, probably due to better cache usage
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
67fc898243
avcodec/jpeg2000: Improve right bottom precinct positions
...
Fixes Ticket4656
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
4e926fb969
avcodec/jpeg2000: Move L band scaling from the 9/7f wavelet to quantization stage
...
This reduces the number of operations
Its not done for 9/7i as that would overflow thanks to JPEG2000 allowing
32 decomposition levels
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
6c7b1597c7
avcodec/jpeg2000: Move H band scaling from wavelet into quantization code
...
This reduces the number of operations done and is equivalent except for
rounding
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
1c495b0bf6
avcodec/jpeg2000: Move gainb handling into the quantization code
...
thats how the specification defines it, this also improves numerical
accuracy of the integer wavelet implementation. It otherwise should
be equivalent, in case of overflows this can be reverted.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
ec5164aa31
avcodec/jpeg2000: Fix regression with multiple tiles
...
Fixes Ticket 4624
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
a206c13289
avcodec/jpeg2000: Change codeblock coords to same origin as bands
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
d9841e53e2
avcodec/jpeg2000: Change precinct coords to same origin as bands
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
59c107292c
avcodec/jpeg2000: Fix band coords
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
James Almer
9f815bc2c2
avcodec/jpeg200dsp: add ff_rct_int_{sse2,avx2}
...
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
James Almer
7912a6830d
avcodec/jpeg200dsp: add ff_ict_float_{sse,avx}
...
Original intrinsics version by Nicolas Bertrand.
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
Michael Niedermayer
dc73c7adc0
avcodec/jpeg2000dec: Fix Selective arithmetic coding bypass and Multiple codeword segments
...
These 2 are highly related so they are in the same commit
Fixes part of Ticket4605
Fixes p0_04.j2k
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
dbbb31e5bb
avcodec/jpeg2000: remove unused variable
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
44327cbc9a
avcodec/jpeg2000: Disable special case for JPEG2000_QSTY_SI
...
The code gave apparently completely wrong values
Fixes Ticket2872
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
Vittorio Giovara
a2448cfe16
jpeg2000: do not compute the same value twice
...
CC: libav-stable@libav.org
Bug-Id: CID 1026771 / CID 1026772 / CID 1026773
10 years ago
Vittorio Giovara
10306e9c5f
jpeg2000: fix dereferencing invalid pointers during cleanup
...
CC: libav-stable@libav.org
Found-by: Laurent Butti <laurentb@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
11 years ago
Diego Biurrun
fe4d5fe936
jpeg2000: Mark static data init functions as av_cold
11 years ago
Lou Logan
88f2586adb
fix various typos
...
Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
e54f4510aa
avcodec/jpeg2000: zero i/f_data
...
Fixes uninitialized use of variables
Fixes part of Ticket2921
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
9e477a3770
jpeg2000: fix null pointer dereference in case of malloc failure
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
09927f3eaa
jpeg2000: zero reslevel array on allocation
...
prevent use of uninitialized values
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
912ce9dd20
jpeg2000: fix dereferencing invalid pointers
...
Found-by: Laurent Butti <laurentb@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 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
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
db13e02c6f
jpeg2000: Compute corrections of sub-band coordinates
...
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
690c8af97b
jpeg2000: Remove unneeded variable initialization
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Michael Niedermayer
4cbd5ed11b
jpeg2000: Fix compute precedence error in lut_gain index
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
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>
12 years ago
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>
12 years ago
Michael Niedermayer
2c3901b2c3
jpeg2000: Remove unneeded returns
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
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>
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
ffb1051b9b
jpeg2000: Zero prec->cblk
...
Prevent use of uninitialized memory / valgrind failure
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
6e9bfc19bd
jpeg2000: check that nreslevels2decode has been initialized before use
...
Fixes out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
234f76ae7d
jpeg2000: Fix unintended sign extension in malloc arguments of prec
...
Fixes: CID1026772/3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
d8c10324ed
jpeg2000: Fix Unintended sign extension in malloc arguments of cblk.
...
Fixes CID1026770
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
9d56ccf5af
j2k/jpeg2000dec: merge
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
62d00aa22f
jpeg2000/j2k: merge j2k/jpeg2000.c/h
...
Now only j2kdec / jpeg2000dec.c remain
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
c2ac389bba
jpeg2000: remove unneeded casts
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
09e03a8467
jpeg2000: merges quantization fixes from j2k
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
efc2df2e27
jpeg2000: remove unneeded variable initialization
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago