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

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

Merge "msm: vidc: Update bitstream buffer size for secure case"

parents 28bf999d ac11cf20
Loading
Loading
Loading
Loading
+3 −11
Original line number Diff line number Diff line
@@ -790,22 +790,14 @@ u32 msm_vidc_calculate_dec_input_frame_size(struct msm_vidc_inst *inst)

	frame_size = base_res_mbs * MB_SIZE_IN_PIXEL * 3 / 2 / div_factor;

	if (is_secure_session(inst)) {
		u32 max_bitrate = inst->capability.cap[CAP_SECURE_BITRATE].max;

		/*
		 * for secure, calc frame_size based on max bitrate,
		 * peak bitrate can be 10 times more and
		 * frame rate assumed to be 30 fps at least
		 */
		frame_size = (max_bitrate * 10 / 8) / 30;
	}

	 /* multiply by 10/8 (1.25) to get size for 10 bit case */
	if ((f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_VP9) ||
		(f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_HEVC))
		frame_size = frame_size + (frame_size >> 2);

	if (is_secure_session(inst))
		frame_size /= 2;

	if (inst->buffer_size_limit &&
		(inst->buffer_size_limit < frame_size)) {
		frame_size = inst->buffer_size_limit;