1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avutil: remove deprecated FF_API_PALETTE_HAS_CHANGED

Deprecated since 2023-05-18.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2025-02-19 14:06:40 -03:00
parent 1061689ad8
commit 6e80ec9dc5
47 changed files with 4 additions and 317 deletions

View File

@ -114,14 +114,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
}
if (avctx->bits_per_coded_sample <= 8) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed =
#endif
ff_copy_palette(c->pal, avpkt, avctx);
#if FF_API_PALETTE_HAS_CHANGED
FF_ENABLE_DEPRECATION_WARNINGS
#endif
memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
}

View File

@ -262,11 +262,6 @@ static int execute_code(AVCodecContext * avctx, int c)
AV_GET_BUFFER_FLAG_REF)) < 0)
return ret;
s->frame->pict_type = AV_PICTURE_TYPE_I;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
s->frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
set_palette((uint32_t *)s->frame->data[1]);
erase_screen(avctx);
} else if (c == 'l') {
@ -375,11 +370,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
}
s->frame->pict_type = AV_PICTURE_TYPE_I;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
s->frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
set_palette((uint32_t *)s->frame->data[1]);
if (!s->first_frame) {
erase_screen(avctx);

View File

@ -63,11 +63,6 @@ static int set_palette(BethsoftvidContext *ctx, GetByteContext *g)
palette[a] = 0xFFU << 24 | bytestream2_get_be24u(g) * 4;
palette[a] |= palette[a] >> 6 & 0x30303;
}
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
ctx->frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
return 0;
}

View File

@ -83,19 +83,9 @@ static int bfi_decode_frame(AVCodecContext *avctx, AVFrame *frame,
pal++;
}
memcpy(bfi->pal, frame->data[1], sizeof(bfi->pal));
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
} else {
frame->pict_type = AV_PICTURE_TYPE_P;
frame->flags &= ~AV_FRAME_FLAG_KEY;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 0;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
memcpy(frame->data[1], bfi->pal, sizeof(bfi->pal));
}

View File

@ -157,11 +157,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0)
return ret;
s->frame->pict_type = AV_PICTURE_TYPE_I;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
s->frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
memcpy(s->frame->data[1], s->palette, 16 * 4);
if (avctx->codec_id == AV_CODEC_ID_XBIN) {

View File

@ -251,11 +251,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
}
memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = type & BMV_PALETTE;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
outptr = frame->data[0];
srcptr = c->frame;

View File

@ -245,12 +245,6 @@ static int pix_decode_frame(AVCodecContext *avctx, AVFrame *frame,
*pal_out++ = (0xFFU << 24) | bytestream2_get_be32u(&gb);
bytestream2_skip(&gb, 8);
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
chunk_type = bytestream2_get_be32(&gb);
} else if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
/* no palette supplied, use the default one */
@ -260,12 +254,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
av_log(avctx, AV_LOG_WARNING,
"Using default palette, colors might be off.\n");
memcpy(pal_out, std_pal_table, sizeof(uint32_t) * 256);
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
data_len = bytestream2_get_be32(&gb);

View File

@ -246,11 +246,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
for (i = 0; i < 256; i++) {
palette[i] = 0xFFU << 24 | bytestream2_get_be24(&gb);
}
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
newpic->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
} else {
if (oldpic->data[1])
memcpy(newpic->data[1], oldpic->data[1], 256 * 4);

View File

@ -125,11 +125,6 @@ static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low)
b = ((color ) & 0x000F) * 17;
palette[i + array_offset] = (uint32_t)cc->alpha[i + array_offset] << 24 | r << 16 | g << 8 | b;
}
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
cc->frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
static int cdg_tile_block(CDGraphicsContext *cc, uint8_t *data, int b)

View File

@ -385,11 +385,6 @@ static int cdtoons_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
}
/* first palette entry indicates transparency */
c->pal[0] = 0;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
c->frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
}

