FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
dca.h File Reference
#include <stdint.h>
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "get_bits.h"

Go to the source code of this file.

Data Structures

struct  DCACoreFrameHeader
 

Macros

#define DCA_CORE_FRAME_HEADER_SIZE   18
 
#define DCA_SPEAKER_LAYOUT_MONO   (DCA_SPEAKER_MASK_C)
 
#define DCA_SPEAKER_LAYOUT_STEREO   (DCA_SPEAKER_MASK_L | DCA_SPEAKER_MASK_R)
 
#define DCA_SPEAKER_LAYOUT_2POINT1   (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_LFE1)
 
#define DCA_SPEAKER_LAYOUT_3_0   (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_C)
 
#define DCA_SPEAKER_LAYOUT_2_1   (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_Cs)
 
#define DCA_SPEAKER_LAYOUT_3_1   (DCA_SPEAKER_LAYOUT_3_0 | DCA_SPEAKER_MASK_Cs)
 
#define DCA_SPEAKER_LAYOUT_2_2   (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_Ls | DCA_SPEAKER_MASK_Rs)
 
#define DCA_SPEAKER_LAYOUT_5POINT0   (DCA_SPEAKER_LAYOUT_3_0 | DCA_SPEAKER_MASK_Ls | DCA_SPEAKER_MASK_Rs)
 
#define DCA_SPEAKER_LAYOUT_5POINT1   (DCA_SPEAKER_LAYOUT_5POINT0 | DCA_SPEAKER_MASK_LFE1)
 
#define DCA_SPEAKER_LAYOUT_7POINT0_WIDE   (DCA_SPEAKER_LAYOUT_5POINT0 | DCA_SPEAKER_MASK_Lw | DCA_SPEAKER_MASK_Rw)
 
#define DCA_SPEAKER_LAYOUT_7POINT1_WIDE   (DCA_SPEAKER_LAYOUT_7POINT0_WIDE | DCA_SPEAKER_MASK_LFE1)
 
#define DCA_HAS_STEREO(mask)   ((mask & DCA_SPEAKER_LAYOUT_STEREO) == DCA_SPEAKER_LAYOUT_STEREO)
 

Enumerations

enum  DCAParseError {
  DCA_PARSE_ERROR_SYNC_WORD = -1, DCA_PARSE_ERROR_DEFICIT_SAMPLES = -2, DCA_PARSE_ERROR_PCM_BLOCKS = -3, DCA_PARSE_ERROR_FRAME_SIZE = -4,
  DCA_PARSE_ERROR_AMODE = -5, DCA_PARSE_ERROR_SAMPLE_RATE = -6, DCA_PARSE_ERROR_RESERVED_BIT = -7, DCA_PARSE_ERROR_LFE_FLAG = -8,
  DCA_PARSE_ERROR_PCM_RES = -9, DCA_PARSE_ERROR_INVALIDDATA = -10
}
 
enum  DCASpeaker {
  DCA_SPEAKER_C, DCA_SPEAKER_L, DCA_SPEAKER_R, DCA_SPEAKER_Ls,
  DCA_SPEAKER_Rs, DCA_SPEAKER_LFE1, DCA_SPEAKER_Cs, DCA_SPEAKER_Lsr,
  DCA_SPEAKER_Rsr, DCA_SPEAKER_Lss, DCA_SPEAKER_Rss, DCA_SPEAKER_Lc,
  DCA_SPEAKER_Rc, DCA_SPEAKER_Lh, DCA_SPEAKER_Ch, DCA_SPEAKER_Rh,
  DCA_SPEAKER_LFE2, DCA_SPEAKER_Lw, DCA_SPEAKER_Rw, DCA_SPEAKER_Oh,
  DCA_SPEAKER_Lhs, DCA_SPEAKER_Rhs, DCA_SPEAKER_Chr, DCA_SPEAKER_Lhr,
  DCA_SPEAKER_Rhr, DCA_SPEAKER_Cl, DCA_SPEAKER_Ll, DCA_SPEAKER_Rl,
  DCA_SPEAKER_RSV1, DCA_SPEAKER_RSV2, DCA_SPEAKER_RSV3, DCA_SPEAKER_RSV4,
  DCA_SPEAKER_COUNT
}
 
