video: driver: add decoder bitstream size overwrite support
add decoder bitsream size overwrite support Change-Id: Id2968c3ac7d485109a47ff7a570a1c18d74dfe43 Signed-off-by: Darshana Patil <darshana@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
0910978cb0
commit
45d8a8c80e
@@ -945,6 +945,9 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
{CODEC_CONFIG, DEC, H264|HEVC, 0, 1, 1, 0,
|
||||
V4L2_CID_MPEG_VIDC_CODEC_CONFIG},
|
||||
|
||||
{BITSTREAM_SIZE_OVERWRITE, DEC, CODECS_ALL, 0, INT_MAX, 1, 0,
|
||||
V4L2_CID_MPEG_VIDC_MIN_BITSTREAM_SIZE_OVERWRITE},
|
||||
|
||||
{META_LTR_MARK_USE, ENC, CODECS_ALL,
|
||||
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||
|
@@ -340,6 +340,7 @@ enum msm_vidc_inst_capability_type {
|
||||
CODED_FRAMES,
|
||||
BIT_DEPTH,
|
||||
CODEC_CONFIG,
|
||||
BITSTREAM_SIZE_OVERWRITE,
|
||||
META_LTR_MARK_USE,
|
||||
META_DPB_MISR,
|
||||
META_OPB_MISR,
|
||||
|
@@ -169,13 +169,22 @@ u32 msm_vidc_decoder_input_size(struct msm_vidc_inst *inst)
|
||||
u32 div_factor = 1;
|
||||
u32 base_res_mbs = NUM_MBS_4k;
|
||||
struct v4l2_format *f;
|
||||
u32 buffer_size_limit = 0; // TODO: fix me
|
||||
u32 bitstream_size_overwrite = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
d_vpr_e("%s: invalid params\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
bitstream_size_overwrite =
|
||||
inst->capabilities->cap[BITSTREAM_SIZE_OVERWRITE].value;
|
||||
if (bitstream_size_overwrite) {
|
||||
frame_size = bitstream_size_overwrite;
|
||||
s_vpr_h(inst->sid, "client configured bitstream buffer size %d\n",
|
||||
frame_size);
|
||||
return frame_size;
|
||||
}
|
||||
|
||||
/*
|
||||
* Decoder input size calculation:
|
||||
* For 8k resolution, buffer size is calculated as 8k mbs / 4 and
|
||||
@@ -214,14 +223,7 @@ u32 msm_vidc_decoder_input_size(struct msm_vidc_inst *inst)
|
||||
f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_HEVC)
|
||||
frame_size = frame_size + (frame_size >> 2);
|
||||
|
||||
if (buffer_size_limit && (buffer_size_limit < frame_size)) {
|
||||
frame_size = buffer_size_limit;
|
||||
s_vpr_h(inst->sid, "input buffer size limited to %d\n",
|
||||
frame_size);
|
||||
} else {
|
||||
s_vpr_h(inst->sid, "set input buffer size to %d\n",
|
||||
frame_size);
|
||||
}
|
||||
s_vpr_h(inst->sid, "set input buffer size to %d\n", frame_size);
|
||||
|
||||
return ALIGN(frame_size, SZ_4K);
|
||||
}
|
||||
|
@@ -169,6 +169,8 @@ static const char *msm_vidc_get_priv_ctrl_name(u32 sid, u32 control_id)
|
||||
return "Timestamp Metadata";
|
||||
case V4L2_CID_MPEG_VIDC_METADATA_ENC_QP_METADATA:
|
||||
return "Encoder QP Metadata";
|
||||
case V4L2_CID_MPEG_VIDC_MIN_BITSTREAM_SIZE_OVERWRITE:
|
||||
return "Bitstream Size Overwrite";
|
||||
default:
|
||||
s_vpr_e(sid, "%s: ctrl name not available for ctrl id %#x\n",
|
||||
__func__, control_id);
|
||||
|
Reference in New Issue
Block a user