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

Commit e8004219 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
parent 9fa40378
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -493,11 +493,11 @@ int msm_vidc_get_num_ref_frames(struct msm_vidc_inst *inst)
	max_layer = get_ctrl(inst,
		V4L2_CID_MPEG_VIDC_VIDEO_HEVC_MAX_HIER_CODING_LAYER);
	if (frame_t->val == V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P &&
		max_layer->val > 0) {
		max_layer->val > 1) {
		codec = get_v4l2_codec(inst);
		/* LTR and B - frame not supported with hybrid HP */
		if (inst->hybrid_hp)
			num_ref = max_layer->val >> 1;
			num_ref = (max_layer->val + 1) >> 1;
		else if (codec == V4L2_PIX_FMT_HEVC)
			num_ref = ((max_layer->val + 1) / 2) + ltr_count;
		else if ((codec == V4L2_PIX_FMT_H264) && (max_layer->val < 4))