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

Commit 736ab077 authored by Prateek Shrivastava's avatar Prateek Shrivastava Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Check for frame size for calculating CF



If height and width are small resulting into less
MBs per frame then frame size might result into
zero after division from a factor of (32*8*3)/2.
So clipping max value of CF at (4 << 16).

CRs-Fixed: 2167880
Change-Id: I640a46d1ed627a6e15523e96781d07c514ac9734
Signed-off-by: default avatarPrateek Shrivastava <pshrivas@codeaurora.org>
parent 5a580c0a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -93,7 +93,10 @@ void update_recon_stats(struct msm_vidc_inst *inst,

	frame_size = (msm_vidc_get_mbs_per_frame(inst) / (32 * 8) * 3) / 2;

	if (frame_size)
		CF = recon_stats->complexity_number / frame_size;
	else
		CF = MSM_VIDC_MAX_UBWC_COMPLEXITY_FACTOR;

	mutex_lock(&inst->reconbufs.lock);
	list_for_each_entry(binfo, &inst->reconbufs.list, list) {