FFmpeg
Data Structures | Macros | Functions | Variables
adpcm.c File Reference
#include "avcodec.h"
#include "get_bits.h"
#include "bytestream.h"
#include "adpcm.h"
#include "adpcm_data.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ADPCMDecodeContext
 

Macros

#define DK3_GET_NEXT_NIBBLE()
 
#define THP_GET16(g)
 
#define ADPCM_DECODER(id_, sample_fmts_, name_, long_name_)
 

Functions

static void adpcm_flush (AVCodecContext *avctx)
 
static av_cold int adpcm_decode_init (AVCodecContext *avctx)
 
static int16_t adpcm_agm_expand_nibble (ADPCMChannelStatus *c, int8_t nibble)
 
static int16_t adpcm_ima_expand_nibble (ADPCMChannelStatus *c, int8_t nibble, int shift)
 
static int16_t adpcm_ima_alp_expand_nibble (ADPCMChannelStatus *c, int8_t nibble, int shift)
 
static int16_t adpcm_ima_mtf_expand_nibble (ADPCMChannelStatus *c, int nibble)
 
static int16_t adpcm_ima_cunning_expand_nibble (ADPCMChannelStatus *c, int8_t nibble)
 
static int16_t adpcm_ima_wav_expand_nibble (ADPCMChannelStatus *c, GetBitContext *gb, int bps)
 
static int adpcm_ima_qt_expand_nibble (ADPCMChannelStatus *c, int nibble)
 
static int16_t adpcm_ms_expand_nibble (ADPCMChannelStatus *c, int nibble)
 
static int16_t adpcm_ima_oki_expand_nibble (ADPCMChannelStatus *c, int nibble)
 
static int16_t adpcm_ct_expand_nibble (ADPCMChannelStatus *c, int8_t nibble)
 
static int16_t adpcm_sbpro_expand_nibble (ADPCMChannelStatus *c, int8_t nibble, int size, int shift)
 
static int16_t adpcm_yamaha_expand_nibble (ADPCMChannelStatus *c, uint8_t nibble)
 
static int16_t adpcm_mtaf_expand_nibble (ADPCMChannelStatus *c, uint8_t nibble)
 
static int16_t adpcm_zork_expand_nibble (ADPCMChannelStatus *c, uint8_t nibble)
 
static int xa_decode (AVCodecContext *avctx, int16_t *out0, int16_t *out1, const uint8_t *in, ADPCMChannelStatus *left, ADPCMChannelStatus *right, int channels, int sample_offset)
 
static void adpcm_swf_decode (AVCodecContext *avctx, const uint8_t *buf, int buf_size, int16_t *samples)
 
int16_t ff_adpcm_argo_expand_nibble (ADPCMChannelStatus *cs, int nibble, int shift, int flag)
 
static int get_nb_samples (AVCodecContext *avctx, GetByteContext *gb, int buf_size, int *coded_samples, int *approx_nb_samples)
 Get the number of samples (per channel) that will be decoded from the packet. More...
 
