summaryrefslogtreecommitdiff
path: root/libavcodec/jpeg2000.h
Commit message (Collapse)AuthorAge
* libavcodec/jpeg2000: fix tag tree resetGautam Ramakrishnan2020-08-30
| | | | | | | | | | The implementation of the tag tree did not set the correct reset value for the encoder. This lead to inefficent tag tree being encoded. This patch fixes the implementation of the ff_tag_tree_zero() function. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/j2kenc: Support for multiple layersGautam Ramakrishnan2020-08-30
| | | | | | | | | | | This patch allows setting a compression ratio and to set multiple layers. The user has to input a compression ratio for each layer. The per layer compression ration can be set as follows: -layer_rates "r1,r2,...rn" for to create 'n' layers. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/j2kenc: Fix tag tree codingGautam Ramakrishnan2020-08-30
| | | | | | | | | | The implementation of tag tree encoding was incorrect. However, this error was not visible as the current j2k encoder encodes only 1 layer. This patch fixes tag tree coding for JPEG2000 such tag tree coding would work for multi layer encoding. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/jpeg2000: Make tag tree functions non staticGautam Ramakrishnan2020-08-30
| | | | | | | This patch makes the tag_tree_zero() and tag_tree_size() functions non static and callable from other files. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Handle reducedresno of 32Michael Niedermayer2020-08-06
| | | | | | | | | Fixes: shift exponent 32 is too large for 32-bit type 'int' Fixes: 24566/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-6033783737024512 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Gautam Ramakrishnan <gautamramk@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/jpeg2000.c: Precinct size check removedGautam Ramakrishnan2020-06-30
| | | | | | | | | | This patch removes a check which throws an error if the log2 precinct width/height is 0. The standard allows the first component to have 0 as the log2 width/height. However, to ensure proper intialization of coding style, an extra check has been added. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/jpeg2000dec.c: ROI marker supportGautam Ramakrishnan2020-04-23
| | | | | | | | | This patch adds support for decoding images with a Region of Interest. Allows decoding samples such as p0_03.j2k. This patch should fix ticket #4681. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/jpeg2000.h: fix comments for JPEG2000 markersGautam Ramakrishnan2020-03-27
| | | | | | | The comments for some of the markers were incorrect. This patch fixes the comments associated with the markers. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Allocate lengthinc and data_start arrays as neededMichael Niedermayer2017-12-21
| | | | | | | | | Decreases memory requirements Fixes: OOM Fixes: 4525/clusterfuzz-testcase-minimized-6400713073623040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000: Only allocate Jpeg2000Pass for the encoderMichael Niedermayer2017-12-01
| | | | | | | | | Reduces memory needed. Fixes: OOM Fixes: 4427/clusterfuzz-testcase-minimized-5106919271301120 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000: Dynamically allocate codeblock dataMichael Niedermayer2017-11-22
| | | | | | | | | | | Fixes: OOM Fixes: 3541/clusterfuzz-testcase-minimized-6469958596820992 Adds support for decoding codeblock data larger than 8kb Reduces decoder memory consumption Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000: Fixes integer overflow in ff_jpeg2000_ceildivpow2()Michael Niedermayer2017-06-16
| | | | | | | | Fixes: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 2231/clusterfuzz-testcase-minimized-4565181982048256 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000: Fix runtime error: signed integer overflow: 4185 + ↵Michael Niedermayer2017-05-28
| | | | | | | | | 2147483394 cannot be represented in type 'int' Fixes: 1870/clusterfuzz-testcase-minimized-4686788029317120 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000: Change coord to 32bit to support larger than 32k width or ↵Michael Niedermayer2015-11-15
| | | | | | | | | height Fixes: 03e0abe721b1174856d41a1eb5d6a896/signal_sigabrt_7ffff6ae7cc9_3813_e71bf3541abed3ccba031cd5ba0269a4.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000: Support 32 decomposition levelsMichael Niedermayer2015-06-28
| | | | | | Fixes Ticket4680 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/jpeg2000: support >32bit in ff_jpeg2000_ceildivpow2()Michael Niedermayer2015-06-28
| | | | | | Fixes part of Ticket4680 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/jpeg2000: Avoid one shift in ff_jpeg2000_ceildivpow2()Michael Niedermayer2015-06-28
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/jpeg2000dec: Support progression order changesMichael Niedermayer2015-06-26
| | | | | | Fixes Ticket4657 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/jpeg2000: Remove CBLK limitMichael Niedermayer2015-06-26
| | | | | | | | | 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>
* avcodec/jpeg2000: change flags array type to 16bitMichael Niedermayer2015-06-24
| | | | | | reduce memory needed for flags Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* vcodec/jpeg2000: Increase cblk size limit to 128Michael Niedermayer2015-06-24
| | | | | | Fixes Ticket4649 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/j2kenc: Properly flush the end of the truncated AC streamMichael Niedermayer2015-06-17
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/jpeg2000dec: Improve readability of SOP checkMichael Niedermayer2015-06-15
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/jpeg2000dec: Fix Selective arithmetic coding bypass and Multiple ↵Michael Niedermayer2015-06-12
| | | | | | | | | | 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>
* avcodec/jpeg2000dec: add some sanity checking on newpassesMichael Niedermayer2015-06-12
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit 'be3271009ef893fbed9640e8edbd771685fd957b'Michael Niedermayer2013-07-03
|\ | | | | | | | | | | | | | | | | | | * commit 'be3271009ef893fbed9640e8edbd771685fd957b': jpeg2000: Define the maximum decomposition levels Conflicts: libavcodec/jpeg2000.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * jpeg2000: Define the maximum decomposition levelsLuca Barbato2013-07-02
| | | | | | | | | | | | And define the resolution levels according. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | jpeg2000: Make nreslevel fields intMichael Niedermayer2013-06-05
| | | | | | | | | | | | This prevents potential integer overflows Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | jpeg2000/j2k: merge j2k/jpeg2000.c/hMichael Niedermayer2013-05-30
| | | | | | | | | | | | Now only j2kdec / jpeg2000dec.c remain Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | j2k/jpeg2000: split data pointer in int & float.Michael Niedermayer2013-05-30
| | | | | | | | | | | | | | | | | | | | | | | | This fixes a TODO item and unifies both decoders structures It also fixes undefined behavior due to aliasing violations I choose 2 fields instead of a union because mistakely using the wrong type with a union will lead to hard to debug "wrong output" while with 2 fields mistakely using the wrong type will crash with a null pointer derefernce which is much easier to debug Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | j2k/jpeg2000: split stepsize in float & int variablesMichael Niedermayer2013-05-28
| | | | | | | | | | | | This is more clear and less prone to mistakes. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | jpeg2000: merge mant type from j2kMichael Niedermayer2013-05-27
| | | | | | | | | | | | mant fits in 16bit Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | j2k/jpeg2000: drop xi/yi0/1 from Jpeg2000PrecMichael Niedermayer2013-05-27
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | j2k/jpeg2000 headers: Cblk/Prec cleanup & mergeMichael Niedermayer2013-05-27
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | j2k/jpeg2000: log2_prec size cleanupMichael Niedermayer2013-05-26
| | | | | | | | | | | | This also changes the cblk size storage method to what jpeg2000 uses Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-04-22
|/ | | | | | | | | | | | | | | | | | | | | | * qatar/master: avcodec: Bump minor for JPEG 2000 decoder JPEG 2000 decoder for DCinema The mqc code is merged, the rest is added independent of the existing jpeg2000 decoder and encoder. Conflicts: Changelog doc/general.texi libavcodec/Makefile libavcodec/allcodecs.c libavcodec/mqc.c libavcodec/mqc.h libavcodec/mqcdec.c libavcodec/version.h tests/fate/video.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
* JPEG 2000 decoder for DCinemaNicolas Bertrand2013-04-22
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>