| 151 | } |
| 152 | |
| 153 | static 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 | |
| 175 | static av_always_inline int mp_gradient(MotionPixelsContext *mp, int component, int v) |
| 176 | { |
no test coverage detected