aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/eatgq.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/eatgq.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/eatgq.c')
-rw-r--r--libavcodec/eatgq.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c
index e53b99205b..a55b061a50 100644
--- a/libavcodec/eatgq.c
+++ b/libavcodec/eatgq.c
@@ -34,10 +34,10 @@
#include "bytestream.h"
#include "dsputil.h"
#include "aandcttab.h"
+#include "eaidct.h"
typedef struct TgqContext {
AVCodecContext *avctx;
- DSPContext dsp;
AVFrame frame;
int width,height;
ScanTable scantable;
@@ -48,11 +48,10 @@ typedef struct TgqContext {
static av_cold int tgq_decode_init(AVCodecContext *avctx){
TgqContext *s = avctx->priv_data;
+ uint8_t idct_permutation[64];
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(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
+ ff_init_scantable_permutation(idct_permutation, FF_NO_IDCT_PERM);
+ ff_init_scantable(idct_permutation, &s->scantable, ff_zigzag_direct);
avctx->time_base = (AVRational){1, 15};
avctx->pix_fmt = PIX_FMT_YUV420P;
return 0;
@@ -109,13 +108,13 @@ static void tgq_idct_put_mb(TgqContext *s, DCTELEM (*block)[64], int mb_x, int m
uint8_t *dest_cb = s->frame.data[1] + (mb_y * 8 * s->frame.linesize[1]) + mb_x * 8;
uint8_t *dest_cr = s->frame.data[2] + (mb_y * 8 * s->frame.linesize[2]) + 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, s->frame.linesize[1], block[4]);
- s->dsp.idct_put(dest_cr, s->frame.linesize[2], block[5]);
+ ff_ea_idct_put_c(dest_cb, s->frame.linesize[1], block[4]);
+ ff_ea_idct_put_c(dest_cr, s->frame.linesize[2], block[5]);
}
}
@@ -180,10 +179,7 @@ static void tgq_calculate_qtable(TgqContext *s, int quant){
const int b = (11*(100-quant))/100 + 4;
for(j=0;j<8;j++)
for(i=0;i<8;i++)
- if (s->avctx->idct_algo==FF_IDCT_EA)
- s->qtable[j*8+i] = ((a*(j+i)/(7+7) + b)*ff_inv_aanscales[j*8+i])>>(14-4);
- else
- s->qtable[j*8+i] = (a*(j+i)/(7+7) + b)<<3;
+ s->qtable[j*8+i] = ((a*(j+i)/(7+7) + b)*ff_inv_aanscales[j*8+i])>>(14-4);
}
static int tgq_decode_frame(AVCodecContext *avctx,