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/saturated.h"
#include "spandsp/plc.h"

Defines

#define ATTENUATION_INCREMENT   0.0025f
#define ms_to_samples(t)   (((t)*SAMPLE_RATE)/1000)

Functions

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

Detailed Description


Function Documentation

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:
s The packet loss concealer context.
amp The audio sample buffer.
len The number of samples to be synthesised.
Returns:
The number of samples synthesized.

References CORRELATION_SPAN, plc_state_t::history, plc_state_t::missing_samples, plc_state_t::pitch, plc_state_t::pitch_offset, plc_state_t::pitchbuf, PLC_HISTORY_LEN, PLC_PITCH_MAX, and PLC_PITCH_MIN.

int plc_free ( plc_state_t s  ) 

Free a packet loss concealer context.

Parameters:
s The packet loss concealer context.
Returns:
0 for OK.

plc_state_t* plc_init ( plc_state_t s  ) 

Initialise a PLC context.

Initialise a packet loss concealer context.

Parameters:
s The packet loss concealer context.
Returns:
A pointer to the the packet loss concealer context.

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:
s The packet loss concealer context.
amp The audio sample buffer.
len The number of samples in the buffer.
Returns:
The number of samples in the buffer.

References plc_state_t::missing_samples, plc_state_t::pitch, plc_state_t::pitch_offset, and plc_state_t::pitchbuf.


Generated on Tue Oct 7 20:25:51 2008 for spandsp by  doxygen 1.5.6