| 205 | } |
| 206 | |
| 207 | static void mp_decode_frame_helper(MotionPixelsContext *mp, GetBitContext *gb) |
| 208 | { |
| 209 | YuvPixel p; |
| 210 | int y, y0; |
| 211 | |
| 212 | for (y = 0; y < mp->avctx->height; ++y) { |
| 213 | if (mp->changes_map[y * mp->avctx->width] != 0) { |
| 214 | memset(mp->gradient_scale, 1, sizeof(mp->gradient_scale)); |
| 215 | p = mp_get_yuv_from_rgb(mp, 0, y); |
| 216 | } else { |
| 217 | p.y += mp_gradient(mp, 0, mp_get_vlc(mp, gb)); |
| 218 | if ((y & 3) == 0) { |
| 219 | p.v += mp_gradient(mp, 1, mp_get_vlc(mp, gb)); |
| 220 | p.u += mp_gradient(mp, 2, mp_get_vlc(mp, gb)); |
| 221 | } |
| 222 | mp->vpt[y] = p; |
| 223 | mp_set_rgb_from_yuv(mp, 0, y, &p); |
| 224 | } |
| 225 | } |
| 226 | for (y0 = 0; y0 < 2; ++y0) |
| 227 | for (y = y0; y < mp->avctx->height; y += 2) |
| 228 | mp_decode_line(mp, gb, y); |
| 229 | } |
| 230 | |
| 231 | static int mp_decode_frame(AVCodecContext *avctx, |
| 232 | void *data, int *data_size, |
no test coverage detected