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

Commit 4f22c849 authored by Vaibhav Deshu Venkatesh's avatar Vaibhav Deshu Venkatesh
Browse files

msm: vidc: Fix decoder input buffer size calculation



Decoder input buffer size is currently calculated in MBs
instead of actual size. Multiply MB size with num pixels in
MB.

CRs-Fixed: 2368458
Change-Id: Ia0a2add18780d026d3372526e19575c89c5169e1
Signed-off-by: default avatarVaibhav Deshu Venkatesh <vdeshuve@codeaurora.org>
parent f5f31790
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -252,6 +252,7 @@
#define SYSTEM_LAL_TILE10 192
#define NUM_MBS_720P (((1280 + 15) >> 4) * ((720 + 15) >> 4))
#define NUM_MBS_4k (((4096 + 15) >> 4) * ((2304 + 15) >> 4))
#define MB_SIZE_IN_PIXEL (16 * 16)

static inline u32 calculate_h264d_scratch_size(struct msm_vidc_inst *inst,
	u32 width, u32 height, bool is_interlaced);
@@ -765,7 +766,7 @@ u32 msm_vidc_calculate_dec_input_frame_size(struct msm_vidc_inst *inst)
			div_factor = 2;
	}

	frame_size = base_res_mbs * 3 / 2 / div_factor;
	frame_size = base_res_mbs * MB_SIZE_IN_PIXEL * 3 / 2 / div_factor;
	 /* multiply by 10/8 (1.25) to get size for 10 bit case */
	if ((inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_VP9) ||
		(inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_HEVC))