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

Function mp_read_codes_table

libavcodec/motionpixels.c:153–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153static int mp_read_codes_table(MotionPixelsContext *mp, GetBitContext *gb)
154{
155 if (mp->codes_count == 1) {
156 mp->codes[0].delta = get_bits(gb, 4);
157 } else {
158 int i;
159 int ret;
160
161 mp->max_codes_bits = get_bits(gb, 4);
162 for (i = 0; i < mp->codes_count; ++i)
163 mp->codes[i].delta = get_bits(gb, 4);
164 mp->current_codes_count = 0;
165 if ((ret = mp_get_code(mp, gb, 0)) < 0)
166 return ret;
167 if (mp->current_codes_count < mp->codes_count) {
168 av_log(mp->avctx, AV_LOG_ERROR, "too few codes\n");
169 return AVERROR_INVALIDDATA;
170 }
171 }
172 return 0;
173}
174
175static av_always_inline int mp_gradient(MotionPixelsContext *mp, int component, int v)
176{

Callers 1

mp_decode_frameFunction · 0.85

Calls 3

mp_get_codeFunction · 0.85
av_logFunction · 0.85
get_bitsFunction · 0.70

Tested by

no test coverage detected