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.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -480,9 +480,9 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n) · 479 unmodified lines | |||
| 480 | { | 480 | { |
| 481 | int mant, nbits, code, i, j; | 481 | int mant, nbits, code, i, j; |
| 482 | int component, dc, run, last_index, val; | 482 | int component, dc, run, last_index, val; |
| 483 | MJpegContext *m = s->mjpeg_ctx; | 483 | const MJpegContext *const m = s->mjpeg_ctx; |
| 484 | uint8_t *huff_size_ac; | 484 | const uint16_t *huff_code_ac; |
| 485 | uint16_t *huff_code_ac; | 485 | const uint8_t *huff_size_ac; |
| 486 | 486 | ||
| 487 | /* DC coef */ | 487 | /* DC coef */ |
| 488 | component = (n <= 3 ? 0 : (n&1) + 1); | 488 | component = (n <= 3 ? 0 : (n&1) + 1); |