FFmpeg
Data Structures | Macros | Functions | Variables
wmaprodec.c File Reference

wmapro decoder implementation Wmapro is an MDCT based codec comparable to wma standard or AAC. The decoding therefore consists of the following steps: More...

#include <inttypes.h>
#include "libavutil/audio_fifo.h"
#include "libavutil/mem.h"
#include "libavutil/tx.h"
#include "libavutil/ffmath.h"
#include "libavutil/float_dsp.h"
#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem_internal.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "internal.h"
#include "put_bits.h"
#include "wmaprodata.h"
#include "sinewin.h"
#include "wma.h"
#include "wma_common.h"

Go to the source code of this file.

Data Structures

struct  WMAProChannelCtx
 frame specific decoder context for a single channel More...
 
struct  WMAProChannelGrp
 channel group for channel transformations More...
 
struct  WMAProDecodeCtx
 main decoder context More...
 
struct  XMADecodeCtx
 

Macros

#define WMAPRO_MAX_CHANNELS   8
 current decoder limitations More...
 
#define MAX_SUBFRAMES   32
 max number of subframes per channel More...
 
#define MAX_BANDS   29
 max number of scale factor bands More...
 
#define MAX_FRAMESIZE   32768
 maximum compressed frame size More...
 
#define XMA_MAX_STREAMS   8
 
#define XMA_MAX_CHANNELS_STREAM   2
 
#define XMA_MAX_CHANNELS   (XMA_MAX_STREAMS * XMA_MAX_CHANNELS_STREAM)
 
#define WMAPRO_BLOCK_MIN_BITS   6
 log2 of min block size More...
 
#define WMAPRO_BLOCK_MAX_BITS   13
 log2 of max block size More...
 
#define WMAPRO_BLOCK_MIN_SIZE   (1 << WMAPRO_BLOCK_MIN_BITS)
 minimum block size More...
 
#define WMAPRO_BLOCK_MAX_SIZE   (1 << WMAPRO_BLOCK_MAX_BITS)
 maximum block size More...
 
#define WMAPRO_BLOCK_SIZES   (WMAPRO_BLOCK_MAX_BITS - WMAPRO_BLOCK_MIN_BITS + 1)
 possible block sizes More...
 
#define VLCBITS   9
 
#define SCALEVLCBITS   8
 
#define VEC4MAXDEPTH   ((HUFF_VEC4_MAXBITS+VLCBITS-1)/VLCBITS)
 
#define VEC2MAXDEPTH   ((HUFF_VEC2_MAXBITS+VLCBITS-1)/VLCBITS)
 
#define VEC1MAXDEPTH   ((HUFF_VEC1_MAXBITS+VLCBITS-1)/VLCBITS)
 
#define SCALEMAXDEPTH   ((HUFF_SCALE_MAXBITS+SCALEVLCBITS-1)/SCALEVLCBITS)
 
#define SCALERLMAXDEPTH   ((HUFF_SCALE_RL_MAXBITS+VLCBITS-1)/VLCBITS)
 
#define PRINT(a, b)   av_log(s->avctx, AV_LOG_DEBUG, " %s = %d\n", a, b);
 
#define PRINT_HEX(a, b)   av_log(s->avctx, AV_LOG_DEBUG, " %s = %"PRIx32"\n", a, b);
 

Functions

static av_cold void dump_context (WMAProDecodeCtx *s)
 helper function to print the most important members of the context More...
 
static av_cold int decode_end (WMAProDecodeCtx *s)
 Uninitialize the decoder and free all resources. More...
 
static av_cold int wmapro_decode_end (AVCodecContext *avctx)
 
static av_cold int get_rate (AVCodecContext *avctx)
 
static av_cold void decode_init_static (void)
 
static av_cold int decode_init (WMAProDecodeCtx *s, AVCodecContext *avctx, int num_stream)
 Initialize the decoder. More...
 
static av_cold int wmapro_decode_init (AVCodecContext *avctx)
 Initialize the decoder. More...
 
static int decode_subframe_length (WMAProDecodeCtx *s, int offset)
 Decode the subframe length. More...
 
