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

Function wv_get_value_integer

libavcodec/wavpack.c:297–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297static inline int wv_get_value_integer(WavpackFrameContext *s, uint32_t *crc,
298 unsigned S)
299{
300 unsigned bit;
301
302 if (s->extra_bits) {
303 S *= 1 << s->extra_bits;
304
305 if (s->got_extra_bits &&
306 get_bits_left(&s->gb_extra_bits) >= s->extra_bits) {
307 S |= get_bits_long(&s->gb_extra_bits, s->extra_bits);
308 *crc = *crc * 9 + (S & 0xffff) * 3 + ((unsigned)S >> 16);
309 }
310 }
311
312 bit = (S & s->and) | s->or;
313 bit = ((S + bit) << s->shift) - bit;
314
315 if (s->hybrid)
316 bit = av_clip(bit, s->hybrid_minclip, s->hybrid_maxclip);
317
318 return bit << s->post_shift;
319}
320
321static float wv_get_value_float(WavpackFrameContext *s, uint32_t *crc, int S)
322{

Callers 2

wv_unpack_stereoFunction · 0.85
wv_unpack_monoFunction · 0.85

Calls 2

get_bits_leftFunction · 0.85
get_bits_longFunction · 0.85

Tested by

no test coverage detected