History

Give RDFT types more meaningful names

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

Måns Rullgård committed 16 years ago

Commit 41ea18f1 parent 3bd8a2e6 files · +15 −15Browse files

Unified · Split

6 files
  1. ffplay.c +1 −1
  2. libavcodec/binkaudio.c +1 −1
  3. libavcodec/fft-test.c +3 −3
  4. libavcodec/fft.h +4 −4
  5. libavcodec/qdm2.c +1 −1
  6. libavcodec/rdft.c +5 −5
ffplay.c+1−1
@@ -906,7 +906,7 @@ static void video_audio_display(VideoState *s) · 905 unmodified lines
906 nb_display_channels= FFMIN(nb_display_channels, 2);906 nb_display_channels= FFMIN(nb_display_channels, 2);
907 if(rdft_bits != s->rdft_bits){907 if(rdft_bits != s->rdft_bits){
908 ff_rdft_end(&s->rdft);908 ff_rdft_end(&s->rdft);
909 ff_rdft_init(&s->rdft, rdft_bits, RDFT);909 ff_rdft_init(&s->rdft, rdft_bits, DFT_R2C);
910 s->rdft_bits= rdft_bits;910 s->rdft_bits= rdft_bits;
911 }911 }
912 {912 {
libavcodec/binkaudio.c+1−1
@@ -125,7 +125,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 124 unmodified lines
125 s->coeffs_ptr[i] = s->coeffs + i * s->frame_len;125 s->coeffs_ptr[i] = s->coeffs + i * s->frame_len;
126 126
127 if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT)127 if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT)
128 ff_rdft_init(&s->trans.rdft, frame_len_bits, IRIDFT);128 ff_rdft_init(&s->trans.rdft, frame_len_bits, DFT_C2R);
129 else if (CONFIG_BINKAUDIO_DCT_DECODER)129 else if (CONFIG_BINKAUDIO_DCT_DECODER)
130 ff_dct_init(&s->trans.dct, frame_len_bits, 1);130 ff_dct_init(&s->trans.dct, frame_len_bits, 1);
131 else131 else
libavcodec/fft-test.c+3−3
@@ -292,10 +292,10 @@ int main(int argc, char **argv) · 291 unmodified lines
292 break;292 break;
293 case TRANSFORM_RDFT:293 case TRANSFORM_RDFT:
294 if (do_inverse)294 if (do_inverse)
295 av_log(NULL, AV_LOG_INFO,"IRDFT");295 av_log(NULL, AV_LOG_INFO,"IDFT_C2R");
296 else296 else
297 av_log(NULL, AV_LOG_INFO,"RDFT");297 av_log(NULL, AV_LOG_INFO,"DFT_R2C");
298 ff_rdft_init(r, fft_nbits, do_inverse ? IRDFT : RDFT);298 ff_rdft_init(r, fft_nbits, do_inverse ? IDFT_C2R : DFT_R2C);
299 fft_ref_init(fft_nbits, do_inverse);299 fft_ref_init(fft_nbits, do_inverse);
300 break;300 break;
301 case TRANSFORM_DCT:301 case TRANSFORM_DCT:
libavcodec/fft.h+4−4
@@ -195,10 +195,10 @@ void ff_mdct_end(FFTContext *s); · 194 unmodified lines
195/* Real Discrete Fourier Transform */195/* Real Discrete Fourier Transform */
196 196
197enum RDFTransformType {197enum RDFTransformType {
198 RDFT,198 DFT_R2C,
199 IRDFT,199 IDFT_C2R,
200 RIDFT,200 IDFT_R2C,
201 IRIDFT,201 DFT_C2R,
202};202};
203 203
204typedef struct {204typedef struct {
libavcodec/qdm2.c+1−1
@@ -1928,7 +1928,7 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx) · 1927 unmodified lines
1928 return -1;1928 return -1;
1929 }1929 }
1930 1930
1931 ff_rdft_init(&s->rdft_ctx, s->fft_order, IRDFT);1931 ff_rdft_init(&s->rdft_ctx, s->fft_order, IDFT_C2R);
1932 1932
1933 qdm2_init(s);1933 qdm2_init(s);
1934 1934
libavcodec/rdft.c+5−5
@@ -53,21 +53,21 @@ av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans) · 52 unmodified lines
53{53{
54 int n = 1 << nbits;54 int n = 1 << nbits;
55 int i;55 int i;
56 const double theta = (trans == RDFT || trans == IRIDFT ? -1 : 1)*2*M_PI/n;56 const double theta = (trans == DFT_R2C || trans == DFT_C2R ? -1 : 1)*2*M_PI/n;
57 57
58 s->nbits = nbits;58 s->nbits = nbits;
59 s->inverse = trans == IRDFT || trans == IRIDFT;59 s->inverse = trans == IDFT_C2R || trans == DFT_C2R;
60 s->sign_convention = trans == RIDFT || trans == IRIDFT ? 1 : -1;60 s->sign_convention = trans == IDFT_R2C || trans == DFT_C2R ? 1 : -1;
61 61
62 if (nbits < 4 || nbits > 16)62 if (nbits < 4 || nbits > 16)
63 return -1;63 return -1;
64 64
65 if (ff_fft_init(&s->fft, nbits-1, trans == IRDFT || trans == RIDFT) < 0)65 if (ff_fft_init(&s->fft, nbits-1, trans == IDFT_C2R || trans == IDFT_R2C) < 0)
66 return -1;66 return -1;
67 67
68 ff_init_ff_cos_tabs(nbits);68 ff_init_ff_cos_tabs(nbits);
69 s->tcos = ff_cos_tabs[nbits];69 s->tcos = ff_cos_tabs[nbits];
70 s->tsin = ff_sin_tabs[nbits]+(trans == RDFT || trans == IRIDFT)*(n>>2);70 s->tsin = ff_sin_tabs[nbits]+(trans == DFT_R2C || trans == DFT_C2R)*(n>>2);
71#if !CONFIG_HARDCODED_TABLES71#if !CONFIG_HARDCODED_TABLES
72 for (i = 0; i < (n>>2); i++) {72 for (i = 0; i < (n>>2); i++) {
73 s->tsin[i] = sin(i*theta);73 s->tsin[i] = sin(i*theta);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t