static int adpcm_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_4XM, sample_fmts_s16p, adpcm_4xm, "ADPCM 4X Movie")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_AFC, sample_fmts_s16p, adpcm_afc, "ADPCM Nintendo Gamecube AFC")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_AGM, sample_fmts_s16, adpcm_agm, "ADPCM AmuseGraphics Movie")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_AICA, sample_fmts_s16p, adpcm_aica, "ADPCM Yamaha AICA")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_ARGO, sample_fmts_s16p, adpcm_argo, "ADPCM Argonaut Games")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_CT, sample_fmts_s16, adpcm_ct, "ADPCM Creative Technology")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_DTK, sample_fmts_s16p, adpcm_dtk, "ADPCM Nintendo Gamecube DTK")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_EA, sample_fmts_s16, adpcm_ea, "ADPCM Electronic Arts")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_EA_MAXIS_XA, sample_fmts_s16, adpcm_ea_maxis_xa, "ADPCM Electronic Arts Maxis CDROM XA")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_EA_R1, sample_fmts_s16p, adpcm_ea_r1, "ADPCM Electronic Arts R1")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_EA_R2, sample_fmts_s16p, adpcm_ea_r2, "ADPCM Electronic Arts R2")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_EA_R3, sample_fmts_s16p, adpcm_ea_r3, "ADPCM Electronic Arts R3")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_EA_XAS, sample_fmts_s16p, adpcm_ea_xas, "ADPCM Electronic Arts XAS")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_AMV, sample_fmts_s16, adpcm_ima_amv, "ADPCM IMA AMV")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_APC, sample_fmts_s16, adpcm_ima_apc, "ADPCM IMA CRYO APC")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_APM, sample_fmts_s16, adpcm_ima_apm, "ADPCM IMA Ubisoft APM")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_CUNNING, sample_fmts_s16p, adpcm_ima_cunning, "ADPCM IMA Cunning Developments")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_DAT4, sample_fmts_s16, adpcm_ima_dat4, "ADPCM IMA Eurocom DAT4")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_DK3, sample_fmts_s16, adpcm_ima_dk3, "ADPCM IMA Duck DK3")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_DK4, sample_fmts_s16, adpcm_ima_dk4, "ADPCM IMA Duck DK4")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_EA_EACS, sample_fmts_s16, adpcm_ima_ea_eacs, "ADPCM IMA Electronic Arts EACS")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_EA_SEAD, sample_fmts_s16, adpcm_ima_ea_sead, "ADPCM IMA Electronic Arts SEAD")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_ISS, sample_fmts_s16, adpcm_ima_iss, "ADPCM IMA Funcom ISS")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_MOFLEX, sample_fmts_s16p, adpcm_ima_moflex, "ADPCM IMA MobiClip MOFLEX")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_MTF, sample_fmts_s16, adpcm_ima_mtf, "ADPCM IMA Capcom's MT Framework")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_OKI, sample_fmts_s16, adpcm_ima_oki, "ADPCM IMA Dialogic OKI")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_QT, sample_fmts_s16p, adpcm_ima_qt, "ADPCM IMA QuickTime")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_RAD, sample_fmts_s16, adpcm_ima_rad, "ADPCM IMA Radical")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_SSI, sample_fmts_s16, adpcm_ima_ssi, "ADPCM IMA Simon & Schuster Interactive")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_SMJPEG, sample_fmts_s16, adpcm_ima_smjpeg, "ADPCM IMA Loki SDL MJPEG")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_ALP, sample_fmts_s16, adpcm_ima_alp, "ADPCM IMA High Voltage Software ALP")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_WAV, sample_fmts_s16p, adpcm_ima_wav, "ADPCM IMA WAV")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_IMA_WS, sample_fmts_both, adpcm_ima_ws, "ADPCM IMA Westwood")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_MS, sample_fmts_both, adpcm_ms, "ADPCM Microsoft")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_MTAF, sample_fmts_s16p, adpcm_mtaf, "ADPCM MTAF")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_PSX, sample_fmts_s16p, adpcm_psx, "ADPCM Playstation")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_SBPRO_2, sample_fmts_s16, adpcm_sbpro_2, "ADPCM Sound Blaster Pro 2-bit")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_SBPRO_3, sample_fmts_s16, adpcm_sbpro_3, "ADPCM Sound Blaster Pro 2.6-bit")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_SBPRO_4, sample_fmts_s16, adpcm_sbpro_4, "ADPCM Sound Blaster Pro 4-bit")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_SWF, sample_fmts_s16, adpcm_swf, "ADPCM Shockwave Flash")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_THP_LE, sample_fmts_s16p, adpcm_thp_le, "ADPCM Nintendo THP (little-endian)")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_THP, sample_fmts_s16p, adpcm_thp, "ADPCM Nintendo THP")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_XA, sample_fmts_s16p, adpcm_xa, "ADPCM CDROM XA")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_YAMAHA, sample_fmts_s16, adpcm_yamaha, "ADPCM Yamaha")
 
 ADPCM_DECODER (AV_CODEC_ID_ADPCM_ZORK, sample_fmts_s16, adpcm_zork, "ADPCM Zork")
 

Variables

static const int8_t xa_adpcm_table [5][2]
 
static const int16_t ea_adpcm_table []
 
static const int8_t swf_index_tables [4][16]
 
static const int8_t zork_index_table [8]
 
static const int8_t mtf_index_table [16]
 
static enum AVSampleFormat sample_fmts_s16 []
 
static enum AVSampleFormat sample_fmts_s16p []
 
static enum AVSampleFormat sample_fmts_both []
 

Detailed Description

ADPCM decoders Features and limitations:

Reference documents: http://wiki.multimedia.cx/index.php?title=Category:ADPCM_Audio_Codecs http://www.pcisys.net/~melanson/codecs/simpleaudio.html [dead] http://www.geocities.com/SiliconValley/8682/aud3.txt [dead] http://openquicktime.sourceforge.net/ XAnim sources (xa_codec.c) http://xanim.polter.net/ http://www.cs.ucla.edu/~leec/mediabench/applications.html [dead] SoX source code http://sox.sourceforge.net/

