avcodec/jpeg2000dec: Constify slice threads' ptr to main context

Modifying the main context from a slice thread is (usually)
a data race, so it must not happen. So only use a pointer to const
to access the main context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-07-23 06:14:10 +02:00
parent 0980d3801d
commit a18c372390
1 changed files with 6 additions and 6 deletions

View File

@ -1679,7 +1679,7 @@ static void decode_refpass(Jpeg2000T1Context *t1, int width, int height,
}
}
static void decode_clnpass(Jpeg2000DecoderContext *s, Jpeg2000T1Context *t1,
static void decode_clnpass(const Jpeg2000DecoderContext *s, Jpeg2000T1Context *t1,
int width, int height, int bpno, int bandno,
int seg_symbols, int vert_causal_ctx_csty_symbol)
{
@ -1745,7 +1745,7 @@ static void decode_clnpass(Jpeg2000DecoderContext *s, Jpeg2000T1Context *t1,
}
}
static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
static int decode_cblk(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
Jpeg2000T1Context *t1, Jpeg2000Cblk *cblk,
int width, int height, int bandpos, uint8_t roi_shift)
{
@ -1896,7 +1896,7 @@ static void dequantization_int_97(int x, int y, Jpeg2000Cblk *cblk,
}
}
static inline void mct_decode(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
static inline void mct_decode(const Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
{
int i, csize = 1;
void *src[3];
@ -1937,7 +1937,7 @@ static inline void roi_scale_cblk(Jpeg2000Cblk *cblk,
}
}
static inline void tile_codeblocks(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
static inline void tile_codeblocks(const Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
{
Jpeg2000T1Context t1;
@ -2009,7 +2009,7 @@ static inline void tile_codeblocks(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
}
#define WRITE_FRAME(D, PIXEL) \
static inline void write_frame_ ## D(Jpeg2000DecoderContext * s, Jpeg2000Tile * tile, \
static inline void write_frame_ ## D(const Jpeg2000DecoderContext * s, Jpeg2000Tile * tile, \
AVFrame * picture, int precision) \
{ \
const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(s->avctx->pix_fmt); \
@ -2078,7 +2078,7 @@ WRITE_FRAME(16, uint16_t)
static int jpeg2000_decode_tile(AVCodecContext *avctx, void *td,
int jobnr, int threadnr)
{
Jpeg2000DecoderContext *s = avctx->priv_data;
const Jpeg2000DecoderContext *s = avctx->priv_data;
AVFrame *picture = td;
Jpeg2000Tile *tile = s->tile + jobnr;