Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 02/18] avcodec/vvcdec: refact, unify vvc_deblock_bs_luma_{horizontal, vertical}
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
@ 2024-06-22  6:23 ` Nuo Mi
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 03/18] avcodec/vvcdec: refact, unify vvc_deblock_bs_chroma_{horizontal, vertical} Nuo Mi
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:23 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/filter.c | 108 ++++++++++++++--------------------------
 1 file changed, 36 insertions(+), 72 deletions(-)

diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index d4c09b69f3..996e58dc3e 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -538,100 +538,64 @@ static int deblock_is_boundary(const VVCLocalContext *lc, const int boundary,
     return boundary;
 }
 
-static void vvc_deblock_bs_luma_vertical(const VVCLocalContext *lc,
-    const int x0, const int y0, const int width, const int height, const int rs)
+static void vvc_deblock_bs_luma(const VVCLocalContext *lc,
+    const int x0, const int y0, const int width, const int height, const int rs, const int vertical)
 {
     const VVCFrameContext *fc  = lc->fc;
     const MvField *tab_mvf     = fc->tab.mvf;
+    const int mask             = LUMA_GRID - 1;
     const int log2_min_pu_size = MIN_PU_LOG2;
     const int min_pu_width     = fc->ps.pps->min_pu_width;
     const int min_cb_log2      = fc->ps.sps->min_cb_log2_size_y;
     const int min_cb_width     = fc->ps.pps->min_cb_width;
-    const int is_intra         = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width +
-        (x0 >> log2_min_pu_size)].pred_flag == PF_INTRA;
-    int boundary_left;
-    int has_vertical_sb = 0;
-
+    const int pos              = vertical ? x0 : y0;
     const int off_q            = (y0 >> min_cb_log2) * min_cb_width + (x0 >> min_cb_log2);
-    const int cb_x             = fc->tab.cb_pos_x[LUMA][off_q];
-    const int cb_width         = fc->tab.cb_width[LUMA][off_q];
-    const int off_x            = cb_x - x0;
-
-    if (!is_intra) {
-        if (fc->tab.msf[off_q] || fc->tab.iaf[off_q])
-            has_vertical_sb = cb_width  > 8;
-    }
-
-    // bs for vertical TU boundaries
-    boundary_left = deblock_is_boundary(lc, x0 > 0 && !(x0 & 3), x0, rs, 1);
-
-    if (boundary_left) {
-        const RefPicList *rpl_left =
-            (lc->boundary_flags & BOUNDARY_LEFT_SLICE) ? ff_vvc_get_ref_list(fc, fc->ref, x0 - 1, y0) : lc->sc->rpl;
-        for (int i = 0; i < height; i += 4) {
+    const int cb               = (vertical ? fc->tab.cb_pos_x : fc->tab.cb_pos_y )[LUMA][off_q];
+    const int is_intra         = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width +
+            (x0 >> log2_min_pu_size)].pred_flag == PF_INTRA;
+
+    if (deblock_is_boundary(lc, pos > 0 && !(pos & mask), pos, rs, vertical)) {
+        const int size          = vertical ? height : width;
+        const int off           = cb - pos;
+        const int cb_size       = (vertical ? fc->tab.cb_width : fc->tab.cb_height)[LUMA][off_q];
+        const int has_sb        = !is_intra && (fc->tab.msf[off_q] || fc->tab.iaf[off_q]) && cb_size > 8;
+        const int flag          = vertical ? BOUNDARY_LEFT_SLICE : BOUNDARY_UPPER_SLICE;
+        const RefPicList *rpl_p =
+            (lc->boundary_flags & flag) ? ff_vvc_get_ref_list(fc, fc->ref, x0 - vertical, y0 - !vertical) : lc->sc->rpl;
+        uint8_t *tab_bs         = vertical ? fc->tab.vertical_bs[LUMA] : fc->tab.horizontal_bs[LUMA];
+        uint8_t *tab_max_len_p  = vertical ? fc->tab.vertical_p : fc->tab.horizontal_p;
+        uint8_t *tab_max_len_q  = vertical ? fc->tab.vertical_q : fc->tab.horizontal_q;
+
+        for (int i = 0; i < size; i += 4) {
+            const int x = x0 + i * !vertical;
+            const int y = y0 + i * vertical;
             uint8_t max_len_p, max_len_q;
-            const int bs = deblock_bs(lc, x0 - 1, y0 + i, x0, y0 + i, rpl_left, 0, off_x, has_vertical_sb);
+            const int bs = deblock_bs(lc, x - vertical, y - !vertical, x, y, rpl_p, LUMA, off, has_sb);
 
-            TAB_BS(fc->tab.vertical_bs[LUMA], x0, (y0 + i)) = bs;
+            TAB_BS(tab_bs, x, y) = bs;
 
-            derive_max_filter_length_luma(fc, x0, y0 + i, is_intra, has_vertical_sb, 1, &max_len_p, &max_len_q);
-            TAB_MAX_LEN(fc->tab.vertical_p, x0, y0 + i) = max_len_p;
-            TAB_MAX_LEN(fc->tab.vertical_q, x0, y0 + i) = max_len_q;
+            derive_max_filter_length_luma(fc, x, y, is_intra, has_sb, vertical, &max_len_p, &max_len_q);
+            TAB_MAX_LEN(tab_max_len_p, x, y) = max_len_p;
+            TAB_MAX_LEN(tab_max_len_q, x, y) = max_len_q;
         }
     }
 
     if (!is_intra) {
         if (fc->tab.msf[off_q] || fc->tab.iaf[off_q])
-            vvc_deblock_subblock_bs(lc, cb_x, x0, y0, width, height, 1);
+            vvc_deblock_subblock_bs(lc, cb, x0, y0, width, height, vertical);
     }
 }
 
-static void vvc_deblock_bs_luma_horizontal(const VVCLocalContext *lc,
+static void vvc_deblock_bs_luma_vertical(const VVCLocalContext *lc,
     const int x0, const int y0, const int width, const int height, const int rs)
 {
-    const VVCFrameContext *fc  = lc->fc;
-    const MvField *tab_mvf     = fc->tab.mvf;
-    const int log2_min_pu_size = MIN_PU_LOG2;
-    const int min_pu_width     = fc->ps.pps->min_pu_width;
-    const int min_cb_log2      = fc->ps.sps->min_cb_log2_size_y;
-    const int min_cb_width     = fc->ps.pps->min_cb_width;
-    const int is_intra = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width +
-                           (x0 >> log2_min_pu_size)].pred_flag == PF_INTRA;
-    int boundary_upper;
-    int has_horizontal_sb = 0;
-
-    const int off_q            = (y0 >> min_cb_log2) * min_cb_width + (x0 >> min_cb_log2);
-    const int cb_y             = fc->tab.cb_pos_y[LUMA][off_q];
-    const int cb_height        = fc->tab.cb_height[LUMA][off_q];
-    const int off_y            = y0 - cb_y;
-
-    if (!is_intra) {
-        if (fc->tab.msf[off_q] || fc->tab.iaf[off_q])
-            has_horizontal_sb = cb_height > 8;
-    }
-
-    boundary_upper = deblock_is_boundary(lc, y0 > 0 && !(y0 & 3), y0, rs, 0);
-
-    if (boundary_upper) {
-        const RefPicList *rpl_top =
-            (lc->boundary_flags & BOUNDARY_UPPER_SLICE) ? ff_vvc_get_ref_list(fc, fc->ref, x0, y0 - 1) : lc->sc->rpl;
-
-        for (int i = 0; i < width; i += 4) {
-            uint8_t max_len_p, max_len_q;
-            const int bs = deblock_bs(lc, x0 + i, y0 - 1, x0 + i, y0, rpl_top, 0, off_y, has_horizontal_sb);
-
-            TAB_BS(fc->tab.horizontal_bs[LUMA], x0 + i, y0) = bs;
-
-            derive_max_filter_length_luma(fc, x0 + i, y0, is_intra, has_horizontal_sb, 0, &max_len_p, &max_len_q);
-            TAB_MAX_LEN(fc->tab.horizontal_p, x0 + i, y0) = max_len_p;
-            TAB_MAX_LEN(fc->tab.horizontal_q, x0 + i, y0) = max_len_q;
-        }
-    }
+    vvc_deblock_bs_luma(lc, x0, y0, width, height, rs, 1);
+}
 
-    if (!is_intra) {
-        if (fc->tab.msf[off_q] || fc->tab.iaf[off_q])
-            vvc_deblock_subblock_bs(lc, cb_y, x0, y0, width, height, 0);
-    }
+static void vvc_deblock_bs_luma_horizontal(const VVCLocalContext *lc,
+    const int x0, const int y0, const int width, const int height, const int rs)
+{
+    vvc_deblock_bs_luma(lc, x0, y0, width, height, rs, 0);
 }
 
 static void vvc_deblock_bs_chroma_vertical(const VVCLocalContext *lc,
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 03/18] avcodec/vvcdec: refact, unify vvc_deblock_bs_chroma_{horizontal, vertical}
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 02/18] avcodec/vvcdec: refact, unify vvc_deblock_bs_luma_{horizontal, vertical} Nuo Mi
@ 2024-06-22  6:23 ` Nuo Mi
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 04/18] avcodec/vvcdec: refact, unify {horizontal, vertical}_bs, {horizontal, vertical}_p, {horizontal, vertical}_q Nuo Mi
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:23 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/filter.c | 62 +++++++++++++----------------------------
 1 file changed, 19 insertions(+), 43 deletions(-)

diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index 996e58dc3e..06e1717b13 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -586,56 +586,33 @@ static void vvc_deblock_bs_luma(const VVCLocalContext *lc,
     }
 }
 