CD-ROM XA: http://ku-www.ss.titech.ac.jp/~yatsushi/xaadpcm.html [dead] vagpack & depack http://homepages.compuserve.de/bITmASTER32/psx-index.html [dead] readstr http://www.geocities.co.jp/Playtown/2004/

Definition in file adpcm.c.

Macro Definition Documentation

◆ DK3_GET_NEXT_NIBBLE

#define DK3_GET_NEXT_NIBBLE ( )
Value:
if (decode_top_nibble_next) { \
nibble = last_byte >> 4; \
decode_top_nibble_next = 0; \
} else { \
last_byte = bytestream2_get_byteu(&gb); \
nibble = last_byte & 0x0F; \
decode_top_nibble_next = 1; \
}

◆ THP_GET16

#define THP_GET16 (   g)
Value:
avctx->codec->id == AV_CODEC_ID_ADPCM_THP_LE ? \
bytestream2_get_le16u(&(g)) : \
bytestream2_get_be16u(&(g)), 16)

◆ ADPCM_DECODER

#define ADPCM_DECODER (   id_,
  sample_fmts_,
  name_,
  long_name_ 
)
Value:
AVCodec ff_ ## name_ ## _decoder = { \
.name = #name_, \
.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
.type = AVMEDIA_TYPE_AUDIO, \
.id = id_, \
.priv_data_size = sizeof(ADPCMDecodeContext), \
.capabilities = AV_CODEC_CAP_DR1, \
.sample_fmts = sample_fmts_, \
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \
}

Definition at line 2141 of file adpcm.c.

Function Documentation

◆ adpcm_flush()

static void adpcm_flush ( AVCodecContext avctx)
static

Definition at line 2084 of file adpcm.c.

Referenced by adpcm_decode_init().

◆ adpcm_decode_init()

static av_cold int adpcm_decode_init ( AVCodecContext avctx)
static

Definition at line 108 of file adpcm.c.

◆ adpcm_agm_expand_nibble()

static int16_t adpcm_agm_expand_nibble ( ADPCMChannelStatus c,
int8_t  nibble 
)
inlinestatic

Definition at line 209 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_ima_expand_nibble()

static int16_t adpcm_ima_expand_nibble ( ADPCMChannelStatus c,
int8_t  nibble,
int  shift 
)
inlinestatic

Definition at line 253 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_ima_alp_expand_nibble()

static int16_t adpcm_ima_alp_expand_nibble ( ADPCMChannelStatus c,
int8_t  nibble,
int  shift 
)
inlinestatic

Definition at line 279 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_ima_mtf_expand_nibble()

static int16_t adpcm_ima_mtf_expand_nibble ( ADPCMChannelStatus c,
int  nibble 
)
inlinestatic

Definition at line 302 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_ima_cunning_expand_nibble()

static int16_t adpcm_ima_cunning_expand_nibble ( ADPCMChannelStatus c,
int8_t  nibble 
)
inlinestatic

Definition at line 318 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_ima_wav_expand_nibble()

static int16_t adpcm_ima_wav_expand_nibble ( ADPCMChannelStatus c,
GetBitContext gb,
int  bps 
)
inlinestatic

Definition at line 338 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_ima_qt_expand_nibble()

static int adpcm_ima_qt_expand_nibble ( ADPCMChannelStatus c,
int  nibble 
)
inlinestatic

Definition at line 361 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_ms_expand_nibble()

static int16_t adpcm_ms_expand_nibble ( ADPCMChannelStatus c,
int  nibble 
)
inlinestatic

Definition at line 387 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_ima_oki_expand_nibble()

static int16_t adpcm_ima_oki_expand_nibble ( ADPCMChannelStatus c,
int  nibble 
)
inlinestatic

Definition at line 406 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_ct_expand_nibble()

static int16_t adpcm_ct_expand_nibble ( ADPCMChannelStatus c,
int8_t  nibble 
)
inlinestatic

Definition at line 427 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_sbpro_expand_nibble()

static int16_t adpcm_sbpro_expand_nibble ( ADPCMChannelStatus c,
int8_t  nibble,
int  size,
int  shift 
)
inlinestatic

Definition at line 448 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_yamaha_expand_nibble()

static int16_t adpcm_yamaha_expand_nibble ( ADPCMChannelStatus c,
uint8_t  nibble 
)
inlinestatic

Definition at line 468 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_mtaf_expand_nibble()

static int16_t adpcm_mtaf_expand_nibble ( ADPCMChannelStatus c,
uint8_t  nibble 
)
inlinestatic

Definition at line 482 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_zork_expand_nibble()

static int16_t adpcm_zork_expand_nibble ( ADPCMChannelStatus c,
uint8_t  nibble 
)
inlinestatic

Definition at line 491 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ xa_decode()

static int xa_decode ( AVCodecContext avctx,
int16_t *  out0,
int16_t *  out1,
const uint8_t in,
ADPCMChannelStatus left,
ADPCMChannelStatus right,
int  channels,
int  sample_offset 
)
static

Definition at line 526 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_swf_decode()

static void adpcm_swf_decode ( AVCodecContext avctx,
const uint8_t buf,
int  buf_size,
int16_t *  samples 
)
static

Definition at line 614 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ ff_adpcm_argo_expand_nibble()

int16_t ff_adpcm_argo_expand_nibble ( ADPCMChannelStatus cs,
int  nibble,
int  shift,
int  flag 
)

Definition at line 671 of file adpcm.c.

Referenced by adpcm_decode_frame(), and adpcm_encode_frame().

◆ get_nb_samples()

static int get_nb_samples ( AVCodecContext avctx,
GetByteContext gb,
int  buf_size,
int coded_samples,
int approx_nb_samples 
)
static

Get the number of samples (per channel) that will be decoded from the packet.

In one case, this is actually the maximum number of samples possible to decode with the given buf_size.

Parameters
[out]coded_samplesset to the number of samples as coded in the packet, or 0 if the codec does not encode the number of samples in each frame.
[out]approx_nb_samplesset to non-zero if the number of samples returned is an approximation.

Definition at line 699 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ adpcm_decode_frame()

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

Definition at line 919 of file adpcm.c.

◆ ADPCM_DECODER() [1/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_4XM  ,
sample_fmts_s16p  ,
adpcm_4xm  ,
"ADPCM 4X Movie"   
)

◆ ADPCM_DECODER() [2/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_AFC  ,
sample_fmts_s16p  ,
adpcm_afc  ,
"ADPCM Nintendo Gamecube AFC"   
)

◆ ADPCM_DECODER() [3/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_AGM  ,
sample_fmts_s16  ,
adpcm_agm  ,
"ADPCM AmuseGraphics Movie"   
)

◆ ADPCM_DECODER() [4/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_AICA  ,
sample_fmts_s16p  ,
adpcm_aica  ,
"ADPCM Yamaha AICA"   
)

◆ ADPCM_DECODER() [5/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_ARGO  ,
sample_fmts_s16p  ,
adpcm_argo  ,
"ADPCM Argonaut Games"   
)

◆ ADPCM_DECODER() [6/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_CT  ,
sample_fmts_s16  ,
adpcm_ct  ,
"ADPCM Creative Technology"   
)

◆ ADPCM_DECODER() [7/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_DTK  ,
sample_fmts_s16p  ,
adpcm_dtk  ,
"ADPCM Nintendo Gamecube DTK"   
)

◆ ADPCM_DECODER() [8/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_EA  ,
sample_fmts_s16  ,
adpcm_ea  ,
"ADPCM Electronic Arts"   
)

◆ ADPCM_DECODER() [9/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_EA_MAXIS_XA  ,
sample_fmts_s16  ,
adpcm_ea_maxis_xa  ,
"ADPCM Electronic Arts Maxis CDROM XA"   
)

◆ ADPCM_DECODER() [10/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_EA_R1  ,
sample_fmts_s16p  ,
adpcm_ea_r1  ,
"ADPCM Electronic Arts R1  
)

◆ ADPCM_DECODER() [11/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_EA_R2  ,
sample_fmts_s16p  ,
adpcm_ea_r2  ,
"ADPCM Electronic Arts R2  
)

◆ ADPCM_DECODER() [12/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_EA_R3  ,
sample_fmts_s16p  ,
adpcm_ea_r3  ,
"ADPCM Electronic Arts R3  
)

◆ ADPCM_DECODER() [13/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_EA_XAS  ,
sample_fmts_s16p  ,
adpcm_ea_xas  ,
"ADPCM Electronic Arts XAS"   
)

◆ ADPCM_DECODER() [14/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_AMV  ,
sample_fmts_s16  ,
adpcm_ima_amv  ,
"ADPCM IMA AMV"   
)

