Commit 0bf18db2 authored by Nicolas Gaullier's avatar Nicolas Gaullier Committed by Paul B Mahol

avcodec/dolby_e: Add a parser

parent a2a06029
...@@ -57,6 +57,7 @@ version <next>: ...@@ -57,6 +57,7 @@ version <next>:
- tmidequalizer filter - tmidequalizer filter
- estdif filter - estdif filter
- epx filter - epx filter
- Dolby E parser
version 4.3: version 4.3:
......
This diff is collapsed.
...@@ -75,16 +75,27 @@ typedef struct DBEChannel { ...@@ -75,16 +75,27 @@ typedef struct DBEChannel {
} DBEChannel; } DBEChannel;
typedef struct DBEContext { typedef struct DBEContext {
AVCodecContext *avctx; void *avctx;
GetBitContext gb; GetBitContext gb;
uint8_t *input; const uint8_t *input;
int input_size; int input_size;
int word_bits; int word_bits;
int word_bytes; int word_bytes;
int key_present; int key_present;
uint8_t buffer[1024 * 3 + AV_INPUT_BUFFER_PADDING_SIZE];
} DBEContext;
/**
* @struct DolbyEHeaderInfo
* Coded Dolby E header values up to end_gain element, plus derived values.
*/
typedef struct DolbyEHeaderInfo {
/** @name Coded elements
* @{
*/
int prog_conf; int prog_conf;
int nb_channels; int nb_channels;
int nb_programs; int nb_programs;
...@@ -99,8 +110,27 @@ typedef struct DBEContext { ...@@ -99,8 +110,27 @@ typedef struct DBEContext {
int rev_id[MAX_CHANNELS]; int rev_id[MAX_CHANNELS];
int begin_gain[MAX_CHANNELS]; int begin_gain[MAX_CHANNELS];
int end_gain[MAX_CHANNELS]; int end_gain[MAX_CHANNELS];
/** @} */
/** @name Derived values
* @{
*/
int multi_prog_warned; int multi_prog_warned;
/** @} */
} DolbyEHeaderInfo;
typedef struct DBEParseContext {
ParseContext pc;
DBEContext dectx;
DolbyEHeaderInfo metadata;
} DBEParseContext;
typedef struct DBEDecodeContext {
AVCodecContext *avctx;
DBEContext dectx;
DolbyEHeaderInfo metadata;
DBEChannel channels[MAX_SEGMENTS][MAX_CHANNELS]; DBEChannel channels[MAX_SEGMENTS][MAX_CHANNELS];
...@@ -108,9 +138,7 @@ typedef struct DBEContext { ...@@ -108,9 +138,7 @@ typedef struct DBEContext {
FFTContext imdct[3]; FFTContext imdct[3];
AVFloatDSPContext *fdsp; AVFloatDSPContext *fdsp;
} DBEDecodeContext;
uint8_t buffer[1024 * 3 + AV_INPUT_BUFFER_PADDING_SIZE];
} DBEContext;
static const uint8_t nb_programs_tab[MAX_PROG_CONF + 1] = { static const uint8_t nb_programs_tab[MAX_PROG_CONF + 1] = {
2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 8, 1, 2, 3, 3, 4, 5, 6, 1, 2, 3, 4, 1, 1 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 8, 1, 2, 3, 3, 4, 5, 6, 1, 2, 3, 4, 1, 1
......
...@@ -36,6 +36,7 @@ extern AVCodecParser ff_cook_parser; ...@@ -36,6 +36,7 @@ extern AVCodecParser ff_cook_parser;
extern AVCodecParser ff_dca_parser; extern AVCodecParser ff_dca_parser;
extern AVCodecParser ff_dirac_parser; extern AVCodecParser ff_dirac_parser;
extern AVCodecParser ff_dnxhd_parser; extern AVCodecParser ff_dnxhd_parser;
extern AVCodecParser ff_dolby_e_parser;
extern AVCodecParser ff_dpx_parser; extern AVCodecParser ff_dpx_parser;
extern AVCodecParser ff_dvaudio_parser; extern AVCodecParser ff_dvaudio_parser;
extern AVCodecParser ff_dvbsub_parser; extern AVCodecParser ff_dvbsub_parser;
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#include "libavutil/version.h" #include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 58 #define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 117 #define LIBAVCODEC_VERSION_MINOR 118
#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \ LIBAVCODEC_VERSION_MINOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment