[vlc-devel] [PATCH V2 6/8] packetizer: detect AC-3 core + EAC3 extension
Thomas Guillem
thomas at gllm.fr
Mon Oct 7 15:46:24 CEST 2019
This will allow audio output to first try EAC3 and/or fallback to AC3.
cf. https://en.wikipedia.org/wiki/Dolby_Digital_Plus#HD_DVD_and_Blu-ray_Disc
"On Blu-ray Disc, DD+ is an optional codec, and is deployed as an extension to a
"core" AC-3 5.1 audiotrack. The AC-3 core is encoded at 640 kbit/s, carries 5
primary channels (and 1 LFE), and is independently playable as a movie audio
track by any Blu-ray Disc player. The DD+ extension bitstream is used on
players that support it by replacing the rear channels in the 5.1 setup with
higher fidelity versions, along with providing a possible channel extension to
6.1 or 7.1. The complete audio track is allowed a combined bitrate of 1.7
Mbit/s: 640 kbit/s for the AC-3 5.1 core, and 1 Mbit/s for the DD+ extension.
During playback, both the core and extension bitstreams contribute to the final
audio-output, according to rules embedded in the bitstream metadata."
---
modules/packetizer/a52.c | 4 ++++
modules/packetizer/a52.h | 2 ++
2 files changed, 6 insertions(+)
diff --git a/modules/packetizer/a52.c b/modules/packetizer/a52.c
index 91afafcf54..15890af14b 100644
--- a/modules/packetizer/a52.c
+++ b/modules/packetizer/a52.c
@@ -258,7 +258,11 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
vlc_a52_header_t a52;
if( !vlc_a52_header_Parse( &a52, p_header, VLC_A52_MIN_HEADER_SIZE )
&& a52.b_eac3 && a52.bs.eac3.strmtyp == EAC3_STRMTYP_DEPENDENT )
+ {
p_sys->i_input_size += a52.i_size;
+ p_dec->fmt_out.i_codec = VLC_CODEC_A52;
+ p_dec->fmt_out.i_profile = VLC_A52_PROFILE_EAC3_DEPENDENT;
+ }
p_sys->i_state = STATE_GET_DATA;
break;
diff --git a/modules/packetizer/a52.h b/modules/packetizer/a52.h
index 42d09dc7bd..fe04b5edf6 100644
--- a/modules/packetizer/a52.h
+++ b/modules/packetizer/a52.h
@@ -36,6 +36,8 @@
#define VLC_A52_EAC3_BSI_SIZE ((532 + 7)/8)
#define VLC_A52_EAC3_HEADER_SIZE (VLC_A52_EAC3_BSI_SIZE + 2)
+#define VLC_A52_PROFILE_EAC3_DEPENDENT 1
+
/**
* AC3 header information.
*/
--
2.20.1
More information about the vlc-devel
mailing list