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

Function read_slice_sizes

libavcodec/rv60dec.c:395–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395static int read_slice_sizes(RV60Context *s, GetBitContext *gb)
396{
397 int nbits = get_bits(gb, 5) + 1;
398 int64_t last_size;
399
400 for (int i = 0; i < s->cu_height; i++)
401 s->slice[i].sign = get_bits1(gb);
402
403 s->slice[0].size = last_size = get_bits_long(gb, nbits);
404
405 if (last_size < 0 || last_size > INT32_MAX)
406 return AVERROR_INVALIDDATA;
407
408 for (int i = 1; i < s->cu_height; i++) {
409 int diff = get_bits_long(gb, nbits);
410 if (s->slice[i].sign)
411 last_size += diff;
412 else
413 last_size -= diff;
414 if (last_size <= 0 || last_size > INT32_MAX)
415 return AVERROR_INVALIDDATA;
416 s->slice[i].size = last_size;
417 }
418
419 align_get_bits(gb);
420 return 0;
421}
422
423static int read_intra_mode(GetBitContext * gb, int * param)
424{

Callers 1

rv60_decode_frameFunction · 0.85

Calls 4

get_bits1Function · 0.85
get_bits_longFunction · 0.85
align_get_bitsFunction · 0.85
get_bitsFunction · 0.70

Tested by

no test coverage detected