[FFmpeg-cvslog] avcodec/vvcdec: ensure every CTU belongs to a slice

Nuo Mi git at videolan.org
Sat Nov 30 04:06:46 EET 2024


ffmpeg | branch: master | Nuo Mi <nuomi2021 at gmail.com> | Sat Nov 23 17:32:32 2024 +0800| [5c5a08ecb53b1b9d97512ce398fa395c3fb8c1a8] | committer: Nuo Mi

avcodec/vvcdec: ensure every CTU belongs to a slice

According to section 6.3.3 "Spatial or component-wise partitionings,"
CTUs should fully cover slices with no overlaps, gaps, or additions.
No overlaps are ensured by task_init_parse.
No gaps and no additions are ensured by this patch.

Co-authored-by: Frank Plowman <post at frankplowman.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c5a08ecb53b1b9d97512ce398fa395c3fb8c1a8
---

 libavcodec/vvc/thread.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/vvc/thread.c b/libavcodec/vvc/thread.c
index 82c00dd4c9..f623d6a394 100644
--- a/libavcodec/vvc/thread.c
+++ b/libavcodec/vvc/thread.c
@@ -822,6 +822,13 @@ int ff_vvc_frame_submit(VVCContext *s, VVCFrameContext *fc)
             }
         }
     }
+    for (int rs = 0; rs < ft->ctu_count; rs++) {
+        const VVCTask *t = ft->tasks + rs;
+        if (!t->sc) {
+            av_log(s->avctx, AV_LOG_ERROR, "frame %5d, CTU(%d, %d) not belong to any slice\r\n", (int)fc->decode_order, t->rx, t->ry);
+            return AVERROR_INVALIDDATA;
+        }
+    }
     frame_thread_add_score(s, ft, 0, 0, VVC_TASK_STAGE_INIT);
 
     return 0;



More information about the ffmpeg-cvslog mailing list