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

Function mp_decode_frame_helper

libavcodec/motionpixels.c:253–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253static 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
282static int mp_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
283 int *got_frame, AVPacket *avpkt)

Callers 1

mp_decode_frameFunction · 0.85

Calls 5

mp_get_yuv_from_rgbFunction · 0.85
mp_gradientFunction · 0.85
mp_get_vlcFunction · 0.85
mp_set_rgb_from_yuvFunction · 0.85
mp_decode_lineFunction · 0.85

Tested by

no test coverage detected