You've already forked FFmpeg
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:
@ -114,14 +114,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (avctx->bits_per_coded_sample <= 8) {
|
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);
|
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);
|
memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
|
||||||
}
|
}
|
||||||
|
@ -262,11 +262,6 @@ static int execute_code(AVCodecContext * avctx, int c)
|
|||||||
AV_GET_BUFFER_FLAG_REF)) < 0)
|
AV_GET_BUFFER_FLAG_REF)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
s->frame->pict_type = AV_PICTURE_TYPE_I;
|
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]);
|
set_palette((uint32_t *)s->frame->data[1]);
|
||||||
erase_screen(avctx);
|
erase_screen(avctx);
|
||||||
} else if (c == 'l') {
|
} else if (c == 'l') {
|
||||||
@ -375,11 +370,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
}
|
}
|
||||||
|
|
||||||
s->frame->pict_type = AV_PICTURE_TYPE_I;
|
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]);
|
set_palette((uint32_t *)s->frame->data[1]);
|
||||||
if (!s->first_frame) {
|
if (!s->first_frame) {
|
||||||
erase_screen(avctx);
|
erase_screen(avctx);
|
||||||
|
@ -63,11 +63,6 @@ static int set_palette(BethsoftvidContext *ctx, GetByteContext *g)
|
|||||||
palette[a] = 0xFFU << 24 | bytestream2_get_be24u(g) * 4;
|
palette[a] = 0xFFU << 24 | bytestream2_get_be24u(g) * 4;
|
||||||
palette[a] |= palette[a] >> 6 & 0x30303;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,19 +83,9 @@ static int bfi_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
pal++;
|
pal++;
|
||||||
}
|
}
|
||||||
memcpy(bfi->pal, frame->data[1], sizeof(bfi->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 {
|
} else {
|
||||||
frame->pict_type = AV_PICTURE_TYPE_P;
|
frame->pict_type = AV_PICTURE_TYPE_P;
|
||||||
frame->flags &= ~AV_FRAME_FLAG_KEY;
|
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));
|
memcpy(frame->data[1], bfi->pal, sizeof(bfi->pal));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,11 +157,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0)
|
if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
s->frame->pict_type = AV_PICTURE_TYPE_I;
|
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);
|
memcpy(s->frame->data[1], s->palette, 16 * 4);
|
||||||
|
|
||||||
if (avctx->codec_id == AV_CODEC_ID_XBIN) {
|
if (avctx->codec_id == AV_CODEC_ID_XBIN) {
|
||||||
|
@ -251,11 +251,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
}
|
}
|
||||||
|
|
||||||
memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
|
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];
|
outptr = frame->data[0];
|
||||||
srcptr = c->frame;
|
srcptr = c->frame;
|
||||||
|
@ -245,12 +245,6 @@ static int pix_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
*pal_out++ = (0xFFU << 24) | bytestream2_get_be32u(&gb);
|
*pal_out++ = (0xFFU << 24) | bytestream2_get_be32u(&gb);
|
||||||
bytestream2_skip(&gb, 8);
|
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);
|
chunk_type = bytestream2_get_be32(&gb);
|
||||||
} else if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
|
} else if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
|
||||||
/* no palette supplied, use the default one */
|
/* no palette supplied, use the default one */
|
||||||
@ -260,12 +254,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
av_log(avctx, AV_LOG_WARNING,
|
av_log(avctx, AV_LOG_WARNING,
|
||||||
"Using default palette, colors might be off.\n");
|
"Using default palette, colors might be off.\n");
|
||||||
memcpy(pal_out, std_pal_table, sizeof(uint32_t) * 256);
|
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);
|
data_len = bytestream2_get_be32(&gb);
|
||||||
|
@ -246,11 +246,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
for (i = 0; i < 256; i++) {
|
for (i = 0; i < 256; i++) {
|
||||||
palette[i] = 0xFFU << 24 | bytestream2_get_be24(&gb);
|
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 {
|
} else {
|
||||||
if (oldpic->data[1])
|
if (oldpic->data[1])
|
||||||
memcpy(newpic->data[1], oldpic->data[1], 256 * 4);
|
memcpy(newpic->data[1], oldpic->data[1], 256 * 4);
|
||||||
|
@ -125,11 +125,6 @@ static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low)
|
|||||||
b = ((color ) & 0x000F) * 17;
|
b = ((color ) & 0x000F) * 17;
|
||||||
palette[i + array_offset] = (uint32_t)cc->alpha[i + array_offset] << 24 | r << 16 | g << 8 | b;
|
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)
|
static int cdg_tile_block(CDGraphicsContext *cc, uint8_t *data, int b)
|
||||||
|
@ -385,11 +385,6 @@ static int cdtoons_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
}
|
}
|
||||||
/* first palette entry indicates transparency */
|
/* first palette entry indicates transparency */
|
||||||
c->pal[0] = 0;
|
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,14 +476,7 @@ static int cinepak_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (s->palette_video) {
|
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);
|
ff_copy_palette(s->pal, avpkt, avctx);
|
||||||
#if FF_API_PALETTE_HAS_CHANGED
|
|
||||||
FF_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = cinepak_decode(s)) < 0) {
|
if ((ret = cinepak_decode(s)) < 0) {
|
||||||
|
@ -653,11 +653,6 @@ static int dds_decode(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
((unsigned)frame->data[1][3+i*4]<<24)
|
((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) {
|
if (bytestream2_get_bytes_left(gbc) < frame->height * frame->width / 2) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Buffer is too small (%d < %d).\n",
|
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)+
|
(frame->data[1][0+i*4]<<16)+
|
||||||
((unsigned)frame->data[1][3+i*4]<<24)
|
((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) {
|
if (bytestream2_get_bytes_left(gbc) < frame->height * linesize) {
|
||||||
|
@ -367,11 +367,6 @@ static int dfa_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
s->pal[i] = bytestream2_get_be24(&gb) << 2;
|
s->pal[i] = bytestream2_get_be24(&gb) << 2;
|
||||||
s->pal[i] |= 0xFFU << 24 | (s->pal[i] >> 6) & 0x30303;
|
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) {
|
} else if (chunk_type <= 9) {
|
||||||
if (decoder[chunk_type - 2](&gb, s->frame_buf, avctx->width, avctx->height)) {
|
if (decoder[chunk_type - 2](&gb, s->frame_buf, avctx->width, avctx->height)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Error decoding %s chunk\n",
|
av_log(avctx, AV_LOG_ERROR, "Error decoding %s chunk\n",
|
||||||
|
@ -294,11 +294,6 @@ static int cinvideo_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
return res;
|
return res;
|
||||||
|
|
||||||
memcpy(cin->frame->data[1], cin->palette, sizeof(cin->palette));
|
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)
|
for (y = 0; y < cin->avctx->height; ++y)
|
||||||
memcpy(cin->frame->data[0] + (cin->avctx->height - 1 - y) * cin->frame->linesize[0],
|
memcpy(cin->frame->data[0] + (cin->avctx->height - 1 - y) * cin->frame->linesize[0],
|
||||||
cin->bitmap_table[CIN_CUR_BMP] + y * cin->avctx->width,
|
cin->bitmap_table[CIN_CUR_BMP] + y * cin->avctx->width,
|
||||||
|
@ -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)
|
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
|
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];
|
outptr = frame->data[0];
|
||||||
srcptr = c->decomp_buf;
|
srcptr = c->decomp_buf;
|
||||||
|
@ -682,11 +682,6 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
|
|||||||
/* make the palette available on the way out */
|
/* make the palette available on the way out */
|
||||||
memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE);
|
memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE);
|
||||||
if (s->new_palette) {
|
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;
|
s->new_palette = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,11 +182,6 @@ static int gem_decode_frame(AVCodecContext *avctx, AVFrame *p,
|
|||||||
|
|
||||||
p->pict_type = AV_PICTURE_TYPE_I;
|
p->pict_type = AV_PICTURE_TYPE_I;
|
||||||
p->flags |= AV_FRAME_FLAG_KEY;
|
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];
|
palette = (uint32_t *)p->data[1];
|
||||||
|
|
||||||
if (tag == AV_RB32("STTT")) {
|
if (tag == AV_RB32("STTT")) {
|
||||||
|
@ -224,14 +224,7 @@ static int idcin_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
if (idcin_decode_vlcs(s, frame))
|
if (idcin_decode_vlcs(s, frame))
|
||||||
return AVERROR_INVALIDDATA;
|
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);
|
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 */
|
/* make the palette available on the way out */
|
||||||
memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);
|
memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);
|
||||||
|
|
||||||
|
@ -58,19 +58,9 @@ static int imx_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (ff_copy_palette(imx->pal, avpkt, avctx)) {
|
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;
|
frame->flags |= AV_FRAME_FLAG_KEY;
|
||||||
} else {
|
} else {
|
||||||
frame->flags &= ~AV_FRAME_FLAG_KEY;
|
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);
|
bytestream2_init(&gb, avpkt->data, avpkt->size);
|
||||||
|
@ -1315,14 +1315,7 @@ static int ipvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (!s->is_16bpp) {
|
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);
|
ff_copy_palette(s->pal, avpkt, avctx);
|
||||||
#if FF_API_PALETTE_HAS_CHANGED
|
|
||||||
FF_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (frame_format) {
|
switch (frame_format) {
|
||||||
|
@ -37,9 +37,6 @@ typedef struct JvContext {
|
|||||||
BlockDSPContext bdsp;
|
BlockDSPContext bdsp;
|
||||||
AVFrame *frame;
|
AVFrame *frame;
|
||||||
uint32_t palette[AVPALETTE_COUNT];
|
uint32_t palette[AVPALETTE_COUNT];
|
||||||
#if FF_API_PALETTE_HAS_CHANGED
|
|
||||||
int palette_has_changed;
|
|
||||||
#endif
|
|
||||||
} JvContext;
|
} JvContext;
|
||||||
|
|
||||||
static av_cold int decode_init(AVCodecContext *avctx)
|
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);
|
s->palette[i] = 0xFFU << 24 | pal << 2 | ((pal >> 4) & 0x30303);
|
||||||
buf += 3;
|
buf += 3;
|
||||||
}
|
}
|
||||||
#if FF_API_PALETTE_HAS_CHANGED
|
|
||||||
s->palette_has_changed = 1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_size) {
|
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);
|
memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE);
|
||||||
|
|
||||||
if ((ret = av_frame_ref(rframe, s->frame)) < 0)
|
if ((ret = av_frame_ref(rframe, s->frame)) < 0)
|
||||||
|
@ -273,14 +273,7 @@ static int decode_frame(AVCodecContext * avctx, AVFrame *frame,
|
|||||||
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
#if FF_API_PALETTE_HAS_CHANGED
|
|
||||||
FF_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
frame->palette_has_changed =
|
|
||||||
#endif
|
|
||||||
ff_copy_palette(ctx->pal, avpkt, avctx);
|
ff_copy_palette(ctx->pal, avpkt, avctx);
|
||||||
#if FF_API_PALETTE_HAS_CHANGED
|
|
||||||
FF_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
header = bytestream2_get_byte(&ctx->g);
|
header = bytestream2_get_byte(&ctx->g);
|
||||||
|
|
||||||
@ -303,11 +296,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (header & KMVC_PALETTE) {
|
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
|
// palette starts from index 1 and has 127 entries
|
||||||
for (i = 1; i <= ctx->palsize; i++) {
|
for (i = 1; i <= ctx->palsize; i++) {
|
||||||
ctx->pal[i] = 0xFFU << 24 | bytestream2_get_be24(&ctx->g);
|
ctx->pal[i] = 0xFFU << 24 | bytestream2_get_be24(&ctx->g);
|
||||||
@ -316,11 +304,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
|
|
||||||
if (ctx->setpal) {
|
if (ctx->setpal) {
|
||||||
ctx->setpal = 0;
|
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 */
|
/* make the palette available on the way out */
|
||||||
|
@ -184,11 +184,6 @@ inflate_error:
|
|||||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
|
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
|
||||||
|
|
||||||
if (pal && size == AVPALETTE_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++)
|
for (j = 0; j < 256; j++)
|
||||||
s->pal[j] = 0xFF000000 | AV_RL32(pal + j * 4);
|
s->pal[j] = 0xFF000000 | AV_RL32(pal + j * 4);
|
||||||
} else if (pal) {
|
} else if (pal) {
|
||||||
|
@ -95,15 +95,7 @@ static int msrle_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (avctx->bits_per_coded_sample > 1 && avctx->bits_per_coded_sample <= 8) {
|
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);
|
ff_copy_palette(s->pal, avpkt, avctx);
|
||||||
#if FF_API_PALETTE_HAS_CHANGED
|
|
||||||
FF_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* make the palette available */
|
/* make the palette available */
|
||||||
memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
|
memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
|
||||||
}
|
}
|
||||||
|
@ -121,13 +121,13 @@ static void arith_init(ArithCoder *c, GetBitContext *gb)
|
|||||||
c->get_number = arith_get_number;
|
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;
|
int i, ncol, r, g, b;
|
||||||
uint32_t *pal = ctx->pal + 256 - ctx->free_colours;
|
uint32_t *pal = ctx->pal + 256 - ctx->free_colours;
|
||||||
|
|
||||||
if (!ctx->free_colours)
|
if (!ctx->free_colours)
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
ncol = arith_get_number(acoder, ctx->free_colours + 1);
|
ncol = arith_get_number(acoder, ctx->free_colours + 1);
|
||||||
for (i = 0; i < ncol; i++) {
|
for (i = 0; i < ncol; i++) {
|
||||||
@ -136,8 +136,6 @@ static int decode_pal(MSS12Context *ctx, ArithCoder *acoder)
|
|||||||
b = arith_get_bits(acoder, 8);
|
b = arith_get_bits(acoder, 8);
|
||||||
*pal++ = (0xFFU << 24) | (r << 16) | (g << 8) | b;
|
*pal++ = (0xFFU << 24) | (r << 16) | (g << 8) | b;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !!ncol;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mss1_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
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;
|
MSS12Context *c = &ctx->ctx;
|
||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
ArithCoder acoder;
|
ArithCoder acoder;
|
||||||
int pal_changed = 0;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((ret = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0)
|
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) {
|
if (c->keyframe) {
|
||||||
c->corrupted = 0;
|
c->corrupted = 0;
|
||||||
ff_mss12_slicecontext_reset(&ctx->sc);
|
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->flags |= AV_FRAME_FLAG_KEY;
|
||||||
ctx->pic->pict_type = AV_PICTURE_TYPE_I;
|
ctx->pic->pict_type = AV_PICTURE_TYPE_I;
|
||||||
} else {
|
} else {
|
||||||
@ -178,11 +175,6 @@ static int mss1_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
if (c->corrupted)
|
if (c->corrupted)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
memcpy(ctx->pic->data[1], c->pal, AVPALETTE_SIZE);
|
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)
|
if ((ret = av_frame_ref(rframe, ctx->pic)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -312,14 +312,7 @@ static int msvideo1_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (s->mode_8bit) {
|
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);
|
ff_copy_palette(s->pal, avpkt, avctx);
|
||||||
#if FF_API_PALETTE_HAS_CHANGED
|
|
||||||
FF_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->mode_8bit)
|
if (s->mode_8bit)
|
||||||
|
@ -328,11 +328,6 @@ static int paf_video_decode(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
b = b << 2 | b >> 4;
|
b = b << 2 | b >> 4;
|
||||||
*out++ = (0xFFU << 24) | (r << 16) | (g << 8) | b;
|
*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;
|
c->dirty[c->current_frame] = 1;
|
||||||
|
@ -192,11 +192,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
return ret;
|
return ret;
|
||||||
memset(frame->data[0], 0, s->height * frame->linesize[0]);
|
memset(frame->data[0], 0, s->height * frame->linesize[0]);
|
||||||
frame->pict_type = AV_PICTURE_TYPE_I;
|
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;
|
pos_after_pal = bytestream2_tell(&s->g) + esize;
|
||||||
palette = (uint32_t*)frame->data[1];
|
palette = (uint32_t*)frame->data[1];
|
||||||
|
@ -533,11 +533,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (s->color_mode == PSD_INDEXED) {
|
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);
|
memcpy(picture->data[1], s->palette, AVPALETTE_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
ret = parse_palette(avctx, &gbc, (uint32_t *)p->data[1], colors, flags & 0x8000);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
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 */
|
/* jump to image data */
|
||||||
bytestream2_skip(&gbc, 18);
|
bytestream2_skip(&gbc, 18);
|
||||||
|
@ -297,14 +297,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* make the palette available on the way out */
|
/* 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);
|
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);
|
memcpy(p->data[1], a->pal, AVPALETTE_SIZE);
|
||||||
|
|
||||||
if ((ret = av_frame_replace(ref, p)) < 0)
|
if ((ret = av_frame_replace(ref, p)) < 0)
|
||||||
|
@ -537,15 +537,7 @@ static int qtrle_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(has_palette) {
|
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);
|
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 */
|
/* make the palette available on the way out */
|
||||||
memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
|
memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
|
||||||
}
|
}
|
||||||
|
@ -368,24 +368,13 @@ static int raw_decode(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ff_copy_palette(context->palette->data, avpkt, avctx)) {
|
if (!ff_copy_palette(context->palette->data, avpkt, avctx) && context->is_nut_pal8) {
|
||||||
#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) {
|
|
||||||
int vid_size = avctx->width * avctx->height;
|
int vid_size = avctx->width * avctx->height;
|
||||||
int pal_size = avpkt->size - vid_size;
|
int pal_size = avpkt->size - vid_size;
|
||||||
|
|
||||||
if (avpkt->size > vid_size && pal_size <= AVPALETTE_SIZE) {
|
if (avpkt->size > vid_size && pal_size <= AVPALETTE_SIZE) {
|
||||||
const uint8_t *pal = avpkt->data + vid_size;
|
const uint8_t *pal = avpkt->data + vid_size;
|
||||||
memcpy(context->palette->data, pal, pal_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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -347,14 +347,7 @@ static int rscc_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
|
|
||||||
/* Palette handling */
|
/* Palette handling */
|
||||||
if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
|
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);
|
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);
|
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
|
// We only return a picture when enough of it is undamaged, this avoids copying nearly broken frames around
|
||||||
|
@ -501,11 +501,6 @@ static int sga_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
}
|
}
|
||||||
|
|
||||||
memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);
|
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->pict_type = AV_PICTURE_TYPE_I;
|
||||||
frame->flags |= AV_FRAME_FLAG_KEY;
|
frame->flags |= AV_FRAME_FLAG_KEY;
|
||||||
|
|
||||||
|
@ -393,11 +393,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
pal = (uint32_t*)smk->pic->data[1];
|
pal = (uint32_t*)smk->pic->data[1];
|
||||||
bytestream2_init(&gb2, avpkt->data, avpkt->size);
|
bytestream2_init(&gb2, avpkt->data, avpkt->size);
|
||||||
flags = bytestream2_get_byteu(&gb2);
|
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) {
|
if (flags & 2) {
|
||||||
smk->pic->flags |= AV_FRAME_FLAG_KEY;
|
smk->pic->flags |= AV_FRAME_FLAG_KEY;
|
||||||
smk->pic->pict_type = AV_PICTURE_TYPE_I;
|
smk->pic->pict_type = AV_PICTURE_TYPE_I;
|
||||||
|
@ -437,14 +437,7 @@ static int smc_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0)
|
if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0)
|
||||||
return ret;
|
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);
|
ff_copy_palette(s->pal, avpkt, avctx);
|
||||||
#if FF_API_PALETTE_HAS_CHANGED
|
|
||||||
FF_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bytestream2_init(&gb, buf, buf_size);
|
bytestream2_init(&gb, buf, buf_size);
|
||||||
ret = smc_decode_stream(s, &gb);
|
ret = smc_decode_stream(s, &gb);
|
||||||
|
@ -249,11 +249,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#if FF_API_PALETTE_HAS_CHANGED
|
|
||||||
FF_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
p->palette_has_changed = 1;
|
|
||||||
FF_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,11 +182,6 @@ static int seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int
|
|||||||
c[j] = (*data << 2) | (*data >> 4);
|
c[j] = (*data << 2) | (*data >> 4);
|
||||||
palette[i] = 0xFFU << 24 | AV_RB24(c);
|
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) {
|
if (flags & 2) {
|
||||||
|
@ -58,11 +58,6 @@ static int tmv_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
|
|
||||||
dst = frame->data[0];
|
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);
|
memcpy(frame->data[1], ff_cga_palette, 16 * 4);
|
||||||
memset(frame->data[1] + 16 * 4, 0, AVPALETTE_SIZE - 16 * 4);
|
memset(frame->data[1] + 16 * 4, 0, AVPALETTE_SIZE - 16 * 4);
|
||||||
|
|
||||||
|
@ -107,11 +107,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
|
|
||||||
/* make the palette available on the way out */
|
/* make the palette available on the way out */
|
||||||
if (c->avctx->pix_fmt == AV_PIX_FMT_PAL8) {
|
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);
|
memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,11 +231,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
}
|
}
|
||||||
|
|
||||||
memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
|
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];
|
outptr = frame->data[0];
|
||||||
srcptr = c->frame;
|
srcptr = c->frame;
|
||||||
|
@ -810,11 +810,6 @@ static int vqa_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
|
|
||||||
/* make the palette available on the way out */
|
/* make the palette available on the way out */
|
||||||
memcpy(s->frame->data[1], s->palette, PALETTE_COUNT * 4);
|
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) {
|
} else if (avctx->pix_fmt == AV_PIX_FMT_RGB555LE) {
|
||||||
if ((res = vqa_decode_frame_hicolor(s, s->frame)) < 0)
|
if ((res = vqa_decode_frame_hicolor(s, s->frame)) < 0)
|
||||||
return res;
|
return res;
|
||||||
|
@ -232,12 +232,6 @@ static int yop_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
|||||||
(palette[i + firstcolor] >> 6) & 0x30303;
|
(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 (y = 0; y < avctx->height; y += 2) {
|
||||||
for (x = 0; x < avctx->width; x += 2) {
|
for (x = 0; x < avctx->width; x += 2) {
|
||||||
if (s->srcptr - avpkt->data >= avpkt->size) {
|
if (s->srcptr - avpkt->data >= avpkt->size) {
|
||||||
|
@ -230,11 +230,6 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy)
|
|||||||
dst->pts = src->pts;
|
dst->pts = src->pts;
|
||||||
dst->duration = src->duration;
|
dst->duration = src->duration;
|
||||||
dst->repeat_pict = src->repeat_pict;
|
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->sample_rate = src->sample_rate;
|
||||||
dst->opaque = src->opaque;
|
dst->opaque = src->opaque;
|
||||||
dst->pkt_dts = src->pkt_dts;
|
dst->pkt_dts = src->pkt_dts;
|
||||||
|
@ -567,14 +567,6 @@ typedef struct AVFrame {
|
|||||||
*/
|
*/
|
||||||
int repeat_pict;
|
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.
|
* Sample rate of the audio data.
|
||||||
*/
|
*/
|
||||||
|
@ -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_VULKAN_CONTIGUOUS_MEMORY (LIBAVUTIL_VERSION_MAJOR < 60)
|
||||||
#define FF_API_H274_FILM_GRAIN_VCS (LIBAVUTIL_VERSION_MAJOR < 60)
|
#define FF_API_H274_FILM_GRAIN_VCS (LIBAVUTIL_VERSION_MAJOR < 60)
|
||||||
#define FF_API_MOD_UINTP2 (LIBAVUTIL_VERSION_MAJOR < 60)
|
#define FF_API_MOD_UINTP2 (LIBAVUTIL_VERSION_MAJOR < 60)
|
||||||
|
Reference in New Issue
Block a user