-static void vvc_deblock_bs_luma_vertical(const VVCLocalContext *lc,
-    const int x0, const int y0, const int width, const int height, const int rs)
-{
-    vvc_deblock_bs_luma(lc, x0, y0, width, height, rs, 1);
-}
-
-static void vvc_deblock_bs_luma_horizontal(const VVCLocalContext *lc,
-    const int x0, const int y0, const int width, const int height, const int rs)
-{
-    vvc_deblock_bs_luma(lc, x0, y0, width, height, rs, 0);
-}
-
-static void vvc_deblock_bs_chroma_vertical(const VVCLocalContext *lc,
-    const int x0, const int y0, const int width, const int height, const int rs)
+static void vvc_deblock_bs_chroma(const VVCLocalContext *lc,
+    const int x0, const int y0, const int width, const int height, const int rs, const int vertical)
 {
     const VVCFrameContext *fc = lc->fc;
-    const int boundary_left = deblock_is_boundary(lc,
-         x0 > 0 && !(x0 & ((CHROMA_GRID << fc->ps.sps->hshift[CHROMA]) - 1)), x0, rs, 1);
-
-    if (boundary_left) {
-        for (int i = 0; i < height; i += 2) {
-            for (int c_idx = CB; c_idx <= CR; c_idx++) {
-                const int bs = deblock_bs(lc, x0 - 1, y0 + i, x0, y0 + i, NULL, c_idx, 0, 0);
+    const int shift           = (vertical ? fc->ps.sps->hshift : fc->ps.sps->vshift)[CHROMA];
+    const int mask            = (CHROMA_GRID << shift) - 1;
+    const int pos             = vertical ? x0 : y0;
 
-                TAB_BS(fc->tab.vertical_bs[c_idx], x0, (y0 + i)) = bs;
-            }
-        }
-    }
-}
+    if (deblock_is_boundary(lc, pos > 0 && !(pos & mask), pos, rs, vertical)) {
+        const int size = vertical ? height : width;
 
-static void vvc_deblock_bs_chroma_horizontal(const VVCLocalContext *lc,
-    const int x0, const int y0, const int width, const int height, const int rs)
-{
-    const VVCFrameContext *fc = lc->fc;
-    const int boundary_upper  = deblock_is_boundary(lc,
-        y0 > 0 && !(y0 & ((CHROMA_GRID << fc->ps.sps->vshift[CHROMA]) - 1)), y0, rs, 0);
+        for (int c_idx = CB; c_idx <= CR; c_idx++) {
+            uint8_t *tab_bs = (vertical ? fc->tab.vertical_bs : fc->tab.horizontal_bs)[c_idx];
 
-    if (boundary_upper) {
-        for (int i = 0; i < width; i += 2) {
-            for (int c_idx = CB; c_idx <= CR; c_idx++) {
-                const int bs = deblock_bs(lc, x0 + i, y0 - 1, x0 + i, y0, NULL, c_idx, 0, 0);
+            for (int i = 0; i < size; i += 2) {
+                const int x  = x0 + i * !vertical;
+                const int y  = y0 + i * vertical;
+                const int bs = deblock_bs(lc, x - vertical, y - !vertical, x, y, NULL, c_idx, 0, 0);
 
-                TAB_BS(fc->tab.horizontal_bs[c_idx], x0 + i, y0) = bs;
+                TAB_BS(tab_bs, x, y) = bs;
             }
         }
     }
 }
 
 typedef void (*deblock_bs_fn)(const VVCLocalContext *lc, const int x0, const int y0,
-    const int width, const int height, const int rs);
+    const int width, const int height, const int rs, const int vertical);
 
 static void vvc_deblock_bs(const VVCLocalContext *lc, const int x0, const int y0, const int rs, const int vertical)
 {
@@ -645,9 +622,8 @@ static void vvc_deblock_bs(const VVCLocalContext *lc, const int x0, const int y0
     const int ctb_size = sps->ctb_size_y;
     const int x_end    = FFMIN(x0 + ctb_size, pps->width) >> MIN_TU_LOG2;
     const int y_end    = FFMIN(y0 + ctb_size, pps->height) >> MIN_TU_LOG2;
-    deblock_bs_fn deblock_bs[2][2] = {
-        { vvc_deblock_bs_luma_horizontal, vvc_deblock_bs_chroma_horizontal },
-        { vvc_deblock_bs_luma_vertical,   vvc_deblock_bs_chroma_vertical   }
+    deblock_bs_fn deblock_bs[] = {
+        vvc_deblock_bs_luma, vvc_deblock_bs_chroma
     };
 
     for (int is_chroma = 0; is_chroma <= 1; is_chroma++) {
@@ -657,8 +633,8 @@ static void vvc_deblock_bs(const VVCLocalContext *lc, const int x0, const int y0
             for (int x = x0 >> MIN_TU_LOG2; x < x_end; x++) {
                 const int off = y * fc->ps.pps->min_tu_width + x;
                 if ((fc->tab.tb_pos_x0[is_chroma][off] >> MIN_TU_LOG2) == x && (fc->tab.tb_pos_y0[is_chroma][off] >> MIN_TU_LOG2) == y) {
-                    deblock_bs[vertical][is_chroma](lc, x << MIN_TU_LOG2, y << MIN_TU_LOG2,
-                        fc->tab.tb_width[is_chroma][off] << hs, fc->tab.tb_height[is_chroma][off] << vs, rs);
+                    deblock_bs[is_chroma](lc, x << MIN_TU_LOG2, y << MIN_TU_LOG2,
+                        fc->tab.tb_width[is_chroma][off] << hs, fc->tab.tb_height[is_chroma][off] << vs, rs, vertical);
                 }
             }
         }
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 04/18] avcodec/vvcdec: refact, unify {horizontal, vertical}_bs, {horizontal, vertical}_p, {horizontal, vertical}_q
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 02/18] avcodec/vvcdec: refact, unify vvc_deblock_bs_luma_{horizontal, vertical} Nuo Mi
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 03/18] avcodec/vvcdec: refact, unify vvc_deblock_bs_chroma_{horizontal, vertical} Nuo Mi
@ 2024-06-22  6:23 ` Nuo Mi
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 05/18] avcodec/vvcdec: misc, use POS to simplify filter code Nuo Mi
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:23 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/dec.c    | 14 +++++++-------
 libavcodec/vvc/dec.h    |  9 +++------
 libavcodec/vvc/filter.c | 32 +++++++++++---------------------
 3 files changed, 21 insertions(+), 34 deletions(-)

diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c
index f5603306f3..356ed58e37 100644
--- a/libavcodec/vvc/dec.c
+++ b/libavcodec/vvc/dec.c
@@ -191,14 +191,14 @@ static void bs_tl_init(TabList *l, VVCFrameContext *fc)
 
     tl_init(l, 1, changed);
 
-    for (int i = 0; i < VVC_MAX_SAMPLE_ARRAYS; i++) {
-        TL_ADD(horizontal_bs[i], bs_count);
-        TL_ADD(vertical_bs[i],   bs_count);
+    for (int i = 0; i < 2; i++) {
+        for (int j = 0; j < VVC_MAX_SAMPLE_ARRAYS; j++) {
+            TL_ADD(bs[i][j], bs_count);
+            TL_ADD(bs[i][j],   bs_count);
+        }
+        TL_ADD(max_len_p[i], bs_count);
+        TL_ADD(max_len_q[i], bs_count);
     }
-    TL_ADD(horizontal_q, bs_count);
-    TL_ADD(horizontal_p, bs_count);
-    TL_ADD(vertical_p,   bs_count);
-    TL_ADD(vertical_q,   bs_count);
 }
 
 static void pixel_buffer_nz_tl_init(TabList *l, VVCFrameContext *fc)
diff --git a/libavcodec/vvc/dec.h b/libavcodec/vvc/dec.h
index 1e0b76f283..a8492f1398 100644
--- a/libavcodec/vvc/dec.h
+++ b/libavcodec/vvc/dec.h
@@ -178,12 +178,9 @@ typedef struct VVCFrameContext {
         uint8_t *tb_height[2];
         uint8_t *pcmf[2];
 
-        uint8_t *horizontal_bs[VVC_MAX_SAMPLE_ARRAYS];
-        uint8_t *vertical_bs[VVC_MAX_SAMPLE_ARRAYS];
-        uint8_t *horizontal_p;                          ///< horizontal maxFilterLengthPs for luma
-        uint8_t *horizontal_q;                          ///< horizontal maxFilterLengthQs for luma
-        uint8_t *vertical_p;                            ///< vertical   maxFilterLengthPs for luma
-        uint8_t *vertical_q;                            ///< vertical   maxFilterLengthQs for luma
+        uint8_t *bs[2][VVC_MAX_SAMPLE_ARRAYS];          ///< horizontal, vertical boundary filtering strength
+        uint8_t *max_len_p[2];                          ///< horizontal, vertical maxFilterLengthPs for luma
+        uint8_t *max_len_q[2];                          ///< horizontal, vertical maxFilterLengthQs for luma
 
         uint8_t *sao_pixel_buffer_h[VVC_MAX_SAMPLE_ARRAYS];
         uint8_t *sao_pixel_buffer_v[VVC_MAX_SAMPLE_ARRAYS];
diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index 06e1717b13..7ae36b2344 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -414,9 +414,6 @@ static void vvc_deblock_subblock_bs(const VVCLocalContext *lc,
     const RefPicList *rpl      = lc->sc->rpl;
     int stridea                = fc->ps.pps->min_pu_width;
     int strideb                = 1;
-    uint8_t *tab_bs            = vertical ? fc->tab.vertical_bs[LUMA] : fc->tab.horizontal_bs[LUMA];
-    uint8_t *tab_max_len_p     = vertical ? fc->tab.vertical_p : fc->tab.horizontal_p;
-    uint8_t *tab_max_len_q     = vertical ? fc->tab.vertical_q : fc->tab.horizontal_q;
     const int log2_min_pu_size = MIN_PU_LOG2;
 
     if (!vertical) {
@@ -442,7 +439,7 @@ static void vvc_deblock_subblock_bs(const VVCLocalContext *lc,
             if (!vertical)
                 FFSWAP(int, x, y);
 
-            TAB_BS(tab_bs, x, y) = bs;
+            TAB_BS(fc->tab.bs[vertical][LUMA], x, y) = bs;
 
             if (i == 4 || i == width - 4)
                 max_len_p = max_len_q = 1;
@@ -451,8 +448,8 @@ static void vvc_deblock_subblock_bs(const VVCLocalContext *lc,
             else
                 max_len_p = max_len_q = 3;
 
-            TAB_MAX_LEN(tab_max_len_p, x, y) = max_len_p;
-            TAB_MAX_LEN(tab_max_len_q, x, y) = max_len_q;
+            TAB_MAX_LEN(fc->tab.max_len_p[vertical], x, y) = max_len_p;
+            TAB_MAX_LEN(fc->tab.max_len_q[vertical], x, y) = max_len_q;
         }
     }
 }
@@ -562,9 +559,6 @@ static void vvc_deblock_bs_luma(const VVCLocalContext *lc,
         const int flag          = vertical ? BOUNDARY_LEFT_SLICE : BOUNDARY_UPPER_SLICE;
         const RefPicList *rpl_p =
             (lc->boundary_flags & flag) ? ff_vvc_get_ref_list(fc, fc->ref, x0 - vertical, y0 - !vertical) : lc->sc->rpl;
-        uint8_t *tab_bs         = vertical ? fc->tab.vertical_bs[LUMA] : fc->tab.horizontal_bs[LUMA];
-        uint8_t *tab_max_len_p  = vertical ? fc->tab.vertical_p : fc->tab.horizontal_p;
-        uint8_t *tab_max_len_q  = vertical ? fc->tab.vertical_q : fc->tab.horizontal_q;
 
         for (int i = 0; i < size; i += 4) {
             const int x = x0 + i * !vertical;
@@ -572,11 +566,11 @@ static void vvc_deblock_bs_luma(const VVCLocalContext *lc,
             uint8_t max_len_p, max_len_q;
             const int bs = deblock_bs(lc, x - vertical, y - !vertical, x, y, rpl_p, LUMA, off, has_sb);
 
-            TAB_BS(tab_bs, x, y) = bs;
+            TAB_BS(fc->tab.bs[vertical][LUMA], x, y) = bs;
 
             derive_max_filter_length_luma(fc, x, y, is_intra, has_sb, vertical, &max_len_p, &max_len_q);
-            TAB_MAX_LEN(tab_max_len_p, x, y) = max_len_p;
-            TAB_MAX_LEN(tab_max_len_q, x, y) = max_len_q;
+            TAB_MAX_LEN(fc->tab.max_len_p[vertical], x, y) = max_len_p;
+            TAB_MAX_LEN(fc->tab.max_len_q[vertical], x, y) = max_len_q;
         }
     }
 
@@ -598,14 +592,12 @@ static void vvc_deblock_bs_chroma(const VVCLocalContext *lc,
         const int size = vertical ? height : width;
 
         for (int c_idx = CB; c_idx <= CR; c_idx++) {
-            uint8_t *tab_bs = (vertical ? fc->tab.vertical_bs : fc->tab.horizontal_bs)[c_idx];
-
             for (int i = 0; i < size; i += 2) {
                 const int x  = x0 + i * !vertical;
                 const int y  = y0 + i * vertical;
                 const int bs = deblock_bs(lc, x - vertical, y - !vertical, x, y, NULL, c_idx, 0, 0);
 
-                TAB_BS(tab_bs, x, y) = bs;
+                TAB_BS(fc->tab.bs[vertical][c_idx], x, y) = bs;
             }
         }
     }
@@ -645,10 +637,8 @@ static void vvc_deblock_bs(const VVCLocalContext *lc, const int x0, const int y0
 static void max_filter_length_luma(const VVCFrameContext *fc, const int qx, const int qy,
                                    const int vertical, uint8_t *max_len_p, uint8_t *max_len_q)
 {
-    const uint8_t *tab_len_p = vertical ? fc->tab.vertical_p : fc->tab.horizontal_p;
-    const uint8_t *tab_len_q = vertical ? fc->tab.vertical_q : fc->tab.horizontal_q;
-    *max_len_p = TAB_MAX_LEN(tab_len_p, qx, qy);
-    *max_len_q = TAB_MAX_LEN(tab_len_q, qx, qy);
+    *max_len_p = TAB_MAX_LEN(fc->tab.max_len_p[vertical], qx, qy);
+    *max_len_q = TAB_MAX_LEN(fc->tab.max_len_q[vertical], qx, qy);
 }
 
 //part of 8.8.3.3 Derivation process of transform block boundary
@@ -758,7 +748,7 @@ void ff_vvc_deblock_vertical(const VVCLocalContext *lc, const int x0, const int
 
                 for (int i = 0; i < DEBLOCK_STEP >> (2 - vs); i++) {
                     const int dy = i << 2;
-                    bs[i] = (y + dy < y_end) ? TAB_BS(fc->tab.vertical_bs[c_idx], x, y + dy) : 0;
+                    bs[i] = (y + dy < y_end) ? TAB_BS(fc->tab.bs[1][c_idx], x, y + dy) : 0;
                     if (bs[i]) {
                         src = &fc->frame->data[c_idx][((y + dy) >> vs) * fc->frame->linesize[c_idx] + ((x >> hs) << fc->ps.sps->pixel_shift)];
                         qp = get_qp(fc, src, x, y + dy, c_idx, 1);
@@ -831,7 +821,7 @@ void ff_vvc_deblock_horizontal(const VVCLocalContext *lc, const int x0, const in
                 for (int i = 0; i < DEBLOCK_STEP >> (2 - hs); i++) {
                     const int dx = i << 2;
 
-                    bs[i] = (x + dx < x_end) ? TAB_BS(fc->tab.horizontal_bs[c_idx], x + dx, y) : 0;
+                    bs[i] = (x + dx < x_end) ? TAB_BS(fc->tab.bs[0][c_idx], x + dx, y) : 0;
                     if (bs[i]) {
                         src = &fc->frame->data[c_idx][(y >> vs) * fc->frame->linesize[c_idx] + (((x + dx)>> hs) << fc->ps.sps->pixel_shift)];
                         qp = get_qp(fc, src, x + dx, y, c_idx, 0);
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 05/18] avcodec/vvcdec: misc, use POS to simplify filter code
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (2 preceding siblings ...)
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 04/18] avcodec/vvcdec: refact, unify {horizontal, vertical}_bs, {horizontal, vertical}_p, {horizontal, vertical}_q Nuo Mi
@ 2024-06-22  6:23 ` Nuo Mi
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 06/18] avcodec/vvcdec: refact, unify ff_vvc_deblock_{horizontal, vertical} Nuo Mi
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:23 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/filter.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index 7ae36b2344..82a58a7ea8 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -34,6 +34,10 @@
 
 #define DEFAULT_INTRA_TC_OFFSET 2
 
+#define POS(c_idx, x, y)                                                                        \
+    &fc->frame->data[c_idx][((y) >> fc->ps.sps->vshift[c_idx]) * fc->frame->linesize[c_idx] +   \
+        (((x) >> fc->ps.sps->hshift[c_idx]) << fc->ps.sps->pixel_shift)]
+
 //Table 43 Derivation of threshold variables beta' and tc' from input Q
 static const uint16_t tctable[66] = {
       0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
@@ -135,7 +139,7 @@ static void sao_copy_ctb_to_hv(VVCLocalContext *lc, const int rx, const int ry,
         const int ctb_size_v       = ctb_size_y >> fc->ps.sps->vshift[c_idx];
         const int width            = FFMIN(ctb_size_h, (fc->ps.pps->width  >> fc->ps.sps->hshift[c_idx]) - x);
         const int height           = FFMIN(ctb_size_v, (fc->ps.pps->height >> fc->ps.sps->vshift[c_idx]) - y);
-        const uint8_t *src          = &fc->frame->data[c_idx][y * src_stride + (x << fc->ps.sps->pixel_shift)];
+        const uint8_t *src         = POS(c_idx, x0, y0);
         copy_ctb_to_hv(fc, src, src_stride, x, y, width, height, c_idx, rx, ry, top);
     }
 }
@@ -225,7 +229,7 @@ void ff_vvc_sao_filter(VVCLocalContext *lc, int x, int y)
         int width    = FFMIN(ctb_size_h, (fc->ps.pps->width  >> fc->ps.sps->hshift[c_idx]) - x0);
         int height   = FFMIN(ctb_size_v, (fc->ps.pps->height >> fc->ps.sps->vshift[c_idx]) - y0);
         int tab      = sao_tab[(FFALIGN(width, 8) >> 3) - 1];
-        uint8_t *src = &fc->frame->data[c_idx][y0 * src_stride + (x0 << fc->ps.sps->pixel_shift)];
+        uint8_t *src = POS(c_idx, x, y);
         ptrdiff_t dst_stride;
         uint8_t *dst;
 
@@ -750,7 +754,7 @@ void ff_vvc_deblock_vertical(const VVCLocalContext *lc, const int x0, const int
                     const int dy = i << 2;
                     bs[i] = (y + dy < y_end) ? TAB_BS(fc->tab.bs[1][c_idx], x, y + dy) : 0;
                     if (bs[i]) {
-                        src = &fc->frame->data[c_idx][((y + dy) >> vs) * fc->frame->linesize[c_idx] + ((x >> hs) << fc->ps.sps->pixel_shift)];
+                        src = POS(c_idx, x, y + dy);
                         qp = get_qp(fc, src, x, y + dy, c_idx, 1);
 
                         beta[i] = betatable[av_clip(qp + beta_offset, 0, MAX_QP)];
@@ -762,7 +766,7 @@ void ff_vvc_deblock_vertical(const VVCLocalContext *lc, const int x0, const int
                 }
 
                 if (!all_zero_bs) {
-                    src = &fc->frame->data[c_idx][(y >> vs) * fc->frame->linesize[c_idx] + ((x >> hs) << fc->ps.sps->pixel_shift)];
+                    src = POS(c_idx, x, y);
                     if (!c_idx) {
                         fc->vvcdsp.lf.filter_luma[1](src, fc->frame->linesize[c_idx],
                             beta, tc, no_p, no_q, max_len_p, max_len_q, 0);
@@ -823,7 +827,7 @@ void ff_vvc_deblock_horizontal(const VVCLocalContext *lc, const int x0, const in
 
                     bs[i] = (x + dx < x_end) ? TAB_BS(fc->tab.bs[0][c_idx], x + dx, y) : 0;
                     if (bs[i]) {
-                        src = &fc->frame->data[c_idx][(y >> vs) * fc->frame->linesize[c_idx] + (((x + dx)>> hs) << fc->ps.sps->pixel_shift)];
+                        src = POS(c_idx, x + dx, y);
                         qp = get_qp(fc, src, x + dx, y, c_idx, 0);
 
                         beta[i] = betatable[av_clip(qp + beta_offset, 0, MAX_QP)];
@@ -834,7 +838,7 @@ void ff_vvc_deblock_horizontal(const VVCLocalContext *lc, const int x0, const in
                     tc[i] = bs[i] ? TC_CALC(qp, bs[i]) : 0;
                 }
                 if (!all_zero_bs) {
-                    src = &fc->frame->data[c_idx][(y >> vs) * fc->frame->linesize[c_idx] + ((x >> hs) << fc->ps.sps->pixel_shift)];
+                    src = POS(c_idx, x, y);
                     if (!c_idx) {
                         fc->vvcdsp.lf.filter_luma[0](src, fc->frame->linesize[c_idx],
                             beta, tc, no_p, no_q, max_len_p, max_len_q, horizontal_ctu_edge);
@@ -1079,7 +1083,6 @@ void ff_vvc_alf_copy_ctu_to_hv(VVCLocalContext* lc, const int x0, const int y0)
     const int rx         = x0 >> fc->ps.sps->ctb_log2_size_y;
     const int ry         = y0 >> fc->ps.sps->ctb_log2_size_y;
     const int ctb_size_y = fc->ps.sps->ctb_size_y;
-    const int ps         = fc->ps.sps->pixel_shift;
     const int c_end      = fc->ps.sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;
 
     for (int c_idx = 0; c_idx < c_end; c_idx++) {
@@ -1091,7 +1094,7 @@ void ff_vvc_alf_copy_ctu_to_hv(VVCLocalContext* lc, const int x0, const int y0)
         const int height = FFMIN(fc->ps.pps->height - y0, ctb_size_y) >> vs;
 
         const int src_stride = fc->frame->linesize[c_idx];
-        uint8_t* src = &fc->frame->data[c_idx][y * src_stride + (x << ps)];
+        uint8_t *src = POS(c_idx, x0, y0);
 
         alf_copy_ctb_to_hv(fc, src, src_stride, x, y, width, height, rx, ry, c_idx);
     }
@@ -1146,7 +1149,7 @@ void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0)
         const int width  = FFMIN(pic_width  - x, ctb_size_h);
         const int height = FFMIN(pic_height - y, ctb_size_v);
         const int src_stride = fc->frame->linesize[c_idx];
-        uint8_t *src = &fc->frame->data[c_idx][y * src_stride + (x << ps)];
+        uint8_t *src = POS(c_idx, x0, y0);
         uint8_t *padded;
 
         if (alf->ctb_flag[c_idx] || (!c_idx && (alf->ctb_cc_idc[0] || alf->ctb_cc_idc[1]))) {
@@ -1181,7 +1184,7 @@ void ff_vvc_lmcs_filter(const VVCLocalContext *lc, const int x, const int y)
     const int ctb_size = fc->ps.sps->ctb_size_y;
     const int width    = FFMIN(fc->ps.pps->width  - x, ctb_size);
     const int height   = FFMIN(fc->ps.pps->height - y, ctb_size);
-    uint8_t *data      = fc->frame->data[LUMA] + y * fc->frame->linesize[LUMA] + (x << fc->ps.sps->pixel_shift);
+    uint8_t *data      = POS(LUMA, x, y);
     if (sc->sh.r->sh_lmcs_used_flag)
         fc->vvcdsp.lmcs.filter(data, fc->frame->linesize[LUMA], width, height, &fc->ps.lmcs.inv_lut);
 }
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 06/18] avcodec/vvcdec: refact, unify ff_vvc_deblock_{horizontal, vertical}
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (3 preceding siblings ...)
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 05/18] avcodec/vvcdec: misc, use POS to simplify filter code Nuo Mi
@ 2024-06-22  6:23 ` Nuo Mi
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 07/18] avcodec/vvcdec: refact out sao_get_edges Nuo Mi
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:23 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/filter.c | 153 ++++++++++++----------------------------
 1 file changed, 44 insertions(+), 109 deletions(-)

diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index 82a58a7ea8..89b794195e 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -712,144 +712,79 @@ static int get_qp(const VVCFrameContext *fc, const uint8_t *src, const int x, co
     return get_qp_c(fc, x, y, c_idx, vertical);
 }
 
-void ff_vvc_deblock_vertical(const VVCLocalContext *lc, const int x0, const int y0, const int rs)
+static void vvc_deblock(const VVCLocalContext *lc, int x0, int y0, const int rs, const int vertical)
 {
-    VVCFrameContext *fc = lc->fc;
-    const VVCSPS *sps   = fc->ps.sps;
-    const int c_end     = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;
-    uint8_t *src;
-    int x, y, qp;
+    VVCFrameContext *fc    = lc->fc;
+    const VVCSPS *sps      = fc->ps.sps;
+    const int c_end        = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;
+    const int ctb_size     = fc->ps.sps->ctb_size_y;
+    const DBParams *params = fc->tab.deblock + rs;
+    int x_end              = FFMIN(x0 + ctb_size, fc->ps.pps->width);
+    int y_end              = FFMIN(y0 + ctb_size, fc->ps.pps->height);
 
     //not use this yet, may needed by plt.
-    const uint8_t no_p[4] = { 0 };
-    const uint8_t no_q[4] = { 0 } ;
-
-    const int ctb_log2_size_y = fc->ps.sps->ctb_log2_size_y;
-    int x_end, y_end;
-    const int ctb_size = 1 << ctb_log2_size_y;
-    const DBParams *params = fc->tab.deblock + rs;
+    const uint8_t no_p[4]  = { 0 };
+    const uint8_t no_q[4]  = { 0 } ;
 
-    vvc_deblock_bs(lc, x0, y0, rs, 1);
+    vvc_deblock_bs(lc, x0, y0, rs, vertical);
 
-    x_end = x0 + ctb_size;
-    if (x_end > fc->ps.pps->width)
-        x_end = fc->ps.pps->width;
-    y_end = y0 + ctb_size;
-    if (y_end > fc->ps.pps->height)
-        y_end = fc->ps.pps->height;
+    if (!vertical) {
+        FFSWAP(int, x_end, y_end);
+        FFSWAP(int, x0, y0);
+    }
 
     for (int c_idx = 0; c_idx < c_end; c_idx++) {
-        const int hs          = sps->hshift[c_idx];
-        const int vs          = sps->vshift[c_idx];
+        const int hs          = (vertical ? sps->hshift : sps->vshift)[c_idx];
+        const int vs          = (vertical ? sps->vshift : sps->hshift)[c_idx];
         const int grid        = c_idx ? (CHROMA_GRID << hs) : LUMA_GRID;
         const int tc_offset   = params->tc_offset[c_idx];
         const int beta_offset = params->beta_offset[c_idx];
+        const int src_stride  = fc->frame->linesize[c_idx];
 
-        for (y = y0; y < y_end; y += (DEBLOCK_STEP << vs)) {
-            for (x = x0 ? x0 : grid; x < x_end; x += grid) {
-                int32_t bs[4], beta[4], tc[4], all_zero_bs = 1;
+        for (int y = y0; y < y_end; y += (DEBLOCK_STEP << vs)) {
+            for (int x = x0 ? x0 : grid; x < x_end; x += grid) {
+                const uint8_t horizontal_ctu_edge = !vertical && !(x % ctb_size);
+                int32_t bs[4], beta[4], tc[4] = { }, all_zero_bs = 1;
                 uint8_t max_len_p[4], max_len_q[4];
 
                 for (int i = 0; i < DEBLOCK_STEP >> (2 - vs); i++) {
-                    const int dy = i << 2;
-                    bs[i] = (y + dy < y_end) ? TAB_BS(fc->tab.bs[1][c_idx], x, y + dy) : 0;
-                    if (bs[i]) {
-                        src = POS(c_idx, x, y + dy);
-                        qp = get_qp(fc, src, x, y + dy, c_idx, 1);
+                    int tx         = x;
+                    int ty         = y + (i << 2);
+                    const int end  = ty >= y_end;
 
-                        beta[i] = betatable[av_clip(qp + beta_offset, 0, MAX_QP)];
+                    if (!vertical)
+                        FFSWAP(int, tx, ty);
 
-                        max_filter_length(fc, x, y + dy, c_idx, 1, 0, bs[i], &max_len_p[i], &max_len_q[i]);
+                    bs[i] = end ? 0 : TAB_BS(fc->tab.bs[vertical][c_idx], tx, ty);
+                    if (bs[i]) {
+                        const int qp = get_qp(fc, POS(c_idx, tx, ty), tx, ty, c_idx, vertical);
+                        beta[i] = betatable[av_clip(qp + beta_offset, 0, MAX_QP)];
+                        tc[i] = TC_CALC(qp, bs[i]) ;
+                        max_filter_length(fc, tx, ty, c_idx, vertical, horizontal_ctu_edge, bs[i], &max_len_p[i], &max_len_q[i]);
                         all_zero_bs = 0;
                     }
-                    tc[i] = bs[i] ? TC_CALC(qp, bs[i]) : 0;
                 }
 
                 if (!all_zero_bs) {
-                    src = POS(c_idx, x, y);
-                    if (!c_idx) {
-                        fc->vvcdsp.lf.filter_luma[1](src, fc->frame->linesize[c_idx],
-                            beta, tc, no_p, no_q, max_len_p, max_len_q, 0);
-                    } else {
-                        fc->vvcdsp.lf.filter_chroma[1](src, fc->frame->linesize[c_idx],
-                            beta, tc, no_p, no_q, max_len_p, max_len_q, vs);
-                    }
+                    uint8_t *src = vertical ? POS(c_idx, x, y) : POS(c_idx, y, x);
+                    if (!c_idx)
+                        fc->vvcdsp.lf.filter_luma[vertical](src, src_stride, beta, tc, no_p, no_q, max_len_p, max_len_q, horizontal_ctu_edge);
+                    else
+                        fc->vvcdsp.lf.filter_chroma[vertical](src, src_stride, beta, tc, no_p, no_q, max_len_p, max_len_q, vs);
                 }
             }
         }
     }
 }
 
-void ff_vvc_deblock_horizontal(const VVCLocalContext *lc, const int x0, const int y0, const int rs)
+void ff_vvc_deblock_vertical(const VVCLocalContext *lc, const int x0, const int y0, const int rs)
 {
-    VVCFrameContext *fc = lc->fc;
-    const VVCSPS *sps   = fc->ps.sps;
-    const int c_end     = fc->ps.sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;
-    uint8_t* src;
-    int x, y, qp;
-
-    //not use this yet, may needed by plt.
-    const uint8_t no_p[4] = { 0 };
-    const uint8_t no_q[4] = { 0 } ;
-
-    const int ctb_log2_size_y = fc->ps.sps->ctb_log2_size_y;
-    int x_end, y_end;
-    const int ctb_size = 1 << ctb_log2_size_y;
-    const DBParams *params = fc->tab.deblock + rs;
-
-    vvc_deblock_bs(lc, x0, y0, rs, 0);
-
-    x_end = x0 + ctb_size;
-    if (x_end > fc->ps.pps->width)
-        x_end = fc->ps.pps->width;
-    y_end = y0 + ctb_size;
-    if (y_end > fc->ps.pps->height)
-        y_end = fc->ps.pps->height;
-
-    for (int c_idx = 0; c_idx < c_end; c_idx++) {
-        const int hs          = sps->hshift[c_idx];
-        const int vs          = sps->vshift[c_idx];
-        const int grid        = c_idx ? (CHROMA_GRID << vs) : LUMA_GRID;
-        const int beta_offset = params->beta_offset[c_idx];
-        const int tc_offset   = params->tc_offset[c_idx];
-
-        for (y = y0; y < y_end; y += grid) {
-            const uint8_t horizontal_ctu_edge = !(y % fc->ps.sps->ctb_size_y);
-            if (!y)
-                continue;
-
-            for (x = x0 ? x0: 0; x < x_end; x += (DEBLOCK_STEP << hs)) {
-                int32_t bs[4], beta[4], tc[4], all_zero_bs = 1;
-                uint8_t max_len_p[4], max_len_q[4];
-
-                for (int i = 0; i < DEBLOCK_STEP >> (2 - hs); i++) {
-                    const int dx = i << 2;
-
-                    bs[i] = (x + dx < x_end) ? TAB_BS(fc->tab.bs[0][c_idx], x + dx, y) : 0;
-                    if (bs[i]) {
-                        src = POS(c_idx, x + dx, y);
-                        qp = get_qp(fc, src, x + dx, y, c_idx, 0);
-
-                        beta[i] = betatable[av_clip(qp + beta_offset, 0, MAX_QP)];
+    vvc_deblock(lc, x0, y0, rs, 1);
+}
 
-                        max_filter_length(fc, x + dx, y, c_idx, 0, horizontal_ctu_edge, bs[i], &max_len_p[i], &max_len_q[i]);
-                        all_zero_bs = 0;
-                    }
-                    tc[i] = bs[i] ? TC_CALC(qp, bs[i]) : 0;
-                }
-                if (!all_zero_bs) {
-                    src = POS(c_idx, x, y);
-                    if (!c_idx) {
-                        fc->vvcdsp.lf.filter_luma[0](src, fc->frame->linesize[c_idx],
-                            beta, tc, no_p, no_q, max_len_p, max_len_q, horizontal_ctu_edge);
-                    } else {
-                        fc->vvcdsp.lf.filter_chroma[0](src, fc->frame->linesize[c_idx],
-                            beta, tc, no_p, no_q, max_len_p, max_len_q, hs);
-                    }
-                }
-            }
-        }
-    }
+void ff_vvc_deblock_horizontal(const VVCLocalContext *lc, const int x0, const int y0, const int rs)
+{
+    vvc_deblock(lc, x0, y0, rs, 0);
 }
 
 static void alf_copy_border(uint8_t *dst, const uint8_t *src,
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 07/18] avcodec/vvcdec: refact out sao_get_edges
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (4 preceding siblings ...)
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 06/18] avcodec/vvcdec: refact, unify ff_vvc_deblock_{horizontal, vertical} Nuo Mi
@ 2024-06-22  6:23 ` Nuo Mi
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 08/18] avcodec/vvcdec: refact out sao_extends_edges Nuo Mi
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:23 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/filter.c | 119 ++++++++++++++++++++++------------------
 1 file changed, 65 insertions(+), 54 deletions(-)

diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index 89b794195e..1326d2c82e 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -155,70 +155,81 @@ void ff_vvc_sao_copy_ctb_to_hv(VVCLocalContext *lc, const int rx, const int ry,
         sao_copy_ctb_to_hv(lc, rx, ry, 0);
 }
 
+static int sao_can_cross_slices(const VVCFrameContext *fc, const int rx, const int ry, const int dx, const int dy)
+{
+    const uint8_t lfase = fc->ps.pps->r->pps_loop_filter_across_slices_enabled_flag;
+
+    return lfase || CTB(fc->tab.slice_idx, rx, ry) == CTB(fc->tab.slice_idx, rx + dx, ry + dy);
+}
+
+static void sao_get_edges(uint8_t vert_edge[2], uint8_t horiz_edge[2], uint8_t diag_edge[4], int *restore,
+    const VVCLocalContext *lc, const int edges[4], const int rx, const int ry)
+{
+    const VVCFrameContext *fc      = lc->fc;
+    const VVCSPS *sps              = fc->ps.sps;
+    const H266RawSPS *rsps         = sps->r;
+    const VVCPPS *pps              = fc->ps.pps;
+    const int subpic_idx           = lc->sc->sh.r->curr_subpic_idx;
+    const uint8_t lfase            = fc->ps.pps->r->pps_loop_filter_across_slices_enabled_flag;
+    const uint8_t no_tile_filter   = pps->r->num_tiles_in_pic > 1 && !pps->r->pps_loop_filter_across_tiles_enabled_flag;
+    const uint8_t no_subpic_filter = rsps->sps_num_subpics_minus1 && !rsps->sps_loop_filter_across_subpic_enabled_flag[subpic_idx];
+    uint8_t lf_edge[] = { 0, 0, 0, 0 };
+
+    *restore = no_subpic_filter || no_tile_filter || !lfase;
+
+    if (!*restore)
+        return;
+
+    if (!edges[LEFT]) {
+        lf_edge[LEFT]  = no_tile_filter && pps->ctb_to_col_bd[rx] == rx;
+        lf_edge[LEFT] |= no_subpic_filter && rsps->sps_subpic_ctu_top_left_x[subpic_idx] == rx;
+        vert_edge[0]   = !sao_can_cross_slices(fc, rx, ry, -1, 0) || lf_edge[LEFT];
+    }
+    if (!edges[RIGHT]) {
+        lf_edge[RIGHT]  = no_tile_filter && pps->ctb_to_col_bd[rx] != pps->ctb_to_col_bd[rx + 1];
+        lf_edge[RIGHT] |= no_subpic_filter && rsps->sps_subpic_ctu_top_left_x[subpic_idx] + rsps->sps_subpic_width_minus1[subpic_idx] == rx;
+        vert_edge[1]    = !sao_can_cross_slices(fc, rx, ry, 1, 0) || lf_edge[RIGHT];
+    }
+    if (!edges[TOP]) {
+        lf_edge[TOP]   = no_tile_filter && pps->ctb_to_row_bd[ry] == ry;
+        lf_edge[TOP]  |= no_subpic_filter && rsps->sps_subpic_ctu_top_left_y[subpic_idx] == ry;
+        horiz_edge[0]  = !sao_can_cross_slices(fc, rx, ry, 0, -1) || lf_edge[TOP];
+    }
+    if (!edges[BOTTOM]) {
+        lf_edge[BOTTOM]  = no_tile_filter && pps->ctb_to_row_bd[ry] != pps->ctb_to_row_bd[ry + 1];
+        lf_edge[BOTTOM] |= no_subpic_filter && rsps->sps_subpic_ctu_top_left_y[subpic_idx] + rsps->sps_subpic_height_minus1[subpic_idx] == ry;
+        horiz_edge[1]    = !sao_can_cross_slices(fc, rx, ry, 0, 1) || lf_edge[BOTTOM];
+    }
+
+    if (!edges[LEFT] && !edges[TOP])
+        diag_edge[0] = !sao_can_cross_slices(fc, rx, ry, -1, -1) || lf_edge[LEFT] || lf_edge[TOP];
+
+    if (!edges[TOP] && !edges[RIGHT])
+        diag_edge[1] = !sao_can_cross_slices(fc, rx, ry,  1, -1) || lf_edge[RIGHT] || lf_edge[TOP];
+
+    if (!edges[RIGHT] && !edges[BOTTOM])
+        diag_edge[2] = !sao_can_cross_slices(fc, rx, ry,  1,  1) || lf_edge[RIGHT] || lf_edge[BOTTOM];
+
+    if (!edges[LEFT] && !edges[BOTTOM])
+        diag_edge[3] = !sao_can_cross_slices(fc, rx, ry, -1,  1) || lf_edge[LEFT] || lf_edge[BOTTOM];
+}
+
 void ff_vvc_sao_filter(VVCLocalContext *lc, int x, int y)
 {
     VVCFrameContext *fc  = lc->fc;
     const int ctb_size_y = fc->ps.sps->ctb_size_y;
     static const uint8_t sao_tab[16] = { 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8 };
-    int c_idx;
+    int c_idx, restore;
     const int rx         = x >> fc->ps.sps->ctb_log2_size_y;
     const int ry         = y >> fc->ps.sps->ctb_log2_size_y;
     int edges[4]         = { !rx, !ry, rx == fc->ps.pps->ctb_width - 1, ry == fc->ps.pps->ctb_height - 1 };
     const SAOParams *sao = &CTB(fc->tab.sao, rx, ry);
     // flags indicating unfilterable edges
-    uint8_t vert_edge[]          = { 0, 0 };
-    uint8_t horiz_edge[]         = { 0, 0 };
-    uint8_t diag_edge[]          = { 0, 0, 0, 0 };
-    uint8_t tile_edge[]          = { 0, 0, 0, 0 };
-    uint8_t subpic_edge[]        = { 0, 0, 0, 0 };
-    const int subpic_idx         = lc->sc->sh.r->curr_subpic_idx;
-    const uint8_t lfase          = fc->ps.pps->r->pps_loop_filter_across_slices_enabled_flag;
-    const uint8_t no_tile_filter = fc->ps.pps->r->num_tiles_in_pic > 1 &&
-                               !fc->ps.pps->r->pps_loop_filter_across_tiles_enabled_flag;
-    const uint8_t no_subpic_filter = fc->ps.sps->r->sps_num_subpics_minus1 &&
-        !fc->ps.sps->r->sps_loop_filter_across_subpic_enabled_flag[subpic_idx];
-    const uint8_t restore        = no_subpic_filter || no_tile_filter || !lfase;
-
-    if (restore) {
-        if (!edges[LEFT]) {
-            tile_edge[LEFT]   = no_tile_filter && fc->ps.pps->ctb_to_col_bd[rx] == rx;
-            subpic_edge[LEFT] = no_subpic_filter && fc->ps.sps->r->sps_subpic_ctu_top_left_x[subpic_idx] == rx;
-            vert_edge[0]      = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx - 1, ry)) || tile_edge[LEFT] || subpic_edge[LEFT];
-        }
-        if (!edges[RIGHT]) {
-            tile_edge[RIGHT]   = no_tile_filter && fc->ps.pps->ctb_to_col_bd[rx] != fc->ps.pps->ctb_to_col_bd[rx + 1];
-            subpic_edge[RIGHT] = no_subpic_filter &&
-                fc->ps.sps->r->sps_subpic_ctu_top_left_x[subpic_idx] + fc->ps.sps->r->sps_subpic_width_minus1[subpic_idx] == rx;
-            vert_edge[1]       = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx + 1, ry)) || tile_edge[RIGHT] || subpic_edge[RIGHT];
-        }
-        if (!edges[TOP]) {
-            tile_edge[TOP]   = no_tile_filter && fc->ps.pps->ctb_to_row_bd[ry] == ry;
-            subpic_edge[TOP] = no_subpic_filter && fc->ps.sps->r->sps_subpic_ctu_top_left_y[subpic_idx] == ry;
-            horiz_edge[0]    = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx, ry - 1)) || tile_edge[TOP] || subpic_edge[TOP];
-        }
-        if (!edges[BOTTOM]) {
-            tile_edge[BOTTOM]   = no_tile_filter && fc->ps.pps->ctb_to_row_bd[ry] != fc->ps.pps->ctb_to_row_bd[ry + 1];
-            subpic_edge[BOTTOM] = no_subpic_filter &&
-                fc->ps.sps->r->sps_subpic_ctu_top_left_y[subpic_idx] + fc->ps.sps->r->sps_subpic_height_minus1[subpic_idx] == ry;
-            horiz_edge[1]       = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx, ry + 1)) || tile_edge[BOTTOM] || subpic_edge[BOTTOM];
-        }
-        if (!edges[LEFT] && !edges[TOP]) {
-            diag_edge[0] = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx - 1, ry - 1)) ||
-                tile_edge[LEFT] || tile_edge[TOP] || subpic_edge[LEFT] || subpic_edge[TOP];
-        }
-        if (!edges[TOP] && !edges[RIGHT]) {
-            diag_edge[1] = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx + 1, ry - 1)) ||
-                tile_edge[RIGHT] || tile_edge[TOP] || subpic_edge[TOP] || subpic_edge[RIGHT];
-        }
-        if (!edges[RIGHT] && !edges[BOTTOM]) {
-            diag_edge[2] = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx + 1, ry + 1)) ||
-                tile_edge[RIGHT] || tile_edge[BOTTOM] || subpic_edge[RIGHT] || subpic_edge[BOTTOM];
-        }
-        if (!edges[LEFT] && !edges[BOTTOM]) {
-            diag_edge[3] = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx - 1, ry + 1)) ||
-                tile_edge[LEFT] || tile_edge[BOTTOM] || subpic_edge[LEFT] || subpic_edge[BOTTOM];
-        }
-    }
+    uint8_t vert_edge[]  = { 0, 0 };
+    uint8_t horiz_edge[] = { 0, 0 };
+    uint8_t diag_edge[]  = { 0, 0, 0, 0 };
+
+    sao_get_edges(vert_edge, horiz_edge, diag_edge, &restore, lc, edges, rx, ry);
 
     for (c_idx = 0; c_idx < (fc->ps.sps->r->sps_chroma_format_idc ? 3 : 1); c_idx++) {
         int x0       = x >> fc->ps.sps->hshift[c_idx];
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 08/18] avcodec/vvcdec: refact out sao_extends_edges
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (5 preceding siblings ...)
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 07/18] avcodec/vvcdec: refact out sao_get_edges Nuo Mi
@ 2024-06-22  6:23 ` Nuo Mi
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 09/18] avcodec/vvcdec: refact, fix naming convention of x0, y0 for sao Nuo Mi
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:23 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/filter.c | 108 +++++++++++++++++++---------------------
 1 file changed, 50 insertions(+), 58 deletions(-)

diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index 1326d2c82e..534ba57205 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -214,6 +214,52 @@ static void sao_get_edges(uint8_t vert_edge[2], uint8_t horiz_edge[2], uint8_t d
         diag_edge[3] = !sao_can_cross_slices(fc, rx, ry, -1,  1) || lf_edge[LEFT] || lf_edge[BOTTOM];
 }
 
+static void sao_copy_hor(uint8_t *dst, const ptrdiff_t dst_stride,
+    const uint8_t *src, const ptrdiff_t src_stride, const int width, const int edges[4], const int ps)
+{
+    const int left      = 1 - edges[LEFT];
+    const int right     = 1 - edges[RIGHT];
+    int pos             = 0;
+
+    src -= left << ps;
+    dst -= left << ps;
+
+    if (left) {
+        copy_pixel(dst, src, ps);
+        pos += (1 << ps);
+    }
+    memcpy(dst + pos, src + pos, width << ps);
+    if (right) {
+        pos += width << ps;
+        copy_pixel(dst + pos, src + pos, ps);
+    }
+}
+
+static void sao_extends_edges(uint8_t *dst, const ptrdiff_t dst_stride,
+    const uint8_t *src, const ptrdiff_t src_stride, const int width, const int height,
+    const VVCFrameContext *fc, const int x, const int y, const int rx, const int ry, const int edges[4], const int c_idx)
+{
+    const uint8_t *sao_h = fc->tab.sao_pixel_buffer_h[c_idx];
+    const uint8_t *sao_v = fc->tab.sao_pixel_buffer_v[c_idx];
+    const int w          = fc->ps.pps->width >> fc->ps.sps->hshift[c_idx];
+    const int h          = fc->ps.pps->height >> fc->ps.sps->vshift[c_idx];
+    const int ps         = fc->ps.sps->pixel_shift;
+
+    if (!edges[TOP])
+        sao_copy_hor(dst - dst_stride, dst_stride, sao_h + (((2 * ry - 1) * w + x) << ps), src_stride, width, edges, ps);
+
+    if (!edges[BOTTOM])
+        sao_copy_hor(dst + height * dst_stride, dst_stride, sao_h + (((2 * ry + 2) * w + x) << ps), src_stride, width, edges, ps);
+
+    if (!edges[LEFT])
+        copy_vert(dst - (1 << ps), sao_v + (((2 * rx - 1) * h + y) << ps), ps, height, dst_stride, 1 << ps);
+
+    if (!edges[RIGHT])
+        copy_vert(dst + (width << ps), sao_v + (((2 * rx + 2) * h + y) << ps),  ps, height, dst_stride, 1 << ps);
+
+    copy_ctb(dst, src, width << ps, height, dst_stride, src_stride);
+}
+
 void ff_vvc_sao_filter(VVCLocalContext *lc, int x, int y)
 {
     VVCFrameContext *fc  = lc->fc;
@@ -241,8 +287,6 @@ void ff_vvc_sao_filter(VVCLocalContext *lc, int x, int y)
         int height   = FFMIN(ctb_size_v, (fc->ps.pps->height >> fc->ps.sps->vshift[c_idx]) - y0);
         int tab      = sao_tab[(FFALIGN(width, 8) >> 3) - 1];
         uint8_t *src = POS(c_idx, x, y);
-        ptrdiff_t dst_stride;
-        uint8_t *dst;
 
         switch (sao->type_idx[c_idx]) {
         case SAO_BAND:
@@ -251,63 +295,11 @@ void ff_vvc_sao_filter(VVCLocalContext *lc, int x, int y)
             break;
         case SAO_EDGE:
         {
-            const int w = fc->ps.pps->width >> fc->ps.sps->hshift[c_idx];
-            const int h = fc->ps.pps->height >> fc->ps.sps->vshift[c_idx];
-            const int sh = fc->ps.sps->pixel_shift;
-
-            dst_stride = 2*MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE;
-            dst = lc->sao_buffer + dst_stride + AV_INPUT_BUFFER_PADDING_SIZE;
-
-            if (!edges[TOP]) {
-                const int left = 1 - edges[LEFT];
-                const int right = 1 - edges[RIGHT];
-                const uint8_t *src1;
-                uint8_t *dst1;
-                int pos = 0;
-
-                dst1 = dst - dst_stride - (left << sh);
-                src1 = fc->tab.sao_pixel_buffer_h[c_idx] + (((2 * ry - 1) * w + x0 - left) << sh);
-                if (left) {
-                    copy_pixel(dst1, src1, sh);
-                    pos += (1 << sh);
-                }
-                memcpy(dst1 + pos, src1 + pos, width << sh);
-                if (right) {
-                    pos += width << sh;
-                    copy_pixel(dst1 + pos, src1 + pos, sh);
-                }
-            }
-            if (!edges[BOTTOM]) {
-                const int left = 1 - edges[LEFT];
-                const int right = 1 - edges[RIGHT];
-                const uint8_t *src1;
-                uint8_t *dst1;
-                int pos = 0;
-
-                dst1 = dst + height * dst_stride - (left << sh);
-                src1 = fc->tab.sao_pixel_buffer_h[c_idx] + (((2 * ry + 2) * w + x0 - left) << sh);
-                if (left) {
-                    copy_pixel(dst1, src1, sh);
-                    pos += (1 << sh);
-                }
-                memcpy(dst1 + pos, src1 + pos, width << sh);
-                if (right) {
-                    pos += width << sh;
-                    copy_pixel(dst1 + pos, src1 + pos, sh);
-                }
-            }
-            if (!edges[LEFT]) {
-                copy_vert(dst - (1 << sh),
-                    fc->tab.sao_pixel_buffer_v[c_idx] + (((2 * rx - 1) * h + y0) << sh),
-                    sh, height, dst_stride, 1 << sh);
-            }
-            if (!edges[RIGHT]) {
-                copy_vert(dst + (width << sh),
-                    fc->tab.sao_pixel_buffer_v[c_idx] + (((2 * rx + 2) * h + y0) << sh),
-                    sh, height, dst_stride, 1 << sh);
-            }
+            const ptrdiff_t dst_stride = 2 * MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE;
+            uint8_t *dst               = lc->sao_buffer + dst_stride + AV_INPUT_BUFFER_PADDING_SIZE;
+
+            sao_extends_edges(dst, dst_stride, src, src_stride, width, height, fc, x0, y0, rx, ry, edges, c_idx);
 
-            copy_ctb(dst, src,  width << sh, height, dst_stride, src_stride);
             fc->vvcdsp.sao.edge_filter[tab](src, dst, src_stride, sao->offset_val[c_idx],
                 sao->eo_class[c_idx], width, height);
             fc->vvcdsp.sao.edge_restore[restore](src, dst, src_stride, dst_stride,
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 09/18] avcodec/vvcdec: refact, fix naming convention of x0, y0 for sao
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (6 preceding siblings ...)
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 08/18] avcodec/vvcdec: refact out sao_extends_edges Nuo Mi
@ 2024-06-22  6:23 ` Nuo Mi
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 10/18] avcodec/vvcdec: misc, reformat ff_vvc_sao_filter Nuo Mi
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:23 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

