History

Formatting K&R fixes

Originally committed as revision 19732 to svn://svn.ffmpeg.org/ffmpeg/trunk

Vitor Sessak committed 17 years ago

Commit bf8202f1 parent 9263a051 file · +51 −51Browse files

Unified · Split

libavcodec/twinvq.c+51−51
@@ -234,7 +234,7 @@ static float eval_lpc_spectrum(const float *lsp, float cos_val, int order) · 233 unmodified lines
234 float q = 0.5f;234 float q = 0.5f;
235 float two_cos_w = 2.0f*cos_val;235 float two_cos_w = 2.0f*cos_val;
236 236
237 for (j=0; j + 1 < order; j += 2*2) {237 for (j = 0; j + 1 < order; j += 2*2) {
238 // Unroll the loop once since order is a multiple of four238 // Unroll the loop once since order is a multiple of four
239 q *= lsp[j ] - two_cos_w;239 q *= lsp[j ] - two_cos_w;
240 p *= lsp[j+1] - two_cos_w;240 p *= lsp[j+1] - two_cos_w;
@@ -258,7 +258,7 @@ static void eval_lpcenv(TwinContext *tctx, const float *cos_vals, float *lpc) · 17 unmodified lines
258 const ModeTab *mtab = tctx->mtab;258 const ModeTab *mtab = tctx->mtab;
259 int size_s = mtab->size / mtab->fmode[FT_SHORT].sub;259 int size_s = mtab->size / mtab->fmode[FT_SHORT].sub;
260 260
261 for (i=0; i < size_s/2; i++) {261 for (i = 0; i < size_s/2; i++) {
262 float cos_i = tctx->cos_tabs[0][i];262 float cos_i = tctx->cos_tabs[0][i];
263 lpc[i] = eval_lpc_spectrum(cos_vals, cos_i, mtab->n_lsp);263 lpc[i] = eval_lpc_spectrum(cos_vals, cos_i, mtab->n_lsp);
264 lpc[size_s-i-1] = eval_lpc_spectrum(cos_vals, -cos_i, mtab->n_lsp);264 lpc[size_s-i-1] = eval_lpc_spectrum(cos_vals, -cos_i, mtab->n_lsp);
@@ -270,7 +270,7 @@ static void interpolate(float *out, float v1, float v2, int size) · 5 unmodified lines
270 int i;270 int i;
271 float step = (v1 - v2)/(size + 1);271 float step = (v1 - v2)/(size + 1);
272 272
273 for (i=0; i < size; i++) {273 for (i = 0; i < size; i++) {
274 v2 += step;274 v2 += step;
275 out[i] = v2;275 out[i] = v2;
276 }276 }
@@ -306,14 +306,14 @@ static inline void eval_lpcenv_or_interp(TwinContext *tctx, · 29 unmodified lines
306 const float *cos_tab = tctx->cos_tabs[ftype];306 const float *cos_tab = tctx->cos_tabs[ftype];
307 307
308 // Fill the 's'308 // Fill the 's'
309 for (i=0; i < size; i += step)309 for (i = 0; i < size; i += step)
310 out[i] =310 out[i] =
311 eval_lpc_spectrum(in,311 eval_lpc_spectrum(in,
312 get_cos(i, part, cos_tab, size),312 get_cos(i, part, cos_tab, size),
313 mtab->n_lsp);313 mtab->n_lsp);
314 314
315 // Fill the 'iiiibiiii'315 // Fill the 'iiiibiiii'
316 for (i=step; i <= size - 2*step; i += step) {316 for (i = step; i <= size - 2*step; i += step) {
317 if (out[i + step] + out[i - step] > 1.95*out[i] ||317 if (out[i + step] + out[i - step] > 1.95*out[i] ||
318 out[i + step] >= out[i - step]) {318 out[i + step] >= out[i - step]) {
319 interpolate(out + i - step + 1, out[i], out[i-step], step - 1);319 interpolate(out + i - step + 1, out[i], out[i-step], step - 1);
@@ -354,7 +354,7 @@ static void dequant(TwinContext *tctx, GetBitContext *gb, float *out, · 34 unmodified lines
354 int pos = 0;354 int pos = 0;
355 int i, j;355 int i, j;
356 356
357 for (i=0; i < tctx->n_div[ftype]; i++) {357 for (i = 0; i < tctx->n_div[ftype]; i++) {
358 int tmp0, tmp1;358 int tmp0, tmp1;
359 int sign0 = 1;359 int sign0 = 1;
360 int sign1 = 1;360 int sign1 = 1;
@@ -383,7 +383,7 @@ static void dequant(TwinContext *tctx, GetBitContext *gb, float *out, · 22 unmodified lines
383 tab0 = cb0 + tmp0*cb_len;383 tab0 = cb0 + tmp0*cb_len;
384 tab1 = cb1 + tmp1*cb_len;384 tab1 = cb1 + tmp1*cb_len;
385 385
386 for (j=0; j < length; j++)386 for (j = 0; j < length; j++)
387 out[tctx->permut[ftype][pos+j]] = sign0*tab0[j] + sign1*tab1[j];387 out[tctx->permut[ftype][pos+j]] = sign0*tab0[j] + sign1*tab1[j];
388 388
389 pos += length;389 pos += length;
@@ -447,18 +447,18 @@ static void add_peak(int period, int width, const float *shape, · 57 unmodified lines
447 int center;447 int center;
448 448
449 // First peak centered around zero449 // First peak centered around zero
450 for (i=0; i < width/2; i++)450 for (i = 0; i < width/2; i++)
451 speech[i] += ppc_gain * *shape++;451 speech[i] += ppc_gain * *shape++;
452 452
453 for (i=1; i < ROUNDED_DIV(len,width) ; i++) {453 for (i = 1; i < ROUNDED_DIV(len,width) ; i++) {
454 center = very_broken_op(period, i);454 center = very_broken_op(period, i);
455 for (j=-width/2; j < (width+1)/2; j++)455 for (j = -width/2; j < (width+1)/2; j++)
456 speech[j+center] += ppc_gain * *shape++;456 speech[j+center] += ppc_gain * *shape++;
457 }457 }
458 458
459 // For the last block, be careful not to go beyond the end of the buffer459 // For the last block, be careful not to go beyond the end of the buffer
460 center = very_broken_op(period, i);460 center = very_broken_op(period, i);
461 for (j=-width/2; j < (width + 1)/2 && shape < shape_end; j++)461 for (j = -width/2; j < (width + 1)/2 && shape < shape_end; j++)
462 speech[j+center] += ppc_gain * *shape++;462 speech[j+center] += ppc_gain * *shape++;
463}463}
464 464
@@ -497,17 +497,17 @@ static void dec_gain(TwinContext *tctx, GetBitContext *gb, enum FrameType ftype, · 32 unmodified lines
497 float sub_step = SUB_AMP_MAX / ((1 << SUB_GAIN_BITS) - 1);497 float sub_step = SUB_AMP_MAX / ((1 << SUB_GAIN_BITS) - 1);
498 498
499 if (ftype == FT_LONG) {499 if (ftype == FT_LONG) {
500 for (i=0; i < tctx->avctx->channels; i++)500 for (i = 0; i < tctx->avctx->channels; i++)
501 out[i] = (1./(1<<13)) *501 out[i] = (1./(1<<13)) *
502 mulawinv(step * 0.5 + step * get_bits(gb, GAIN_BITS),502 mulawinv(step * 0.5 + step * get_bits(gb, GAIN_BITS),
503 AMP_MAX, MULAW_MU);503 AMP_MAX, MULAW_MU);
504 } else {504 } else {
505 for (i=0; i < tctx->avctx->channels; i++) {505 for (i = 0; i < tctx->avctx->channels; i++) {
506 float val = (1./(1<<23)) *506 float val = (1./(1<<23)) *
507 mulawinv(step * 0.5 + step * get_bits(gb, GAIN_BITS),507 mulawinv(step * 0.5 + step * get_bits(gb, GAIN_BITS),
508 AMP_MAX, MULAW_MU);508 AMP_MAX, MULAW_MU);
509 509
510 for (j=0; j < sub; j++) {510 for (j = 0; j < sub; j++) {
511 out[i*sub + j] =511 out[i*sub + j] =
512 val*mulawinv(sub_step* 0.5 +512 val*mulawinv(sub_step* 0.5 +
513 sub_step* get_bits(gb, SUB_GAIN_BITS),513 sub_step* get_bits(gb, SUB_GAIN_BITS),
@@ -527,7 +527,7 @@ static void rearrange_lsp(int order, float *lsp, float min_dist) · 13 unmodified lines
527{527{
528 int i;528 int i;
529 float min_dist2 = min_dist * 0.5;529 float min_dist2 = min_dist * 0.5;
530 for (i=1; i < order; i++)530 for (i = 1; i < order; i++)
531 if (lsp[i] - lsp[i-1] < min_dist) {531 if (lsp[i] - lsp[i-1] < min_dist) {
532 float avg = (lsp[i] + lsp[i-1]) * 0.5;532 float avg = (lsp[i] + lsp[i-1]) * 0.5;
533 533
@@ -542,8 +542,8 @@ static void bubblesort(float *lsp, int lp_order) · 8 unmodified lines
542 542
543 /* sort lsp in ascending order. float bubble agorithm,543 /* sort lsp in ascending order. float bubble agorithm,
544 O(n) if data already sorted, O(n^2) - otherwise */544 O(n) if data already sorted, O(n^2) - otherwise */
545 for (i=0; i < lp_order - 1; i++)545 for (i = 0; i < lp_order - 1; i++)
546 for (j=i; j >= 0 && lsp[j] > lsp[j+1]; j--)546 for (j = i; j >= 0 && lsp[j] > lsp[j+1]; j--)
547 FFSWAP(float, lsp[j], lsp[j+1]);547 FFSWAP(float, lsp[j], lsp[j+1]);
548}548}
549 549
@@ -564,8 +564,8 @@ static void decode_lsp(TwinContext *tctx, int lpc_idx1, uint8_t *lpc_idx2, · 14 unmodified lines
564 0564 0
565 };565 };
566 566
567 j=0;567 j = 0;
568 for (i=0; i < mtab->lsp_split; i++) {568 for (i = 0; i < mtab->lsp_split; i++) {
569 int chunk_end = ((i + 1)*mtab->n_lsp + funny_rounding[i])/mtab->lsp_split;569 int chunk_end = ((i + 1)*mtab->n_lsp + funny_rounding[i])/mtab->lsp_split;
570 for (; j < chunk_end; j++)570 for (; j < chunk_end; j++)
571 lsp[j] = cb [lpc_idx1 * mtab->n_lsp + j] +571 lsp[j] = cb [lpc_idx1 * mtab->n_lsp + j] +
@@ -574,7 +574,7 @@ static void decode_lsp(TwinContext *tctx, int lpc_idx1, uint8_t *lpc_idx2, · 2 unmodified lines
574 574
575 rearrange_lsp(mtab->n_lsp, lsp, 0.0001);575 rearrange_lsp(mtab->n_lsp, lsp, 0.0001);
576 576
577 for (i=0; i < mtab->n_lsp; i++) {577 for (i = 0; i < mtab->n_lsp; i++) {
578 float tmp1 = 1. - cb3[lpc_hist_idx*mtab->n_lsp + i];578 float tmp1 = 1. - cb3[lpc_hist_idx*mtab->n_lsp + i];
579 float tmp2 = hist[i] * cb3[lpc_hist_idx*mtab->n_lsp + i];579 float tmp2 = hist[i] * cb3[lpc_hist_idx*mtab->n_lsp + i];
580 hist[i] = lsp[i];580 hist[i] = lsp[i];
@@ -592,7 +592,7 @@ static void dec_lpc_spectrum_inv(TwinContext *tctx, float *lsp, · 11 unmodified lines
592 int i;592 int i;
593 int size = tctx->mtab->size / tctx->mtab->fmode[ftype].sub;593 int size = tctx->mtab->size / tctx->mtab->fmode[ftype].sub;
594 594
595 for (i=0; i < tctx->mtab->n_lsp; i++)595 for (i = 0; i < tctx->mtab->n_lsp; i++)
596 lsp[i] = 2*cos(lsp[i]);596 lsp[i] = 2*cos(lsp[i]);
597 597
598 switch (ftype) {598 switch (ftype) {
@@ -633,7 +633,7 @@ static void imdct_and_window(TwinContext *tctx, enum FrameType ftype, int wtype, · 34 unmodified lines
633 first_wsize = wsize;633 first_wsize = wsize;
634 prev_buf = prev + (size - bsize)/2;634 prev_buf = prev + (size - bsize)/2;
635 635
636 for (j=0; j < mtab->fmode[ftype].sub; j++) {636 for (j = 0; j < mtab->fmode[ftype].sub; j++) {
637 int sub_wtype = ftype == FT_MEDIUM ? 8 : wtype;637 int sub_wtype = ftype == FT_MEDIUM ? 8 : wtype;
638 638
639 if (!j && wtype == 4)639 if (!j && wtype == 4)
@@ -670,7 +670,7 @@ static void imdct_output(TwinContext *tctx, enum FrameType ftype, int wtype, · 30 unmodified lines
670 float *prev_buf = tctx->prev_frame + tctx->last_block_pos[0];670 float *prev_buf = tctx->prev_frame + tctx->last_block_pos[0];
671 int i, j;671 int i, j;
672 672
673 for (i=0; i < tctx->avctx->channels; i++) {673 for (i = 0; i < tctx->avctx->channels; i++) {
674 imdct_and_window(tctx, ftype, wtype,674 imdct_and_window(tctx, ftype, wtype,
675 tctx->spectrum + i*mtab->size,675 tctx->spectrum + i*mtab->size,
676 prev_buf + 2*i*mtab->size,676 prev_buf + 2*i*mtab->size,
@@ -678,13 +678,13 @@ static void imdct_output(TwinContext *tctx, enum FrameType ftype, int wtype, · 1 unmodified line
678 }678 }
679 679
680 if (tctx->avctx->channels == 2) {680 if (tctx->avctx->channels == 2) {
681 for (i=0; i < mtab->size - tctx->last_block_pos[0]; i++) {681 for (i = 0; i < mtab->size - tctx->last_block_pos[0]; i++) {
682 float f1 = prev_buf[ i];682 float f1 = prev_buf[ i];
683 float f2 = prev_buf[2*mtab->size + i];683 float f2 = prev_buf[2*mtab->size + i];
684 out[2*i ] = f1 + f2;684 out[2*i ] = f1 + f2;
685 out[2*i + 1] = f1 - f2;685 out[2*i + 1] = f1 - f2;
686 }686 }
687 for (j=0; i < mtab->size; j++,i++) {687 for (j = 0; i < mtab->size; j++,i++) {
688 float f1 = tctx->curr_frame[ j];688 float f1 = tctx->curr_frame[ j];
689 float f2 = tctx->curr_frame[2*mtab->size + j];689 float f2 = tctx->curr_frame[2*mtab->size + j];
690 out[2*i ] = f1 + f2;690 out[2*i ] = f1 + f2;
@@ -713,8 +713,8 @@ static void dec_bark_env(TwinContext *tctx, const uint8_t *in, int use_hist, · 22 unmodified lines
713 int fw_cb_len = mtab->fmode[ftype].bark_env_size / bark_n_coef;713 int fw_cb_len = mtab->fmode[ftype].bark_env_size / bark_n_coef;
714 int idx = 0;714 int idx = 0;
715 715
716 for (i=0; i < fw_cb_len; i++)716 for (i = 0; i < fw_cb_len; i++)
717 for (j=0; j < bark_n_coef; j++, idx++) {717 for (j = 0; j < bark_n_coef; j++, idx++) {
718 float tmp2 =718 float tmp2 =
719 mtab->fmode[ftype].bark_cb[fw_cb_len*in[j] + i] * (1./4096);719 mtab->fmode[ftype].bark_cb[fw_cb_len*in[j] + i] * (1./4096);
720 float st = use_hist ?720 float st = use_hist ?
@@ -751,23 +751,23 @@ static void read_and_decode_spectrum(TwinContext *tctx, GetBitContext *gb, · 30 unmodified lines
751 mtab->fmode[ftype].cb0, mtab->fmode[ftype].cb1,751 mtab->fmode[ftype].cb0, mtab->fmode[ftype].cb1,
752 mtab->fmode[ftype].cb_len_read);752 mtab->fmode[ftype].cb_len_read);
753 753
754 for (i=0; i < channels; i++)754 for (i = 0; i < channels; i++)
755 for (j=0; j < sub; j++)755 for (j = 0; j < sub; j++)
756 for (k=0; k < mtab->fmode[ftype].bark_n_coef; k++)756 for (k = 0; k < mtab->fmode[ftype].bark_n_coef; k++)
757 bark1[i][j][k] =757 bark1[i][j][k] =
758 get_bits(gb, mtab->fmode[ftype].bark_n_bit);758 get_bits(gb, mtab->fmode[ftype].bark_n_bit);
759 759
760 for (i=0; i < channels; i++)760 for (i = 0; i < channels; i++)
761 for (j=0; j < sub; j++)761 for (j = 0; j < sub; j++)
762 bark_use_hist[i][j] = get_bits1(gb);762 bark_use_hist[i][j] = get_bits1(gb);
763 763
764 dec_gain(tctx, gb, ftype, gain);764 dec_gain(tctx, gb, ftype, gain);
765 765
766 for (i=0; i < channels; i++) {766 for (i = 0; i < channels; i++) {
767 lpc_hist_idx[i] = get_bits(gb, tctx->mtab->lsp_bit0);767 lpc_hist_idx[i] = get_bits(gb, tctx->mtab->lsp_bit0);
768 lpc_idx1 [i] = get_bits(gb, tctx->mtab->lsp_bit1);768 lpc_idx1 [i] = get_bits(gb, tctx->mtab->lsp_bit1);
769 769
770 for (j=0; j < tctx->mtab->lsp_split; j++)770 for (j = 0; j < tctx->mtab->lsp_split; j++)
771 lpc_idx2[i][j] = get_bits(gb, tctx->mtab->lsp_bit2);771 lpc_idx2[i][j] = get_bits(gb, tctx->mtab->lsp_bit2);
772 }772 }
773 773
@@ -778,11 +778,11 @@ static void read_and_decode_spectrum(TwinContext *tctx, GetBitContext *gb, · 4 unmodified lines
778 mtab->ppc_shape_cb + cb_len_p*PPC_SHAPE_CB_SIZE, cb_len_p);778 mtab->ppc_shape_cb + cb_len_p*PPC_SHAPE_CB_SIZE, cb_len_p);
779 }779 }
780 780
781 for (i=0; i < channels; i++) {781 for (i = 0; i < channels; i++) {
782 float *chunk = out + mtab->size * i;782 float *chunk = out + mtab->size * i;
783 float lsp[tctx->mtab->n_lsp];783 float lsp[tctx->mtab->n_lsp];
784 784
785 for (j=0; j < sub; j++) {785 for (j = 0; j < sub; j++) {
786 dec_bark_env(tctx, bark1[i][j], bark_use_hist[i][j], i,786 dec_bark_env(tctx, bark1[i][j], bark_use_hist[i][j], i,
787 tctx->tmp_buf, gain[sub*i+j], ftype);787 tctx->tmp_buf, gain[sub*i+j], ftype);
788 788
@@ -807,7 +807,7 @@ static void read_and_decode_spectrum(TwinContext *tctx, GetBitContext *gb, · 18 unmodified lines
807 807
808 dec_lpc_spectrum_inv(tctx, lsp, ftype, tctx->tmp_buf);808 dec_lpc_spectrum_inv(tctx, lsp, ftype, tctx->tmp_buf);
809 809
810 for (j=0; j < mtab->fmode[ftype].sub; j++) {810 for (j = 0; j < mtab->fmode[ftype].sub; j++) {
811 tctx->dsp.vector_fmul(chunk, tctx->tmp_buf, block_size);811 tctx->dsp.vector_fmul(chunk, tctx->tmp_buf, block_size);
812 chunk += block_size;812 chunk += block_size;
813 }813 }
@@ -879,7 +879,7 @@ static av_cold void init_mdct_win(TwinContext *tctx) · 65 unmodified lines
879 int channels = tctx->avctx->channels;879 int channels = tctx->avctx->channels;
880 float norm = channels == 1 ? 2. : 1.;880 float norm = channels == 1 ? 2. : 1.;
881 881
882 for (i=0; i < 3; i++) {882 for (i = 0; i < 3; i++) {
883 int bsize = tctx->mtab->size/tctx->mtab->fmode[i].sub;883 int bsize = tctx->mtab->size/tctx->mtab->fmode[i].sub;
884 ff_mdct_init(&tctx->mdct_ctx[i], av_log2(bsize) + 1, 1,884 ff_mdct_init(&tctx->mdct_ctx[i], av_log2(bsize) + 1, 1,
885 -sqrt(norm/bsize) / (1<<15));885 -sqrt(norm/bsize) / (1<<15));
@@ -891,14 +891,14 @@ static av_cold void init_mdct_win(TwinContext *tctx) · 5 unmodified lines
891 tctx->curr_frame = av_malloc(2*mtab->size*channels*sizeof(float));891 tctx->curr_frame = av_malloc(2*mtab->size*channels*sizeof(float));
892 tctx->prev_frame = av_malloc(2*mtab->size*channels*sizeof(float));892 tctx->prev_frame = av_malloc(2*mtab->size*channels*sizeof(float));
893 893
894 for(i=0; i < 3; i++) {894 for (i = 0; i < 3; i++) {
895 int m = 4*mtab->size/mtab->fmode[i].sub;895 int m = 4*mtab->size/mtab->fmode[i].sub;
896 double freq = 2*M_PI/m;896 double freq = 2*M_PI/m;
897 tctx->cos_tabs[i] = av_malloc((m/4)*sizeof(*tctx->cos_tabs));897 tctx->cos_tabs[i] = av_malloc((m/4)*sizeof(*tctx->cos_tabs));
898 898
899 for (j=0; j <= m/8; j++)899 for (j = 0; j <= m/8; j++)
900 tctx->cos_tabs[i][j] = cos((2*j + 1)*freq);900 tctx->cos_tabs[i][j] = cos((2*j + 1)*freq);
901 for (j=1; j < m/8; j++)901 for (j = 1; j < m/8; j++)
902 tctx->cos_tabs[i][m/4-j] = tctx->cos_tabs[i][j];902 tctx->cos_tabs[i][m/4-j] = tctx->cos_tabs[i][j];
903 }903 }
904 904
@@ -922,7 +922,7 @@ static void permutate_in_line(int16_t *tab, int num_vect, int num_blocks, · 17 unmodified lines
922{922{
923 int i,j;923 int i,j;
924 924
925 for (i=0; i < line_len[0]; i++) {925 for (i = 0; i < line_len[0]; i++) {
926 int shift;926 int shift;
927 927
928 if (num_blocks == 1 ||928 if (num_blocks == 1 ||
@@ -935,7 +935,7 @@ static void permutate_in_line(int16_t *tab, int num_vect, int num_blocks, · 6 unmodified lines
935 } else935 } else
936 shift = i*i;936 shift = i*i;
937 937
938 for (j=0; j < num_vect && (j+num_vect*i < block_size*num_blocks); j++)938 for (j = 0; j < num_vect && (j+num_vect*i < block_size*num_blocks); j++)
939 tab[i*num_vect+j] = i*num_vect + (j + shift) % num_vect;939 tab[i*num_vect+j] = i*num_vect + (j + shift) % num_vect;
940 }940 }
941}941}
@@ -960,8 +960,8 @@ static void transpose_perm(int16_t *out, int16_t *in, int num_vect, · 18 unmodified lines
960{960{
961 int i,j;961 int i,j;
962 int cont= 0;962 int cont= 0;
963 for (i=0; i < num_vect; i++)963 for (i = 0; i < num_vect; i++)
964 for (j=0; j < line_len[i >= length_div]; j++)964 for (j = 0; j < line_len[i >= length_div]; j++)
965 out[cont++] = in[j*num_vect + i];965 out[cont++] = in[j*num_vect + i];
966}966}
967 967
@@ -970,7 +970,7 @@ static void linear_perm(int16_t *out, int16_t *in, int n_blocks, int size) · 2 unmodified lines
970 int block_size = size/n_blocks;970 int block_size = size/n_blocks;
971 int i;971 int i;
972 972
973 for (i=0; i < size; i++)973 for (i = 0; i < size; i++)
974 out[i] = block_size * (in[i] % n_blocks) + in[i] / n_blocks;974 out[i] = block_size * (in[i] % n_blocks) + in[i] / n_blocks;
975}975}
976 976
@@ -1015,7 +1015,7 @@ static av_cold void init_bitstream_params(TwinContext *tctx) · 38 unmodified lines
1015 int bse_bits[3];1015 int bse_bits[3];
1016 int i;1016 int i;
1017 1017
1018 for (i=0; i < 3; i++)1018 for (i = 0; i < 3; i++)
1019 // +1 for history usage switch1019 // +1 for history usage switch
1020 bse_bits[i] = n_ch *1020 bse_bits[i] = n_ch *
1021 (mtab->fmode[i].bark_n_coef * mtab->fmode[i].bark_n_bit + 1);1021 (mtab->fmode[i].bark_n_coef * mtab->fmode[i].bark_n_bit + 1);
@@ -1023,13 +1023,13 @@ static av_cold void init_bitstream_params(TwinContext *tctx) · 1 unmodified line
1023 bsize_no_main_cb[2] = bse_bits[2] + lsp_bits_per_block + ppc_bits +1023 bsize_no_main_cb[2] = bse_bits[2] + lsp_bits_per_block + ppc_bits +
1024 WINDOW_TYPE_BITS + n_ch*GAIN_BITS;1024 WINDOW_TYPE_BITS + n_ch*GAIN_BITS;
1025 1025
1026 for (i=0; i < 2; i++)1026 for (i = 0; i < 2; i++)
1027 bsize_no_main_cb[i] =1027 bsize_no_main_cb[i] =
1028 lsp_bits_per_block + n_ch*GAIN_BITS + WINDOW_TYPE_BITS +1028 lsp_bits_per_block + n_ch*GAIN_BITS + WINDOW_TYPE_BITS +
1029 mtab->fmode[i].sub*(bse_bits[i] + n_ch*SUB_GAIN_BITS);1029 mtab->fmode[i].sub*(bse_bits[i] + n_ch*SUB_GAIN_BITS);
1030 1030
1031 // The remaining bits are all used for the main spectrum coefficients1031 // The remaining bits are all used for the main spectrum coefficients
1032 for (i=0; i < 4; i++) {1032 for (i = 0; i < 4; i++) {
1033 int bit_size;1033 int bit_size;
1034 int vect_size;1034 int vect_size;
1035 int rounded_up, rounded_down, num_rounded_down, num_rounded_up;1035 int rounded_up, rounded_down, num_rounded_down, num_rounded_up;
@@ -1062,7 +1062,7 @@ static av_cold void init_bitstream_params(TwinContext *tctx) · 26 unmodified lines
1062 tctx->length_change[i] = num_rounded_up;1062 tctx->length_change[i] = num_rounded_up;
1063 }1063 }
1064 1064
1065 for (i=0; i < 4; i++)1065 for (i = 0; i < 4; i++)
1066 construct_perm_table(tctx, i);1066 construct_perm_table(tctx, i);
1067}1067}
1068 1068
@@ -1110,7 +1110,7 @@ static av_cold int twin_decode_close(AVCodecContext *avctx) · 41 unmodified lines
1110 TwinContext *tctx = avctx->priv_data;1110 TwinContext *tctx = avctx->priv_data;
1111 int i;1111 int i;
1112 1112
1113 for (i=0; i < 3; i++) {1113 for (i = 0; i < 3; i++) {
1114 ff_mdct_end(&tctx->mdct_ctx[i]);1114 ff_mdct_end(&tctx->mdct_ctx[i]);
1115 av_free(tctx->cos_tabs[i]);1115 av_free(tctx->cos_tabs[i]);
1116 }1116 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t