Lines Matching refs:bits
53 N and K are themselves limited to 15 bits.*/
84 unsigned char *bits;
127 bits = (unsigned char *)opus_alloc(sizeof(unsigned char)*curr);
128 cache->bits = bits;
133 unsigned char *ptr = bits+entryI[i];
142 many bits as we ask for. */
153 /* N=1 bands only have a sign bit and fine bits. */
183 pcache = bits + cindex[(LM0+1)*m->nbEBands+j];
189 /* Offset the number of qtheta bits by log2(N)/2
193 /* The number of qtheta bits we'll allocate if the remainder
218 /* Add the fine bits we'll use. */
221 /* Offset the number of fine bits by log2(N)/2 + FINE_OFFSET
227 /* The number of fine bits we'll allocate if the remainder is
250 int skip_rsv, int *intensity, int intensity_rsv, int *dual_stereo, int dual_stereo_rsv, int *bits,
310 bits[j] = tmp;
324 all the other bits.
325 In the second case, we'd be coding a bit to redistribute all the bits
333 /*Figure out how many left-over bits we would be adding to this band.
334 This can include bits we've stolen back from higher, skipped bands.*/
340 band_bits = (int)(bits[j] + percoeff*band_width + rem);
343 This ensures that we have enough bits to code the skip flag.*/
370 /*Reclaim the bits originally allocated to this band.*/
371 psum -= bits[j]+intensity_rsv;
379 bits[j] = alloc_floor;
382 bits[j] = 0;
415 /* Allocate the remaining bits */
420 bits[j] += ((int)percoeff*(m->eBands[j+1]-m->eBands[j]));
424 bits[j] += tmp;
427 /*for (j=0;j<end;j++)printf("%d ", bits[j]);printf("\n");*/
437 celt_assert(bits[j] >= 0);
440 bit = (opus_int32)bits[j]+balance;
445 bits[j] = bit-excess;
452 /* Offset for the number of fine bits by log2(N)/2 + FINE_OFFSET
462 if (bits[j] + offset < den*2<<BITRES)
464 else if (bits[j] + offset < den*3<<BITRES)
468 ebits[j] = IMAX(0, (bits[j] + offset + (den<<(BITRES-1))) / (den<<BITRES));
471 if (C*ebits[j] > (bits[j]>>BITRES))
472 ebits[j] = bits[j] >> stereo >> BITRES;
479 fine_priority[j] = ebits[j]*(den<<BITRES) >= bits[j]+offset;
481 /* Remove the allocated fine bits; the rest are assigned to PVQ */
482 bits[j] -= C*ebits[j]<<BITRES;
485 /* For N=1, all bits go to fine energy except for a single sign bit */
487 bits[j] = bit-excess;
507 celt_assert(bits[j] >= 0);
510 /* Save any remaining bits over the cap for the rebalancing in
514 /* The skipped bands use all their bits for fine energy. */
517 ebits[j] = bits[j] >> stereo >> BITRES;
518 celt_assert(C*ebits[j]<<BITRES == bits[j]);
519 bits[j] = 0;
547 /* Reserve bits for the intensity and dual stereo parameters. */
568 /* Below this threshold, we're sure not to allocate any PVQ bits */