Commit Graph

26 Commits (f2ff2bb2f6f2f9190210b60833b4232fe5398b07)

Author SHA1 Message Date
Chris Robinson dd3f03c148 Move a member variable to the struct it's needed 2022-08-09 22:19:11 -07:00
Chris Robinson 7e5dd41968 Add an option for higher quality UHJ filters 2022-08-08 03:44:25 -07:00
Chris Robinson 250f162496 Parameterize the UHJ filter length 2022-08-07 13:09:12 -07:00
Chris Robinson 556c5d14d7 Avoid a virtual function call to set the decoder width 2022-05-17 02:32:10 -07:00
Chris Robinson 3e9597a768 Avoid magic numbers 2022-05-16 22:49:03 -07:00
Chris Robinson 83238973ed Use virtual functions for the decoder 2022-05-14 21:23:03 -07:00
Chris Robinson 7e6ed2fa95 Use an array of pointers for the UHJ encoder input 2022-05-06 04:14:34 -07:00
Chris Robinson 354c18a242 Remove a couple unused fields 2022-04-22 16:37:08 -07:00
Chris Robinson a271484e7c Pass a span of pointers to the UHJ/SuperStereo decoder 2022-01-01 00:10:21 -08:00
Chris Robinson 01dd34f305 Add an internal Super Stereo format
It's not available as an AL buffer format (yet) since I'm not sure how to
expose it. Internally it seems fine as a separate channel configuration, but
because OpenAL combines the channel configuration and sample type, a flag may
work better there.
2021-12-11 17:50:24 -08:00
Chris Robinson b72402d3e7 Add a function for Super Stereo conversions
a.k.a. Stereo Enhance. A common feature of UHJ decoders to take a plain
stereo signal and generate a B-Format signal with variable width control,
widening (or narrowing) the soundfield while maintaining a sharp central
image.
2021-12-09 21:19:36 -08:00
Chris Robinson f1380d830a Avoid passing spans unnecessarily 2021-11-25 20:29:50 -08:00
Chris Robinson d5707b3184 Use a base for the UhjEncoder/Decoder common properties 2021-11-25 19:53:52 -08:00
Chris Robinson d998c03a27 Add a UHJ-specific coefficient scaling array 2021-07-13 06:31:13 -07:00
Chris Robinson 87682e7cb2 Update a comment 2021-04-11 17:32:14 -07:00
Chris Robinson f403fbd2e9 Fix UHJ encoding/decoding factors
Classic B-Format uses scaling factors W=1, X=sqrt(2), Y=sqrt(2), and Z=sqrt(2),
which is +3dB louder than FuMa. The base factors are designed assuming classic
scaling, so encoding a 0dBFS FuMa signal without accounting for this would
result in the UHJ signal peaking at about -3dBFS. Similarly, decoding UHJ to
FuMa B-Format would be +3dB louder than intended.

So encoding needs to implicitly boost the signal by +3dB, and decoding needs to
attenuate by -3dB.
2021-04-11 17:09:52 -07:00
Chris Robinson c6dbc487b3 Rename Uhj2Encoder to UhjEncoder 2021-04-01 05:37:54 -07:00
Chris Robinson e457018921 Avoid passing an array of pointers 2021-04-01 03:44:26 -07:00
Chris Robinson f33edc3b30 Add support for 4-channel UHJ
Also add the SOFT moniker to the new macros
2021-03-31 21:02:30 -07:00
Chris Robinson 35a0f2665f Decode UHJ buffers to B-Format for mixing
This should also have an adjustment for the shelf filter. Although it's not
clear what the appropriate adjustments should be.
2021-03-31 09:37:30 -07:00
Chris Robinson 7b2f194490 Rename a couple class members 2021-03-28 23:45:16 -07:00
Chris Robinson 8ab5e5dba2 Move the UHJ phase shifter to a common header 2021-03-28 06:09:11 -07:00
Chris Robinson 7c697b9178 Fix the UHJ all-pass delay
For real this time. The non-all-passed signal needs a one-sample delay over the
all-passed signal. Because of the way the all-pass FIR filter is structured,
it wouldn't otherwise use the last buffered sample, allowing it to be shifted
forward in time by one sample.

Also, remove a couple unnecessary buffers.
2021-03-20 03:14:10 -07:00
Chris Robinson e5833a9a68 Fix UHJ FIR filter alignment 2021-03-15 22:11:35 -07:00
Chris Robinson dfe627133c Use spans instead of references to arrays 2021-02-06 14:39:30 -08:00
Chris Robinson c4132b80ed Move a couple more things to core 2020-12-04 13:13:52 -08:00