diff options
author | Priyanka Gujjula <pgujjula@codeaurora.org> | 2020-07-15 16:23:43 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2020-08-17 20:39:54 -0700 |
commit | fe47c74012b0936fabaa6e503618f9359891ab6a (patch) | |
tree | d27cead2e83dc0d550f9fd5abda29315b81bd89b | |
parent | 4d49ef27ea3c02b909cbd8b020a46717e7a2a9d5 (diff) |
mm-video-v4l2: vdec: Override client primaries only for >=UHD
There are few compliance tests which sets for color primaries
and checks the color primaries received. At the same time,
IL client enforces BT2020 for UHD and higher. To allow the
flexibility for tests to choose the color space, allow
client specified color space for lower resolutions.
Change-Id: I695cea420439cf048f9a87446cc22d059780f9fe
-rw-r--r-- | mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp index ccc39748..aa32dd05 100644 --- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp +++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp @@ -11219,6 +11219,9 @@ void omx_vdec::convert_hdr_info_to_metadata(HDRStaticInfo& hdr_info, ColorMetaDa void omx_vdec::get_preferred_color_aspects(ColorAspects& preferredColorAspects) { + OMX_U32 width = drv_ctx.video_resolution.frame_width; + OMX_U32 height = drv_ctx.video_resolution.frame_height; + // For VPX, use client-color if specified. // For the rest, try to use the stream-color if present bool preferClientColor = (output_capability == V4L2_PIX_FMT_VP8 || @@ -11229,11 +11232,11 @@ void omx_vdec::get_preferred_color_aspects(ColorAspects& preferredColorAspects) const ColorAspects &defaultColor = preferClientColor ? m_internal_color_space.sAspects : m_client_color_space.sAspects; - /* Client sets BT2020 for UHD and higher. Set correct aspects if the bistream is 8-bit */ - if ((m_client_color_space.sAspects.mPrimaries == ColorAspects::PrimariesBT2020) && + if ((width >= 3840 || height >= 3840 || width * (int64_t)height >= 3840 * 1634) && + (m_client_color_space.sAspects.mPrimaries == ColorAspects::PrimariesBT2020) && (dpb_bit_depth == MSM_VIDC_BIT_DEPTH_8)) { - m_client_color_space.sAspects.mPrimaries = ColorAspects::PrimariesBT709_5; - m_client_color_space.sAspects.mMatrixCoeffs = ColorAspects::MatrixBT709_5; + m_client_color_space.sAspects.mPrimaries = ColorAspects::PrimariesBT709_5; + m_client_color_space.sAspects.mMatrixCoeffs = ColorAspects::MatrixBT709_5; } preferredColorAspects.mPrimaries = preferredColor.mPrimaries != ColorAspects::PrimariesUnspecified ? |