FFmpeg
Functions | Variables
adxdec.c File Reference
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "adx.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"

Go to the source code of this file.

Functions

static int adx_decode_header (AVCodecContext *avctx, const uint8_t *buf, int bufsize, int *header_size, int *coeff)
 Decode ADX stream header. More...
 
static av_cold int adx_decode_init (AVCodecContext *avctx)
 
static int adx_decode (ADXContext *c, int16_t *out, int offset, const uint8_t *in, int ch)
 Decode 32 samples from 18 bytes. More...
 
static int adx_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
static void adx_decode_flush (AVCodecContext *avctx)
 

Variables

const FFCodec ff_adpcm_adx_decoder
 

Detailed Description

SEGA CRI adx codecs.

Reference documents: http://ku-www.ss.titech.ac.jp/~yatsushi/adx.html adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/

Definition in file adxdec.c.

Function Documentation

◆ adx_decode_header()

static int adx_decode_header ( AVCodecContext avctx,
const uint8_t *  buf,
int  bufsize,
int header_size,
int coeff 
)
static

Decode ADX stream header.

Sets avctx->channels and avctx->sample_rate.

Parameters
avctxcodec context
bufheader data
bufsizedata size, should be at least 24 bytes
[out]header_sizesize of ADX header
[out]coeff2 LPC coefficients, can be NULL
Returns
data offset or negative error code if header is invalid

Definition at line 49 of file adxdec.c.

Referenced by adx_decode_frame(), and adx_decode_init().

◆ adx_decode_init()

static av_cold int adx_decode_init ( AVCodecContext avctx)
static

Definition at line 101 of file adxdec.c.

◆ adx_decode()

static int adx_decode ( ADXContext c,
int16_t *  out,
int  offset,
const uint8_t *  in,
int  ch 
)
static

Decode 32 samples from 18 bytes.

A 16-bit scalar value is applied to 32 residuals, which then have a 2nd-order LPC filter applied to it to form the output signal for a single channel.

Definition at line 129 of file adxdec.c.

Referenced by adx_decode_frame().

◆ adx_decode_frame()

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

Definition at line 159 of file adxdec.c.

◆ adx_decode_flush()

static void adx_decode_flush ( AVCodecContext avctx)
static

Definition at line 249 of file adxdec.c.

Variable Documentation

◆ ff_adpcm_adx_decoder

const FFCodec ff_adpcm_adx_decoder
Initial value:
= {
.p.name = "adpcm_adx",
CODEC_LONG_NAME("SEGA CRI ADX ADPCM"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(ADXContext),
.flush = adx_decode_flush,
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
}

Definition at line 256 of file adxdec.c.

adx_decode_flush
static void adx_decode_flush(AVCodecContext *avctx)
Definition: adxdec.c:249
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:286
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:271
adx_decode_init
static av_cold int adx_decode_init(AVCodecContext *avctx)
Definition: adxdec.c:101
AV_CODEC_CAP_CHANNEL_CONF
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition: codec.h:106
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:366
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AV_CODEC_ID_ADPCM_ADX
@ AV_CODEC_ID_ADPCM_ADX
Definition: codec_id.h:376
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:64
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
ADXContext
Definition: adx.h:40
adx_decode_frame
static int adx_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: adxdec.c:159