Mercurial > libavcodec.hg
comparison snow.c @ 3338:937f14bb0f23 libavcodec
support doing motion estimation and compensation without any residual transform or coding
this is usefull for filters which need ME/MC
author | michael |
---|---|
date | Sun, 04 Jun 2006 21:54:58 +0000 |
parents | 955096780e7c |
children | 6805c1e5507e |
comparison
equal
deleted
inserted
replaced
3337:bec1eb6d3746 | 3338:937f14bb0f23 |
---|---|
4259 int w= p->width; | 4259 int w= p->width; |
4260 int h= p->height; | 4260 int h= p->height; |
4261 int x, y; | 4261 int x, y; |
4262 // int bits= put_bits_count(&s->c.pb); | 4262 // int bits= put_bits_count(&s->c.pb); |
4263 | 4263 |
4264 if(!(avctx->flags2 & CODEC_FLAG2_MEMC_ONLY)){ | |
4264 //FIXME optimize | 4265 //FIXME optimize |
4265 if(pict->data[plane_index]) //FIXME gray hack | 4266 if(pict->data[plane_index]) //FIXME gray hack |
4266 for(y=0; y<h; y++){ | 4267 for(y=0; y<h; y++){ |
4267 for(x=0; x<w; x++){ | 4268 for(x=0; x<w; x++){ |
4268 s->spatial_dwt_buffer[y*w + x]= pict->data[plane_index][y*pict->linesize[plane_index] + x]<<FRAC_BITS; | 4269 s->spatial_dwt_buffer[y*w + x]= pict->data[plane_index][y*pict->linesize[plane_index] + x]<<FRAC_BITS; |
4328 } | 4329 } |
4329 } | 4330 } |
4330 {START_TIMER | 4331 {START_TIMER |
4331 predict_plane(s, s->spatial_dwt_buffer, plane_index, 1); | 4332 predict_plane(s, s->spatial_dwt_buffer, plane_index, 1); |
4332 STOP_TIMER("pred-conv")} | 4333 STOP_TIMER("pred-conv")} |
4334 }else{ | |
4335 //ME/MC only | |
4336 if(pict->pict_type == I_TYPE){ | |
4337 for(y=0; y<h; y++){ | |
4338 for(x=0; x<w; x++){ | |
4339 s->current_picture.data[plane_index][y*s->current_picture.linesize[plane_index] + x]= | |
4340 pict->data[plane_index][y*pict->linesize[plane_index] + x]; | |
4341 } | |
4342 } | |
4343 }else{ | |
4344 memset(s->spatial_dwt_buffer, 0, sizeof(DWTELEM)*w*h); | |
4345 predict_plane(s, s->spatial_dwt_buffer, plane_index, 1); | |
4346 } | |
4347 } | |
4333 if(s->avctx->flags&CODEC_FLAG_PSNR){ | 4348 if(s->avctx->flags&CODEC_FLAG_PSNR){ |
4334 int64_t error= 0; | 4349 int64_t error= 0; |
4335 | 4350 |
4336 if(pict->data[plane_index]) //FIXME gray hack | 4351 if(pict->data[plane_index]) //FIXME gray hack |
4337 for(y=0; y<h; y++){ | 4352 for(y=0; y<h; y++){ |