[FFmpeg-cvslog] mjpeg: use hpeldsp instead of dsputil for half-pel functions.

Ronald S. Bultje git at videolan.org
Wed Mar 13 04:18:41 CET 2013


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Sun Mar 10 14:23:52 2013 -0700| [e0a8f315911ccd12d1e2eeef6a921b942e0063ab] | committer: Michael Niedermayer

mjpeg: use hpeldsp instead of dsputil for half-pel functions.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e0a8f315911ccd12d1e2eeef6a921b942e0063ab
---

 configure             |    1 +
 libavcodec/mjpegdec.c |    3 ++-
 libavcodec/mjpegdec.h |    2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 65152f5..4afe0dc 100755
--- a/configure
+++ b/configure
@@ -1750,6 +1750,7 @@ ljpeg_encoder_select="aandcttables mpegvideoenc"
 loco_decoder_select="golomb"
 mdec_decoder_select="dsputil error_resilience mpegvideo"
 mimic_decoder_select="dsputil hpeldsp"
+mjpeg_decoder_select="dsputil hpeldsp"
 mjpeg_encoder_select="aandcttables dsputil mpegvideoenc"
 mlp_decoder_select="dsputil mlp_parser"
 motionpixels_decoder_select="dsputil"
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 2f75194..7a4c78c 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -89,6 +89,7 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
     avcodec_get_frame_defaults(&s->picture);
 
     s->avctx = avctx;
+    ff_hpeldsp_init(&s->hdsp, avctx->flags);
     ff_dsputil_init(&s->dsp, avctx);
     ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
     s->buffer_size   = 0;
@@ -992,7 +993,7 @@ static av_always_inline void mjpeg_copy_block(MJpegDecodeContext *s,
                                               int linesize, int lowres)
 {
     switch (lowres) {
-    case 0: s->dsp.put_pixels_tab[1][0](dst, src, linesize, 8);
+    case 0: s->hdsp.put_pixels_tab[1][0](dst, src, linesize, 8);
         break;
     case 1: copy_block4(dst, src, linesize, linesize, 4);
         break;
diff --git a/libavcodec/mjpegdec.h b/libavcodec/mjpegdec.h
index 01f4323..17665e4 100644
--- a/libavcodec/mjpegdec.h
+++ b/libavcodec/mjpegdec.h
@@ -34,6 +34,7 @@
 #include "avcodec.h"
 #include "get_bits.h"
 #include "dsputil.h"
+#include "hpeldsp.h"
 
 #define MAX_COMPONENTS 4
 
@@ -97,6 +98,7 @@ typedef struct MJpegDecodeContext {
     uint64_t coefs_finished[MAX_COMPONENTS]; ///< bitmask of which coefs have been completely decoded (progressive mode)
     ScanTable scantable;
     DSPContext dsp;
+    HpelDSPContext hdsp;
 
     int restart_interval;
     int restart_count;



More information about the ffmpeg-cvslog mailing list