/* * NV12: * YUV 4:2:0 image with a plane of 8 bit Y samples followed * by an interleaved U/V plane containing 8 bit 2x2 subsampled * colour difference samples. * * <-Y/UV_Stride (aligned to 128)-> * <------- Width -------> * Y Y Y Y Y Y Y Y Y Y Y Y . . . . ^ ^ * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | * Y Y Y Y Y Y Y Y Y Y Y Y . . . . Height | * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | y_scanlines (aligned to 32) * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | * Y Y Y Y Y Y Y Y Y Y Y Y . . . . V | * . . . . . . . . . . . . . . . . | * . . . . . . . . . . . . . . . . | * . . . . . . . . . . . . . . . . | * . . . . . . . . . . . . . . . . V * U V U V U V U V U V U V . . . . ^ * U V U V U V U V U V U V . . . . | * U V U V U V U V U V U V . . . . | * U V U V U V U V U V U V . . . . uv_scanlines (aligned to 16) * . . . . . . . . . . . . . . . . | * . . . . . . . . . . . . . . . . V * . . . . . . . . . . . . . . . . --> Buffer size aligned to 4K * * y_stride : Width aligned to 128 * uv_stride : Width aligned to 128 * y_scanlines: Height aligned to 32 * uv_scanlines: Height/2 aligned to 16 * Total size = align((y_stride * y_scanlines * + uv_stride * uv_scanlines , 4096) * * Note: All the alignments are hardware requirements.
*/ static u32 iris_yuv_buffer_size_nv12(struct iris_inst *inst)
{
u32 y_plane, uv_plane, y_stride, uv_stride, y_scanlines, uv_scanlines; struct v4l2_format *f = inst->fmt_dst;
/* * QC08C: * Compressed Macro-tile format for NV12. * Contains 4 planes in the following order - * (A) Y_Meta_Plane * (B) Y_UBWC_Plane * (C) UV_Meta_Plane * (D) UV_UBWC_Plane * * Y_Meta_Plane consists of meta information to decode compressed * tile data in Y_UBWC_Plane. * Y_UBWC_Plane consists of Y data in compressed macro-tile format. * UBWC decoder block will use the Y_Meta_Plane data together with * Y_UBWC_Plane data to produce loss-less uncompressed 8 bit Y samples. * * UV_Meta_Plane consists of meta information to decode compressed * tile data in UV_UBWC_Plane. * UV_UBWC_Plane consists of UV data in compressed macro-tile format. * UBWC decoder block will use UV_Meta_Plane data together with * UV_UBWC_Plane data to produce loss-less uncompressed 8 bit 2x2 * subsampled color difference samples. * * Each tile in Y_UBWC_Plane/UV_UBWC_Plane is independently decodable * and randomly accessible. There is no dependency between tiles. * * <----- y_meta_stride ----> (aligned to 64) * <-------- Width ------> * M M M M M M M M M M M M . . ^ ^ * M M M M M M M M M M M M . . | | * M M M M M M M M M M M M . . Height | * M M M M M M M M M M M M . . | y_meta_scanlines (aligned to 16) * M M M M M M M M M M M M . . | | * M M M M M M M M M M M M . . | | * M M M M M M M M M M M M . . | | * M M M M M M M M M M M M . . V | * . . . . . . . . . . . . . . | * . . . . . . . . . . . . . . | * . . . . . . . . . . . . . . -------> Buffer size aligned to 4k * . . . . . . . . . . . . . . V * <--Compressed tile y_stride---> (aligned to 128) * <------- Width -------> * Y* Y* Y* Y* Y* Y* Y* Y* . . . . ^ ^ * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | * Y* Y* Y* Y* Y* Y* Y* Y* . . . . Height | * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | Macro_tile y_scanlines (aligned to 32) * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | * Y* Y* Y* Y* Y* Y* Y* Y* . . . . V | * . . . . . . . . . . . . . . . . | * . . . . . . . . . . . . . . . . | * . . . . . . . . . . . . . . . . -------> Buffer size aligned to 4k * . . . . . . . . . . . . . . . . V * <----- uv_meta_stride ----> (aligned to 64) * M M M M M M M M M M M M . . ^ * M M M M M M M M M M M M . . | * M M M M M M M M M M M M . . | * M M M M M M M M M M M M . . uv_meta_scanlines (aligned to 16) * . . . . . . . . . . . . . . | * . . . . . . . . . . . . . . V * . . . . . . . . . . . . . . -------> Buffer size aligned to 4k * <--Compressed tile uv_stride---> (aligned to 128) * U* V* U* V* U* V* U* V* . . . . ^ * U* V* U* V* U* V* U* V* . . . . | * U* V* U* V* U* V* U* V* . . . . | * U* V* U* V* U* V* U* V* . . . . uv_scanlines (aligned to 32) * . . . . . . . . . . . . . . . . | * . . . . . . . . . . . . . . . . V * . . . . . . . . . . . . . . . . -------> Buffer size aligned to 4k * * y_stride: width aligned to 128 * uv_stride: width aligned to 128 * y_scanlines: height aligned to 32 * uv_scanlines: height aligned to 32 * y_plane: buffer size aligned to 4096 * uv_plane: buffer size aligned to 4096 * y_meta_stride: width aligned to 64 * y_meta_scanlines: height aligned to 16 * y_meta_plane: buffer size aligned to 4096 * uv_meta_stride: width aligned to 64 * uv_meta_scanlines: height aligned to 16 * uv_meta_plane: buffer size aligned to 4096 * * Total size = align( y_plane + uv_plane + * y_meta_plane + uv_meta_plane, 4096) * * Note: All the alignments are hardware requirements.
*/ static u32 iris_yuv_buffer_size_qc08c(struct iris_inst *inst)
{
u32 y_plane, uv_plane, y_stride, uv_stride; struct v4l2_format *f = inst->fmt_dst;
u32 uv_meta_stride, uv_meta_plane;
u32 y_meta_stride, y_meta_plane;
if (V4L2_TYPE_IS_OUTPUT(plane)) {
internal_buf_type = platform_data->dec_ip_int_buf_tbl;
len = platform_data->dec_ip_int_buf_tbl_size;
} else {
internal_buf_type = platform_data->dec_op_int_buf_tbl;
len = platform_data->dec_op_int_buf_tbl_size;
}
for (i = 0; i < len; i++) {
buffers = &inst->buffers[internal_buf_type[i]];
list_for_each_entry_safe(buf, next, &buffers->list, list) { /* * during stream on, skip destroying internal(DPB) buffer * if firmware did not return it. * during close, destroy all buffers irrespectively.
*/ if (!force && buf->attr & BUF_ATTR_QUEUED) continue;
ret = iris_destroy_internal_buffer(inst, buf); if (ret) return ret;
}
}
if (force) {
buffers = &inst->buffers[BUF_PERSIST];
list_for_each_entry_safe(buf, next, &buffers->list, list) {
ret = iris_destroy_internal_buffer(inst, buf); if (ret) return ret;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.