Commit dc9fa2ed authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Add codecs for S24 in 4 bytes

parent 21fcab35
......@@ -323,6 +323,8 @@
#define VLC_CODEC_S24B VLC_FOURCC('s','2','4','b')
#define VLC_CODEC_U24L VLC_FOURCC('u','2','4','l')
#define VLC_CODEC_U24B VLC_FOURCC('u','2','4','b')
#define VLC_CODEC_S24L32 VLC_FOURCC('s','2','4','4')
#define VLC_CODEC_S24B32 VLC_FOURCC('S','2','4','4')
#define VLC_CODEC_S32L VLC_FOURCC('s','3','2','l')
#define VLC_CODEC_S32B VLC_FOURCC('s','3','2','b')
#define VLC_CODEC_U32L VLC_FOURCC('u','3','2','l')
......
......@@ -91,6 +91,8 @@ static void U24BDecode( void *, const uint8_t *, unsigned );
static void U24LDecode( void *, const uint8_t *, unsigned );
static void S24BDecode( void *, const uint8_t *, unsigned );
static void S24LDecode( void *, const uint8_t *, unsigned );
static void S24B32Decode( void *, const uint8_t *, unsigned );
static void S24L32Decode( void *, const uint8_t *, unsigned );
static void U32BDecode( void *, const uint8_t *, unsigned );
static void U32LDecode( void *, const uint8_t *, unsigned );
static void Swap32Decode( void *, const uint8_t *, unsigned );
......@@ -166,6 +168,16 @@ static int DecoderOpen( vlc_object_t *p_this )
case VLC_CODEC_S32N:
bits = 32;
break;
case VLC_CODEC_S24B32:
format = VLC_CODEC_S32N;
decode = S24B32Decode;
bits = 32;
break;
case VLC_CODEC_S24L32:
format = VLC_CODEC_S32N;
decode = S24L32Decode;
bits = 32;
break;
case VLC_CODEC_U24B:
format = VLC_CODEC_S32N;
decode = U24BDecode;
......@@ -441,6 +453,28 @@ static void S24LDecode( void *outp, const uint8_t *in, unsigned samples )
}
}
static void S24B32Decode( void *outp, const uint8_t *in, unsigned samples )
{
uint32_t *out = outp;
for( size_t i = 0; i < samples; i++ )
{
*(out++) = GetDWBE( in ) << 8;
in += 4;
}
}
static void S24L32Decode( void *outp, const uint8_t *in, unsigned samples )
{
uint32_t *out = outp;
for( size_t i = 0; i < samples; i++ )
{
*(out++) = GetDWLE( in ) << 8;
in += 4;
}
}
static void U32BDecode( void *outp, const uint8_t *in, unsigned samples )
{
uint32_t *out = outp;
......
......@@ -61,6 +61,10 @@ unsigned int aout_BitsPerSample( vlc_fourcc_t i_format )
case VLC_CODEC_S24B:
return 24;
case VLC_CODEC_S24L32:
case VLC_CODEC_S24B32:
case VLC_CODEC_U32L:
case VLC_CODEC_U32B:
case VLC_CODEC_S32L:
case VLC_CODEC_S32B:
case VLC_CODEC_F32L:
......
......@@ -1283,6 +1283,10 @@ static const staticentry_t p_list_audio[] = {
B(VLC_CODEC_U24B, "PCM U24 BE"),
A("u24b"),
B(VLC_CODEC_S24L32, "PCM S24 in 32 LE"),
B(VLC_CODEC_S24B32, "PCM S24 in 32 BE"),
B(VLC_CODEC_S32L, "PCM S32 LE"),
A("s32l"),
A("23ni"), /* Quicktime */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment