mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-04-26 01:04:45 +08:00
More OKed parts of the QCELP decoder
patch by Kenan Gillet, kenan.gillet gmail com Originally committed as revision 15802 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
committed by
Vitor Sessak
parent
e22192ecc3
commit
200de8c6bb
@@ -378,6 +378,38 @@ static const qcelp_vector * const qcelp_lspvq[5] = {
|
||||
qcelp_lspvq5
|
||||
};
|
||||
|
||||
/**
|
||||
* the final gain scalefactor before clipping into a usable output float
|
||||
*/
|
||||
#define QCELP_SCALE 8192.
|
||||
|
||||
/**
|
||||
* table for computing Ga (decoded linear codebook gain magnitude)
|
||||
*
|
||||
* @note The table could fit in int16_t in x*8 form, but it seems
|
||||
* to be slower on x86
|
||||
*
|
||||
* TIA/EIA/IS-733 2.4.6.2.1-3
|
||||
*/
|
||||
|
||||
static const float qcelp_g12ga[61] = {
|
||||
1.000/QCELP_SCALE, 1.125/QCELP_SCALE, 1.250/QCELP_SCALE, 1.375/QCELP_SCALE,
|
||||
1.625/QCELP_SCALE, 1.750/QCELP_SCALE, 2.000/QCELP_SCALE, 2.250/QCELP_SCALE,
|
||||
2.500/QCELP_SCALE, 2.875/QCELP_SCALE, 3.125/QCELP_SCALE, 3.500/QCELP_SCALE,
|
||||
4.000/QCELP_SCALE, 4.500/QCELP_SCALE, 5.000/QCELP_SCALE, 5.625/QCELP_SCALE,
|
||||
6.250/QCELP_SCALE, 7.125/QCELP_SCALE, 8.000/QCELP_SCALE, 8.875/QCELP_SCALE,
|
||||
10.000/QCELP_SCALE, 11.250/QCELP_SCALE, 12.625/QCELP_SCALE, 14.125/QCELP_SCALE,
|
||||
15.875/QCELP_SCALE, 17.750/QCELP_SCALE, 20.000/QCELP_SCALE, 22.375/QCELP_SCALE,
|
||||
25.125/QCELP_SCALE, 28.125/QCELP_SCALE, 31.625/QCELP_SCALE, 35.500/QCELP_SCALE,
|
||||
39.750/QCELP_SCALE, 44.625/QCELP_SCALE, 50.125/QCELP_SCALE, 56.250/QCELP_SCALE,
|
||||
63.125/QCELP_SCALE, 70.750/QCELP_SCALE, 79.375/QCELP_SCALE, 89.125/QCELP_SCALE,
|
||||
100.000/QCELP_SCALE, 112.250/QCELP_SCALE, 125.875/QCELP_SCALE, 141.250/QCELP_SCALE,
|
||||
158.500/QCELP_SCALE, 177.875/QCELP_SCALE, 199.500/QCELP_SCALE, 223.875/QCELP_SCALE,
|
||||
251.250/QCELP_SCALE, 281.875/QCELP_SCALE, 316.250/QCELP_SCALE, 354.875/QCELP_SCALE,
|
||||
398.125/QCELP_SCALE, 446.625/QCELP_SCALE, 501.125/QCELP_SCALE, 563.375/QCELP_SCALE,
|
||||
631.000/QCELP_SCALE, 708.000/QCELP_SCALE, 794.375/QCELP_SCALE, 891.250/QCELP_SCALE,
|
||||
1000.000/QCELP_SCALE};
|
||||
|
||||
/**
|
||||
* circular codebook for rate 1 frames in x*100 form
|
||||
*
|
||||
@@ -428,4 +460,18 @@ static const int8_t qcelp_rate_half_codebook[128] = {
|
||||
};
|
||||
#define QCELP_RATE_HALF_CODEBOOK_RATIO 0.5
|
||||
|
||||
/**
|
||||
* table for impulse response of BPF used to filter
|
||||
* the white excitation for framerate 1/4 synthesis
|
||||
*
|
||||
* Only half the tables are needed because of symetry.
|
||||
*
|
||||
* TIA/EIA/IS-733 2.4.8.1.2-1.1
|
||||
*/
|
||||
static const double qcelp_rnd_fir_coefs[11] = {
|
||||
-1.344519e-1, 1.735384e-2, -6.905826e-2, 2.434368e-2,
|
||||
-8.210701e-2, 3.041388e-2, -9.251384e-2, 3.501983e-2,
|
||||
-9.918777e-2, 3.749518e-2, 8.985137e-1
|
||||
};
|
||||
|
||||
#endif /* AVCODEC_QCELPDATA_H */
|
||||
|
||||
Reference in New Issue
Block a user