FFmpeg
Loading...
Searching...
No Matches
dca_parser.c File Reference
#include "dca.h"
#include "dca_core.h"
#include "dca_exss.h"
#include "dca_lbr.h"
#include "dca_syncwords.h"
#include "get_bits.h"
#include "parser.h"
#include "parser_internal.h"

Go to the source code of this file.

Data Structures

struct  DCAParseContext
 

Macros

#define IS_CORE_MARKER(state)
 
#define IS_EXSS_MARKER(state)
 
#define IS_MARKER(state)
 
#define CORE_MARKER(state)
 
#define EXSS_MARKER(state)
 
#define STATE_LE(state)
 
#define STATE_14(state)
 
#define CORE_FRAMESIZE(state)
 
#define EXSS_FRAMESIZE(state)
 

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.
 
static av_cold int dca_parse_init (AVCodecParserContext *s)
 
static int dca_parse_params (DCAParseContext *pc1, const uint8_t *buf, int buf_size, int *duration, int *sample_rate, int *profile)
 
static int dca_parse (AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
 

Variables

const FFCodecParser ff_dca_parser
 

Macro Definition Documentation

◆ IS_CORE_MARKER

#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
#define DCA_SYNCWORD_CORE_LE
#define DCA_SYNCWORD_CORE_BE
#define DCA_SYNCWORD_CORE_14B_LE
static struct @346255127015250356166251341105367306144006377143 state

Definition at line 44 of file dca_parser.c.

◆ IS_EXSS_MARKER

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

Definition at line 50 of file dca_parser.c.

Referenced by dca_find_frame_end().

◆ IS_MARKER

#define IS_MARKER ( state)

◆ CORE_MARKER

#define CORE_MARKER ( state)
Value:
((state >> 16) & 0xFFFFFFFF)

Definition at line 54 of file dca_parser.c.

Referenced by dca_find_frame_end().

◆ EXSS_MARKER

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

Definition at line 55 of file dca_parser.c.

Referenced by dca_find_frame_end().

◆ STATE_LE

#define STATE_LE ( state)
Value:
(((state & 0xFF00FF00) >> 8) | ((state & 0x00FF00FF) << 8))

Definition at line 57 of file dca_parser.c.

Referenced by dca_find_frame_end().

◆ STATE_14

#define STATE_14 ( state)
Value:
(((state & 0x3FFF0000) >> 8) | ((state & 0x00003FFF) >> 6))

Definition at line 58 of file dca_parser.c.

Referenced by dca_find_frame_end().

◆ CORE_FRAMESIZE

#define CORE_FRAMESIZE ( state)
Value:
(((state >> 4) & 0x3FFF) + 1)

Definition at line 60 of file dca_parser.c.

Referenced by dca_find_frame_end().

◆ EXSS_FRAMESIZE

#define EXSS_FRAMESIZE ( state)
Value:
((state & 0x2000000000) ? \
((state >> 5) & 0xFFFFF) + 1 : \
((state >> 13) & 0x0FFFF) + 1)

Definition at line 61 of file dca_parser.c.

Referenced by dca_find_frame_end().

Function Documentation

◆ dca_find_frame_end()

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 69 of file dca_parser.c.

Referenced by dca_parse().

◆ dca_parse_init()

static av_cold int dca_parse_init ( AVCodecParserContext * s)
static

Definition at line 185 of file dca_parser.c.

◆ dca_parse_params()

static int dca_parse_params ( DCAParseContext * pc1,
const uint8_t * buf,
int buf_size,
int * duration,
int * sample_rate,
int * profile )
static

Definition at line 194 of file dca_parser.c.

Referenced by dca_parse().

◆ 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 308 of file dca_parser.c.

Variable Documentation

◆ ff_dca_parser

const FFCodecParser ff_dca_parser
Initial value:
= {
.priv_data_size = sizeof(DCAParseContext),
}
static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition apv_parser.c:92
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
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:308
static av_cold int dca_parse_init(AVCodecParserContext *s)
Definition dca_parser.c:185
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
@ AV_CODEC_ID_DTS
Definition codec_id.h:457
av_cold void ff_parse_close(AVCodecParserContext *s)
Definition parser.c:300
#define PARSER_CODEC_LIST(...)

Definition at line 348 of file dca_parser.c.