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

Commit 3b17f3e8 authored by Amit Shekhar's avatar Amit Shekhar Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Fix b-frame QP setting for VP8



Fix setting b-frame QP control for VP8 encoder.

Change-Id: Icafb982b3eadd1b52f5b0ab0832e843a82313c74
Signed-off-by: default avatarAmit Shekhar <ashekhar@codeaurora.org>
parent 074b3280
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1748,7 +1748,8 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
			((ctrl->val >> 16) & 0xff) < b_qp->minimum ||
			(ctrl->val & 0xff) >= i_qp->maximum ||
			((ctrl->val >> 8) & 0xff) >= p_qp->maximum ||
			((ctrl->val >> 16) & 0xff) >= b_qp->maximum) {
			(inst->fmts[CAPTURE_PORT].fourcc != V4L2_PIX_FMT_VP8 &&
			((ctrl->val >> 16) & 0xff) >= b_qp->maximum)) {
			dprintk(VIDC_ERR, "Invalid QP %#x\n", ctrl->val);
			return -EINVAL;
		}
@@ -2415,6 +2416,11 @@ int msm_venc_set_frame_qp(struct msm_vidc_inst *inst)
			b_qp->val < b_qp->minimum)
			b_qp->val = i_qp->val;
	}

	/* B frame QP is not supported for VP8. */
	if (inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_VP8)
		qp.enable &= (!QP_ENABLE_B);

	qp.qp_packed = i_qp->val | p_qp->val << 8 | b_qp->val << 16;

	dprintk(VIDC_DBG, "%s: layers %#x frames %#x qp_packed %#x\n",