mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 16:24:04 +02:00
Remove auto-generated code.
This commit is contained in:
@@ -19307,268 +19307,9 @@ mal_result mal_decoder_seek_to_frame(mal_decoder* pDecoder, mal_uint64 frameInde
|
||||
// Should never get here, but if we do it means onSeekToFrame was not set by the backend.
|
||||
return MAL_INVALID_ARGS;
|
||||
}
|
||||
#endif
|
||||
#endif // MAL_NO_DECODING
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
// AUTO-GENERATED
|
||||
//
|
||||
//
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FORMAT CONVERSION
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void mal_pcm_u8_to_s16(short* pOut, const unsigned char* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = pIn[i];
|
||||
r = x - 128;
|
||||
r = r << 8;
|
||||
pOut[i] = (short)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_u8_to_s24(void* pOut, const unsigned char* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = pIn[i];
|
||||
r = x - 128;
|
||||
r = r << 16;
|
||||
((unsigned char*)pOut)[(i*3)+0] = (unsigned char)(r & 0xFF); ((unsigned char*)pOut)[(i*3)+1] = (unsigned char)((r & 0xFF00) >> 8); ((unsigned char*)pOut)[(i*3)+2] = (unsigned char)((r & 0xFF0000) >> 16);
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_u8_to_s32(int* pOut, const unsigned char* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = pIn[i];
|
||||
r = x - 128;
|
||||
r = r << 24;
|
||||
pOut[i] = (int)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_u8_to_f32(float* pOut, const unsigned char* pIn, unsigned int count)
|
||||
{
|
||||
float r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = pIn[i];
|
||||
r = x * 0.00784313725490196078f;
|
||||
r = r - 1;
|
||||
pOut[i] = (float)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_s16_to_u8(unsigned char* pOut, const short* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = pIn[i];
|
||||
r = x >> 8;
|
||||
r = r + 128;
|
||||
pOut[i] = (unsigned char)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_s16_to_s24(void* pOut, const short* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = pIn[i];
|
||||
r = x << 8;
|
||||
((unsigned char*)pOut)[(i*3)+0] = (unsigned char)(r & 0xFF); ((unsigned char*)pOut)[(i*3)+1] = (unsigned char)((r & 0xFF00) >> 8); ((unsigned char*)pOut)[(i*3)+2] = (unsigned char)((r & 0xFF0000) >> 16);
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_s16_to_s32(int* pOut, const short* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = pIn[i];
|
||||
r = x << 16;
|
||||
pOut[i] = (int)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_s16_to_f32(float* pOut, const short* pIn, unsigned int count)
|
||||
{
|
||||
float r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = pIn[i];
|
||||
r = (float)(x + 32768);
|
||||
r = r * 0.00003051804379339284f;
|
||||
r = r - 1;
|
||||
pOut[i] = (float)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_s24_to_u8(unsigned char* pOut, const void* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = ((int)(((unsigned int)(((unsigned char*)pIn)[i*3+0]) << 8) | ((unsigned int)(((unsigned char*)pIn)[i*3+1]) << 16) | ((unsigned int)(((unsigned char*)pIn)[i*3+2])) << 24)) >> 8;
|
||||
r = x >> 16;
|
||||
r = r + 128;
|
||||
pOut[i] = (unsigned char)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_s24_to_s16(short* pOut, const void* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = ((int)(((unsigned int)(((unsigned char*)pIn)[i*3+0]) << 8) | ((unsigned int)(((unsigned char*)pIn)[i*3+1]) << 16) | ((unsigned int)(((unsigned char*)pIn)[i*3+2])) << 24)) >> 8;
|
||||
r = x >> 8;
|
||||
pOut[i] = (short)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_s24_to_s32(int* pOut, const void* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = ((int)(((unsigned int)(((unsigned char*)pIn)[i*3+0]) << 8) | ((unsigned int)(((unsigned char*)pIn)[i*3+1]) << 16) | ((unsigned int)(((unsigned char*)pIn)[i*3+2])) << 24)) >> 8;
|
||||
r = x << 8;
|
||||
pOut[i] = (int)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_s24_to_f32(float* pOut, const void* pIn, unsigned int count)
|
||||
{
|
||||
float r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = ((int)(((unsigned int)(((unsigned char*)pIn)[i*3+0]) << 8) | ((unsigned int)(((unsigned char*)pIn)[i*3+1]) << 16) | ((unsigned int)(((unsigned char*)pIn)[i*3+2])) << 24)) >> 8;
|
||||
r = (float)(x + 8388608);
|
||||
r = r * 0.00000011920929665621f;
|
||||
r = r - 1;
|
||||
pOut[i] = (float)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_s32_to_u8(unsigned char* pOut, const int* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = pIn[i];
|
||||
r = x >> 24;
|
||||
r = r + 128;
|
||||
pOut[i] = (unsigned char)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_s32_to_s16(short* pOut, const int* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = pIn[i];
|
||||
r = x >> 16;
|
||||
pOut[i] = (short)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_s32_to_s24(void* pOut, const int* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = pIn[i];
|
||||
r = x >> 8;
|
||||
((unsigned char*)pOut)[(i*3)+0] = (unsigned char)(r & 0xFF); ((unsigned char*)pOut)[(i*3)+1] = (unsigned char)((r & 0xFF00) >> 8); ((unsigned char*)pOut)[(i*3)+2] = (unsigned char)((r & 0xFF0000) >> 16);
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_s32_to_f32(float* pOut, const int* pIn, unsigned int count)
|
||||
{
|
||||
float r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
int x = pIn[i];
|
||||
double t;
|
||||
t = (double)(x + 2147483647UL);
|
||||
t = t + 1;
|
||||
t = t * 0.0000000004656612873077392578125;
|
||||
r = (float)(t - 1);
|
||||
pOut[i] = (float)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_f32_to_u8(unsigned char* pOut, const float* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
float x = pIn[i];
|
||||
float c;
|
||||
c = ((x < -1) ? -1 : ((x > 1) ? 1 : x));
|
||||
c = c + 1;
|
||||
r = (int)(c * 127.5f);
|
||||
pOut[i] = (unsigned char)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_f32_to_s16(short* pOut, const float* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
float x = pIn[i];
|
||||
float c;
|
||||
c = ((x < -1) ? -1 : ((x > 1) ? 1 : x));
|
||||
c = c + 1;
|
||||
r = (int)(c * 32767.5f);
|
||||
r = r - 32768;
|
||||
pOut[i] = (short)r;
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_f32_to_s24(void* pOut, const float* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
float x = pIn[i];
|
||||
float c;
|
||||
c = ((x < -1) ? -1 : ((x > 1) ? 1 : x));
|
||||
c = c + 1;
|
||||
r = (int)(c * 8388607.5f);
|
||||
r = r - 8388608;
|
||||
((unsigned char*)pOut)[(i*3)+0] = (unsigned char)(r & 0xFF); ((unsigned char*)pOut)[(i*3)+1] = (unsigned char)((r & 0xFF00) >> 8); ((unsigned char*)pOut)[(i*3)+2] = (unsigned char)((r & 0xFF0000) >> 16);
|
||||
}
|
||||
}
|
||||
|
||||
void mal_pcm_f32_to_s32(int* pOut, const float* pIn, unsigned int count)
|
||||
{
|
||||
int r;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
float x = pIn[i];
|
||||
float c;
|
||||
mal_int64 t;
|
||||
c = ((x < -1) ? -1 : ((x > 1) ? 1 : x));
|
||||
c = c + 1;
|
||||
t = (mal_int64)(c * 2147483647.5);
|
||||
t = t - 2147483647;
|
||||
r = (int)(t - 1);
|
||||
pOut[i] = (int)r;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // MAL_IMPLEMENTATION
|
||||
|
||||
|
||||
// REVISION HISTORY
|
||||
|
||||
Reference in New Issue
Block a user