[FFmpeg-devel] [PATCH 10/33] vp3: use hpeldsp instead of dsputil for half-pel functions.

Ronald S. Bultje rsbultje at gmail.com
Wed Feb 6 04:27:23 CET 2013


From: "Ronald S. Bultje" <rsbultje at gmail.com>

---
 configure        | 2 +-
 libavcodec/vp3.c | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index 6ecb0d0..21c72cb 100755
--- a/configure
+++ b/configure
@@ -1757,7 +1757,7 @@ vc1_decoder_select="h263_decoder h264chroma h264qpel"
 vc1image_decoder_select="vc1_decoder"
 vorbis_decoder_select="mdct"
 vorbis_encoder_select="mdct"
-vp3_decoder_select="vp3dsp videodsp"
+vp3_decoder_select="hpeldsp vp3dsp videodsp"
 vp5_decoder_select="vp3dsp videodsp"
 vp6_decoder_select="huffman vp3dsp videodsp"
 vp6a_decoder_select="vp6_decoder"
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 00a77e9..78fd908 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -38,6 +38,7 @@
 #include "internal.h"
 #include "dsputil.h"
 #include "get_bits.h"
+#include "hpeldsp.h"
 #include "videodsp.h"
 #include "vp3data.h"
 #include "vp3dsp.h"
@@ -140,6 +141,7 @@ typedef struct Vp3DecodeContext {
     AVFrame current_frame;
     int keyframe;
     DSPContext dsp;
+    HpelDSPContext hdsp;
     VideoDSPContext vdsp;
     VP3DSPContext vp3dsp;
     DECLARE_ALIGNED(16, int16_t, block)[64];
@@ -1565,7 +1567,7 @@ static void render_slice(Vp3DecodeContext *s, int slice)
                            VP3 source but this would be slower as
                            put_no_rnd_pixels_tab is better optimzed */
                         if(motion_halfpel_index != 3){
-                            s->dsp.put_no_rnd_pixels_tab[1][motion_halfpel_index](
+                            s->hdsp.put_no_rnd_pixels_tab[1][motion_halfpel_index](
                                 output_plane + first_pixel,
                                 motion_source, stride, 8);
                         }else{
@@ -1599,7 +1601,7 @@ static void render_slice(Vp3DecodeContext *s, int slice)
                 } else {
 
                     /* copy directly from the previous frame */
-                    s->dsp.put_pixels_tab[1][0](
+                    s->hdsp.put_pixels_tab[1][0](
                         output_plane + first_pixel,
                         last_plane + first_pixel,
                         stride, 8);
@@ -1676,7 +1678,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
     if (avctx->codec_id != AV_CODEC_ID_THEORA)
         avctx->pix_fmt = AV_PIX_FMT_YUV420P;
     avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
-    ff_dsputil_init(&s->dsp, avctx);
+    ff_hpeldsp_init(&s->hdsp, avctx->flags | CODEC_FLAG_BITEXACT);
     ff_videodsp_init(&s->vdsp, 8);
     ff_vp3dsp_init(&s->vp3dsp, avctx->flags);
 
-- 
1.7.11.3



More information about the ffmpeg-devel mailing list