FFmpeg
Data Structures | Macros | Functions | Variables
ra288.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/float_dsp.h"
#include "libavutil/internal.h"
#include "avcodec.h"
#include "celp_filters.h"
#include "get_bits.h"
#include "internal.h"
#include "lpc.h"
#include "ra288.h"

Go to the source code of this file.

Data Structures

struct  RA288Context
 

Macros

#define BITSTREAM_READER_LE
 
#define MAX_BACKWARD_FILTER_ORDER   36
 
#define MAX_BACKWARD_FILTER_LEN   40
 
#define MAX_BACKWARD_FILTER_NONREC   35
 
#define RA288_BLOCK_SIZE   5
 
#define RA288_BLOCKS_PER_FRAME   32
 

Functions

static av_cold int ra288_decode_close (AVCodecContext *avctx)
 
static av_cold int ra288_decode_init (AVCodecContext *avctx)
 
static void convolve (float *tgt, const float *src, int len, int n)
 
static void decode (RA288Context *ractx, float gain, int cb_coef)
 
static void do_hybrid_window (RA288Context *ractx, int order, int n, int non_rec, float *out, float *hist, float *out2, const float *window)
 Hybrid window filtering, see blocks 36 and 49 of the G.728 specification. More...
 
static void backward_filter (RA288Context *ractx, float *hist, float *rec, const float *window, float *lpc, const float *tab, int order, int n, int non_rec, int move_size)
 Backward synthesis filter, find the LPC coefficients from past speech data. More...
 
static int ra288_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 

Variables

AVCodec ff_ra_288_decoder
 

Macro Definition Documentation

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 26 of file ra288.c.

◆ MAX_BACKWARD_FILTER_ORDER

#define MAX_BACKWARD_FILTER_ORDER   36

Definition at line 34 of file ra288.c.

◆ MAX_BACKWARD_FILTER_LEN

#define MAX_BACKWARD_FILTER_LEN   40

Definition at line 35 of file ra288.c.

◆ MAX_BACKWARD_FILTER_NONREC

#define MAX_BACKWARD_FILTER_NONREC   35

Definition at line 36 of file ra288.c.

◆ RA288_BLOCK_SIZE

#define RA288_BLOCK_SIZE   5

Definition at line 38 of file ra288.c.

◆ RA288_BLOCKS_PER_FRAME

#define RA288_BLOCKS_PER_FRAME   32

Definition at line 39 of file ra288.c.

Function Documentation

◆ ra288_decode_close()

static av_cold int ra288_decode_close ( AVCodecContext avctx)
static

Definition at line 63 of file ra288.c.

◆ ra288_decode_init()

static av_cold int ra288_decode_init ( AVCodecContext avctx)
static

Definition at line 72 of file ra288.c.

◆ convolve()

static void convolve ( float *  tgt,
const float *  src,
int  len,
int  n 
)
static

Definition at line 92 of file ra288.c.

Referenced by do_hybrid_window().

◆ decode()

static void decode ( RA288Context ractx,
float  gain,
int  cb_coef 
)
static

Definition at line 99 of file ra288.c.

Referenced by ra288_decode_frame().

◆ do_hybrid_window()

static void do_hybrid_window ( RA288Context ractx,
int  order,
int  n,
int  non_rec,
float *  out,
float *  hist,
float *  out2,
const float *  window 
)
static

Hybrid window filtering, see blocks 36 and 49 of the G.728 specification.

Parameters
orderfilter order
ninput length
non_recnumber of non-recursive samples
outfilter output
histpointer to the input history of the filter
outpointer to the non-recursive part of the output
out2pointer to the recursive part of the output
windowpointer to the windowing function table

Definition at line 148 of file ra288.c.

Referenced by backward_filter().

◆ backward_filter()

static void backward_filter ( RA288Context ractx,
float *  hist,
float *  rec,
const float *  window,
float *  lpc,
const float *  tab,
int  order,
int  n,
int  non_rec,
int  move_size 
)
static

Backward synthesis filter, find the LPC coefficients from past speech data.

Definition at line 178 of file ra288.c.

Referenced by ra288_decode_frame().

◆ ra288_decode_frame()

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

Definition at line 193 of file ra288.c.

Variable Documentation

◆ ff_ra_288_decoder

AVCodec ff_ra_288_decoder
Initial value:
= {
.name = "real_288",
.long_name = NULL_IF_CONFIG_SMALL("RealAudio 2.0 (28.8K)"),
.priv_data_size = sizeof(RA288Context),
.capabilities = AV_CODEC_CAP_DR1,
}

Definition at line 244 of file ra288.c.

init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
decode
static void decode(RA288Context *ractx, float gain, int cb_coef)
Definition: ra288.c:99
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
ra288_decode_init
static av_cold int ra288_decode_init(AVCodecContext *avctx)
Definition: ra288.c:72
ra288_decode_close
static av_cold int ra288_decode_close(AVCodecContext *avctx)
Definition: ra288.c:63
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:981
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:188
RA288Context
Definition: ra288.c:41
AV_CODEC_ID_RA_288
@ AV_CODEC_ID_RA_288
Definition: avcodec.h:552
ra288_decode_frame
static int ra288_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: ra288.c:193