View File

@ -476,14 +476,7 @@ static int cinepak_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
return ret;
if (s->palette_video) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
s->frame->palette_has_changed =
#endif
ff_copy_palette(s->pal, avpkt, avctx);
#if FF_API_PALETTE_HAS_CHANGED
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
if ((ret = cinepak_decode(s)) < 0) {

View File

@ -653,11 +653,6 @@ static int dds_decode(AVCodecContext *avctx, AVFrame *frame,
((unsigned)frame->data[1][3+i*4]<<24)
);
}
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
if (bytestream2_get_bytes_left(gbc) < frame->height * frame->width / 2) {
av_log(avctx, AV_LOG_ERROR, "Buffer is too small (%d < %d).\n",
@ -687,12 +682,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
(frame->data[1][0+i*4]<<16)+
((unsigned)frame->data[1][3+i*4]<<24)
);
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
if (bytestream2_get_bytes_left(gbc) < frame->height * linesize) {

View File

@ -367,11 +367,6 @@ static int dfa_decode_frame(AVCodecContext *avctx, AVFrame *frame,
s->pal[i] = bytestream2_get_be24(&gb) << 2;
s->pal[i] |= 0xFFU << 24 | (s->pal[i] >> 6) & 0x30303;
}
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
} else if (chunk_type <= 9) {
if (decoder[chunk_type - 2](&gb, s->frame_buf, avctx->width, avctx->height)) {
av_log(avctx, AV_LOG_ERROR, "Error decoding %s chunk\n",

View File

@ -294,11 +294,6 @@ static int cinvideo_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
return res;
memcpy(cin->frame->data[1], cin->palette, sizeof(cin->palette));
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
cin->frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
for (y = 0; y < cin->avctx->height; ++y)
memcpy(cin->frame->data[0] + (cin->avctx->height - 1 - y) * cin->frame->linesize[0],
cin->bitmap_table[CIN_CUR_BMP] + y * cin->avctx->width,

View File

@ -230,11 +230,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
return ret;
memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = pc;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
outptr = frame->data[0];
srcptr = c->decomp_buf;

View File

@ -682,11 +682,6 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
/* make the palette available on the way out */
memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE);
if (s->new_palette) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
s->frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
s->new_palette = 0;
}

View File

@ -182,11 +182,6 @@ static int gem_decode_frame(AVCodecContext *avctx, AVFrame *p,
p->pict_type = AV_PICTURE_TYPE_I;
p->flags |= AV_FRAME_FLAG_KEY;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
p->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
palette = (uint32_t *)p->data[1];
if (tag == AV_RB32("STTT")) {

View File

@ -224,14 +224,7 @@ static int idcin_decode_frame(AVCodecContext *avctx, AVFrame *frame,
if (idcin_decode_vlcs(s, frame))
return AVERROR_INVALIDDATA;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed =
#endif
ff_copy_palette(s->pal, avpkt, avctx);
#if FF_API_PALETTE_HAS_CHANGED
FF_ENABLE_DEPRECATION_WARNINGS
#endif
/* make the palette available on the way out */
memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);

View File

@ -58,19 +58,9 @@ static int imx_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
return ret;
if (ff_copy_palette(imx->pal, avpkt, avctx)) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
frame->flags |= AV_FRAME_FLAG_KEY;
} else {
frame->flags &= ~AV_FRAME_FLAG_KEY;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 0;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
bytestream2_init(&gb, avpkt->data, avpkt->size);

View File

@ -1315,14 +1315,7 @@ static int ipvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame,
return ret;
if (!s->is_16bpp) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed =
#endif
ff_copy_palette(s->pal, avpkt, avctx);
#if FF_API_PALETTE_HAS_CHANGED
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
switch (frame_format) {

View File

@ -37,9 +37,6 @@ typedef struct JvContext {
BlockDSPContext bdsp;
AVFrame *frame;
uint32_t palette[AVPALETTE_COUNT];
#if FF_API_PALETTE_HAS_CHANGED
int palette_has_changed;
#endif
} JvContext;
static av_cold int decode_init(AVCodecContext *avctx)
@ -209,18 +206,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
s->palette[i] = 0xFFU << 24 | pal << 2 | ((pal >> 4) & 0x30303);
buf += 3;
}
#if FF_API_PALETTE_HAS_CHANGED
s->palette_has_changed = 1;
#endif
}
if (video_size) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
s->frame->palette_has_changed = s->palette_has_changed;
s->palette_has_changed = 0;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE);
if ((ret = av_frame_ref(rframe, s->frame)) < 0)

View File

@ -273,14 +273,7 @@ static int decode_frame(AVCodecContext * avctx, AVFrame *frame,
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed =
#endif
ff_copy_palette(ctx->pal, avpkt, avctx);
#if FF_API_PALETTE_HAS_CHANGED
FF_ENABLE_DEPRECATION_WARNINGS
#endif
header = bytestream2_get_byte(&ctx->g);
@ -303,11 +296,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
if (header & KMVC_PALETTE) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
// palette starts from index 1 and has 127 entries
for (i = 1; i <= ctx->palsize; i++) {
ctx->pal[i] = 0xFFU << 24 | bytestream2_get_be24(&ctx->g);
@ -316,11 +304,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (ctx->setpal) {
ctx->setpal = 0;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
/* make the palette available on the way out */

View File

@ -184,11 +184,6 @@ inflate_error:
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
if (pal && size == AVPALETTE_SIZE) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
for (j = 0; j < 256; j++)
s->pal[j] = 0xFF000000 | AV_RL32(pal + j * 4);
} else if (pal) {

View File

@ -95,15 +95,7 @@ static int msrle_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
return ret;
if (avctx->bits_per_coded_sample > 1 && avctx->bits_per_coded_sample <= 8) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
s->frame->palette_has_changed =
#endif
ff_copy_palette(s->pal, avpkt, avctx);
#if FF_API_PALETTE_HAS_CHANGED
FF_ENABLE_DEPRECATION_WARNINGS
#endif
/* make the palette available */
memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
}

View File

@ -121,13 +121,13 @@ static void arith_init(ArithCoder *c, GetBitContext *gb)
c->get_number = arith_get_number;
}
static int decode_pal(MSS12Context *ctx, ArithCoder *acoder)
static void decode_pal(MSS12Context *ctx, ArithCoder *acoder)
{
int i, ncol, r, g, b;
uint32_t *pal = ctx->pal + 256 - ctx->free_colours;
if (!ctx->free_colours)
return 0;
return;
ncol = arith_get_number(acoder, ctx->free_colours + 1);
for (i = 0; i < ncol; i++) {
@ -136,8 +136,6 @@ static int decode_pal(MSS12Context *ctx, ArithCoder *acoder)
b = arith_get_bits(acoder, 8);
*pal++ = (0xFFU << 24) | (r << 16) | (g << 8) | b;
}
return !!ncol;
}
static int mss1_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
@ -147,7 +145,6 @@ static int mss1_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
MSS12Context *c = &ctx->ctx;
GetBitContext gb;
ArithCoder acoder;
int pal_changed = 0;
int ret;
if ((ret = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0)
@ -164,7 +161,7 @@ static int mss1_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
if (c->keyframe) {
c->corrupted = 0;
ff_mss12_slicecontext_reset(&ctx->sc);
pal_changed = decode_pal(c, &acoder);
decode_pal(c, &acoder);
ctx->pic->flags |= AV_FRAME_FLAG_KEY;
ctx->pic->pict_type = AV_PICTURE_TYPE_I;
} else {
@ -178,11 +175,6 @@ static int mss1_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
if (c->corrupted)
return AVERROR_INVALIDDATA;
memcpy(ctx->pic->data[1], c->pal, AVPALETTE_SIZE);
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
ctx->pic->palette_has_changed = pal_changed;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
if ((ret = av_frame_ref(rframe, ctx->pic)) < 0)
return ret;

View File

@ -312,14 +312,7 @@ static int msvideo1_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
return ret;
if (s->mode_8bit) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
s->frame->palette_has_changed =
#endif
ff_copy_palette(s->pal, avpkt, avctx);
#if FF_API_PALETTE_HAS_CHANGED
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
if (s->mode_8bit)

View File

@ -328,11 +328,6 @@ static int paf_video_decode(AVCodecContext *avctx, AVFrame *rframe,
b = b << 2 | b >> 4;
*out++ = (0xFFU << 24) | (r << 16) | (g << 8) | b;
}
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
c->pic->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
c->dirty[c->current_frame] = 1;

View File

@ -192,11 +192,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
return ret;
memset(frame->data[0], 0, s->height * frame->linesize[0]);
frame->pict_type = AV_PICTURE_TYPE_I;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
pos_after_pal = bytestream2_tell(&s->g) + esize;
palette = (uint32_t*)frame->data[1];

View File

@ -533,11 +533,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
}
if (s->color_mode == PSD_INDEXED) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
picture->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
memcpy(picture->data[1], s->palette, AVPALETTE_SIZE);
}

View File

@ -384,11 +384,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
ret = parse_palette(avctx, &gbc, (uint32_t *)p->data[1], colors, flags & 0x8000);
if (ret < 0)
return ret;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
p->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
/* jump to image data */
bytestream2_skip(&gbc, 18);

View File

@ -297,14 +297,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
}
/* make the palette available on the way out */
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
p->palette_has_changed =
#endif
ff_copy_palette(a->pal, avpkt, avctx);
#if FF_API_PALETTE_HAS_CHANGED
FF_ENABLE_DEPRECATION_WARNINGS
#endif
memcpy(p->data[1], a->pal, AVPALETTE_SIZE);
if ((ret = av_frame_replace(ref, p)) < 0)

View File

@ -537,15 +537,7 @@ static int qtrle_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
}
if(has_palette) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
s->frame->palette_has_changed =
#endif
ff_copy_palette(s->pal, avpkt, avctx);
#if FF_API_PALETTE_HAS_CHANGED
FF_ENABLE_DEPRECATION_WARNINGS
#endif
/* make the palette available on the way out */
memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
}

View File

@ -368,24 +368,13 @@ static int raw_decode(AVCodecContext *avctx, AVFrame *frame,
return ret;
}
if (ff_copy_palette(context->palette->data, avpkt, avctx)) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
} else if (context->is_nut_pal8) {
if (!ff_copy_palette(context->palette->data, avpkt, avctx) && context->is_nut_pal8) {
int vid_size = avctx->width * avctx->height;
int pal_size = avpkt->size - vid_size;
if (avpkt->size > vid_size && pal_size <= AVPALETTE_SIZE) {
const uint8_t *pal = avpkt->data + vid_size;
memcpy(context->palette->data, pal, pal_size);
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
}
}

View File

@ -347,14 +347,7 @@ static int rscc_decode_frame(AVCodecContext *avctx, AVFrame *frame,
/* Palette handling */
if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed =
#endif
ff_copy_palette(ctx->palette, avpkt, avctx);
#if FF_API_PALETTE_HAS_CHANGED
FF_ENABLE_DEPRECATION_WARNINGS
#endif
memcpy(frame->data[1], ctx->palette, AVPALETTE_SIZE);
}
// We only return a picture when enough of it is undamaged, this avoids copying nearly broken frames around

View File

@ -501,11 +501,6 @@ static int sga_decode_frame(AVCodecContext *avctx, AVFrame *frame,
}
memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
frame->pict_type = AV_PICTURE_TYPE_I;
frame->flags |= AV_FRAME_FLAG_KEY;

View File

@ -393,11 +393,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
pal = (uint32_t*)smk->pic->data[1];
bytestream2_init(&gb2, avpkt->data, avpkt->size);
flags = bytestream2_get_byteu(&gb2);
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
smk->pic->palette_has_changed = flags & 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
if (flags & 2) {
smk->pic->flags |= AV_FRAME_FLAG_KEY;
smk->pic->pict_type = AV_PICTURE_TYPE_I;

View File

@ -437,14 +437,7 @@ static int smc_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0)
return ret;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
s->frame->palette_has_changed =
#endif
ff_copy_palette(s->pal, avpkt, avctx);
#if FF_API_PALETTE_HAS_CHANGED
FF_ENABLE_DEPRECATION_WARNINGS
#endif
bytestream2_init(&gb, buf, buf_size);
ret = smc_decode_stream(s, &gb);

View File

@ -249,11 +249,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
}
break;
}
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
p->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
}

