[vlc-commits] Add codecs for S24 in 4 bytes
Rémi Denis-Courmont
git at videolan.org
Thu Dec 20 19:20:58 CET 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Dec 20 20:15:55 2012 +0200| [dc9fa2ed90ebf213d9d862784ba353861b531957] | committer: Rémi Denis-Courmont
Add codecs for S24 in 4 bytes
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dc9fa2ed90ebf213d9d862784ba353861b531957
---
include/vlc_fourcc.h | 2 ++
modules/codec/araw.c | 34 ++++++++++++++++++++++++++++++++++
src/audio_output/common.c | 4 ++++
src/misc/fourcc.c | 4 ++++
4 files changed, 44 insertions(+)
diff --git a/include/vlc_fourcc.h b/include/vlc_fourcc.h
index 391a9a2..603db0d 100644
--- a/include/vlc_fourcc.h
+++ b/include/vlc_fourcc.h
@@ -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')
diff --git a/modules/codec/araw.c b/modules/codec/araw.c
index 3ef2c92..78166cc 100644
--- a/modules/codec/araw.c
+++ b/modules/codec/araw.c
@@ -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;
diff --git a/src/audio_output/common.c b/src/audio_output/common.c
index 3f16894..f5a0fc1 100644
--- a/src/audio_output/common.c
+++ b/src/audio_output/common.c
@@ -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:
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index 1ac3300..afd89af 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -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 */
More information about the vlc-commits
mailing list