diff mbox series

[FFmpeg-devel,6/9] avcodec/me_cmp: Mark ff_square_tab as hidden

Message ID GV1P250MB0737F66CF274D44BCE7B17738F5C9@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit b9133bce0447bee9f5b4052c1467eb6908214acb
Headers show
Series None | expand

Commit Message

Andreas Rheinhardt Oct. 6, 2022, 12:57 a.m. UTC
ff_square_tab is always used with an offset; if this table
is marked as hidden, the compiler can infer that it and
therefore also ff_square_tab + 256 have a fixed offset
from the code. This allows to avoid performing "+ 256"
at runtime by baking it into the offset from the code to
the table.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/me_cmp.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/me_cmp.h b/libavcodec/me_cmp.h
index c6de2d0061..90ea76c891 100644
--- a/libavcodec/me_cmp.h
+++ b/libavcodec/me_cmp.h
@@ -21,9 +21,11 @@ 
 
 #include <stdint.h>
 
+#include "libavutil/attributes_internal.h"
+
 #include "avcodec.h"
 
-extern const uint32_t ff_square_tab[512];
+extern const uint32_t attribute_visibility_hidden ff_square_tab[512];
 
 
 /* minimum alignment rules ;)