it's mismatched with the ff_vvc_sao_filter function declaration
---
 libavcodec/vvc/filter.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index 534ba57205..10d11ce31f 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -237,10 +237,12 @@ static void sao_copy_hor(uint8_t *dst, const ptrdiff_t dst_stride,
 
 static void sao_extends_edges(uint8_t *dst, const ptrdiff_t dst_stride,
     const uint8_t *src, const ptrdiff_t src_stride, const int width, const int height,
-    const VVCFrameContext *fc, const int x, const int y, const int rx, const int ry, const int edges[4], const int c_idx)
+    const VVCFrameContext *fc, const int x0, const int y0, const int rx, const int ry, const int edges[4], const int c_idx)
 {
     const uint8_t *sao_h = fc->tab.sao_pixel_buffer_h[c_idx];
     const uint8_t *sao_v = fc->tab.sao_pixel_buffer_v[c_idx];
+    const int x          = x0 >> fc->ps.sps->hshift[c_idx];
+    const int y          = y0 >> fc->ps.sps->vshift[c_idx];
     const int w          = fc->ps.pps->width >> fc->ps.sps->hshift[c_idx];
     const int h          = fc->ps.pps->height >> fc->ps.sps->vshift[c_idx];
     const int ps         = fc->ps.sps->pixel_shift;
@@ -260,14 +262,14 @@ static void sao_extends_edges(uint8_t *dst, const ptrdiff_t dst_stride,
     copy_ctb(dst, src, width << ps, height, dst_stride, src_stride);
 }
 
-void ff_vvc_sao_filter(VVCLocalContext *lc, int x, int y)
+void ff_vvc_sao_filter(VVCLocalContext *lc, int x0, int y0)
 {
     VVCFrameContext *fc  = lc->fc;
-    const int ctb_size_y = fc->ps.sps->ctb_size_y;
+    const VVCSPS *sps    = fc->ps.sps;
     static const uint8_t sao_tab[16] = { 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8 };
     int c_idx, restore;
-    const int rx         = x >> fc->ps.sps->ctb_log2_size_y;
-    const int ry         = y >> fc->ps.sps->ctb_log2_size_y;
+    const int rx         = x0 >> sps->ctb_log2_size_y;
+    const int ry         = y0 >> sps->ctb_log2_size_y;
     int edges[4]         = { !rx, !ry, rx == fc->ps.pps->ctb_width - 1, ry == fc->ps.pps->ctb_height - 1 };
     const SAOParams *sao = &CTB(fc->tab.sao, rx, ry);
     // flags indicating unfilterable edges
@@ -277,16 +279,12 @@ void ff_vvc_sao_filter(VVCLocalContext *lc, int x, int y)
 
     sao_get_edges(vert_edge, horiz_edge, diag_edge, &restore, lc, edges, rx, ry);
 
-    for (c_idx = 0; c_idx < (fc->ps.sps->r->sps_chroma_format_idc ? 3 : 1); c_idx++) {
-        int x0       = x >> fc->ps.sps->hshift[c_idx];
-        int y0       = y >> fc->ps.sps->vshift[c_idx];
+    for (c_idx = 0; c_idx < (sps->r->sps_chroma_format_idc ? 3 : 1); c_idx++) {
         ptrdiff_t src_stride = fc->frame->linesize[c_idx];
-        int ctb_size_h = ctb_size_y >> fc->ps.sps->hshift[c_idx];
-        int ctb_size_v = ctb_size_y >> fc->ps.sps->vshift[c_idx];
-        int width    = FFMIN(ctb_size_h, (fc->ps.pps->width  >> fc->ps.sps->hshift[c_idx]) - x0);
-        int height   = FFMIN(ctb_size_v, (fc->ps.pps->height >> fc->ps.sps->vshift[c_idx]) - y0);
+        const int width  = FFMIN(sps->ctb_size_y, fc->ps.pps->width - x0) >> sps->hshift[c_idx];
+        const int height = FFMIN(sps->ctb_size_y, fc->ps.pps->height - y0) >> sps->vshift[c_idx];
         int tab      = sao_tab[(FFALIGN(width, 8) >> 3) - 1];
-        uint8_t *src = POS(c_idx, x, y);
+        uint8_t *src = POS(c_idx, x0, y0);
 
         switch (sao->type_idx[c_idx]) {
         case SAO_BAND:
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 10/18] avcodec/vvcdec: misc, reformat ff_vvc_sao_filter
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (7 preceding siblings ...)
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 09/18] avcodec/vvcdec: refact, fix naming convention of x0, y0 for sao Nuo Mi
@ 2024-06-22  6:23 ` Nuo Mi
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 11/18] avcodec/vvcdec: refact out alf_get_edges Nuo Mi
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:23 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/filter.c | 52 ++++++++++++++++++++---------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index 10d11ce31f..3aa241ad90 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -266,44 +266,44 @@ void ff_vvc_sao_filter(VVCLocalContext *lc, int x0, int y0)
 {
     VVCFrameContext *fc  = lc->fc;
     const VVCSPS *sps    = fc->ps.sps;
-    static const uint8_t sao_tab[16] = { 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8 };
-    int c_idx, restore;
     const int rx         = x0 >> sps->ctb_log2_size_y;
     const int ry         = y0 >> sps->ctb_log2_size_y;
-    int edges[4]         = { !rx, !ry, rx == fc->ps.pps->ctb_width - 1, ry == fc->ps.pps->ctb_height - 1 };
+    const int edges[4]   = { !rx, !ry, rx == fc->ps.pps->ctb_width - 1, ry == fc->ps.pps->ctb_height - 1 };
     const SAOParams *sao = &CTB(fc->tab.sao, rx, ry);
     // flags indicating unfilterable edges
     uint8_t vert_edge[]  = { 0, 0 };
     uint8_t horiz_edge[] = { 0, 0 };
     uint8_t diag_edge[]  = { 0, 0, 0, 0 };
+    int restore;
 
     sao_get_edges(vert_edge, horiz_edge, diag_edge, &restore, lc, edges, rx, ry);
 
-    for (c_idx = 0; c_idx < (sps->r->sps_chroma_format_idc ? 3 : 1); c_idx++) {
-        ptrdiff_t src_stride = fc->frame->linesize[c_idx];
-        const int width  = FFMIN(sps->ctb_size_y, fc->ps.pps->width - x0) >> sps->hshift[c_idx];
-        const int height = FFMIN(sps->ctb_size_y, fc->ps.pps->height - y0) >> sps->vshift[c_idx];
-        int tab      = sao_tab[(FFALIGN(width, 8) >> 3) - 1];
-        uint8_t *src = POS(c_idx, x0, y0);
+    for (int c_idx = 0; c_idx < (sps->r->sps_chroma_format_idc ? 3 : 1); c_idx++) {
+        static const uint8_t sao_tab[16] = { 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8 };
+        const ptrdiff_t src_stride       = fc->frame->linesize[c_idx];
+        uint8_t *src                     = POS(c_idx, x0, y0);
+        const int width                  = FFMIN(sps->ctb_size_y, fc->ps.pps->width - x0) >> sps->hshift[c_idx];
+        const int height                 = FFMIN(sps->ctb_size_y, fc->ps.pps->height - y0) >> sps->vshift[c_idx];
+        const int tab                    = sao_tab[(FFALIGN(width, 8) >> 3) - 1];
 
         switch (sao->type_idx[c_idx]) {
-        case SAO_BAND:
-            fc->vvcdsp.sao.band_filter[tab](src, src, src_stride, src_stride,
-                sao->offset_val[c_idx], sao->band_position[c_idx], width, height);
-            break;
-        case SAO_EDGE:
-        {
-            const ptrdiff_t dst_stride = 2 * MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE;
-            uint8_t *dst               = lc->sao_buffer + dst_stride + AV_INPUT_BUFFER_PADDING_SIZE;
-
-            sao_extends_edges(dst, dst_stride, src, src_stride, width, height, fc, x0, y0, rx, ry, edges, c_idx);
-
-            fc->vvcdsp.sao.edge_filter[tab](src, dst, src_stride, sao->offset_val[c_idx],
-                sao->eo_class[c_idx], width, height);
-            fc->vvcdsp.sao.edge_restore[restore](src, dst, src_stride, dst_stride,
-                sao, edges, width, height, c_idx, vert_edge, horiz_edge, diag_edge);
-            break;
-        }
+            case SAO_BAND:
+                fc->vvcdsp.sao.band_filter[tab](src, src, src_stride, src_stride,
+                    sao->offset_val[c_idx], sao->band_position[c_idx], width, height);
+                break;
+            case SAO_EDGE:
+            {
+                const ptrdiff_t dst_stride = 2 * MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE;
+                uint8_t *dst               = lc->sao_buffer + dst_stride + AV_INPUT_BUFFER_PADDING_SIZE;
+
+                sao_extends_edges(dst, dst_stride, src, src_stride, width, height, fc, x0, y0, rx, ry, edges, c_idx);
+
+                fc->vvcdsp.sao.edge_filter[tab](src, dst, src_stride, sao->offset_val[c_idx],
+                    sao->eo_class[c_idx], width, height);
+                fc->vvcdsp.sao.edge_restore[restore](src, dst, src_stride, dst_stride,
+                    sao, edges, width, height, c_idx, vert_edge, horiz_edge, diag_edge);
+                break;
+            }
         }
     }
 }
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 11/18] avcodec/vvcdec: refact out alf_get_edges
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (8 preceding siblings ...)
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 10/18] avcodec/vvcdec: misc, reformat ff_vvc_sao_filter Nuo Mi
@ 2024-06-22  6:23 ` Nuo Mi
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 12/18] avcodec/vvcdec: misc, remove unused ALFParams.applied Nuo Mi
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:23 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/filter.c | 53 ++++++++++++++++++++++++-----------------
 1 file changed, 31 insertions(+), 22 deletions(-)

diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index 3aa241ad90..671e599dab 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -1036,6 +1036,35 @@ void ff_vvc_alf_copy_ctu_to_hv(VVCLocalContext* lc, const int x0, const int y0)
     }
 }
 
