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

Go to the source code of this file.

Data Structures

struct  BinkAudioContext
 

Macros

#define BITSTREAM_READER_LE
 
#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)
 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)
 

Variables

static const uint8_t rle_length_tab [16]
 
const AVCodec ff_binkaudio_rdft_decoder
 
const AVCodec 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 35 of file binkaudio.c.

◆ MAX_CHANNELS

#define MAX_CHANNELS   2

Definition at line 44 of file binkaudio.c.

◆ BINK_BLOCK_MAX_SIZE

#define BINK_BLOCK_MAX_SIZE   (MAX_CHANNELS << 11)

Definition at line 45 of file binkaudio.c.

Function Documentation

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 68 of file binkaudio.c.

◆ get_float()

static float get_float ( GetBitContext gb)
static

Definition at line 150 of file binkaudio.c.

Referenced by decode_block().

◆ decode_block()

static int decode_block ( BinkAudioContext s,
float **  out,
int  use_dct 
)
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 168 of file binkaudio.c.

Referenced by binkaudio_receive_frame().

◆ decode_end()

static av_cold int decode_end ( AVCodecContext avctx)
static

Definition at line 272 of file binkaudio.c.

◆ get_bits_align32()

static void get_bits_align32 ( GetBitContext s)
static

Definition at line 285 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 291 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 159 of file binkaudio.c.

Referenced by decode_block().

◆ ff_binkaudio_rdft_decoder

const AVCodec ff_binkaudio_rdft_decoder
Initial value:
= {
.name = "binkaudio_rdft",
.long_name = NULL_IF_CONFIG_SMALL("Bink Audio (RDFT)"),
.priv_data_size = sizeof(BinkAudioContext),
.close = decode_end,
}

Definition at line 340 of file binkaudio.c.

◆ ff_binkaudio_dct_decoder

const AVCodec ff_binkaudio_dct_decoder
Initial value:
= {
.name = "binkaudio_dct",
.long_name = NULL_IF_CONFIG_SMALL("Bink Audio (DCT)"),
.priv_data_size = sizeof(BinkAudioContext),
.close = decode_end,
}

Definition at line 353 of file binkaudio.c.

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:42
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
BinkAudioContext
Definition: binkaudio.c:47
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
decode_end
static av_cold int decode_end(AVCodecContext *avctx)
Definition: binkaudio.c:272
binkaudio_receive_frame
static int binkaudio_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Definition: binkaudio.c:291
AV_CODEC_ID_BINKAUDIO_DCT
@ AV_CODEC_ID_BINKAUDIO_DCT
Definition: codec_id.h:471
receive_frame
static CopyRet receive_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame)
Definition: crystalhd.c:555
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
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: binkaudio.c:68
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: internal.h:50
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:82
AV_CODEC_ID_BINKAUDIO_RDFT
@ AV_CODEC_ID_BINKAUDIO_RDFT
Definition: codec_id.h:470