History

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.

Andreas Rheinhardt committed 1 year ago

Commit 8940a611 parent 60cae501 file · +3 −3Browse files

Unified · Split

libavcodec/mjpegenc.c+3−3
@@ -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);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t