[SCM] libdca packaging branch, master, updated. debian/0.0.5-2-9-gb0aef89

fabian-guest at users.alioth.debian.org fabian-guest at users.alioth.debian.org
Tue Jun 16 09:29:28 UTC 2009


The following commit has been merged in the master branch:
commit a0240825c522d52ba37a1e5c8ea583b762bc20fd
Author: Fabian Greffrath <fabian at debian-unofficial.org>
Date:   Tue Jun 16 11:25:16 2009 +0200

    debian/patches/r84-normalisation-factor-sqrt2+output-bias.patch: Change output normalisation factor from 3/2 to sqrt(2). Fixed a bug where the output bias wasn't applied when downmixing wasn't being done.

diff --git a/debian/patches/r84-normalisation-factor-sqrt2+output-bias.patch b/debian/patches/r84-normalisation-factor-sqrt2+output-bias.patch
new file mode 100644
index 0000000..acdb9f0
--- /dev/null
+++ b/debian/patches/r84-normalisation-factor-sqrt2+output-bias.patch
@@ -0,0 +1,107 @@
+r84 | gbazin | 2008-06-01 16:13:33 +0000 (Sun, 01 Jun 2008) | 3 lines
+  * libdca/parse.c: Change output normalisation factor from 3/2 to sqrt(2).
+    Thanks to Alexander E. Patrakov for finding that this is the proper normalisation factor.
+    Fixed a bug where the output bias wasn't applied when downmixing wasn't being done.
+
+--- libdca.orig/libdca/parse.c
++++ libdca/libdca/parse.c
+@@ -59,12 +59,11 @@
+ static int decode_blockcode (int code, int levels, int *values);
+ 
+ static void qmf_32_subbands (dca_state_t * state, int chans,
+-                             double samples_in[32][8], sample_t *samples_out,
+-                             double rScale, sample_t bias);
++                             double samples_in[32][8], sample_t *samples_out);
+ 
+ static void lfe_interpolation_fir (int nDecimationSelect, int nNumDeciSample,
+                                    double *samples_in, sample_t *samples_out,
+-                                   double rScale, sample_t bias );
++                                   sample_t bias);
+ 
+ static void pre_calc_cosmod( dca_state_t * state );
+ 
+@@ -123,7 +122,9 @@
+     bitstream_get (state, 1);
+ 
+     *frame_length = (bitstream_get (state, 7) + 1) * 32;
++    if (*frame_length < 6 * 32) return 0;
+     frame_size = bitstream_get (state, 14) + 1;
++    if (frame_size < 96) return 0;
+     if (!state->word_mode) frame_size = frame_size * 8 / 14 * 2;
+ 
+     /* Audio channel arrangement */
+@@ -981,14 +982,7 @@
+     /* 32 subbands QMF */
+     for (k = 0; k < state->prim_channels; k++)
+     {
+-        /*static double pcm_to_float[8] =
+-            {32768.0, 32768.0, 524288.0, 524288.0, 0, 8388608.0, 8388608.0};*/
+-
+-        qmf_32_subbands (state, k,
+-                         subband_samples[k],
+-                         &state->samples[256*k],
+-          /*WTF ???*/    32768.0*3/2/*pcm_to_float[state->source_pcm_res]*/,
+-                         0/*state->bias*/);
++        qmf_32_subbands (state, k, subband_samples[k], &state->samples[256*k]);
+     }
+ 
+     /* Down/Up mixing */
+@@ -1000,6 +994,10 @@
+     {
+         dca_downmix (state->samples, state->amode, state->output, state->bias,
+                      state->clev, state->slev);
++    } else if (state->bias)
++    {
++        for ( k = 0; k < 256*state->prim_channels; k++ )
++            state->samples[k] += state->bias;
+     }
+ 
+     /* Generate LFE samples for this subsubframe FIXME!!! */
+@@ -1011,8 +1009,7 @@
+         lfe_interpolation_fir (state->lfe, 2 * state->lfe,
+                                state->lfe_data + lfe_samples +
+                                2 * state->lfe * subsubframe,
+-                               &state->samples[256*i_channels],
+-                               8388608.0, state->bias);
++                               &state->samples[256*i_channels], state->bias);
+         /* Outputs 20bits pcm samples */
+     }
+ 
+@@ -1142,9 +1139,9 @@
+ }
+ 
+ static void qmf_32_subbands (dca_state_t * state, int chans,
+-                             double samples_in[32][8], sample_t *samples_out,
+-                             double scale, sample_t bias)
++                             double samples_in[32][8], sample_t *samples_out)
+ {
++    static const double scale = 1.4142135623730951 /* sqrt(2) */ * 32768.0;
+     const double *prCoeff;
+     int i, j, k;
+     double raXin[32];
+@@ -1211,7 +1208,7 @@
+ 
+         /* Create 32 PCM output samples */
+         for (i=0;i<32;i++)
+-            samples_out[nChIndex++] = subband_fir_hist2[i] / scale + bias;
++            samples_out[nChIndex++] = subband_fir_hist2[i] / scale;
+ 
+         /* Update working arrays */
+         for (i=511;i>=32;i--)
+@@ -1225,7 +1222,7 @@
+ 
+ static void lfe_interpolation_fir (int nDecimationSelect, int nNumDeciSample,
+                                    double *samples_in, sample_t *samples_out,
+-                                   double scale, sample_t bias)
++                                   sample_t bias)
+ {
+     /* samples_in: An array holding decimated samples.
+      *   Samples in current subframe starts from samples_in[0],
+@@ -1235,6 +1232,7 @@
+      * samples_out: An array holding interpolated samples
+      */
+ 
++    static const double scale = 8388608.0;
+     int nDeciFactor, k, J;
+     const double *prCoeff;
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 69a09d2..a58fb52 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 r83-mark-tables-as-static-constants.patch 
+r84-normalisation-factor-sqrt2+output-bias.patch 

-- 
libdca packaging



More information about the pkg-multimedia-commits mailing list