mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-03 13:32:10 +00:00
Merge commit 'be3271009ef893fbed9640e8edbd771685fd957b'
* commit 'be3271009ef893fbed9640e8edbd771685fd957b': jpeg2000: Define the maximum decomposition levels Conflicts: libavcodec/jpeg2000.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
b0448e5123
@ -67,7 +67,9 @@ enum Jpeg2000Quantsty { // quantization style
|
||||
#define JPEG2000_MAX_CBLKW 64
|
||||
#define JPEG2000_MAX_CBLKH 64
|
||||
|
||||
#define JPEG2000_MAX_RESLEVELS 33
|
||||
|
||||
#define JPEG2000_MAX_DECLEVELS 32
|
||||
#define JPEG2000_MAX_RESLEVELS (JPEG2000_MAX_DECLEVELS + 1)
|
||||
|
||||
// T1 flags
|
||||
// flags determining significance of neighbor coefficients
|
||||
@ -143,8 +145,8 @@ typedef struct Jpeg2000CodingStyle {
|
||||
} Jpeg2000CodingStyle;
|
||||
|
||||
typedef struct Jpeg2000QuantStyle {
|
||||
uint8_t expn[32 * 3]; // quantization exponent
|
||||
uint16_t mant[32 * 3]; // quantization mantissa
|
||||
uint8_t expn[JPEG2000_MAX_DECLEVELS * 3]; // quantization exponent
|
||||
uint16_t mant[JPEG2000_MAX_DECLEVELS * 3]; // quantization mantissa
|
||||
uint8_t quantsty; // quantization style
|
||||
uint8_t nguardbits; // number of guard bits
|
||||
} Jpeg2000QuantStyle;
|
||||
|
@ -396,7 +396,7 @@ static int get_qcx(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q)
|
||||
x = bytestream2_get_be16u(&s->g);
|
||||
q->expn[0] = x >> 11;
|
||||
q->mant[0] = x & 0x7ff;
|
||||
for (i = 1; i < 32 * 3; i++) {
|
||||
for (i = 1; i < JPEG2000_MAX_DECLEVELS * 3; i++) {
|
||||
int curexpn = FFMAX(0, q->expn[0] - (i - 1) / 3);
|
||||
q->expn[i] = curexpn;
|
||||
q->mant[i] = q->mant[0];
|
||||
|
Loading…
Reference in New Issue
Block a user