From 104abea6469dd290c77b9d3916d3dadac52d4f04 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Thu, 12 May 2022 13:44:21 +0200 Subject: avcodec/ac3: Move non-(de|en)coder-only parts out of ac3.h Move AC3HeaderInfo into ac3_parser_internal.h and the rest into a new header ac3defs.h. This also breaks an include cycle of ac3.h and ac3tab.h (the latter now only needs ac3defs.h). Signed-off-by: Andreas Rheinhardt --- libavcodec/ac3_parser_internal.h | 41 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'libavcodec/ac3_parser_internal.h') diff --git a/libavcodec/ac3_parser_internal.h b/libavcodec/ac3_parser_internal.h index 3648802a73..dd57dc95a6 100644 --- a/libavcodec/ac3_parser_internal.h +++ b/libavcodec/ac3_parser_internal.h @@ -21,9 +21,48 @@ #ifndef AVCODEC_AC3_PARSER_INTERNAL_H #define AVCODEC_AC3_PARSER_INTERNAL_H -#include "ac3.h" +#include +#include + +#include "ac3defs.h" #include "get_bits.h" +/** + * @struct AC3HeaderInfo + * Coded AC-3 header values up to the lfeon element, plus derived values. + */ +typedef struct AC3HeaderInfo { + /** @name Coded elements + * @{ + */ + uint16_t sync_word; + uint16_t crc1; + uint8_t sr_code; + uint8_t bitstream_id; + uint8_t bitstream_mode; + uint8_t channel_mode; + uint8_t lfe_on; + uint8_t frame_type; + int substreamid; ///< substream identification + int center_mix_level; ///< Center mix level index + int surround_mix_level; ///< Surround mix level index + uint16_t channel_map; + int num_blocks; ///< number of audio blocks + int dolby_surround_mode; + /** @} */ + + /** @name Derived values + * @{ + */ + uint8_t sr_shift; + uint16_t sample_rate; + uint32_t bit_rate; + uint8_t channels; + uint16_t frame_size; + uint64_t channel_layout; + /** @} */ +} AC3HeaderInfo; + /** * Parse AC-3 frame header. * Parse the header up to the lfeon element, which is the first 52 or 54 bits -- cgit v1.2.3