diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-09-23 15:55:24 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-09-23 17:04:02 +0200 |
commit | b0f7de3e7c735cf6e222006ecbbd3e11b5f90a21 (patch) | |
tree | cf5bed599a748fa8257b6a5879dca00035f1c34b /libavcodec/asvenc.c | |
parent | 0bb5ad7a06ebcda9102357f8755d18b63f56aa29 (diff) | |
download | ffmpeg-b0f7de3e7c735cf6e222006ecbbd3e11b5f90a21.tar.gz |
avcodec/asvenc: fix AAN scaling
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/asvenc.c')
-rw-r--r-- | libavcodec/asvenc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c index ccd8182e1e..2b2080ef6c 100644 --- a/libavcodec/asvenc.c +++ b/libavcodec/asvenc.c @@ -26,8 +26,10 @@ #include "libavutil/attributes.h" #include "libavutil/mem.h" +#include "aandcttab.h" #include "asv.h" #include "avcodec.h" +#include "dct.h" #include "fdctdsp.h" #include "internal.h" #include "mathops.h" @@ -335,8 +337,13 @@ static av_cold int encode_init(AVCodecContext *avctx) ((uint32_t *) avctx->extradata)[1] = av_le2ne32(AV_RL32("ASUS")); for (i = 0; i < 64; i++) { - int q = 32 * scale * ff_mpeg1_default_intra_matrix[i]; - a->q_intra_matrix[i] = ((a->inv_qscale << 16) + q / 2) / q; + if (a->fdsp.fdct == ff_fdct_ifast) { + int q = 32LL * scale * ff_mpeg1_default_intra_matrix[i] * ff_aanscales[i]; + a->q_intra_matrix[i] = (((int64_t)a->inv_qscale << 30) + q / 2) / q; + } else { + int q = 32 * scale * ff_mpeg1_default_intra_matrix[i]; + a->q_intra_matrix[i] = ((a->inv_qscale << 16) + q / 2) / q; + } } return 0; |