FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
sipr.c File Reference
#include <math.h>
#include <stdint.h>
#include <string.h>
#include "libavutil/channel_layout.h"
#include "libavutil/float_dsp.h"
#include "libavutil/mathematics.h"
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
#include "lsp.h"
#include "acelp_vectors.h"
#include "acelp_pitch_delay.h"
#include "acelp_filters.h"
#include "celp_filters.h"
#include "sipr.h"
#include "siprdata.h"

Go to the source code of this file.

Data Structures

struct  SiprModeParam
 

Macros

#define BITSTREAM_READER_LE
 
#define MAX_SUBFRAME_COUNT   5
 

Functions

static void dequant (float *out, const int *idx, const float *const cbs[])
 
static void lsf_decode_fp (float *lsfnew, float *lsf_history, const SiprParameters *parm)
 
static void pitch_sharpening (int pitch_lag_int, float beta, float *fixed_vector)
 Apply pitch lag to the fixed vector (AMR section 6.1.2). More...
 
static void decode_parameters (SiprParameters *parms, GetBitContext *pgb, const SiprModeParam *p)
 Extract decoding parameters from the input bitstream. More...
 
static void sipr_decode_lp (float *lsfnew, const float *lsfold, float *Az, int num_subfr)
 
static void eval_ir (const float *Az, int pitch_lag, float *freq, float pitch_sharp_factor)
 Evaluate the adaptive impulse response. More...
 
static void convolute_with_sparse (float *out, const AMRFixed *pulses, const float *shape, int length)
 Evaluate the convolution of a vector with a sparse vector. More...
 
static void postfilter_5k0 (SiprContext *ctx, const float *lpc, float *samples)
 Apply postfilter, very similar to AMR one. More...
 
static void decode_fixed_sparse (AMRFixed *fixed_sparse, const int16_t *pulses, SiprMode mode, int low_gain)
 
static void decode_frame (SiprContext *ctx, SiprParameters *params, float *out_data)
 
static av_cold int sipr_decoder_init (AVCodecContext *avctx)
 
static int sipr_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 

Variables

static const SiprModeParam modes [MODE_COUNT]
 
const float ff_pow_0_5 []
 
AVCodec ff_sipr_decoder
 

Macro Definition Documentation

#define BITSTREAM_READER_LE

Definition at line 32 of file sipr.c.

#define MAX_SUBFRAME_COUNT   5

Definition at line 42 of file sipr.c.

Referenced by decode_frame().

Function Documentation

static void dequant ( float *  out,
const int idx,
const float *const  cbs[] 
)
static

Definition at line 142 of file sipr.c.

Referenced by lsf_decode_fp().

static void lsf_decode_fp ( float *  lsfnew,
float *  lsf_history,
const SiprParameters parm 
)
static

Definition at line 153 of file sipr.c.

Referenced by decode_frame().

static void pitch_sharpening ( int  pitch_lag_int,
float  beta,
float *  fixed_vector 
)
static

Apply pitch lag to the fixed vector (AMR section 6.1.2).

Definition at line 179 of file sipr.c.

Referenced by eval_ir().

static void decode_parameters ( SiprParameters parms,
GetBitContext pgb,
const SiprModeParam p 
)
static

Extract decoding parameters from the input bitstream.

Parameters
parmsparameters structure
pgbpointer to initialized GetBitContext structure

Definition at line 193 of file sipr.c.

Referenced by sipr_decode_frame().

static void sipr_decode_lp ( float *  lsfnew,
const float *  lsfold,
float *  Az,
int  num_subfr 
)
static

Definition at line 216 of file sipr.c.

Referenced by decode_frame().

static void eval_ir ( const float *  Az,
int  pitch_lag,
float *  freq,
float  pitch_sharp_factor 
)
static

Evaluate the adaptive impulse response.

Definition at line 237 of file sipr.c.

Referenced by decode_frame().

static void convolute_with_sparse ( float *  out,
const AMRFixed pulses,
const float *  shape,
int  length 
)
static

Evaluate the convolution of a vector with a sparse vector.

Definition at line 259 of file sipr.c.

Referenced by decode_frame().

static void postfilter_5k0 ( SiprContext ctx,
const float *  lpc,
float *  samples 
)
static

Apply postfilter, very similar to AMR one.

Definition at line 273 of file sipr.c.

Referenced by decode_frame().

static void decode_fixed_sparse ( AMRFixed fixed_sparse,
const int16_t *  pulses,
SiprMode  mode,
int  low_gain 
)
static

Definition at line 308 of file sipr.c.

Referenced by decode_frame().

static void decode_frame ( SiprContext ctx,
SiprParameters params,
float *  out_data 
)
static

Definition at line 364 of file sipr.c.

Referenced by sipr_decoder_init().

static av_cold int sipr_decoder_init ( AVCodecContext avctx)
static

Definition at line 480 of file sipr.c.

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

Definition at line 522 of file sipr.c.

Variable Documentation

const SiprModeParam modes[MODE_COUNT]
static

Definition at line 69 of file sipr.c.

Referenced by decode_mb_mode(), and libsrt_network_wait_fd().

const float ff_pow_0_5[]
Initial value:
= {
1.0/(1 << 1), 1.0/(1 << 2), 1.0/(1 << 3), 1.0/(1 << 4),
1.0/(1 << 5), 1.0/(1 << 6), 1.0/(1 << 7), 1.0/(1 << 8),
1.0/(1 << 9), 1.0/(1 << 10), 1.0/(1 << 11), 1.0/(1 << 12),
1.0/(1 << 13), 1.0/(1 << 14), 1.0/(1 << 15), 1.0/(1 << 16)
}

Definition at line 135 of file sipr.c.

Referenced by postfilter(), and postfilter_5k0().

AVCodec ff_sipr_decoder
Initial value:
= {
.name = "sipr",
.long_name = NULL_IF_CONFIG_SMALL("RealAudio SIPR / ACELP.NET"),
.priv_data_size = sizeof(SiprContext),
.capabilities = AV_CODEC_CAP_DR1,
}
static av_cold int sipr_decoder_init(AVCodecContext *avctx)
Definition: sipr.c:480
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static int sipr_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: sipr.c:522
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:968

Definition at line 565 of file sipr.c.