Commit 4130789f authored by Andreas Rheinhardt's avatar 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: 's avatarPeter Ross <pross@xvid.org>
Reviewed-by: 's avatarRonald S. Bultje <rsbultje@gmail.com>
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
parent b3591ccd
......@@ -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);
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment