Home | History | Annotate | Download | only in encode

Lines Matching refs:surface_image

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