Lines Matching refs:surface_image
356 VAImage surface_image; in upload_yuv_to_surface() local
370 va_status = vaDeriveImage(va_dpy, surface_id, &surface_image); in upload_yuv_to_surface()
373 vaMapBuffer(va_dpy, surface_image.buf, &surface_p); in upload_yuv_to_surface()
380 y_dst = surface_p + surface_image.offsets[0]; in upload_yuv_to_surface()
381 u_dst = surface_p + surface_image.offsets[1]; /* UV offset for NV12 */ in upload_yuv_to_surface()
382 v_dst = surface_p + surface_image.offsets[2]; in upload_yuv_to_surface()
385 for (row = 0; row < surface_image.height; row++) { in upload_yuv_to_surface()
386 memcpy(y_dst, y_src, surface_image.width); in upload_yuv_to_surface()
387 y_dst += surface_image.pitches[0]; in upload_yuv_to_surface()
391 if (surface_image.format.fourcc == VA_FOURCC_NV12) { /* UV plane */ in upload_yuv_to_surface()
392 for (row = 0; row < surface_image.height / 2; row++) { in upload_yuv_to_surface()
393 for (col = 0; col < surface_image.width / 2; col++) { in upload_yuv_to_surface()
398 u_dst += surface_image.pitches[1]; in upload_yuv_to_surface()
402 } else if (surface_image.format.fourcc == VA_FOURCC_YV12 || in upload_yuv_to_surface()
403 surface_image.format.fourcc == VA_FOURCC_I420) { in upload_yuv_to_surface()
404 const int U = surface_image.format.fourcc == VA_FOURCC_I420 ? 1 : 2; in upload_yuv_to_surface()
405 const int V = surface_image.format.fourcc == VA_FOURCC_I420 ? 2 : 1; in upload_yuv_to_surface()
407 u_dst = surface_p + surface_image.offsets[U]; in upload_yuv_to_surface()
408 v_dst = surface_p + surface_image.offsets[V]; in upload_yuv_to_surface()
410 for (row = 0; row < surface_image.height / 2; row++) { in upload_yuv_to_surface()
411 memcpy(u_dst, u_src, surface_image.width / 2); in upload_yuv_to_surface()
412 memcpy(v_dst, v_src, surface_image.width / 2); in upload_yuv_to_surface()
413 u_dst += surface_image.pitches[U]; in upload_yuv_to_surface()
414 v_dst += surface_image.pitches[V]; in upload_yuv_to_surface()
420 vaUnmapBuffer(va_dpy, surface_image.buf); in upload_yuv_to_surface()
421 vaDestroyImage(va_dpy, surface_image.image_id); in upload_yuv_to_surface()