FFmpeg
Data Structures | Macros | Functions | Variables
binkaudio.c File Reference
#include "config_components.h"
#include "libavutil/channel_layout.h"
#include "libavutil/intfloat.h"
#include "libavutil/mem_internal.h"
#include "libavutil/tx.h"
#include "avcodec.h"
#include "decode.h"
#include "get_bits.h"
#include "codec_internal.h"
#include "internal.h"
#include "wma_freqs.h"

Go to the source code of this file.

Data Structures

struct  BinkAudioContext
 

Macros

#define BITSTREAM_READER_LE
 
#define MAX_DCT_CHANNELS   6
 
#define MAX_CHANNELS   2
 
#define BINK_BLOCK_MAX_SIZE   (MAX_CHANNELS << 11)
 

Functions

static av_cold int decode_init (AVCodecContext *avctx)
 
static float get_float (GetBitContext *gb)
 
static int decode_block (BinkAudioContext *s, float **out, int use_dct, int channels, int ch_offset)
 Decode Bink Audio block. More...
 
static av_cold int decode_end (AVCodecContext *avctx)
 
static void get_bits_align32 (GetBitContext *s)
 
static int binkaudio_receive_frame (AVCodecContext *avctx, AVFrame *frame)
 
static void decode_flush (AVCodecContext *avctx)
 

Variables

static const uint8_t rle_length_tab [16]
 
const FFCodec ff_binkaudio_rdft_decoder
 
const FFCodec ff_binkaudio_dct_decoder
 

Detailed Description

Bink Audio decoder

Technical details here: http://wiki.multimedia.cx/index.php?title=Bink_Audio

Definition in file binkaudio.c.

Macro Definition Documentation

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 38 of file binkaudio.c.

◆ MAX_DCT_CHANNELS

#define MAX_DCT_CHANNELS   6

Definition at line 46 of file binkaudio.c.

◆ MAX_CHANNELS

#define MAX_CHANNELS   2

Definition at line 47 of file binkaudio.c.

◆ BINK_BLOCK_MAX_SIZE

#define BINK_BLOCK_MAX_SIZE   (MAX_CHANNELS << 11)

Definition at line 48 of file binkaudio.c.

Function Documentation

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 70 of file binkaudio.c.

◆ get_float()

static float get_float ( GetBitContext gb)
static

Definition at line 155 of file binkaudio.c.

Referenced by decode_block().

◆ decode_block()

static int decode_block ( BinkAudioContext s,
float **  out,
int  use_dct,
int  channels,
int  ch_offset 
)
static

Decode Bink Audio block.

Parameters
[out]outOutput buffer (must contain s->block_size elements)
Returns
0 on success, negative error code on failure

Definition at line 173 of file binkaudio.c.

Referenced by binkaudio_receive_frame().

◆ decode_end()

static av_cold int decode_end ( AVCodecContext avctx)
static

Definition at line 282 of file binkaudio.c.

◆ get_bits_align32()

static void get_bits_align32 ( GetBitContext s)
static

Definition at line 289 of file binkaudio.c.

Referenced by binkaudio_receive_frame().

◆ binkaudio_receive_frame()

static int binkaudio_receive_frame ( AVCodecContext avctx,
AVFrame frame 
)
static

Definition at line 295 of file binkaudio.c.

◆ decode_flush()

static void decode_flush ( AVCodecContext avctx)
static

Definition at line 361 of file binkaudio.c.

Variable Documentation

◆ rle_length_tab

const uint8_t rle_length_tab[16]
static
Initial value:
= {
2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 32, 64
}

Definition at line 164 of file binkaudio.c.

Referenced by decode_block().

◆ ff_binkaudio_rdft_decoder

const FFCodec ff_binkaudio_rdft_decoder
Initial value:
= {
.p.name = "binkaudio_rdft",
CODEC_LONG_NAME("Bink Audio (RDFT)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(BinkAudioContext),
.close = decode_end,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 371 of file binkaudio.c.

◆ ff_binkaudio_dct_decoder

const FFCodec ff_binkaudio_dct_decoder
Initial value:
= {
.p.name = "binkaudio_dct",
CODEC_LONG_NAME("Bink Audio (DCT)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(BinkAudioContext),
.close = decode_end,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 385 of file binkaudio.c.

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:42
BinkAudioContext
Definition: binkaudio.c:50
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
decode_end
static av_cold int decode_end(AVCodecContext *avctx)
Definition: binkaudio.c:282
binkaudio_receive_frame
static int binkaudio_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Definition: binkaudio.c:295
AV_CODEC_ID_BINKAUDIO_DCT
@ AV_CODEC_ID_BINKAUDIO_DCT
Definition: codec_id.h:490
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
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
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: binkaudio.c:70
FF_CODEC_RECEIVE_FRAME_CB
#define FF_CODEC_RECEIVE_FRAME_CB(func)
Definition: codec_internal.h:312
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:367
decode_flush
static void decode_flush(AVCodecContext *avctx)
Definition: binkaudio.c:361
AV_CODEC_ID_BINKAUDIO_RDFT
@ AV_CODEC_ID_BINKAUDIO_RDFT
Definition: codec_id.h:489