History

avutil: remove deprecated FF_API_PALETTE_HAS_CHANGED

Deprecated since 2023-05-18.

James Almer committed 1 year ago

Commit 6e80ec91 parent 106168947 files · +4 −317Browse files

Unified · Split

47 files
  1. libavcodec/8bps.c +0 −7
  2. libavcodec/ansi.c +0 −10
  3. libavcodec/bethsoftvideo.c +0 −5
  4. libavcodec/bfi.c +0 −10
  5. libavcodec/bintext.c +0 −5
  6. libavcodec/bmvvideo.c +0 −5
  7. libavcodec/brenderpix.c +0 −12
  8. libavcodec/c93.c +0 −5
  9. libavcodec/cdgraphics.c +0 −5
  10. libavcodec/cdtoons.c +0 −5
  11. libavcodec/cinepak.c +0 −7
  12. libavcodec/dds.c +0 −11
  13. libavcodec/dfa.c +0 −5
  14. libavcodec/dsicinvideo.c +0 −5
  15. libavcodec/dxa.c +0 −5
  16. libavcodec/flicvideo.c +0 −5
  17. libavcodec/gemdec.c +0 −5
  18. libavcodec/idcinvideo.c +0 −7
  19. libavcodec/imx.c +0 −10
  20. libavcodec/interplayvideo.c +0 −7
  21. libavcodec/jvdec.c +0 −12
  22. libavcodec/kmvc.c +0 −17
  23. libavcodec/mscc.c +0 −5
  24. libavcodec/msrle.c +0 −8
  25. libavcodec/mss1.c +3 −11
  26. libavcodec/msvideo1.c +0 −7
  27. libavcodec/pafvideo.c +0 −5
  28. libavcodec/pictordec.c +0 −5
  29. libavcodec/psd.c +0 −5
  30. libavcodec/qdrw.c +0 −5
  31. libavcodec/qpeg.c +0 −7
  32. libavcodec/qtrle.c +0 −8
  33. libavcodec/rawdec.c +1 −12
  34. libavcodec/rscc.c +0 −7
  35. libavcodec/sga.c +0 −5
  36. libavcodec/smacker.c +0 −5
  37. libavcodec/smc.c +0 −7
  38. libavcodec/targa.c +0 −5
  39. libavcodec/tiertexseqv.c +0 −5
  40. libavcodec/tmv.c +0 −5
  41. libavcodec/tscc.c +0 −5
  42. libavcodec/vb.c +0 −5
  43. libavcodec/vqavideo.c +0 −5
  44. libavcodec/yop.c +0 −6
  45. libavutil/frame.c +0 −5
  46. libavutil/frame.h +0 −8
  47. libavutil/version.h +0 −1