+static void alf_get_edges(const VVCLocalContext *lc, int edges[MAX_EDGES], const int rx, const int ry)
+{
+    VVCFrameContext *fc  = lc->fc;
+    const VVCSPS *sps    = fc->ps.sps;
+    const VVCPPS *pps    = fc->ps.pps;
+    const int subpic_idx = lc->sc->sh.r->curr_subpic_idx;
+
+    if (!pps->r->pps_loop_filter_across_tiles_enabled_flag) {
+        edges[LEFT]   |= !!(lc->boundary_flags & BOUNDARY_LEFT_TILE);
+        edges[TOP]    |= !!(lc->boundary_flags & BOUNDARY_UPPER_TILE);
+        edges[RIGHT]  |= pps->ctb_to_col_bd[rx] != pps->ctb_to_col_bd[rx + 1];
+        edges[BOTTOM] |= pps->ctb_to_row_bd[ry] != pps->ctb_to_row_bd[ry + 1];
+    }
+
+    if (!pps->r->pps_loop_filter_across_slices_enabled_flag) {
+        edges[LEFT]   |= !!(lc->boundary_flags & BOUNDARY_LEFT_SLICE);
+        edges[TOP]    |= !!(lc->boundary_flags & BOUNDARY_UPPER_SLICE);
+        edges[RIGHT]  |= CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx + 1, ry);
+        edges[BOTTOM] |= CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx, ry + 1);
+    }
+
+    if (!sps->r->sps_loop_filter_across_subpic_enabled_flag[subpic_idx]) {
+        edges[LEFT]   |= !!(lc->boundary_flags & BOUNDARY_LEFT_SUBPIC);
+        edges[TOP]    |= !!(lc->boundary_flags & BOUNDARY_UPPER_SUBPIC);
+        edges[RIGHT]  |= fc->ps.sps->r->sps_subpic_ctu_top_left_x[subpic_idx] + fc->ps.sps->r->sps_subpic_width_minus1[subpic_idx] == rx;
+        edges[BOTTOM] |= fc->ps.sps->r->sps_subpic_ctu_top_left_y[subpic_idx] + fc->ps.sps->r->sps_subpic_height_minus1[subpic_idx] == ry;
+    }
+}
+
 void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0)
 {
     VVCFrameContext *fc     = lc->fc;
@@ -1047,31 +1076,11 @@ void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0)
     const int ps            = fc->ps.sps->pixel_shift;
     const int padded_stride = EDGE_EMU_BUFFER_STRIDE << ps;
     const int padded_offset = padded_stride * ALF_PADDING_SIZE + (ALF_PADDING_SIZE << ps);
