[FFmpeg-devel] [PATCH 79/80] avcodec/mpegvideo: Move custom_pcf to H263DecContext

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Thu Feb 3 03:06:30 EET 2022


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/h263dec.h    | 1 +
 libavcodec/ituh263dec.c | 9 ++++-----
 libavcodec/mpegvideo.h  | 1 -
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/libavcodec/h263dec.h b/libavcodec/h263dec.h
index 04c238d90a..539f2df01a 100644
--- a/libavcodec/h263dec.h
+++ b/libavcodec/h263dec.h
@@ -47,6 +47,7 @@ typedef struct H263DecContext {
     int pb_frame;          ///< PB-frame mode (0 = none, 1 = base, 2 = improved)
     int long_vectors;      ///< use horrible H.263v1 long vector mode
     int ehc_mode;
+    int custom_pcf;
 
     /* divx specific, used to workaround (many) bugs in divx5 */
     int divx_packed;
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index 15365afebc..0ce0b1c795 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -1184,7 +1184,7 @@ int ff_h263_decode_picture_header(H263DecContext *h)
             /* OPPTYPE */
             format = get_bits(&s->gb, 3);
             ff_dlog(s->avctx, "ufep=1, format: %d\n", format);
-            s->custom_pcf= get_bits1(&s->gb);
+            h->custom_pcf = get_bits1(&s->gb);
             s->umvplus = get_bits1(&s->gb); /* Unrestricted Motion Vector */
             if (get_bits1(&s->gb) != 0) {
                 av_log(s->avctx, AV_LOG_ERROR, "Syntax-based Arithmetic Coding (SAC) not supported\n");
@@ -1267,7 +1267,7 @@ int ff_h263_decode_picture_header(H263DecContext *h)
             s->width = width;
             s->height = height;
 
-            if(s->custom_pcf){
+            if (h->custom_pcf) {
                 int gcd;
                 s->avctx->framerate.num  = 1800000;
                 s->avctx->framerate.den  = 1000 + get_bits1(&s->gb);
@@ -1284,9 +1284,8 @@ int ff_h263_decode_picture_header(H263DecContext *h)
             }
         }
 
-        if(s->custom_pcf){
+        if (h->custom_pcf)
             skip_bits(&s->gb, 2); //extended Temporal reference
-        }
 
         if (ufep) {
             if (s->umvplus) {
@@ -1326,7 +1325,7 @@ int ff_h263_decode_picture_header(H263DecContext *h)
 
     if (h->pb_frame) {
         skip_bits(&s->gb, 3); /* Temporal reference for B-pictures */
-        if (s->custom_pcf)
+        if (h->custom_pcf)
             skip_bits(&s->gb, 2); //extended Temporal reference
         skip_bits(&s->gb, 2); /* Quantization information for B-pictures */
     }
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 2b5267f1c3..1be77bc83b 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -309,7 +309,6 @@ typedef struct MPVContext {
     int alt_inter_vlc;              ///< alternative inter vlc
     int modified_quant;
     int loop_filter;
-    int custom_pcf;
 
     /* MPEG-4 specific */
     int studio_profile;
-- 
2.32.0



More information about the ffmpeg-devel mailing list