Skip to content

Commit 1312911

Browse files
committed
Revert "Update the Super Stereo calculation"
This reverts commit 9ffa786.
1 parent 9ffa786 commit 1312911

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

core/uhjfilter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ void UhjDecoderIIR::decode(const std::span<std::span<float>> samples, const bool
534534
*
535535
* W = 0.6098637*S + 0.6896511*j*w*D
536536
* X = 0.8624776*S - 0.7626955*j*w*D
537-
* Y = 1.6822415*w*D - 0.2156194*j*S
537+
* Y = 1.6822415*w*D + 0.2156194*j*S
538538
*
539539
* where j is a +90 degree phase shift. w is a variable control for the
540540
* resulting stereo width, with the range 0 <= w <= 0.7.
@@ -612,9 +612,9 @@ void UhjStereoDecoder<N>::decode(const std::span<std::span<float>> samples, cons
612612
mSHistory.begin());
613613
PShifter<N>.process(youtput, mTemp);
614614

615-
/* Y = 1.6822415*w*D - 0.2156194*j*S */
615+
/* Y = 1.6822415*w*D + 0.2156194*j*S */
616616
std::ranges::transform(mD, youtput, youtput.begin(), [](const float d, const float js) noexcept
617-
{ return 1.6822415f*d - 0.2156194f*js; });
617+
{ return 1.6822415f*d + 0.2156194f*js; });
618618
}
619619

620620
void UhjStereoDecoderIIR::decode(const std::span<std::span<float>> samples, const bool updateState)
@@ -687,9 +687,9 @@ void UhjStereoDecoderIIR::decode(const std::span<std::span<float>> samples, cons
687687
/* Apply filter1 to D and store in mTemp. */
688688
process(mFilter1D, Filter1Coeff, std::span{mD}.first(samplesToDo), updateState, mTemp);
689689

690-
/* Y = 1.6822415*w*D - 0.2156194*j*S */
690+
/* Y = 1.6822415*w*D + 0.2156194*j*S */
691691
std::ranges::transform(mTemp, youtput, youtput.begin(), [](float d, float js) noexcept
692-
{ return 1.6822415f*d - 0.2156194f*js; });
692+
{ return 1.6822415f*d + 0.2156194f*js; });
693693

694694
mFirstRun = false;
695695
}

core/uhjfilter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,13 @@ struct DecoderBase {
154154
* The width factor for Super Stereo processing. Can be changed in between
155155
* calls to decode, with valid values being between 0...0.7.
156156
*
157-
* 0.41 seems to produce the least amount of channel bleed when the output
157+
* 0.46 seens to produce the least amount of channel bleed when the output
158158
* is subsequently UHJ encoded (given a stereo sound with a noise on the
159159
* left buffer channel, for instance, when decoded with UhjStereoDecoder
160160
* and then encoded with UhjEncoder, the right output channel was at its
161161
* quietest).
162162
*/
163-
float mWidthControl{0.41f};
163+
float mWidthControl{0.46f};
164164
};
165165

166166
template<std::size_t N>

0 commit comments

Comments
 (0)