diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-01 14:38:57 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-01 15:22:11 +0200 |
commit | 581b5f0b9b93969712e73e0ae6324bbd03e85d4e (patch) | |
tree | d1319dc7744ac67e6ebd3379f11ff6e4a8178dc1 /libavcodec/mpegvideo_enc.c | |
parent | 909f53f2b285bc7dbe77d4690a03f3d114417297 (diff) | |
parent | e3fcb14347466095839c2a3c47ebecff02da891e (diff) | |
download | ffmpeg-581b5f0b9b93969712e73e0ae6324bbd03e85d4e.tar.gz |
Merge commit 'e3fcb14347466095839c2a3c47ebecff02da891e'
* commit 'e3fcb14347466095839c2a3c47ebecff02da891e':
dsputil: Split off IDCT bits into their own context
Conflicts:
configure
libavcodec/aic.c
libavcodec/arm/Makefile
libavcodec/arm/dsputil_init_arm.c
libavcodec/arm/dsputil_init_armv6.c
libavcodec/asvdec.c
libavcodec/dnxhdenc.c
libavcodec/dsputil.c
libavcodec/dvdec.c
libavcodec/dxva2_mpeg2.c
libavcodec/intrax8.c
libavcodec/mdec.c
libavcodec/mjpegdec.c
libavcodec/mjpegenc_common.h
libavcodec/mpegvideo.c
libavcodec/ppc/dsputil_altivec.h
libavcodec/ppc/dsputil_ppc.c
libavcodec/ppc/idctdsp.c
libavcodec/x86/Makefile
libavcodec/x86/dsputil_init.c
libavcodec/x86/dsputil_mmx.c
libavcodec/x86/dsputil_x86.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 35cde20cb1..ffd91a7ab8 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -38,6 +38,7 @@ #include "avcodec.h" #include "dct.h" #include "dsputil.h" +#include "idctdsp.h" #include "mpeg12.h" #include "mpegvideo.h" #include "h261.h" @@ -87,7 +88,7 @@ void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64], dsp->fdct == ff_jpeg_fdct_islow_10 || dsp->fdct == ff_faandct) { for (i = 0; i < 64; i++) { - const int j = dsp->idct_permutation[i]; + const int j = s->idsp.idct_permutation[i]; /* 16 <= qscale * quant_matrix[i] <= 7905 * Assume x = ff_aanscales[i] * qscale * quant_matrix[i] * 19952 <= x <= 249205026 @@ -99,7 +100,7 @@ void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64], } } else if (dsp->fdct == ff_fdct_ifast) { for (i = 0; i < 64; i++) { - const int j = dsp->idct_permutation[i]; + const int j = s->idsp.idct_permutation[i]; /* 16 <= qscale * quant_matrix[i] <= 7905 * Assume x = ff_aanscales[i] * qscale * quant_matrix[i] * 19952 <= x <= 249205026 @@ -111,7 +112,7 @@ void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64], } } else { for (i = 0; i < 64; i++) { - const int j = dsp->idct_permutation[i]; + const int j = s->idsp.idct_permutation[i]; /* We can safely suppose that 16 <= quant_matrix[i] <= 255 * Assume x = qscale * quant_matrix[i] * So 16 <= x <= 7905 @@ -866,7 +867,7 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) /* init q matrix */ for (i = 0; i < 64; i++) { - int j = s->dsp.idct_permutation[i]; + int j = s->idsp.idct_permutation[i]; if (CONFIG_MPEG4_ENCODER && s->codec_id == AV_CODEC_ID_MPEG4 && s->mpeg_quant) { s->intra_matrix[j] = ff_mpeg4_default_intra_matrix[i]; @@ -3553,7 +3554,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) /* for mjpeg, we do include qscale in the matrix */ for(i=1;i<64;i++){ - int j= s->dsp.idct_permutation[i]; + int j = s->idsp.idct_permutation[i]; s->chroma_intra_matrix[j] = av_clip_uint8((chroma_matrix[i] * s->qscale) >> 3); s-> intra_matrix[j] = av_clip_uint8(( luma_matrix[i] * s->qscale) >> 3); @@ -3572,7 +3573,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) static const uint8_t y[32]={13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13}; static const uint8_t c[32]={14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14}; for(i=1;i<64;i++){ - int j= s->dsp.idct_permutation[ff_zigzag_direct[i]]; + int j= s->idsp.idct_permutation[ff_zigzag_direct[i]]; s->intra_matrix[j] = sp5x_quant_table[5*2+0][i]; s->chroma_intra_matrix[j] = sp5x_quant_table[5*2+1][i]; @@ -3806,7 +3807,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s, if(s->out_format == FMT_H263 || s->out_format == FMT_H261){ unquant_coeff= alevel*qmul + qadd; }else{ //MPEG1 - j= s->dsp.idct_permutation[ scantable[i] ]; //FIXME optimize + j = s->idsp.idct_permutation[scantable[i]]; // FIXME: optimize if(s->mb_intra){ unquant_coeff = (int)( alevel * qscale * s->intra_matrix[j]) >> 3; unquant_coeff = (unquant_coeff - 1) | 1; @@ -4012,7 +4013,7 @@ static int messed_sign=0; #endif if(basis[0][0] == 0) - build_basis(s->dsp.idct_permutation); + build_basis(s->idsp.idct_permutation); qmul= qscale*2; qadd= (qscale-1)|1; @@ -4431,8 +4432,9 @@ int ff_dct_quantize_c(MpegEncContext *s, *overflow= s->max_qcoeff < max; //overflow might have happened /* we need this permutation so that we correct the IDCT, we only permute the !=0 elements */ - if (s->dsp.idct_permutation_type != FF_NO_IDCT_PERM) - ff_block_permute(block, s->dsp.idct_permutation, scantable, last_non_zero); + if (s->idsp.idct_permutation_type != FF_NO_IDCT_PERM) + ff_block_permute(block, s->idsp.idct_permutation, + scantable, last_non_zero); return last_non_zero; } |