-    const int c_end         = fc->ps.sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;
-    const int subpic_idx    = lc->sc->sh.r->curr_subpic_idx;
+    const int c_end         = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;
     ALFParams *alf          = &CTB(fc->tab.alf, rx, ry);
     int edges[MAX_EDGES]    = { rx == 0, ry == 0, rx == pps->ctb_width - 1, ry == pps->ctb_height - 1 };
 
-    if (!pps->r->pps_loop_filter_across_tiles_enabled_flag) {
-        edges[LEFT]   = edges[LEFT] || (lc->boundary_flags & BOUNDARY_LEFT_TILE);
-        edges[TOP]    = edges[TOP] || (lc->boundary_flags & BOUNDARY_UPPER_TILE);
-        edges[RIGHT]  = edges[RIGHT] || pps->ctb_to_col_bd[rx] != pps->ctb_to_col_bd[rx + 1];
-        edges[BOTTOM] = edges[BOTTOM] || pps->ctb_to_row_bd[ry] != pps->ctb_to_row_bd[ry + 1];
-    }
-
-    if (!pps->r->pps_loop_filter_across_slices_enabled_flag) {
-        edges[LEFT]   = edges[LEFT] || (lc->boundary_flags & BOUNDARY_LEFT_SLICE);
-        edges[TOP]    = edges[TOP] || (lc->boundary_flags & BOUNDARY_UPPER_SLICE);
-        edges[RIGHT]  = edges[RIGHT] || CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx + 1, ry);
-        edges[BOTTOM] = edges[BOTTOM] || CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx, ry + 1);
-    }
-
-    if (!sps->r->sps_loop_filter_across_subpic_enabled_flag[subpic_idx]) {
-        edges[LEFT]   = edges[LEFT] || (lc->boundary_flags & BOUNDARY_LEFT_SUBPIC);
-        edges[TOP]    = edges[TOP] || (lc->boundary_flags & BOUNDARY_UPPER_SUBPIC);
-        edges[RIGHT]  = edges[RIGHT] || fc->ps.sps->r->sps_subpic_ctu_top_left_x[subpic_idx] + fc->ps.sps->r->sps_subpic_width_minus1[subpic_idx] == rx;
-        edges[BOTTOM] = edges[BOTTOM] || fc->ps.sps->r->sps_subpic_ctu_top_left_y[subpic_idx] + fc->ps.sps->r->sps_subpic_height_minus1[subpic_idx] == ry;
-    }
+    alf_get_edges(lc, edges, rx, ry);
 
     for (int c_idx = 0; c_idx < c_end; c_idx++) {
         const int hs = fc->ps.sps->hshift[c_idx];
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 12/18] avcodec/vvcdec: misc, remove unused ALFParams.applied
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (9 preceding siblings ...)
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 11/18] avcodec/vvcdec: refact out alf_get_edges Nuo Mi
@ 2024-06-22  6:23 ` Nuo Mi
  2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 13/18] avcodec/vvcdec: misc, constify ALFParams Nuo Mi
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:23 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/ctu.h    | 2 --
 libavcodec/vvc/filter.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/libavcodec/vvc/ctu.h b/libavcodec/vvc/ctu.h
index a987328d81..432dbc5ade 100644
--- a/libavcodec/vvc/ctu.h
+++ b/libavcodec/vvc/ctu.h
@@ -461,8 +461,6 @@ typedef struct ALFParams {
     uint8_t ctb_filt_set_idx_y;         ///< AlfCtbFiltSetIdxY
     uint8_t alf_ctb_filter_alt_idx[2];  ///< alf_ctb_filter_alt_idx[]
     uint8_t ctb_cc_idc[2];              ///< alf_ctb_cc_cb_idc, alf_ctb_cc_cr_idc
-
-    uint8_t applied[3];
 } ALFParams;
 
 /**
diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index 671e599dab..457e2b99c2 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -1116,8 +1116,6 @@ void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0)
             alf_filter_cc(lc, src, padded, src_stride, padded_stride, c_idx,
                 width, height, hs, vs, (ctb_size_v << vs) - ALF_VB_POS_ABOVE_LUMA, alf);
         }
-
-        alf->applied[c_idx] = 1;
     }
 }
 
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 13/18] avcodec/vvcdec: misc, constify ALFParams
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (10 preceding siblings ...)
  2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 12/18] avcodec/vvcdec: misc, remove unused ALFParams.applied Nuo Mi
@ 2024-06-22  6:24 ` Nuo Mi
  2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 14/18] cbs_h266: add VVC_MAX_VBS for max num of virtual boundaries Nuo Mi
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:24 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/filter.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index 457e2b99c2..a5635c60df 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -926,7 +926,7 @@ static void alf_prepare_buffer(VVCFrameContext *fc, uint8_t *_dst, const uint8_t
 #define ALF_MAX_FILTER_SIZE     (ALF_MAX_BLOCKS_IN_CTU * ALF_NUM_COEFF_LUMA)
 
 static void alf_get_coeff_and_clip(VVCLocalContext *lc, int16_t *coeff, int16_t *clip,
-    const uint8_t *src, ptrdiff_t src_stride, int width, int height, int vb_pos, ALFParams *alf)
+    const uint8_t *src, ptrdiff_t src_stride, int width, int height, int vb_pos, const ALFParams *alf)
 {
     const VVCFrameContext *fc     = lc->fc;
     const H266RawSliceHeader *rsh = lc->sc->sh.r;
@@ -957,7 +957,7 @@ static void alf_get_coeff_and_clip(VVCLocalContext *lc, int16_t *coeff, int16_t
 
 static void alf_filter_luma(VVCLocalContext *lc, uint8_t *dst, const uint8_t *src,
     const ptrdiff_t dst_stride, const ptrdiff_t src_stride, const int x0, const int y0,
-    const int width, const int height, const int _vb_pos, ALFParams *alf)
+    const int width, const int height, const int _vb_pos, const ALFParams *alf)
 {
     const VVCFrameContext *fc = lc->fc;
     int vb_pos                = _vb_pos - y0;
@@ -981,7 +981,7 @@ static int alf_clip_from_idx(const VVCFrameContext *fc, const int idx)
 
 static void alf_filter_chroma(VVCLocalContext *lc, uint8_t *dst, const uint8_t *src,
     const ptrdiff_t dst_stride, const ptrdiff_t src_stride, const int c_idx,
-    const int width, const int height, const int vb_pos, ALFParams *alf)
+    const int width, const int height, const int vb_pos, const ALFParams *alf)
 {
     VVCFrameContext *fc           = lc->fc;
     const H266RawSliceHeader *rsh = lc->sc->sh.r;
@@ -998,7 +998,7 @@ static void alf_filter_chroma(VVCLocalContext *lc, uint8_t *dst, const uint8_t *
 
 static void alf_filter_cc(VVCLocalContext *lc, uint8_t *dst, const uint8_t *luma,
     const ptrdiff_t dst_stride, const ptrdiff_t luma_stride, const int c_idx,
-    const int width, const int height, const int hs, const int vs, const int vb_pos, ALFParams *alf)
+    const int width, const int height, const int hs, const int vs, const int vb_pos, const ALFParams *alf)
 {
     const VVCFrameContext *fc     = lc->fc;
     const H266RawSliceHeader *rsh = lc->sc->sh.r;
@@ -1077,7 +1077,7 @@ void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0)
     const int padded_stride = EDGE_EMU_BUFFER_STRIDE << ps;
     const int padded_offset = padded_stride * ALF_PADDING_SIZE + (ALF_PADDING_SIZE << ps);
     const int c_end         = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;
-    ALFParams *alf          = &CTB(fc->tab.alf, rx, ry);
+    const ALFParams *alf    = &CTB(fc->tab.alf, rx, ry);
     int edges[MAX_EDGES]    = { rx == 0, ry == 0, rx == pps->ctb_width - 1, ry == pps->ctb_height - 1 };
 
     alf_get_edges(lc, edges, rx, ry);
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 14/18] cbs_h266: add VVC_MAX_VBS for max num of virtual boundaries
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (11 preceding siblings ...)
  2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 13/18] avcodec/vvcdec: misc, constify ALFParams Nuo Mi
