From: Michael Niedermayer <[email protected]>
Signed-off-by: Luca Barbato <[email protected]>
---
libavcodec/jpeg2k.h | 4 ----
libavcodec/jpeg2kdec.c | 8 +++-----
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/libavcodec/jpeg2k.h b/libavcodec/jpeg2k.h
index f3e11cb..b73c086 100644
--- a/libavcodec/jpeg2k.h
+++ b/libavcodec/jpeg2k.h
@@ -136,8 +136,6 @@ typedef struct Jpeg2KCodingStyle {
log2_cblk_height; // exponent of codeblock size
uint8_t transform; // DWT type
uint8_t csty; // coding style
- uint8_t log2_prec_width,
- log2_prec_height; // precinct size
uint8_t nlayers; // number of layers
uint8_t mct; // multiple component transformation
uint8_t cblk_style; // codeblock coding style
@@ -172,7 +170,6 @@ typedef struct Jpeg2KCblk {
} Jpeg2KCblk; // code block
typedef struct Jpeg2KPrec {
- uint16_t xi0, yi0; // codeblock indexes ([xi0, xi1))
uint16_t nb_codeblocks_width;
uint16_t nb_codeblocks_height;
Jpeg2KTgtNode *zerobits;
@@ -186,7 +183,6 @@ typedef struct Jpeg2KPrec {
typedef struct Jpeg2KBand {
uint16_t coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}}
uint16_t log2_cblk_width, log2_cblk_height;
- uint16_t cblknx, cblkny;
float stepsize; // quantization stepsize
Jpeg2KPrec *prec;
} Jpeg2KBand; // subband
diff --git a/libavcodec/jpeg2kdec.c b/libavcodec/jpeg2kdec.c
index afba557..bf1fd10 100644
--- a/libavcodec/jpeg2kdec.c
+++ b/libavcodec/jpeg2kdec.c
@@ -318,6 +318,9 @@ static int get_cox(Jpeg2KDecoderContext *s,
Jpeg2KCodingStyle *c)
c->log2_prec_widths[i] = byte & 0x0F; // precinct PPx
c->log2_prec_heights[i] = (byte >> 4) & 0x0F; // precinct PPy
}
+ } else {
+ memset(c->log2_prec_widths , 15, sizeof(c->log2_prec_widths ));
+ memset(c->log2_prec_heights, 15, sizeof(c->log2_prec_heights));
}
return 0;
}
@@ -332,9 +335,6 @@ static int get_cod(Jpeg2KDecoderContext *s,
Jpeg2KCodingStyle *c,
if (bytestream2_get_bytes_left(&s->g) < 5)
return AVERROR_INVALIDDATA;
- tmp.log2_prec_width =
- tmp.log2_prec_height = 15;
-
tmp.csty = bytestream2_get_byteu(&s->g);
// get progression order
@@ -650,8 +650,6 @@ static int jpeg2k_decode_packet(Jpeg2KDecoderContext *s,
if (band->coord[0][0] == band->coord[0][1] ||
band->coord[1][0] == band->coord[1][1])
continue;
- prec->yi0 = 0;
- prec->xi0 = 0;
nb_code_blocks = prec->nb_codeblocks_height *
prec->nb_codeblocks_width;
for (cblkno = 0; cblkno < nb_code_blocks; cblkno++) {
--
1.7.9.5
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel