FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
mlp_parser.c File Reference

MLP parser. More...

#include <stdint.h>
#include "libavutil/channel_layout.h"
#include "libavutil/crc.h"
#include "libavutil/internal.h"
#include "get_bits.h"
#include "parser.h"
#include "mlp_parser.h"
#include "mlp.h"

Go to the source code of this file.

Data Structures

struct  MLPParseContext
 

Functions

static int mlp_samplerate (int in)
 
static int truehd_channels (int chanmap)
 
uint64_t ff_truehd_layout (int chanmap)
 
static int ff_mlp_get_major_sync_size (const uint8_t *buf, int bufsize)
 
int ff_mlp_read_major_sync (void *log, MLPHeaderInfo *mh, GetBitContext *gb)
 Read a major sync info header - contains high level information about the stream - sample rate, channel arrangement etc. More...
 
static av_cold int mlp_init (AVCodecParserContext *s)
 
static int mlp_parse (AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
 

Variables

static const uint8_t mlp_quants [16]
 
static const uint8_t mlp_channels [32]
 
const uint64_t ff_mlp_layout [32]
 
static const uint8_t thd_chancount [13]
 
static const uint64_t thd_layout [13]
 
AVCodecParser ff_mlp_parser
 

Detailed Description

MLP parser.

Definition in file mlp_parser.c.

Function Documentation

static int mlp_samplerate ( int  in)
static

Definition at line 93 of file mlp_parser.c.

Referenced by ff_mlp_read_major_sync().

static int truehd_channels ( int  chanmap)
static

Definition at line 101 of file mlp_parser.c.

Referenced by ff_mlp_read_major_sync().

uint64_t ff_truehd_layout ( int  chanmap)

Definition at line 111 of file mlp_parser.c.

Referenced by ff_mlp_read_major_sync().

static int ff_mlp_get_major_sync_size ( const uint8_t buf,
int  bufsize 
)
static

Definition at line 122 of file mlp_parser.c.

Referenced by ff_mlp_read_major_sync().

int ff_mlp_read_major_sync ( void log,
MLPHeaderInfo mh,
GetBitContext gb 
)

Read a major sync info header - contains high level information about the stream - sample rate, channel arrangement etc.

Most of this information is not actually necessary for decoding, only for playback. gb must be a freshly initialized GetBitContext with no bits read.

Definition at line 145 of file mlp_parser.c.

Referenced by mlp_parse(), and read_major_sync().

static av_cold int mlp_init ( AVCodecParserContext s)
static

Definition at line 237 of file mlp_parser.c.

static int mlp_parse ( AVCodecParserContext s,
AVCodecContext avctx,
const uint8_t **  poutbuf,
int *  poutbuf_size,
const uint8_t buf,
int  buf_size 
)
static

Definition at line 243 of file mlp_parser.c.

Variable Documentation

const uint8_t mlp_quants[16]
static
Initial value:
= {
16, 20, 24, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
}

Definition at line 37 of file mlp_parser.c.

Referenced by ff_mlp_read_major_sync().

const uint8_t mlp_channels[32]
static
Initial value:
= {
1, 2, 3, 4, 3, 4, 5, 3, 4, 5, 4, 5, 6, 4, 5, 4,
5, 6, 5, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}

Definition at line 42 of file mlp_parser.c.

Referenced by ff_mlp_read_major_sync().

const uint64_t ff_mlp_layout[32]
Initial value:
= {
AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY,
AV_CH_LAYOUT_2_1|AV_CH_LOW_FREQUENCY,
AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY,
AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY,
AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY,
AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY,
AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY,
AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}
#define AV_CH_LAYOUT_SURROUND
#define AV_CH_LAYOUT_4POINT0
#define AV_CH_LAYOUT_STEREO
#define AV_CH_LOW_FREQUENCY
#define AV_CH_LAYOUT_QUAD
#define AV_CH_LAYOUT_2_1
#define AV_CH_LAYOUT_5POINT1_BACK
#define AV_CH_LAYOUT_5POINT0_BACK
#define AV_CH_LAYOUT_MONO

Definition at line 47 of file mlp_parser.c.

Referenced by ff_mlp_read_major_sync().

const uint8_t thd_chancount[13]
static
Initial value:
= {
2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1
}

Definition at line 72 of file mlp_parser.c.

Referenced by truehd_channels().

const uint64_t thd_layout[13]
static
Initial value:
= {
}
#define AV_CH_TOP_FRONT_RIGHT
#define AV_CH_TOP_FRONT_LEFT
#define AV_CH_TOP_FRONT_CENTER
#define AV_CH_LOW_FREQUENCY_2
#define AV_CH_SURROUND_DIRECT_RIGHT
#define AV_CH_WIDE_LEFT
#define AV_CH_WIDE_RIGHT
#define AV_CH_LOW_FREQUENCY
#define AV_CH_BACK_LEFT
#define AV_CH_TOP_CENTER
#define AV_CH_FRONT_LEFT_OF_CENTER
#define AV_CH_FRONT_CENTER
#define AV_CH_FRONT_RIGHT_OF_CENTER
#define AV_CH_FRONT_LEFT
#define AV_CH_BACK_CENTER
#define AV_CH_SIDE_RIGHT
#define AV_CH_SURROUND_DIRECT_LEFT
#define AV_CH_FRONT_RIGHT
#define AV_CH_SIDE_LEFT
#define AV_CH_BACK_RIGHT

Definition at line 77 of file mlp_parser.c.

Referenced by ff_truehd_layout().

AVCodecParser ff_mlp_parser
Initial value:
= {
.priv_data_size = sizeof(MLPParseContext),
.parser_init = mlp_init,
.parser_parse = mlp_parse,
.parser_close = ff_parse_close,
}
static int mlp_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition: mlp_parser.c:243
void ff_parse_close(AVCodecParserContext *s)
Definition: parser.c:321
static av_cold int mlp_init(AVCodecParserContext *s)
Definition: mlp_parser.c:237

Definition at line 407 of file mlp_parser.c.