[vlc-commits] packetizer: dts: add LBR header parser
Francois Cartegnie
git at videolan.org
Mon Mar 11 19:39:16 CET 2019
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Mar 11 18:28:22 2019 +0100| [60cca0eadead0682e6625f825f6c7294999a49ee] | committer: Francois Cartegnie
packetizer: dts: add LBR header parser
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=60cca0eadead0682e6625f825f6c7294999a49ee
---
modules/packetizer/dts_header.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/modules/packetizer/dts_header.c b/modules/packetizer/dts_header.c
index b06934326c..1d4ebd98a1 100644
--- a/modules/packetizer/dts_header.c
+++ b/modules/packetizer/dts_header.c
@@ -259,6 +259,44 @@ static int dts_header_ParseSubstream( vlc_dts_header_t *p_header,
return VLC_SUCCESS;
}
+static int dts_header_ParseLBRExtSubstream( vlc_dts_header_t *p_header,
+ const void *p_buffer )
+{
+ bs_t s;
+ bs_init( &s, p_buffer, VLC_DTS_HEADER_SIZE );
+ bs_skip( &s, 32 /*SYNCEXTSSH*/ );
+ uint8_t ucFmtInfoCode = bs_read( &s, 8 );
+ if( ucFmtInfoCode != 0x02 /*LBR_HDRCODE_DECODERINIT*/ )
+ return VLC_EGENERIC;
+ p_header->i_rate = bs_read( &s, 8 );
+ /* See ETSI TS 102 114, table 9-3 */
+ const unsigned int LBRsamplerates[] = {
+ 8000, 16000, 32000,
+ 0, 0,
+ 22050, 44100,
+ 0, 0, 0,
+ 12000, 24000, 48000,
+ };
+ if(p_header->i_rate >= ARRAY_SIZE(LBRsamplerates))
+ return VLC_EGENERIC;
+ p_header->i_rate = LBRsamplerates[p_header->i_rate];
+ if( p_header->i_rate < 16000 )
+ p_header->i_frame_length = 1024;
+ else if( p_header->i_rate < 32000 )
+ p_header->i_frame_length = 2048;
+ else
+ p_header->i_frame_length = 4096;
+
+ uint16_t i_spkrmask = bs_read( &s, 16 );
+ bs_skip( &s, 16 );
+ bs_skip( &s, 8 );
+ bs_skip( &s, 8 );
+ bs_skip( &s, 16 );
+ bs_skip( &s, 16 );
+
+ return VLC_SUCCESS;
+}
+
static int dts_header_ParseCore( vlc_dts_header_t *p_header,
const void *p_buffer)
{
More information about the vlc-commits
mailing list