diff options
author | Praveen Chavan <pchavan@codeaurora.org> | 2017-06-30 01:15:05 -0700 |
---|---|---|
committer | Chong Zhang <chz@google.com> | 2017-07-05 11:03:20 -0700 |
commit | 72a6741bef5699f38df4d95864d7fcdc2ca53d6e (patch) | |
tree | 81cce11c8b5a49b358430068ef05e966c4d5093d /msm8998 | |
parent | 956c1217c1c6515d5200297ac8bde93f857b0ba8 (diff) | |
download | media-72a6741bef5699f38df4d95864d7fcdc2ca53d6e.tar.gz |
mm-video-v4l2: venc: Set 601-Limited colorspace for color-converted buffers
Colorspace is derived from gralloc-handles for graphic-buffers and set to codec.
RGBA8888 Buffers are converted to YUV via C2D and have 601-Limited color.
When passed to the device-layer, such buffers do not have gralloc-handle
and hence colorspace does not get set.
Set colorspace as 601-L explicitly in such case to the codec.
b/63147656
Test: verified that it fixes the failures in EncodeVirtualDisplayTest#
testEncodeVirtualDisplay and DecodeEditEncodeTest#testVideoEdit720p
CRs-Fixed: 2070838
Change-Id: Iae2705b8f4256d8e76309d2d1adb7cb6d3eb1692
Diffstat (limited to 'msm8998')
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp index 92d98b5..64b709d 100644 --- a/msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp +++ b/msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp @@ -4105,6 +4105,13 @@ bool venc_dev::venc_empty_buf(void *buffer, void *pmem_data_buf, unsigned index, ": filled %d of %d format 0x%lx", fd, plane[0].bytesused, plane[0].length, m_sVenc_cfg.inputformat); } } else { + // color_format == 1 ==> RGBA to YUV Color-converted buffer + // Buffers color-converted via C2D have 601-Limited color + if (!streaming[OUTPUT_PORT]) { + DEBUG_PRINT_HIGH("Setting colorspace 601-L for Color-converted buffer"); + venc_set_colorspace(MSM_VIDC_BT601_6_625, 0 /*range-limited*/, + MSM_VIDC_TRANSFER_601_6_525, MSM_VIDC_MATRIX_601_6_525); + } plane[0].m.userptr = (unsigned long) bufhdr->pBuffer; plane[0].data_offset = bufhdr->nOffset; plane[0].length = bufhdr->nAllocLen; |