@ 2024-06-22  6:24 ` Nuo Mi
  2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 15/18] avcodec/vvcdec: ps, derive " Nuo Mi
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:24 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/cbs_h266.h                 | 8 ++++----
 libavcodec/cbs_h266_syntax_template.c | 8 ++++----
 libavcodec/vvc.h                      | 3 +++
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/libavcodec/cbs_h266.h b/libavcodec/cbs_h266.h
index 21b9a4196c..5f12915b65 100644
--- a/libavcodec/cbs_h266.h
+++ b/libavcodec/cbs_h266.h
@@ -464,9 +464,9 @@ typedef struct H266RawSPS {
     uint8_t  sps_virtual_boundaries_enabled_flag;
     uint8_t  sps_virtual_boundaries_present_flag;
     uint8_t  sps_num_ver_virtual_boundaries;
-    uint16_t sps_virtual_boundary_pos_x_minus1[3];
+    uint16_t sps_virtual_boundary_pos_x_minus1[VVC_MAX_VBS];
     uint8_t  sps_num_hor_virtual_boundaries;
-    uint16_t sps_virtual_boundary_pos_y_minus1[3];
+    uint16_t sps_virtual_boundary_pos_y_minus1[VVC_MAX_VBS];
 
     uint8_t  sps_timing_hrd_params_present_flag;
     uint8_t  sps_sublayer_cpb_params_present_flag;
@@ -703,9 +703,9 @@ typedef struct  H266RawPictureHeader {
 
     uint8_t  ph_virtual_boundaries_present_flag;
     uint8_t  ph_num_ver_virtual_boundaries;
-    uint16_t ph_virtual_boundary_pos_x_minus1[3];
+    uint16_t ph_virtual_boundary_pos_x_minus1[VVC_MAX_VBS];
     uint8_t  ph_num_hor_virtual_boundaries;
-    uint16_t ph_virtual_boundary_pos_y_minus1[3];
+    uint16_t ph_virtual_boundary_pos_y_minus1[VVC_MAX_VBS];
 
     uint8_t  ph_pic_output_flag;
     H266RefPicLists ph_ref_pic_lists;
diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c
index 53c4b60b0d..34b766c7af 100644
--- a/libavcodec/cbs_h266_syntax_template.c
+++ b/libavcodec/cbs_h266_syntax_template.c
@@ -1562,13 +1562,13 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
         flag(sps_virtual_boundaries_present_flag);
         if (current->sps_virtual_boundaries_present_flag) {
             ue(sps_num_ver_virtual_boundaries,
-               0, current->sps_pic_width_max_in_luma_samples <= 8 ? 0 : 3);
+               0, current->sps_pic_width_max_in_luma_samples <= 8 ? 0 : VVC_MAX_VBS);
             for (i = 0; i < current->sps_num_ver_virtual_boundaries; i++)
                 ues(sps_virtual_boundary_pos_x_minus1[i],
                     0, (current->sps_pic_width_max_in_luma_samples + 7) / 8 - 2,
                     1, i);
             ue(sps_num_hor_virtual_boundaries,
-               0, current->sps_pic_height_max_in_luma_samples <= 8 ? 0 : 3);
+               0, current->sps_pic_height_max_in_luma_samples <= 8 ? 0 : VVC_MAX_VBS);
             for (i = 0; i < current->sps_num_hor_virtual_boundaries; i++)
                 ues(sps_virtual_boundary_pos_y_minus1[i],
                     0, (current->sps_pic_height_max_in_luma_samples + 7) /
@@ -2714,13 +2714,13 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw,
         flag(ph_virtual_boundaries_present_flag);
         if (current->ph_virtual_boundaries_present_flag) {
             ue(ph_num_ver_virtual_boundaries,
-               0, pps->pps_pic_width_in_luma_samples <= 8 ? 0 : 3);
+               0, pps->pps_pic_width_in_luma_samples <= 8 ? 0 : VVC_MAX_VBS);
             for (i = 0; i < current->ph_num_ver_virtual_boundaries; i++) {
                 ues(ph_virtual_boundary_pos_x_minus1[i],
                     0, (pps->pps_pic_width_in_luma_samples + 7) / 8 - 2, 1, i);
             }
             ue(ph_num_hor_virtual_boundaries,
-               0, pps->pps_pic_height_in_luma_samples <= 8 ? 0 : 3);
+               0, pps->pps_pic_height_in_luma_samples <= 8 ? 0 : VVC_MAX_VBS);
             for (i = 0; i < current->ph_num_hor_virtual_boundaries; i++) {
                 ues(ph_virtual_boundary_pos_y_minus1[i],
                     0, (pps->pps_pic_height_in_luma_samples + 7) / 8 - 2, 1, i);
diff --git a/libavcodec/vvc.h b/libavcodec/vvc.h
index c4cec1eb8f..92639779c1 100644
--- a/libavcodec/vvc.h
+++ b/libavcodec/vvc.h
@@ -151,6 +151,9 @@ enum {
     // get near that, though, so set a lower limit here with the maximum
     // possible value for 8K video (at most 135 32x32 Ctb rows).
     VVC_MAX_ENTRY_POINTS = VVC_MAX_TILE_COLUMNS * 135,
+
+    // {sps, ph}_num_{ver, hor}_virtual_boundaries should in [0, 3]
+    VVC_MAX_VBS = 3,
 };
 
 #endif /* AVCODEC_VVC_H */
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 15/18] avcodec/vvcdec: ps, derive virtual boundaries
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (12 preceding siblings ...)
  2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 14/18] cbs_h266: add VVC_MAX_VBS for max num of virtual boundaries Nuo Mi
@ 2024-06-22  6:24 ` Nuo Mi
  2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 16/18] avcodec/vvcdec: deblock, support " Nuo Mi
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:24 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/ps.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
 libavcodec/vvc/ps.h |  6 ++++++
 2 files changed, 51 insertions(+)

diff --git a/libavcodec/vvc/ps.c b/libavcodec/vvc/ps.c
index 92368eafc2..58496c9fba 100644
--- a/libavcodec/vvc/ps.c
+++ b/libavcodec/vvc/ps.c
@@ -796,8 +796,49 @@ static int ph_max_num_subblock_merge_cand(const H266RawSPS *sps, const H266RawPi
     return sps->sps_sbtmvp_enabled_flag && ph->ph_temporal_mvp_enabled_flag;
 }
 
+static int ph_vb_pos(uint16_t *vbs, uint8_t *num_vbs, const uint16_t *pos_minus_1, const uint8_t num_pos, uint16_t max, const int ctb_size_y)
+{
+    max = FF_CEIL_RSHIFT(max, 3) - 2;
+    for (int i = 0; i < num_pos; i++) {
+        if (pos_minus_1[i] > max)
+            return AVERROR_INVALIDDATA;
+
+        vbs[i] = (pos_minus_1[i] + 1) << 3;
+
+        // The distance between any two vertical virtual boundaries shall be greater than or equal to CtbSizeY luma samples
+        if (i && vbs[i] < vbs[i - 1] + ctb_size_y)
+            return AVERROR_INVALIDDATA;
+    }
+    *num_vbs = num_pos;
+
+    return 0;
+}
+
+#define VBF(f) (sps->sps_virtual_boundaries_present_flag ? sps->sps_##f : ph->r->ph_##f)
+#define VBFS(c, d) VBF(virtual_boundary_pos_##c##_minus1), VBF(num_##d##_virtual_boundaries)
+
+static int ph_vb(VVCPH *ph, const H266RawSPS *sps, const H266RawPPS *pps)
+{
+    const int ctb_size_y = 1 << (sps->sps_log2_ctu_size_minus5 + 5);
+    int ret;
+
+    if (!sps->sps_virtual_boundaries_enabled_flag)
+        return 0;
+
+    ret = ph_vb_pos(ph->vb_pos_x, &ph->num_ver_vbs, VBFS(x, ver), pps->pps_pic_width_in_luma_samples, ctb_size_y);
+    if (ret < 0)
+        return ret;
+
+    ret = ph_vb_pos(ph->vb_pos_y, &ph->num_hor_vbs, VBFS(y, hor), pps->pps_pic_height_in_luma_samples, ctb_size_y);
+    if (ret < 0)
+        return ret;
+
+    return 0;
+}
+
 static int ph_derive(VVCPH *ph, const H266RawSPS *sps, const H266RawPPS *pps, const int poc_tid0, const int is_clvss)
 {
+    int ret;
     ph->max_num_subblock_merge_cand = ph_max_num_subblock_merge_cand(sps, ph->r);
 
     ph->poc = ph_compute_poc(ph->r, sps, poc_tid0, is_clvss);
@@ -805,6 +846,10 @@ static int ph_derive(VVCPH *ph, const H266RawSPS *sps, const H266RawPPS *pps, co
     if (pps->pps_wp_info_in_ph_flag)
         pred_weight_table(&ph->pwt, &ph->r->ph_pred_weight_table);
 
+    ret = ph_vb(ph, sps, pps);
+    if (ret < 0)
+        return ret;
+
     return 0;
 }
 
diff --git a/libavcodec/vvc/ps.h b/libavcodec/vvc/ps.h
index 6656a06320..9203e2c57f 100644
--- a/libavcodec/vvc/ps.h
+++ b/libavcodec/vvc/ps.h
@@ -151,6 +151,12 @@ typedef struct VVCPH {
     //derived values
     uint32_t max_num_subblock_merge_cand;           ///< MaxNumSubblockMergeCand
     int32_t  poc;                                   ///< PicOrderCntVal
+
+    uint8_t  num_ver_vbs;                           ///< NumVerVirtualBoundaries
+    uint16_t vb_pos_x[VVC_MAX_VBS];                 ///< VirtualBoundaryPosX
+    uint8_t  num_hor_vbs;                           ///< NumHorVirtualBoundaries
+    uint16_t vb_pos_y[VVC_MAX_VBS];                 ///< VirtualBoundaryPosY
+
     PredWeightTable pwt;
 } VVCPH;
 
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 16/18] avcodec/vvcdec: deblock, support virtual boundaries
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (13 preceding siblings ...)
  2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 15/18] avcodec/vvcdec: ps, derive " Nuo Mi
@ 2024-06-22  6:24 ` Nuo Mi
  2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 17/18] avcodec/vvcdec: sao, " Nuo Mi
  2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 18/18] avcodec/vvcdec: alf, " Nuo Mi
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:24 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/filter.c | 34 ++++++++++++++++++++++++++++++----
 1 file changed, 30 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index a5635c60df..69d67cb7f6 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -55,6 +55,29 @@ static const uint8_t betatable[64] = {
      58,  60,  62,  64,  66,  68,  70,  72,  74,  76,  78,  80,  82,  84,  86,  88,
 };
 
+static int get_virtual_boundary(const VVCFrameContext *fc, const int ctu_pos, const int vertical)
+{
+    const VVCSPS *sps    = fc->ps.sps;
+    const VVCPH *ph      = &fc->ps.ph;
+    const uint16_t *vbs  = vertical ? ph->vb_pos_x    : ph->vb_pos_y;
+    const uint8_t nb_vbs = vertical ? ph->num_ver_vbs : ph->num_hor_vbs;
+    const int pos        = ctu_pos << sps->ctb_log2_size_y;
+
+    if (sps->r->sps_virtual_boundaries_enabled_flag) {
+        for (int i = 0; i < nb_vbs; i++) {
+            const int o = vbs[i] - pos;
+            if (o >= 0 && o < sps->ctb_size_y)
+                return vbs[i];
+        }
+    }
+    return 0;
+}
+
+static int is_virtual_boundary(const VVCFrameContext *fc, const int pos, const int vertical)
+{
+    return get_virtual_boundary(fc, pos >> fc->ps.sps->ctb_log2_size_y, vertical) == pos;
+}
+
 static int get_qPc(const VVCFrameContext *fc, const int x0, const int y0, const int chroma)
 {
     const int x            = x0 >> MIN_TU_LOG2;
@@ -429,6 +452,7 @@ static void vvc_deblock_subblock_bs(const VVCLocalContext *lc,
 
     // bs for TU internal vertical PU boundaries
     for (int i = 8 - ((x0 - cb) % 8); i < width; i += 8) {
+        const int is_vb = is_virtual_boundary(fc, x0 + i, vertical);
         const int xp_pu = (x0 + i - 1) >> log2_min_pu_size;
         const int xq_pu = (x0 + i)     >> log2_min_pu_size;
 
@@ -436,7 +460,7 @@ static void vvc_deblock_subblock_bs(const VVCLocalContext *lc,
             const int y_pu       = (y0 + j) >> log2_min_pu_size;
             const MvField *mvf_p = &tab_mvf[y_pu * stridea + xp_pu * strideb];
             const MvField *mvf_q = &tab_mvf[y_pu * stridea + xq_pu * strideb];
-            const int bs         = boundary_strength(lc, mvf_q, mvf_p, rpl);
+            const int bs         = is_vb ? 0 : boundary_strength(lc, mvf_q, mvf_p, rpl);
             int x                = x0 + i;
             int y                = y0 + j;
             uint8_t max_len_p = 0, max_len_q = 0;
@@ -557,6 +581,7 @@ static void vvc_deblock_bs_luma(const VVCLocalContext *lc,
             (x0 >> log2_min_pu_size)].pred_flag == PF_INTRA;
 
     if (deblock_is_boundary(lc, pos > 0 && !(pos & mask), pos, rs, vertical)) {
+        const int is_vb         = is_virtual_boundary(fc, pos, vertical);
         const int size          = vertical ? height : width;
         const int off           = cb - pos;
         const int cb_size       = (vertical ? fc->tab.cb_width : fc->tab.cb_height)[LUMA][off_q];
@@ -569,7 +594,7 @@ static void vvc_deblock_bs_luma(const VVCLocalContext *lc,
             const int x = x0 + i * !vertical;
             const int y = y0 + i * vertical;
             uint8_t max_len_p, max_len_q;
-            const int bs = deblock_bs(lc, x - vertical, y - !vertical, x, y, rpl_p, LUMA, off, has_sb);
+            const int bs = is_vb ? 0 : deblock_bs(lc, x - vertical, y - !vertical, x, y, rpl_p, LUMA, off, has_sb);
 
             TAB_BS(fc->tab.bs[vertical][LUMA], x, y) = bs;
 
@@ -594,13 +619,14 @@ static void vvc_deblock_bs_chroma(const VVCLocalContext *lc,
     const int pos             = vertical ? x0 : y0;
 
     if (deblock_is_boundary(lc, pos > 0 && !(pos & mask), pos, rs, vertical)) {
-        const int size = vertical ? height : width;
+        const int is_vb = is_virtual_boundary(fc, pos, vertical);
+        const int size  = vertical ? height : width;
 
         for (int c_idx = CB; c_idx <= CR; c_idx++) {
             for (int i = 0; i < size; i += 2) {
                 const int x  = x0 + i * !vertical;
                 const int y  = y0 + i * vertical;
-                const int bs = deblock_bs(lc, x - vertical, y - !vertical, x, y, NULL, c_idx, 0, 0);
+                const int bs = is_vb ? 0 : deblock_bs(lc, x - vertical, y - !vertical, x, y, NULL, c_idx, 0, 0);
 
                 TAB_BS(fc->tab.bs[vertical][c_idx], x, y) = bs;
             }
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 17/18] avcodec/vvcdec: sao, support virtual boundaries
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (14 preceding siblings ...)
  2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 16/18] avcodec/vvcdec: deblock, support " Nuo Mi
@ 2024-06-22  6:24 ` Nuo Mi
  2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 18/18] avcodec/vvcdec: alf, " Nuo Mi
  16 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:24 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/vvc/filter.c | 46 +++++++++++++++++++++++++++++++++++++----
 1 file changed, 42 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index 69d67cb7f6..44dd895d7d 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "libavutil/frame.h"
+#include "libavutil/imgutils.h"
 
 #include "ctu.h"
 #include "data.h"
