Commit Graph

13 Commits (b0b1446aa7a9305ccb830a9e4ac47761601c5bac)

Author SHA1 Message Date
Christopher Snowhill b0b1446aa7 HRIR Filter: Corrected scale math, fixing volume
The volume should have been twice what it was, because I got this scale
wrong. The correct scale for Accelerate inverse FFT is 1/4 per sample,
not 1/8 like I accidentally misread while rewriting a convolver for the
umpteenth time from scratch.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-06 21:53:42 -08:00
Christopher Snowhill 85c7073649 Reformat my own source code with clang-format
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-06 21:49:27 -08:00
Christopher Snowhill d6760c823a HRIR Filter: Change resampler to use soxr oneshot
This should use the oneshot method, which takes care of flushing for us.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-01 22:54:27 -08:00
Christopher Snowhill d4990de7f3 Adopt the sox resampler instead of RetroArch
Removing RetroArch code from my project.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-01 18:55:39 -08:00
Christopher Snowhill 641f6390c5 HRIR Filter: Quality of life improvements
The memory allocation is now nicer, and only allocates what is needed.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-01 15:28:24 -08:00
Christopher Snowhill d239b58ab1 HRIR Filter: Fix 7.0 downmix and WAV files
7.0 downmix was passing parameters to cblas_scopy backwards, and WAV
files report "host" endian, not "native".

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-01-27 23:02:04 -08:00
Christopher Snowhill 600c447531 Virtual Surround: Further cleanup
Quick changes I missed. Oops.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-01-26 01:03:12 -08:00
Christopher Snowhill 7b5925d7d2 Virtual Surround: General cleanup
This should fix some coding issues, and also fix some potential memory
leaks in the file verifier, assuming it didn't already release the
files it was pulling the stats from.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-01-26 01:00:28 -08:00
Christopher Snowhill 778ac0699e Virtual Surround: Cleanup properly
The filter wasn't properly freeing its FFT setup state, and also was
unnecessarily null checking the pointers before passing them to the
aligned free function, which already does null checking.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-01-25 22:06:53 -08:00
Christopher Snowhill 708c7dc721 Headphone Virtualization: Implement customization
Implement the ability to configure and select an HRIR preset to use with
the HRIR filter, or remove the preset. It will validate the file's
usefulness before setting it for the player to use.

Also, fixed back center channel filtering for 7.0 format audio.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-01-25 21:30:33 -08:00
Christopher Snowhill bb029757fd
Headphone Virtualization: Fix an oops
The previous commit was not sound. Now it is.
2022-01-25 17:45:32 -08:00
Christopher Snowhill e53144acfa Headphone Virtualization: Implement 7ch impulses
This is needed for HeSuVi no-echo impulses, which are only one channel
per input channel, and mapping uses symmetrical mirroring of the input
set to create the surround effect, since there's no side-to-side delay
in these impulses.
2022-01-25 17:23:34 -08:00
Christopher Snowhill e7b78085ca New feature: Implemented headphone virtualization
This new virtualizer uses the Accelerate framework to process samples.
I've bundled a HeSuVi impulse for now, and will add an option to select
an impulse in the future. It will validate the selection before sending
it to the actual filter, which outright fails if it receives invalid
input. Impulses will be supported in any arbitrary format that Cog
supports, but let's not go too hog wild, it requires HeSuVi 14 channel
presets.
2022-01-25 16:50:42 -08:00