summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-07-23 06:14:10 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-07-31 04:37:27 +0200
commita18c372390346d089580a18183115c8f8ef2d1ec (patch)
tree912dfbbeb6089e2b02cb869d3395f31bd99925ea
parent0980d3801d12939bd0eaa6b23b7a21d9012d8c5e (diff)
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>
-rw-r--r--libavcodec/jpeg2000dec.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 4823127758..503753c4d6 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -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;