[FFmpeg-cvslog] avcodec/vp8: Move fade_present from context to stack

Andreas Rheinhardt git at videolan.org
Sun Sep 11 22:06:54 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri Sep  9 17:17:15 2022 +0200| [4130789f4f20e67ef44f8c721955c5e3bcbc1b09] | committer: Andreas Rheinhardt

avcodec/vp8: Move fade_present from context to stack

It is only an auxiliary value used for parsing the VP7 frame header.

Reviewed-by: Peter Ross <pross at xvid.org>
Reviewed-by: Ronald S. Bultje <rsbultje at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4130789f4f20e67ef44f8c721955c5e3bcbc1b09
---

 libavcodec/vp8.c | 6 +++---
 libavcodec/vp8.h | 5 -----
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index f83a0d66bb..07ea3c6dd1 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -580,6 +580,7 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
     int height = s->avctx->height;
     int alpha = 0;
     int beta  = 0;
+    int fade_present = 1;
 
     if (buf_size < 4) {
         return AVERROR_INVALIDDATA;
@@ -681,7 +682,6 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
 
     s->update_last          = 1;
     s->update_probabilities = 1;
-    s->fade_present         = 1;
 
     if (s->profile > 0) {
         s->update_probabilities = vp89_rac_get(c);
@@ -689,13 +689,13 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
             s->prob[1] = s->prob[0];
 
         if (!s->keyframe)
-            s->fade_present = vp89_rac_get(c);
+            fade_present = vp89_rac_get(c);
     }
 
     if (vpx_rac_is_end(c))
         return AVERROR_INVALIDDATA;
     /* E. Fading information for previous frame */
-    if (s->fade_present && vp89_rac_get(c)) {
+    if (fade_present && vp89_rac_get(c)) {
         alpha = (int8_t) vp89_rac_get_uint(c, 8);
         beta  = (int8_t) vp89_rac_get_uint(c, 8);
     }
diff --git a/libavcodec/vp8.h b/libavcodec/vp8.h
index 30aeb4cb06..6f29156b53 100644
--- a/libavcodec/vp8.h
+++ b/libavcodec/vp8.h
@@ -335,11 +335,6 @@ typedef struct VP8Context {
 
     int vp7;
 
-    /**
-     * Fade bit present in bitstream (VP7)
-     */
-    int fade_present;
-
     /**
      * Interframe DC prediction (VP7)
      * [0] VP8_FRAME_PREVIOUS



More information about the ffmpeg-cvslog mailing list