summaryrefslogtreecommitdiffstats
path: root/libavcodec/eatgq.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-30 23:04:28 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-30 23:28:31 +0200
commitb5da7d4c1a7f08f89aece651a8f0f8c4963e5ad9 (patch)
treec5ade4afd26c2cbd5fd7d5442e044e688724269a /libavcodec/eatgq.c
parenta85b4a5696787e36df8d7c805de8f86ea6365acb (diff)
parent6774247a9d7d15033c2b80118c03cb0cb10027df (diff)
downloadffmpeg-streaming-b5da7d4c1a7f08f89aece651a8f0f8c4963e5ad9.zip
ffmpeg-streaming-b5da7d4c1a7f08f89aece651a8f0f8c4963e5ad9.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: avformat: Drop pointless "format" from container long names swscale: bury one more piece of inline asm under HAVE_INLINE_ASM. wv: K&R formatting cosmetics configure: Add missing descriptions to help output h264_ps: declare array of colorspace strings on its own line. fate: amix: specify f32 sample format for comparison tiny_psnr: support 32-bit float samples eamad/eatgq/eatqi: call special EA IDCT directly eamad: remove use of MpegEncContext mpegvideo: remove unnecessary inclusions of faandct.h af_asyncts: avoid overflow in out_size with large delta values af_asyncts: add first_pts option Conflicts: configure libavcodec/eamad.c libavcodec/h264_ps.c libavformat/crcenc.c libavformat/ffmdec.c libavformat/ffmenc.c libavformat/framecrcenc.c libavformat/md5enc.c libavformat/nutdec.c libavformat/rawenc.c libavformat/yuv4mpeg.c tests/tiny_psnr.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 69bed3d..7326af3 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,
OpenPOWER on IntegriCloud