diff mbox series

[FFmpeg-devel,1/3] lavc/jpeg2000dsp: make coefficients extern

Message ID 20231028190455.64807-1-remi@remlab.net
State Accepted
Commit b2a441a3bed281a74b7fced77ef974897e407e32
Headers show
Series [FFmpeg-devel,1/3] lavc/jpeg2000dsp: make coefficients extern | expand

Checks

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

Commit Message

Rémi Denis-Courmont Oct. 28, 2023, 7:04 p.m. UTC
This is so that they can be loaded from assembler, rather than
duplicated.
---
 libavcodec/jpeg2000dsp.c | 3 ++-
 libavcodec/jpeg2000dsp.h | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Tomas Härdin Oct. 30, 2023, 12:33 p.m. UTC | #1
lör 2023-10-28 klockan 22:04 +0300 skrev Rémi Denis-Courmont:
> This is so that they can be loaded from assembler, rather than
> duplicated.

Is loading these constants via immediates slower than the indirect load
that the patchset does?

/Tomas
diff mbox series

Patch

diff --git a/libavcodec/jpeg2000dsp.c b/libavcodec/jpeg2000dsp.c
index b1bff6d5b1..50bc1ecee6 100644
--- a/libavcodec/jpeg2000dsp.c
+++ b/libavcodec/jpeg2000dsp.c
@@ -26,7 +26,7 @@ 
 
 /* Inverse ICT parameters in float and integer.
  * int value = (float value) * (1<<16) */
-static const float f_ict_params[4] = {
+const float ff_jpeg2000_f_ict_params[4] = {
     1.402f,
     0.34413f,
     0.71414f,
@@ -42,6 +42,7 @@  static const int i_ict_params[4] = {
 
 static void ict_float(void *_src0, void *_src1, void *_src2, int csize)
 {
+    const float *const f_ict_params = ff_jpeg2000_f_ict_params;
     float *src0 = _src0, *src1 = _src1, *src2 = _src2;
     float i0f, i1f, i2f;
     int i;
diff --git a/libavcodec/jpeg2000dsp.h b/libavcodec/jpeg2000dsp.h
index 1ae5b95d9a..932dbb2102 100644
--- a/libavcodec/jpeg2000dsp.h
+++ b/libavcodec/jpeg2000dsp.h
@@ -30,6 +30,8 @@  typedef struct Jpeg2000DSPContext {
     void (*mct_decode[FF_DWT_NB])(void *src0, void *src1, void *src2, int csize);
 } Jpeg2000DSPContext;
 
+extern const float ff_jpeg2000_f_ict_params[4];
+
 void ff_jpeg2000dsp_init(Jpeg2000DSPContext *c);
 void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c);