◆ ADPCM_DECODER() [15/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_APC  ,
sample_fmts_s16  ,
adpcm_ima_apc  ,
"ADPCM IMA CRYO APC"   
)

◆ ADPCM_DECODER() [16/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_APM  ,
sample_fmts_s16  ,
adpcm_ima_apm  ,
"ADPCM IMA Ubisoft APM"   
)

◆ ADPCM_DECODER() [17/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_CUNNING  ,
sample_fmts_s16p  ,
adpcm_ima_cunning  ,
"ADPCM IMA Cunning Developments"   
)

◆ ADPCM_DECODER() [18/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_DAT4  ,
sample_fmts_s16  ,
adpcm_ima_dat4  ,
"ADPCM IMA Eurocom DAT4"   
)

◆ ADPCM_DECODER() [19/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_DK3  ,
sample_fmts_s16  ,
adpcm_ima_dk3  ,
"ADPCM IMA Duck DK3"   
)

◆ ADPCM_DECODER() [20/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_DK4  ,
sample_fmts_s16  ,
adpcm_ima_dk4  ,
"ADPCM IMA Duck DK4"   
)

◆ ADPCM_DECODER() [21/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_EA_EACS  ,
sample_fmts_s16  ,
adpcm_ima_ea_eacs  ,
"ADPCM IMA Electronic Arts EACS"   
)

◆ ADPCM_DECODER() [22/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_EA_SEAD  ,
sample_fmts_s16  ,
adpcm_ima_ea_sead  ,
"ADPCM IMA Electronic Arts SEAD"   
)

◆ ADPCM_DECODER() [23/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_ISS  ,
sample_fmts_s16  ,
adpcm_ima_iss  ,
"ADPCM IMA Funcom ISS"   
)

◆ ADPCM_DECODER() [24/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_MOFLEX  ,
sample_fmts_s16p  ,
adpcm_ima_moflex  ,
"ADPCM IMA MobiClip MOFLEX"   
)

◆ ADPCM_DECODER() [25/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_MTF  ,
sample_fmts_s16  ,
adpcm_ima_mtf  ,
"ADPCM IMA Capcom's MT Framework"   
)

◆ ADPCM_DECODER() [26/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_OKI  ,
sample_fmts_s16  ,
adpcm_ima_oki  ,
"ADPCM IMA Dialogic OKI"   
)

◆ ADPCM_DECODER() [27/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_QT  ,
sample_fmts_s16p  ,
adpcm_ima_qt  ,
"ADPCM IMA QuickTime"   
)

◆ ADPCM_DECODER() [28/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_RAD  ,
sample_fmts_s16  ,
adpcm_ima_rad  ,
"ADPCM IMA Radical"   
)

◆ ADPCM_DECODER() [29/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_SSI  ,
sample_fmts_s16  ,
adpcm_ima_ssi  ,
"ADPCM IMA Simon & Schuster Interactive"   
)

◆ ADPCM_DECODER() [30/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_SMJPEG  ,
sample_fmts_s16  ,
adpcm_ima_smjpeg  ,
"ADPCM IMA Loki SDL MJPEG"   
)

◆ ADPCM_DECODER() [31/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_ALP  ,
sample_fmts_s16  ,
adpcm_ima_alp  ,
"ADPCM IMA High Voltage Software ALP"   
)

◆ ADPCM_DECODER() [32/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_WAV  ,
sample_fmts_s16p  ,
adpcm_ima_wav  ,
"ADPCM IMA WAV"   
)

◆ ADPCM_DECODER() [33/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_IMA_WS  ,
sample_fmts_both  ,
adpcm_ima_ws  ,
"ADPCM IMA Westwood"   
)

◆ ADPCM_DECODER() [34/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_MS  ,
sample_fmts_both  ,
adpcm_ms  ,
"ADPCM Microsoft"   
)

◆ ADPCM_DECODER() [35/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_MTAF  ,
sample_fmts_s16p  ,
adpcm_mtaf  ,
"ADPCM MTAF"   
)

◆ ADPCM_DECODER() [36/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_PSX  ,
sample_fmts_s16p  ,
adpcm_psx  ,
"ADPCM Playstation"   
)

◆ ADPCM_DECODER() [37/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_SBPRO_2  ,
sample_fmts_s16  ,
adpcm_sbpro_2  ,
"ADPCM Sound Blaster Pro 2-bit  
)

◆ ADPCM_DECODER() [38/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_SBPRO_3  ,
sample_fmts_s16  ,
adpcm_sbpro_3  ,
"ADPCM Sound Blaster Pro 2.6-bit  
)