enum  DCASpeakerMask {
  DCA_SPEAKER_MASK_C = 0x00000001, DCA_SPEAKER_MASK_L = 0x00000002, DCA_SPEAKER_MASK_R = 0x00000004, DCA_SPEAKER_MASK_Ls = 0x00000008,
  DCA_SPEAKER_MASK_Rs = 0x00000010, DCA_SPEAKER_MASK_LFE1 = 0x00000020, DCA_SPEAKER_MASK_Cs = 0x00000040, DCA_SPEAKER_MASK_Lsr = 0x00000080,
  DCA_SPEAKER_MASK_Rsr = 0x00000100, DCA_SPEAKER_MASK_Lss = 0x00000200, DCA_SPEAKER_MASK_Rss = 0x00000400, DCA_SPEAKER_MASK_Lc = 0x00000800,
  DCA_SPEAKER_MASK_Rc = 0x00001000, DCA_SPEAKER_MASK_Lh = 0x00002000, DCA_SPEAKER_MASK_Ch = 0x00004000, DCA_SPEAKER_MASK_Rh = 0x00008000,
  DCA_SPEAKER_MASK_LFE2 = 0x00010000, DCA_SPEAKER_MASK_Lw = 0x00020000, DCA_SPEAKER_MASK_Rw = 0x00040000, DCA_SPEAKER_MASK_Oh = 0x00080000,
  DCA_SPEAKER_MASK_Lhs = 0x00100000, DCA_SPEAKER_MASK_Rhs = 0x00200000, DCA_SPEAKER_MASK_Chr = 0x00400000, DCA_SPEAKER_MASK_Lhr = 0x00800000,
  DCA_SPEAKER_MASK_Rhr = 0x01000000, DCA_SPEAKER_MASK_Cl = 0x02000000, DCA_SPEAKER_MASK_Ll = 0x04000000, DCA_SPEAKER_MASK_Rl = 0x08000000
}
 
enum  DCASpeakerPair {
  DCA_SPEAKER_PAIR_C = 0x0001, DCA_SPEAKER_PAIR_LR = 0x0002, DCA_SPEAKER_PAIR_LsRs = 0x0004, DCA_SPEAKER_PAIR_LFE1 = 0x0008,
  DCA_SPEAKER_PAIR_Cs = 0x0010, DCA_SPEAKER_PAIR_LhRh = 0x0020, DCA_SPEAKER_PAIR_LsrRsr = 0x0040, DCA_SPEAKER_PAIR_Ch = 0x0080,
  DCA_SPEAKER_PAIR_Oh = 0x0100, DCA_SPEAKER_PAIR_LcRc = 0x0200, DCA_SPEAKER_PAIR_LwRw = 0x0400, DCA_SPEAKER_PAIR_LssRss = 0x0800,
  DCA_SPEAKER_PAIR_LFE2 = 0x1000, DCA_SPEAKER_PAIR_LhsRhs = 0x2000, DCA_SPEAKER_PAIR_Chr = 0x4000, DCA_SPEAKER_PAIR_LhrRhr = 0x8000
}
 
enum  DCARepresentationType { DCA_REPR_TYPE_LtRt = 2, DCA_REPR_TYPE_LhRh = 3 }
 
enum  DCAExtensionMask {
  DCA_CSS_CORE = 0x001, DCA_CSS_XXCH = 0x002, DCA_CSS_X96 = 0x004, DCA_CSS_XCH = 0x008,
  DCA_CSS_MASK = 0x00f, DCA_EXSS_CORE = 0x010, DCA_EXSS_XBR = 0x020, DCA_EXSS_XXCH = 0x040,
  DCA_EXSS_X96 = 0x080, DCA_EXSS_LBR = 0x100, DCA_EXSS_XLL = 0x200, DCA_EXSS_RSV1 = 0x400,
  DCA_EXSS_RSV2 = 0x800, DCA_EXSS_MASK = 0xff0
}
 
