Mercurial > libavcodec.hg
comparison ra288.c @ 7431:da24b77f46f6 libavcodec
Add a few comments pointing to the G.728 specification
author | vitor |
---|---|
date | Sun, 27 Jul 2008 22:22:51 +0000 |
parents | 4ebfb53ff2df |
children | 158d1acfe3bf |
comparison
equal
deleted
inserted
replaced
7430:4ebfb53ff2df | 7431:da24b77f46f6 |
---|---|
72 | 72 |
73 for (x=4; x >= 0; x--) | 73 for (x=4; x >= 0; x--) |
74 ractx->sb[x] = -scalar_product_float(ractx->sb + x + 1, | 74 ractx->sb[x] = -scalar_product_float(ractx->sb + x + 1, |
75 ractx->sp_lpc, 36); | 75 ractx->sp_lpc, 36); |
76 | 76 |
77 /* convert log and do rms */ | 77 /* block 46 of G.728 spec */ |
78 sum = 32. - scalar_product_float(ractx->gain_lpc, ractx->lhist, 10); | 78 sum = 32. - scalar_product_float(ractx->gain_lpc, ractx->lhist, 10); |
79 | 79 |
80 /* block 47 of G.728 spec */ | |
80 sum = av_clipf(sum, 0, 60); | 81 sum = av_clipf(sum, 0, 60); |
81 | 82 |
83 /* block 48 of G.728 spec */ | |
82 sumsum = exp(sum * 0.1151292546497) * gain; /* pow(10.0,sum/20)*f */ | 84 sumsum = exp(sum * 0.1151292546497) * gain; /* pow(10.0,sum/20)*f */ |
83 | 85 |
84 for (x=0; x < 5; x++) | 86 for (x=0; x < 5; x++) |
85 buffer[x] = codetable[cb_coef][x] * sumsum; | 87 buffer[x] = codetable[cb_coef][x] * sumsum; |
86 | 88 |