avcodec/jpeg2000dec, j2kenc: Constify where appropriate

Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
release/7.0
Andreas Rheinhardt 9 months ago
parent 32178c2f28
commit b48b3250ca
  1. 2
      libavcodec/j2kenc.c
  2. 14
      libavcodec/jpeg2000dec.c

@ -781,7 +781,7 @@ static void putnumpasses(Jpeg2000EncoderContext *s, int n)
static int encode_packet(Jpeg2000EncoderContext *s, Jpeg2000ResLevel *rlevel, int layno, static int encode_packet(Jpeg2000EncoderContext *s, Jpeg2000ResLevel *rlevel, int layno,
int precno, uint8_t *expn, int numgbits, int packetno, int precno, const uint8_t *expn, int numgbits, int packetno,
int nlayers) int nlayers)
{ {
int bandno, empty = 1; int bandno, empty = 1;

@ -489,7 +489,7 @@ static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c)
/* get coding parameters for a particular tile or whole image*/ /* get coding parameters for a particular tile or whole image*/
static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c, static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
uint8_t *properties) const uint8_t *properties)
{ {
Jpeg2000CodingStyle tmp; Jpeg2000CodingStyle tmp;
int compno, ret; int compno, ret;
@ -639,7 +639,7 @@ static int get_qcx(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q)
/* Get quantization parameters for a particular tile or a whole image. */ /* Get quantization parameters for a particular tile or a whole image. */
static int get_qcd(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q, static int get_qcd(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q,
uint8_t *properties) const uint8_t *properties)
{ {
Jpeg2000QuantStyle tmp; Jpeg2000QuantStyle tmp;
int compno, ret; int compno, ret;
@ -1004,7 +1004,7 @@ static int getlblockinc(Jpeg2000DecoderContext *s)
return res; return res;
} }
static inline void select_header(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile, static inline void select_header(Jpeg2000DecoderContext *s, const Jpeg2000Tile *tile,
int *tp_index) int *tp_index)
{ {
s->g = tile->tile_part[*tp_index].header_tpg; s->g = tile->tile_part[*tp_index].header_tpg;
@ -1015,8 +1015,8 @@ static inline void select_header(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
} }
} }
static inline void select_stream(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile, static inline void select_stream(Jpeg2000DecoderContext *s, const Jpeg2000Tile *tile,
int *tp_index, Jpeg2000CodingStyle *codsty) int *tp_index, const Jpeg2000CodingStyle *codsty)
{ {
s->g = tile->tile_part[*tp_index].tpg; s->g = tile->tile_part[*tp_index].tpg;
if (bytestream2_get_bytes_left(&s->g) == 0 && s->bit_index == 8) { if (bytestream2_get_bytes_left(&s->g) == 0 && s->bit_index == 8) {
@ -1033,9 +1033,9 @@ static inline void select_stream(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
} }
static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile, int *tp_index, static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile, int *tp_index,
Jpeg2000CodingStyle *codsty, const Jpeg2000CodingStyle *codsty,
Jpeg2000ResLevel *rlevel, int precno, Jpeg2000ResLevel *rlevel, int precno,
int layno, uint8_t *expn, int numgbits) int layno, const uint8_t *expn, int numgbits)
{ {
int bandno, cblkno, ret, nb_code_blocks; int bandno, cblkno, ret, nb_code_blocks;
int cwsno; int cwsno;

Loading…
Cancel
Save