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

Commit 4e0a2b29 authored by Priyanka Gujjula's avatar Priyanka Gujjula
Browse files

msm: vidc: Fix criteria for hierp num_ref calc



[1] num_ref for hierp has to be calculated only if
    max_layer value is > 1. Since max_layer value
    0/1 indicates absence of layer encoding.
[2] Fix hybrid_hp num_ref calculation inline with
    FW calc

Change-Id: I507d58c33529e5976974cc2d5a6e2d3fd8c55026
Signed-off-by: default avatarPriyanka Gujjula <pgujjula@codeaurora.org>
parent 362479c1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -492,10 +492,10 @@ int msm_vidc_get_num_ref_frames(struct msm_vidc_inst *inst)
		V4L2_CID_MPEG_VIDC_VIDEO_HEVC_MAX_HIER_CODING_LAYER);
	num_hp_layers = layer_ctrl->val;
	codec = get_v4l2_codec(inst);
	if (num_hp_layers > 0) {
	if (num_hp_layers > 1) {
		/* LTR and B - frame not supported with hybrid HP */
		if (inst->hybrid_hp)
			num_ref = num_hp_layers >> 1;
			num_ref = (num_hp_layers + 1) >> 1;
		else if (codec == V4L2_PIX_FMT_HEVC)
			num_ref = ((num_hp_layers + 1) / 2) + ltr_count;
		else if ((codec == V4L2_PIX_FMT_H264) && (num_hp_layers < 4))