Remove the (u)byte3 sample formats
They're not accessible since the removal of the buffer_samples extension, and were kind of clunky to work with as 24-bit packed values.
This commit is contained in:
parent
ac8b4aa5f6
commit
355a8898cf
@ -17,8 +17,6 @@ enum UserFmtType {
|
||||
UserFmtUInt = AL_UNSIGNED_INT_SOFT,
|
||||
UserFmtFloat = AL_FLOAT_SOFT,
|
||||
UserFmtDouble = AL_DOUBLE_SOFT,
|
||||
UserFmtByte3 = AL_BYTE3_SOFT,
|
||||
UserFmtUByte3 = AL_UNSIGNED_BYTE3_SOFT,
|
||||
UserFmtMulaw = AL_MULAW_SOFT,
|
||||
UserFmtAlaw = 0x10000000,
|
||||
UserFmtIMA4,
|
||||
|
@ -183,8 +183,6 @@ AL_API ALvoid AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoi
|
||||
|
||||
case UserFmtInt:
|
||||
case UserFmtUInt:
|
||||
case UserFmtByte3:
|
||||
case UserFmtUByte3:
|
||||
case UserFmtDouble:
|
||||
framesize = FrameSizeFromUserFmt(srcchannels, srctype) * align;
|
||||
if((size%framesize) != 0)
|
||||
@ -1086,8 +1084,6 @@ ALsizei BytesFromUserFmt(enum UserFmtType type)
|
||||
case UserFmtUInt: return sizeof(ALuint);
|
||||
case UserFmtFloat: return sizeof(ALfloat);
|
||||
case UserFmtDouble: return sizeof(ALdouble);
|
||||
case UserFmtByte3: return sizeof(ALbyte[3]);
|
||||
case UserFmtUByte3: return sizeof(ALubyte[3]);
|
||||
case UserFmtMulaw: return sizeof(ALubyte);
|
||||
case UserFmtAlaw: return sizeof(ALubyte);
|
||||
case UserFmtIMA4: break; /* not handled here */
|
||||
|
@ -174,14 +174,6 @@ typedef ALubyte ALmulaw;
|
||||
typedef ALubyte ALalaw;
|
||||
typedef ALubyte ALima4;
|
||||
typedef ALubyte ALmsadpcm;
|
||||
typedef struct {
|
||||
ALbyte b[3];
|
||||
} ALbyte3;
|
||||
static_assert(sizeof(ALbyte3)==sizeof(ALbyte[3]), "ALbyte3 size is not 3");
|
||||
typedef struct {
|
||||
ALubyte b[3];
|
||||
} ALubyte3;
|
||||
static_assert(sizeof(ALubyte3)==sizeof(ALubyte[3]), "ALubyte3 size is not 3");
|
||||
|
||||
static inline ALshort DecodeMuLaw(ALmulaw val)
|
||||
{ return muLawDecompressionTable[val]; }
|
||||
@ -498,49 +490,6 @@ static void EncodeMSADPCMBlock(ALmsadpcm *dst, const ALshort *src, ALint *sample
|
||||
}
|
||||
|
||||
|
||||
static inline ALint DecodeByte3(ALbyte3 val)
|
||||
{
|
||||
if(IS_LITTLE_ENDIAN)
|
||||
return (val.b[2]<<16) | (((ALubyte)val.b[1])<<8) | ((ALubyte)val.b[0]);
|
||||
return (val.b[0]<<16) | (((ALubyte)val.b[1])<<8) | ((ALubyte)val.b[2]);
|
||||
}
|
||||
|
||||
static inline ALbyte3 EncodeByte3(ALint val)
|
||||
{
|
||||
if(IS_LITTLE_ENDIAN)
|
||||
{
|
||||
ALbyte3 ret = {{ val, val>>8, val>>16 }};
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
ALbyte3 ret = {{ val>>16, val>>8, val }};
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
static inline ALint DecodeUByte3(ALubyte3 val)
|
||||
{
|
||||
if(IS_LITTLE_ENDIAN)
|
||||
return (val.b[2]<<16) | (val.b[1]<<8) | (val.b[0]);
|
||||
return (val.b[0]<<16) | (val.b[1]<<8) | val.b[2];
|
||||
}
|
||||
|
||||
static inline ALubyte3 EncodeUByte3(ALint val)
|
||||
{
|
||||
if(IS_LITTLE_ENDIAN)
|
||||
{
|
||||
ALubyte3 ret = {{ val, val>>8, val>>16 }};
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
ALubyte3 ret = {{ val>>16, val>>8, val }};
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Define same-type pass-through sample conversion functions (excludes ADPCM,
|
||||
* which are block-based). */
|
||||
#define DECL_TEMPLATE(T) \
|
||||
@ -552,8 +501,6 @@ DECL_TEMPLATE(ALshort);
|
||||
DECL_TEMPLATE(ALushort);
|
||||
DECL_TEMPLATE(ALint);
|
||||
DECL_TEMPLATE(ALuint);
|
||||
DECL_TEMPLATE(ALbyte3);
|
||||
DECL_TEMPLATE(ALubyte3);
|
||||
DECL_TEMPLATE(ALalaw);
|
||||
DECL_TEMPLATE(ALmulaw);
|
||||
|
||||
@ -652,35 +599,6 @@ static inline ALuint Conv_ALuint_ALfloat(ALfloat val)
|
||||
|
||||
#undef DECL_TEMPLATE
|
||||
|
||||
/* Define byte3 and ubyte3 functions (goes through int and uint functions). */
|
||||
#define DECL_TEMPLATE(T) \
|
||||
static inline ALbyte3 Conv_ALbyte3_##T(T val) \
|
||||
{ return EncodeByte3(Conv_ALint_##T(val)>>8); } \
|
||||
static inline T Conv_##T##_ALbyte3(ALbyte3 val) \
|
||||
{ return Conv_##T##_ALint(DecodeByte3(val)<<8); } \
|
||||
\
|
||||
static inline ALubyte3 Conv_ALubyte3_##T(T val) \
|
||||
{ return EncodeUByte3(Conv_ALuint_##T(val)>>8); } \
|
||||
static inline T Conv_##T##_ALubyte3(ALubyte3 val) \
|
||||
{ return Conv_##T##_ALuint(DecodeUByte3(val)<<8); }
|
||||
|
||||
DECL_TEMPLATE(ALbyte)
|
||||
DECL_TEMPLATE(ALubyte)
|
||||
DECL_TEMPLATE(ALshort)
|
||||
DECL_TEMPLATE(ALushort)
|
||||
DECL_TEMPLATE(ALint)
|
||||
DECL_TEMPLATE(ALuint)
|
||||
DECL_TEMPLATE(ALfloat)
|
||||
DECL_TEMPLATE(ALdouble)
|
||||
|
||||
#undef DECL_TEMPLATE
|
||||
|
||||
/* Define byte3 <-> ubyte3 functions. */
|
||||
static inline ALbyte3 Conv_ALbyte3_ALubyte3(ALubyte3 val)
|
||||
{ return EncodeByte3(DecodeUByte3(val)-8388608); }
|
||||
static inline ALubyte3 Conv_ALubyte3_ALbyte3(ALbyte3 val)
|
||||
{ return EncodeUByte3(DecodeByte3(val)+8388608); }
|
||||
|
||||
/* Define muLaw and aLaw functions (goes through short functions). */
|
||||
#define DECL_TEMPLATE(T) \
|
||||
static inline ALmulaw Conv_ALmulaw_##T(T val) \
|
||||
@ -701,8 +619,6 @@ DECL_TEMPLATE(ALint)
|
||||
DECL_TEMPLATE(ALuint)
|
||||
DECL_TEMPLATE(ALfloat)
|
||||
DECL_TEMPLATE(ALdouble)
|
||||
DECL_TEMPLATE(ALbyte3)
|
||||
DECL_TEMPLATE(ALubyte3)
|
||||
|
||||
#undef DECL_TEMPLATE
|
||||
|
||||
@ -735,9 +651,7 @@ DECL_TEMPLATE(T, ALuint) \
|
||||
DECL_TEMPLATE(T, ALfloat) \
|
||||
DECL_TEMPLATE(T, ALdouble) \
|
||||
DECL_TEMPLATE(T, ALmulaw) \
|
||||
DECL_TEMPLATE(T, ALalaw) \
|
||||
DECL_TEMPLATE(T, ALbyte3) \
|
||||
DECL_TEMPLATE(T, ALubyte3)
|
||||
DECL_TEMPLATE(T, ALalaw)
|
||||
|
||||
DECL_TEMPLATE2(ALbyte)
|
||||
DECL_TEMPLATE2(ALubyte)
|
||||
@ -749,8 +663,6 @@ DECL_TEMPLATE2(ALfloat)
|
||||
DECL_TEMPLATE2(ALdouble)
|
||||
DECL_TEMPLATE2(ALmulaw)
|
||||
DECL_TEMPLATE2(ALalaw)
|
||||
DECL_TEMPLATE2(ALbyte3)
|
||||
DECL_TEMPLATE2(ALubyte3)
|
||||
|
||||
#undef DECL_TEMPLATE2
|
||||
#undef DECL_TEMPLATE
|
||||
@ -800,8 +712,6 @@ DECL_TEMPLATE(ALfloat)
|
||||
DECL_TEMPLATE(ALdouble)
|
||||
DECL_TEMPLATE(ALmulaw)
|
||||
DECL_TEMPLATE(ALalaw)
|
||||
DECL_TEMPLATE(ALbyte3)
|
||||
DECL_TEMPLATE(ALubyte3)
|
||||
|
||||
#undef DECL_TEMPLATE
|
||||
|
||||
@ -853,8 +763,6 @@ DECL_TEMPLATE(ALfloat)
|
||||
DECL_TEMPLATE(ALdouble)
|
||||
DECL_TEMPLATE(ALmulaw)
|
||||
DECL_TEMPLATE(ALalaw)
|
||||
DECL_TEMPLATE(ALbyte3)
|
||||
DECL_TEMPLATE(ALubyte3)
|
||||
|
||||
#undef DECL_TEMPLATE
|
||||
|
||||
@ -906,8 +814,6 @@ DECL_TEMPLATE(ALfloat)
|
||||
DECL_TEMPLATE(ALdouble)
|
||||
DECL_TEMPLATE(ALmulaw)
|
||||
DECL_TEMPLATE(ALalaw)
|
||||
DECL_TEMPLATE(ALbyte3)
|
||||
DECL_TEMPLATE(ALubyte3)
|
||||
|
||||
#undef DECL_TEMPLATE
|
||||
|
||||
@ -957,8 +863,6 @@ DECL_TEMPLATE(ALfloat)
|
||||
DECL_TEMPLATE(ALdouble)
|
||||
DECL_TEMPLATE(ALmulaw)
|
||||
DECL_TEMPLATE(ALalaw)
|
||||
DECL_TEMPLATE(ALbyte3)
|
||||
DECL_TEMPLATE(ALubyte3)
|
||||
|
||||
#undef DECL_TEMPLATE
|
||||
|
||||
@ -1035,12 +939,6 @@ static void Convert_##T(T *dst, const ALvoid *src, enum UserFmtType srcType, \
|
||||
case UserFmtMSADPCM: \
|
||||
Convert_##T##_ALmsadpcm(dst, src, numchans, len, align); \
|
||||
break; \
|
||||
case UserFmtByte3: \
|
||||
Convert_##T##_ALbyte3(dst, src, numchans, len, align); \
|
||||
break; \
|
||||
case UserFmtUByte3: \
|
||||
Convert_##T##_ALubyte3(dst, src, numchans, len, align); \
|
||||
break; \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -1056,8 +954,6 @@ DECL_TEMPLATE(ALmulaw)
|
||||
DECL_TEMPLATE(ALalaw)
|
||||
DECL_TEMPLATE(ALima4)
|
||||
DECL_TEMPLATE(ALmsadpcm)
|
||||
DECL_TEMPLATE(ALbyte3)
|
||||
DECL_TEMPLATE(ALubyte3)
|
||||
|
||||
#undef DECL_TEMPLATE
|
||||
|
||||
@ -1102,11 +998,5 @@ void ConvertData(ALvoid *dst, enum UserFmtType dstType, const ALvoid *src, enum
|
||||
case UserFmtMSADPCM:
|
||||
Convert_ALmsadpcm(dst, src, srcType, numchans, len, align);
|
||||
break;
|
||||
case UserFmtByte3:
|
||||
Convert_ALbyte3(dst, src, srcType, numchans, len, align);
|
||||
break;
|
||||
case UserFmtUByte3:
|
||||
Convert_ALubyte3(dst, src, srcType, numchans, len, align);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user