Mercurial > libavcodec.hg
comparison snow.c @ 6481:493dc59d469a libavcodec
add FF_ prefix to all (frame)_TYPE usage
author | aurel |
---|---|
date | Sun, 09 Mar 2008 23:31:02 +0000 |
parents | e9431bea10dc |
children | 48759bfbd073 |
comparison
equal
deleted
inserted
replaced
6480:6f01a499e785 | 6481:493dc59d469a |
---|---|
3798 | 3798 |
3799 /* ugly, ratecontrol just takes a sqrt again */ | 3799 /* ugly, ratecontrol just takes a sqrt again */ |
3800 coef_sum = (uint64_t)coef_sum * coef_sum >> 16; | 3800 coef_sum = (uint64_t)coef_sum * coef_sum >> 16; |
3801 assert(coef_sum < INT_MAX); | 3801 assert(coef_sum < INT_MAX); |
3802 | 3802 |
3803 if(pict->pict_type == I_TYPE){ | 3803 if(pict->pict_type == FF_I_TYPE){ |
3804 s->m.current_picture.mb_var_sum= coef_sum; | 3804 s->m.current_picture.mb_var_sum= coef_sum; |
3805 s->m.current_picture.mc_mb_var_sum= 0; | 3805 s->m.current_picture.mc_mb_var_sum= 0; |
3806 }else{ | 3806 }else{ |
3807 s->m.current_picture.mc_mb_var_sum= coef_sum; | 3807 s->m.current_picture.mc_mb_var_sum= coef_sum; |
3808 s->m.current_picture.mb_var_sum= 0; | 3808 s->m.current_picture.mb_var_sum= 0; |
4196 }//else keep previous frame's qlog until after motion estimation | 4196 }//else keep previous frame's qlog until after motion estimation |
4197 | 4197 |
4198 frame_start(s); | 4198 frame_start(s); |
4199 | 4199 |
4200 s->m.current_picture_ptr= &s->m.current_picture; | 4200 s->m.current_picture_ptr= &s->m.current_picture; |
4201 if(pict->pict_type == P_TYPE){ | 4201 if(pict->pict_type == FF_P_TYPE){ |
4202 int block_width = (width +15)>>4; | 4202 int block_width = (width +15)>>4; |
4203 int block_height= (height+15)>>4; | 4203 int block_height= (height+15)>>4; |
4204 int stride= s->current_picture.linesize[0]; | 4204 int stride= s->current_picture.linesize[0]; |
4205 | 4205 |
4206 assert(s->current_picture.data[0]); | 4206 assert(s->current_picture.data[0]); |
4245 memcpy(rc_block_bak, s->block_state, sizeof(s->block_state)); | 4245 memcpy(rc_block_bak, s->block_state, sizeof(s->block_state)); |
4246 } | 4246 } |
4247 | 4247 |
4248 redo_frame: | 4248 redo_frame: |
4249 | 4249 |
4250 if(pict->pict_type == I_TYPE) | 4250 if(pict->pict_type == FF_I_TYPE) |
4251 s->spatial_decomposition_count= 5; | 4251 s->spatial_decomposition_count= 5; |
4252 else | 4252 else |
4253 s->spatial_decomposition_count= 5; | 4253 s->spatial_decomposition_count= 5; |
4254 | 4254 |
4255 s->m.pict_type = pict->pict_type; | 4255 s->m.pict_type = pict->pict_type; |
4256 s->qbias= pict->pict_type == P_TYPE ? 2 : 0; | 4256 s->qbias= pict->pict_type == FF_P_TYPE ? 2 : 0; |
4257 | 4257 |
4258 common_init_after_header(avctx); | 4258 common_init_after_header(avctx); |
4259 | 4259 |
4260 if(s->last_spatial_decomposition_count != s->spatial_decomposition_count){ | 4260 if(s->last_spatial_decomposition_count != s->spatial_decomposition_count){ |
4261 for(plane_index=0; plane_index<3; plane_index++){ | 4261 for(plane_index=0; plane_index<3; plane_index++){ |
4284 } | 4284 } |
4285 } | 4285 } |
4286 predict_plane(s, s->spatial_idwt_buffer, plane_index, 0); | 4286 predict_plane(s, s->spatial_idwt_buffer, plane_index, 0); |
4287 | 4287 |
4288 if( plane_index==0 | 4288 if( plane_index==0 |
4289 && pict->pict_type == P_TYPE | 4289 && pict->pict_type == FF_P_TYPE |
4290 && !(avctx->flags&CODEC_FLAG_PASS2) | 4290 && !(avctx->flags&CODEC_FLAG_PASS2) |
4291 && s->m.me.scene_change_score > s->avctx->scenechange_threshold){ | 4291 && s->m.me.scene_change_score > s->avctx->scenechange_threshold){ |
4292 ff_init_range_encoder(c, buf, buf_size); | 4292 ff_init_range_encoder(c, buf, buf_size); |
4293 ff_build_rac_states(c, 0.05*(1LL<<32), 256-8); | 4293 ff_build_rac_states(c, 0.05*(1LL<<32), 256-8); |
4294 pict->pict_type= FF_I_TYPE; | 4294 pict->pict_type= FF_I_TYPE; |
4335 SubBand *b= &p->band[level][orientation]; | 4335 SubBand *b= &p->band[level][orientation]; |
4336 | 4336 |
4337 if(!QUANTIZE2) | 4337 if(!QUANTIZE2) |
4338 quantize(s, b, b->ibuf, b->buf, b->stride, s->qbias); | 4338 quantize(s, b, b->ibuf, b->buf, b->stride, s->qbias); |
4339 if(orientation==0) | 4339 if(orientation==0) |
4340 decorrelate(s, b, b->ibuf, b->stride, pict->pict_type == P_TYPE, 0); | 4340 decorrelate(s, b, b->ibuf, b->stride, pict->pict_type == FF_P_TYPE, 0); |
4341 encode_subband(s, b, b->ibuf, b->parent ? b->parent->ibuf : NULL, b->stride, orientation); | 4341 encode_subband(s, b, b->ibuf, b->parent ? b->parent->ibuf : NULL, b->stride, orientation); |
4342 assert(b->parent==NULL || b->parent->stride == b->stride*2); | 4342 assert(b->parent==NULL || b->parent->stride == b->stride*2); |
4343 if(orientation==0) | 4343 if(orientation==0) |
4344 correlate(s, b, b->ibuf, b->stride, 1, 0); | 4344 correlate(s, b, b->ibuf, b->stride, 1, 0); |
4345 } | 4345 } |
4362 } | 4362 } |
4363 } | 4363 } |
4364 predict_plane(s, s->spatial_idwt_buffer, plane_index, 1); | 4364 predict_plane(s, s->spatial_idwt_buffer, plane_index, 1); |
4365 }else{ | 4365 }else{ |
4366 //ME/MC only | 4366 //ME/MC only |
4367 if(pict->pict_type == I_TYPE){ | 4367 if(pict->pict_type == FF_I_TYPE){ |
4368 for(y=0; y<h; y++){ | 4368 for(y=0; y<h; y++){ |
4369 for(x=0; x<w; x++){ | 4369 for(x=0; x<w; x++){ |
4370 s->current_picture.data[plane_index][y*s->current_picture.linesize[plane_index] + x]= | 4370 s->current_picture.data[plane_index][y*s->current_picture.linesize[plane_index] + x]= |
4371 pict->data[plane_index][y*pict->linesize[plane_index] + x]; | 4371 pict->data[plane_index][y*pict->linesize[plane_index] + x]; |
4372 } | 4372 } |