FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
dca_parser.c File Reference
#include "dca.h"
#include "dca_syncwords.h"
#include "get_bits.h"
#include "parser.h"

Go to the source code of this file.

Data Structures

struct  DCAParseContext
 

Macros

#define IS_CORE_MARKER(state)
 
#define IS_EXSS_MARKER(state)   ((state & 0xFFFFFFFF) == DCA_SYNCWORD_SUBSTREAM)
 
#define IS_MARKER(state)   (IS_CORE_MARKER(state) || IS_EXSS_MARKER(state))
 
#define CORE_MARKER(state)   ((state >> 16) & 0xFFFFFFFF)
 
#define EXSS_MARKER(state)   (state & 0xFFFFFFFF)
 

Functions

static int dca_find_frame_end (DCAParseContext *pc1, const uint8_t *buf, int buf_size)
 Find the end of the current frame in the bitstream. More...
 
static av_cold int dca_parse_init (AVCodecParserContext *s)
 
static int dca_parse_params (const uint8_t *buf, int buf_size, int *duration, int *sample_rate, int *framesize)
 
static int dca_parse (AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
 

Variables

AVCodecParser ff_dca_parser
 

Macro Definition Documentation

#define IS_CORE_MARKER (   state)
Value:
(((state & 0xFFFFFFFFF0FF) == (((uint64_t)DCA_SYNCWORD_CORE_14B_LE << 16) | 0xF007)) || \
((state & 0xFFFFFFFFFFF0) == (((uint64_t)DCA_SYNCWORD_CORE_14B_BE << 16) | 0x07F0)) || \
((state & 0xFFFFFFFF00FC) == (((uint64_t)DCA_SYNCWORD_CORE_LE << 16) | 0x00FC)) || \
((state & 0xFFFFFFFFFC00) == (((uint64_t)DCA_SYNCWORD_CORE_BE << 16) | 0xFC00)))
#define DCA_SYNCWORD_CORE_14B_BE
Definition: dca_syncwords.h:24
#define DCA_SYNCWORD_CORE_BE
Definition: dca_syncwords.h:22
#define DCA_SYNCWORD_CORE_14B_LE
Definition: dca_syncwords.h:25
#define DCA_SYNCWORD_CORE_LE
Definition: dca_syncwords.h:23
static struct @205 state

Definition at line 37 of file dca_parser.c.

#define IS_EXSS_MARKER (   state)    ((state & 0xFFFFFFFF) == DCA_SYNCWORD_SUBSTREAM)

Definition at line 43 of file dca_parser.c.

Referenced by dca_find_frame_end().

#define IS_MARKER (   state)    (IS_CORE_MARKER(state) || IS_EXSS_MARKER(state))
#define CORE_MARKER (   state)    ((state >> 16) & 0xFFFFFFFF)

Definition at line 47 of file dca_parser.c.

Referenced by dca_find_frame_end().

#define EXSS_MARKER (   state)    (state & 0xFFFFFFFF)

Definition at line 48 of file dca_parser.c.

Referenced by dca_find_frame_end().

Function Documentation

static int dca_find_frame_end ( DCAParseContext pc1,
const uint8_t buf,
int  buf_size 
)
static

Find the end of the current frame in the bitstream.

Returns
the position of the first byte of the next frame, or -1

Definition at line 54 of file dca_parser.c.

Referenced by dca_parse().

static av_cold int dca_parse_init ( AVCodecParserContext s)
static

Definition at line 104 of file dca_parser.c.

static int dca_parse_params ( const uint8_t buf,
int  buf_size,
int *  duration,
int *  sample_rate,
int *  framesize 
)
static

Definition at line 112 of file dca_parser.c.

Referenced by dca_parse().

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

Definition at line 146 of file dca_parser.c.

Variable Documentation

AVCodecParser ff_dca_parser
Initial value:
= {
.codec_ids = { AV_CODEC_ID_DTS },
.priv_data_size = sizeof(DCAParseContext),
.parser_init = dca_parse_init,
.parser_parse = dca_parse,
.parser_close = ff_parse_close,
}
static av_cold int dca_parse_init(AVCodecParserContext *s)
Definition: dca_parser.c:104
void ff_parse_close(AVCodecParserContext *s)
Definition: parser.c:319
static int dca_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition: dca_parser.c:146

Definition at line 179 of file dca_parser.c.