Re: [PATCH 1/4] media: qcom: iris: Add intra refresh support for gen1 encoder

From: Wangao Wang
Date: Tue Dec 02 2025 - 01:35:29 EST




On 2025/11/27 18:35, Bryan O'Donoghue wrote:
On 27/11/2025 07:44, Wangao Wang wrote:
+    hfi_val.mbs = fmt->width * fmt->height;
+    hfi_val.mbs /= 16 * 16;

256

But why ? Also why express it as 16 * 16 ?

+    if (hfi_val.mbs % ir_period)
+        hfi_val.mbs++;
+    hfi_val.mbs /= ir_period;

This code deserves some commentary.

---
bod

16 * 16 is the size of a macroblock.

Here, we first calculate the total number of macroblocks in one frame, then determine the number of macroblocks that need intra refresh in each frame based on the ir_period. All macroblocks must be refreshed within a single ir_period.

However, there is an issue: the macroblock sizes for AVC and HEVC are different. I will address this in a later patch and add comments accordingly.

--
Best Regards,
Wangao