Message ID | AS8P250MB0744823B63EA7771474B5C328F7A9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM |
---|---|
State | Accepted |
Commit | 0b95a6a1d0b3d9c06aedd5fc929804661addd263 |
Headers | show |
Series | [FFmpeg-devel] avcodec/mathops: Set hidden visibility where advantageous | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
On Sat, 3 Sep 2022, Andreas Rheinhardt wrote: > It is advantageous for ff_crop_tab, as the base pointer used to > access this table is not the first element of it. But the real > base pointer is still at a constant offset from the code/the GOT > and can therefore be accessed relative to the instruction pointer > (if supported by the arch) or relative to the GOT; without this, > one has to first load address of ff_crop_tab (potentially via > the GOT) and then offset manually (which is what the earlier code > did). > > Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> > --- > libavcodec/mathops.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h > index f81d21f9c4..c89054d6ed 100644 > --- a/libavcodec/mathops.h > +++ b/libavcodec/mathops.h > @@ -24,6 +24,7 @@ > > #include <stdint.h> > > +#include "libavutil/attributes_internal.h" > #include "libavutil/common.h" > #include "config.h" > > @@ -32,7 +33,7 @@ > extern const uint32_t ff_inverse[257]; > extern const uint8_t ff_log2_run[41]; > extern const uint8_t ff_sqrt_tab[256]; > -extern const uint8_t ff_crop_tab[256 + 2 * MAX_NEG_CROP]; > +extern const uint8_t attribute_visibility_hidden ff_crop_tab[256 + 2 * MAX_NEG_CROP]; > extern const uint8_t ff_zigzag_direct[64]; > extern const uint8_t ff_zigzag_scan[16+1]; > > -- > 2.34.1 LGTM // Martin
diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index f81d21f9c4..c89054d6ed 100644 --- a/libavcodec/mathops.h +++ b/libavcodec/mathops.h @@ -24,6 +24,7 @@ #include <stdint.h> +#include "libavutil/attributes_internal.h" #include "libavutil/common.h" #include "config.h" @@ -32,7 +33,7 @@ extern const uint32_t ff_inverse[257]; extern const uint8_t ff_log2_run[41]; extern const uint8_t ff_sqrt_tab[256]; -extern const uint8_t ff_crop_tab[256 + 2 * MAX_NEG_CROP]; +extern const uint8_t attribute_visibility_hidden ff_crop_tab[256 + 2 * MAX_NEG_CROP]; extern const uint8_t ff_zigzag_direct[64]; extern const uint8_t ff_zigzag_scan[16+1];
It is advantageous for ff_crop_tab, as the base pointer used to access this table is not the first element of it. But the real base pointer is still at a constant offset from the code/the GOT and can therefore be accessed relative to the instruction pointer (if supported by the arch) or relative to the GOT; without this, one has to first load address of ff_crop_tab (potentially via the GOT) and then offset manually (which is what the earlier code did). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/mathops.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)