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

Direct Stream Transfer (DST) decoder ISO/IEC 14496-3 Part 3 Subpart 10: Technical description of lossless coding of oversampled audio. More...

#include "libavutil/avassert.h"
#include "libavutil/intreadwrite.h"
#include "internal.h"
#include "get_bits.h"
#include "avcodec.h"
#include "golomb.h"
#include "mathops.h"
#include "dsd.h"

Go to the source code of this file.

Data Structures

struct  ArithCoder
 
struct  Table
 
struct  DSTContext
 

Macros

#define DST_MAX_CHANNELS   6
 
#define DST_MAX_ELEMENTS   (2 * DST_MAX_CHANNELS)
 
#define DSD_FS44(sample_rate)   (sample_rate * 8 / 44100)
 
#define DST_SAMPLES_PER_FRAME(sample_rate)   (588 * DSD_FS44(sample_rate))
 
#define F(x)   filter[(x)][status[(x)]]
 

Functions

static av_cold int decode_init (AVCodecContext *avctx)
 
static int read_map (GetBitContext *gb, Table *t, unsigned int map[DST_MAX_CHANNELS], int channels)
 
static av_always_inline int get_sr_golomb_dst (GetBitContext *gb, unsigned int k)
 
static void read_uncoded_coeff (GetBitContext *gb, int *dst, unsigned int elements, int coeff_bits, int is_signed, int offset)
 
static int read_table (GetBitContext *gb, Table *t, const int8_t code_pred_coeff[3][3], int length_bits, int coeff_bits, int is_signed, int offset)
 
static void ac_init (ArithCoder *ac, GetBitContext *gb)
 
static av_always_inline void ac_get (ArithCoder *ac, GetBitContext *gb, int p, int *e)
 
static uint8_t prob_dst_x_bit (int c)
 
static void build_filter (int16_t table[DST_MAX_ELEMENTS][16][256], const Table *fsets)
 
static int decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 

Variables

static const int8_t fsets_code_pred_coeff [3][3]
 
static const int8_t probs_code_pred_coeff [3][3]
 
AVCodec ff_dst_decoder
 

Detailed Description

Direct Stream Transfer (DST) decoder ISO/IEC 14496-3 Part 3 Subpart 10: Technical description of lossless coding of oversampled audio.

Definition in file dstdec.c.

Macro Definition Documentation

#define DST_MAX_CHANNELS   6

Definition at line 37 of file dstdec.c.

Referenced by decode_frame(), and decode_init().

#define DST_MAX_ELEMENTS   (2 * DST_MAX_CHANNELS)

Definition at line 38 of file dstdec.c.

Referenced by read_map().

#define DSD_FS44 (   sample_rate)    (sample_rate * 8 / 44100)

Definition at line 40 of file dstdec.c.

#define DST_SAMPLES_PER_FRAME (   sample_rate)    (588 * DSD_FS44(sample_rate))

Definition at line 42 of file dstdec.c.

Referenced by decode_frame().

#define F (   x)    filter[(x)][status[(x)]]

Function Documentation

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 78 of file dstdec.c.

static int read_map ( GetBitContext gb,
Table t,
unsigned int  map[DST_MAX_CHANNELS],
int  channels 
)
static

Definition at line 98 of file dstdec.c.

Referenced by decode_frame().

static av_always_inline int get_sr_golomb_dst ( GetBitContext gb,
unsigned int  k 
)
static

Definition at line 121 of file dstdec.c.

Referenced by read_table().

static void read_uncoded_coeff ( GetBitContext gb,
int dst,
unsigned int  elements,
int  coeff_bits,
int  is_signed,
int  offset 
)
static

Definition at line 129 of file dstdec.c.

Referenced by read_table().

static int read_table ( GetBitContext gb,
Table t,
const int8_t  code_pred_coeff[3][3],
int  length_bits,
int  coeff_bits,
int  is_signed,
int  offset 
)
static

Definition at line 139 of file dstdec.c.

Referenced by decode_frame().

static void ac_init ( ArithCoder ac,
GetBitContext gb 
)
static

Definition at line 171 of file dstdec.c.

Referenced by decode_frame().

static av_always_inline void ac_get ( ArithCoder ac,
GetBitContext gb,
int  p,
int e 
)
static

Definition at line 177 of file dstdec.c.

Referenced by decode_frame().

static uint8_t prob_dst_x_bit ( int  c)
static

Definition at line 198 of file dstdec.c.

Referenced by decode_frame().

static void build_filter ( int16_t  table[DST_MAX_ELEMENTS][16][256],
const Table fsets 
)
static

Definition at line 203 of file dstdec.c.

Referenced by decode_frame().

static int decode_frame ( AVCodecContext avctx,
void data,
int got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 224 of file dstdec.c.

Variable Documentation

const int8_t fsets_code_pred_coeff[3][3]
static
Initial value:
= {
{ -8 },
{ -16, 8 },
{ -9, -5, 6 },
}

Definition at line 44 of file dstdec.c.

Referenced by decode_frame().

const int8_t probs_code_pred_coeff[3][3]
static
Initial value:
= {
{ -8 },
{ -16, 8 },
{ -24, 24, -8 },
}

Definition at line 50 of file dstdec.c.

Referenced by decode_frame().

AVCodec ff_dst_decoder
Initial value:
= {
.name = "dst",
.long_name = NULL_IF_CONFIG_SMALL("DST (Digital Stream Transfer)"),
.priv_data_size = sizeof(DSTContext),
.capabilities = AV_CODEC_CAP_DR1,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: dstdec.c:224
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static av_cold int decode_init(AVCodecContext *avctx)
Definition: dstdec.c:78
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:701
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:959

Definition at line 363 of file dstdec.c.