[FFmpeg-devel] [PATCH 6/6] avcodec/codec_desc: Mark AVRN, TGQ, PhotoCD, VBN as intra-only

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Fri May 10 21:06:00 EEST 2024


Also remove the then redundant assignments of AV_FRAME_FLAG_KEY,
AV_PICTURE_TYPE_I.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
Is SGA (AV_CIDEC_ID_SGA_VIDEO) intra only? The decoder always sets
the key frame flag + picture type I, yet the demuxer does not
automatically set the AV_PKT_FLAG_KEY.

 libavcodec/avrndec.c    | 2 --
 libavcodec/codec_desc.c | 7 ++++---
 libavcodec/eatgq.c      | 2 --
 libavcodec/photocd.c    | 3 ---
 libavcodec/vbndec.c     | 3 ---
 5 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c
index 97d2824625..02bdfb6516 100644
--- a/libavcodec/avrndec.c
+++ b/libavcodec/avrndec.c
@@ -67,8 +67,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
 
     if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    p->pict_type= AV_PICTURE_TYPE_I;
-    p->flags |= AV_FRAME_FLAG_KEY;
 
     if(a->interlace) {
         buf += (true_height - avctx->height)*avctx->width;
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 5ae26f5d2b..a28ef68061 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -905,7 +905,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .type      = AVMEDIA_TYPE_VIDEO,
         .name      = "tgq",
         .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts TGQ video"),
-        .props     = AV_CODEC_PROP_LOSSY,
+        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
     },
     {
         .id        = AV_CODEC_ID_TQI,
@@ -1503,6 +1503,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .type      = AVMEDIA_TYPE_VIDEO,
         .name      = "avrn",
         .long_name = NULL_IF_CONFIG_SMALL("Avid AVI Codec"),
+        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
     },
     {
         .id        = AV_CODEC_ID_CPIA,
@@ -1820,7 +1821,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .type      = AVMEDIA_TYPE_VIDEO,
         .name      = "photocd",
         .long_name = NULL_IF_CONFIG_SMALL("Kodak Photo CD"),
-        .props     = AV_CODEC_PROP_LOSSY,
+        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
     },
     {
         .id        = AV_CODEC_ID_IPU,
@@ -1869,7 +1870,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .type      = AVMEDIA_TYPE_VIDEO,
         .name      = "vbn",
         .long_name = NULL_IF_CONFIG_SMALL("Vizrt Binary Image"),
-        .props     = AV_CODEC_PROP_LOSSY,
+        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
     },
     {
         .id        = AV_CODEC_ID_JPEGXL,
diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c
index 0f0ed3585f..d326c05390 100644
--- a/libavcodec/eatgq.c
+++ b/libavcodec/eatgq.c
@@ -237,8 +237,6 @@ static int tgq_decode_frame(AVCodecContext *avctx, AVFrame *frame,
 
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
-    frame->flags |= AV_FRAME_FLAG_KEY;
-    frame->pict_type = AV_PICTURE_TYPE_I;
 
     for (y = 0; y < FFALIGN(avctx->height, 16) >> 4; y++)
         for (x = 0; x < FFALIGN(avctx->width, 16) >> 4; x++)
diff --git a/libavcodec/photocd.c b/libavcodec/photocd.c
index 07e8d460bd..75948d1b42 100644
--- a/libavcodec/photocd.c
+++ b/libavcodec/photocd.c
@@ -331,9 +331,6 @@ static int photocd_decode_frame(AVCodecContext *avctx, AVFrame *p,
     if ((ret = ff_thread_get_buffer(avctx, p, 0)) < 0)
         return ret;
 
-    p->pict_type = AV_PICTURE_TYPE_I;
-    p->flags |= AV_FRAME_FLAG_KEY;
-
     bytestream2_init(gb, avpkt->data, avpkt->size);
 
     if (s->resolution < 3) {
diff --git a/libavcodec/vbndec.c b/libavcodec/vbndec.c
index 4a38b02168..a96843f212 100644
--- a/libavcodec/vbndec.c
+++ b/libavcodec/vbndec.c
@@ -151,9 +151,6 @@ static int vbn_decode_frame(AVCodecContext *avctx,
     if (ret < 0)
         goto out;
 
-    frame->pict_type = AV_PICTURE_TYPE_I;
-    frame->flags |= AV_FRAME_FLAG_KEY;
-
     if (format == VBN_FORMAT_RAW) {
         uint8_t *flipped = frame->data[0] + frame->linesize[0] * (frame->height - 1);
         av_image_copy_plane(flipped, -frame->linesize[0], image_buf ? image_buf : gb->buffer, linesize, linesize, frame->height);
-- 
2.40.1



More information about the ffmpeg-devel mailing list