Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
0eee443b
Commit
0eee443b
authored
Mar 25, 2018
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove auto-generated code.
parent
bcbc7ad4
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
881 deletions
+2
-881
mini_al.h
mini_al.h
+2
-261
tools/malgen/source/malgen.cpp
tools/malgen/source/malgen.cpp
+0
-620
No files found.
mini_al.h
View file @
0eee443b
...
@@ -19307,268 +19307,9 @@ mal_result mal_decoder_seek_to_frame(mal_decoder* pDecoder, mal_uint64 frameInde
...
@@ -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.
// Should never get here, but if we do it means onSeekToFrame was not set by the backend.
return
MAL_INVALID_ARGS
;
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)
#endif // MAL_IMPLEMENTATION
{
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
// REVISION HISTORY
// REVISION HISTORY
...
...
tools/malgen/source/malgen.cpp
deleted
100644 → 0
View file @
bcbc7ad4
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment