28 #define BITSTREAM_READER_LE
42 float ppc_gain,
float *speech,
int len)
45 const float *shape_end = shape +
len;
48 for (i = 0; i < width / 2; i++)
49 speech[i] += ppc_gain * *shape++;
52 center = (int)(i * period + 0.5);
53 for (j = -width / 2; j < (width + 1) / 2; j++)
54 speech[j + center] += ppc_gain * *shape++;
58 center = (int)(i * period + 0.5);
59 for (j = -width / 2; j < (width + 1) / 2 && shape < shape_end; j++)
60 speech[j + center] += ppc_gain * *shape++;
64 const float *shape,
float *speech)
71 float ratio = (float)mtab->
size / isampf;
72 float min_period, max_period, period_range, period;
75 float pgain_base, pgain_step, ppc_gain;
78 min_period =
log2(ratio * 0.2);
79 max_period = min_period +
log2(6);
81 min_period = (int)(ratio * 0.2 * 400 + 0.5) / 400.0;
82 max_period = (int)(ratio * 0.2 * 400 * 6 + 0.5) / 400.0;
84 period_range = max_period - min_period;
85 period = min_period + period_coef * period_range /
88 period =
powf(2.0, period);
90 period = (int)(period * 400 + 0.5) / 400.0;
93 case 8: some_mult = 2.0;
break;
94 case 11: some_mult = 3.0;
break;
95 case 16: some_mult = 3.0;
break;
96 case 22: some_mult = ibps == 32 ? 2.0 : 4.0;
break;
97 case 44: some_mult = 8.0;
break;
98 default: some_mult = 4.0;
102 if (isampf == 22 && ibps == 32)
103 width = (int)((2.0 / period + 1) * width + 0.5);
106 pgain_step = pgain_base / ((1 << mtab->
pgain_bit) - 1);
107 ppc_gain = 1.0 / 8192 *
115 int ch,
float *
out,
float gain,
120 float *hist = tctx->
bark_hist[ftype][ch];
121 float val = ((
const float []) { 0.4, 0.35, 0.28 })[ftype];
128 for (i = 0; i < fw_cb_len; i++)
129 for (j = 0; j < bark_n_coef; j++, idx++) {
130 float tmp2 = mtab->
fmode[ftype].
bark_cb[fw_cb_len * in[j] + i] *
136 tmp2 + val * hist[idx] + 1.0 : tmp2 + 1.0;
138 st = use_hist ? (1.0 -
val) * tmp2 + val * hist[idx] + 1.0
156 for (i = 0; i < tctx->
n_div[ftype]; i++) {
196 for (i = 0; i < channels; i++)
197 for (j = 0; j < sub; j++)
199 bits->
bark1[i][j][k] =
202 for (i = 0; i < channels; i++)
203 for (j = 0; j < sub; j++)
207 for (i = 0; i < channels; i++)
210 for (i = 0; i < channels; i++) {
212 for (j = 0; j < sub; j++)
218 for (i = 0; i < channels; i++) {
228 for (i = 0; i < channels; i++) {
250 {
MKTAG(
'V',
'X',
'0',
'3'), 6, 1, 8000 },
251 {
MKTAG(
'V',
'X',
'0',
'4'), 12, 2, 8000 },
253 {
MKTAG(
'V',
'O',
'X',
'i'), 8, 1, 8000 },
254 {
MKTAG(
'V',
'O',
'X',
'j'), 10, 1, 11025 },
255 {
MKTAG(
'V',
'O',
'X',
'k'), 16, 1, 16000 },
256 {
MKTAG(
'V',
'O',
'X',
'L'), 24, 1, 22050 },
257 {
MKTAG(
'V',
'O',
'X',
'q'), 32, 1, 44100 },
258 {
MKTAG(
'V',
'O',
'X',
'r'), 40, 1, 44100 },
259 {
MKTAG(
'V',
'O',
'X',
's'), 48, 1, 44100 },
260 {
MKTAG(
'V',
'O',
'X',
't'), 16, 2, 8000 },
261 {
MKTAG(
'V',
'O',
'X',
'u'), 20, 2, 11025 },
262 {
MKTAG(
'V',
'O',
'X',
'v'), 32, 2, 16000 },
263 {
MKTAG(
'V',
'O',
'X',
'w'), 48, 2, 22050 },
264 {
MKTAG(
'V',
'O',
'X',
'x'), 64, 2, 44100 },
265 {
MKTAG(
'V',
'O',
'X',
'y'), 80, 2, 44100 },
266 {
MKTAG(
'V',
'O',
'X',
'z'), 96, 2, 44100 },
290 if (props->
tag == tag) {
310 switch ((avctx->
channels << 16) + (isampf << 8) + ibps) {
311 case (1 << 16) + ( 8 << 8) + 6:
314 case (2 << 16) + ( 8 << 8) + 6:
317 case (1 << 16) + ( 8 << 8) + 8:
320 case (2 << 16) + ( 8 << 8) + 8:
323 case (1 << 16) + (11 << 8) + 10:
326 case (2 << 16) + (11 << 8) + 10:
329 case (1 << 16) + (16 << 8) + 16:
332 case (2 << 16) + (16 << 8) + 16:
335 case (1 << 16) + (22 << 8) + 24:
338 case (2 << 16) + (22 << 8) + 24:
341 case (1 << 16) + (44 << 8) + 32:
344 case (2 << 16) + (44 << 8) + 32:
347 case (1 << 16) + (44 << 8) + 40:
350 case (2 << 16) + (44 << 8) + 40:
353 case (1 << 16) + (44 << 8) + 48:
356 case (2 << 16) + (44 << 8) + 48:
361 "This version does not support %d kHz - %d kbit/s/ch mode.\n",