]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/twinvq.c
qdm2: Whitespace cosmetics
[ffmpeg] / libavcodec / twinvq.c
index 7b56140653e8a3b59d4ba33d11d0c619d4513de0..8c304c6afe62f2ab0793ec7a7a596d1769974774 100644 (file)
@@ -230,7 +230,7 @@ static void memset_float(float *buf, float val, int size)
  * Evaluate a single LPC amplitude spectrum envelope coefficient from the line
  * spectrum pairs.
  *
- * @param lsp a vector of the cosinus of the LSP values
+ * @param lsp a vector of the cosine of the LSP values
  * @param cos_val cos(PI*i/N) where i is the index of the LPC amplitude
  * @param order the order of the LSP (and the size of the *lsp buffer). Must
  *        be a multiple of four.
@@ -302,9 +302,9 @@ static inline float get_cos(int idx, int part, const float *cos_tab, int size)
  * unexplained condition.
  *
  * @param step the size of a block "siiiibiiii"
- * @param in the cosinus of the LSP data
- * @param part is 0 for 0...PI (positive cossinus values) and 1 for PI...2PI
- *        (negative cossinus values)
+ * @param in the cosine of the LSP data
+ * @param part is 0 for 0...PI (positive cosine values) and 1 for PI...2PI
+ *        (negative cosine values)
  * @param size the size of the whole output
  */
 static inline void eval_lpcenv_or_interp(TwinContext *tctx,
@@ -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);
@@ -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_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;