diff h264.c @ 3807:6a40092eb9e6 libavcodec

approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
author lorenm
date Sun, 01 Oct 2006 21:25:17 +0000
parents 1843a85123b7
children f44a3341bfdf
line wrap: on
line diff
--- a/h264.c	Sun Oct 01 18:19:49 2006 +0000
+++ b/h264.c	Sun Oct 01 21:25:17 2006 +0000
@@ -3782,8 +3782,8 @@
                 xchg_mb_border(h, dest_y, dest_cb, dest_cr, linesize, uvlinesize, 0);
         }else if(s->codec_id == CODEC_ID_H264){
             hl_motion(h, dest_y, dest_cb, dest_cr,
-                      s->dsp.put_h264_qpel_pixels_tab, s->dsp.put_h264_chroma_pixels_tab,
-                      s->dsp.avg_h264_qpel_pixels_tab, s->dsp.avg_h264_chroma_pixels_tab,
+                      s->me.qpel_put, s->dsp.put_h264_chroma_pixels_tab,
+                      s->me.qpel_avg, s->dsp.avg_h264_chroma_pixels_tab,
                       s->dsp.weight_h264_pixels_tab, s->dsp.biweight_h264_pixels_tab);
         }
 
@@ -4885,6 +4885,14 @@
                );
     }
 
+    if((s->avctx->flags2 & CODEC_FLAG2_FAST) && !s->current_picture.reference){
+        s->me.qpel_put= s->dsp.put_2tap_qpel_pixels_tab;
+        s->me.qpel_avg= s->dsp.avg_2tap_qpel_pixels_tab;
+    }else{
+        s->me.qpel_put= s->dsp.put_h264_qpel_pixels_tab;
+        s->me.qpel_avg= s->dsp.avg_h264_qpel_pixels_tab;
+    }
+
     return 0;
 }