mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-02-04 14:30:55 +08:00
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user