OSDN Git Service

Do not initialize ff_cos_* tables again in rdft_init, they are already
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Thu, 15 Oct 2009 11:50:32 +0000 (11:50 +0000)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Thu, 15 Oct 2009 11:50:32 +0000 (11:50 +0000)
initialized by ff_fft_init and using different code can result in slightly
different values, in addition it crashes when the tables are hardcoded.
On amd64 this slightly changes qdm2 output.

Originally committed as revision 20237 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/dsputil.h
libavcodec/rdft.c

index 3656d1c..50889bb 100644 (file)
@@ -840,7 +840,7 @@ typedef struct {
     int sign_convention;
 
     /* pre/post rotation tables */
-    FFTSample *tcos;
+    const FFTSample *tcos;
     FFTSample *tsin;
     FFTContext fft;
 } RDFTContext;
index 0fe26ab..ed4e39a 100644 (file)
@@ -64,7 +64,6 @@ av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans)
     s->tcos = ff_cos_tabs[nbits-4];
     s->tsin = ff_sin_tabs[nbits-4]+(trans == RDFT || trans == IRIDFT)*(n>>2);
     for (i = 0; i < (n>>2); i++) {
-        s->tcos[i] = cos(i*theta);
         s->tsin[i] = sin(i*theta);
     }
     return 0;