static int decode_tilehdr (WMAProDecodeCtx *s)
 Decode how the data in the frame is split into subframes. More...
 
static void decode_decorrelation_matrix (WMAProDecodeCtx *s, WMAProChannelGrp *chgroup)
 Calculate a decorrelation matrix from the bitstream parameters. More...
 
static int decode_channel_transform (WMAProDecodeCtx *s)
 Decode channel transformation parameters. More...
 
static int decode_coeffs (WMAProDecodeCtx *s, int c)
 Extract the coefficients from the bitstream. More...
 
static int decode_scale_factors (WMAProDecodeCtx *s)
 Extract scale factors from the bitstream. More...
 
static void inverse_channel_transform (WMAProDecodeCtx *s)
 Reconstruct the individual channel data. More...
 
static void wmapro_window (WMAProDecodeCtx *s)
 Apply sine window and reconstruct the output buffer. More...
 
static int decode_subframe (WMAProDecodeCtx *s)
 Decode a single subframe (block). More...
 
static int decode_frame (WMAProDecodeCtx *s, AVFrame *frame, int *got_frame_ptr)
 Decode one WMA frame. More...
 
static int remaining_bits (WMAProDecodeCtx *s, GetBitContext *gb)
 Calculate remaining input buffer length. More...
 
static void save_bits (WMAProDecodeCtx *s, GetBitContext *gb, int len, int append)
 Fill the bit reservoir with a (partial) frame. More...
 
