video: driver: add support for main10StillPic profile
Added support for V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10_STILL_PICTURE. It willbe used in 10bit image encoding usecases. Change-Id: I14877547f1f4792eefb0ea6bcecf2643627c125a Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
This commit is contained in:
@@ -920,12 +920,13 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
{ENTROPY_MODE},
|
||||
NULL, msm_vidc_set_u32_enum},
|
||||
|
||||
{PROFILE, ENC|DEC, HEVC|HEIC,
|
||||
{PROFILE, ENC|DEC, HEVC,
|
||||
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN,
|
||||
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10,
|
||||
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10_STILL_PICTURE,
|
||||
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN) |
|
||||
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE) |
|
||||
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10),
|
||||
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10) |
|
||||
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10_STILL_PICTURE),
|
||||
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN,
|
||||
V4L2_CID_MPEG_VIDEO_HEVC_PROFILE,
|
||||
HFI_PROP_PROFILE,
|
||||
@@ -1400,9 +1401,9 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
{PROFILE}},
|
||||
{PROFILE, ENC|DEC, HEIC,
|
||||
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE,
|
||||
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10,
|
||||
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10_STILL_PICTURE,
|
||||
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE) |
|
||||
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10),
|
||||
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10_STILL_PICTURE),
|
||||
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE,
|
||||
V4L2_CID_MPEG_VIDEO_HEVC_PROFILE,
|
||||
HFI_PROP_PROFILE,
|
||||
|
@@ -97,6 +97,7 @@ enum hfi_hevc_profile_type {
|
||||
HFI_H265_PROFILE_MAIN = 0,
|
||||
HFI_H265_PROFILE_MAIN_STILL_PICTURE = 1,
|
||||
HFI_H265_PROFILE_MAIN_10 = 2,
|
||||
HFI_H265_PROFILE_MAIN_10_STILL_PICTURE = 3,
|
||||
};
|
||||
|
||||
enum hfi_vp9_profile_type {
|
||||
|
@@ -29,6 +29,12 @@ static bool is_priv_ctrl(u32 id)
|
||||
* we have added custom values to the controls
|
||||
*/
|
||||
switch (id) {
|
||||
/*
|
||||
* TODO: V4L2_CID_MPEG_VIDEO_HEVC_PROFILE is std ctrl. But
|
||||
* V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10_STILL_PICTURE support is not
|
||||
* available yet. Hence, make this as private ctrl for time being
|
||||
*/
|
||||
case V4L2_CID_MPEG_VIDEO_HEVC_PROFILE:
|
||||
/*
|
||||
* TODO: V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE is
|
||||
* std ctrl. But needs some fixes in v4l2-ctrls.c. Hence,
|
||||
@@ -108,6 +114,14 @@ static const char *const mpeg_video_avc_coding_layer[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const char *const mpeg_video_hevc_profile[] = {
|
||||
"Main",
|
||||
"Main Still Picture",
|
||||
"Main 10",
|
||||
"Main 10 Still Picture",
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const char *const roi_map_type[] = {
|
||||
"None",
|
||||
"2-bit",
|
||||
@@ -148,6 +162,8 @@ static const char * const * msm_vidc_get_qmenu_type(
|
||||
return mpeg_video_blur_types;
|
||||
case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE:
|
||||
return mpeg_video_avc_coding_layer;
|
||||
case V4L2_CID_MPEG_VIDEO_HEVC_PROFILE:
|
||||
return mpeg_video_hevc_profile;
|
||||
default:
|
||||
i_vpr_e(inst, "%s: No available qmenu for ctrl %#x\n",
|
||||
__func__, control_id);
|
||||
@@ -872,8 +888,10 @@ int msm_vidc_adjust_profile(void *instance, struct v4l2_ctrl *ctrl)
|
||||
return -EINVAL;
|
||||
|
||||
/* 10 bit profile for 10 bit color format */
|
||||
if (pix_fmt == MSM_VIDC_FMT_TP10C ||
|
||||
pix_fmt == MSM_VIDC_FMT_P010) {
|
||||
if (pix_fmt == MSM_VIDC_FMT_TP10C || pix_fmt == MSM_VIDC_FMT_P010) {
|
||||
if (is_image_session(inst))
|
||||
adjusted_value = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10_STILL_PICTURE;
|
||||
else
|
||||
adjusted_value = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10;
|
||||
} else {
|
||||
/* 8 bit profile for 8 bit color format */
|
||||
|
@@ -4758,7 +4758,7 @@ static bool msm_vidc_allow_image_encode_session(struct msm_vidc_inst *inst)
|
||||
|
||||
/* is profile type Still Pic */
|
||||
if (is_10bit_colorformat(pix_fmt))
|
||||
allow = profile == V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10;
|
||||
allow = profile == V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10_STILL_PICTURE;
|
||||
else
|
||||
allow = profile == V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE;
|
||||
if (!allow) {
|
||||
|
@@ -46,6 +46,9 @@
|
||||
#define V4L2_YCBCR_VIDC_FCC47_73_682 302
|
||||
|
||||
/* end of vidc specific colorspace definitions */
|
||||
#ifndef V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10_STILL_PICTURE
|
||||
#define V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10_STILL_PICTURE (3)
|
||||
#endif
|
||||
|
||||
/* vendor controls start */
|
||||
#define V4L2_CID_MPEG_VIDC_BASE (V4L2_CTRL_CLASS_MPEG | 0x2000)
|
||||
|
Reference in New Issue
Block a user