pitch[1] = obj_surface->cb_cr_pitch;
bo_offset[1] = obj_surface->width * obj_surface->y_cb_offset;
} else {
- /* I010/I420 format */
width[1] = width[0] / 2;
height[1] = height[0] / 2;
pitch[1] = obj_surface->cb_cr_pitch;
pitch[1] = obj_image->image.pitches[1];
bo_offset[1] = obj_image->image.offsets[1];
} else {
- /* I010/I420 format */
- /* YV12 is TBD */
+ int u = 1, v = 2;
+
+ if (fourcc == VA_FOURCC_YV12 || fourcc == VA_FOURCC_IMC1)
+ u = 2, v = 1;
+
width[1] = width[0] / 2;
height[1] = height[0] / 2;
- pitch[1] = obj_image->image.pitches[1];
- bo_offset[1] = obj_image->image.offsets[1];
+ pitch[1] = obj_image->image.pitches[u];
+ bo_offset[1] = obj_image->image.offsets[u];
width[2] = width[0] / 2;
height[2] = height[0] / 2;
- pitch[2] = obj_image->image.pitches[2];
- bo_offset[2] = obj_image->image.offsets[2];
+ pitch[2] = obj_image->image.pitches[v];
+ bo_offset[2] = obj_image->image.offsets[v];
}
}
} else if (fourcc == VA_FOURCC_YUY2 || fourcc == VA_FOURCC_UYVY) {
/* nothing to do here */
} else {
- /* I010/I420 format */
width[1] = width[0] / 2;
height[1] = height[0] / 2;
pitch[1] = obj_surface->cb_cr_pitch;
} else if (fourcc == VA_FOURCC_YUY2 || fourcc == VA_FOURCC_UYVY) {
/* nothing to do here */
} else {
- /* I010/I420 format */
+ int u = 1, v = 2;
+
+ if (fourcc == VA_FOURCC_YV12 || fourcc == VA_FOURCC_IMC1)
+ u = 2, v = 1;
+
width[1] = width[0] / 2;
height[1] = height[0] / 2;
- pitch[1] = obj_image->image.pitches[1];
- bo_offset[1] = obj_image->image.offsets[1];
+ pitch[1] = obj_image->image.pitches[u];
+ bo_offset[1] = obj_image->image.offsets[u];
width[2] = width[0] / 2;
height[2] = height[0] / 2;
- pitch[2] = obj_image->image.pitches[2];
- bo_offset[2] = obj_image->image.offsets[2];
+ pitch[2] = obj_image->image.pitches[v];
+ bo_offset[2] = obj_image->image.offsets[v];
}
}
break;
case VA_FOURCC_I420:
+ case VA_FOURCC_IMC3: /* pitch / base address is set via surface_state */
dst_format = DST_FORMAT_I420;
break;
+ case VA_FOURCC_YV12:
+ case VA_FOURCC_IMC1: /* pitch / base address is set via surface_state */
+ dst_format = DST_FORMAT_YV12;
+ break;
+
default:
break;
}
scale_flag |= SRC_10BIT_420;
if (src_fourcc == VA_FOURCC_NV12 ||
- src_fourcc == VA_FOURCC_I420)
+ src_fourcc == VA_FOURCC_I420 ||
+ src_fourcc == VA_FOURCC_IMC3 ||
+ src_fourcc == VA_FOURCC_YV12 ||
+ src_fourcc == VA_FOURCC_IMC1)
scale_flag |= SRC_8BIT_420;
if (src_fourcc == VA_FOURCC_YUY2 ||
scale_flag |= DST_10BIT_420;
if (dst_fourcc == VA_FOURCC_NV12 ||
- dst_fourcc == VA_FOURCC_I420)
+ dst_fourcc == VA_FOURCC_I420 ||
+ dst_fourcc == VA_FOURCC_IMC3 ||
+ dst_fourcc == VA_FOURCC_YV12 ||
+ dst_fourcc == VA_FOURCC_IMC1)
scale_flag |= DST_8BIT_420;
if (dst_fourcc == VA_FOURCC_YUY2 ||