Skip to content

Commit

Permalink
VIDEO: Changed several places that use PI to use M_PI instead
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Mar 19, 2011
1 parent 0eb2c47 commit 19d3972
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions video/codecs/qdm2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ float *ff_cos_tabs[] = {

void initCosineTables(int index) {
int m = 1 << index;
double freq = 2 * PI / m;
double freq = 2 * M_PI / m;
float *tab = ff_cos_tabs[index];

for (int i = 0; i <= m / 4; i++)
Expand Down Expand Up @@ -776,7 +776,7 @@ int fftInit(FFTContext *s, int nbits, int inverse) {
s->tmpBuf = (FFTComplex *)malloc(n * sizeof(FFTComplex));
} else {
for (i = 0; i < n / 2; i++) {
alpha = 2 * PI * (float)i / (float)n;
alpha = 2 * M_PI * (float)i / (float)n;
c1 = cos(alpha);
s1 = sin(alpha) * s2;
s->exptab[i].re = c1;
Expand Down Expand Up @@ -814,7 +814,7 @@ int fftInit(FFTContext *s, int nbits, int inverse) {
*/
int rdftInit(RDFTContext *s, int nbits, RDFTransformType trans) {
int n = 1 << nbits;
const double theta = (trans == RDFT || trans == IRIDFT ? -1 : 1) * 2 * PI / n;
const double theta = (trans == RDFT || trans == IRIDFT ? -1 : 1) * 2 * M_PI / n;

s->nbits = nbits;
s->inverse = trans == IRDFT || trans == IRIDFT;
Expand Down Expand Up @@ -3009,7 +3009,7 @@ void QDM2Stream::qdm2_fft_generate_tone(FFTTone *tone)
float level, f[6];
int i;
QDM2Complex c;
const double iscale = 2.0 * PI / 512.0;
const double iscale = 2.0 * M_PI / 512.0;

tone->phase += tone->phase_shift;

Expand Down Expand Up @@ -3050,7 +3050,7 @@ void QDM2Stream::qdm2_fft_generate_tone(FFTTone *tone)

void QDM2Stream::qdm2_fft_tone_synthesizer(uint8 sub_packet) {
int i, j, ch;
const double iscale = 0.25 * PI;
const double iscale = 0.25 * M_PI;

for (ch = 0; ch < _channels; ch++) {
memset(_fft.complex[ch], 0, _frameSize * sizeof(QDM2Complex));
Expand Down

0 comments on commit 19d3972

Please sign in to comment.