FFmpeg
Loading...
Searching...
No Matches
pcm-dvda.c File Reference
#include <assert.h>
#include <stddef.h>
#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"

Go to the source code of this file.

Data Structures

struct  PCMDVDAHeader
 
struct  PCMDVDAContext
 

Macros

#define CH_C   AV_CH_FRONT_CENTER
 
#define CH_L   AV_CH_FRONT_LEFT
 
#define CH_R   AV_CH_FRONT_RIGHT
 
#define CH_LFE   AV_CH_LOW_FREQUENCY
 
#define CH_S   AV_CH_BACK_CENTER
 
#define CH_LS   AV_CH_BACK_LEFT
 
#define CH_RS   AV_CH_BACK_RIGHT
 

Functions

static av_cold int pcm_dvda_decode_init (AVCodecContext *avctx)
 
static int pcm_dvda_parse_header (AVCodecContext *avctx, const PCMDVDAHeader *header)
 
static void pcm_dvda_decode_samples (AVCodecContext *avctx, GetByteContext *gb, void *dst, int blocks)
 
static int pcm_dvda_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 

Variables

struct { 
 
   uint8_t   group1_channels 
 
   uint8_t   group2_channels 
 
   uint64_t   channels [6] 
 
channel_assignments [21] 
 
const FFCodec ff_pcm_dvda_decoder
 

Macro Definition Documentation

◆ CH_C

#define CH_C   AV_CH_FRONT_CENTER

Definition at line 89 of file pcm-dvda.c.

◆ CH_L

#define CH_L   AV_CH_FRONT_LEFT

Definition at line 90 of file pcm-dvda.c.

◆ CH_R

#define CH_R   AV_CH_FRONT_RIGHT

Definition at line 91 of file pcm-dvda.c.

◆ CH_LFE

#define CH_LFE   AV_CH_LOW_FREQUENCY

Definition at line 92 of file pcm-dvda.c.

◆ CH_S

#define CH_S   AV_CH_BACK_CENTER

Definition at line 93 of file pcm-dvda.c.

◆ CH_LS

#define CH_LS   AV_CH_BACK_LEFT

Definition at line 94 of file pcm-dvda.c.

◆ CH_RS

#define CH_RS   AV_CH_BACK_RIGHT

Definition at line 95 of file pcm-dvda.c.

Function Documentation

◆ pcm_dvda_decode_init()

static av_cold int pcm_dvda_decode_init ( AVCodecContext * avctx)
static

Definition at line 134 of file pcm-dvda.c.

◆ pcm_dvda_parse_header()

static int pcm_dvda_parse_header ( AVCodecContext * avctx,
const PCMDVDAHeader * header )
static

Definition at line 144 of file pcm-dvda.c.

Referenced by pcm_dvda_decode_frame().

◆ pcm_dvda_decode_samples()

static void pcm_dvda_decode_samples ( AVCodecContext * avctx,
GetByteContext * gb,
void * dst,
int blocks )
static

Definition at line 252 of file pcm-dvda.c.

Referenced by pcm_dvda_decode_frame().

◆ pcm_dvda_decode_frame()

static int pcm_dvda_decode_frame ( AVCodecContext * avctx,
AVFrame * frame,
int * got_frame_ptr,
AVPacket * avpkt )
static

Definition at line 291 of file pcm-dvda.c.

Variable Documentation

◆ group1_channels

uint8_t group1_channels

Definition at line 107 of file pcm-dvda.c.

◆ group2_channels

uint8_t group2_channels

Definition at line 108 of file pcm-dvda.c.

◆ channels

uint64_t channels[6]

Definition at line 109 of file pcm-dvda.c.

◆ [struct]

const struct { ... } channel_assignments[21]
Initial value:
= {
[ 0] = { 1, 0, { CH_C } },
[ 1] = { 2, 0, { CH_L, CH_R } },
[ 2] = { 2, 1, { CH_L, CH_R, CH_S } },
[ 3] = { 2, 2, { CH_L, CH_R, CH_LS, CH_RS } },
[ 4] = { 2, 1, { CH_L, CH_R, CH_LFE } },
[ 5] = { 2, 2, { CH_L, CH_R, CH_LFE, CH_S } },
[ 6] = { 2, 3, { CH_L, CH_R, CH_LFE, CH_LS, CH_RS } },
[ 7] = { 2, 1, { CH_L, CH_R, CH_C } },
[ 8] = { 2, 2, { CH_L, CH_R, CH_C, CH_S } },
[ 9] = { 2, 3, { CH_L, CH_R, CH_C, CH_LS, CH_RS } },
[10] = { 2, 2, { CH_L, CH_R, CH_C, CH_LFE } },
[11] = { 2, 3, { CH_L, CH_R, CH_C, CH_LFE, CH_S } },
[12] = { 2, 4, { CH_L, CH_R, CH_C, CH_LFE, CH_LS, CH_RS } },
[13] = { 3, 1, { CH_L, CH_R, CH_C, CH_S } },
[14] = { 3, 2, { CH_L, CH_R, CH_C, CH_LS, CH_RS } },
[15] = { 3, 1, { CH_L, CH_R, CH_C, CH_LFE } },
[16] = { 3, 2, { CH_L, CH_R, CH_C, CH_LFE, CH_S } },
[17] = { 3, 3, { CH_L, CH_R, CH_C, CH_LFE, CH_LS, CH_RS } },
[18] = { 4, 1, { CH_L, CH_R, CH_LS, CH_RS, CH_LFE } },
[19] = { 4, 1, { CH_L, CH_R, CH_LS, CH_RS, CH_C } },
[20] = { 4, 2, { CH_L, CH_R, CH_LS, CH_RS, CH_C, CH_LFE } },
}
#define CH_RS
Definition pcm-dvda.c:95
#define CH_C
Definition pcm-dvda.c:89
#define CH_R
Definition pcm-dvda.c:91
#define CH_L
Definition pcm-dvda.c:90
#define CH_S
Definition pcm-dvda.c:93
#define CH_LFE
Definition pcm-dvda.c:92
#define CH_LS
Definition pcm-dvda.c:94

Referenced by pcm_dvda_parse_header().

◆ ff_pcm_dvda_decoder

const FFCodec ff_pcm_dvda_decoder
Initial value:
= {
.p.name = "pcm_dvda",
CODEC_LONG_NAME("PCM signed 16|20|24-bit big-endian for DVD-Audio media"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(PCMDVDAContext),
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
}
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition codec.h:94
@ AV_CODEC_ID_PCM_DVDA
Definition codec_id.h:367
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
static int pcm_dvda_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition pcm-dvda.c:291
static av_cold int pcm_dvda_decode_init(AVCodecContext *avctx)
Definition pcm-dvda.c:134

Definition at line 343 of file pcm-dvda.c.