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