faandct: Remove FAAN_POSTSCALE define and related code.

It is not a user-accessible option and unlikely to ever be changed.
pull/4/head
Diego Biurrun 13 years ago
parent a839dbb94e
commit 856c8e0a04
  1. 8
      libavcodec/dct-test.c
  2. 37
      libavcodec/faandct.c
  3. 2
      libavcodec/faandct.h
  4. 25
      libavcodec/mpegvideo_enc.c

@ -74,17 +74,11 @@ struct algo {
int nonspec;
};
#ifndef FAAN_POSTSCALE
#define FAAN_SCALE SCALE_PERM
#else
#define FAAN_SCALE NO_PERM
#endif
static int cpu_flags;
static const struct algo fdct_tab[] = {
{ "REF-DBL", ff_ref_fdct, NO_PERM },
{ "FAAN", ff_faandct, FAAN_SCALE },
{ "FAAN", ff_faandct, NO_PERM },
{ "IJG-AAN-INT", ff_fdct_ifast, SCALE_PERM },
{ "IJG-LLM-INT", ff_jpeg_fdct_islow_8, NO_PERM },

@ -29,11 +29,6 @@
#include "faandct.h"
#define FLOAT float
#ifdef FAAN_POSTSCALE
# define SCALE(x) postscale[x]
#else
# define SCALE(x) 1
#endif
//numbers generated by simple c code (not as accurate as they could be)
/*
@ -150,13 +145,13 @@ void ff_faandct(DCTELEM * data)
tmp11= tmp1 + tmp2;
tmp12= tmp1 - tmp2;
data[8*0 + i]= lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
data[8*4 + i]= lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
data[8*0 + i]= lrintf(postscale[8*0 + i] * (tmp10 + tmp11));
data[8*4 + i]= lrintf(postscale[8*4 + i] * (tmp10 - tmp11));
tmp12 += tmp13;
tmp12 *= A1;
data[8*2 + i]= lrintf(SCALE(8*2 + i) * (tmp13 + tmp12));
data[8*6 + i]= lrintf(SCALE(8*6 + i) * (tmp13 - tmp12));
data[8*2 + i]= lrintf(postscale[8*2 + i] * (tmp13 + tmp12));
data[8*6 + i]= lrintf(postscale[8*6 + i] * (tmp13 - tmp12));
tmp4 += tmp5;
tmp5 += tmp6;
@ -175,10 +170,10 @@ void ff_faandct(DCTELEM * data)
z11= tmp7 + tmp5;
z13= tmp7 - tmp5;
data[8*5 + i]= lrintf(SCALE(8*5 + i) * (z13 + z2));
data[8*3 + i]= lrintf(SCALE(8*3 + i) * (z13 - z2));
data[8*1 + i]= lrintf(SCALE(8*1 + i) * (z11 + z4));
data[8*7 + i]= lrintf(SCALE(8*7 + i) * (z11 - z4));
data[8*5 + i]= lrintf(postscale[8*5 + i] * (z13 + z2));
data[8*3 + i]= lrintf(postscale[8*3 + i] * (z13 - z2));
data[8*1 + i]= lrintf(postscale[8*1 + i] * (z11 + z4));
data[8*7 + i]= lrintf(postscale[8*7 + i] * (z11 - z4));
}
}
@ -208,25 +203,25 @@ void ff_faandct248(DCTELEM * data)
tmp12 = tmp1 - tmp2;
tmp13 = tmp0 - tmp3;
data[8*0 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
data[8*4 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
data[8*0 + i] = lrintf(postscale[8*0 + i] * (tmp10 + tmp11));
data[8*4 + i] = lrintf(postscale[8*4 + i] * (tmp10 - tmp11));
tmp12 += tmp13;
tmp12 *= A1;
data[8*2 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + tmp12));
data[8*6 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - tmp12));
data[8*2 + i] = lrintf(postscale[8*2 + i] * (tmp13 + tmp12));
data[8*6 + i] = lrintf(postscale[8*6 + i] * (tmp13 - tmp12));
tmp10 = tmp4 + tmp7;
tmp11 = tmp5 + tmp6;
tmp12 = tmp5 - tmp6;
tmp13 = tmp4 - tmp7;
data[8*1 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
data[8*5 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
data[8*1 + i] = lrintf(postscale[8*0 + i] * (tmp10 + tmp11));
data[8*5 + i] = lrintf(postscale[8*4 + i] * (tmp10 - tmp11));
tmp12 += tmp13;
tmp12 *= A1;
data[8*3 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + tmp12));
data[8*7 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - tmp12));
data[8*3 + i] = lrintf(postscale[8*2 + i] * (tmp13 + tmp12));
data[8*7 + i] = lrintf(postscale[8*6 + i] * (tmp13 - tmp12));
}
}

@ -31,8 +31,6 @@
#include "dsputil.h"
#define FAAN_POSTSCALE
void ff_faandct(DCTELEM * data);
void ff_faandct248(DCTELEM * data);

@ -79,11 +79,8 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
for (qscale = qmin; qscale <= qmax; qscale++) {
int i;
if (dsp->fdct == ff_jpeg_fdct_islow_8 ||
dsp->fdct == ff_jpeg_fdct_islow_10
#ifdef FAAN_POSTSCALE
|| dsp->fdct == ff_faandct
#endif
) {
dsp->fdct == ff_jpeg_fdct_islow_10 ||
dsp->fdct == ff_faandct) {
for (i = 0; i < 64; i++) {
const int j = dsp->idct_permutation[i];
/* 16 <= qscale * quant_matrix[i] <= 7905
@ -95,11 +92,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) /
(qscale * quant_matrix[j]));
}
} else if (dsp->fdct == ff_fdct_ifast
#ifndef FAAN_POSTSCALE
|| dsp->fdct == ff_faandct
#endif
) {
} else if (dsp->fdct == ff_fdct_ifast) {
for (i = 0; i < 64; i++) {
const int j = dsp->idct_permutation[i];
/* 16 <= qscale * quant_matrix[i] <= 7905
@ -138,11 +131,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
for (i = intra; i < 64; i++) {
int64_t max = 8191;
if (dsp->fdct == ff_fdct_ifast
#ifndef FAAN_POSTSCALE
|| dsp->fdct == ff_faandct
#endif
) {
if (dsp->fdct == ff_fdct_ifast) {
max = (8191LL * ff_aanscales[i]) >> 14;
}
while (((max * qmat[qscale][i]) >> shift) > INT_MAX) {
@ -3474,11 +3463,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s,
int dct_coeff= FFABS(block[ scantable[i] ]);
int best_score=256*256*256*120;
if ( s->dsp.fdct == ff_fdct_ifast
#ifndef FAAN_POSTSCALE
|| s->dsp.fdct == ff_faandct
#endif
)
if (s->dsp.fdct == ff_fdct_ifast)
dct_coeff= (dct_coeff*ff_inv_aanscales[ scantable[i] ]) >> 12;
zero_distortion= dct_coeff*dct_coeff;

Loading…
Cancel
Save