|
FFmpeg
|
AMR narrowband decoder. More...
#include <string.h>#include <math.h>#include "libavutil/channel_layout.h"#include "libavutil/float_dsp.h"#include "avcodec.h"#include "libavutil/common.h"#include "libavutil/avassert.h"#include "celp_math.h"#include "celp_filters.h"#include "acelp_filters.h"#include "acelp_vectors.h"#include "acelp_pitch_delay.h"#include "lsp.h"#include "amr.h"#include "internal.h"#include "amrnbdata.h"Classes | |
| struct | AMRContext |
Macros | |
| #define | AMR_BLOCK_SIZE 160 |
| samples per frame | |
| #define | AMR_SAMPLE_BOUND 32768.0 |
| threshold for synthesis overflow | |
| #define | AMR_SAMPLE_SCALE (2.0 / 32768.0) |
| Scale from constructed speech to [-1,1]. More... | |
| #define | PRED_FAC_MODE_12k2 0.65 |
| Prediction factor for 12.2kbit/s mode. | |
| #define | LSF_R_FAC (8000.0 / 32768.0) |
| LSF residual tables to Hertz. | |
| #define | MIN_LSF_SPACING (50.0488 / 8000.0) |
| Ensures stability of LPC filter. | |
| #define | PITCH_LAG_MIN_MODE_12k2 18 |
| Lower bound on decoded lag search in 12.2kbit/s mode. | |
| #define | MIN_ENERGY -14.0 |
| Initial energy in dB. More... | |
| #define | SHARP_MAX 0.79449462890625 |
| Maximum sharpening factor. More... | |
| #define | AMR_TILT_RESPONSE 22 |
| Number of impulse response coefficients used for tilt factor. | |
| #define | AMR_TILT_GAMMA_T 0.8 |
| Tilt factor = 1st reflection coefficient * gamma_t. | |
| #define | AMR_AGC_ALPHA 0.9 |
| Adaptive gain control factor used in post-filter. | |
Typedefs | |
| typedef struct AMRContext | AMRContext |
Variables | |
| AVCodec | ff_amrnb_decoder |
AMR narrowband decoder.
This decoder uses floats for simplicity and so is not bit-exact. One difference is that differences in phase can accumulate. The test sequences in 3GPP TS 26.074 can still be useful.
| #define AMR_SAMPLE_SCALE (2.0 / 32768.0) |
Scale from constructed speech to [-1,1].
AMR is designed to produce 16-bit PCM samples (3GPP TS 26.090 4.2) but upscales by two (section 6.2.2).
Fundamentally, this scale is determined by energy_mean through the fixed vector contribution to the excitation vector.
| #define MIN_ENERGY -14.0 |
Initial energy in dB.
Also used for bad frames (unimplemented).
| #define SHARP_MAX 0.79449462890625 |
Maximum sharpening factor.
The specification says 0.8, which should be 13107, but the reference C code uses 13017 instead. (Amusingly the same applies to SHARP_MAX in g729dec.c.)
| AVCodec ff_amrnb_decoder |
1.8.12