| 161 | } |
| 162 | |
| 163 | static void mp_decode_line(MotionPixelsContext *mp, GetBitContext *gb, int y) |
| 164 | { |
| 165 | YuvPixel p; |
| 166 | const int y0 = y * mp->avctx->width; |
| 167 | int w, i, x = 0; |
| 168 | |
| 169 | p = mp->vpt[y]; |
| 170 | if (mp->changes_map[y0 + x] == 0) { |
| 171 | memset(mp->gradient_scale, 1, sizeof(mp->gradient_scale)); |
| 172 | ++x; |
| 173 | } |
| 174 | while (x < mp->avctx->width) { |
| 175 | w = mp->changes_map[y0 + x]; |
| 176 | if (w != 0) { |
| 177 | if ((y & 3) == 0) { |
| 178 | if (mp->changes_map[y0 + x + mp->avctx->width] < w || |
| 179 | mp->changes_map[y0 + x + mp->avctx->width * 2] < w || |
| 180 | mp->changes_map[y0 + x + mp->avctx->width * 3] < w) { |
| 181 | for (i = (x + 3) & ~3; i < x + w; i += 4) { |
| 182 | mp->hpt[((y / 4) * mp->avctx->width + i) / 4] = mp_get_yuv_from_rgb(mp, i, y); |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | x += w; |
| 187 | memset(mp->gradient_scale, 1, sizeof(mp->gradient_scale)); |
| 188 | p = mp_get_yuv_from_rgb(mp, x - 1, y); |
| 189 | } else { |
| 190 | p.y += mp_gradient(mp, 0, mp_get_vlc(mp, gb)); |
| 191 | if ((x & 3) == 0) { |
| 192 | if ((y & 3) == 0) { |
| 193 | p.v += mp_gradient(mp, 1, mp_get_vlc(mp, gb)); |
| 194 | p.u += mp_gradient(mp, 2, mp_get_vlc(mp, gb)); |
| 195 | mp->hpt[((y / 4) * mp->avctx->width + x) / 4] = p; |
| 196 | } else { |
| 197 | p.v = mp->hpt[((y / 4) * mp->avctx->width + x) / 4].v; |
| 198 | p.u = mp->hpt[((y / 4) * mp->avctx->width + x) / 4].u; |
| 199 | } |
| 200 | } |
| 201 | mp_set_rgb_from_yuv(mp, x, y, &p); |
| 202 | ++x; |
| 203 | } |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | static void mp_decode_frame_helper(MotionPixelsContext *mp, GetBitContext *gb) |
| 208 | { |
no test coverage detected