Cog/Audio/Utils/floatlist.c
Christopher Snowhill 4537a72275 [DSD] Add pure downsampling path, disabled
Pure downsampling is slower, but may or may not be more accurate. Though
probably not worth it. It did help me realize a minor error, though.
The decimator's volume is twice as loud as it should be.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 02:13:10 -07:00

19 lines
416 B
C

#include <stdint.h>
#include <stdio.h>
int main(void) {
fprintf(stdout, "static const float dsdtofloat[256][8] = {\n");
for(size_t i = 0; i < 256; ++i) {
fprintf(stdout, "\t{ ");
for(size_t j = 0; j < 8; ++j) {
if(j) fprintf(stdout, ", ");
fprintf(stdout, "%s", ((i << j) & 128) ? "+1.0f" : "-1.0f");
}
fprintf(stdout, " }%s", (i < 255) ? ",\n" : "\n");
}
fprintf(stdout, "};\n");
return 0;
}