Lines Matching defs:fracbits
68 int fracbits; /* the number of bits of rbps that comprise the fractional part */
80 * fixed-point division (err<<fracbits)/n.
83 fracbits = (8*sizeof(err)) - (FLAC__bitmath_ilog2(err)+1);
85 err <<= fracbits;
87 /* err now holds err/n with fracbits fractional bits */
97 fracbits -= (bits-16);
103 fracbits += 16;
104 FLAC__ASSERT(fracbits >= 0);
106 /* FLAC__fixedpoint_log2 requires fracbits%4 to be 0 */
108 const int f = fracbits & 3;
111 fracbits -= f;
115 rbps = FLAC__fixedpoint_log2(rbps, fracbits, (unsigned)(-1));
122 * of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits
124 * left if necessary to get 16 fracbits without losing any bits of the
131 FLAC__ASSERT((int)FLAC__bitmath_ilog2(rbps)+1 <= fracbits + 6);
132 FLAC__ASSERT(fracbits >= -3);
135 if(fracbits < 16)
136 return rbps << (16-fracbits);
137 else if(fracbits > 16)
138 return rbps >> (fracbits-16);
147 int fracbits; /* the number of bits of rbps that comprise the fractional part */
159 * fixed-point division (err<<fracbits)/n.
162 fracbits = (8*sizeof(err)) - (FLAC__bitmath_ilog2_wide(err)+1);
164 err <<= fracbits;
166 /* err now holds err/n with fracbits fractional bits */
176 fracbits -= (bits-16);
182 fracbits += 16;
183 FLAC__ASSERT(fracbits >= 0);
185 /* FLAC__fixedpoint_log2 requires fracbits%4 to be 0 */
187 const int f = fracbits & 3;
190 fracbits -= f;
194 rbps = FLAC__fixedpoint_log2(rbps, fracbits, (unsigned)(-1));
201 * of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits
203 * left if necessary to get 16 fracbits without losing any bits of the
210 FLAC__ASSERT((int)FLAC__bitmath_ilog2(rbps)+1 <= fracbits + 6);
211 FLAC__ASSERT(fracbits >= -3);
214 if(fracbits < 16)
215 return rbps << (16-fracbits);
216 else if(fracbits > 16)
217 return rbps >> (fracbits-16);