dsputil: Split off FDCT bits into their own context

This commit is contained in:
Diego Biurrun
2014-02-03 10:09:45 -08:00
parent 1e9a93bfca
commit a9aee08d90
21 changed files with 238 additions and 93 deletions

View File

@@ -28,10 +28,8 @@
#include "libavutil/attributes.h"
#include "avcodec.h"
#include "copy_block.h"
#include "dct.h"
#include "dsputil.h"
#include "simple_idct.h"
#include "faandct.h"
#include "mpegvideo.h"
#include "config.h"
@@ -580,7 +578,7 @@ static int dct_sad8x8_c(MpegEncContext *s, uint8_t *src1,
assert(h == 8);
s->dsp.diff_pixels(temp, src1, src2, stride);
s->dsp.fdct(temp);
s->fdsp.fdct(temp);
return s->dsp.sum_abs_dctelem(temp);
}
@@ -647,7 +645,7 @@ static int dct_max8x8_c(MpegEncContext *s, uint8_t *src1,
assert(h == 8);
s->dsp.diff_pixels(temp, src1, src2, stride);
s->dsp.fdct(temp);
s->fdsp.fdct(temp);
for (i = 0; i < 64; i++)
sum = FFMAX(sum, FFABS(temp[i]));
@@ -934,24 +932,6 @@ av_cold void ff_dsputil_init(DSPContext *c, AVCodecContext *avctx)
{
const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
#if CONFIG_ENCODERS
if (avctx->bits_per_raw_sample == 10) {
c->fdct = ff_jpeg_fdct_islow_10;
c->fdct248 = ff_fdct248_islow_10;
} else {
if (avctx->dct_algo == FF_DCT_FASTINT) {
c->fdct = ff_fdct_ifast;
c->fdct248 = ff_fdct_ifast248;
} else if (avctx->dct_algo == FF_DCT_FAAN) {
c->fdct = ff_faandct;
c->fdct248 = ff_faandct248;
} else {
c->fdct = ff_jpeg_fdct_islow_8; // slow/accurate/default
c->fdct248 = ff_fdct248_islow_8;
}
}
#endif /* CONFIG_ENCODERS */
c->diff_pixels = diff_pixels_c;
c->sum_abs_dctelem = sum_abs_dctelem_c;