[FFmpeg-cvslog] faandct: Remove FAAN_POSTSCALE define and related code.

Diego Biurrun git at videolan.org
Thu Mar 29 04:32:33 CEST 2012


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Tue Mar 27 16:42:23 2012 +0200| [856c8e0a049dc7069b7504d3aaa48549c75852de] | committer: Diego Biurrun

faandct: Remove FAAN_POSTSCALE define and related code.

It is not a user-accessible option and unlikely to ever be changed.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=856c8e0a049dc7069b7504d3aaa48549c75852de
---

 libavcodec/dct-test.c      |    8 +-------
 libavcodec/faandct.c       |   37 ++++++++++++++++---------------------
 libavcodec/faandct.h       |    2 --
 libavcodec/mpegvideo_enc.c |   25 +++++--------------------
 4 files changed, 22 insertions(+), 50 deletions(-)

diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index 1787ef6..bc5f2c5 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.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    },
 
diff --git a/libavcodec/faandct.c b/libavcodec/faandct.c
index a986f65..eaf4b65 100644
--- a/libavcodec/faandct.c
+++ b/libavcodec/faandct.c
@@ -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));
     }
 }
diff --git a/libavcodec/faandct.h b/libavcodec/faandct.h
index da8c0e4..cd98236 100644
--- a/libavcodec/faandct.h
+++ b/libavcodec/faandct.h
@@ -31,8 +31,6 @@
 
 #include "dsputil.h"
 
-#define FAAN_POSTSCALE
-
 void ff_faandct(DCTELEM * data);
 void ff_faandct248(DCTELEM * data);
 
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 7074dda..19aa4b4 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -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;
 



More information about the ffmpeg-cvslog mailing list