enum  DCADownMixType {
  DCA_DMIX_TYPE_1_0, DCA_DMIX_TYPE_LoRo, DCA_DMIX_TYPE_LtRt, DCA_DMIX_TYPE_3_0,
  DCA_DMIX_TYPE_2_1, DCA_DMIX_TYPE_2_2, DCA_DMIX_TYPE_3_1, DCA_DMIX_TYPE_COUNT
}
 

Functions

static int ff_dca_count_chs_for_mask (unsigned int mask)
 Return number of individual channels in DCASpeakerPair mask. More...
 
int avpriv_dca_convert_bitstream (const uint8_t *src, int src_size, uint8_t *dst, int max_size)
 Convert bitstream to one representation based on sync marker. More...
 
int avpriv_dca_parse_core_frame_header (DCACoreFrameHeader *h, uint8_t *buf, int size)
 Parse and validate core frame header. More...
 
int ff_dca_parse_core_frame_header (DCACoreFrameHeader *h, GetBitContext *gb)
 

Variables

av_export const uint32_t avpriv_dca_sample_rates [16]
 
const uint32_t ff_dca_sampling_freqs [16]
 
const uint8_t ff_dca_freq_ranges [16]
 
const uint8_t ff_dca_bits_per_sample [8]
 

Macro Definition Documentation

#define DCA_CORE_FRAME_HEADER_SIZE   18

Definition at line 37 of file dca.h.

Referenced by dca_parse_params(), and dts_probe().

#define DCA_SPEAKER_LAYOUT_MONO   (DCA_SPEAKER_MASK_C)

Definition at line 123 of file dca.h.

#define DCA_SPEAKER_LAYOUT_STEREO   (DCA_SPEAKER_MASK_L | DCA_SPEAKER_MASK_R)
#define DCA_SPEAKER_LAYOUT_2POINT1   (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_LFE1)

Definition at line 125 of file dca.h.

#define DCA_SPEAKER_LAYOUT_3_0   (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_C)

Definition at line 126 of file dca.h.

#define DCA_SPEAKER_LAYOUT_2_1   (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_Cs)

Definition at line 127 of file dca.h.

#define DCA_SPEAKER_LAYOUT_3_1   (DCA_SPEAKER_LAYOUT_3_0 | DCA_SPEAKER_MASK_Cs)

Definition at line 128 of file dca.h.

#define DCA_SPEAKER_LAYOUT_2_2   (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_Ls | DCA_SPEAKER_MASK_Rs)

Definition at line 129 of file dca.h.

#define DCA_SPEAKER_LAYOUT_5POINT0   (DCA_SPEAKER_LAYOUT_3_0 | DCA_SPEAKER_MASK_Ls | DCA_SPEAKER_MASK_Rs)

Definition at line 130 of file dca.h.

Referenced by dcadec_init(), and parse_sub_headers().

#define DCA_SPEAKER_LAYOUT_5POINT1   (DCA_SPEAKER_LAYOUT_5POINT0 | DCA_SPEAKER_MASK_LFE1)

Definition at line 131 of file dca.h.

Referenced by dcadec_init(), and parse_sub_headers().

#define DCA_SPEAKER_LAYOUT_7POINT0_WIDE   (DCA_SPEAKER_LAYOUT_5POINT0 | DCA_SPEAKER_MASK_Lw | DCA_SPEAKER_MASK_Rw)

Definition at line 132 of file dca.h.

Referenced by ff_dca_set_channel_layout().

#define DCA_SPEAKER_LAYOUT_7POINT1_WIDE   (DCA_SPEAKER_LAYOUT_7POINT0_WIDE | DCA_SPEAKER_MASK_LFE1)

