MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / l1_unscale

Function l1_unscale

libavcodec/mpegaudiodec.c:164–176  ·  view source on GitHub ↗

layer 1 unscaling */ n = number of bits of the mantissa minus 1 */

Source from the content-addressed store, hash-verified

162/* layer 1 unscaling */
163/* n = number of bits of the mantissa minus 1 */
164static inline int l1_unscale(int n, int mant, int scale_factor)
165{
166 int shift, mod;
167 int64_t val;
168
169 shift = scale_factor_modshift[scale_factor];
170 mod = shift & 3;
171 shift >>= 2;
172 val = MUL64(mant + (-1 << n) + 1, scale_factor_mult[n-1][mod]);
173 shift += n;
174 /* NOTE: at this point, 1 <= shift >= 21 + 15 */
175 return (int)((val + (1LL << (shift - 1))) >> shift);
176}
177
178static inline int l2_unscale_group(int steps, int mant, int scale_factor)
179{

Callers 2

mp_decode_layer1Function · 0.85
mp_decode_layer2Function · 0.85

Calls 1

MUL64Function · 0.50

Tested by

no test coverage detected