From 36661afe022ef048f702d03ca957b743fb38758d Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 17 May 2005 08:46:40 +0000 Subject: [PATCH] fix last coeff Originally committed as revision 4254 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/vp3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 7202388f39..8b9f7c829c 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -833,7 +833,7 @@ static void init_frame(Vp3DecodeContext *s, GetBitContext *gb) for (i = 0; i < s->fragment_count; i++) { s->all_fragments[i].coeffs = zero_block; s->all_fragments[i].coeff_count = 0; - s->all_fragments[i].last_coeff = 0; + s->all_fragments[i].last_coeff = -1; s->all_fragments[i].motion_x = 0xbeef; s->all_fragments[i].motion_y = 0xbeef; } @@ -2036,6 +2036,8 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, /* save the DC */ last_dc[current_frame_type] = s->all_fragments[i].coeffs[0]; + if(s->all_fragments[i].coeffs[0] && s->all_fragments[i].last_coeff<0) + s->all_fragments[i].last_coeff= 0; } } } -- GitLab