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

Commit a540f6e6 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm-vidc: calculate encode output buffer size considering 10-bit"

parents 2d58b331 185d24cd
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -875,11 +875,15 @@ u32 msm_vidc_calculate_enc_output_frame_size(struct msm_vidc_inst *inst)
	if (inst->rc_type == RATE_CONTROL_LOSSLESS)
		frame_size = (width * height * 6);

	/* For 10-bit cases size = size * 1.25 */
	if (inst->bit_depth == MSM_VIDC_BIT_DEPTH_10) {
	/*
	 * In case of opaque color format bitdepth will be known
	 * with first ETB, buffers allocated already with 8 bit
	 * won't be sufficient for 10 bit
	 * calculate size considering 10-bit by default
	 * For 10-bit cases size = size * 1.25
	*/
		frame_size *= 5;
		frame_size /= 4;
	}

	return ALIGN(frame_size, SZ_4K);
}