| 251 | } |
| 252 | |
| 253 | static void mp_decode_frame_helper(MotionPixelsContext *mp, GetBitContext *gb) |
| 254 | { |
| 255 | YuvPixel p; |
| 256 | int y, y0; |
| 257 | |
| 258 | av_assert1(mp->changes_map[0]); |
| 259 | |
| 260 | for (y = 0; y < mp->avctx->height; ++y) { |
| 261 | if (mp->changes_map[y * mp->avctx->width] != 0) { |
| 262 | memset(mp->gradient_scale, 1, sizeof(mp->gradient_scale)); |
| 263 | p = mp_get_yuv_from_rgb(mp, 0, y); |
| 264 | } else { |
| 265 | p.y += mp_gradient(mp, 0, mp_get_vlc(mp, gb)); |
| 266 | p.y = av_clip_uintp2(p.y, 5); |
| 267 | if ((y & 3) == 0) { |
| 268 | p.v += mp_gradient(mp, 1, mp_get_vlc(mp, gb)); |
| 269 | p.v = av_clip_intp2(p.v, 5); |
| 270 | p.u += mp_gradient(mp, 2, mp_get_vlc(mp, gb)); |
| 271 | p.u = av_clip_intp2(p.u, 5); |
| 272 | } |
| 273 | mp->vpt[y] = p; |
| 274 | mp_set_rgb_from_yuv(mp, 0, y, &p); |
| 275 | } |
| 276 | } |
| 277 | for (y0 = 0; y0 < 2; ++y0) |
| 278 | for (y = y0; y < mp->avctx->height; y += 2) |
| 279 | mp_decode_line(mp, gb, y); |
| 280 | } |
| 281 | |
| 282 | static int mp_decode_frame(AVCodecContext *avctx, AVFrame *rframe, |
| 283 | int *got_frame, AVPacket *avpkt) |
no test coverage detected