Lines Matching refs:surface_image
212 VAImage surface_image; in construct_nv12_mask_surface() local
217 va_status = vaDeriveImage(va_dpy, surface_id, &surface_image); in construct_nv12_mask_surface()
220 va_status = vaMapBuffer(va_dpy, surface_image.buf, &surface_p); in construct_nv12_mask_surface()
223 y_dst = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[0]); in construct_nv12_mask_surface()
224 u_dst = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[1]); in construct_nv12_mask_surface()
230 for (row = 0; row < surface_image.height; row++) { in construct_nv12_mask_surface()
231 if (row < surface_image.height / 4 || row > surface_image.height * 3 / 4) in construct_nv12_mask_surface()
232 memset(y_dst, max_luma + 1, surface_image.pitches[0]); in construct_nv12_mask_surface()
234 memset(y_dst, (min_luma + max_luma) / 2, surface_image.pitches[0]); in construct_nv12_mask_surface()
236 y_dst += surface_image.pitches[0]; in construct_nv12_mask_surface()
240 for (row = 0; row < surface_image.height / 2; row++) { in construct_nv12_mask_surface()
241 for (col = 0; col < surface_image.width / 2; col++) { in construct_nv12_mask_surface()
245 u_dst += surface_image.pitches[1]; in construct_nv12_mask_surface()
248 vaUnmapBuffer(va_dpy, surface_image.buf); in construct_nv12_mask_surface()
249 vaDestroyImage(va_dpy, surface_image.image_id); in construct_nv12_mask_surface()
260 VAImage surface_image; in upload_yv12_frame_to_yuv_surface() local
268 va_status = vaDeriveImage(va_dpy, surface_id, &surface_image); in upload_yv12_frame_to_yuv_surface()
271 va_status = vaMapBuffer(va_dpy, surface_image.buf, &surface_p); in upload_yv12_frame_to_yuv_surface()
274 if (surface_image.format.fourcc == VA_FOURCC_YV12 || in upload_yv12_frame_to_yuv_surface()
275 surface_image.format.fourcc == VA_FOURCC_I420 || in upload_yv12_frame_to_yuv_surface()
276 surface_image.format.fourcc == VA_FOURCC_NV12){ in upload_yv12_frame_to_yuv_surface()
278 frame_size = surface_image.width * surface_image.height * 3 / 2; in upload_yv12_frame_to_yuv_surface()
285 v_src = newImageBuffer + surface_image.width * surface_image.height; in upload_yv12_frame_to_yuv_surface()
286 u_src = newImageBuffer + surface_image.width * surface_image.height * 5 / 4; in upload_yv12_frame_to_yuv_surface()
288 y_dst = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[0]); in upload_yv12_frame_to_yuv_surface()
290 if(surface_image.format.fourcc == VA_FOURCC_YV12){ in upload_yv12_frame_to_yuv_surface()
291 v_dst = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[1]); in upload_yv12_frame_to_yuv_surface()
292 u_dst = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[2]); in upload_yv12_frame_to_yuv_surface()
293 }else if(surface_image.format.fourcc == VA_FOURCC_I420){ in upload_yv12_frame_to_yuv_surface()
294 u_dst = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[1]); in upload_yv12_frame_to_yuv_surface()
295 v_dst = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[2]); in upload_yv12_frame_to_yuv_surface()
297 u_dst = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[1]); in upload_yv12_frame_to_yuv_surface()
302 for (row = 0; row < surface_image.height; row++) { in upload_yv12_frame_to_yuv_surface()
303 memcpy(y_dst, y_src, surface_image.width); in upload_yv12_frame_to_yuv_surface()
304 y_dst += surface_image.pitches[0]; in upload_yv12_frame_to_yuv_surface()
305 y_src += surface_image.width; in upload_yv12_frame_to_yuv_surface()
309 if (surface_image.format.fourcc == VA_FOURCC_YV12|| in upload_yv12_frame_to_yuv_surface()
310 surface_image.format.fourcc == VA_FOURCC_I420){ in upload_yv12_frame_to_yuv_surface()
312 for (row = 0; row < surface_image.height /2; row ++){ in upload_yv12_frame_to_yuv_surface()
313 memcpy(v_dst, v_src, surface_image.width/2); in upload_yv12_frame_to_yuv_surface()
314 memcpy(u_dst, u_src, surface_image.width/2); in upload_yv12_frame_to_yuv_surface()
316 v_src += surface_image.width/2; in upload_yv12_frame_to_yuv_surface()
317 u_src += surface_image.width/2; in upload_yv12_frame_to_yuv_surface()
319 if (surface_image.format.fourcc == VA_FOURCC_YV12){ in upload_yv12_frame_to_yuv_surface()
320 v_dst += surface_image.pitches[1]; in upload_yv12_frame_to_yuv_surface()
321 u_dst += surface_image.pitches[2]; in upload_yv12_frame_to_yuv_surface()
323 v_dst += surface_image.pitches[2]; in upload_yv12_frame_to_yuv_surface()
324 u_dst += surface_image.pitches[1]; in upload_yv12_frame_to_yuv_surface()
327 } else if (surface_image.format.fourcc == VA_FOURCC_NV12){ in upload_yv12_frame_to_yuv_surface()
328 for (row = 0; row < surface_image.height / 2; row++) { in upload_yv12_frame_to_yuv_surface()
329 for (col = 0; col < surface_image.width / 2; col++) { in upload_yv12_frame_to_yuv_surface()
334 u_dst += surface_image.pitches[1]; in upload_yv12_frame_to_yuv_surface()
335 u_src += (surface_image.width / 2); in upload_yv12_frame_to_yuv_surface()
336 v_src += (surface_image.width / 2); in upload_yv12_frame_to_yuv_surface()
349 vaUnmapBuffer(va_dpy, surface_image.buf); in upload_yv12_frame_to_yuv_surface()
350 vaDestroyImage(va_dpy, surface_image.image_id); in upload_yv12_frame_to_yuv_surface()
362 VAImage surface_image; in store_yuv_surface_to_yv12_frame() local
370 va_status = vaDeriveImage(va_dpy, surface_id, &surface_image); in store_yuv_surface_to_yv12_frame()
373 va_status = vaMapBuffer(va_dpy, surface_image.buf, &surface_p); in store_yuv_surface_to_yv12_frame()
377 if (surface_image.format.fourcc == VA_FOURCC_YV12 || in store_yuv_surface_to_yv12_frame()
378 surface_image.format.fourcc == VA_FOURCC_I420 || in store_yuv_surface_to_yv12_frame()
379 surface_image.format.fourcc == VA_FOURCC_NV12){ in store_yuv_surface_to_yv12_frame()
381 uint32_t y_size = surface_image.width * surface_image.height; in store_yuv_surface_to_yv12_frame()
391 y_src = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[0]); in store_yuv_surface_to_yv12_frame()
392 if (surface_image.format.fourcc == VA_FOURCC_YV12){ in store_yuv_surface_to_yv12_frame()
393 v_src = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[1]); in store_yuv_surface_to_yv12_frame()
394 u_src = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[2]); in store_yuv_surface_to_yv12_frame()
395 } else if(surface_image.format.fourcc == VA_FOURCC_I420){ in store_yuv_surface_to_yv12_frame()
396 u_src = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[1]); in store_yuv_surface_to_yv12_frame()
397 v_src = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[2]); in store_yuv_surface_to_yv12_frame()
398 } else if(surface_image.format.fourcc == VA_FOURCC_NV12){ in store_yuv_surface_to_yv12_frame()
399 u_src = (unsigned char *)((unsigned char*)surface_p + surface_image.offsets[1]); in store_yuv_surface_to_yv12_frame()
404 for (row = 0; row < surface_image.height; row++) { in store_yuv_surface_to_yv12_frame()
405 memcpy(y_dst, y_src, surface_image.width); in store_yuv_surface_to_yv12_frame()
406 y_src += surface_image.pitches[0]; in store_yuv_surface_to_yv12_frame()
407 y_dst += surface_image.width; in store_yuv_surface_to_yv12_frame()
411 if (surface_image.format.fourcc == VA_FOURCC_YV12|| in store_yuv_surface_to_yv12_frame()
412 surface_image.format.fourcc == VA_FOURCC_I420){ in store_yuv_surface_to_yv12_frame()
413 for (row = 0; row < surface_image.height /2; row ++){ in store_yuv_surface_to_yv12_frame()
414 memcpy(v_dst, v_src, surface_image.width/2); in store_yuv_surface_to_yv12_frame()
415 memcpy(u_dst, u_src, surface_image.width/2); in store_yuv_surface_to_yv12_frame()
417 v_dst += surface_image.width/2; in store_yuv_surface_to_yv12_frame()
418 u_dst += surface_image.width/2; in store_yuv_surface_to_yv12_frame()
420 if (surface_image.format.fourcc == VA_FOURCC_YV12){ in store_yuv_surface_to_yv12_frame()
421 v_src += surface_image.pitches[1]; in store_yuv_surface_to_yv12_frame()
422 u_src += surface_image.pitches[2]; in store_yuv_surface_to_yv12_frame()
424 v_src += surface_image.pitches[2]; in store_yuv_surface_to_yv12_frame()
425 u_src += surface_image.pitches[1]; in store_yuv_surface_to_yv12_frame()
428 } else if (surface_image.format.fourcc == VA_FOURCC_NV12){ in store_yuv_surface_to_yv12_frame()
429 for (row = 0; row < surface_image.height / 2; row++) { in store_yuv_surface_to_yv12_frame()
430 for (col = 0; col < surface_image.width /2; col++) { in store_yuv_surface_to_yv12_frame()
435 u_src += surface_image.pitches[1]; in store_yuv_surface_to_yv12_frame()
436 u_dst += (surface_image.width / 2); in store_yuv_surface_to_yv12_frame()
437 v_dst += (surface_image.width / 2); in store_yuv_surface_to_yv12_frame()
456 vaUnmapBuffer(va_dpy, surface_image.buf); in store_yuv_surface_to_yv12_frame()
457 vaDestroyImage(va_dpy, surface_image.image_id); in store_yuv_surface_to_yv12_frame()