diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-08 03:12:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-08 03:19:06 +0200 |
commit | 14e2406de7d211d50fcce0059c90103bdaa947aa (patch) | |
tree | 10e20cd60b4f4bc91d14957b9565871cdd0381c3 /libavcodec/mpegvideo_enc.c | |
parent | 5c7bf354dc0c8bea6e7af21c0bc2edad92974274 (diff) | |
parent | a9aee08d900f686e966c64afec5d88a7d9d130a3 (diff) |
Merge commit 'a9aee08d900f686e966c64afec5d88a7d9d130a3'
* commit 'a9aee08d900f686e966c64afec5d88a7d9d130a3':
dsputil: Split off FDCT bits into their own context
Conflicts:
configure
libavcodec/Makefile
libavcodec/asvenc.c
libavcodec/dnxhdenc.c
libavcodec/dsputil.c
libavcodec/mpegvideo.h
libavcodec/mpegvideo_enc.c
libavcodec/x86/Makefile
libavcodec/x86/dsputilenc_mmx.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index d39f88edde..826f061eea 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -78,15 +78,15 @@ void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64], const uint16_t *quant_matrix, int bias, int qmin, int qmax, int intra) { - DSPContext *dsp = &s->dsp; + FDCTDSPContext *fdsp = &s->fdsp; int qscale; int shift = 0; for (qscale = qmin; qscale <= qmax; qscale++) { int i; - if (dsp->fdct == ff_jpeg_fdct_islow_8 || - dsp->fdct == ff_jpeg_fdct_islow_10 || - dsp->fdct == ff_faandct) { + if (fdsp->fdct == ff_jpeg_fdct_islow_8 || + fdsp->fdct == ff_jpeg_fdct_islow_10 || + fdsp->fdct == ff_faandct) { for (i = 0; i < 64; i++) { const int j = s->idsp.idct_permutation[i]; /* 16 <= qscale * quant_matrix[i] <= 7905 @@ -98,7 +98,7 @@ void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64], qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) / (qscale * quant_matrix[j])); } - } else if (dsp->fdct == ff_fdct_ifast) { + } else if (fdsp->fdct == ff_fdct_ifast) { for (i = 0; i < 64; i++) { const int j = s->idsp.idct_permutation[i]; /* 16 <= qscale * quant_matrix[i] <= 7905 @@ -136,7 +136,7 @@ void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64], for (i = intra; i < 64; i++) { int64_t max = 8191; - if (dsp->fdct == ff_fdct_ifast) { + if (fdsp->fdct == ff_fdct_ifast) { max = (8191LL * ff_aanscales[i]) >> 14; } while (((max * qmat[qscale][i]) >> shift) > INT_MAX) { @@ -818,6 +818,7 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) if (ff_MPV_common_init(s) < 0) return -1; + ff_fdctdsp_init(&s->fdsp, avctx); ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx); ff_qpeldsp_init(&s->qdsp); @@ -3714,7 +3715,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s, uint8_t * last_length; const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6); - s->dsp.fdct (block); + s->fdsp.fdct(block); if(s->dct_error_sum) s->denoise_dct(s, block); @@ -3809,7 +3810,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s, int dct_coeff= FFABS(block[ scantable[i] ]); int best_score=256*256*256*120; - if (s->dsp.fdct == ff_fdct_ifast) + if (s->fdsp.fdct == ff_fdct_ifast) dct_coeff= (dct_coeff*ff_inv_aanscales[ scantable[i] ]) >> 12; zero_distortion= dct_coeff*dct_coeff; @@ -4141,7 +4142,7 @@ STOP_TIMER("init rem[]") STOP_TIMER("rem*w*w")} {START_TIMER #endif - s->dsp.fdct(d1); + s->fdsp.fdct(d1); #ifdef REFINE_STATS STOP_TIMER("dct")} #endif @@ -4388,7 +4389,7 @@ int ff_dct_quantize_c(MpegEncContext *s, int max=0; unsigned int threshold1, threshold2; - s->dsp.fdct (block); + s->fdsp.fdct(block); if(s->dct_error_sum) s->denoise_dct(s, block); |