c->idct_add= ff_faanidct_add;
c->idct = ff_faanidct;
c->idct_permutation_type= FF_NO_IDCT_PERM;
- }else if(CONFIG_EATGQ_DECODER && avctx->idct_algo==FF_IDCT_EA) {
- c->idct_put= ff_ea_idct_put_c;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
}else{ //accurate/default
c->idct_put = ff_simple_idct_put_8;
c->idct_add = ff_simple_idct_add_8;
#define ff_put_pixels16x16_c ff_put_pixels16x16_8_c
#define ff_avg_pixels16x16_c ff_avg_pixels16x16_8_c
-/* EA functions */
-void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block);
-
/* RV40 functions */
void ff_put_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, int stride);
void ff_avg_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, int stride);
*/
#include "dsputil.h"
+#include "eaidct.h"
#define ASQRT 181 /* (1/sqrt(2))<<8 */
#define A4 669 /* cos(pi/8)*sqrt(2)<<9 */
--- /dev/null
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_EAIDCT_H
+#define AVCODEC_EAIDCT_H
+
+#include <stdint.h>
+#include "dsputil.h"
+
+void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block);
+
+#endif /* AVCODEC_EAIDCT_H */
#include "get_bits.h"
#include "dsputil.h"
#include "aandcttab.h"
+#include "eaidct.h"
#include "mpeg12.h"
#include "mpeg12data.h"
#include "libavutil/imgutils.h"
MadContext *s = avctx->priv_data;
s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_YUV420P;
- 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->scantable, ff_zigzag_direct);
ff_mpeg12_init_vlcs();
return 0;
static inline void idct_put(MadContext *t, DCTELEM *block, int mb_x, int mb_y, int j)
{
if (j < 4) {
- t->dsp.idct_put(
+ ff_ea_idct_put_c(
t->frame.data[0] + (mb_y*16 + ((j&2)<<2))*t->frame.linesize[0] + mb_x*16 + ((j&1)<<3),
t->frame.linesize[0], block);
} else if (!(t->avctx->flags & CODEC_FLAG_GRAY)) {
int index = j - 3;
- t->dsp.idct_put(
+ ff_ea_idct_put_c(
t->frame.data[index] + (mb_y*8)*t->frame.linesize[index] + mb_x*8,
t->frame.linesize[index], block);
}
{
int i;
- if (s->avctx->idct_algo == FF_IDCT_EA) {
- s->quant_matrix[0] = (ff_inv_aanscales[0]*ff_mpeg1_default_intra_matrix[0]) >> 11;
- for (i=1; i<64; i++)
- s->quant_matrix[i] = (ff_inv_aanscales[i]*ff_mpeg1_default_intra_matrix[i]*qscale + 32) >> 10;
- } else {
- s->quant_matrix[0] = ff_mpeg1_default_intra_matrix[0];
- for (i=1; i<64; i++)
- s->quant_matrix[i] = (ff_mpeg1_default_intra_matrix[i]*qscale) << 1;
- }
+ s->quant_matrix[0] = (ff_inv_aanscales[0]*ff_mpeg1_default_intra_matrix[0]) >> 11;
+ for (i=1; i<64; i++)
+ s->quant_matrix[i] = (ff_inv_aanscales[i]*ff_mpeg1_default_intra_matrix[i]*qscale + 32) >> 10;
}
static int decode_frame(AVCodecContext *avctx,
#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;
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;
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]);
}
}
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,
#include "get_bits.h"
#include "dsputil.h"
#include "aandcttab.h"
+#include "eaidct.h"
#include "mpeg12.h"
#include "mpegvideo.h"
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};
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]);
}
}
{
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,