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

Ronald S. Bultje git at videolan.org
Sat Apr 20 13:28:09 CEST 2013


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Sun Mar 10 14:23:52 2013 -0700| [28bc406c84b04a5f1458b90ff52ddbec73e46202] | committer: Martin Storsjö

mjpeg: Use hpeldsp instead of dsputil for half-pel functions

Signed-off-by: Martin Storsjö <martin at martin.st>

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

 configure             |   14 +++++++-------
 libavcodec/mjpegdec.c |    9 +++++----
 libavcodec/mjpegdec.h |    2 ++
 3 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index ed2fdfe..e798cf6 100755
--- a/configure
+++ b/configure
@@ -1525,7 +1525,7 @@ alac_encoder_select="lpc"
 als_decoder_select="dsputil"
 amrnb_decoder_select="lsp"
 amrwb_decoder_select="lsp"
-amv_decoder_select="dsputil"
+amv_decoder_select="dsputil hpeldsp"
 ape_decoder_select="dsputil"
 asv1_decoder_select="dsputil"
 asv1_encoder_select="dsputil"
@@ -1580,7 +1580,7 @@ iac_decoder_select="dsputil fft mdct sinewin"
 imc_decoder_select="dsputil fft mdct sinewin"
 indeo3_decoder_select="hpeldsp"
 interplay_video_decoder_select="hpeldsp"
-jpegls_decoder_select="dsputil golomb"
+jpegls_decoder_select="dsputil golomb hpeldsp"
 jpegls_encoder_select="golomb"
 jv_decoder_select="dsputil"
 lagarith_decoder_select="dsputil"
@@ -1588,8 +1588,8 @@ 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"
-mjpegb_decoder_select="dsputil"
+mjpeg_decoder_select="dsputil hpeldsp"
+mjpegb_decoder_select="dsputil hpeldsp"
 mjpeg_encoder_select="aandcttables dsputil mpegvideoenc"
 mlp_decoder_select="dsputil mlp_parser"
 motionpixels_decoder_select="dsputil"
@@ -1619,7 +1619,7 @@ msmpeg4v2_encoder_select="h263_encoder"
 msmpeg4v3_decoder_select="h263_decoder"
 msmpeg4v3_encoder_select="h263_encoder"
 mss2_decoder_select="error_resilience vc1_decoder"
-mxpeg_decoder_select="dsputil"
+mxpeg_decoder_select="dsputil hpeldsp"
 nellymoser_decoder_select="mdct sinewin"
 nellymoser_encoder_select="audio_frame_queue mdct sinewin"
 nuv_decoder_select="dsputil lzo"
@@ -1639,7 +1639,7 @@ rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvi
 rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo videodsp"
 shorten_decoder_select="golomb"
 sipr_decoder_select="lsp"
-sp5x_decoder_select="dsputil"
+sp5x_decoder_select="dsputil hpeldsp"
 svq1_decoder_select="hpeldsp"
 svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc"
 svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel hpeldsp mpegvideo videodsp"
@@ -1648,7 +1648,7 @@ tak_decoder_select="dsputil"
 theora_decoder_select="vp3_decoder"
 tiff_decoder_suggest="zlib"
 tiff_encoder_suggest="zlib"
-thp_decoder_select="dsputil"
+thp_decoder_select="dsputil hpeldsp"
 truehd_decoder_select="mlp_decoder"
 truemotion2_decoder_select="dsputil"
 truespeech_decoder_select="dsputil"
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index abc32d1..61ebabc 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -89,6 +89,7 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
         s->picture_ptr = &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;
@@ -858,7 +859,7 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
                     ptr = data[c] + block_offset;
                     if (!s->progressive) {
                         if (copy_mb)
-                            s->dsp.put_pixels_tab[1][0](ptr,
+                            s->hdsp.put_pixels_tab[1][0](ptr,
                                 reference_data[c] + block_offset,
                                 linesize[c], 8);
                         else {
@@ -974,9 +975,9 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
 
             if (last_scan) {
                 if (copy_mb) {
-                    s->dsp.put_pixels_tab[1][0](ptr,
-                                                reference_data + block_offset,
-                                                linesize, 8);
+                    s->hdsp.put_pixels_tab[1][0](ptr,
+                                                 reference_data + block_offset,
+                                                 linesize, 8);
                 } else {
                     s->dsp.idct_put(ptr, linesize, *block);
                     ptr += 8;
diff --git a/libavcodec/mjpegdec.h b/libavcodec/mjpegdec.h
index d48877e..36598dd 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
 
@@ -94,6 +95,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