diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-07-26 10:43:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-26 10:43:12 +0200 |
commit | af7949fdea2f3115c82143178a22a39afe7bbde1 (patch) | |
tree | a13279b4b881c3dbd172b21f9ea69321f3d9596b /libavcodec | |
parent | e28fabb4cbe5e7c6cde8a63733d7530f283a0acb (diff) | |
parent | 4a2ef39442bf7f0150db07a1fbfcf8286e4d44a3 (diff) | |
download | ffmpeg-af7949fdea2f3115c82143178a22a39afe7bbde1.tar.gz |
Merge commit '4a2ef39442bf7f0150db07a1fbfcf8286e4d44a3'
* commit '4a2ef39442bf7f0150db07a1fbfcf8286e4d44a3':
cosmetics: Add '0' to float constants ending in '.'.
Conflicts:
libavcodec/ra288.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/aac_tablegen.h | 2 | ||||
-rw-r--r-- | libavcodec/aacdec.c | 4 | ||||
-rw-r--r-- | libavcodec/aacps_tablegen.h | 2 | ||||
-rw-r--r-- | libavcodec/acelp_vectors.c | 4 | ||||
-rw-r--r-- | libavcodec/qcelpdec.c | 6 | ||||
-rw-r--r-- | libavcodec/ra288.c | 6 | ||||
-rw-r--r-- | libavcodec/sipr.c | 2 | ||||
-rw-r--r-- | libavcodec/twinvq.c | 28 | ||||
-rw-r--r-- | libavcodec/vorbisenc.c | 8 |
9 files changed, 31 insertions, 31 deletions
diff --git a/libavcodec/aac_tablegen.h b/libavcodec/aac_tablegen.h index 2b080ba836..1c19a1529a 100644 --- a/libavcodec/aac_tablegen.h +++ b/libavcodec/aac_tablegen.h @@ -35,7 +35,7 @@ void ff_aac_tableinit(void) { int 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 */ diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index a17fb2caf8..1bdc22d5c5 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -1224,7 +1224,7 @@ static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb, int run_end = band_type_run_end[idx]; if (band_type[idx] == ZERO_BT) { for (; i < run_end; i++, idx++) - sf[idx] = 0.; + sf[idx] = 0.0; } else if ((band_type[idx] == INTENSITY_BT) || (band_type[idx] == INTENSITY_BT2)) { for (; i < run_end; i++, idx++) { @@ -1968,7 +1968,7 @@ static int decode_cce(AACContext *ac, GetBitContext *gb, ChannelElement *che) int idx = 0; int cge = 1; int gain = 0; - float gain_cache = 1.; + float gain_cache = 1.0; if (c) { cge = coup->coupling_point == AFTER_IMDCT ? 1 : get_bits1(gb); gain = cge ? get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60: 0; diff --git a/libavcodec/aacps_tablegen.h b/libavcodec/aacps_tablegen.h index 1f9c326d49..05a2af6524 100644 --- a/libavcodec/aacps_tablegen.h +++ b/libavcodec/aacps_tablegen.h @@ -192,7 +192,7 @@ static void ps_tableinit(void) for (k = 0; k < NR_ALLPASS_BANDS34; k++) { double f_center, theta; if (k < FF_ARRAY_ELEMS(f_center_34)) - f_center = f_center_34[k] / 24.; + f_center = f_center_34[k] / 24.0; else f_center = k - 26.5f; for (m = 0; m < PS_AP_LINKS; m++) { diff --git a/libavcodec/acelp_vectors.c b/libavcodec/acelp_vectors.c index c9d6f877f6..86851a3a8a 100644 --- a/libavcodec/acelp_vectors.c +++ b/libavcodec/acelp_vectors.c @@ -114,10 +114,10 @@ const float ff_b60_sinc[61] = { 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.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.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.00366211, -0.00497437, -0.00503540, -0.00402832, -0.00241089, -0.000579834, 0.00103760, 0.00222778, 0.00277710, 0.00271606, 0.00213623, 0.00115967 , diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c index f8fe85de99..806ec65f78 100644 --- a/libavcodec/qcelpdec.c +++ b/libavcodec/qcelpdec.c @@ -94,7 +94,7 @@ static av_cold int qcelp_decode_init(AVCodecContext *avctx) avctx->sample_fmt = AV_SAMPLE_FMT_FLT; for (i = 0; i < 10; i++) - q->prev_lspf[i] = (i + 1) / 11.; + q->prev_lspf[i] = (i + 1) / 11.0; return 0; } @@ -162,7 +162,7 @@ static int decode_lspf(QCELPContext *q, float *lspf) } else { q->octave_count = 0; - tmp_lspf = 0.; + tmp_lspf = 0.0; 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 + 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]; for (v_len = v_in + 40; v_in < v_len; v_in++) { 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]); } else *v_out = *v_lag; diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index 8590c7cd32..1f65710a42 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -95,7 +95,7 @@ static void decode(RA288Context *ractx, float gain, int cb_coef) memmove(ractx->sp_hist + 70, ractx->sp_hist + 75, 36*sizeof(*block)); /* block 46 of G.728 spec */ - sum = 32.; + sum = 32.0; for (i=0; i < 10; i++) sum -= gain_block[9-i] * ractx->gain_lpc[i]; @@ -111,7 +111,7 @@ static void decode(RA288Context *ractx, float gain, int cb_coef) sum = avpriv_scalarproduct_float_c(buffer, buffer, 5); - sum = FFMAX(sum, 5. / (1<<24)); + sum = FFMAX(sum, 5.0 / (1<<24)); /* shift and store */ memmove(gain_block, gain_block + 1, 9 * sizeof(*gain_block)); @@ -157,7 +157,7 @@ static void do_hybrid_window(RA288Context *ractx, } /* Multiply by the white noise correcting factor (WNCF). */ - *out *= 257./256.; + *out *= 257.0 / 256.0; } /** diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c index 35e8bf5ea5..d524177021 100644 --- a/libavcodec/sipr.c +++ b/libavcodec/sipr.c @@ -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]; int i; - tmp1[0] = 1.; + tmp1[0] = 1.0; for (i = 0; i < LP_FILTER_ORDER; i++) { tmp1[i+1] = Az[i] * ff_pow_0_55[i]; tmp2[i ] = Az[i] * ff_pow_0_7 [i]; diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c index 9bc4659ded..ea80becb3e 100644 --- a/libavcodec/twinvq.c +++ b/libavcodec/twinvq.c @@ -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... * - * test = a / 400.; + * test = a / 400.0; * return b * test + 0.5; * } * @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 * the decoded output increases, which leads one to believe that the encoder * expects exactly this broken calculation. @@ -516,12 +516,12 @@ static void dec_gain(TwinContext *tctx, GetBitContext *gb, enum FrameType ftype, if (ftype == FT_LONG) { 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), AMP_MAX, MULAW_MU); } else { 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), 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); 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]; hist[i] = lsp[i]; 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 (j = 0; j < bark_n_coef; j++, idx++) { float tmp2 = mtab->fmode[ftype].bark_cb[fw_cb_len * in[j] + i] * - (1. / 4096); - float st = use_hist ? (1. - val) * tmp2 + val * hist[idx] + 1. - : tmp2 + 1.; + (1.0 / 4096); + float st = use_hist ? (1.0 - val) * tmp2 + val * hist[idx] + 1.0 + : tmp2 + 1.0; hist[idx] = tmp2; - if (st < -1.) - st = 1.; + if (st < -1.0) + st = 1.0; memset_float(out, st * gain, 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) { - 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 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, - 25000., PGAIN_MU); + 25000.0, PGAIN_MU); decode_ppc(tctx, p_coef, ppc_shape + i * mtab->ppc_shape_len, v, chunk); @@ -881,7 +881,7 @@ static av_cold int init_mdct_win(TwinContext *tctx) int size_s = mtab->size / mtab->fmode[FT_SHORT].sub; int size_m = mtab->size / mtab->fmode[FT_MEDIUM].sub; 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++) { int bsize = tctx->mtab->size / tctx->mtab->fmode[i].sub; diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c index d685996277..dddbca0781 100644 --- a/libavcodec/vorbisenc.c +++ b/libavcodec/vorbisenc.c @@ -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]; div *= vals; } - cb->pow2[i] /= 2.; + cb->pow2[i] /= 2.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 i; - float tot_average = 0.; + float tot_average = 0.0; float averages[MAX_FLOOR_VALUES]; for (i = 0; i < fc->values; 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(real_ch == 2); for (p = 0; p < partitions; p++) { - float max1 = 0., max2 = 0.; + float max1 = 0.0, max2 = 0.0; int s = rc->begin + p * psize; for (k = s; k < s + psize; k += 2) { 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; const float * win = venc->win[0]; 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 if (!venc->have_saved && !samples) |