You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/mjpegenc: Constify parent ctx in encode_block()
Said parent is shared between all slice contexts and encode_block() can be run concurrently by slice threads, so the parent context must not be (and is not) modified. So constify the pointers. Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -480,9 +480,9 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n)
|
|||||||
{
|
{
|
||||||
int mant, nbits, code, i, j;
|
int mant, nbits, code, i, j;
|
||||||
int component, dc, run, last_index, val;
|
int component, dc, run, last_index, val;
|
||||||
MJpegContext *m = s->mjpeg_ctx;
|
const MJpegContext *const m = s->mjpeg_ctx;
|
||||||
uint8_t *huff_size_ac;
|
const uint16_t *huff_code_ac;
|
||||||
uint16_t *huff_code_ac;
|
const uint8_t *huff_size_ac;
|
||||||
|
|
||||||
/* DC coef */
|
/* DC coef */
|
||||||
component = (n <= 3 ? 0 : (n&1) + 1);
|
component = (n <= 3 ? 0 : (n&1) + 1);
|
||||||
|
Reference in New Issue
Block a user