Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92114e05 authored by Srinu Gorle's avatar Srinu Gorle
Browse files

msm: vidc: Add support 601-709 color space conversion



This flag is set on the encoder input to indicate that the YUV values of
the associated frame should be converted from the rec.601 range [0-255]
to the rec.709 range Luma: [16-235] Chroma: [16-240], and then clamped
to the rec.709 range before encode.

Change-Id: Iaa47de91ef6c8a1643f6317a8d0036e2ebd03ca6
Signed-off-by: default avatarSrinu Gorle <sgorle@codeaurora.org>
parent c4127fbe
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -2448,7 +2448,13 @@ int msm_comm_qbuf(struct vb2_buffer *vb)
				dprintk(VIDC_DBG,
					"Received EOS on output capability\n");
			}

			if (vb->v4l2_buf.flags &
				V4L2_MSM_BUF_FLAG_YUV_601_709_CLAMP) {
				frame_data.flags |=
					HAL_BUFFERFLAG_YUV_601_709_CSC_CLAMP;
				dprintk(VIDC_DBG,
					"Received buff with 601to709 clamp\n");
			}
			if (vb->v4l2_buf.flags &
					V4L2_QCOM_BUF_FLAG_CODECCONFIG) {
				frame_data.flags |= HAL_BUFFERFLAG_CODECCONFIG;
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
#define HAL_BUFFERFLAG_READONLY         0x00000200
#define HAL_BUFFERFLAG_ENDOFSUBFRAME    0x00000400
#define HAL_BUFFERFLAG_EOSEQ            0x00200000
#define HAL_BUFFERFLAG_YUV_601_709_CSC_CLAMP   0x10000000
#define HAL_BUFFERFLAG_DROP_FRAME       0x20000000
#define HAL_BUFFERFLAG_TS_DISCONTINUITY	0x40000000
#define HAL_BUFFERFLAG_TS_ERROR		0x80000000
+1 −0
Original line number Diff line number Diff line
@@ -714,6 +714,7 @@ struct v4l2_buffer {
#define V4L2_QCOM_BUF_TS_ERROR			0x4000000
#define V4L2_QCOM_BUF_FLAG_READONLY		0x8000000
#define V4L2_MSM_VIDC_BUF_START_CODE_NOT_FOUND	0x10000000
#define V4L2_MSM_BUF_FLAG_YUV_601_709_CLAMP	0x20000000

/**
 * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor