FFmpeg
|
#include <inttypes.h>
#include <string.h>
#include "avcodec.h"
#include "libavutil/avutil.h"
#include "libavutil/mem.h"
#include "get_bits.h"
#include "audiodsp.h"
#include "codec_internal.h"
#include "decode.h"
#include "g729.h"
#include "lsp.h"
#include "celp_filters.h"
#include "acelp_filters.h"
#include "acelp_pitch_delay.h"
#include "acelp_vectors.h"
#include "g729data.h"
#include "g729postfilter.h"
Go to the source code of this file.
Data Structures | |
struct | G729FormatDescription |
struct | G729ChannelContext |
struct | G729Context |
Macros | |
#define | LSFQ_MIN 40 |
minimum quantized LSF value (3.2.4) 0.005 in Q13 More... | |
#define | LSFQ_MAX 25681 |
maximum quantized LSF value (3.2.4) 3.135 in Q13 More... | |
#define | LSFQ_DIFF_MIN 321 |
minimum LSF distance (3.2.4) 0.0391 in Q13 More... | |
#define | INTERPOL_LEN 11 |
interpolation filter length More... | |
#define | SHARP_MIN 3277 |
minimum gain pitch value (3.8, Equation 47) 0.2 in (1.14) More... | |
#define | SHARP_MAX 13017 |
maximum gain pitch value (3.8, Equation 47) (EE) This does not comply with the specification. More... | |
#define | MR_ENERGY 1018156 |
MR_ENERGY (mean removed energy) = mean_energy + 10 * log10(2^26 * subframe_size) in (7.13) More... | |
#define | DECISION_NOISE 0 |
#define | DECISION_INTERMEDIATE 1 |
#define | DECISION_VOICE 2 |
Enumerations | |
enum | G729Formats { FORMAT_G729_8K = 0, FORMAT_G729D_6K4, FORMAT_COUNT } |
Functions | |
static uint16_t | g729_prng (uint16_t value) |
pseudo random number generator More... | |
static void | lsf_decode (int16_t *lsfq, int16_t *past_quantizer_outputs[MA_NP+1], int16_t ma_predictor, int16_t vq_1st, int16_t vq_2nd_low, int16_t vq_2nd_high) |
Decodes LSF (Line Spectral Frequencies) from L0-L3 (3.2.4). More... | |
static void | lsf_restore_from_previous (int16_t *lsfq, int16_t *past_quantizer_outputs[MA_NP+1], int ma_predictor_prev) |
Restores past LSP quantizer output using LSF from previous frame. More... | |
static void | g729d_get_new_exc (int16_t *out, const int16_t *in, const int16_t *fc_cur, int dstate, int gain_code, int subframe_size) |
Constructs new excitation signal and applies phase filter to it. More... | |
static int | g729d_onset_decision (int past_onset, const int16_t *past_gain_code) |
Makes decision about onset in current subframe. More... | |
static int16_t | g729d_voice_decision (int onset, int prev_voice_decision, const int16_t *past_gain_pitch) |
Makes decision about voice presence in current subframe. More... | |
static int32_t | scalarproduct_int16_c (const int16_t *v1, const int16_t *v2, int order) |
static av_cold int | decoder_init (AVCodecContext *avctx) |
static int | decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) |
static av_cold int | decode_close (AVCodecContext *avctx) |
Variables | |
static const G729FormatDescription | format_g729_8k |
static const G729FormatDescription | format_g729d_6k4 |
const FFCodec | ff_g729_decoder |
const FFCodec | ff_acelp_kelvin_decoder |
#define LSFQ_MIN 40 |
#define LSFQ_MAX 25681 |
#define LSFQ_DIFF_MIN 321 |
#define SHARP_MIN 3277 |
#define SHARP_MAX 13017 |
#define MR_ENERGY 1018156 |
enum G729Formats |
|
inlinestatic |
pseudo random number generator
Definition at line 186 of file g729dec.c.
Referenced by decode_frame().
|
static |
Decodes LSF (Line Spectral Frequencies) from L0-L3 (3.2.4).
[out] | lsfq | (2.13) quantized LSF coefficients |
[in,out] | past_quantizer_outputs | (2.13) quantizer outputs from previous frames |
ma_predictor | switched MA predictor of LSP quantizer | |
vq_1st | first stage vector of quantizer | |
vq_2nd_low | second stage lower vector of LSP quantizer | |
vq_2nd_high | second stage higher vector of LSP quantizer |
Definition at line 200 of file g729dec.c.
Referenced by decode_frame().
|
static |
Restores past LSP quantizer output using LSF from previous frame.
[in,out] | lsfq | (2.13) quantized LSF coefficients |
[in,out] | past_quantizer_outputs | (2.13) quantizer outputs from previous frames |
ma_predictor_prev | MA predictor from previous frame | |
lsfq_prev | (2.13) quantized LSF coefficients from previous frame |
Definition at line 241 of file g729dec.c.
Referenced by decode_frame().
|
static |
Constructs new excitation signal and applies phase filter to it.
[out] | out | constructed speech signal |
in | original excitation signal | |
fc_cur | (2.13) original fixed-codebook vector | |
gain_code | (14.1) gain code | |
subframe_size | length of the subframe |
Definition at line 266 of file g729dec.c.
Referenced by decode_frame().
|
static |
Makes decision about onset in current subframe.
past_onset | decision result of previous subframe |
past_gain_code | gain code of current and previous subframe |
Definition at line 293 of file g729dec.c.
Referenced by decode_frame().
|
static |
Makes decision about voice presence in current subframe.
onset | onset level |
prev_voice_decision | voice decision result from previous subframe |
past_gain_pitch | pitch gain of current and previous subframes |
Definition at line 309 of file g729dec.c.
Referenced by decode_frame().
|
static |
Definition at line 337 of file g729dec.c.
Referenced by decoder_init().
|
static |
|
static |
< switched MA predictor of LSP quantizer
< first stage vector of quantizer
< second stage lower vector of quantizer (size in bits)
< second stage higher vector of quantizer (size in bits)
< frame erasure detected during decoding
< parity check failed
< whether one of the subframes is declared as periodic or not
< adaptive codebook index
< fixed-codebook vector pulse signs
< fixed-codebook indexes
< gain codebook (first stage) index
< gain codebook (second stage) index
|
static |
|
static |
Definition at line 163 of file g729dec.c.
Referenced by decode_frame().
|
static |
Definition at line 173 of file g729dec.c.
Referenced by decode_frame().
const FFCodec ff_g729_decoder |
const FFCodec ff_acelp_kelvin_decoder |