Lines Matching refs:gi
656 gr_info * const gi, calc_noise_data * prev_noise)
661 int const *const ix = gi->l3_enc;
663 i = Min(576, ((gi->max_nonzero_coeff + 2) >> 1) << 1);
672 gi->count1 = i;
692 gi->count1table_select = 0;
695 gi->count1table_select = 1;
698 gi->count1bits = bits;
699 gi->big_values = i;
703 if (gi->block_type == SHORT_TYPE) {
705 if (a1 > gi->big_values)
706 a1 = gi->big_values;
707 a2 = gi->big_values;
710 else if (gi->block_type == NORM_TYPE) {
712 a1 = gi->region0_count = gfc->sv_qnt.bv_scf[i - 2];
713 a2 = gi->region1_count = gfc->sv_qnt.bv_scf[i - 1];
719 gi->table_select[2] = gfc->choose_table(ix + a2, ix + i, &bits);
723 gi->region0_count = 7;
724 /*gi->region1_count = SBPSY_l - 7 - 1; */
725 gi->region1_count = SBMAX_l - 1 - 7 - 1;
744 gi->table_select[0] = gfc->choose_table(ix, ix + a1, &bits);
746 gi->table_select[1] = gfc->choose_table(ix + a1, ix + a2, &bits);
748 gi->part2_3_length = bits;
749 best_huffman_divide(gfc, gi);
750 bits = gi->part2_3_length;
755 if (gi->block_type == NORM_TYPE) {
757 while (gfc->scalefac_band.l[sfb] < gi->big_values) {
769 const FLOAT * const xr, gr_info * const gi, calc_noise_data * prev_noise)
771 int *const ix = gi->l3_enc;
774 FLOAT const w = (IXMAX_VAL) / IPOW20(gi->global_gain);
776 if (gi->xrpow_max > w)
779 quantize_xrpow(xr, ix, IPOW20(gi->global_gain), gi, prev_noise);
784 int const gain = gi->global_gain + gi->scalefac_scale;
786 for (sfb = 0; sfb < gi->sfbmax; sfb++) {
787 int const width = gi->width[sfb];
800 return noquant_count_bits(gfc, gi, prev_noise);
850 gr_info * const gi,
864 if (gi->part2_3_length <= bits)
868 if (gi->part2_3_length <= bits)
871 memcpy(gi, cod_info2, sizeof(gr_info));
872 gi->part2_3_length = bits;
873 gi->region0_count = r01_div[r2 - 2];
874 gi->region1_count = r2 - 2 - r01_div[r2 - 2];
875 gi->table_select[0] = r0_tbl[r2 - 2];
876 gi->table_select[1] = r1_tbl[r2 - 2];
877 gi->table_select[2] = r2t;
885 best_huffman_divide(const lame_internal_flags * const gfc, gr_info * const gi)
890 int const *const ix = gi->l3_enc;
899 if (gi->block_type == SHORT_TYPE && cfg->mode_gr == 1)
903 memcpy(&cod_info2, gi, sizeof(gr_info));
904 if (gi->block_type == NORM_TYPE) {
905 recalc_divide_init(gfc, gi, ix, r01_bits, r01_div, r0_tbl, r1_tbl);
906 recalc_divide_sub(gfc, &cod_info2, gi, ix, r01_bits, r01_div, r0_tbl, r1_tbl);
913 i = gi->count1 + 2;
918 memcpy(&cod_info2, gi, sizeof(gr_info));
940 recalc_divide_sub(gfc, &cod_info2, gi, ix, r01_bits, r01_div, r0_tbl, r1_tbl);
954 if (gi->part2_3_length > cod_info2.part2_3_length)
955 memcpy(gi, &cod_info2, sizeof(gr_info));
970 gr_info *const gi = &l3_side->tt[1][ch];
975 if (g0->scalefac[sfb] != gi->scalefac[sfb]
976 && gi->scalefac[sfb] >= 0)
981 gi->scalefac[sfb] = -1;
989 if (gi->scalefac[sfb] == -1)
992 if (s1 < gi->scalefac[sfb])
993 s1 = gi->scalefac[sfb];
998 if (gi->scalefac[sfb] == -1)
1001 if (s2 < gi->scalefac[sfb])
1002 s2 = gi->scalefac[sfb];
1008 if (gi->part2_length > c) {
1009 gi->part2_length = c;
1010 gi->scalefac_compress = (int)i;
1027 gr_info *const gi = &l3_side->tt[gr][ch];
1035 for (sfb = 0; sfb < gi->sfbmax; sfb++) {
1036 int const width = gi->width[sfb];
1039 if (gi->l3_enc[l] != 0)
1043 gi->scalefac[sfb] = recalc = -2; /* anything goes. */
1049 if (!gi->scalefac_scale && !gi->preflag) {
1051 for (sfb = 0; sfb < gi->sfbmax; sfb++)
1052 if (gi->scalefac[sfb] > 0)
1053 s |= gi->scalefac[sfb];
1056 for (sfb = 0; sfb < gi->sfbmax; sfb++)
1057 if (gi->scalefac[sfb] > 0)
1058 gi->scalefac[sfb] >>= 1;
1060 gi->scalefac_scale = recalc = 1;
1064 if (!gi->preflag && gi->block_type != SHORT_TYPE && cfg->mode_gr == 2) {
1066 if (gi->scalefac[sfb] < pretab[sfb] && gi->scalefac[sfb] != -2)
1070 if (gi->scalefac[sfb] > 0)
1071 gi->scalefac[sfb] -= pretab[sfb];
1073 gi->preflag = recalc = 1;
1086 for (sfb = 0; sfb < gi->sfbmax; sfb++) {
1087 if (gi->scalefac[sfb] == -2) {
1088 gi->scalefac[sfb] = 0; /* if anything goes, then 0 is a good choice */
1092 (void) scale_bitcount(gfc, gi);