View File

@ -182,11 +182,6 @@ static int seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int
c[j] = (*data << 2) | (*data >> 4);
palette[i] = 0xFFU << 24 | AV_RB24(c);
}
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
seq->frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
if (flags & 2) {

View File

@ -58,11 +58,6 @@ static int tmv_decode_frame(AVCodecContext *avctx, AVFrame *frame,
dst = frame->data[0];
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
memcpy(frame->data[1], ff_cga_palette, 16 * 4);
memset(frame->data[1] + 16 * 4, 0, AVPALETTE_SIZE - 16 * 4);

View File

@ -107,11 +107,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
/* make the palette available on the way out */
if (c->avctx->pix_fmt == AV_PIX_FMT_PAL8) {
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = palette_has_changed;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
}

View File

@ -231,11 +231,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
}
memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = flags & VB_HAS_PALETTE;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
outptr = frame->data[0];
srcptr = c->frame;

View File

@ -810,11 +810,6 @@ static int vqa_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
/* make the palette available on the way out */
memcpy(s->frame->data[1], s->palette, PALETTE_COUNT * 4);
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
s->frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
} else if (avctx->pix_fmt == AV_PIX_FMT_RGB555LE) {
if ((res = vqa_decode_frame_hicolor(s, s->frame)) < 0)
return res;

View File

@ -232,12 +232,6 @@ static int yop_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
(palette[i + firstcolor] >> 6) & 0x30303;
}
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed = 1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
for (y = 0; y < avctx->height; y += 2) {
for (x = 0; x < avctx->width; x += 2) {
if (s->srcptr - avpkt->data >= avpkt->size) {

View File

@ -230,11 +230,6 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy)
dst->pts = src->pts;
dst->duration = src->duration;
dst->repeat_pict = src->repeat_pict;
#if FF_API_PALETTE_HAS_CHANGED
FF_DISABLE_DEPRECATION_WARNINGS
dst->palette_has_changed = src->palette_has_changed;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
dst->sample_rate = src->sample_rate;
dst->opaque = src->opaque;
dst->pkt_dts = src->pkt_dts;

View File

@ -567,14 +567,6 @@ typedef struct AVFrame {
*/
int repeat_pict;
#if FF_API_PALETTE_HAS_CHANGED
/**
* Tell user application that palette has changed from previous frame.
*/
attribute_deprecated
int palette_has_changed;
#endif
/**
* Sample rate of the audio data.
*/

View File

@ -105,7 +105,6 @@
* @{
*/
#define FF_API_PALETTE_HAS_CHANGED (LIBAVUTIL_VERSION_MAJOR < 60)
#define FF_API_VULKAN_CONTIGUOUS_MEMORY (LIBAVUTIL_VERSION_MAJOR < 60)
#define FF_API_H274_FILM_GRAIN_VCS (LIBAVUTIL_VERSION_MAJOR < 60)
#define FF_API_MOD_UINTP2 (LIBAVUTIL_VERSION_MAJOR < 60)