1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
| namespace NSpeex
| {
| using System;
|
| internal class LtpForcedPitch : Ltp
| {
| public sealed override int Quant(float[] target, float[] sw, int sws, float[] ak, float[] awk1, float[] awk2, float[] exc, int es, int start, int end, float pitch_coef, int p, int nsf, Bits bits, float[] exc2, int e2s, float[] r, int complexity)
| {
| if (pitch_coef > 0.99f)
| {
| pitch_coef = 0.99f;
| }
| for (int i = 0; i < nsf; i++)
| {
| exc[es + i] = exc[(es + i) - start] * pitch_coef;
| }
| return start;
| }
|
| public sealed override int Unquant(float[] exc, int es, int start, float pitch_coef, int nsf, float[] gain_val, Bits bits, int count_lost, int subframe_offset, float last_pitch_gain)
| {
| if (pitch_coef > 0.99f)
| {
| pitch_coef = 0.99f;
| }
| for (int i = 0; i < nsf; i++)
| {
| exc[es + i] = exc[(es + i) - start] * pitch_coef;
| }
| gain_val[0] = gain_val[2] = 0f;
| gain_val[1] = pitch_coef;
| return start;
| }
| }
| }
|
|