summaryrefslogtreecommitdiff
path: root/libavcodec/dolby_e.h
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-01-25 11:29:27 -0300
committerJames Almer <jamrial@gmail.com>2021-01-25 16:45:20 -0300
commit81d070dd09ce154d635414fd07d80a591266b421 (patch)
tree0ca751f25ec99b6fa69be602ee6c506ae111083c /libavcodec/dolby_e.h
parent12c8aeb2b822f8acec5a94ed4591ec6db9994c74 (diff)
avcodec/dolby_e: split decoder and parser more thoroughly
Neither module should depend on the other. Move shared functions to its own file for this purpose, and ensure source files are compiled only when the required modules are enabled. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/dolby_e.h')
-rw-r--r--libavcodec/dolby_e.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/libavcodec/dolby_e.h b/libavcodec/dolby_e.h
index 855d978bc2..d7fac94fd9 100644
--- a/libavcodec/dolby_e.h
+++ b/libavcodec/dolby_e.h
@@ -21,6 +21,7 @@
#ifndef AVCODEC_DOLBY_E_H
#define AVCODEC_DOLBY_E_H
+#include <stdint.h>
#include "get_bits.h"
#define FRAME_SAMPLES 1792
@@ -81,5 +82,23 @@ typedef struct DolbyEHeaderInfo {
static const uint16_t sample_rate_tab[16] = {
0, 42965, 43008, 44800, 53706, 53760
};
+/**
+ * Initialize DBEContext.
+ * Set word_bits/word_bytes, input, input_size, key_present.
+ * @param[out] s DBEContext.
+ * @param[in] buf raw input buffer.
+ * @param[in] buf_size must be 3 bytes at least.
+ * @return Returns 0 on success, AVERROR_INVALIDDATA on error
+ */
+int ff_dolby_e_parse_init(DBEContext *s, const uint8_t *buf, int buf_size);
+
+/**
+ * Parse Dolby E metadata.
+ * Parse the header up to the end_gain element.
+ * @param[in] s DBEContext .
+ * @param[out] hdr Pointer to struct where header info is written.
+ * @return Returns 0 on success, AVERROR_INVALIDDATA on error
+ */
+int ff_dolby_e_parse_header(DBEContext *s, DolbyEHeaderInfo *hdr);
#endif