aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/eatqi.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-07-29 13:09:10 +0100
committerMans Rullgard <mans@mansr.com>2012-07-29 21:30:57 +0100
commitf3eb00834362273dcb1fd3320faa5f8f5a00fb22 (patch)
tree2987b75048fa48d5dc6591b16aea3ed7824f20a5 /libavcodec/eatqi.c
parent591766a3a9c88614b9cb0ed90e25dc6e7d883752 (diff)
downloadffmpeg-f3eb00834362273dcb1fd3320faa5f8f5a00fb22.tar.gz
eamad/eatgq/eatqi: call special EA IDCT directly
These decoders use a special non-MPEG2 IDCT. Call it directly instead of going through dsputil. There is never any reason to use a regular IDCT with these decoders or to use the EA IDCT with other codecs. This also fixes the bizarre situation of eamad and eatqi decoding incorrectly if eatgq is disabled. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/eatqi.c')
-rw-r--r--libavcodec/eatqi.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c
index 9824940d97..548a084044 100644
--- a/libavcodec/eatqi.c
+++ b/libavcodec/eatqi.c
@@ -30,6 +30,7 @@
#include "get_bits.h"
#include "dsputil.h"
#include "aandcttab.h"
+#include "eaidct.h"
#include "mpeg12.h"
#include "mpegvideo.h"
@@ -46,9 +47,8 @@ static av_cold int tqi_decode_init(AVCodecContext *avctx)
TqiContext *t = avctx->priv_data;
MpegEncContext *s = &t->s;
s->avctx = avctx;
- if(avctx->idct_algo==FF_IDCT_AUTO)
- avctx->idct_algo=FF_IDCT_EA;
ff_dsputil_init(&s->dsp, avctx);
+ ff_init_scantable_permutation(s->dsp.idct_permutation, FF_NO_IDCT_PERM);
ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);
s->qscale = 1;
avctx->time_base = (AVRational){1, 15};
@@ -76,13 +76,13 @@ static inline void tqi_idct_put(TqiContext *t, DCTELEM (*block)[64])
uint8_t *dest_cb = t->frame.data[1] + (s->mb_y * 8 * t->frame.linesize[1]) + s->mb_x * 8;
uint8_t *dest_cr = t->frame.data[2] + (s->mb_y * 8 * t->frame.linesize[2]) + s->mb_x * 8;
- s->dsp.idct_put(dest_y , linesize, block[0]);
- s->dsp.idct_put(dest_y + 8, linesize, block[1]);
- s->dsp.idct_put(dest_y + 8*linesize , linesize, block[2]);
- s->dsp.idct_put(dest_y + 8*linesize + 8, linesize, block[3]);
+ ff_ea_idct_put_c(dest_y , linesize, block[0]);
+ ff_ea_idct_put_c(dest_y + 8, linesize, block[1]);
+ ff_ea_idct_put_c(dest_y + 8*linesize , linesize, block[2]);
+ ff_ea_idct_put_c(dest_y + 8*linesize + 8, linesize, block[3]);
if(!(s->avctx->flags&CODEC_FLAG_GRAY)) {
- s->dsp.idct_put(dest_cb, t->frame.linesize[1], block[4]);
- s->dsp.idct_put(dest_cr, t->frame.linesize[2], block[5]);
+ ff_ea_idct_put_c(dest_cb, t->frame.linesize[1], block[4]);
+ ff_ea_idct_put_c(dest_cr, t->frame.linesize[2], block[5]);
}
}
@@ -90,15 +90,9 @@ static void tqi_calculate_qtable(MpegEncContext *s, int quant)
{
const int qscale = (215 - 2*quant)*5;
int i;
- if (s->avctx->idct_algo==FF_IDCT_EA) {
- s->intra_matrix[0] = (ff_inv_aanscales[0]*ff_mpeg1_default_intra_matrix[0])>>11;
- for(i=1; i<64; i++)
- s->intra_matrix[i] = (ff_inv_aanscales[i]*ff_mpeg1_default_intra_matrix[i]*qscale + 32)>>14;
- }else{
- s->intra_matrix[0] = ff_mpeg1_default_intra_matrix[0];
- for(i=1; i<64; i++)
- s->intra_matrix[i] = (ff_mpeg1_default_intra_matrix[i]*qscale + 32)>>3;
- }
+ s->intra_matrix[0] = (ff_inv_aanscales[0]*ff_mpeg1_default_intra_matrix[0])>>11;
+ for(i=1; i<64; i++)
+ s->intra_matrix[i] = (ff_inv_aanscales[i]*ff_mpeg1_default_intra_matrix[i]*qscale + 32)>>14;
}
static int tqi_decode_frame(AVCodecContext *avctx,