[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>swiftingly
parent
92f6c38db0
commit
4537a72275
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
#import "HeadphoneFilter.h"
|
#import "HeadphoneFilter.h"
|
||||||
|
|
||||||
|
#define DSD_DECIMATE 1
|
||||||
|
|
||||||
@interface ConverterNode : Node {
|
@interface ConverterNode : Node {
|
||||||
NSDictionary *rgInfo;
|
NSDictionary *rgInfo;
|
||||||
|
|
||||||
|
@ -52,9 +54,11 @@
|
||||||
void *extrapolateBuffer;
|
void *extrapolateBuffer;
|
||||||
size_t extrapolateBufferSize;
|
size_t extrapolateBufferSize;
|
||||||
|
|
||||||
|
#if DSD_DECIMATE
|
||||||
void **dsd2pcm;
|
void **dsd2pcm;
|
||||||
size_t dsd2pcmCount;
|
size_t dsd2pcmCount;
|
||||||
int dsd2pcmLatency;
|
int dsd2pcmLatency;
|
||||||
|
#endif
|
||||||
|
|
||||||
BOOL rememberedLossless;
|
BOOL rememberedLossless;
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,10 @@
|
||||||
|
|
||||||
#import "r8bstate.h"
|
#import "r8bstate.h"
|
||||||
|
|
||||||
|
#if !DSD_DECIMATE
|
||||||
|
#include "dsd2float.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
void PrintStreamDesc(AudioStreamBasicDescription *inDesc) {
|
void PrintStreamDesc(AudioStreamBasicDescription *inDesc) {
|
||||||
if(!inDesc) {
|
if(!inDesc) {
|
||||||
DLog(@"Can't print a NULL desc!\n");
|
DLog(@"Can't print a NULL desc!\n");
|
||||||
|
@ -65,8 +69,10 @@ void PrintStreamDesc(AudioStreamBasicDescription *inDesc) {
|
||||||
extrapolateBuffer = NULL;
|
extrapolateBuffer = NULL;
|
||||||
extrapolateBufferSize = 0;
|
extrapolateBufferSize = 0;
|
||||||
|
|
||||||
|
#if DSD_DECIMATE
|
||||||
dsd2pcm = NULL;
|
dsd2pcm = NULL;
|
||||||
dsd2pcmCount = 0;
|
dsd2pcmCount = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
hdcd_decoder = NULL;
|
hdcd_decoder = NULL;
|
||||||
|
|
||||||
|
@ -94,6 +100,7 @@ extern "C" void scale_by_volume(float *buffer, size_t count, float volume) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DSD_DECIMATE
|
||||||
/**
|
/**
|
||||||
* DSD 2 PCM: Stage 1:
|
* DSD 2 PCM: Stage 1:
|
||||||
* Decimate by factor 8
|
* Decimate by factor 8
|
||||||
|
@ -324,6 +331,19 @@ static void convert_dsd_to_f32(float *output, const uint8_t *input, size_t count
|
||||||
dsd2pcm_process(dsd2pcm[channel], input, channel, channels, output, channel, channels, count);
|
dsd2pcm_process(dsd2pcm[channel], input, channel, channels, output, channel, channels, count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static void convert_dsd_to_f32(float *output, const uint8_t *input, size_t count, size_t channels) {
|
||||||
|
const uint8_t *iptr = input;
|
||||||
|
float *optr = output;
|
||||||
|
for(size_t index = 0; index < count; ++index) {
|
||||||
|
for(size_t channel = 0; channel < channels; ++channel) {
|
||||||
|
uint8_t sample = *iptr++;
|
||||||
|
cblas_scopy(8, &dsd2float[sample][0], 1, optr++, (int)channels);
|
||||||
|
}
|
||||||
|
optr += channels * 7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void convert_u8_to_s16(int16_t *output, const uint8_t *input, size_t count) {
|
static void convert_u8_to_s16(int16_t *output, const uint8_t *input, size_t count) {
|
||||||
for(size_t i = 0; i < count; ++i) {
|
for(size_t i = 0; i < count; ++i) {
|
||||||
|
@ -475,6 +495,7 @@ tryagain:
|
||||||
|
|
||||||
BOOL isFloat = !!(inputFormat.mFormatFlags & kAudioFormatFlagIsFloat);
|
BOOL isFloat = !!(inputFormat.mFormatFlags & kAudioFormatFlagIsFloat);
|
||||||
BOOL isUnsigned = !isFloat && !(inputFormat.mFormatFlags & kAudioFormatFlagIsSignedInteger);
|
BOOL isUnsigned = !isFloat && !(inputFormat.mFormatFlags & kAudioFormatFlagIsSignedInteger);
|
||||||
|
size_t bitsPerSample = inputFormat.mBitsPerChannel;
|
||||||
|
|
||||||
// Approximately the most we want on input
|
// Approximately the most we want on input
|
||||||
ioNumberPackets = CHUNK_SIZE;
|
ioNumberPackets = CHUNK_SIZE;
|
||||||
|
@ -486,9 +507,15 @@ tryagain:
|
||||||
ioNumberPackets = ((uint32_t)(ioNumberPackets / sampleRatio) + 15) & ~15;
|
ioNumberPackets = ((uint32_t)(ioNumberPackets / sampleRatio) + 15) & ~15;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DSD_DECIMATE
|
||||||
|
const size_t sizeScale = 3;
|
||||||
|
#else
|
||||||
|
const size_t sizeScale = (bitsPerSample == 1) ? 10 : 3;
|
||||||
|
#endif
|
||||||
|
|
||||||
size_t newSize = ioNumberPackets * floatFormat.mBytesPerPacket;
|
size_t newSize = ioNumberPackets * floatFormat.mBytesPerPacket;
|
||||||
if(!inputBuffer || inputBufferSize < newSize)
|
if(!inputBuffer || inputBufferSize < newSize)
|
||||||
inputBuffer = realloc(inputBuffer, inputBufferSize = newSize * 3);
|
inputBuffer = realloc(inputBuffer, inputBufferSize = newSize * sizeScale);
|
||||||
|
|
||||||
ssize_t amountToWrite = ioNumberPackets * inputFormat.mBytesPerPacket;
|
ssize_t amountToWrite = ioNumberPackets * inputFormat.mBytesPerPacket;
|
||||||
|
|
||||||
|
@ -535,18 +562,21 @@ tryagain:
|
||||||
|
|
||||||
if(stopping || paused || streamFormatChanged || [self shouldContinue] == NO || [self endOfStream] == YES) {
|
if(stopping || paused || streamFormatChanged || [self shouldContinue] == NO || [self endOfStream] == YES) {
|
||||||
if(!skipResampler && !is_postextrapolated_) {
|
if(!skipResampler && !is_postextrapolated_) {
|
||||||
|
#if DSD_DECIMATE
|
||||||
if(dsd2pcm) {
|
if(dsd2pcm) {
|
||||||
uint32_t amountToSkip = dsd2pcmLatency * inputFormat.mBytesPerPacket;
|
uint32_t amountToSkip = dsd2pcmLatency * inputFormat.mBytesPerPacket;
|
||||||
memset(((uint8_t *)inputBuffer) + bytesReadFromInput, 0x55, amountToSkip);
|
memset(((uint8_t *)inputBuffer) + bytesReadFromInput, 0x55, amountToSkip);
|
||||||
bytesReadFromInput += amountToSkip;
|
bytesReadFromInput += amountToSkip;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
is_postextrapolated_ = 1;
|
is_postextrapolated_ = 1;
|
||||||
|
#if DSD_DECIMATE
|
||||||
} else if(!is_postextrapolated_ && dsd2pcm) {
|
} else if(!is_postextrapolated_ && dsd2pcm) {
|
||||||
is_postextrapolated_ = 3;
|
is_postextrapolated_ = 3;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t bitsPerSample = inputFormat.mBitsPerChannel;
|
|
||||||
BOOL isBigEndian = !!(inputFormat.mFormatFlags & kAudioFormatFlagIsBigEndian);
|
BOOL isBigEndian = !!(inputFormat.mFormatFlags & kAudioFormatFlagIsBigEndian);
|
||||||
|
|
||||||
if(!bytesReadFromInput && streamFormatChanged && !skipResampler && is_postextrapolated_ < 2) {
|
if(!bytesReadFromInput && streamFormatChanged && !skipResampler && is_postextrapolated_ < 2) {
|
||||||
|
@ -586,7 +616,15 @@ tryagain:
|
||||||
if(bitsPerSample == 1) {
|
if(bitsPerSample == 1) {
|
||||||
samplesRead = bytesReadFromInput / inputFormat.mBytesPerPacket;
|
samplesRead = bytesReadFromInput / inputFormat.mBytesPerPacket;
|
||||||
size_t buffer_adder = (bytesReadFromInput + 15) & ~15;
|
size_t buffer_adder = (bytesReadFromInput + 15) & ~15;
|
||||||
convert_dsd_to_f32((float *)(((uint8_t *)inputBuffer) + buffer_adder), (const uint8_t *)inputBuffer, samplesRead, inputFormat.mChannelsPerFrame, dsd2pcm);
|
convert_dsd_to_f32((float *)(((uint8_t *)inputBuffer) + buffer_adder), (const uint8_t *)inputBuffer, samplesRead, inputFormat.mChannelsPerFrame
|
||||||
|
#if DSD_DECIMATE
|
||||||
|
,
|
||||||
|
dsd2pcm
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
#if !DSD_DECIMATE
|
||||||
|
samplesRead *= 8;
|
||||||
|
#endif
|
||||||
memmove(inputBuffer, ((const uint8_t *)inputBuffer) + buffer_adder, samplesRead * inputFormat.mChannelsPerFrame * sizeof(float));
|
memmove(inputBuffer, ((const uint8_t *)inputBuffer) + buffer_adder, samplesRead * inputFormat.mChannelsPerFrame * sizeof(float));
|
||||||
bitsPerSample = 32;
|
bitsPerSample = 32;
|
||||||
bytesReadFromInput = samplesRead * inputFormat.mChannelsPerFrame * sizeof(float);
|
bytesReadFromInput = samplesRead * inputFormat.mChannelsPerFrame * sizeof(float);
|
||||||
|
@ -671,7 +709,9 @@ tryagain:
|
||||||
size_t samples_in_buffer = bytesReadFromInput / floatFormat.mBytesPerPacket;
|
size_t samples_in_buffer = bytesReadFromInput / floatFormat.mBytesPerPacket;
|
||||||
size_t prime = min(samples_in_buffer, PRIME_LEN_);
|
size_t prime = min(samples_in_buffer, PRIME_LEN_);
|
||||||
size_t _N_samples_to_add_ = N_samples_to_add_;
|
size_t _N_samples_to_add_ = N_samples_to_add_;
|
||||||
|
#if DSD_DECIMATE
|
||||||
if(dsd2pcm) _N_samples_to_add_ += dsd2pcmLatency;
|
if(dsd2pcm) _N_samples_to_add_ += dsd2pcmLatency;
|
||||||
|
#endif
|
||||||
size_t newSize = _N_samples_to_add_ * floatFormat.mBytesPerPacket;
|
size_t newSize = _N_samples_to_add_ * floatFormat.mBytesPerPacket;
|
||||||
newSize += bytesReadFromInput;
|
newSize += bytesReadFromInput;
|
||||||
|
|
||||||
|
@ -680,6 +720,7 @@ tryagain:
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t bytesToSkip = 0;
|
size_t bytesToSkip = 0;
|
||||||
|
#if DSD_DECIMATE
|
||||||
if(dsd2pcm) {
|
if(dsd2pcm) {
|
||||||
bytesToSkip = dsd2pcmLatency * floatFormat.mBytesPerPacket;
|
bytesToSkip = dsd2pcmLatency * floatFormat.mBytesPerPacket;
|
||||||
if(bytesReadFromInput >= bytesToSkip) {
|
if(bytesReadFromInput >= bytesToSkip) {
|
||||||
|
@ -688,6 +729,7 @@ tryagain:
|
||||||
bytesToSkip = 0;
|
bytesToSkip = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
memmove(((uint8_t *)inputBuffer) + N_samples_to_add_ * floatFormat.mBytesPerPacket, ((uint8_t *)inputBuffer) + bytesToSkip, bytesReadFromInput);
|
memmove(((uint8_t *)inputBuffer) + N_samples_to_add_ * floatFormat.mBytesPerPacket, ((uint8_t *)inputBuffer) + bytesToSkip, bytesReadFromInput);
|
||||||
|
|
||||||
|
@ -700,11 +742,15 @@ tryagain:
|
||||||
|
|
||||||
bytesReadFromInput += _N_samples_to_add_ * floatFormat.mBytesPerPacket;
|
bytesReadFromInput += _N_samples_to_add_ * floatFormat.mBytesPerPacket;
|
||||||
latencyEaten = N_samples_to_drop_;
|
latencyEaten = N_samples_to_drop_;
|
||||||
|
#if DSD_DECIMATE
|
||||||
if(dsd2pcm) latencyEaten += (int)ceil(dsd2pcmLatency * sampleRatio);
|
if(dsd2pcm) latencyEaten += (int)ceil(dsd2pcmLatency * sampleRatio);
|
||||||
|
#endif
|
||||||
is_preextrapolated_ = 2;
|
is_preextrapolated_ = 2;
|
||||||
|
#if DSD_DECIMATE
|
||||||
} else if(dsd2pcm && !is_preextrapolated_) {
|
} else if(dsd2pcm && !is_preextrapolated_) {
|
||||||
latencyEaten = dsd2pcmLatency;
|
latencyEaten = dsd2pcmLatency;
|
||||||
is_preextrapolated_ = 3;
|
is_preextrapolated_ = 3;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_postextrapolated_ == 1) {
|
if(is_postextrapolated_ == 1) {
|
||||||
|
@ -932,6 +978,7 @@ static float db_to_scale(float db) {
|
||||||
floatFormat.mBytesPerFrame = (32 / 8) * floatFormat.mChannelsPerFrame;
|
floatFormat.mBytesPerFrame = (32 / 8) * floatFormat.mChannelsPerFrame;
|
||||||
floatFormat.mBytesPerPacket = floatFormat.mBytesPerFrame * floatFormat.mFramesPerPacket;
|
floatFormat.mBytesPerPacket = floatFormat.mBytesPerFrame * floatFormat.mFramesPerPacket;
|
||||||
|
|
||||||
|
#if DSD_DECIMATE
|
||||||
if(inputFormat.mBitsPerChannel == 1) {
|
if(inputFormat.mBitsPerChannel == 1) {
|
||||||
// Decimate this for speed
|
// Decimate this for speed
|
||||||
floatFormat.mSampleRate *= 1.0 / 8.0;
|
floatFormat.mSampleRate *= 1.0 / 8.0;
|
||||||
|
@ -943,6 +990,7 @@ static float db_to_scale(float db) {
|
||||||
dsd2pcm[i] = dsd2pcm_dup(dsd2pcm[0]);
|
dsd2pcm[i] = dsd2pcm_dup(dsd2pcm[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
inpOffset = 0;
|
inpOffset = 0;
|
||||||
inpSize = 0;
|
inpSize = 0;
|
||||||
|
@ -1044,6 +1092,7 @@ static float db_to_scale(float db) {
|
||||||
delete(r8bstate *)_r8bstate;
|
delete(r8bstate *)_r8bstate;
|
||||||
_r8bstate = NULL;
|
_r8bstate = NULL;
|
||||||
}
|
}
|
||||||
|
#if DSD_DECIMATE
|
||||||
if(dsd2pcm && dsd2pcmCount) {
|
if(dsd2pcm && dsd2pcmCount) {
|
||||||
for(size_t i = 0; i < dsd2pcmCount; ++i) {
|
for(size_t i = 0; i < dsd2pcmCount; ++i) {
|
||||||
dsd2pcm_free(dsd2pcm[i]);
|
dsd2pcm_free(dsd2pcm[i]);
|
||||||
|
@ -1052,6 +1101,7 @@ static float db_to_scale(float db) {
|
||||||
free(dsd2pcm);
|
free(dsd2pcm);
|
||||||
dsd2pcm = NULL;
|
dsd2pcm = NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if(extrapolateBuffer) {
|
if(extrapolateBuffer) {
|
||||||
free(extrapolateBuffer);
|
free(extrapolateBuffer);
|
||||||
extrapolateBuffer = NULL;
|
extrapolateBuffer = NULL;
|
||||||
|
|
|
@ -73,6 +73,7 @@
|
||||||
8377C65227B8CAD100E8BC0F /* VisualizationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 8377C65027B8CAD100E8BC0F /* VisualizationController.h */; };
|
8377C65227B8CAD100E8BC0F /* VisualizationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 8377C65027B8CAD100E8BC0F /* VisualizationController.h */; };
|
||||||
8377C65327B8CAD100E8BC0F /* VisualizationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8377C65127B8CAD100E8BC0F /* VisualizationController.m */; };
|
8377C65327B8CAD100E8BC0F /* VisualizationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8377C65127B8CAD100E8BC0F /* VisualizationController.m */; };
|
||||||
8384912718080FF100E7332D /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 8384912618080FF100E7332D /* Logging.h */; };
|
8384912718080FF100E7332D /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 8384912618080FF100E7332D /* Logging.h */; };
|
||||||
|
839065F32853338700636FBB /* dsd2float.h in Headers */ = {isa = PBXBuildFile; fileRef = 839065F22853338700636FBB /* dsd2float.h */; };
|
||||||
839366671815923C006DD712 /* CogPluginMulti.h in Headers */ = {isa = PBXBuildFile; fileRef = 839366651815923C006DD712 /* CogPluginMulti.h */; };
|
839366671815923C006DD712 /* CogPluginMulti.h in Headers */ = {isa = PBXBuildFile; fileRef = 839366651815923C006DD712 /* CogPluginMulti.h */; };
|
||||||
839366681815923C006DD712 /* CogPluginMulti.m in Sources */ = {isa = PBXBuildFile; fileRef = 839366661815923C006DD712 /* CogPluginMulti.m */; };
|
839366681815923C006DD712 /* CogPluginMulti.m in Sources */ = {isa = PBXBuildFile; fileRef = 839366661815923C006DD712 /* CogPluginMulti.m */; };
|
||||||
8399CF2C27B5D1D5008751F1 /* NSDictionary+Merge.h in Headers */ = {isa = PBXBuildFile; fileRef = 8399CF2A27B5D1D4008751F1 /* NSDictionary+Merge.h */; };
|
8399CF2C27B5D1D5008751F1 /* NSDictionary+Merge.h in Headers */ = {isa = PBXBuildFile; fileRef = 8399CF2A27B5D1D4008751F1 /* NSDictionary+Merge.h */; };
|
||||||
|
@ -205,6 +206,7 @@
|
||||||
8377C65027B8CAD100E8BC0F /* VisualizationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VisualizationController.h; sourceTree = "<group>"; };
|
8377C65027B8CAD100E8BC0F /* VisualizationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VisualizationController.h; sourceTree = "<group>"; };
|
||||||
8377C65127B8CAD100E8BC0F /* VisualizationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VisualizationController.m; sourceTree = "<group>"; };
|
8377C65127B8CAD100E8BC0F /* VisualizationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VisualizationController.m; sourceTree = "<group>"; };
|
||||||
8384912618080FF100E7332D /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = ../../Utils/Logging.h; sourceTree = "<group>"; };
|
8384912618080FF100E7332D /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = ../../Utils/Logging.h; sourceTree = "<group>"; };
|
||||||
|
839065F22853338700636FBB /* dsd2float.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dsd2float.h; sourceTree = "<group>"; };
|
||||||
839366651815923C006DD712 /* CogPluginMulti.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CogPluginMulti.h; sourceTree = "<group>"; };
|
839366651815923C006DD712 /* CogPluginMulti.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CogPluginMulti.h; sourceTree = "<group>"; };
|
||||||
839366661815923C006DD712 /* CogPluginMulti.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CogPluginMulti.m; sourceTree = "<group>"; };
|
839366661815923C006DD712 /* CogPluginMulti.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CogPluginMulti.m; sourceTree = "<group>"; };
|
||||||
8399CF2A27B5D1D4008751F1 /* NSDictionary+Merge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSDictionary+Merge.h"; path = "../../Utils/NSDictionary+Merge.h"; sourceTree = "<group>"; };
|
8399CF2A27B5D1D4008751F1 /* NSDictionary+Merge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSDictionary+Merge.h"; path = "../../Utils/NSDictionary+Merge.h"; sourceTree = "<group>"; };
|
||||||
|
@ -412,6 +414,7 @@
|
||||||
17D21CDC0B8BE5B400D1EBDE /* Utils */ = {
|
17D21CDC0B8BE5B400D1EBDE /* Utils */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
839065F22853338700636FBB /* dsd2float.h */,
|
||||||
8328995527CB51B700D7F028 /* SHA256Digest.h */,
|
8328995527CB51B700D7F028 /* SHA256Digest.h */,
|
||||||
8328995627CB51B700D7F028 /* SHA256Digest.m */,
|
8328995627CB51B700D7F028 /* SHA256Digest.m */,
|
||||||
8328995227CB511000D7F028 /* RedundantPlaylistDataStore.h */,
|
8328995227CB511000D7F028 /* RedundantPlaylistDataStore.h */,
|
||||||
|
@ -601,6 +604,7 @@
|
||||||
17A2D3C50B8D1D37000778C4 /* AudioDecoder.h in Headers */,
|
17A2D3C50B8D1D37000778C4 /* AudioDecoder.h in Headers */,
|
||||||
8347C7412796C58800FA8A7D /* NSFileHandle+CreateFile.h in Headers */,
|
8347C7412796C58800FA8A7D /* NSFileHandle+CreateFile.h in Headers */,
|
||||||
17C940230B900909008627D6 /* AudioMetadataReader.h in Headers */,
|
17C940230B900909008627D6 /* AudioMetadataReader.h in Headers */,
|
||||||
|
839065F32853338700636FBB /* dsd2float.h in Headers */,
|
||||||
17B619300B909BC300BC003F /* AudioPropertiesReader.h in Headers */,
|
17B619300B909BC300BC003F /* AudioPropertiesReader.h in Headers */,
|
||||||
83F18B5427D1E8F000385946 /* CDSPHBUpsampler.h in Headers */,
|
83F18B5427D1E8F000385946 /* CDSPHBUpsampler.h in Headers */,
|
||||||
835EDD7D279FE307001EDCCE /* HeadphoneFilter.h in Headers */,
|
835EDD7D279FE307001EDCCE /* HeadphoneFilter.h in Headers */,
|
||||||
|
|
|
@ -0,0 +1,258 @@
|
||||||
|
static const float dsd2float[256][8] = {
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f, +1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, -1.0f },
|
||||||
|
{ +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f, +1.0f }
|
||||||
|
};
|
|
@ -0,0 +1,19 @@
|
||||||
|
#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;
|
||||||
|
}
|
Loading…
Reference in New Issue