aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/snow.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-01-14 04:27:03 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-01-14 04:27:03 +0000
commit526e037b95e05e79d9e1452240fe8fd3129b536a (patch)
tree5f9c3b3f7e16be82c0f671af80472f4317327100 /libavcodec/snow.c
parent3174c77a3ed0db38c79de086d3f1ba3aba31acf8 (diff)
downloadffmpeg-526e037b95e05e79d9e1452240fe8fd3129b536a.tar.gz
Remove green clouds.
fixes issue263 Originally committed as revision 11524 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r--libavcodec/snow.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 9f36553512..1099e34287 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -3583,10 +3583,6 @@ static void encode_header(SnowContext *s){
put_symbol(&s->c, s->header_state, p->htaps/2-1, 0);
for(i= p->htaps/2; i; i--)
put_symbol(&s->c, s->header_state, FFABS(p->hcoeff[i]), 0);
-
- p->last_diag_mc= p->diag_mc;
- p->last_htaps= p->htaps;
- memcpy(p->last_hcoeff, p->hcoeff, sizeof(p->hcoeff));
}
}
if(s->last_spatial_decomposition_count != s->spatial_decomposition_count){
@@ -3603,6 +3599,20 @@ static void encode_header(SnowContext *s){
put_symbol(&s->c, s->header_state, s->qbias - s->last_qbias , 1);
put_symbol(&s->c, s->header_state, s->block_max_depth - s->last_block_max_depth, 1);
+}
+
+static void update_last_header_values(SnowContext *s){
+ int plane_index;
+
+ if(!s->keyframe){
+ for(plane_index=0; plane_index<2; plane_index++){
+ Plane *p= &s->plane[plane_index];
+ p->last_diag_mc= p->diag_mc;
+ p->last_htaps = p->htaps;
+ memcpy(p->last_hcoeff, p->hcoeff, sizeof(p->hcoeff));
+ }
+ }
+
s->last_spatial_decomposition_type= s->spatial_decomposition_type;
s->last_qlog = s->qlog;
s->last_qbias = s->qbias;
@@ -4473,6 +4483,8 @@ STOP_TIMER("pred-conv")}
}
}
+ update_last_header_values(s);
+
if(s->last_picture[s->max_ref_frames-1].data[0]){
avctx->release_buffer(avctx, &s->last_picture[s->max_ref_frames-1]);
for(i=0; i<9; i++)