Definition at line 133 of file dca.h.

Referenced by ff_dca_set_channel_layout().

#define DCA_HAS_STEREO (   mask)    ((mask & DCA_SPEAKER_LAYOUT_STEREO) == DCA_SPEAKER_LAYOUT_STEREO)

Enumeration Type Documentation

Enumerator
DCA_PARSE_ERROR_SYNC_WORD 
DCA_PARSE_ERROR_DEFICIT_SAMPLES 
DCA_PARSE_ERROR_PCM_BLOCKS 
DCA_PARSE_ERROR_FRAME_SIZE 
DCA_PARSE_ERROR_AMODE 
DCA_PARSE_ERROR_SAMPLE_RATE 
DCA_PARSE_ERROR_RESERVED_BIT 
DCA_PARSE_ERROR_LFE_FLAG 
DCA_PARSE_ERROR_PCM_RES 
DCA_PARSE_ERROR_INVALIDDATA 

Definition at line 39 of file dca.h.

enum DCASpeaker
Enumerator
DCA_SPEAKER_C 
DCA_SPEAKER_L 
DCA_SPEAKER_R 
DCA_SPEAKER_Ls 
DCA_SPEAKER_Rs 
DCA_SPEAKER_LFE1 
DCA_SPEAKER_Cs 
DCA_SPEAKER_Lsr 
DCA_SPEAKER_Rsr 
DCA_SPEAKER_Lss 
DCA_SPEAKER_Rss 
DCA_SPEAKER_Lc 
DCA_SPEAKER_Rc 
DCA_SPEAKER_Lh 
DCA_SPEAKER_Ch 
DCA_SPEAKER_Rh 
DCA_SPEAKER_LFE2 
DCA_SPEAKER_Lw 
DCA_SPEAKER_Rw 
DCA_SPEAKER_Oh 
DCA_SPEAKER_Lhs 
DCA_SPEAKER_Rhs 
DCA_SPEAKER_Chr 
DCA_SPEAKER_Lhr 
DCA_SPEAKER_Rhr 
DCA_SPEAKER_Cl 
DCA_SPEAKER_Ll 
DCA_SPEAKER_Rl 
DCA_SPEAKER_RSV1 
DCA_SPEAKER_RSV2 
DCA_SPEAKER_RSV3 
DCA_SPEAKER_RSV4 
DCA_SPEAKER_COUNT 

Definition at line 79 of file dca.h.

Enumerator
DCA_SPEAKER_MASK_C 
DCA_SPEAKER_MASK_L 
DCA_SPEAKER_MASK_R 
DCA_SPEAKER_MASK_Ls 
DCA_SPEAKER_MASK_Rs 
DCA_SPEAKER_MASK_LFE1 
DCA_SPEAKER_MASK_Cs 
DCA_SPEAKER_MASK_Lsr 
DCA_SPEAKER_MASK_Rsr 
DCA_SPEAKER_MASK_Lss 
DCA_SPEAKER_MASK_Rss 
DCA_SPEAKER_MASK_Lc 
DCA_SPEAKER_MASK_Rc 
DCA_SPEAKER_MASK_Lh 
DCA_SPEAKER_MASK_Ch 
DCA_SPEAKER_MASK_Rh 
DCA_SPEAKER_MASK_LFE2 
DCA_SPEAKER_MASK_Lw 
DCA_SPEAKER_MASK_Rw 
DCA_SPEAKER_MASK_Oh 
DCA_SPEAKER_MASK_Lhs 
DCA_SPEAKER_MASK_Rhs 
DCA_SPEAKER_MASK_Chr 
DCA_SPEAKER_MASK_Lhr 
DCA_SPEAKER_MASK_Rhr 
DCA_SPEAKER_MASK_Cl 
DCA_SPEAKER_MASK_Ll 
DCA_SPEAKER_MASK_Rl 

