summaryrefslogtreecommitdiff
path: root/libavcodec/snow.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-06-04 21:54:58 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-06-04 21:54:58 +0000
commit086bfd256e3150ad37bc115a46a3b4580d4de574 (patch)
tree25073fbc29536239ab285b89f349e1e37e5a2312 /libavcodec/snow.c
parenta9d4a6ef3437d316450c2e30b9ed6a8fd4df4804 (diff)
support doing motion estimation and compensation without any residual transform or coding
this is usefull for filters which need ME/MC Originally committed as revision 5456 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r--libavcodec/snow.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index d20b9604ba..5bd7623ab5 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -4261,6 +4261,7 @@ redo_frame:
int x, y;
// int bits= put_bits_count(&s->c.pb);
+ if(!(avctx->flags2 & CODEC_FLAG2_MEMC_ONLY)){
//FIXME optimize
if(pict->data[plane_index]) //FIXME gray hack
for(y=0; y<h; y++){
@@ -4330,6 +4331,20 @@ redo_frame:
{START_TIMER
predict_plane(s, s->spatial_dwt_buffer, plane_index, 1);
STOP_TIMER("pred-conv")}
+ }else{
+ //ME/MC only
+ if(pict->pict_type == I_TYPE){
+ for(y=0; y<h; y++){
+ for(x=0; x<w; x++){
+ s->current_picture.data[plane_index][y*s->current_picture.linesize[plane_index] + x]=
+ pict->data[plane_index][y*pict->linesize[plane_index] + x];
+ }
+ }
+ }else{
+ memset(s->spatial_dwt_buffer, 0, sizeof(DWTELEM)*w*h);
+ predict_plane(s, s->spatial_dwt_buffer, plane_index, 1);
+ }
+ }
if(s->avctx->flags&CODEC_FLAG_PSNR){
int64_t error= 0;