aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rdft.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-11-04 17:30:23 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-11-04 17:30:23 +0000
commit223217746c5beaa6110ce9ade2a582fc10d3d630 (patch)
treeefe7304981746185c85f16c977cca8691f381e74 /libavcodec/rdft.c
parent981b8fd777f8ea273c53a055cbbb45ad9fe872aa (diff)
downloadffmpeg-223217746c5beaa6110ce9ade2a582fc10d3d630.tar.gz
Pad ff_cos_tabs and ff_sin_tabs so that index n points to the table for n bits.
While this "wastes" up to 2x32 bytes it makes the code slightly simpler and less confusing. Originally committed as revision 20449 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/rdft.c')
-rw-r--r--libavcodec/rdft.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/rdft.c b/libavcodec/rdft.c
index 01aef872c2..46dd6dac3a 100644
--- a/libavcodec/rdft.c
+++ b/libavcodec/rdft.c
@@ -43,6 +43,7 @@ SINTABLE(32768);
SINTABLE(65536);
#endif
SINTABLE_CONST FFTSample * const ff_sin_tabs[] = {
+ NULL, NULL, NULL, NULL,
ff_sin_16, ff_sin_32, ff_sin_64, ff_sin_128, ff_sin_256, ff_sin_512, ff_sin_1024,
ff_sin_2048, ff_sin_4096, ff_sin_8192, ff_sin_16384, ff_sin_32768, ff_sin_65536,
};
@@ -63,8 +64,8 @@ av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans)
if (ff_fft_init(&s->fft, nbits-1, trans == IRDFT || trans == RIDFT) < 0)
return -1;
- s->tcos = ff_cos_tabs[nbits-4];
- s->tsin = ff_sin_tabs[nbits-4]+(trans == RDFT || trans == IRIDFT)*(n>>2);
+ s->tcos = ff_cos_tabs[nbits];
+ s->tsin = ff_sin_tabs[nbits]+(trans == RDFT || trans == IRIDFT)*(n>>2);
#if !CONFIG_HARDCODED_TABLES
for (i = 0; i < (n>>2); i++) {
s->tsin[i] = sin(i*theta);