mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-05 01:54:09 +08:00
media: coda: Add control for h.264 constrained intra prediction
Allow to enable constrained intra prediction in the h.264 encoder. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
d034696cbe
commit
31489f6bda
@ -1010,7 +1010,9 @@ static int coda_start_encoding(struct coda_ctx *ctx)
|
|||||||
CODA_264PARAM_DEBLKFILTEROFFSETALPHA_OFFSET) |
|
CODA_264PARAM_DEBLKFILTEROFFSETALPHA_OFFSET) |
|
||||||
((ctx->params.h264_slice_beta_offset_div2 &
|
((ctx->params.h264_slice_beta_offset_div2 &
|
||||||
CODA_264PARAM_DEBLKFILTEROFFSETBETA_MASK) <<
|
CODA_264PARAM_DEBLKFILTEROFFSETBETA_MASK) <<
|
||||||
CODA_264PARAM_DEBLKFILTEROFFSETBETA_OFFSET);
|
CODA_264PARAM_DEBLKFILTEROFFSETBETA_OFFSET) |
|
||||||
|
(ctx->params.h264_constrained_intra_pred_flag <<
|
||||||
|
CODA_264PARAM_CONSTRAINEDINTRAPREDFLAG_OFFSET);
|
||||||
coda_write(dev, value, CODA_CMD_ENC_SEQ_264_PARA);
|
coda_write(dev, value, CODA_CMD_ENC_SEQ_264_PARA);
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_JPEG:
|
case V4L2_PIX_FMT_JPEG:
|
||||||
|
@ -1839,6 +1839,9 @@ static int coda_s_ctrl(struct v4l2_ctrl *ctrl)
|
|||||||
case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE:
|
case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE:
|
||||||
ctx->params.h264_disable_deblocking_filter_idc = ctrl->val;
|
ctx->params.h264_disable_deblocking_filter_idc = ctrl->val;
|
||||||
break;
|
break;
|
||||||
|
case V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION:
|
||||||
|
ctx->params.h264_constrained_intra_pred_flag = ctrl->val;
|
||||||
|
break;
|
||||||
case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
|
case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
|
||||||
/* TODO: switch between baseline and constrained baseline */
|
/* TODO: switch between baseline and constrained baseline */
|
||||||
if (ctx->inst_type == CODA_INST_ENCODER)
|
if (ctx->inst_type == CODA_INST_ENCODER)
|
||||||
@ -1925,6 +1928,9 @@ static void coda_encode_ctrls(struct coda_ctx *ctx)
|
|||||||
V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE,
|
V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE,
|
||||||
V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY,
|
V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY,
|
||||||
0x0, V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED);
|
0x0, V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED);
|
||||||
|
v4l2_ctrl_new_std(&ctx->ctrls, &coda_ctrl_ops,
|
||||||
|
V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION, 0, 1, 1,
|
||||||
|
0);
|
||||||
v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops,
|
v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops,
|
||||||
V4L2_CID_MPEG_VIDEO_H264_PROFILE,
|
V4L2_CID_MPEG_VIDEO_H264_PROFILE,
|
||||||
V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE, 0x0,
|
V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE, 0x0,
|
||||||
|
@ -118,6 +118,7 @@ struct coda_params {
|
|||||||
u8 h264_disable_deblocking_filter_idc;
|
u8 h264_disable_deblocking_filter_idc;
|
||||||
s8 h264_slice_alpha_c0_offset_div2;
|
s8 h264_slice_alpha_c0_offset_div2;
|
||||||
s8 h264_slice_beta_offset_div2;
|
s8 h264_slice_beta_offset_div2;
|
||||||
|
bool h264_constrained_intra_pred_flag;
|
||||||
u8 h264_profile_idc;
|
u8 h264_profile_idc;
|
||||||
u8 h264_level_idc;
|
u8 h264_level_idc;
|
||||||
u8 mpeg4_intra_qp;
|
u8 mpeg4_intra_qp;
|
||||||
|
Loading…
Reference in New Issue
Block a user