Lines Matching refs:j
77 int j; in compute_pulse_cache() local
93 for (j=0;j<m->nbEBands;j++) in compute_pulse_cache()
96 int N = (eBands[j+1]-eBands[j])<<i>>1; in compute_pulse_cache()
97 cindex[i*m->nbEBands+j] = -1; in compute_pulse_cache()
102 for (n=0;n<m->nbEBands && (k!=i || n<j);n++) in compute_pulse_cache()
106 cindex[i*m->nbEBands+j] = cindex[k*m->nbEBands+n]; in compute_pulse_cache()
111 if (cache->index[i*m->nbEBands+j] == -1 && N!=0) in compute_pulse_cache()
119 cindex[i*m->nbEBands+j] = curr; in compute_pulse_cache()
136 for (j=1;j<=entryK[i];j++) in compute_pulse_cache()
137 ptr[j] = tmp[get_pulses(j)]-1; in compute_pulse_cache()
148 for (j=0;j<m->nbEBands;j++) in compute_pulse_cache()
152 N0 = m->eBands[j+1]-m->eBands[j]; in compute_pulse_cache()
183 pcache = bits + cindex[(LM0+1)*m->nbEBands+j]; in compute_pulse_cache()
192 offset = ((m->logN[j]+((LM0+k)<<BITRES))>>1)-QTHETA_OFFSET; in compute_pulse_cache()
208 … offset = ((m->logN[j]+(i<<BITRES))>>1)-(N==2?QTHETA_OFFSET_TWOPHASE:QTHETA_OFFSET); in compute_pulse_cache()
223 offset = ((m->logN[j] + (i<<BITRES))>>1)-FINE_OFFSET; in compute_pulse_cache()
235 max_bits = (4*max_bits/(C*((m->eBands[j+1]-m->eBands[j])<<i)))-64; in compute_pulse_cache()
255 int i, j; in interp_bits2pulses() local
276 for (j=end;j-->start;) in interp_bits2pulses()
278 int tmp = bits1[j] + (mid*(opus_int32)bits2[j]>>ALLOC_STEPS); in interp_bits2pulses()
279 if (tmp >= thresh[j] || done) in interp_bits2pulses()
283 psum += IMIN(tmp, cap[j]); in interp_bits2pulses()
297 for (j=end;j-->start;) in interp_bits2pulses()
299 int tmp = bits1[j] + (lo*bits2[j]>>ALLOC_STEPS); in interp_bits2pulses()
300 if (tmp < thresh[j] && !done) in interp_bits2pulses()
309 tmp = IMIN(tmp, cap[j]); in interp_bits2pulses()
310 bits[j] = tmp; in interp_bits2pulses()
320 j = codedBands-1; in interp_bits2pulses()
327 if (j<=skip_start) in interp_bits2pulses()
338 rem = IMAX(left-(m->eBands[j]-m->eBands[start]),0); in interp_bits2pulses()
339 band_width = m->eBands[codedBands]-m->eBands[j]; in interp_bits2pulses()
340 band_bits = (int)(bits[j] + percoeff*band_width + rem); in interp_bits2pulses()
344 if (band_bits >= IMAX(thresh[j], alloc_floor+(1<<BITRES))) in interp_bits2pulses()
356 …if (codedBands<=start+2 || (band_bits > ((j<prev?7:9)*band_width<<LM<<BITRES)>>4 && j<=signalBandw… in interp_bits2pulses()
371 psum -= bits[j]+intensity_rsv; in interp_bits2pulses()
373 intensity_rsv = LOG2_FRAC_TABLE[j-start]; in interp_bits2pulses()
379 bits[j] = alloc_floor; in interp_bits2pulses()
382 bits[j] = 0; in interp_bits2pulses()
419 for (j=start;j<codedBands;j++) in interp_bits2pulses()
420 bits[j] += ((int)percoeff*(m->eBands[j+1]-m->eBands[j])); in interp_bits2pulses()
421 for (j=start;j<codedBands;j++) in interp_bits2pulses()
423 int tmp = (int)IMIN(left, m->eBands[j+1]-m->eBands[j]); in interp_bits2pulses()
424 bits[j] += tmp; in interp_bits2pulses()
430 for (j=start;j<codedBands;j++) in interp_bits2pulses()
437 celt_assert(bits[j] >= 0); in interp_bits2pulses()
438 N0 = m->eBands[j+1]-m->eBands[j]; in interp_bits2pulses()
440 bit = (opus_int32)bits[j]+balance; in interp_bits2pulses()
444 excess = MAX32(bit-cap[j],0); in interp_bits2pulses()
445 bits[j] = bit-excess; in interp_bits2pulses()
448 den=(C*N+ ((C==2 && N>2 && !*dual_stereo && j<*intensity) ? 1 : 0)); in interp_bits2pulses()
450 NClogN = den*(m->logN[j] + logM); in interp_bits2pulses()
462 if (bits[j] + offset < den*2<<BITRES) in interp_bits2pulses()
464 else if (bits[j] + offset < den*3<<BITRES) in interp_bits2pulses()
468 ebits[j] = IMAX(0, (bits[j] + offset + (den<<(BITRES-1))) / (den<<BITRES)); in interp_bits2pulses()
471 if (C*ebits[j] > (bits[j]>>BITRES)) in interp_bits2pulses()
472 ebits[j] = bits[j] >> stereo >> BITRES; in interp_bits2pulses()
475 ebits[j] = IMIN(ebits[j], MAX_FINE_BITS); in interp_bits2pulses()
479 fine_priority[j] = ebits[j]*(den<<BITRES) >= bits[j]+offset; in interp_bits2pulses()
482 bits[j] -= C*ebits[j]<<BITRES; in interp_bits2pulses()
487 bits[j] = bit-excess; in interp_bits2pulses()
488 ebits[j] = 0; in interp_bits2pulses()
489 fine_priority[j] = 1; in interp_bits2pulses()
499 extra_fine = IMIN(excess>>(stereo+BITRES),MAX_FINE_BITS-ebits[j]); in interp_bits2pulses()
500 ebits[j] += extra_fine; in interp_bits2pulses()
502 fine_priority[j] = extra_bits >= excess-balance; in interp_bits2pulses()
507 celt_assert(bits[j] >= 0); in interp_bits2pulses()
508 celt_assert(ebits[j] >= 0); in interp_bits2pulses()
515 for (;j<end;j++) in interp_bits2pulses()
517 ebits[j] = bits[j] >> stereo >> BITRES; in interp_bits2pulses()
518 celt_assert(C*ebits[j]<<BITRES == bits[j]); in interp_bits2pulses()
519 bits[j] = 0; in interp_bits2pulses()
520 fine_priority[j] = ebits[j]<1; in interp_bits2pulses()
529 int lo, hi, len, j; in compute_allocation() local
566 for (j=start;j<end;j++) in compute_allocation()
569 thresh[j] = IMAX((C)<<BITRES, (3*(m->eBands[j+1]-m->eBands[j])<<LM<<BITRES)>>4); in compute_allocation()
571 trim_offset[j] = C*(m->eBands[j+1]-m->eBands[j])*(alloc_trim-5-LM)*(end-j-1) in compute_allocation()
575 if ((m->eBands[j+1]-m->eBands[j])<<LM==1) in compute_allocation()
576 trim_offset[j] -= C<<BITRES; in compute_allocation()
585 for (j=end;j-->start;) in compute_allocation()
588 int N = m->eBands[j+1]-m->eBands[j]; in compute_allocation()
589 bitsj = C*N*m->allocVectors[mid*len+j]<<LM>>2; in compute_allocation()
591 bitsj = IMAX(0, bitsj + trim_offset[j]); in compute_allocation()
592 bitsj += offsets[j]; in compute_allocation()
593 if (bitsj >= thresh[j] || done) in compute_allocation()
597 psum += IMIN(bitsj, cap[j]); in compute_allocation()
612 for (j=start;j<end;j++) in compute_allocation()
615 int N = m->eBands[j+1]-m->eBands[j]; in compute_allocation()
616 bits1j = C*N*m->allocVectors[lo*len+j]<<LM>>2; in compute_allocation()
618 cap[j] : C*N*m->allocVectors[hi*len+j]<<LM>>2; in compute_allocation()
620 bits1j = IMAX(0, bits1j + trim_offset[j]); in compute_allocation()
622 bits2j = IMAX(0, bits2j + trim_offset[j]); in compute_allocation()
624 bits1j += offsets[j]; in compute_allocation()
625 bits2j += offsets[j]; in compute_allocation()
626 if (offsets[j]>0) in compute_allocation()
627 skip_start = j; in compute_allocation()
629 bits1[j] = bits1j; in compute_allocation()
630 bits2[j] = bits2j; in compute_allocation()