comparison snow.c @ 6144:f0efd4254164 libavcodec

Remove green clouds. fixes issue263
author michael
date Mon, 14 Jan 2008 04:27:03 +0000
parents 382aa8b243c5
children ecaf5226e9b0
comparison
equal deleted inserted replaced
6143:75c09a7168c7 6144:f0efd4254164
3581 Plane *p= &s->plane[plane_index]; 3581 Plane *p= &s->plane[plane_index];
3582 put_rac(&s->c, s->header_state, p->diag_mc); 3582 put_rac(&s->c, s->header_state, p->diag_mc);
3583 put_symbol(&s->c, s->header_state, p->htaps/2-1, 0); 3583 put_symbol(&s->c, s->header_state, p->htaps/2-1, 0);
3584 for(i= p->htaps/2; i; i--) 3584 for(i= p->htaps/2; i; i--)
3585 put_symbol(&s->c, s->header_state, FFABS(p->hcoeff[i]), 0); 3585 put_symbol(&s->c, s->header_state, FFABS(p->hcoeff[i]), 0);
3586
3587 p->last_diag_mc= p->diag_mc;
3588 p->last_htaps= p->htaps;
3589 memcpy(p->last_hcoeff, p->hcoeff, sizeof(p->hcoeff));
3590 } 3586 }
3591 } 3587 }
3592 if(s->last_spatial_decomposition_count != s->spatial_decomposition_count){ 3588 if(s->last_spatial_decomposition_count != s->spatial_decomposition_count){
3593 put_rac(&s->c, s->header_state, 1); 3589 put_rac(&s->c, s->header_state, 1);
3594 put_symbol(&s->c, s->header_state, s->spatial_decomposition_count, 0); 3590 put_symbol(&s->c, s->header_state, s->spatial_decomposition_count, 0);
3600 put_symbol(&s->c, s->header_state, s->spatial_decomposition_type - s->last_spatial_decomposition_type, 1); 3596 put_symbol(&s->c, s->header_state, s->spatial_decomposition_type - s->last_spatial_decomposition_type, 1);
3601 put_symbol(&s->c, s->header_state, s->qlog - s->last_qlog , 1); 3597 put_symbol(&s->c, s->header_state, s->qlog - s->last_qlog , 1);
3602 put_symbol(&s->c, s->header_state, s->mv_scale - s->last_mv_scale, 1); 3598 put_symbol(&s->c, s->header_state, s->mv_scale - s->last_mv_scale, 1);
3603 put_symbol(&s->c, s->header_state, s->qbias - s->last_qbias , 1); 3599 put_symbol(&s->c, s->header_state, s->qbias - s->last_qbias , 1);
3604 put_symbol(&s->c, s->header_state, s->block_max_depth - s->last_block_max_depth, 1); 3600 put_symbol(&s->c, s->header_state, s->block_max_depth - s->last_block_max_depth, 1);
3601
3602 }
3603
3604 static void update_last_header_values(SnowContext *s){
3605 int plane_index;
3606
3607 if(!s->keyframe){
3608 for(plane_index=0; plane_index<2; plane_index++){
3609 Plane *p= &s->plane[plane_index];
3610 p->last_diag_mc= p->diag_mc;
3611 p->last_htaps = p->htaps;
3612 memcpy(p->last_hcoeff, p->hcoeff, sizeof(p->hcoeff));
3613 }
3614 }
3605 3615
3606 s->last_spatial_decomposition_type= s->spatial_decomposition_type; 3616 s->last_spatial_decomposition_type= s->spatial_decomposition_type;
3607 s->last_qlog = s->qlog; 3617 s->last_qlog = s->qlog;
3608 s->last_qbias = s->qbias; 3618 s->last_qbias = s->qbias;
3609 s->last_mv_scale = s->mv_scale; 3619 s->last_mv_scale = s->mv_scale;
4471 s->avctx->error[plane_index] += error; 4481 s->avctx->error[plane_index] += error;
4472 s->current_picture.error[plane_index] = error; 4482 s->current_picture.error[plane_index] = error;
4473 } 4483 }
4474 } 4484 }
4475 4485
4486 update_last_header_values(s);
4487
4476 if(s->last_picture[s->max_ref_frames-1].data[0]){ 4488 if(s->last_picture[s->max_ref_frames-1].data[0]){
4477 avctx->release_buffer(avctx, &s->last_picture[s->max_ref_frames-1]); 4489 avctx->release_buffer(avctx, &s->last_picture[s->max_ref_frames-1]);
4478 for(i=0; i<9; i++) 4490 for(i=0; i<9; i++)
4479 if(s->halfpel_plane[s->max_ref_frames-1][1+i/3][i%3]) 4491 if(s->halfpel_plane[s->max_ref_frames-1][1+i/3][i%3])
4480 av_free(s->halfpel_plane[s->max_ref_frames-1][1+i/3][i%3] - EDGE_WIDTH*(1+s->current_picture.linesize[i%3])); 4492 av_free(s->halfpel_plane[s->max_ref_frames-1][1+i/3][i%3] - EDGE_WIDTH*(1+s->current_picture.linesize[i%3]));