27 #define BITSTREAM_READER_LE
41 float ppc_gain,
float *speech,
int len)
44 const float *shape_end = shape +
len;
47 for (i = 0; i < width / 2; i++)
48 speech[i] += ppc_gain * *shape++;
51 center = (int)(i * period + 0.5);
52 for (j = -width / 2; j < (width + 1) / 2; j++)
53 speech[j + center] += ppc_gain * *shape++;
57 center = (int)(i * period + 0.5);
58 for (j = -width / 2; j < (width + 1) / 2 && shape < shape_end; j++)
59 speech[j + center] += ppc_gain * *shape++;
63 const float *shape,
float *speech)
70 float ratio = (float)mtab->
size / isampf;
71 float min_period, max_period, period_range, period;
74 float pgain_base, pgain_step, ppc_gain;
77 min_period =
log2(ratio * 0.2);
78 max_period = min_period +
log2(6);
80 min_period = (int)(ratio * 0.2 * 400 + 0.5) / 400.0;
81 max_period = (int)(ratio * 0.2 * 400 * 6 + 0.5) / 400.0;
83 period_range = max_period - min_period;
84 period = min_period + period_coef * period_range /
87 period =
powf(2.0, period);
89 period = (int)(period * 400 + 0.5) / 400.0;
92 case 8: some_mult = 2.0;
break;
93 case 11: some_mult = 3.0;
break;
94 case 16: some_mult = 3.0;
break;
95 case 22: some_mult = ibps == 32 ? 2.0 : 4.0;
break;
96 case 44: some_mult = 8.0;
break;
97 default: some_mult = 4.0;
101 if (isampf == 22 && ibps == 32)
102 width = (int)((2.0 / period + 1) * width + 0.5);
105 pgain_step = pgain_base / ((1 << mtab->
pgain_bit) - 1);
106 ppc_gain = 1.0 / 8192 *
114 int ch,
float *
out,
float gain,
119 float *hist = tctx->
bark_hist[ftype][ch];
120 float val = ((
const float []) { 0.4, 0.35, 0.28 })[ftype];
127 for (i = 0; i < fw_cb_len; i++)
128 for (j = 0; j < bark_n_coef; j++, idx++) {
129 float tmp2 = mtab->
fmode[ftype].
bark_cb[fw_cb_len * in[j] + i] *
135 tmp2 + val * hist[idx] + 1.0 : tmp2 + 1.0;
137 st = use_hist ? (1.0 -
val) * tmp2 + val * hist[idx] + 1.0
155 for (i = 0; i < tctx->
n_div[ftype]; i++) {
195 for (i = 0; i < channels; i++)
196 for (j = 0; j < sub; j++)
198 bits->
bark1[i][j][k] =
201 for (i = 0; i < channels; i++)
202 for (j = 0; j < sub; j++)
206 for (i = 0; i < channels; i++)
209 for (i = 0; i < channels; i++) {
211 for (j = 0; j < sub; j++)
217 for (i = 0; i < channels; i++) {
227 for (i = 0; i < channels; i++) {
249 {
MKTAG(
'V',
'X',
'0',
'3'), 6, 1, 8000 },
250 {
MKTAG(
'V',
'X',
'0',
'4'), 12, 2, 8000 },
252 {
MKTAG(
'V',
'O',
'X',
'i'), 8, 1, 8000 },
253 {
MKTAG(
'V',
'O',
'X',
'j'), 10, 1, 11025 },
254 {
MKTAG(
'V',
'O',
'X',
'k'), 16, 1, 16000 },
255 {
MKTAG(
'V',
'O',
'X',
'L'), 24, 1, 22050 },
256 {
MKTAG(
'V',
'O',
'X',
'q'), 32, 1, 44100 },
257 {
MKTAG(
'V',
'O',
'X',
'r'), 40, 1, 44100 },
258 {
MKTAG(
'V',
'O',
'X',
's'), 48, 1, 44100 },
259 {
MKTAG(
'V',
'O',
'X',
't'), 16, 2, 8000 },
260 {
MKTAG(
'V',
'O',
'X',
'u'), 20, 2, 11025 },
261 {
MKTAG(
'V',
'O',
'X',
'v'), 32, 2, 16000 },
262 {
MKTAG(
'V',
'O',
'X',
'w'), 48, 2, 22050 },
263 {
MKTAG(
'V',
'O',
'X',
'x'), 64, 2, 44100 },
264 {
MKTAG(
'V',
'O',
'X',
'y'), 80, 2, 44100 },
265 {
MKTAG(
'V',
'O',
'X',
'z'), 96, 2, 44100 },
289 if (props->
tag == tag) {
309 switch ((avctx->
channels << 16) + (isampf << 8) + ibps) {
310 case (1 << 16) + ( 8 << 8) + 6:
313 case (2 << 16) + ( 8 << 8) + 6:
316 case (1 << 16) + ( 8 << 8) + 8:
319 case (2 << 16) + ( 8 << 8) + 8:
322 case (1 << 16) + (11 << 8) + 10:
325 case (2 << 16) + (11 << 8) + 10:
328 case (1 << 16) + (16 << 8) + 16:
331 case (2 << 16) + (16 << 8) + 16:
334 case (1 << 16) + (22 << 8) + 24:
337 case (2 << 16) + (22 << 8) + 24:
340 case (1 << 16) + (44 << 8) + 32:
343 case (2 << 16) + (44 << 8) + 32:
346 case (1 << 16) + (44 << 8) + 40:
349 case (2 << 16) + (44 << 8) + 40:
352 case (1 << 16) + (44 << 8) + 48:
355 case (2 << 16) + (44 << 8) + 48:
360 "This version does not support %d kHz - %d kbit/s/ch mode.\n",