◆ ADPCM_DECODER() [39/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_SBPRO_4  ,
sample_fmts_s16  ,
adpcm_sbpro_4  ,
"ADPCM Sound Blaster Pro 4-bit  
)

◆ ADPCM_DECODER() [40/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_SWF  ,
sample_fmts_s16  ,
adpcm_swf  ,
"ADPCM Shockwave Flash"   
)

◆ ADPCM_DECODER() [41/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_THP_LE  ,
sample_fmts_s16p  ,
adpcm_thp_le  ,
"ADPCM Nintendo THP (little-endian)"   
)

◆ ADPCM_DECODER() [42/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_THP  ,
sample_fmts_s16p  ,
adpcm_thp  ,
"ADPCM Nintendo THP"   
)

◆ ADPCM_DECODER() [43/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_XA  ,
sample_fmts_s16p  ,
adpcm_xa  ,
"ADPCM CDROM XA"   
)

◆ ADPCM_DECODER() [44/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_YAMAHA  ,
sample_fmts_s16  ,
adpcm_yamaha  ,
"ADPCM Yamaha"   
)

◆ ADPCM_DECODER() [45/45]

ADPCM_DECODER ( AV_CODEC_ID_ADPCM_ZORK  ,
sample_fmts_s16  ,
adpcm_zork  ,
"ADPCM Zork"   
)

Variable Documentation

◆ xa_adpcm_table

const int8_t xa_adpcm_table[5][2]
static
Initial value:
= {
{ 0, 0 },
{ 60, 0 },
{ 115, -52 },
{ 98, -55 },
{ 122, -60 }
}

Definition at line 65 of file adpcm.c.

Referenced by adpcm_decode_frame(), and xa_decode().

◆ ea_adpcm_table

const int16_t ea_adpcm_table[]
static
Initial value:
= {
0, 240, 460, 392,
0, 0, -208, -220,
0, 1, 3, 4,
7, 8, 10, 11,
0, -1, -3, -4
}

Definition at line 73 of file adpcm.c.

Referenced by adpcm_decode_frame().

◆ swf_index_tables

const int8_t swf_index_tables[4][16]
static
Initial value:
= {
{ -1, 2 },
{ -1, -1, 2, 4 },
{ -1, -1, -1, -1, 2, 4, 6, 8 },
{ -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 4, 6, 8, 10, 13, 16 }
}

Definition at line 82 of file adpcm.c.

Referenced by adpcm_swf_decode().

◆ zork_index_table

const int8_t zork_index_table[8]
static
Initial value:
= {
-1, -1, -1, 1, 4, 7, 10, 12,
}

Definition at line 89 of file adpcm.c.

Referenced by adpcm_zork_expand_nibble().

◆ mtf_index_table

const int8_t mtf_index_table[16]
static
Initial value:
= {
8, 6, 4, 2, -1, -1, -1, -1,
-1, -1, -1, -1, 2, 4, 6, 8,
}

Definition at line 93 of file adpcm.c.

Referenced by adpcm_ima_mtf_expand_nibble().

◆ sample_fmts_s16

enum AVSampleFormat sample_fmts_s16[]
static
Initial value:

Definition at line 2133 of file adpcm.c.

◆ sample_fmts_s16p

enum AVSampleFormat sample_fmts_s16p[]
static
Initial value:

Definition at line 2135 of file adpcm.c.

◆ sample_fmts_both

enum AVSampleFormat sample_fmts_both[]
static
Initial value:

Definition at line 2137 of file adpcm.c.

AVCodec
AVCodec.
Definition: codec.h:197
FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:41
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:926
AV_CODEC_ID_ADPCM_THP_LE
@ AV_CODEC_ID_ADPCM_THP_LE
Definition: codec_id.h:390
adpcm_flush
static void adpcm_flush(AVCodecContext *avctx)
Definition: adpcm.c:2084
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
g
const char * g
Definition: vf_curves.c:117
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
flush
static void flush(AVCodecContext *avctx)
Definition: aacdec_template.c:592
ADPCMDecodeContext
Definition: adpcm.c:100
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
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:67
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:61
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:204
sign_extend
static av_const int sign_extend(int val, unsigned bits)
Definition: mathops.h:130
adpcm_decode_init
static av_cold int adpcm_decode_init(AVCodecContext *avctx)
Definition: adpcm.c:108
adpcm_decode_frame
static int adpcm_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: adpcm.c:919