Commit 856c8e0a authored by Diego Biurrun's avatar Diego Biurrun

faandct: Remove FAAN_POSTSCALE define and related code.

It is not a user-accessible option and unlikely to ever be changed.
parent a839dbb9
...@@ -74,17 +74,11 @@ struct algo { ...@@ -74,17 +74,11 @@ struct algo {
int nonspec; int nonspec;
}; };
#ifndef FAAN_POSTSCALE
#define FAAN_SCALE SCALE_PERM
#else
#define FAAN_SCALE NO_PERM
#endif
static int cpu_flags; static int cpu_flags;
static const struct algo fdct_tab[] = { static const struct algo fdct_tab[] = {
{ "REF-DBL", ff_ref_fdct, NO_PERM }, { "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-AAN-INT", ff_fdct_ifast, SCALE_PERM },
{ "IJG-LLM-INT", ff_jpeg_fdct_islow_8, NO_PERM }, { "IJG-LLM-INT", ff_jpeg_fdct_islow_8, NO_PERM },
......
...@@ -29,11 +29,6 @@ ...@@ -29,11 +29,6 @@
#include "faandct.h" #include "faandct.h"
#define FLOAT float #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) //numbers generated by simple c code (not as accurate as they could be)
/* /*
...@@ -150,13 +145,13 @@ void ff_faandct(DCTELEM * data) ...@@ -150,13 +145,13 @@ void ff_faandct(DCTELEM * data)
tmp11= tmp1 + tmp2; tmp11= tmp1 + tmp2;
tmp12= tmp1 - tmp2; tmp12= tmp1 - tmp2;
data[8*0 + i]= lrintf(SCALE(8*0 + i) * (tmp10 + tmp11)); data[8*0 + i]= lrintf(postscale[8*0 + i] * (tmp10 + tmp11));
data[8*4 + i]= lrintf(SCALE(8*4 + i) * (tmp10 - tmp11)); data[8*4 + i]= lrintf(postscale[8*4 + i] * (tmp10 - tmp11));
tmp12 += tmp13; tmp12 += tmp13;
tmp12 *= A1; tmp12 *= A1;
data[8*2 + i]= lrintf(SCALE(8*2 + i) * (tmp13 + tmp12)); data[8*2 + i]= lrintf(postscale[8*2 + i] * (tmp13 + tmp12));
data[8*6 + i]= lrintf(SCALE(8*6 + i) * (tmp13 - tmp12)); data[8*6 + i]= lrintf(postscale[8*6 + i] * (tmp13 - tmp12));
tmp4 += tmp5; tmp4 += tmp5;
tmp5 += tmp6; tmp5 += tmp6;
...@@ -175,10 +170,10 @@ void ff_faandct(DCTELEM * data) ...@@ -175,10 +170,10 @@ void ff_faandct(DCTELEM * data)
z11= tmp7 + tmp5; z11= tmp7 + tmp5;
z13= tmp7 - tmp5; z13= tmp7 - tmp5;
data[8*5 + i]= lrintf(SCALE(8*5 + i) * (z13 + z2)); data[8*5 + i]= lrintf(postscale[8*5 + i] * (z13 + z2));
data[8*3 + i]= lrintf(SCALE(8*3 + i) * (z13 - z2)); data[8*3 + i]= lrintf(postscale[8*3 + i] * (z13 - z2));
data[8*1 + i]= lrintf(SCALE(8*1 + i) * (z11 + z4)); data[8*1 + i]= lrintf(postscale[8*1 + i] * (z11 + z4));
data[8*7 + i]= lrintf(SCALE(8*7 + i) * (z11 - z4)); data[8*7 + i]= lrintf(postscale[8*7 + i] * (z11 - z4));
} }
} }
...@@ -208,25 +203,25 @@ void ff_faandct248(DCTELEM * data) ...@@ -208,25 +203,25 @@ void ff_faandct248(DCTELEM * data)
tmp12 = tmp1 - tmp2; tmp12 = tmp1 - tmp2;
tmp13 = tmp0 - tmp3; tmp13 = tmp0 - tmp3;
data[8*0 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11)); data[8*0 + i] = lrintf(postscale[8*0 + i] * (tmp10 + tmp11));
data[8*4 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11)); data[8*4 + i] = lrintf(postscale[8*4 + i] * (tmp10 - tmp11));
tmp12 += tmp13; tmp12 += tmp13;
tmp12 *= A1; tmp12 *= A1;
data[8*2 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + tmp12)); data[8*2 + i] = lrintf(postscale[8*2 + i] * (tmp13 + tmp12));
data[8*6 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - tmp12)); data[8*6 + i] = lrintf(postscale[8*6 + i] * (tmp13 - tmp12));
tmp10 = tmp4 + tmp7; tmp10 = tmp4 + tmp7;
tmp11 = tmp5 + tmp6; tmp11 = tmp5 + tmp6;
tmp12 = tmp5 - tmp6; tmp12 = tmp5 - tmp6;
tmp13 = tmp4 - tmp7; tmp13 = tmp4 - tmp7;
data[8*1 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11)); data[8*1 + i] = lrintf(postscale[8*0 + i] * (tmp10 + tmp11));
data[8*5 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11)); data[8*5 + i] = lrintf(postscale[8*4 + i] * (tmp10 - tmp11));
tmp12 += tmp13; tmp12 += tmp13;
tmp12 *= A1; tmp12 *= A1;
data[8*3 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + tmp12)); data[8*3 + i] = lrintf(postscale[8*2 + i] * (tmp13 + tmp12));
data[8*7 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - tmp12)); data[8*7 + i] = lrintf(postscale[8*6 + i] * (tmp13 - tmp12));
} }
} }
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
#include "dsputil.h" #include "dsputil.h"
#define FAAN_POSTSCALE
void ff_faandct(DCTELEM * data); void ff_faandct(DCTELEM * data);
void ff_faandct248(DCTELEM * data); void ff_faandct248(DCTELEM * data);
......
...@@ -79,11 +79,8 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], ...@@ -79,11 +79,8 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
for (qscale = qmin; qscale <= qmax; qscale++) { for (qscale = qmin; qscale <= qmax; qscale++) {
int i; int i;
if (dsp->fdct == ff_jpeg_fdct_islow_8 || if (dsp->fdct == ff_jpeg_fdct_islow_8 ||
dsp->fdct == ff_jpeg_fdct_islow_10 dsp->fdct == ff_jpeg_fdct_islow_10 ||
#ifdef FAAN_POSTSCALE dsp->fdct == ff_faandct) {
|| dsp->fdct == ff_faandct
#endif
) {
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++) {
const int j = dsp->idct_permutation[i]; const int j = dsp->idct_permutation[i];
/* 16 <= qscale * quant_matrix[i] <= 7905 /* 16 <= qscale * quant_matrix[i] <= 7905
...@@ -95,11 +92,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], ...@@ -95,11 +92,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) / qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) /
(qscale * quant_matrix[j])); (qscale * quant_matrix[j]));
} }
} else if (dsp->fdct == ff_fdct_ifast } else if (dsp->fdct == ff_fdct_ifast) {
#ifndef FAAN_POSTSCALE
|| dsp->fdct == ff_faandct
#endif
) {
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++) {
const int j = dsp->idct_permutation[i]; const int j = dsp->idct_permutation[i];
/* 16 <= qscale * quant_matrix[i] <= 7905 /* 16 <= qscale * quant_matrix[i] <= 7905
...@@ -138,11 +131,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], ...@@ -138,11 +131,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
for (i = intra; i < 64; i++) { for (i = intra; i < 64; i++) {
int64_t max = 8191; int64_t max = 8191;
if (dsp->fdct == ff_fdct_ifast if (dsp->fdct == ff_fdct_ifast) {
#ifndef FAAN_POSTSCALE
|| dsp->fdct == ff_faandct
#endif
) {
max = (8191LL * ff_aanscales[i]) >> 14; max = (8191LL * ff_aanscales[i]) >> 14;
} }
while (((max * qmat[qscale][i]) >> shift) > INT_MAX) { while (((max * qmat[qscale][i]) >> shift) > INT_MAX) {
...@@ -3474,11 +3463,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s, ...@@ -3474,11 +3463,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s,
int dct_coeff= FFABS(block[ scantable[i] ]); int dct_coeff= FFABS(block[ scantable[i] ]);
int best_score=256*256*256*120; int best_score=256*256*256*120;
if ( s->dsp.fdct == ff_fdct_ifast if (s->dsp.fdct == ff_fdct_ifast)
#ifndef FAAN_POSTSCALE
|| s->dsp.fdct == ff_faandct
#endif
)
dct_coeff= (dct_coeff*ff_inv_aanscales[ scantable[i] ]) >> 12; dct_coeff= (dct_coeff*ff_inv_aanscales[ scantable[i] ]) >> 12;
zero_distortion= dct_coeff*dct_coeff; zero_distortion= dct_coeff*dct_coeff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment