summaryrefslogtreecommitdiff
path: root/libavcodec/ac3_parser_internal.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-12 13:44:21 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-15 18:13:56 +0200
commit104abea6469dd290c77b9d3916d3dadac52d4f04 (patch)
treef93d2fe048cdf4d6f8067e3ffeba542c02df0844 /libavcodec/ac3_parser_internal.h
parentcbd75ecc18db15f38f101991599f83af3ff48deb (diff)
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 <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/ac3_parser_internal.h')
-rw-r--r--libavcodec/ac3_parser_internal.h41
1 files changed, 40 insertions, 1 deletions
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,10 +21,49 @@
#ifndef AVCODEC_AC3_PARSER_INTERNAL_H
#define AVCODEC_AC3_PARSER_INTERNAL_H
-#include "ac3.h"
+#include <stddef.h>
+#include <stdint.h>
+
+#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
* depending on the audio coding mode.