spandsp 0.0.6
plc.c File Reference
#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include "floating_fudge.h"
#include <limits.h>
#include "spandsp/telephony.h"
#include "spandsp/fast_convert.h"
#include "spandsp/saturated.h"
#include "spandsp/plc.h"

Macros

#define ATTENUATION_INCREMENT   0.0025f /* Attenuation per sample */
 

Functions

int plc_rx (plc_state_t *s, int16_t amp[], int len)
 Process a block of received audio samples for PLC. More...
 
int plc_fillin (plc_state_t *s, int16_t amp[], int len)
 Fill-in a block of missing audio samples. More...
 
plc_state_tplc_init (plc_state_t *s)
 Initialise a PLC context. More...
 
int plc_release (plc_state_t *s)
 
int plc_free (plc_state_t *s)
 

Function Documentation

◆ plc_fillin()

int plc_fillin ( plc_state_t s,
int16_t  amp[],
int  len 
)

Fill-in a block of missing audio samples.

Fill-in a block of missing audio samples.

Parameters
sThe packet loss concealer context.
ampThe audio sample buffer.
lenThe number of samples to be synthesised.
Returns
The number of samples synthesized.

◆ plc_free()

int plc_free ( plc_state_t s)

Free a packet loss concealer context.

Parameters
sThe packet loss concealer context.
Returns
0 for OK.

◆ plc_init()

plc_state_t * plc_init ( plc_state_t s)

Initialise a PLC context.

Initialise a packet loss concealer context.

Parameters
sThe packet loss concealer context.
Returns
A pointer to the the packet loss concealer context.

◆ plc_release()

int plc_release ( plc_state_t s)

Release a packet loss concealer context.

Parameters
sThe packet loss concealer context.
Returns
0 for OK.

◆ plc_rx()

int plc_rx ( plc_state_t s,
int16_t  amp[],
int  len 
)

Process a block of received audio samples for PLC.

Process a block of received audio samples for PLC.

Parameters
sThe packet loss concealer context.
ampThe audio sample buffer.
lenThe number of samples in the buffer.
Returns
The number of samples in the buffer.