Commit 6e26070bdb for aom
commit 6e26070bdb7b4f1d6aed743366f895542ac797f7
Author: Ihor Buhaiov <freedbrt@gmail.com>
Date: Wed Oct 28 12:22:49 2026 +0100
rtc: Use chroma block size for nonrd IntraBC
av1_search_intrabc_nonrd() passes the luma bsize to
av1_model_rd_for_sb_uv(). The inter mode path passes the chroma
block size from get_plane_block_size(). With 4:2:0 the luma size is
twice as wide and twice as high as the chroma block, so the model
would also measure pixels right of and below the block.
This has no effect today. color_sensitivity is always 0 on intra
frames, so av1_model_rd_for_sb_uv() skips both chroma planes. The
fix keeps the IntraBC chroma cost correct if that ever changes.
Output is bit exact. RT speed 11, screen content, IntraBC on, 20 key
frames per clip, VBR and fixed q 9 and 14, 1 and 4 threads, RT only
and default builds:
4:2:0 on 8 screen recordings, 4:4:4 on 4 of them.
Change-Id: Id105a072eeb5051ec4468b755f2fa8e0ef1567f1
diff --git a/av1/encoder/nonrd_pickmode.c b/av1/encoder/nonrd_pickmode.c
index edc99d0807..b0c67fc470 100644
--- a/av1/encoder/nonrd_pickmode.c
+++ b/av1/encoder/nonrd_pickmode.c
@@ -1754,7 +1754,11 @@ static void av1_search_intrabc_nonrd(AV1_COMP *cpi, MACROBLOCK *x,
if (num_planes > 1) {
RD_STATS rdc_uv;
av1_invalid_rd_stats(&rdc_uv);
- av1_model_rd_for_sb_uv(cpi, bsize, x, xd, &rdc_uv, 1, 2);
+ const BLOCK_SIZE uv_bsize =
+ get_plane_block_size(bsize, xd->plane[AOM_PLANE_U].subsampling_x,
+ xd->plane[AOM_PLANE_U].subsampling_y);
+ av1_model_rd_for_sb_uv(cpi, uv_bsize, x, xd, &rdc_uv, AOM_PLANE_U,
+ AOM_PLANE_V);
this_rdc->rate += rdc_uv.rate;
this_rdc->dist += rdc_uv.dist;
}