static int decode_packet (AVCodecContext *avctx, WMAProDecodeCtx *s, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
static int wmapro_decode_packet (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 Decode a single WMA packet. More...
 
static int xma_decode_packet (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold int xma_decode_init (AVCodecContext *avctx)
 
static av_cold int xma_decode_end (AVCodecContext *avctx)
 
static void flush (WMAProDecodeCtx *s)
 
static void wmapro_flush (AVCodecContext *avctx)
 Clear decoder buffers (for seeking). More...
 
static void xma_flush (AVCodecContext *avctx)
 

Variables

static VLCElem sf_vlc [616]
 scale factor DPCM vlc More...
 
static VLCElem sf_rl_vlc [1406]
 scale factor run length vlc More...
 
static VLCElem vec4_vlc [604]
 4 coefficients per symbol More...
 
static VLCElem vec2_vlc [562]
 2 coefficients per symbol More...
 
static VLCElem vec1_vlc [562]
 1 coefficient per symbol More...
 
static const VLCElemcoef_vlc [2]
 coefficient run length vlc codes More...
 
static float sin64 [33]
 sine table for decorrelation More...
 
const FFCodec ff_wmapro_decoder
 wmapro decoder More...
 
const FFCodec ff_xma1_decoder
 
const FFCodec ff_xma2_decoder
 

Detailed Description

wmapro decoder implementation Wmapro is an MDCT based codec comparable to wma standard or AAC. The decoding therefore consists of the following steps:

The compressed wmapro bitstream is split into individual packets. Every such packet contains one or more wma frames. The compressed frames may have a variable length and frames may cross packet boundaries. Common to all wmapro frames is the number of samples that are stored in a frame. The number of samples and a few other decode flags are stored as extradata that has to be passed to the decoder.

The wmapro frames themselves are again split into a variable number of subframes. Every subframe contains the data for 2^N time domain samples where N varies between 7 and 12.

Example wmapro bitstream (in samples):

|| packet 0 || packet 1 || packet 2 packets

|| frame 0 || frame 1 || frame 2 || frames

|| | | || | | | || || subframes of channel 0

|| | | || | | | || || subframes of channel 1

The frame layouts for the individual channels of a wma frame does not need to be the same.

However, if the offsets and lengths of several subframes of a frame are the same, the subframes of the channels can be grouped. Every group may then use special coding techniques like M/S stereo coding to improve the compression ratio. These channel transformations do not need to be applied to a whole subframe. Instead, they can also work on individual scale factor bands (see below). The coefficients that carry the audio signal in the frequency domain are transmitted as huffman-coded vectors with 4, 2 and 1 elements. In addition to that, the encoder can switch to a runlevel coding scheme by transmitting subframe_length / 128 zero coefficients.

Before the audio signal can be converted to the time domain, the coefficients have to be rescaled and inverse quantized. A subframe is therefore split into several scale factor bands that get scaled individually. Scale factors are submitted for every frame but they might be shared between the subframes of a channel. Scale factors are initially DPCM-coded. Once scale factors are shared, the differences are transmitted as runlevel codes. Every subframe length and offset combination in the frame layout shares a common quantization factor that can be adjusted for every channel by a modifier. After the inverse quantization, the coefficients get processed by an IMDCT. The resulting values are then windowed with a sine window and the first half of the values are added to the second half of the output from the previous subframe in order to reconstruct the output samples.

Definition in file wmaprodec.c.

Macro Definition Documentation

◆ WMAPRO_MAX_CHANNELS

#define WMAPRO_MAX_CHANNELS   8

current decoder limitations

max number of handled channels

Definition at line 113 of file wmaprodec.c.

◆ MAX_SUBFRAMES

#define MAX_SUBFRAMES   32

max number of subframes per channel

Definition at line 114 of file wmaprodec.c.

◆ MAX_BANDS

#define MAX_BANDS   29

max number of scale factor bands

Definition at line 115 of file wmaprodec.c.

◆ MAX_FRAMESIZE

#define MAX_FRAMESIZE   32768

maximum compressed frame size

Definition at line 116 of file wmaprodec.c.

◆ XMA_MAX_STREAMS

#define XMA_MAX_STREAMS   8

Definition at line 117 of file wmaprodec.c.

◆ XMA_MAX_CHANNELS_STREAM

#define XMA_MAX_CHANNELS_STREAM   2

Definition at line 118 of file wmaprodec.c.

◆ XMA_MAX_CHANNELS

#define XMA_MAX_CHANNELS   (XMA_MAX_STREAMS * XMA_MAX_CHANNELS_STREAM)

Definition at line 119 of file wmaprodec.c.

◆ WMAPRO_BLOCK_MIN_BITS

#define WMAPRO_BLOCK_MIN_BITS   6

log2 of min block size

Definition at line 121 of file wmaprodec.c.

◆ WMAPRO_BLOCK_MAX_BITS

#define WMAPRO_BLOCK_MAX_BITS   13

log2 of max block size

Definition at line 122 of file wmaprodec.c.

◆ WMAPRO_BLOCK_MIN_SIZE

#define WMAPRO_BLOCK_MIN_SIZE   (1 << WMAPRO_BLOCK_MIN_BITS)

minimum block size

Definition at line 123 of file wmaprodec.c.

◆ WMAPRO_BLOCK_MAX_SIZE

#define WMAPRO_BLOCK_MAX_SIZE   (1 << WMAPRO_BLOCK_MAX_BITS)

maximum block size

Definition at line 124 of file wmaprodec.c.

◆ WMAPRO_BLOCK_SIZES

#define WMAPRO_BLOCK_SIZES   (WMAPRO_BLOCK_MAX_BITS - WMAPRO_BLOCK_MIN_BITS + 1)

possible block sizes

Definition at line 125 of file wmaprodec.c.

◆ VLCBITS

#define VLCBITS   9

Definition at line 128 of file wmaprodec.c.

◆ SCALEVLCBITS

#define SCALEVLCBITS   8

Definition at line 129 of file wmaprodec.c.

◆ VEC4MAXDEPTH

#define VEC4MAXDEPTH   ((HUFF_VEC4_MAXBITS+VLCBITS-1)/VLCBITS)

Definition at line 130 of file wmaprodec.c.

◆ VEC2MAXDEPTH

#define VEC2MAXDEPTH   ((HUFF_VEC2_MAXBITS+VLCBITS-1)/VLCBITS)

Definition at line 131 of file wmaprodec.c.

◆ VEC1MAXDEPTH

#define VEC1MAXDEPTH   ((HUFF_VEC1_MAXBITS+VLCBITS-1)/VLCBITS)

Definition at line 132 of file wmaprodec.c.

◆ SCALEMAXDEPTH

#define SCALEMAXDEPTH   ((HUFF_SCALE_MAXBITS+SCALEVLCBITS-1)/SCALEVLCBITS)

Definition at line 133 of file wmaprodec.c.

◆ SCALERLMAXDEPTH

#define SCALERLMAXDEPTH   ((HUFF_SCALE_RL_MAXBITS+VLCBITS-1)/VLCBITS)

Definition at line 134 of file wmaprodec.c.

◆ PRINT

#define PRINT (   a,
  b 
)    av_log(s->avctx, AV_LOG_DEBUG, " %s = %d\n", a, b);

◆ PRINT_HEX

#define PRINT_HEX (   a,
  b 
)    av_log(s->avctx, AV_LOG_DEBUG, " %s = %"PRIx32"\n", a, b);

Function Documentation

◆ dump_context()

static av_cold void dump_context ( WMAProDecodeCtx s)
static

helper function to print the most important members of the context

Parameters
scontext

Definition at line 267 of file wmaprodec.c.

Referenced by decode_init().

◆ decode_end()

static av_cold int decode_end ( WMAProDecodeCtx s)
static

Uninitialize the decoder and free all resources.

Parameters
avctxcodec context
Returns
0 on success, < 0 otherwise

Definition at line 286 of file wmaprodec.c.

Referenced by wmapro_decode_end(), and xma_decode_end().

◆ wmapro_decode_end()

static av_cold int wmapro_decode_end ( AVCodecContext avctx)
static

Definition at line 298 of file wmaprodec.c.

◆ get_rate()

static av_cold int get_rate ( AVCodecContext avctx)
static

Definition at line 307 of file wmaprodec.c.

Referenced by decode_init().

◆ decode_init_static()

static av_cold void decode_init_static ( void  )
static

calculate sine values for the decorrelation matrix

Definition at line 322 of file wmaprodec.c.

Referenced by decode_init().

◆ decode_init()

static av_cold int decode_init ( WMAProDecodeCtx s,
AVCodecContext avctx,
int  num_stream 
)
static

Initialize the decoder.

Parameters
avctxcodec context
Returns
0 on success, -1 otherwise

dump the extradata

generic init

frame info

get frame len

subframe info

init previous block len

extract lfe channel position

calculate number of scale factor bands and their offsets for every possible block size

Scale factors can be shared between blocks of different size as every block has a different scale factor band layout. The matrix sf_offsets is needed to find the correct scale factor.

init MDCT, FIXME: only init needed sizes

init MDCT windows: simple sine window

calculate subwoofer cutoff values

Definition at line 364 of file wmaprodec.c.

Referenced by wmapro_decode_init(), and xma_decode_init().

◆ wmapro_decode_init()

static av_cold int wmapro_decode_init ( AVCodecContext avctx)
static

Initialize the decoder.

Parameters
avctxcodec context
Returns
0 on success, -1 otherwise

Definition at line 607 of file wmaprodec.c.

◆ decode_subframe_length()

static int decode_subframe_length ( WMAProDecodeCtx s,
int  offset 
)
static

Decode the subframe length.

Parameters
scontext
offsetsample offset in the frame
Returns
decoded subframe length on success, < 0 in case of an error

no need to read from the bitstream when only one length is possible

1 bit indicates if the subframe is of maximum length

sanity check the length

Definition at line 620 of file wmaprodec.c.

Referenced by decode_tilehdr().

◆ decode_tilehdr()

static int decode_tilehdr ( WMAProDecodeCtx s)
static

Decode how the data in the frame is split into subframes.

Every WMA frame contains the encoded data for a fixed number of samples per channel. The data for every channel might be split into several subframes. This function will reconstruct the list of subframes for every channel.

If the subframes are not evenly split, the algorithm estimates the channels with the lowest number of total samples. Afterwards, for each of these channels a bit is read from the bitstream that indicates if the channel contains a subframe with the next subframe size that is going to be read from the bitstream or not. If a channel contains such a subframe, the subframe size gets added to the channel's subframe list. The algorithm repeats these steps until the frame is properly divided between the individual channels.

Parameters
scontext
Returns
0 on success, < 0 in case of an error

< sum of samples for all currently known subframes of a channel

< flag indicating if a channel contains the current subframe

< number of channels that contain the current subframe

< flag indicating that all channels use the same subframe offsets and sizes

< smallest sum of samples (channels with this length will be processed first)

reset tiling information

loop until the frame data is split between the subframes

check which channels contain the subframe

get subframe length, subframe_len == 0 is not allowed

add subframes to the individual channels and find new min_channel_len

Definition at line 671 of file wmaprodec.c.

Referenced by decode_frame().

◆ decode_decorrelation_matrix()

static void decode_decorrelation_matrix ( WMAProDecodeCtx s,
WMAProChannelGrp chgroup 
)
static

Calculate a decorrelation matrix from the bitstream parameters.

Parameters
scodec context
chgroupchannel group for which the matrix needs to be calculated

Definition at line 762 of file wmaprodec.c.

Referenced by decode_channel_transform().

◆ decode_channel_transform()

static int decode_channel_transform ( WMAProDecodeCtx s)
static

Decode channel transformation parameters.

Parameters
scodec context
Returns
>= 0 in case of success, < 0 in case of bitstream errors

in the one channel case channel transforms are pointless

decode channel mask

decode transform type

cos(pi/4)

FIXME: more than 6 coupled channels not supported

decode transform on / off

transform can be enabled for individual bands

Definition at line 812 of file wmaprodec.c.

Referenced by decode_subframe().

◆ decode_coeffs()

static int decode_coeffs ( WMAProDecodeCtx s,
int  c 
)
static

Extract the coefficients from the bitstream.

Parameters
scodec context
ccurrent channel number
Returns
0 on success, < 0 in case of bitstream errors

decode vector coefficients (consumes up to 167 bits per iteration for 4 vector coded large values)

decode sign

switch to run level mode when subframe_len / 128 zeros were found in a row

decode run level coded coefficients

Definition at line 926 of file wmaprodec.c.

Referenced by decode_subframe().

◆ decode_scale_factors()

static int decode_scale_factors ( WMAProDecodeCtx s)
static

Extract scale factors from the bitstream.

Parameters
scodec context
Returns
0 on success, < 0 in case of bitstream errors

should never consume more than 5344 bits MAX_CHANNELS * (1 + MAX_BANDS * 23)

resample scale factors for the new block size as the scale factors might need to be resampled several times before some new values are transmitted, a backup of the last transmitted scale factors is kept in saved_scale_factors

decode DPCM coded scale factors

run level decode differences to the resampled factors

swap buffers

calculate new scale factor maximum

Definition at line 1032 of file wmaprodec.c.

Referenced by decode_subframe().

◆ inverse_channel_transform()

static void inverse_channel_transform ( WMAProDecodeCtx s)
static

Reconstruct the individual channel data.

Parameters
scodec context

multichannel decorrelation

multiply values with the decorrelation_matrix

Definition at line 1125 of file wmaprodec.c.

Referenced by decode_subframe().

◆ wmapro_window()

static void wmapro_window ( WMAProDecodeCtx s)
static

Apply sine window and reconstruct the output buffer.

Parameters
scodec context

Definition at line 1180 of file wmaprodec.c.

Referenced by decode_subframe().

◆ decode_subframe()

static int decode_subframe ( WMAProDecodeCtx s)
static

Decode a single subframe (block).

Parameters
scodec context
Returns
0 on success, < 0 when decoding failed

reset channel context and find the next block offset and size == the next block of the channel with the smallest number of decoded samples

get a list of all channels that contain the estimated block

subtract already processed samples

and count if there are multiple subframes that match our profile

check if the frame will be complete after processing the estimated block

calculate number of scale factor bands and their offsets

configure the decoder for the current subframe

skip extended header if any

no idea for what the following bit is used

decode number of vector coded coefficients

decode quantization step

decode quantization step modifiers for every channel

decode scale factors

parse coefficients

reconstruct the per channel data

inverse quantization and rescaling

apply imdct (imdct_half == DCTIV with reverse)

window and overlapp-add

handled one subframe

Definition at line 1210 of file wmaprodec.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( WMAProDecodeCtx s,
AVFrame frame,
int *  got_frame_ptr 
)
static

Decode one WMA frame.

Parameters
scodec context
Returns
0 if the trailer bit indicates that this is the last frame, 1 if there are additional frames

get frame length

decode tile information

read postproc transform

read drc info

reset subframe states

decode all subframes

copy samples to the output buffer

reuse second half of the IMDCT output for the next frame

FIXME: not sure if this is always an error

skip the rest of the frame data

decode trailer bit

Definition at line 1451 of file wmaprodec.c.

Referenced by decode_packet().

◆ remaining_bits()

static int remaining_bits ( WMAProDecodeCtx s,
GetBitContext gb 
)
static

Calculate remaining input buffer length.

Parameters
scodec context
gbbitstream reader context
Returns
remaining size in bits

Definition at line 1564 of file wmaprodec.c.

Referenced by decode_packet().

◆ save_bits()

static void save_bits ( WMAProDecodeCtx s,
GetBitContext gb,
int  len,
int  append 
)
static

Fill the bit reservoir with a (partial) frame.

Parameters
scodec context
gbbitstream reader context
lenlength of the partial frame
appenddecides whether to reset the buffer or not

when the frame data does not need to be concatenated, the input buffer is reset and additional bits from the previous frame are copied and skipped later so that a fast byte copy is possible

Definition at line 1576 of file wmaprodec.c.

Referenced by decode_packet().

◆ decode_packet()

static int decode_packet ( AVCodecContext avctx,
WMAProDecodeCtx s,
AVFrame frame,
int *  got_frame_ptr,
AVPacket avpkt 
)
static

Must output remaining samples after stream end. WMAPRO 5.1 created by XWMA encoder don't though (maybe only 1/2ch streams need it).

clean output buffer and copy last IMDCT samples

sanity check for the buffer length

parse packet header

get number of bits that need to be added to the previous frame

check for packet loss

append the previous frame data to the remaining data from the previous packet to create a full frame

decode the cross packet frame if it is valid

reset number of saved bits so that the decoder does not start to decode incomplete frames in the s->len_prefix == 0 case

when the frames do not have a length prefix, we don't know the compressed length of the individual frames however, we know what part of a new packet belongs to the previous frame therefore we save the incoming packet first, then we append the "previous frame" data from the next packet so that we get a buffer that only contains full frames

save the rest of the data so that it can be decoded with the next packet

Definition at line 1623 of file wmaprodec.c.

Referenced by wmapro_decode_packet(), and xma_decode_packet().

◆ wmapro_decode_packet()

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

Decode a single WMA packet.

Parameters
avctxcodec context
datathe output buffer
avpktinput packet
Returns
number of bytes that were read from the input buffer

Definition at line 1823 of file wmaprodec.c.

◆ xma_decode_packet()

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

Definition at line 1839 of file wmaprodec.c.

◆ xma_decode_init()

static av_cold int xma_decode_init ( AVCodecContext avctx)
static

Definition at line 1960 of file wmaprodec.c.

◆ xma_decode_end()

static av_cold int xma_decode_end ( AVCodecContext avctx)
static

Definition at line 2030 of file wmaprodec.c.

◆ flush()

static void flush ( WMAProDecodeCtx s)
static

reset output buffer as a part of it is used during the windowing of a new frame

Definition at line 2049 of file wmaprodec.c.

Referenced by wmapro_flush(), and xma_flush().

◆ wmapro_flush()

static void wmapro_flush ( AVCodecContext avctx)
static

Clear decoder buffers (for seeking).

Parameters
avctxcodec context

Definition at line 2067 of file wmaprodec.c.

◆ xma_flush()

static void xma_flush ( AVCodecContext avctx)
static

Definition at line 2074 of file wmaprodec.c.

Variable Documentation

◆ sf_vlc

VLCElem sf_vlc[616]
static

scale factor DPCM vlc

Definition at line 136 of file wmaprodec.c.

Referenced by decode_init_static(), and decode_scale_factors().

◆ sf_rl_vlc

VLCElem sf_rl_vlc[1406]
static

scale factor run length vlc

Definition at line 137 of file wmaprodec.c.

Referenced by decode_init_static(), and decode_scale_factors().

◆ vec4_vlc

VLCElem vec4_vlc[604]
static

4 coefficients per symbol

Definition at line 138 of file wmaprodec.c.

Referenced by decode_coeffs(), and decode_init_static().

◆ vec2_vlc

VLCElem vec2_vlc[562]
static

2 coefficients per symbol

Definition at line 139 of file wmaprodec.c.

Referenced by decode_coeffs(), and decode_init_static().

◆ vec1_vlc

VLCElem vec1_vlc[562]
static

1 coefficient per symbol

Definition at line 140 of file wmaprodec.c.

Referenced by decode_coeffs(), and decode_init_static().

◆ coef_vlc

const VLCElem* coef_vlc[2]
static

coefficient run length vlc codes

Definition at line 141 of file wmaprodec.c.

Referenced by decode_coeffs(), and decode_init_static().

◆ sin64

float sin64[33]
static

sine table for decorrelation

Definition at line 142 of file wmaprodec.c.

Referenced by decode_decorrelation_matrix(), and decode_init_static().

◆ ff_wmapro_decoder

const FFCodec ff_wmapro_decoder
Initial value:
= {
.p.name = "wmapro",
CODEC_LONG_NAME("Windows Media Audio 9 Professional"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(WMAProDecodeCtx),
.p.capabilities =
AV_CODEC_CAP_SUBFRAMES |
.flush = wmapro_flush,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

wmapro decoder

Definition at line 2094 of file wmaprodec.c.

◆ ff_xma1_decoder

const FFCodec ff_xma1_decoder
Initial value:
= {
.p.name = "xma1",
CODEC_LONG_NAME("Xbox Media Audio 1"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(XMADecodeCtx),
.close = xma_decode_end,
.flush = xma_flush,
.p.capabilities =
AV_CODEC_CAP_SUBFRAMES |
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 2114 of file wmaprodec.c.

◆ ff_xma2_decoder

const FFCodec ff_xma2_decoder
Initial value:
= {
.p.name = "xma2",
CODEC_LONG_NAME("Xbox Media Audio 2"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(XMADecodeCtx),
.close = xma_decode_end,
.flush = xma_flush,
.p.capabilities =
AV_CODEC_CAP_SUBFRAMES |
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 2134 of file wmaprodec.c.

xma_decode_init
static av_cold int xma_decode_init(AVCodecContext *avctx)
Definition: wmaprodec.c:1960
AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:43
wmapro_decode_init
static av_cold int wmapro_decode_init(AVCodecContext *avctx)
Initialize the decoder.
Definition: wmaprodec.c:607
wmapro_decode_end
static av_cold int wmapro_decode_end(AVCodecContext *avctx)
Definition: wmaprodec.c:298
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
AV_CODEC_ID_WMAPRO
@ AV_CODEC_ID_WMAPRO
Definition: codec_id.h:484
AV_CODEC_ID_XMA1
@ AV_CODEC_ID_XMA1
Definition: codec_id.h:526
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
wmapro_flush
static void wmapro_flush(AVCodecContext *avctx)
Clear decoder buffers (for seeking).
Definition: wmaprodec.c:2067
xma_flush
static void xma_flush(AVCodecContext *avctx)
Definition: wmaprodec.c:2074
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
xma_decode_packet
static int xma_decode_packet(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: wmaprodec.c:1839
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
WMAProDecodeCtx
main decoder context
Definition: wmaprodec.c:183
wmapro_decode_packet
static int wmapro_decode_packet(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Decode a single WMA packet.
Definition: wmaprodec.c:1823
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:76
xma_decode_end
static av_cold int xma_decode_end(AVCodecContext *avctx)
Definition: wmaprodec.c:2030
AV_CODEC_ID_XMA2
@ AV_CODEC_ID_XMA2
Definition: codec_id.h:527
XMADecodeCtx
Definition: wmaprodec.c:252