libavcodec/8bps.c+0−7
@@ -114,14 +114,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, · 113 unmodified lines
114114 }
115115
116116 if (avctx->bits_per_coded_sample <= 8) {
117−#if FF_API_PALETTE_HAS_CHANGED
118−FF_DISABLE_DEPRECATION_WARNINGS
119− frame->palette_has_changed =
120−#endif
121117 ff_copy_palette(c->pal, avpkt, avctx);
122−#if FF_API_PALETTE_HAS_CHANGED
123−FF_ENABLE_DEPRECATION_WARNINGS
124−#endif
125118
126119 memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
127120 }
libavcodec/ansi.c+0−10
@@ -262,11 +262,6 @@ static int execute_code(AVCodecContext * avctx, int c) · 261 unmodified lines
262262 AV_GET_BUFFER_FLAG_REF)) < 0)
263263 return ret;
264264 s->frame->pict_type = AV_PICTURE_TYPE_I;
265−#if FF_API_PALETTE_HAS_CHANGED
266−FF_DISABLE_DEPRECATION_WARNINGS
267− s->frame->palette_has_changed = 1;
268−FF_ENABLE_DEPRECATION_WARNINGS
269−#endif
270265 set_palette((uint32_t *)s->frame->data[1]);
271266 erase_screen(avctx);
272267 } else if (c == 'l') {
@@ -375,11 +370,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 102 unmodified lines
375370 }
376371
377372 s->frame->pict_type = AV_PICTURE_TYPE_I;
378−#if FF_API_PALETTE_HAS_CHANGED
379−FF_DISABLE_DEPRECATION_WARNINGS
380− s->frame->palette_has_changed = 1;
381−FF_ENABLE_DEPRECATION_WARNINGS
382−#endif
383373 set_palette((uint32_t *)s->frame->data[1]);
384374 if (!s->first_frame) {
385375 erase_screen(avctx);
libavcodec/bethsoftvideo.c+0−5
@@ -63,11 +63,6 @@ static int set_palette(BethsoftvidContext *ctx, GetByteContext *g) · 62 unmodified lines
6363 palette[a] = 0xFFU << 24 | bytestream2_get_be24u(g) * 4;
6464 palette[a] |= palette[a] >> 6 & 0x30303;
6565 }
66−#if FF_API_PALETTE_HAS_CHANGED
67−FF_DISABLE_DEPRECATION_WARNINGS
68− ctx->frame->palette_has_changed = 1;
69−FF_ENABLE_DEPRECATION_WARNINGS
70−#endif
7166 return 0;
7267 }
7368
libavcodec/bfi.c+0−10
@@ -83,19 +83,9 @@ static int bfi_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 82 unmodified lines
8383 pal++;
8484 }
8585 memcpy(bfi->pal, frame->data[1], sizeof(bfi->pal));
86−#if FF_API_PALETTE_HAS_CHANGED
87−FF_DISABLE_DEPRECATION_WARNINGS
88− frame->palette_has_changed = 1;
89−FF_ENABLE_DEPRECATION_WARNINGS
90−#endif
9186 } else {
9287 frame->pict_type = AV_PICTURE_TYPE_P;
9388 frame->flags &= ~AV_FRAME_FLAG_KEY;
94−#if FF_API_PALETTE_HAS_CHANGED
95−FF_DISABLE_DEPRECATION_WARNINGS
96− frame->palette_has_changed = 0;
97−FF_ENABLE_DEPRECATION_WARNINGS
98−#endif
9989 memcpy(frame->data[1], bfi->pal, sizeof(bfi->pal));
10090 }
10191
libavcodec/bintext.c+0−5
@@ -157,11 +157,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, · 156 unmodified lines
157157 if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0)
158158 return ret;
159159 s->frame->pict_type = AV_PICTURE_TYPE_I;
160−#if FF_API_PALETTE_HAS_CHANGED
161−FF_DISABLE_DEPRECATION_WARNINGS
162− s->frame->palette_has_changed = 1;
163−FF_ENABLE_DEPRECATION_WARNINGS
164−#endif
165160 memcpy(s->frame->data[1], s->palette, 16 * 4);
166161
167162 if (avctx->codec_id == AV_CODEC_ID_XBIN) {
libavcodec/bmvvideo.c+0−5
@@ -251,11 +251,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, · 250 unmodified lines
251251 }
252252
253253 memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
254−#if FF_API_PALETTE_HAS_CHANGED
255−FF_DISABLE_DEPRECATION_WARNINGS
256− frame->palette_has_changed = type & BMV_PALETTE;
257−FF_ENABLE_DEPRECATION_WARNINGS
258−#endif
259254
260255 outptr = frame->data[0];
261256 srcptr = c->frame;
libavcodec/brenderpix.c+0−12
@@ -245,12 +245,6 @@ static int pix_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 244 unmodified lines
245245 *pal_out++ = (0xFFU << 24) | bytestream2_get_be32u(&gb);
246246 bytestream2_skip(&gb, 8);
247247
248−#if FF_API_PALETTE_HAS_CHANGED
249−FF_DISABLE_DEPRECATION_WARNINGS
250− frame->palette_has_changed = 1;
251−FF_ENABLE_DEPRECATION_WARNINGS
252−#endif
253−
254248 chunk_type = bytestream2_get_be32(&gb);
255249 } else if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
256250 /* no palette supplied, use the default one */
@@ -260,12 +254,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 3 unmodified lines
260254 av_log(avctx, AV_LOG_WARNING,
261255 "Using default palette, colors might be off.\n");
262256 memcpy(pal_out, std_pal_table, sizeof(uint32_t) * 256);
263−
264−#if FF_API_PALETTE_HAS_CHANGED
265−FF_DISABLE_DEPRECATION_WARNINGS
266− frame->palette_has_changed = 1;
267−FF_ENABLE_DEPRECATION_WARNINGS
268−#endif
269257 }
270258
271259 data_len = bytestream2_get_be32(&gb);
libavcodec/c93.c+0−5
@@ -246,11 +246,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 245 unmodified lines
246246 for (i = 0; i < 256; i++) {
247247 palette[i] = 0xFFU << 24 | bytestream2_get_be24(&gb);
248248 }
249−#if FF_API_PALETTE_HAS_CHANGED
250−FF_DISABLE_DEPRECATION_WARNINGS
251− newpic->palette_has_changed = 1;
252−FF_ENABLE_DEPRECATION_WARNINGS
253−#endif
254249 } else {
255250 if (oldpic->data[1])
256251 memcpy(newpic->data[1], oldpic->data[1], 256 * 4);
libavcodec/cdgraphics.c+0−5
@@ -125,11 +125,6 @@ static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low) · 124 unmodified lines
125125 b = ((color ) & 0x000F) * 17;
126126 palette[i + array_offset] = (uint32_t)cc->alpha[i + array_offset] << 24 | r << 16 | g << 8 | b;
127127 }
128−#if FF_API_PALETTE_HAS_CHANGED
129−FF_DISABLE_DEPRECATION_WARNINGS
130− cc->frame->palette_has_changed = 1;
131−FF_ENABLE_DEPRECATION_WARNINGS
132−#endif
133128 }
134129
135130 static int cdg_tile_block(CDGraphicsContext *cc, uint8_t *data, int b)
libavcodec/cdtoons.c+0−5
@@ -385,11 +385,6 @@ static int cdtoons_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 384 unmodified lines
385385 }
386386 /* first palette entry indicates transparency */
387387 c->pal[0] = 0;
388−#if FF_API_PALETTE_HAS_CHANGED
389−FF_DISABLE_DEPRECATION_WARNINGS
390− c->frame->palette_has_changed = 1;
391−FF_ENABLE_DEPRECATION_WARNINGS
392−#endif
393388 }
394389 }
395390
libavcodec/cinepak.c+0−7
@@ -476,14 +476,7 @@ static int cinepak_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 475 unmodified lines
476476 return ret;
477477
478478 if (s->palette_video) {
479−#if FF_API_PALETTE_HAS_CHANGED
480−FF_DISABLE_DEPRECATION_WARNINGS
481− s->frame->palette_has_changed =
482−#endif
483479 ff_copy_palette(s->pal, avpkt, avctx);
484−#if FF_API_PALETTE_HAS_CHANGED
485−FF_ENABLE_DEPRECATION_WARNINGS
486−#endif
487480 }
488481
489482 if ((ret = cinepak_decode(s)) < 0) {
libavcodec/dds.c+0−11
@@ -653,11 +653,6 @@ static int dds_decode(AVCodecContext *avctx, AVFrame *frame, · 652 unmodified lines
653653 ((unsigned)frame->data[1][3+i*4]<<24)
654654 );
655655 }
656−#if FF_API_PALETTE_HAS_CHANGED
657−FF_DISABLE_DEPRECATION_WARNINGS
658− frame->palette_has_changed = 1;
659−FF_ENABLE_DEPRECATION_WARNINGS
660−#endif
661656
662657 if (bytestream2_get_bytes_left(gbc) < frame->height * frame->width / 2) {
663658 av_log(avctx, AV_LOG_ERROR, "Buffer is too small (%d < %d).\n",
@@ -687,12 +682,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 23 unmodified lines
687682 (frame->data[1][0+i*4]<<16)+
688683 ((unsigned)frame->data[1][3+i*4]<<24)
689684 );
690−
691−#if FF_API_PALETTE_HAS_CHANGED
692−FF_DISABLE_DEPRECATION_WARNINGS
693− frame->palette_has_changed = 1;
694−FF_ENABLE_DEPRECATION_WARNINGS
695−#endif
696685 }
697686
698687 if (bytestream2_get_bytes_left(gbc) < frame->height * linesize) {
libavcodec/dfa.c+0−5
@@ -367,11 +367,6 @@ static int dfa_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 366 unmodified lines
367367 s->pal[i] = bytestream2_get_be24(&gb) << 2;
368368 s->pal[i] |= 0xFFU << 24 | (s->pal[i] >> 6) & 0x30303;
369369 }
370−#if FF_API_PALETTE_HAS_CHANGED
371−FF_DISABLE_DEPRECATION_WARNINGS
372− frame->palette_has_changed = 1;
373−FF_ENABLE_DEPRECATION_WARNINGS
374−#endif
375370 } else if (chunk_type <= 9) {
376371 if (decoder[chunk_type - 2](&gb, s->frame_buf, avctx->width, avctx->height)) {
377372 av_log(avctx, AV_LOG_ERROR, "Error decoding %s chunk\n",
libavcodec/dsicinvideo.c+0−5
@@ -294,11 +294,6 @@ static int cinvideo_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 293 unmodified lines
294294 return res;
295295
296296 memcpy(cin->frame->data[1], cin->palette, sizeof(cin->palette));
297−#if FF_API_PALETTE_HAS_CHANGED
298−FF_DISABLE_DEPRECATION_WARNINGS
299− cin->frame->palette_has_changed = 1;
300−FF_ENABLE_DEPRECATION_WARNINGS
301−#endif
302297 for (y = 0; y < cin->avctx->height; ++y)
303298 memcpy(cin->frame->data[0] + (cin->avctx->height - 1 - y) * cin->frame->linesize[0],
304299 cin->bitmap_table[CIN_CUR_BMP] + y * cin->avctx->width,
libavcodec/dxa.c+0−5
@@ -230,11 +230,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, · 229 unmodified lines
230230 if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
231231 return ret;
232232 memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
233−#if FF_API_PALETTE_HAS_CHANGED
234−FF_DISABLE_DEPRECATION_WARNINGS
235− frame->palette_has_changed = pc;
236−FF_ENABLE_DEPRECATION_WARNINGS
237−#endif
238233
239234 outptr = frame->data[0];
240235 srcptr = c->decomp_buf;
libavcodec/flicvideo.c+0−5
@@ -682,11 +682,6 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, · 681 unmodified lines
682682 /* make the palette available on the way out */
683683 memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE);
684684 if (s->new_palette) {
685−#if FF_API_PALETTE_HAS_CHANGED
686−FF_DISABLE_DEPRECATION_WARNINGS
687− s->frame->palette_has_changed = 1;
688−FF_ENABLE_DEPRECATION_WARNINGS
689−#endif
690685 s->new_palette = 0;
691686 }
692687
libavcodec/gemdec.c+0−5
@@ -182,11 +182,6 @@ static int gem_decode_frame(AVCodecContext *avctx, AVFrame *p, · 181 unmodified lines
182182
183183 p->pict_type = AV_PICTURE_TYPE_I;
184184 p->flags |= AV_FRAME_FLAG_KEY;
185−#if FF_API_PALETTE_HAS_CHANGED
186−FF_DISABLE_DEPRECATION_WARNINGS
187− p->palette_has_changed = 1;
188−FF_ENABLE_DEPRECATION_WARNINGS
189−#endif
190185 palette = (uint32_t *)p->data[1];
191186
192187 if (tag == AV_RB32("STTT")) {
libavcodec/idcinvideo.c+0−7
@@ -224,14 +224,7 @@ static int idcin_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 223 unmodified lines
224224 if (idcin_decode_vlcs(s, frame))
225225 return AVERROR_INVALIDDATA;
226226
227−#if FF_API_PALETTE_HAS_CHANGED
228−FF_DISABLE_DEPRECATION_WARNINGS
229− frame->palette_has_changed =
230−#endif
231227 ff_copy_palette(s->pal, avpkt, avctx);
232−#if FF_API_PALETTE_HAS_CHANGED
233−FF_ENABLE_DEPRECATION_WARNINGS
234−#endif
235228 /* make the palette available on the way out */
236229 memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);
237230
libavcodec/imx.c+0−10
@@ -58,19 +58,9 @@ static int imx_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 57 unmodified lines
5858 return ret;
5959
6060 if (ff_copy_palette(imx->pal, avpkt, avctx)) {
61−#if FF_API_PALETTE_HAS_CHANGED
62−FF_DISABLE_DEPRECATION_WARNINGS
63− frame->palette_has_changed = 1;
64−FF_ENABLE_DEPRECATION_WARNINGS
65−#endif
6661 frame->flags |= AV_FRAME_FLAG_KEY;
6762 } else {
6863 frame->flags &= ~AV_FRAME_FLAG_KEY;
69−#if FF_API_PALETTE_HAS_CHANGED
70−FF_DISABLE_DEPRECATION_WARNINGS
71− frame->palette_has_changed = 0;
72−FF_ENABLE_DEPRECATION_WARNINGS
73−#endif
7464 }
7565
7666 bytestream2_init(&gb, avpkt->data, avpkt->size);
libavcodec/interplayvideo.c+0−7
@@ -1315,14 +1315,7 @@ static int ipvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 1314 unmodified lines
13151315 return ret;
13161316
13171317 if (!s->is_16bpp) {
1318−#if FF_API_PALETTE_HAS_CHANGED
1319−FF_DISABLE_DEPRECATION_WARNINGS
1320− frame->palette_has_changed =
1321−#endif
13221318 ff_copy_palette(s->pal, avpkt, avctx);
1323−#if FF_API_PALETTE_HAS_CHANGED
1324−FF_ENABLE_DEPRECATION_WARNINGS
1325−#endif
13261319 }
13271320
13281321 switch (frame_format) {
libavcodec/jvdec.c+0−12
@@ -37,9 +37,6 @@ typedef struct JvContext { · 36 unmodified lines
3737 BlockDSPContext bdsp;
3838 AVFrame *frame;
3939 uint32_t palette[AVPALETTE_COUNT];
40−#if FF_API_PALETTE_HAS_CHANGED
41− int palette_has_changed;
42−#endif
4340 } JvContext;
4441
4542 static av_cold int decode_init(AVCodecContext *avctx)
@@ -209,18 +206,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 163 unmodified lines
209206 s->palette[i] = 0xFFU << 24 | pal << 2 | ((pal >> 4) & 0x30303);
210207 buf += 3;
211208 }
212−#if FF_API_PALETTE_HAS_CHANGED
213− s->palette_has_changed = 1;
214−#endif
215209 }
216210
217211 if (video_size) {
218−#if FF_API_PALETTE_HAS_CHANGED
219−FF_DISABLE_DEPRECATION_WARNINGS
220− s->frame->palette_has_changed = s->palette_has_changed;
221− s->palette_has_changed = 0;
222−FF_ENABLE_DEPRECATION_WARNINGS
223−#endif
224212 memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE);
225213
226214 if ((ret = av_frame_ref(rframe, s->frame)) < 0)
libavcodec/kmvc.c+0−17
@@ -273,14 +273,7 @@ static int decode_frame(AVCodecContext * avctx, AVFrame *frame, · 272 unmodified lines
273273 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
274274 return ret;
275275
276−#if FF_API_PALETTE_HAS_CHANGED
277−FF_DISABLE_DEPRECATION_WARNINGS
278− frame->palette_has_changed =
279−#endif
280276 ff_copy_palette(ctx->pal, avpkt, avctx);
281−#if FF_API_PALETTE_HAS_CHANGED
282−FF_ENABLE_DEPRECATION_WARNINGS
283−#endif
284277
285278 header = bytestream2_get_byte(&ctx->g);
286279
@@ -303,11 +296,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 16 unmodified lines
303296 }
304297
305298 if (header & KMVC_PALETTE) {
306−#if FF_API_PALETTE_HAS_CHANGED
307−FF_DISABLE_DEPRECATION_WARNINGS
308− frame->palette_has_changed = 1;
309−FF_ENABLE_DEPRECATION_WARNINGS
310−#endif
311299 // palette starts from index 1 and has 127 entries
312300 for (i = 1; i <= ctx->palsize; i++) {
313301 ctx->pal[i] = 0xFFU << 24 | bytestream2_get_be24(&ctx->g);
@@ -316,11 +304,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 2 unmodified lines
316304
317305 if (ctx->setpal) {
318306 ctx->setpal = 0;
319−#if FF_API_PALETTE_HAS_CHANGED
320−FF_DISABLE_DEPRECATION_WARNINGS
321− frame->palette_has_changed = 1;
322−FF_ENABLE_DEPRECATION_WARNINGS
323−#endif
324307 }
325308
326309 /* make the palette available on the way out */
libavcodec/mscc.c+0−5
@@ -184,11 +184,6 @@ inflate_error: · 183 unmodified lines
184184 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
185185
186186 if (pal && size == AVPALETTE_SIZE) {
187−#if FF_API_PALETTE_HAS_CHANGED
188−FF_DISABLE_DEPRECATION_WARNINGS
189− frame->palette_has_changed = 1;
190−FF_ENABLE_DEPRECATION_WARNINGS
191−#endif
192187 for (j = 0; j < 256; j++)
193188 s->pal[j] = 0xFF000000 | AV_RL32(pal + j * 4);
194189 } else if (pal) {
libavcodec/msrle.c+0−8
@@ -95,15 +95,7 @@ static int msrle_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 94 unmodified lines
9595 return ret;
9696
9797 if (avctx->bits_per_coded_sample > 1 && avctx->bits_per_coded_sample <= 8) {
98−#if FF_API_PALETTE_HAS_CHANGED
99−FF_DISABLE_DEPRECATION_WARNINGS
100− s->frame->palette_has_changed =
101−#endif
10298 ff_copy_palette(s->pal, avpkt, avctx);
103−#if FF_API_PALETTE_HAS_CHANGED
104−FF_ENABLE_DEPRECATION_WARNINGS
105−#endif
106−
10799 /* make the palette available */
108100 memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
109101 }
libavcodec/mss1.c+3−11
@@ -121,13 +121,13 @@ static void arith_init(ArithCoder *c, GetBitContext *gb) · 120 unmodified lines
121121 c->get_number = arith_get_number;
122122 }
123123
124−static int decode_pal(MSS12Context *ctx, ArithCoder *acoder)
124+static void decode_pal(MSS12Context *ctx, ArithCoder *acoder)
125125 {
126126 int i, ncol, r, g, b;
127127 uint32_t *pal = ctx->pal + 256 - ctx->free_colours;
128128
129129 if (!ctx->free_colours)
130− return 0;
130+ return;
131131
132132 ncol = arith_get_number(acoder, ctx->free_colours + 1);
133133 for (i = 0; i < ncol; i++) {
@@ -136,8 +136,6 @@ static int decode_pal(MSS12Context *ctx, ArithCoder *acoder) · 2 unmodified lines
136136 b = arith_get_bits(acoder, 8);
137137 *pal++ = (0xFFU << 24) | (r << 16) | (g << 8) | b;
138138 }
139−
140− return !!ncol;
141139 }
142140
143141 static int mss1_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
@@ -147,7 +145,6 @@ static int mss1_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 3 unmodified lines
147145 MSS12Context *c = &ctx->ctx;
148146 GetBitContext gb;
149147 ArithCoder acoder;
150− int pal_changed = 0;
151148 int ret;
152149
153150 if ((ret = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0)
@@ -164,7 +161,7 @@ static int mss1_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 10 unmodified lines
164161 if (c->keyframe) {
165162 c->corrupted = 0;
166163 ff_mss12_slicecontext_reset(&ctx->sc);
167− pal_changed = decode_pal(c, &acoder);
164+ decode_pal(c, &acoder);
168165 ctx->pic->flags |= AV_FRAME_FLAG_KEY;
169166 ctx->pic->pict_type = AV_PICTURE_TYPE_I;
170167 } else {
@@ -178,11 +175,6 @@ static int mss1_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 7 unmodified lines
178175 if (c->corrupted)
179176 return AVERROR_INVALIDDATA;
180177 memcpy(ctx->pic->data[1], c->pal, AVPALETTE_SIZE);
181−#if FF_API_PALETTE_HAS_CHANGED
182−FF_DISABLE_DEPRECATION_WARNINGS
183− ctx->pic->palette_has_changed = pal_changed;
184−FF_ENABLE_DEPRECATION_WARNINGS
185−#endif
186178
187179 if ((ret = av_frame_ref(rframe, ctx->pic)) < 0)
188180 return ret;
libavcodec/msvideo1.c+0−7
@@ -312,14 +312,7 @@ static int msvideo1_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 311 unmodified lines
312312 return ret;
313313
314314 if (s->mode_8bit) {
315−#if FF_API_PALETTE_HAS_CHANGED
316−FF_DISABLE_DEPRECATION_WARNINGS
317− s->frame->palette_has_changed =
318−#endif
319315 ff_copy_palette(s->pal, avpkt, avctx);
320−#if FF_API_PALETTE_HAS_CHANGED
321−FF_ENABLE_DEPRECATION_WARNINGS
322−#endif
323316 }
324317
325318 if (s->mode_8bit)
libavcodec/pafvideo.c+0−5
@@ -328,11 +328,6 @@ static int paf_video_decode(AVCodecContext *avctx, AVFrame *rframe, · 327 unmodified lines
328328 b = b << 2 | b >> 4;
329329 *out++ = (0xFFU << 24) | (r << 16) | (g << 8) | b;
330330 }
331−#if FF_API_PALETTE_HAS_CHANGED
332−FF_DISABLE_DEPRECATION_WARNINGS
333− c->pic->palette_has_changed = 1;
334−FF_ENABLE_DEPRECATION_WARNINGS
335−#endif
336331 }
337332
338333 c->dirty[c->current_frame] = 1;
libavcodec/pictordec.c+0−5
@@ -192,11 +192,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, · 191 unmodified lines
192192 return ret;
193193 memset(frame->data[0], 0, s->height * frame->linesize[0]);
194194 frame->pict_type = AV_PICTURE_TYPE_I;
195−#if FF_API_PALETTE_HAS_CHANGED
196−FF_DISABLE_DEPRECATION_WARNINGS
197− frame->palette_has_changed = 1;
198−FF_ENABLE_DEPRECATION_WARNINGS
199−#endif
200195
201196 pos_after_pal = bytestream2_tell(&s->g) + esize;
202197 palette = (uint32_t*)frame->data[1];
libavcodec/psd.c+0−5
@@ -533,11 +533,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, · 532 unmodified lines
533533 }
534534
535535 if (s->color_mode == PSD_INDEXED) {
536−#if FF_API_PALETTE_HAS_CHANGED
537−FF_DISABLE_DEPRECATION_WARNINGS
538− picture->palette_has_changed = 1;
539−FF_ENABLE_DEPRECATION_WARNINGS
540−#endif
541536 memcpy(picture->data[1], s->palette, AVPALETTE_SIZE);
542537 }
543538
libavcodec/qdrw.c+0−5
@@ -384,11 +384,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, · 383 unmodified lines
384384 ret = parse_palette(avctx, &gbc, (uint32_t *)p->data[1], colors, flags & 0x8000);
385385 if (ret < 0)
386386 return ret;
387−#if FF_API_PALETTE_HAS_CHANGED
388−FF_DISABLE_DEPRECATION_WARNINGS
389− p->palette_has_changed = 1;
390−FF_ENABLE_DEPRECATION_WARNINGS
391−#endif
392387
393388 /* jump to image data */
394389 bytestream2_skip(&gbc, 18);
libavcodec/qpeg.c+0−7
@@ -297,14 +297,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, · 296 unmodified lines
297297 }
298298
299299 /* make the palette available on the way out */
300−#if FF_API_PALETTE_HAS_CHANGED
301−FF_DISABLE_DEPRECATION_WARNINGS
302− p->palette_has_changed =
303−#endif
304300 ff_copy_palette(a->pal, avpkt, avctx);
305−#if FF_API_PALETTE_HAS_CHANGED
306−FF_ENABLE_DEPRECATION_WARNINGS
307−#endif
308301 memcpy(p->data[1], a->pal, AVPALETTE_SIZE);
309302
310303 if ((ret = av_frame_replace(ref, p)) < 0)
libavcodec/qtrle.c+0−8
@@ -537,15 +537,7 @@ static int qtrle_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 536 unmodified lines
537537 }
538538
539539 if(has_palette) {
540−#if FF_API_PALETTE_HAS_CHANGED
541−FF_DISABLE_DEPRECATION_WARNINGS
542− s->frame->palette_has_changed =
543−#endif
544540 ff_copy_palette(s->pal, avpkt, avctx);
545−#if FF_API_PALETTE_HAS_CHANGED
546−FF_ENABLE_DEPRECATION_WARNINGS
547−#endif
548−
549541 /* make the palette available on the way out */
550542 memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
551543 }
libavcodec/rawdec.c+1−12
@@ -368,24 +368,13 @@ static int raw_decode(AVCodecContext *avctx, AVFrame *frame, · 367 unmodified lines
368368 return ret;
369369 }
370370
371− if (ff_copy_palette(context->palette->data, avpkt, avctx)) {
372−#if FF_API_PALETTE_HAS_CHANGED
373−FF_DISABLE_DEPRECATION_WARNINGS
374− frame->palette_has_changed = 1;
375−FF_ENABLE_DEPRECATION_WARNINGS
376−#endif
377− } else if (context->is_nut_pal8) {
371+ if (!ff_copy_palette(context->palette->data, avpkt, avctx) && context->is_nut_pal8) {
378372 int vid_size = avctx->width * avctx->height;
379373 int pal_size = avpkt->size - vid_size;
380374
381375 if (avpkt->size > vid_size && pal_size <= AVPALETTE_SIZE) {
382376 const uint8_t *pal = avpkt->data + vid_size;
383377 memcpy(context->palette->data, pal, pal_size);
384−#if FF_API_PALETTE_HAS_CHANGED
385−FF_DISABLE_DEPRECATION_WARNINGS
386− frame->palette_has_changed = 1;
387−FF_ENABLE_DEPRECATION_WARNINGS
388−#endif
389378 }
390379 }
391380 }
libavcodec/rscc.c+0−7
@@ -347,14 +347,7 @@ static int rscc_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 346 unmodified lines
347347
348348 /* Palette handling */
349349 if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
350−#if FF_API_PALETTE_HAS_CHANGED
351−FF_DISABLE_DEPRECATION_WARNINGS
352− frame->palette_has_changed =
353−#endif
354350 ff_copy_palette(ctx->palette, avpkt, avctx);
355−#if FF_API_PALETTE_HAS_CHANGED
356−FF_ENABLE_DEPRECATION_WARNINGS
357−#endif
358351 memcpy(frame->data[1], ctx->palette, AVPALETTE_SIZE);
359352 }
360353 // We only return a picture when enough of it is undamaged, this avoids copying nearly broken frames around
libavcodec/sga.c+0−5
@@ -501,11 +501,6 @@ static int sga_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 500 unmodified lines
501501 }
502502
503503 memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);
504−#if FF_API_PALETTE_HAS_CHANGED
505−FF_DISABLE_DEPRECATION_WARNINGS
506− frame->palette_has_changed = 1;
507−FF_ENABLE_DEPRECATION_WARNINGS
508−#endif
509504 frame->pict_type = AV_PICTURE_TYPE_I;
510505 frame->flags |= AV_FRAME_FLAG_KEY;
511506
libavcodec/smacker.c+0−5
@@ -393,11 +393,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 392 unmodified lines
393393 pal = (uint32_t*)smk->pic->data[1];
394394 bytestream2_init(&gb2, avpkt->data, avpkt->size);
395395 flags = bytestream2_get_byteu(&gb2);
396−#if FF_API_PALETTE_HAS_CHANGED
397−FF_DISABLE_DEPRECATION_WARNINGS
398− smk->pic->palette_has_changed = flags & 1;
399−FF_ENABLE_DEPRECATION_WARNINGS
400−#endif
401396 if (flags & 2) {
402397 smk->pic->flags |= AV_FRAME_FLAG_KEY;
403398 smk->pic->pict_type = AV_PICTURE_TYPE_I;
libavcodec/smc.c+0−7
@@ -437,14 +437,7 @@ static int smc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 436 unmodified lines
437437 if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0)
438438 return ret;
439439
440−#if FF_API_PALETTE_HAS_CHANGED
441−FF_DISABLE_DEPRECATION_WARNINGS
442− s->frame->palette_has_changed =
443−#endif
444440 ff_copy_palette(s->pal, avpkt, avctx);
445−#if FF_API_PALETTE_HAS_CHANGED
446−FF_ENABLE_DEPRECATION_WARNINGS
447−#endif
448441
449442 bytestream2_init(&gb, buf, buf_size);
450443 ret = smc_decode_stream(s, &gb);
libavcodec/targa.c+0−5
@@ -249,11 +249,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, · 248 unmodified lines
249249 }
250250 break;
251251 }
252−#if FF_API_PALETTE_HAS_CHANGED
253−FF_DISABLE_DEPRECATION_WARNINGS
254− p->palette_has_changed = 1;
255−FF_ENABLE_DEPRECATION_WARNINGS
256−#endif
257252 }
258253 }
259254
libavcodec/tiertexseqv.c+0−5
@@ -182,11 +182,6 @@ static int seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int · 181 unmodified lines
182182 c[j] = (*data << 2) | (*data >> 4);
183183 palette[i] = 0xFFU << 24 | AV_RB24(c);
184184 }
185−#if FF_API_PALETTE_HAS_CHANGED
186−FF_DISABLE_DEPRECATION_WARNINGS
187− seq->frame->palette_has_changed = 1;
188−FF_ENABLE_DEPRECATION_WARNINGS
189−#endif
190185 }
191186
192187 if (flags & 2) {
libavcodec/tmv.c+0−5
@@ -58,11 +58,6 @@ static int tmv_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 57 unmodified lines
5858
5959 dst = frame->data[0];
6060
61−#if FF_API_PALETTE_HAS_CHANGED
62−FF_DISABLE_DEPRECATION_WARNINGS
63− frame->palette_has_changed = 1;
64−FF_ENABLE_DEPRECATION_WARNINGS
65−#endif
6661 memcpy(frame->data[1], ff_cga_palette, 16 * 4);
6762 memset(frame->data[1] + 16 * 4, 0, AVPALETTE_SIZE - 16 * 4);
6863
libavcodec/tscc.c+0−5
@@ -107,11 +107,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 106 unmodified lines
107107
108108 /* make the palette available on the way out */
109109 if (c->avctx->pix_fmt == AV_PIX_FMT_PAL8) {
110−#if FF_API_PALETTE_HAS_CHANGED
111−FF_DISABLE_DEPRECATION_WARNINGS
112− frame->palette_has_changed = palette_has_changed;
113−FF_ENABLE_DEPRECATION_WARNINGS
114−#endif
115110 memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
116111 }
117112
libavcodec/vb.c+0−5
@@ -231,11 +231,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, · 230 unmodified lines
231231 }
232232
233233 memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
234−#if FF_API_PALETTE_HAS_CHANGED
235−FF_DISABLE_DEPRECATION_WARNINGS
236− frame->palette_has_changed = flags & VB_HAS_PALETTE;
237−FF_ENABLE_DEPRECATION_WARNINGS
238−#endif
239234
240235 outptr = frame->data[0];
241236 srcptr = c->frame;
libavcodec/vqavideo.c+0−5
@@ -810,11 +810,6 @@ static int vqa_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 809 unmodified lines
810810
811811 /* make the palette available on the way out */
812812 memcpy(s->frame->data[1], s->palette, PALETTE_COUNT * 4);
813−#if FF_API_PALETTE_HAS_CHANGED
814−FF_DISABLE_DEPRECATION_WARNINGS
815− s->frame->palette_has_changed = 1;
816−FF_ENABLE_DEPRECATION_WARNINGS
817−#endif
818813 } else if (avctx->pix_fmt == AV_PIX_FMT_RGB555LE) {
819814 if ((res = vqa_decode_frame_hicolor(s, s->frame)) < 0)
820815 return res;
libavcodec/yop.c+0−6
@@ -232,12 +232,6 @@ static int yop_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 231 unmodified lines
232232 (palette[i + firstcolor] >> 6) & 0x30303;
233233 }
234234
235−#if FF_API_PALETTE_HAS_CHANGED
236−FF_DISABLE_DEPRECATION_WARNINGS
237− frame->palette_has_changed = 1;
238−FF_ENABLE_DEPRECATION_WARNINGS
239−#endif
240−
241235 for (y = 0; y < avctx->height; y += 2) {
242236 for (x = 0; x < avctx->width; x += 2) {
243237 if (s->srcptr - avpkt->data >= avpkt->size) {
libavutil/frame.c+0−5
@@ -230,11 +230,6 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy) · 229 unmodified lines
230230 dst->pts = src->pts;
231231 dst->duration = src->duration;
232232 dst->repeat_pict = src->repeat_pict;
233−#if FF_API_PALETTE_HAS_CHANGED
234−FF_DISABLE_DEPRECATION_WARNINGS
235− dst->palette_has_changed = src->palette_has_changed;
236−FF_ENABLE_DEPRECATION_WARNINGS
237−#endif
238233 dst->sample_rate = src->sample_rate;
239234 dst->opaque = src->opaque;
240235 dst->pkt_dts = src->pkt_dts;
libavutil/frame.h+0−8
@@ -567,14 +567,6 @@ typedef struct AVFrame { · 566 unmodified lines
567567 */
568568 int repeat_pict;
569569
570−#if FF_API_PALETTE_HAS_CHANGED
571− /**
572− * Tell user application that palette has changed from previous frame.
573− */
574− attribute_deprecated
575− int palette_has_changed;
576−#endif
577−
578570 /**
579571 * Sample rate of the audio data.
580572 */
libavutil/version.h+0−1
@@ -105,7 +105,6 @@ · 104 unmodified lines
105105 * @{
106106 */
107107
108−#define FF_API_PALETTE_HAS_CHANGED (LIBAVUTIL_VERSION_MAJOR < 60)
109108 #define FF_API_VULKAN_CONTIGUOUS_MEMORY (LIBAVUTIL_VERSION_MAJOR < 60)
110109 #define FF_API_H274_FILM_GRAIN_VCS (LIBAVUTIL_VERSION_MAJOR < 60)
111110 #define FF_API_MOD_UINTP2 (LIBAVUTIL_VERSION_MAJOR < 60)

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