cosmetics: Add '0' to float constants ending in '.'.

pull/37/head
Diego Biurrun 12 years ago
parent 6c145ecf78
commit 4a2ef39442
  1. 2
      libavcodec/aac_tablegen.h
  2. 4
      libavcodec/aacdec.c
  3. 2
      libavcodec/aacps_tablegen.h
  4. 4
      libavcodec/acelp_vectors.c
  5. 6
      libavcodec/qcelpdec.c
  6. 6
      libavcodec/ra288.c
  7. 2
      libavcodec/sipr.c
  8. 28
      libavcodec/twinvq.c
  9. 8
      libavcodec/vorbisenc.c
  10. 2
      libavformat/swfenc.c

@ -35,7 +35,7 @@ void ff_aac_tableinit(void)
{ {
int i; int i;
for (i = 0; i < 428; i++) for (i = 0; i < 428; i++)
ff_aac_pow2sf_tab[i] = pow(2, (i - POW_SF2_ZERO) / 4.); ff_aac_pow2sf_tab[i] = pow(2, (i - POW_SF2_ZERO) / 4.0);
} }
#endif /* CONFIG_HARDCODED_TABLES */ #endif /* CONFIG_HARDCODED_TABLES */

@ -1172,7 +1172,7 @@ static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb,
int run_end = band_type_run_end[idx]; int run_end = band_type_run_end[idx];
if (band_type[idx] == ZERO_BT) { if (band_type[idx] == ZERO_BT) {
for (; i < run_end; i++, idx++) for (; i < run_end; i++, idx++)
sf[idx] = 0.; sf[idx] = 0.0;
} else if ((band_type[idx] == INTENSITY_BT) || } else if ((band_type[idx] == INTENSITY_BT) ||
(band_type[idx] == INTENSITY_BT2)) { (band_type[idx] == INTENSITY_BT2)) {
for (; i < run_end; i++, idx++) { for (; i < run_end; i++, idx++) {
@ -1916,7 +1916,7 @@ static int decode_cce(AACContext *ac, GetBitContext *gb, ChannelElement *che)
int idx = 0; int idx = 0;
int cge = 1; int cge = 1;
int gain = 0; int gain = 0;
float gain_cache = 1.; float gain_cache = 1.0;
if (c) { if (c) {
cge = coup->coupling_point == AFTER_IMDCT ? 1 : get_bits1(gb); cge = coup->coupling_point == AFTER_IMDCT ? 1 : get_bits1(gb);
gain = cge ? get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60: 0; gain = cge ? get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60: 0;

@ -192,7 +192,7 @@ static void ps_tableinit(void)
for (k = 0; k < NR_ALLPASS_BANDS34; k++) { for (k = 0; k < NR_ALLPASS_BANDS34; k++) {
double f_center, theta; double f_center, theta;
if (k < FF_ARRAY_ELEMS(f_center_34)) if (k < FF_ARRAY_ELEMS(f_center_34))
f_center = f_center_34[k] / 24.; f_center = f_center_34[k] / 24.0;
else else
f_center = k - 26.5f; f_center = k - 26.5f;
for (m = 0; m < PS_AP_LINKS; m++) { for (m = 0; m < PS_AP_LINKS; m++) {

@ -94,10 +94,10 @@ const float ff_b60_sinc[61] = {
0.898529 , 0.865051 , 0.769257 , 0.624054 , 0.448639 , 0.265289 , 0.898529 , 0.865051 , 0.769257 , 0.624054 , 0.448639 , 0.265289 ,
0.0959167 , -0.0412598 , -0.134338 , -0.178986 , -0.178528 , -0.142609 , 0.0959167 , -0.0412598 , -0.134338 , -0.178986 , -0.178528 , -0.142609 ,
-0.0849304 , -0.0205078 , 0.0369568 , 0.0773926 , 0.0955200 , 0.0912781 , -0.0849304 , -0.0205078 , 0.0369568 , 0.0773926 , 0.0955200 , 0.0912781 ,
0.0689392 , 0.0357056 , 0. , -0.0305481 , -0.0504150 , -0.0570068 , 0.0689392 , 0.0357056 , 0.0 , -0.0305481 , -0.0504150 , -0.0570068 ,
-0.0508423 , -0.0350037 , -0.0141602 , 0.00665283, 0.0230713 , 0.0323486 , -0.0508423 , -0.0350037 , -0.0141602 , 0.00665283, 0.0230713 , 0.0323486 ,
0.0335388 , 0.0275879 , 0.0167847 , 0.00411987, -0.00747681, -0.0156860 , 0.0335388 , 0.0275879 , 0.0167847 , 0.00411987, -0.00747681, -0.0156860 ,
-0.0193481 , -0.0183716 , -0.0137634 , -0.00704956, 0. , 0.00582886 , -0.0193481 , -0.0183716 , -0.0137634 , -0.00704956, 0.0 , 0.00582886 ,
0.00939941, 0.0103760 , 0.00903320, 0.00604248, 0.00238037, -0.00109863 , 0.00939941, 0.0103760 , 0.00903320, 0.00604248, 0.00238037, -0.00109863 ,
-0.00366211, -0.00497437, -0.00503540, -0.00402832, -0.00241089, -0.000579834, -0.00366211, -0.00497437, -0.00503540, -0.00402832, -0.00241089, -0.000579834,
0.00103760, 0.00222778, 0.00277710, 0.00271606, 0.00213623, 0.00115967 , 0.00103760, 0.00222778, 0.00277710, 0.00271606, 0.00213623, 0.00115967 ,

@ -94,7 +94,7 @@ static av_cold int qcelp_decode_init(AVCodecContext *avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_FLT; avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
q->prev_lspf[i] = (i + 1) / 11.; q->prev_lspf[i] = (i + 1) / 11.0;
return 0; return 0;
} }
@ -162,7 +162,7 @@ static int decode_lspf(QCELPContext *q, float *lspf)
} else { } else {
q->octave_count = 0; q->octave_count = 0;
tmp_lspf = 0.; tmp_lspf = 0.0;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
lspf[2 * i + 0] = tmp_lspf += qcelp_lspvq[i][q->frame.lspv[i]][0] * 0.0001; lspf[2 * i + 0] = tmp_lspf += qcelp_lspvq[i][q->frame.lspv[i]][0] * 0.0001;
lspf[2 * i + 1] = tmp_lspf += qcelp_lspvq[i][q->frame.lspv[i]][1] * 0.0001; lspf[2 * i + 1] = tmp_lspf += qcelp_lspvq[i][q->frame.lspv[i]][1] * 0.0001;
@ -434,7 +434,7 @@ static const float *do_pitchfilter(float memory[303], const float v_in[160],
v_lag = memory + 143 + 40 * i - lag[i]; v_lag = memory + 143 + 40 * i - lag[i];
for (v_len = v_in + 40; v_in < v_len; v_in++) { for (v_len = v_in + 40; v_in < v_len; v_in++) {
if (pfrac[i]) { // If it is a fractional lag... if (pfrac[i]) { // If it is a fractional lag...
for (j = 0, *v_out = 0.; j < 4; j++) for (j = 0, *v_out = 0.0; j < 4; j++)
*v_out += qcelp_hammsinc_table[j] * (v_lag[j - 4] + v_lag[3 - j]); *v_out += qcelp_hammsinc_table[j] * (v_lag[j - 4] + v_lag[3 - j]);
} else } else
*v_out = *v_lag; *v_out = *v_lag;

@ -90,7 +90,7 @@ static void decode(RA288Context *ractx, float gain, int cb_coef)
memmove(ractx->sp_hist + 70, ractx->sp_hist + 75, 36*sizeof(*block)); memmove(ractx->sp_hist + 70, ractx->sp_hist + 75, 36*sizeof(*block));
/* block 46 of G.728 spec */ /* block 46 of G.728 spec */
sum = 32.; sum = 32.0;
for (i=0; i < 10; i++) for (i=0; i < 10; i++)
sum -= gain_block[9-i] * ractx->gain_lpc[i]; sum -= gain_block[9-i] * ractx->gain_lpc[i];
@ -104,7 +104,7 @@ static void decode(RA288Context *ractx, float gain, int cb_coef)
for (i=0; i < 5; i++) for (i=0; i < 5; i++)
buffer[i] = codetable[cb_coef][i] * sumsum; buffer[i] = codetable[cb_coef][i] * sumsum;
sum = avpriv_scalarproduct_float_c(buffer, buffer, 5) * ((1 << 24) / 5.); sum = avpriv_scalarproduct_float_c(buffer, buffer, 5) * ((1 << 24) / 5.0);
sum = FFMAX(sum, 1); sum = FFMAX(sum, 1);
@ -150,7 +150,7 @@ static void do_hybrid_window(RA288Context *ractx,
} }
/* Multiply by the white noise correcting factor (WNCF). */ /* Multiply by the white noise correcting factor (WNCF). */
*out *= 257./256.; *out *= 257.0 / 256.0;
} }
/** /**

@ -240,7 +240,7 @@ static void eval_ir(const float *Az, int pitch_lag, float *freq,
float tmp1[SUBFR_SIZE+1], tmp2[LP_FILTER_ORDER+1]; float tmp1[SUBFR_SIZE+1], tmp2[LP_FILTER_ORDER+1];
int i; int i;
tmp1[0] = 1.; tmp1[0] = 1.0;
for (i = 0; i < LP_FILTER_ORDER; i++) { for (i = 0; i < LP_FILTER_ORDER; i++) {
tmp1[i+1] = Az[i] * ff_pow_0_55[i]; tmp1[i+1] = Az[i] * ff_pow_0_55[i];
tmp2[i ] = Az[i] * ff_pow_0_7 [i]; tmp2[i ] = Az[i] * ff_pow_0_7 [i];

@ -423,12 +423,12 @@ static inline float mulawinv(float y, float clip, float mu)
* { * {
* static float test; // Ugh, force gcc to do the division first... * static float test; // Ugh, force gcc to do the division first...
* *
* test = a / 400.; * test = a / 400.0;
* return b * test + 0.5; * return b * test + 0.5;
* } * }
* @endcode * @endcode
* *
* @note if this function is replaced by just ROUNDED_DIV(a * b, 400.), the * @note if this function is replaced by just ROUNDED_DIV(a * b, 400.0), the
* stddev between the original file (before encoding with Yamaha encoder) and * stddev between the original file (before encoding with Yamaha encoder) and
* the decoded output increases, which leads one to believe that the encoder * the decoded output increases, which leads one to believe that the encoder
* expects exactly this broken calculation. * expects exactly this broken calculation.
@ -516,12 +516,12 @@ static void dec_gain(TwinContext *tctx, GetBitContext *gb, enum FrameType ftype,
if (ftype == FT_LONG) { if (ftype == FT_LONG) {
for (i = 0; i < tctx->avctx->channels; i++) for (i = 0; i < tctx->avctx->channels; i++)
out[i] = (1. / (1 << 13)) * out[i] = (1.0 / (1 << 13)) *
mulawinv(step * 0.5 + step * get_bits(gb, GAIN_BITS), mulawinv(step * 0.5 + step * get_bits(gb, GAIN_BITS),
AMP_MAX, MULAW_MU); AMP_MAX, MULAW_MU);
} else { } else {
for (i = 0; i < tctx->avctx->channels; i++) { for (i = 0; i < tctx->avctx->channels; i++) {
float val = (1. / (1 << 23)) * float val = (1.0 / (1 << 23)) *
mulawinv(step * 0.5 + step * get_bits(gb, GAIN_BITS), mulawinv(step * 0.5 + step * get_bits(gb, GAIN_BITS),
AMP_MAX, MULAW_MU); AMP_MAX, MULAW_MU);
@ -582,7 +582,7 @@ static void decode_lsp(TwinContext *tctx, int lpc_idx1, uint8_t *lpc_idx2,
rearrange_lsp(mtab->n_lsp, lsp, 0.0001); rearrange_lsp(mtab->n_lsp, lsp, 0.0001);
for (i = 0; i < mtab->n_lsp; i++) { for (i = 0; i < mtab->n_lsp; i++) {
float tmp1 = 1. - cb3[lpc_hist_idx * mtab->n_lsp + i]; float tmp1 = 1.0 - cb3[lpc_hist_idx * mtab->n_lsp + i];
float tmp2 = hist[i] * cb3[lpc_hist_idx * mtab->n_lsp + i]; float tmp2 = hist[i] * cb3[lpc_hist_idx * mtab->n_lsp + i];
hist[i] = lsp[i]; hist[i] = lsp[i];
lsp[i] = lsp[i] * tmp1 + tmp2; lsp[i] = lsp[i] * tmp1 + tmp2;
@ -713,13 +713,13 @@ static void dec_bark_env(TwinContext *tctx, const uint8_t *in, int use_hist,
for (i = 0; i < fw_cb_len; i++) for (i = 0; i < fw_cb_len; i++)
for (j = 0; j < bark_n_coef; j++, idx++) { for (j = 0; j < bark_n_coef; j++, idx++) {
float tmp2 = mtab->fmode[ftype].bark_cb[fw_cb_len * in[j] + i] * float tmp2 = mtab->fmode[ftype].bark_cb[fw_cb_len * in[j] + i] *
(1. / 4096); (1.0 / 4096);
float st = use_hist ? (1. - val) * tmp2 + val * hist[idx] + 1. float st = use_hist ? (1.0 - val) * tmp2 + val * hist[idx] + 1.0
: tmp2 + 1.; : tmp2 + 1.0;
hist[idx] = tmp2; hist[idx] = tmp2;
if (st < -1.) if (st < -1.0)
st = 1.; st = 1.0;
memset_float(out, st * gain, mtab->fmode[ftype].bark_tab[idx]); memset_float(out, st * gain, mtab->fmode[ftype].bark_tab[idx]);
out += mtab->fmode[ftype].bark_tab[idx]; out += mtab->fmode[ftype].bark_tab[idx];
@ -789,12 +789,12 @@ static void read_and_decode_spectrum(TwinContext *tctx, GetBitContext *gb,
} }
if (ftype == FT_LONG) { if (ftype == FT_LONG) {
float pgain_step = 25000. / ((1 << mtab->pgain_bit) - 1); float pgain_step = 25000.0 / ((1 << mtab->pgain_bit) - 1);
int p_coef = get_bits(gb, tctx->mtab->ppc_period_bit); int p_coef = get_bits(gb, tctx->mtab->ppc_period_bit);
int g_coef = get_bits(gb, tctx->mtab->pgain_bit); int g_coef = get_bits(gb, tctx->mtab->pgain_bit);
float v = 1. / 8192 * float v = 1.0 / 8192 *
mulawinv(pgain_step * g_coef + pgain_step / 2, mulawinv(pgain_step * g_coef + pgain_step / 2,
25000., PGAIN_MU); 25000.0, PGAIN_MU);
decode_ppc(tctx, p_coef, ppc_shape + i * mtab->ppc_shape_len, v, decode_ppc(tctx, p_coef, ppc_shape + i * mtab->ppc_shape_len, v,
chunk); chunk);
@ -883,7 +883,7 @@ static av_cold int init_mdct_win(TwinContext *tctx)
int size_s = mtab->size / mtab->fmode[FT_SHORT].sub; int size_s = mtab->size / mtab->fmode[FT_SHORT].sub;
int size_m = mtab->size / mtab->fmode[FT_MEDIUM].sub; int size_m = mtab->size / mtab->fmode[FT_MEDIUM].sub;
int channels = tctx->avctx->channels; int channels = tctx->avctx->channels;
float norm = channels == 1 ? 2. : 1.; float norm = channels == 1 ? 2.0 : 1.0;
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
int bsize = tctx->mtab->size / tctx->mtab->fmode[i].sub; int bsize = tctx->mtab->size / tctx->mtab->fmode[i].sub;

@ -189,7 +189,7 @@ static int ready_codebook(vorbis_enc_codebook *cb)
cb->pow2[i] += cb->dimensions[i * cb->ndimensions + j] * cb->dimensions[i * cb->ndimensions + j]; cb->pow2[i] += cb->dimensions[i * cb->ndimensions + j] * cb->dimensions[i * cb->ndimensions + j];
div *= vals; div *= vals;
} }
cb->pow2[i] /= 2.; cb->pow2[i] /= 2.0;
} }
} }
return 0; return 0;
@ -728,7 +728,7 @@ static void floor_fit(vorbis_enc_context *venc, vorbis_enc_floor *fc,
{ {
int range = 255 / fc->multiplier + 1; int range = 255 / fc->multiplier + 1;
int i; int i;
float tot_average = 0.; float tot_average = 0.0;
float averages[MAX_FLOOR_VALUES]; float averages[MAX_FLOOR_VALUES];
for (i = 0; i < fc->values; i++) { for (i = 0; i < fc->values; i++) {
averages[i] = get_floor_average(fc, coeffs, i); averages[i] = get_floor_average(fc, coeffs, i);
@ -881,7 +881,7 @@ static int residue_encode(vorbis_enc_context *venc, vorbis_enc_residue *rc,
assert(rc->type == 2); assert(rc->type == 2);
assert(real_ch == 2); assert(real_ch == 2);
for (p = 0; p < partitions; p++) { for (p = 0; p < partitions; p++) {
float max1 = 0., max2 = 0.; float max1 = 0.0, max2 = 0.0;
int s = rc->begin + p * psize; int s = rc->begin + p * psize;
for (k = s; k < s + psize; k += 2) { for (k = s; k < s + psize; k += 2) {
max1 = FFMAX(max1, fabs(coeffs[ k / real_ch])); max1 = FFMAX(max1, fabs(coeffs[ k / real_ch]));
@ -968,7 +968,7 @@ static int apply_window_and_mdct(vorbis_enc_context *venc,
int i, channel; int i, channel;
const float * win = venc->win[0]; const float * win = venc->win[0];
int window_len = 1 << (venc->log2_blocksize[0] - 1); int window_len = 1 << (venc->log2_blocksize[0] - 1);
float n = (float)(1 << venc->log2_blocksize[0]) / 4.; float n = (float)(1 << venc->log2_blocksize[0]) / 4.0;
// FIXME use dsp // FIXME use dsp
if (!venc->have_saved && !samples) if (!venc->have_saved && !samples)

@ -229,7 +229,7 @@ static int swf_write_header(AVFormatContext *s)
} }
if (!swf->audio_enc) if (!swf->audio_enc)
swf->samples_per_frame = (44100. * rate_base) / rate; swf->samples_per_frame = (44100.0 * rate_base) / rate;
else else
swf->samples_per_frame = (swf->audio_enc->sample_rate * rate_base) / rate; swf->samples_per_frame = (swf->audio_enc->sample_rate * rate_base) / rate;

Loading…
Cancel
Save