summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPriyanka Gujjula <pgujjula@codeaurora.org>2020-07-15 16:23:43 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2020-08-19 12:06:58 -0700
commit87fae06a57c5f22c6067c0af68249ef74988a480 (patch)
treed41fdb33b80155e3d007d14e3fb141e233b50366
parentb5d4b86b13fd7ded6dad57160bb951d3e3fe1405 (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.cpp11
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 cc584cd3..504fd091 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 ?