private int bigv_bitcount(int [] ix, EChannel gi) {
		int bits = 0;

		if ( gi.window_switching_flag != 0 && gi.block_type == 2 ) {
			/*
          Within each scalefactor band, data is given for successive
          time windows, beginning with window 0 and ending with window 2.
          Within each window, the quantized values are then arranged in
          order of increasing frequency...
			 */
			int sfb = 0, window, line, start, end;

			if ( gi.mixed_block_flag != 0 ) {
				int tableindex;

				if ( (tableindex = gi.table_select[0]) != 0 )
					bits += count_bit( ix, 0, gi.address1, tableindex );
				sfb = 2;
			}

			for ( ; sfb < 13; sfb++ ) {
				int tableindex = 100;

				start = scalefac_band_short[ sfb ];
				end   = scalefac_band_short[ sfb+1 ];

				if ( start < 12 )
					tableindex = gi.table_select[ 0 ];
				else
					tableindex = gi.table_select[ 1 ];

				bits += count_bit_short(ix, start, end, tableindex);/*
                for ( line = start; line < end; line += 2 ) {
                    for ( window = 0; window < 3; window++ ){
                        x = (ix[line * 3 + window ]);
                        y = (ix[(line + 1) * 3 + window]);

                        // x = (i192_3[ line ][ window ]);
                        // y = (i192_3[ line + 1 ][ window]);

                        bits += HuffmanCode( tableindex, x, y );
                    }
                }*/
			}
		} else {

			int table;

			if( (table = gi.table_select[0] )>=0)  // region0
			bits += count_bit(ix, 0, gi.address1, table );
			if( (table = gi.table_select[1])>=0)  // region1
				bits += count_bit(ix, gi.address1, gi.address2, table );
			if( (table = gi.table_select[2])>=0)  // region2
				bits += count_bit(ix, gi.address2, gi.address3, table );
		}

		return bits;
	}