1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

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@xvid.org>
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-09-09 17:17:15 +02:00
parent b3591ccdf1
commit 4130789f4f
2 changed files with 3 additions and 8 deletions

View File

@ -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);
}

View File

@ -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