Definition at line 92 of file dca.h.

Enumerator
DCA_SPEAKER_PAIR_C 
DCA_SPEAKER_PAIR_LR 
DCA_SPEAKER_PAIR_LsRs 
DCA_SPEAKER_PAIR_LFE1 
DCA_SPEAKER_PAIR_Cs 
DCA_SPEAKER_PAIR_LhRh 
DCA_SPEAKER_PAIR_LsrRsr 
DCA_SPEAKER_PAIR_Ch 
DCA_SPEAKER_PAIR_Oh 
DCA_SPEAKER_PAIR_LcRc 
DCA_SPEAKER_PAIR_LwRw 
DCA_SPEAKER_PAIR_LssRss 
DCA_SPEAKER_PAIR_LFE2 
DCA_SPEAKER_PAIR_LhsRhs 
DCA_SPEAKER_PAIR_Chr 
DCA_SPEAKER_PAIR_LhrRhr 

Definition at line 138 of file dca.h.

Enumerator
DCA_REPR_TYPE_LtRt 
DCA_REPR_TYPE_LhRh 

Definition at line 165 of file dca.h.

Enumerator
DCA_CSS_CORE 
DCA_CSS_XXCH 
DCA_CSS_X96 
DCA_CSS_XCH 
DCA_CSS_MASK 
DCA_EXSS_CORE 
DCA_EXSS_XBR 
DCA_EXSS_XXCH 
DCA_EXSS_X96 
DCA_EXSS_LBR 
DCA_EXSS_XLL 
DCA_EXSS_RSV1 
DCA_EXSS_RSV2 
DCA_EXSS_MASK 

Definition at line 170 of file dca.h.

Enumerator
DCA_DMIX_TYPE_1_0 
DCA_DMIX_TYPE_LoRo 
DCA_DMIX_TYPE_LtRt 
DCA_DMIX_TYPE_3_0 
DCA_DMIX_TYPE_2_1 
DCA_DMIX_TYPE_2_2 
DCA_DMIX_TYPE_3_1 
DCA_DMIX_TYPE_COUNT 

Definition at line 187 of file dca.h.

Function Documentation

static int ff_dca_count_chs_for_mask ( unsigned int  mask)
inlinestatic

Return number of individual channels in DCASpeakerPair mask.

Definition at line 160 of file dca.h.

Referenced by dtshd_read_header(), ff_dca_exss_parse(), parse_decoder_init(), and parse_descriptor().

int avpriv_dca_convert_bitstream ( const uint8_t src,
int  src_size,
uint8_t dst,
int  max_size 
)

Convert bitstream to one representation based on sync marker.

Definition at line 54 of file dca.c.

Referenced by dca_parse_params(), dcadec_decode_frame(), and dts_probe().

int avpriv_dca_parse_core_frame_header ( DCACoreFrameHeader h,
uint8_t buf,
int  size 
)

Parse and validate core frame header.

Returns
0 on success, negative DCA_PARSE_ERROR_ code on failure

Definition at line 149 of file dca.c.

Referenced by dca_parse_params(), and dts_probe().

int ff_dca_parse_core_frame_header ( DCACoreFrameHeader h,
GetBitContext gb 
)

Definition at line 91 of file dca.c.

Referenced by avpriv_dca_parse_core_frame_header(), and parse_frame_header().

Variable Documentation

av_export const uint32_t avpriv_dca_sample_rates[16]
const uint32_t ff_dca_sampling_freqs[16]

Definition at line 41 of file dca.c.

Referenced by chs_parse_header(), dca_parse_params(), parse_decoder_init(), and parse_descriptor().

const uint8_t ff_dca_freq_ranges[16]

Definition at line 46 of file dca.c.

Referenced by dca_parse_params(), and parse_decoder_init().

const uint8_t ff_dca_bits_per_sample[8]

Definition at line 50 of file dca.c.

Referenced by ff_dca_parse_core_frame_header(), and parse_frame_header().