@@ -198,7 +199,7 @@ static void sao_get_edges(uint8_t vert_edge[2], uint8_t horiz_edge[2], uint8_t d
     const uint8_t no_subpic_filter = rsps->sps_num_subpics_minus1 && !rsps->sps_loop_filter_across_subpic_enabled_flag[subpic_idx];
     uint8_t lf_edge[] = { 0, 0, 0, 0 };
 
-    *restore = no_subpic_filter || no_tile_filter || !lfase;
+    *restore = no_subpic_filter || no_tile_filter || !lfase || rsps->sps_virtual_boundaries_enabled_flag;
 
     if (!*restore)
         return;
@@ -206,21 +207,25 @@ static void sao_get_edges(uint8_t vert_edge[2], uint8_t horiz_edge[2], uint8_t d
     if (!edges[LEFT]) {
         lf_edge[LEFT]  = no_tile_filter && pps->ctb_to_col_bd[rx] == rx;
         lf_edge[LEFT] |= no_subpic_filter && rsps->sps_subpic_ctu_top_left_x[subpic_idx] == rx;
+        lf_edge[LEFT] |= is_virtual_boundary(fc, rx << sps->ctb_log2_size_y, 1);
         vert_edge[0]   = !sao_can_cross_slices(fc, rx, ry, -1, 0) || lf_edge[LEFT];
     }
     if (!edges[RIGHT]) {
         lf_edge[RIGHT]  = no_tile_filter && pps->ctb_to_col_bd[rx] != pps->ctb_to_col_bd[rx + 1];
         lf_edge[RIGHT] |= no_subpic_filter && rsps->sps_subpic_ctu_top_left_x[subpic_idx] + rsps->sps_subpic_width_minus1[subpic_idx] == rx;
+        lf_edge[RIGHT] |= is_virtual_boundary(fc, (rx + 1) << sps->ctb_log2_size_y, 1);
         vert_edge[1]    = !sao_can_cross_slices(fc, rx, ry, 1, 0) || lf_edge[RIGHT];
     }
     if (!edges[TOP]) {
         lf_edge[TOP]   = no_tile_filter && pps->ctb_to_row_bd[ry] == ry;
         lf_edge[TOP]  |= no_subpic_filter && rsps->sps_subpic_ctu_top_left_y[subpic_idx] == ry;
+        lf_edge[TOP]  |= is_virtual_boundary(fc, ry << sps->ctb_log2_size_y, 0);
         horiz_edge[0]  = !sao_can_cross_slices(fc, rx, ry, 0, -1) || lf_edge[TOP];
     }
     if (!edges[BOTTOM]) {
         lf_edge[BOTTOM]  = no_tile_filter && pps->ctb_to_row_bd[ry] != pps->ctb_to_row_bd[ry + 1];
         lf_edge[BOTTOM] |= no_subpic_filter && rsps->sps_subpic_ctu_top_left_y[subpic_idx] + rsps->sps_subpic_height_minus1[subpic_idx] == ry;
+        lf_edge[BOTTOM] |= is_virtual_boundary(fc, (ry + 1) << sps->ctb_log2_size_y, 0);
         horiz_edge[1]    = !sao_can_cross_slices(fc, rx, ry, 0, 1) || lf_edge[BOTTOM];
     }
 
@@ -285,6 +290,24 @@ static void sao_extends_edges(uint8_t *dst, const ptrdiff_t dst_stride,
     copy_ctb(dst, src, width << ps, height, dst_stride, src_stride);
 }
 
+static void sao_restore_vb(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride,
+    const int width, const int height, const int vb_pos, const int ps, const int vertical)
+{
+    int w = 2;
+    int h = (vertical ? height : width);
+    int dx = vb_pos - 1;
+    int dy = 0;
+
+    if (!vertical) {
+        FFSWAP(int, w, h);
+        FFSWAP(int, dx, dy);
+    }
+    dst += dy * dst_stride +(dx << ps);
+    src += dy * src_stride +(dx << ps);
+
+    av_image_copy_plane(dst, dst_stride, src, src_stride, w << ps, h);
+}
+
 void ff_vvc_sao_filter(VVCLocalContext *lc, int x0, int y0)
 {
     VVCFrameContext *fc  = lc->fc;
@@ -297,7 +320,12 @@ void ff_vvc_sao_filter(VVCLocalContext *lc, int x0, int y0)
     uint8_t vert_edge[]  = { 0, 0 };
     uint8_t horiz_edge[] = { 0, 0 };
     uint8_t diag_edge[]  = { 0, 0, 0, 0 };
-    int restore;
+    int restore, vb_x = 0, vb_y = 0;;
+
+    if (sps->r->sps_virtual_boundaries_enabled_flag) {
+        vb_x = get_virtual_boundary(fc, rx, 1);
+        vb_y = get_virtual_boundary(fc, ry, 0);
+    }
 
     sao_get_edges(vert_edge, horiz_edge, diag_edge, &restore, lc, edges, rx, ry);
 
@@ -305,9 +333,13 @@ void ff_vvc_sao_filter(VVCLocalContext *lc, int x0, int y0)
         static const uint8_t sao_tab[16] = { 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8 };
         const ptrdiff_t src_stride       = fc->frame->linesize[c_idx];
         uint8_t *src                     = POS(c_idx, x0, y0);
-        const int width                  = FFMIN(sps->ctb_size_y, fc->ps.pps->width - x0) >> sps->hshift[c_idx];
-        const int height                 = FFMIN(sps->ctb_size_y, fc->ps.pps->height - y0) >> sps->vshift[c_idx];
+        const int hs                     = sps->hshift[c_idx];
+        const int vs                     = sps->vshift[c_idx];
+        const int ps                     = sps->pixel_shift;
+        const int width                  = FFMIN(sps->ctb_size_y, fc->ps.pps->width  - x0) >> hs;
+        const int height                 = FFMIN(sps->ctb_size_y, fc->ps.pps->height - y0) >> vs;
         const int tab                    = sao_tab[(FFALIGN(width, 8) >> 3) - 1];
+        const int sao_eo_class           = sao->eo_class[c_idx];
 
         switch (sao->type_idx[c_idx]) {
             case SAO_BAND:
@@ -325,6 +357,12 @@ void ff_vvc_sao_filter(VVCLocalContext *lc, int x0, int y0)
                     sao->eo_class[c_idx], width, height);
                 fc->vvcdsp.sao.edge_restore[restore](src, dst, src_stride, dst_stride,
                     sao, edges, width, height, c_idx, vert_edge, horiz_edge, diag_edge);
+
+                if (vb_x > x0 &&  sao_eo_class != SAO_EO_VERT)
+                    sao_restore_vb(src, src_stride, dst, dst_stride, width, height, (vb_x - x0) >> hs, ps, 1);
+                if (vb_y > y0 &&  sao_eo_class != SAO_EO_HORIZ)
+                    sao_restore_vb(src, src_stride, dst, dst_stride, width, height, (vb_y - y0) >> vs, ps, 0);
+
                 break;
             }
         }
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [FFmpeg-devel] [PATCH 18/18] avcodec/vvcdec: alf, support virtual boundaries
       [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
                   ` (15 preceding siblings ...)
  2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 17/18] avcodec/vvcdec: sao, " Nuo Mi
@ 2024-06-22  6:24 ` Nuo Mi
  2024-06-25 11:53   ` Nuo Mi
  16 siblings, 1 reply; 20+ messages in thread
From: Nuo Mi @ 2024-06-22  6:24 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

see https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9503377

passed files:
    GDR_A_ERICSSON_2.bit
    GDR_B_NOKIA_2.bit
    GDR_C_NOKIA_2.bit
    VIRTUAL_A_MediaTek_3.bit
    VIRTUAL_B_MediaTek_3.bit
---
 libavcodec/vvc/ctu.h    |   7 +++
 libavcodec/vvc/filter.c | 134 ++++++++++++++++++++++++++++------------
 libavcodec/vvc/inter.c  |   7 ---
 3 files changed, 100 insertions(+), 48 deletions(-)

diff --git a/libavcodec/vvc/ctu.h b/libavcodec/vvc/ctu.h
index 432dbc5ade..d5c3e8d96f 100644
--- a/libavcodec/vvc/ctu.h
+++ b/libavcodec/vvc/ctu.h
@@ -463,6 +463,13 @@ typedef struct ALFParams {
     uint8_t ctb_cc_idc[2];              ///< alf_ctb_cc_cb_idc, alf_ctb_cc_cr_idc
 } ALFParams;
 
+typedef struct VVCRect {
+    int l;                  // left
+    int t;                  // top
+    int r;                  // right
+    int b;                  // bottom
+} VVCRect;
+
 /**
  * parse a CTU
  * @param lc local context for CTU
diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index 44dd895d7d..19b69f078e 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -56,6 +56,9 @@ static const uint8_t betatable[64] = {
      58,  60,  62,  64,  66,  68,  70,  72,  74,  76,  78,  80,  82,  84,  86,  88,
 };
 
+// One vertical and one horizontal virtual boundary in a CTU at most. The CTU will be divided into 4 subblocks.
+#define MAX_VBBS 4
+
 static int get_virtual_boundary(const VVCFrameContext *fc, const int ctu_pos, const int vertical)
 {
     const VVCSPS *sps    = fc->ps.sps;
@@ -1127,58 +1130,107 @@ static void alf_get_edges(const VVCLocalContext *lc, int edges[MAX_EDGES], const
         edges[RIGHT]  |= fc->ps.sps->r->sps_subpic_ctu_top_left_x[subpic_idx] + fc->ps.sps->r->sps_subpic_width_minus1[subpic_idx] == rx;
         edges[BOTTOM] |= fc->ps.sps->r->sps_subpic_ctu_top_left_y[subpic_idx] + fc->ps.sps->r->sps_subpic_height_minus1[subpic_idx] == ry;
     }
+
+    if (sps->r->sps_virtual_boundaries_enabled_flag) {
+        edges[LEFT]   |= is_virtual_boundary(fc, rx << sps->ctb_log2_size_y, 1);
+        edges[TOP]    |= is_virtual_boundary(fc, ry << sps->ctb_log2_size_y, 0);
+        edges[RIGHT]  |= is_virtual_boundary(fc, (rx + 1) << sps->ctb_log2_size_y, 1);
+        edges[BOTTOM] |= is_virtual_boundary(fc, (ry + 1) << sps->ctb_log2_size_y, 0);
+    }
+}
+
+static void alf_init_subblock(VVCRect *sb, int sb_edges[MAX_EDGES], const VVCRect *b, const int edges[MAX_EDGES])
+{
+    *sb = *b;
+    memcpy(sb_edges, edges, sizeof(int) * MAX_EDGES);
+}
+
+static void alf_get_subblock(VVCRect *sb, int edges[MAX_EDGES], const int bx, const int by, const int vb_pos[2], const int has_vb[2])
+{
+    int *pos[] = { &sb->l, &sb->t, &sb->r, &sb->b };
+
+    for (int vertical = 0; vertical <= 1; vertical++) {
+        if (has_vb[vertical]) {
+            const int c = vertical ? (bx ? LEFT : RIGHT) : (by ? TOP : BOTTOM);
+            *pos[c] = vb_pos[vertical];
+            edges[c]  = 1;
+        }
+    }
+}
+
+static void alf_get_subblocks(const VVCLocalContext *lc, VVCRect sbs[MAX_VBBS], int sb_edges[MAX_VBBS][MAX_EDGES], int *nb_sbs,
+    const int x0, const int y0, const int rx, const int ry)
+{
+    VVCFrameContext *fc  = lc->fc;
+    const VVCSPS *sps    = fc->ps.sps;
+    const VVCPPS *pps    = fc->ps.pps;
+    const int ctu_size_y = sps->ctb_size_y;
+    const int vb_pos[]   = { get_virtual_boundary(fc, ry, 0),  get_virtual_boundary(fc, rx, 1) };
+    const int has_vb[]   = { vb_pos[0] > y0, vb_pos[1] > x0 };
+    const VVCRect b      = { x0, y0, FFMIN(x0 + ctu_size_y, pps->width), FFMIN(y0 + ctu_size_y, pps->height) };
+    int edges[MAX_EDGES] = { !rx, !ry, rx == pps->ctb_width - 1, ry == pps->ctb_height - 1 };
+    int i                = 0;
+
+    alf_get_edges(lc, edges, rx, ry);
+
+    for (int by = 0; by <= has_vb[0]; by++) {
+        for (int bx = 0; bx <= has_vb[1]; bx++, i++) {
+            alf_init_subblock(sbs + i, sb_edges[i], &b, edges);
+            alf_get_subblock(sbs + i, sb_edges[i], bx, by, vb_pos, has_vb);
+        }
+    }
+    *nb_sbs = i;
 }
 
 void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0)
 {
     VVCFrameContext *fc     = lc->fc;
     const VVCSPS *sps       = fc->ps.sps;
-    const VVCPPS *pps       = fc->ps.pps;
-    const int rx            = x0 >> fc->ps.sps->ctb_log2_size_y;
-    const int ry            = y0 >> fc->ps.sps->ctb_log2_size_y;
-    const int ctb_size_y    = fc->ps.sps->ctb_size_y;
-    const int ps            = fc->ps.sps->pixel_shift;
+    const int rx            = x0 >> sps->ctb_log2_size_y;
+    const int ry            = y0 >> sps->ctb_log2_size_y;
+    const int ps            = sps->pixel_shift;
     const int padded_stride = EDGE_EMU_BUFFER_STRIDE << ps;
     const int padded_offset = padded_stride * ALF_PADDING_SIZE + (ALF_PADDING_SIZE << ps);
     const int c_end         = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;
+    const int ctu_end       = y0 + sps->ctb_size_y;
     const ALFParams *alf    = &CTB(fc->tab.alf, rx, ry);
-    int edges[MAX_EDGES]    = { rx == 0, ry == 0, rx == pps->ctb_width - 1, ry == pps->ctb_height - 1 };
-
-    alf_get_edges(lc, edges, rx, ry);
-
-    for (int c_idx = 0; c_idx < c_end; c_idx++) {
-        const int hs = fc->ps.sps->hshift[c_idx];
-        const int vs = fc->ps.sps->vshift[c_idx];
-        const int ctb_size_h = ctb_size_y >> hs;
-        const int ctb_size_v = ctb_size_y >> vs;
-        const int x = x0 >> hs;
-        const int y = y0 >> vs;
-        const int pic_width = fc->ps.pps->width >> hs;
-        const int pic_height = fc->ps.pps->height >> vs;
-        const int width  = FFMIN(pic_width  - x, ctb_size_h);
-        const int height = FFMIN(pic_height - y, ctb_size_v);
-        const int src_stride = fc->frame->linesize[c_idx];
-        uint8_t *src = POS(c_idx, x0, y0);
-        uint8_t *padded;
-
-        if (alf->ctb_flag[c_idx] || (!c_idx && (alf->ctb_cc_idc[0] || alf->ctb_cc_idc[1]))) {
-            padded = (c_idx ? lc->alf_buffer_chroma : lc->alf_buffer_luma) + padded_offset;
-            alf_prepare_buffer(fc, padded, src, x, y, rx, ry, width, height,
-                padded_stride, src_stride, c_idx, edges);
-        }
-        if (alf->ctb_flag[c_idx]) {
-            if (!c_idx)  {
-                alf_filter_luma(lc, src, padded, src_stride, padded_stride, x, y,
-                    width, height, y + ctb_size_v - ALF_VB_POS_ABOVE_LUMA, alf);
-            } else {
-                alf_filter_chroma(lc, src, padded, src_stride, padded_stride, c_idx,
-                    width, height, ctb_size_v - ALF_VB_POS_ABOVE_CHROMA, alf);
+    int sb_edges[MAX_VBBS][MAX_EDGES], nb_sbs;
+    VVCRect sbs[MAX_VBBS];
+
+    alf_get_subblocks(lc, sbs, sb_edges, &nb_sbs, x0, y0, rx, ry);
+
+    for (int i = 0; i < nb_sbs; i++) {
+        const VVCRect *sb = sbs + i;
+        for (int c_idx = 0; c_idx < c_end; c_idx++) {
+            const int hs         = fc->ps.sps->hshift[c_idx];
+            const int vs         = fc->ps.sps->vshift[c_idx];
+            const int x          = sb->l >> hs;
+            const int y          = sb->t >> vs;
+            const int width      = (sb->r - sb->l) >> hs;
+            const int height     = (sb->b - sb->t) >> vs;
+            const int src_stride = fc->frame->linesize[c_idx];
+            uint8_t *src         = POS(c_idx, sb->l, sb->t);
+            uint8_t *padded;
+
+            if (alf->ctb_flag[c_idx] || (!c_idx && (alf->ctb_cc_idc[0] || alf->ctb_cc_idc[1]))) {
+                padded = (c_idx ? lc->alf_buffer_chroma : lc->alf_buffer_luma) + padded_offset;
+                alf_prepare_buffer(fc, padded, src, x, y, rx, ry, width, height,
+                    padded_stride, src_stride, c_idx, sb_edges[i]);
+            }
+            if (alf->ctb_flag[c_idx]) {
+                if (!c_idx)  {
+                    alf_filter_luma(lc, src, padded, src_stride, padded_stride, x, y,
+                        width, height, ctu_end - ALF_VB_POS_ABOVE_LUMA, alf);
+                } else {
+                    alf_filter_chroma(lc, src, padded, src_stride, padded_stride, c_idx,
+                        width, height, ((ctu_end - sb->t) >> vs) - ALF_VB_POS_ABOVE_CHROMA, alf);
+                }
+            }
+            if (c_idx && alf->ctb_cc_idc[c_idx - 1]) {
+                padded = lc->alf_buffer_luma + padded_offset;
+                alf_filter_cc(lc, src, padded, src_stride, padded_stride, c_idx,
+                    width, height, hs, vs, ctu_end - sb->t - ALF_VB_POS_ABOVE_LUMA, alf);
             }
-        }
-        if (c_idx && alf->ctb_cc_idc[c_idx - 1]) {
-            padded = lc->alf_buffer_luma + padded_offset;
-            alf_filter_cc(lc, src, padded, src_stride, padded_stride, c_idx,
-                width, height, hs, vs, (ctb_size_v << vs) - ALF_VB_POS_ABOVE_LUMA, alf);
         }
     }
 }
diff --git a/libavcodec/vvc/inter.c b/libavcodec/vvc/inter.c
index 344a0a8c13..9578fd8de4 100644
--- a/libavcodec/vvc/inter.c
+++ b/libavcodec/vvc/inter.c
@@ -30,13 +30,6 @@
 #define PROF_TEMP_OFFSET (MAX_PB_SIZE + 32)
 static const int bcw_w_lut[] = {4, 5, 3, 10, -2};
 
-typedef struct VVCRect {
-    int l;                  // left
-    int t;                  // top
-    int r;                  // right
-    int b;                  // bottom
-} VVCRect;
-
 static void subpic_get_rect(VVCRect *r, const VVCFrame *src_frame, const int subpic_idx, const int is_chroma)
 {
     const VVCSPS *sps = src_frame->sps;
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [FFmpeg-devel] [PATCH 18/18] avcodec/vvcdec: alf, support virtual boundaries
  2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 18/18] avcodec/vvcdec: alf, " Nuo Mi
@ 2024-06-25 11:53   ` Nuo Mi
  2024-06-25 12:48     ` James Almer
  0 siblings, 1 reply; 20+ messages in thread
From: Nuo Mi @ 2024-06-25 11:53 UTC (permalink / raw)
  To: ffmpeg-devel

On Sat, Jun 22, 2024 at 2:24 PM Nuo Mi <nuomi2021@gmail.com> wrote:

> see https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9503377
>
> passed files:
>     GDR_A_ERICSSON_2.bit
>     GDR_B_NOKIA_2.bit
>     GDR_C_NOKIA_2.bit
>     VIRTUAL_A_MediaTek_3.bit
>     VIRTUAL_B_MediaTek_3.bit
>

Applied.
thank you

> --
> 2.34.1
>
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [FFmpeg-devel] [PATCH 18/18] avcodec/vvcdec: alf, support virtual boundaries
  2024-06-25 11:53   ` Nuo Mi
@ 2024-06-25 12:48     ` James Almer
  2024-06-25 14:29       ` Nuo Mi
  0 siblings, 1 reply; 20+ messages in thread
From: James Almer @ 2024-06-25 12:48 UTC (permalink / raw)
  To: ffmpeg-devel

On 6/25/2024 8:53 AM, Nuo Mi wrote:
> On Sat, Jun 22, 2024 at 2:24 PM Nuo Mi <nuomi2021@gmail.com> wrote:
> 
>> see https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9503377
>>
>> passed files:
>>      GDR_A_ERICSSON_2.bit
>>      GDR_B_NOKIA_2.bit
>>      GDR_C_NOKIA_2.bit
>>      VIRTUAL_A_MediaTek_3.bit
>>      VIRTUAL_B_MediaTek_3.bit
>>
> 
> Applied.
> thank you

Can you add a test for this? Just one of those samples (the that covers 
the most decoder logic).
And in general, try to add tests for at least one of the samples that 
exercise new feature support you add.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [FFmpeg-devel] [PATCH 18/18] avcodec/vvcdec: alf, support virtual boundaries
  2024-06-25 12:48     ` James Almer
@ 2024-06-25 14:29       ` Nuo Mi
  0 siblings, 0 replies; 20+ messages in thread
From: Nuo Mi @ 2024-06-25 14:29 UTC (permalink / raw)
  To: FFmpeg development discussions and patches, Frank Plowman

On Tue, Jun 25, 2024 at 8:48 PM James Almer <jamrial@gmail.com> wrote:

> On 6/25/2024 8:53 AM, Nuo Mi wrote:
> > On Sat, Jun 22, 2024 at 2:24 PM Nuo Mi <nuomi2021@gmail.com> wrote:
> >
> >> see https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9503377
> >>
> >> passed files:
> >>      GDR_A_ERICSSON_2.bit
> >>      GDR_B_NOKIA_2.bit
> >>      GDR_C_NOKIA_2.bit
> >>      VIRTUAL_A_MediaTek_3.bit
> >>      VIRTUAL_B_MediaTek_3.bit
> >>
> >
> > Applied.
> > thank you
>
> Can you add a test for this? Just one of those samples (the that covers
> the most decoder logic).
> And in general, try to add tests for at least one of the samples that
> exercise new feature support you add.
>
Hi James,
Thank you for the reminder.
Yes, we will do that. Once it is merged, it will trigger some gcov tests on
Frank's machine.
He will help select some clips to get the largest coverage and send a FATE
test like before.

BTW: We have a ci to cover conformance and fuzz test at
https://github.com/ffvvc/FFmpeg/actions/runs/9626631693/job/26559410841?pr=235#step:10:665

Thank you

_______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-06-25 14:30 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20240622062405.285359-1-nuomi2021@gmail.com>
2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 02/18] avcodec/vvcdec: refact, unify vvc_deblock_bs_luma_{horizontal, vertical} Nuo Mi
2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 03/18] avcodec/vvcdec: refact, unify vvc_deblock_bs_chroma_{horizontal, vertical} Nuo Mi
2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 04/18] avcodec/vvcdec: refact, unify {horizontal, vertical}_bs, {horizontal, vertical}_p, {horizontal, vertical}_q Nuo Mi
2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 05/18] avcodec/vvcdec: misc, use POS to simplify filter code Nuo Mi
2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 06/18] avcodec/vvcdec: refact, unify ff_vvc_deblock_{horizontal, vertical} Nuo Mi
2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 07/18] avcodec/vvcdec: refact out sao_get_edges Nuo Mi
2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 08/18] avcodec/vvcdec: refact out sao_extends_edges Nuo Mi
2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 09/18] avcodec/vvcdec: refact, fix naming convention of x0, y0 for sao Nuo Mi
2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 10/18] avcodec/vvcdec: misc, reformat ff_vvc_sao_filter Nuo Mi
2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 11/18] avcodec/vvcdec: refact out alf_get_edges Nuo Mi
2024-06-22  6:23 ` [FFmpeg-devel] [PATCH 12/18] avcodec/vvcdec: misc, remove unused ALFParams.applied Nuo Mi
2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 13/18] avcodec/vvcdec: misc, constify ALFParams Nuo Mi
2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 14/18] cbs_h266: add VVC_MAX_VBS for max num of virtual boundaries Nuo Mi
2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 15/18] avcodec/vvcdec: ps, derive " Nuo Mi
2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 16/18] avcodec/vvcdec: deblock, support " Nuo Mi
2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 17/18] avcodec/vvcdec: sao, " Nuo Mi
2024-06-22  6:24 ` [FFmpeg-devel] [PATCH 18/18] avcodec/vvcdec: alf, " Nuo Mi
2024-06-25 11:53   ` Nuo Mi
2024-06-25 12:48     ` James Almer
2024-06-25 14:29       ` Nuo Mi

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git