Stop double-calculation of hashes.
[dcpomatic.git] / src / lib / upmixer_a.cc
index e6ec09c6a9530b2166b50ce3762eed10fdc05f94..a01ff30bb40f39dfbd2e6199e152a1513de6d549 100644 (file)
@@ -31,8 +31,8 @@ using boost::shared_ptr;
 UpmixerA::UpmixerA (int sampling_rate)
        : _left (0.02, 1900.0 / sampling_rate, 4800.0 / sampling_rate)
        , _right (0.02, 1900.0 / sampling_rate, 4800.0 / sampling_rate)
-       , _centre (0.02, 150.0 / sampling_rate, 1900.0 / sampling_rate)
-       , _lfe (0.02, 20.0 / sampling_rate, 150.0 / sampling_rate)
+       , _centre (0.01, 150.0 / sampling_rate, 1900.0 / sampling_rate)
+       , _lfe (0.01, 150.0 / sampling_rate)
        , _ls (0.02, 4800.0 / sampling_rate, 20000.0 / sampling_rate)
        , _rs (0.02, 4800.0 / sampling_rate, 20000.0 / sampling_rate)
 {
@@ -45,19 +45,12 @@ UpmixerA::name () const
        return _("Stereo to 5.1 up-mixer A");
 }
 
-
 string
 UpmixerA::id () const
 {
        return N_("stereo-5.1-upmix-a");
 }
 
-ChannelCount
-UpmixerA::in_channels () const
-{
-       return ChannelCount (2);
-}
-
 int
 UpmixerA::out_channels () const
 {
@@ -77,10 +70,10 @@ UpmixerA::run (shared_ptr<const AudioBuffers> in, int channels)
        shared_ptr<AudioBuffers> in_L = in->channel (0);
        shared_ptr<AudioBuffers> in_R = in->channel (1);
 
-       /* Mix of L and R */
+       /* Mix of L and R; -6dB down in amplitude (3dB in terms of power) */
        shared_ptr<AudioBuffers> in_LR = in_L->clone ();
        in_LR->accumulate_frames (in_R.get(), 0, 0, in_R->frames ());
-       in_LR->apply_gain (0.5);
+       in_LR->apply_gain (-6);
 
        /* Run filters */
        vector<shared_ptr<AudioBuffers> > all_out;