FFmpeg
Loading...
Searching...
No Matches
silk.c File Reference

Opus SILK decoder. More...

#include <stdint.h>
#include "libavutil/mem.h"
#include "libavcodec/mathops.h"
#include "opus.h"
#include "rc.h"
#include "silk.h"
#include "tab.h"

Go to the source code of this file.

Data Structures

struct  SilkFrame
 
struct  SilkContext
 

Macros

#define ROUND_MULL(a, b, s)
 
#define SILK_MAX_LAG   (288 + LTP_ORDER / 2)
 Maximum residual history according to 4.2.7.6.1.
 
#define LTP_ORDER   5
 Order of the LTP filter.
 

Functions

static void silk_stabilize_lsf (int16_t nlsf[16], int order, const uint16_t min_delta[17])
 
static int silk_is_lpc_stable (const int16_t lpc[16], int order)
 
static void silk_lsp2poly (const int32_t lsp[], int32_t pol[], int half_order)
 
static void silk_lsf2lpc (const int16_t nlsf[16], float lpcf[16], int order)
 
static void silk_decode_lpc (SilkContext *s, SilkFrame *frame, OpusRangeCoder *rc, float lpc_leadin[16], float lpc[16], int *lpc_order, int *has_lpc_leadin, int voiced)
 
static void silk_count_children (OpusRangeCoder *rc, int model, int32_t total, int32_t child[2])
 
static void silk_decode_excitation (SilkContext *s, OpusRangeCoder *rc, float *excitationf, int qoffset_high, int active, int voiced)
 
static void silk_decode_frame (SilkContext *s, OpusRangeCoder *rc, int frame_num, int channel, int coded_channels, int active, int active1, int redundant)
 
static void silk_unmix_ms (SilkContext *s, float *l, float *r)
 
static void silk_flush_frame (SilkFrame *frame)
 
int ff_silk_decode_superframe (SilkContext *s, OpusRangeCoder *rc, float *output[2], enum OpusBandwidth bandwidth, int coded_channels, int duration_ms)
 Decode the LP layer of one Opus frame (which may correspond to several SILK frames).
 
void ff_silk_free (SilkContext **ps)
 
void ff_silk_flush (SilkContext *s)
 
int ff_silk_init (void *logctx, SilkContext **ps, int output_channels)
 

Detailed Description

Opus SILK decoder.

Definition in file silk.c.

Macro Definition Documentation

◆ ROUND_MULL

#define ROUND_MULL ( a,
b,
s )
Value:
(((MUL64(a, b) >> ((s) - 1)) + 1) >> 1)
#define s(width, name)
Definition cbs_vp9.c:198
int a
#define b
Definition input.c:43
#define MUL64(a, b)
Definition mathops.h:56

Definition at line 38 of file silk.c.

Referenced by silk_is_lpc_stable(), silk_lsf2lpc(), and silk_lsp2poly().

◆ SILK_MAX_LAG

#define SILK_MAX_LAG   (288 + LTP_ORDER / 2)

Maximum residual history according to 4.2.7.6.1.

Definition at line 504 of file silk.c.

Referenced by silk_decode_frame().

◆ LTP_ORDER

#define LTP_ORDER   5

Order of the LTP filter.

Definition at line 507 of file silk.c.

Referenced by silk_decode_frame().

Function Documentation

◆ silk_stabilize_lsf()

static void silk_stabilize_lsf ( int16_t nlsf[16],
int order,
const uint16_t min_delta[17] )
inlinestatic

Definition at line 73 of file silk.c.

Referenced by silk_decode_lpc().

◆ silk_is_lpc_stable()

static int silk_is_lpc_stable ( const int16_t lpc[16],
int order )
inlinestatic

Definition at line 151 of file silk.c.

Referenced by silk_lsf2lpc().

◆ silk_lsp2poly()

static void silk_lsp2poly ( const int32_t lsp[],
int32_t pol[],
int half_order )
static

Definition at line 209 of file silk.c.

Referenced by silk_lsf2lpc().

◆ silk_lsf2lpc()

static void silk_lsf2lpc ( const int16_t nlsf[16],
float lpcf[16],
int order )
static

Definition at line 226 of file silk.c.

Referenced by silk_decode_lpc().

◆ silk_decode_lpc()

static void silk_decode_lpc ( SilkContext * s,
SilkFrame * frame,
OpusRangeCoder * rc,
float lpc_leadin[16],
float lpc[16],
int * lpc_order,
int * has_lpc_leadin,
int voiced )
inlinestatic

Definition at line 313 of file silk.c.

Referenced by silk_decode_frame().

◆ silk_count_children()

static void silk_count_children ( OpusRangeCoder * rc,
int model,
int32_t total,
int32_t child[2] )
inlinestatic

Definition at line 402 of file silk.c.

Referenced by silk_decode_excitation().

◆ silk_decode_excitation()

static void silk_decode_excitation ( SilkContext * s,
OpusRangeCoder * rc,
float * excitationf,
int qoffset_high,
int active,
int voiced )
inlinestatic

Definition at line 415 of file silk.c.

Referenced by silk_decode_frame().

◆ silk_decode_frame()

static void silk_decode_frame ( SilkContext * s,
OpusRangeCoder * rc,
int frame_num,
int channel,
int coded_channels,
int active,
int active1,
int redundant )
static

Definition at line 509 of file silk.c.

Referenced by ff_silk_decode_superframe().

◆ silk_unmix_ms()

static void silk_unmix_ms ( SilkContext * s,
float * l,
float * r )
static

Definition at line 738 of file silk.c.

Referenced by ff_silk_decode_superframe().

◆ silk_flush_frame()

static void silk_flush_frame ( SilkFrame * frame)
static

Definition at line 768 of file silk.c.

Referenced by ff_silk_decode_superframe(), and ff_silk_flush().

◆ ff_silk_decode_superframe()

int ff_silk_decode_superframe ( SilkContext * s,
OpusRangeCoder * rc,
float * output[2],
enum OpusBandwidth bandwidth,
int coded_channels,
int duration_ms )

Decode the LP layer of one Opus frame (which may correspond to several SILK frames).

Definition at line 786 of file silk.c.

Referenced by opus_decode_frame().

◆ ff_silk_free()

void ff_silk_free ( SilkContext ** ps)

Definition at line 866 of file silk.c.

Referenced by opus_decode_close().

◆ ff_silk_flush()

void ff_silk_flush ( SilkContext * s)

Definition at line 871 of file silk.c.

Referenced by ff_silk_init(), opus_decode_flush(), and opus_decode_frame().

◆ ff_silk_init()

int ff_silk_init ( void * logctx,
SilkContext ** ps,
int output_channels )

Definition at line 879 of file silk.c.

Referenced by opus_decode_init().