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

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 0706d0ab1f avcodec/vvc/intra_template: bound reference corner extension
0706d0ab1f is described below

commit 0706d0ab1fadddf4a32fe7e589b2cff623475274
Author:     lusoris <[email protected]>
AuthorDate: Tue Oct 27 17:06:28 2026 +0100
Commit:     frankplow <[email protected]>
CommitDate: Sat Nov 7 17:19:52 2026 +0000

    avcodec/vvc/intra_template: bound reference corner extension
    
    The corner extension uses at most four samples before the top and left
    origins. Those origins have MAX_TB_SIZE + 3 samples of headroom, so the
    negative indices are valid. However, the ref_line range is not visible
    to the compiler in this loop, and gcc 15.2 and gcc 16.2 with
    -march=x86-64-v3 report vector stores before the edge object.
    
    Assume ref_line >= -4 before the loop. ref_idx is at most 3, so the
    assumption always holds, and the compiler can bound every corner index
    to [-4, -1] without an extra loop condition. With assert-level > 0 the
    assumption is checked at runtime.
    
    Suggested-by: Frank Plowman <[email protected]>
    Signed-off-by: lusoris <[email protected]>
---
 libavcodec/vvc/intra_template.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/vvc/intra_template.c b/libavcodec/vvc/intra_template.c
index 3ec6c72213..0e8da24ac1 100644
--- a/libavcodec/vvc/intra_template.c
+++ b/libavcodec/vvc/intra_template.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/avassert.h"
 #include "libavcodec/bit_depth_template.c"
 
 #include "intra.h"
@@ -526,6 +527,8 @@ do {                                  \
     top_available = ff_vvc_get_top_available(lc, x, y, unfilter_top_size, 
c_idx);
     memcpy(top, src + ref_line * stride, top_available * sizeof(pixel));
 
+    av_assume(ref_line >= -4);
+
     for (int i = -1; i >= ref_line; i--) {
         if (cand_up_left) {
             left[i] = POS(ref_line, i);

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

Reply via email to