1724 | 1724 |
obj_surface->subsampling = SUBSAMPLE_YUV420;
|
1725 | 1725 |
obj_surface->y_cb_offset = obj_surface->height;
|
1726 | 1726 |
obj_surface->y_cr_offset = obj_surface->height;
|
1727 | |
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
|
1728 | |
obj_surface->cb_cr_height = obj_surface->orig_height / 2;
|
|
1727 |
obj_surface->cb_cr_width = ALIGN(obj_surface->orig_width, 2) / 2;
|
|
1728 |
obj_surface->cb_cr_height = ALIGN(obj_surface->orig_height, 2) / 2;
|
1729 | 1729 |
obj_surface->cb_cr_pitch = memory_attibute->pitches[1];
|
1730 | 1730 |
if (tiling)
|
1731 | 1731 |
ASSERT_RET(IS_ALIGNED(obj_surface->cb_cr_pitch, 128), VA_STATUS_ERROR_INVALID_PARAMETER);
|
|
1742 | 1742 |
obj_surface->subsampling = SUBSAMPLE_YUV420;
|
1743 | 1743 |
obj_surface->y_cr_offset = obj_surface->height;
|
1744 | 1744 |
obj_surface->y_cb_offset = memory_attibute->offsets[2] / obj_surface->width;
|
1745 | |
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
|
1746 | |
obj_surface->cb_cr_height = obj_surface->orig_height / 2;
|
|
1745 |
obj_surface->cb_cr_width = ALIGN(obj_surface->orig_width, 2) / 2;
|
|
1746 |
obj_surface->cb_cr_height = ALIGN(obj_surface->orig_height, 2) / 2;
|
1747 | 1747 |
obj_surface->cb_cr_pitch = memory_attibute->pitches[1];
|
1748 | 1748 |
|
1749 | 1749 |
if (tiling)
|
|
1763 | 1763 |
obj_surface->subsampling = SUBSAMPLE_YUV420;
|
1764 | 1764 |
obj_surface->y_cb_offset = obj_surface->height;
|
1765 | 1765 |
obj_surface->y_cr_offset = memory_attibute->offsets[2] / obj_surface->width;
|
1766 | |
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
|
1767 | |
obj_surface->cb_cr_height = obj_surface->orig_height / 2;
|
|
1766 |
obj_surface->cb_cr_width = ALIGN(obj_surface->orig_width, 2) / 2;
|
|
1767 |
obj_surface->cb_cr_height = ALIGN(obj_surface->orig_height, 2) / 2;
|
1768 | 1768 |
obj_surface->cb_cr_pitch = memory_attibute->pitches[1];
|
1769 | 1769 |
if (tiling)
|
1770 | 1770 |
ASSERT_RET(IS_ALIGNED(obj_surface->cb_cr_pitch, 128), VA_STATUS_ERROR_INVALID_PARAMETER);
|
|
1836 | 1836 |
obj_surface->subsampling = SUBSAMPLE_YUV422H;
|
1837 | 1837 |
obj_surface->y_cb_offset = obj_surface->height;
|
1838 | 1838 |
obj_surface->y_cr_offset = memory_attibute->offsets[2] / obj_surface->width;
|
1839 | |
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
|
|
1839 |
obj_surface->cb_cr_width = ALIGN(obj_surface->orig_width, 2) / 2;
|
1840 | 1840 |
obj_surface->cb_cr_height = obj_surface->orig_height;
|
1841 | 1841 |
obj_surface->cb_cr_pitch = memory_attibute->pitches[1];
|
1842 | 1842 |
if (tiling)
|
|
1853 | 1853 |
obj_surface->subsampling = SUBSAMPLE_YUV422H;
|
1854 | 1854 |
obj_surface->y_cr_offset = memory_attibute->offsets[1] / obj_surface->width;
|
1855 | 1855 |
obj_surface->y_cb_offset = memory_attibute->offsets[2] / obj_surface->width;
|
1856 | |
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
|
|
1856 |
obj_surface->cb_cr_width = ALIGN(obj_surface->orig_width, 2) / 2;
|
1857 | 1857 |
obj_surface->cb_cr_height = obj_surface->orig_height;
|
1858 | 1858 |
obj_surface->cb_cr_pitch = memory_attibute->pitches[1];
|
1859 | 1859 |
ASSERT_RET(IS_ALIGNED(obj_surface->cb_cr_pitch, i965->codec_info->min_linear_wpitch), VA_STATUS_ERROR_INVALID_PARAMETER);
|
|
1868 | 1868 |
obj_surface->y_cb_offset = obj_surface->height;
|
1869 | 1869 |
obj_surface->y_cr_offset = memory_attibute->offsets[2] / obj_surface->width;
|
1870 | 1870 |
obj_surface->cb_cr_width = obj_surface->orig_width;
|
1871 | |
obj_surface->cb_cr_height = obj_surface->orig_height / 2;
|
|
1871 |
obj_surface->cb_cr_height = ALIGN(obj_surface->orig_height, 2) / 2;
|
1872 | 1872 |
obj_surface->cb_cr_pitch = memory_attibute->pitches[1];
|
1873 | 1873 |
if (tiling)
|
1874 | 1874 |
ASSERT_RET(IS_ALIGNED(obj_surface->cb_cr_pitch, 128), VA_STATUS_ERROR_INVALID_PARAMETER);
|
|
4525 | 4525 |
case VA_FOURCC_P010:
|
4526 | 4526 |
assert(subsampling == SUBSAMPLE_YUV420);
|
4527 | 4527 |
obj_surface->cb_cr_pitch = obj_surface->width;
|
4528 | |
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
|
4529 | |
obj_surface->cb_cr_height = obj_surface->orig_height / 2;
|
|
4528 |
obj_surface->cb_cr_width = ALIGN(obj_surface->orig_width, 2) / 2;
|
|
4529 |
obj_surface->cb_cr_height = ALIGN(obj_surface->orig_height, 2) / 2;
|
4530 | 4530 |
obj_surface->y_cb_offset = obj_surface->height;
|
4531 | 4531 |
obj_surface->y_cr_offset = obj_surface->height;
|
4532 | 4532 |
region_width = obj_surface->width;
|
|
4537 | 4537 |
case VA_FOURCC_IMC1:
|
4538 | 4538 |
assert(subsampling == SUBSAMPLE_YUV420);
|
4539 | 4539 |
obj_surface->cb_cr_pitch = obj_surface->width;
|
4540 | |
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
|
4541 | |
obj_surface->cb_cr_height = obj_surface->orig_height / 2;
|
|
4540 |
obj_surface->cb_cr_width = ALIGN(obj_surface->orig_width, 2) / 2;
|
|
4541 |
obj_surface->cb_cr_height = ALIGN(obj_surface->orig_height, 2) / 2;
|
4542 | 4542 |
obj_surface->y_cr_offset = obj_surface->height;
|
4543 | 4543 |
obj_surface->y_cb_offset = obj_surface->y_cr_offset + ALIGN(obj_surface->cb_cr_height, 32);
|
4544 | 4544 |
region_width = obj_surface->width;
|
|
4549 | 4549 |
case VA_FOURCC_IMC3:
|
4550 | 4550 |
assert(subsampling == SUBSAMPLE_YUV420);
|
4551 | 4551 |
obj_surface->cb_cr_pitch = obj_surface->width;
|
4552 | |
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
|
4553 | |
obj_surface->cb_cr_height = obj_surface->orig_height / 2;
|
|
4552 |
obj_surface->cb_cr_width = ALIGN(obj_surface->orig_width, 2) / 2;
|
|
4553 |
obj_surface->cb_cr_height = ALIGN(obj_surface->orig_height, 2) / 2;
|
4554 | 4554 |
obj_surface->y_cb_offset = obj_surface->height;
|
4555 | 4555 |
obj_surface->y_cr_offset = obj_surface->y_cb_offset + ALIGN(obj_surface->cb_cr_height, 32);
|
4556 | 4556 |
region_width = obj_surface->width;
|
|
4561 | 4561 |
case VA_FOURCC_422H:
|
4562 | 4562 |
assert(subsampling == SUBSAMPLE_YUV422H);
|
4563 | 4563 |
obj_surface->cb_cr_pitch = obj_surface->width;
|
4564 | |
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
|
|
4564 |
obj_surface->cb_cr_width = ALIGN(obj_surface->orig_width, 2) / 2;
|
4565 | 4565 |
obj_surface->cb_cr_height = obj_surface->orig_height;
|
4566 | 4566 |
obj_surface->y_cb_offset = obj_surface->height;
|
4567 | 4567 |
obj_surface->y_cr_offset = obj_surface->y_cb_offset + ALIGN(obj_surface->cb_cr_height, 32);
|
|
4574 | 4574 |
assert(subsampling == SUBSAMPLE_YUV422V);
|
4575 | 4575 |
obj_surface->cb_cr_pitch = obj_surface->width;
|
4576 | 4576 |
obj_surface->cb_cr_width = obj_surface->orig_width;
|
4577 | |
obj_surface->cb_cr_height = obj_surface->orig_height / 2;
|
|
4577 |
obj_surface->cb_cr_height = ALIGN(obj_surface->orig_height, 2) / 2;
|
4578 | 4578 |
obj_surface->y_cb_offset = obj_surface->height;
|
4579 | 4579 |
obj_surface->y_cr_offset = obj_surface->y_cb_offset + ALIGN(obj_surface->cb_cr_height, 32);
|
4580 | 4580 |
region_width = obj_surface->width;
|
|
4662 | 4662 |
case VA_FOURCC_P010:
|
4663 | 4663 |
obj_surface->y_cb_offset = obj_surface->height;
|
4664 | 4664 |
obj_surface->y_cr_offset = obj_surface->height;
|
4665 | |
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
|
|
4665 |
obj_surface->cb_cr_width = ALIGN(obj_surface->orig_width, 2) / 2;
|
4666 | 4666 |
obj_surface->width = ALIGN(obj_surface->cb_cr_width * 2, i965->codec_info->min_linear_wpitch) *
|
4667 | 4667 |
bpp_1stplane;
|
4668 | |
obj_surface->cb_cr_height = obj_surface->orig_height / 2;
|
|
4668 |
obj_surface->cb_cr_height = ALIGN(obj_surface->orig_height, 2) / 2;
|
4669 | 4669 |
obj_surface->cb_cr_pitch = obj_surface->width;
|
4670 | 4670 |
region_width = obj_surface->width;
|
4671 | 4671 |
region_height = obj_surface->height + obj_surface->height / 2;
|
4672 | 4672 |
break;
|
4673 | 4673 |
|
4674 | 4674 |
case VA_FOURCC_YV16:
|
4675 | |
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
|
|
4675 |
obj_surface->cb_cr_width = ALIGN(obj_surface->orig_width, 2) / 2;
|
4676 | 4676 |
obj_surface->width = ALIGN(obj_surface->cb_cr_width, i965->codec_info->min_linear_wpitch) * 2;
|
4677 | 4677 |
obj_surface->cb_cr_height = obj_surface->orig_height;
|
4678 | 4678 |
obj_surface->y_cr_offset = obj_surface->height;
|
|
4693 | 4693 |
obj_surface->y_cr_offset = obj_surface->height + obj_surface->height / 4;
|
4694 | 4694 |
}
|
4695 | 4695 |
|
4696 | |
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
|
|
4696 |
obj_surface->cb_cr_width = ALIGN(obj_surface->orig_width, 2) / 2;
|
4697 | 4697 |
obj_surface->width = ALIGN(obj_surface->cb_cr_width, i965->codec_info->min_linear_wpitch) * 2;
|
4698 | |
obj_surface->cb_cr_height = obj_surface->orig_height / 2;
|
|
4698 |
obj_surface->cb_cr_height = ALIGN(obj_surface->orig_height, 2) / 2;
|
4699 | 4699 |
obj_surface->cb_cr_pitch = obj_surface->width / 2;
|
4700 | 4700 |
region_width = obj_surface->width;
|
4701 | 4701 |
region_height = obj_surface->height + obj_surface->height / 2;
|
|
4704 | 4704 |
case VA_FOURCC_I010:
|
4705 | 4705 |
obj_surface->y_cb_offset = obj_surface->height;
|
4706 | 4706 |
obj_surface->y_cr_offset = obj_surface->height + obj_surface->height / 4;
|
4707 | |
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
|
|
4707 |
obj_surface->cb_cr_width = ALIGN(obj_surface->orig_width, 2) / 2;
|
4708 | 4708 |
obj_surface->width = ALIGN(obj_surface->cb_cr_width * 2, i965->codec_info->min_linear_wpitch) * 2;
|
4709 | |
obj_surface->cb_cr_height = obj_surface->orig_height / 2;
|
|
4709 |
obj_surface->cb_cr_height =ALIGN(obj_surface->orig_height, 2) / 2;
|
4710 | 4710 |
obj_surface->cb_cr_pitch = obj_surface->width / 2;
|
4711 | 4711 |
region_width = obj_surface->width;
|
4712 | 4712 |
region_height = obj_surface->height + obj_surface->height / 2;
|