This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit d892f427045f865feef35fe95176254244c9bab5
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Mon Oct 12 03:12:36 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Mon Oct 19 23:40:15 2026 +0000

    cosmetics: avcodec/vvc/ps: factor the tile scans of subpic_tiles() into a 
helper
---
 libavcodec/vvc/ps.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/libavcodec/vvc/ps.c b/libavcodec/vvc/ps.c
index d40c8050db..460877246e 100644
--- a/libavcodec/vvc/ps.c
+++ b/libavcodec/vvc/ps.c
@@ -438,28 +438,26 @@ static int pps_single_slice_picture(VVCPPS *pps, int *off)
     return 0;
 }
 
+static int tile_at_or_after(const uint16_t *bd, const int ctb_pos)
+{
+    int tile = 0;
+
+    while (bd[tile] < ctb_pos)
+        tile++;
+
+    return tile;
+}
+
 static void subpic_tiles(int *tile_x, int *tile_y, int *tile_x_end, int 
*tile_y_end,
     const VVCSPS *sps, const VVCPPS *pps,  const int i)
 {
     const int rx = sps->r->sps_subpic_ctu_top_left_x[i];
     const int ry = sps->r->sps_subpic_ctu_top_left_y[i];
 
-    *tile_x = *tile_y = 0;
-
-    while (pps->col_bd[*tile_x] < rx)
-        (*tile_x)++;
-
-    while (pps->row_bd[*tile_y] < ry)
-        (*tile_y)++;
-
-    *tile_x_end = (*tile_x);
-    *tile_y_end = (*tile_y);
-
-    while (pps->col_bd[*tile_x_end] < rx + sps->r->sps_subpic_width_minus1[i] 
+ 1)
-        (*tile_x_end)++;
-
-    while (pps->row_bd[*tile_y_end] < ry + sps->r->sps_subpic_height_minus1[i] 
+ 1)
-        (*tile_y_end)++;
+    *tile_x     = tile_at_or_after(pps->col_bd, rx);
+    *tile_y     = tile_at_or_after(pps->row_bd, ry);
+    *tile_x_end = tile_at_or_after(pps->col_bd, rx + 
sps->r->sps_subpic_width_minus1[i] + 1);
+    *tile_y_end = tile_at_or_after(pps->row_bd, ry + 
sps->r->sps_subpic_height_minus1[i] + 1);
 }
 
 static int pps_subpic_less_than_one_tile_slice(VVCPPS *pps, const VVCSPS *sps, 
const int i, const int tx, const int ty, int *off)

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to