[FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma reserved bitfields

Clément Bœsch u at pkh.me
Mon Dec 11 21:06:55 EET 2023


The layout for the frame flags is as follow:

   chroma_format  u(2)
   reserved       u(2)
   interlace_mode u(2)
   reserved       u(2)

chroma_format has 2 allowed values:
   0: reserved
   1: reserved
   2: 4:2:2
   3: 4:4:4

interlace_mode has 3 allowed values:
   0: progressive
   1: tff
   2: bff
   3: reserved

0x80 is what we expect for "422 not interlaced", and the extra 0x2 from
0x82 is actually writting into the reserved bits.
---
 libavcodec/proresenc_anatoliy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 727199ed3b..7c2ec7b3fe 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -751,7 +751,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     bytestream_put_buffer(&buf, ctx->vendor, 4);
     bytestream_put_be16(&buf, avctx->width);
     bytestream_put_be16(&buf, avctx->height);
-    frame_flags = 0x82; /* 422 not interlaced */
+    frame_flags = 0x80; /* 422 not interlaced */
     if (avctx->profile >= AV_PROFILE_PRORES_4444) /* 4444 or 4444 Xq */
         frame_flags |= 0x40; /* 444 chroma */
     if (ctx->is_interlaced) {
-- 
2.43.0



More information about the ffmpeg-devel mailing list