diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-10 00:56:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-10 01:22:14 +0200 |
commit | 2d5e9451de3c7ab00cac6ec4aff290e12a2f190d (patch) | |
tree | 9934a09e3ad1f63796274ee59f216df19cd9ca02 /libavfilter | |
parent | 6cc1fec41263add956b35af96d7c4a81c9436a65 (diff) | |
parent | f46bb608d9d76c543e4929dc8cffe36b84bd789e (diff) | |
download | ffmpeg-2d5e9451de3c7ab00cac6ec4aff290e12a2f190d.tar.gz |
Merge commit 'f46bb608d9d76c543e4929dc8cffe36b84bd789e'
* commit 'f46bb608d9d76c543e4929dc8cffe36b84bd789e':
dsputil: Split off pixel block routines into their own context
Conflicts:
configure
libavcodec/dsputil.c
libavcodec/mpegvideo_enc.c
libavcodec/pixblockdsp_template.c
libavcodec/x86/dsputilenc.asm
libavcodec/x86/dsputilenc_mmx.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_mpdecimate.c | 6 | ||||
-rw-r--r-- | libavfilter/vf_spp.c | 4 | ||||
-rw-r--r-- | libavfilter/vf_spp.h | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/libavfilter/vf_mpdecimate.c b/libavfilter/vf_mpdecimate.c index 099622a029..c667a9f4cc 100644 --- a/libavfilter/vf_mpdecimate.c +++ b/libavfilter/vf_mpdecimate.c @@ -28,6 +28,7 @@ #include "libavutil/pixdesc.h" #include "libavutil/timestamp.h" #include "libavcodec/dsputil.h" +#include "libavcodec/pixblockdsp.h" #include "avfilter.h" #include "internal.h" #include "formats.h" @@ -49,6 +50,7 @@ typedef struct { int hsub, vsub; ///< chroma subsampling values AVFrame *ref; ///< reference picture DSPContext dspctx; ///< context providing optimized diff routines + PixblockDSPContext pdsp; AVCodecContext *avctx; ///< codec context required for the DSPContext } DecimateContext; @@ -75,6 +77,7 @@ static int diff_planes(AVFilterContext *ctx, { DecimateContext *decimate = ctx->priv; DSPContext *dspctx = &decimate->dspctx; + PixblockDSPContext *pdsp = &decimate->pdsp; int x, y; int d, c = 0; @@ -84,7 +87,7 @@ static int diff_planes(AVFilterContext *ctx, /* compute difference for blocks of 8x8 bytes */ for (y = 0; y < h-7; y += 4) { for (x = 8; x < w-7; x += 4) { - dspctx->diff_pixels(block, + pdsp->diff_pixels(block, cur+x+y*linesize, ref+x+y*linesize, linesize); d = dspctx->sum_abs_dctelem(block); @@ -141,6 +144,7 @@ static av_cold int init(AVFilterContext *ctx) if (!decimate->avctx) return AVERROR(ENOMEM); avpriv_dsputil_init(&decimate->dspctx, decimate->avctx); + ff_pixblockdsp_init(&decimate->pdsp, decimate->avctx); return 0; } diff --git a/libavfilter/vf_spp.c b/libavfilter/vf_spp.c index 9df87ff3f2..4e4a5795f4 100644 --- a/libavfilter/vf_spp.c +++ b/libavfilter/vf_spp.c @@ -232,7 +232,7 @@ static void filter(SPPContext *p, uint8_t *dst, uint8_t *src, const int x1 = x + offset[i + count - 1][0]; const int y1 = y + offset[i + count - 1][1]; const int index = x1 + y1*linesize; - p->dsp.get_pixels(block, p->src + index, linesize); + p->pdsp.get_pixels(block, p->src + index, linesize); p->fdsp.fdct(block); p->requantize(block2, block, qp, p->idsp.idct_permutation); p->idsp.idct(block2); @@ -380,9 +380,9 @@ static av_cold int init(AVFilterContext *ctx) spp->avctx = avcodec_alloc_context3(NULL); if (!spp->avctx) return AVERROR(ENOMEM); - avpriv_dsputil_init(&spp->dsp, spp->avctx); ff_idctdsp_init(&spp->idsp, spp->avctx); ff_fdctdsp_init(&spp->fdsp, spp->avctx); + ff_pixblockdsp_init(&spp->pdsp, spp->avctx); spp->store_slice = store_slice_c; switch (spp->mode) { case MODE_HARD: spp->requantize = hardthresh_c; break; diff --git a/libavfilter/vf_spp.h b/libavfilter/vf_spp.h index 909d4de812..c8eac3caf2 100644 --- a/libavfilter/vf_spp.h +++ b/libavfilter/vf_spp.h @@ -23,7 +23,7 @@ #define AVFILTER_SPP_H #include "libavcodec/avcodec.h" -#include "libavcodec/dsputil.h" +#include "libavcodec/pixblockdsp.h" #include "libavcodec/idctdsp.h" #include "libavcodec/fdctdsp.h" #include "avfilter.h" @@ -41,9 +41,9 @@ typedef struct { uint8_t *src; int16_t *temp; AVCodecContext *avctx; - DSPContext dsp; IDCTDSPContext idsp; FDCTDSPContext fdsp; + PixblockDSPContext pdsp; int8_t *non_b_qp_table; int non_b_qp_alloc_size; int use_bframe_qp; |