* [FFmpeg-devel] [PATCH 1/3] x86/ac3dsp: reduce instruction count inside the float_to_fixed24 loop
@ 2023-11-22 19:49 James Almer
2023-11-22 19:49 ` [FFmpeg-devel] [PATCH 2/3] x86/ac3dsp: add ff_float_to_fixed24_avx2() James Almer
2023-11-22 19:49 ` [FFmpeg-devel] [PATCH 3/3] avcodec/ac3dsp: make len a size_t in float_to_fixed24 James Almer
0 siblings, 2 replies; 11+ messages in thread
From: James Almer @ 2023-11-22 19:49 UTC (permalink / raw)
To: ffmpeg-devel
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/x86/ac3dsp.asm | 46 +++++++++++++++++++--------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
index a95d359d95..42c8310462 100644
--- a/libavcodec/x86/ac3dsp.asm
+++ b/libavcodec/x86/ac3dsp.asm
@@ -77,16 +77,20 @@ AC3_EXPONENT_MIN
INIT_XMM sse2
cglobal float_to_fixed24, 3, 3, 9, dst, src, len
movaps m0, [pf_1_24]
+ shl lenq, 2
+ add srcq, lenq
+ add dstq, lenq
+ neg lenq
.loop:
- movaps m1, [srcq ]
- movaps m2, [srcq+16 ]
- movaps m3, [srcq+32 ]
- movaps m4, [srcq+48 ]
+ movaps m1, [srcq+lenq ]
+ movaps m2, [srcq+lenq+16 ]
+ movaps m3, [srcq+lenq+32 ]
+ movaps m4, [srcq+lenq+48 ]
%ifdef m8
- movaps m5, [srcq+64 ]
- movaps m6, [srcq+80 ]
- movaps m7, [srcq+96 ]
- movaps m8, [srcq+112]
+ movaps m5, [srcq+lenq+64 ]
+ movaps m6, [srcq+lenq+80 ]
+ movaps m7, [srcq+lenq+96 ]
+ movaps m8, [srcq+lenq+112]
%endif
mulps m1, m0
mulps m2, m0
@@ -108,24 +112,20 @@ cglobal float_to_fixed24, 3, 3, 9, dst, src, len
cvtps2dq m7, m7
cvtps2dq m8, m8
%endif
- movdqa [dstq ], m1
- movdqa [dstq+16 ], m2
- movdqa [dstq+32 ], m3
- movdqa [dstq+48 ], m4
+ movdqa [dstq+lenq ], m1
+ movdqa [dstq+lenq+16 ], m2
+ movdqa [dstq+lenq+32 ], m3
+ movdqa [dstq+lenq+48 ], m4
%ifdef m8
- movdqa [dstq+64 ], m5
- movdqa [dstq+80 ], m6
- movdqa [dstq+96 ], m7
- movdqa [dstq+112], m8
- add srcq, 128
- add dstq, 128
- sub lenq, 32
+ movdqa [dstq+lenq+64 ], m5
+ movdqa [dstq+lenq+80 ], m6
+ movdqa [dstq+lenq+96 ], m7
+ movdqa [dstq+lenq+112], m8
+ add lenq, 128
%else
- add srcq, 64
- add dstq, 64
- sub lenq, 16
+ add lenq, 64
%endif
- ja .loop
+ jl .loop
RET
;------------------------------------------------------------------------------
--
2.42.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH 2/3] x86/ac3dsp: add ff_float_to_fixed24_avx2()
2023-11-22 19:49 [FFmpeg-devel] [PATCH 1/3] x86/ac3dsp: reduce instruction count inside the float_to_fixed24 loop James Almer
@ 2023-11-22 19:49 ` James Almer
2023-11-23 6:56 ` Kieran Kunhya
2023-11-22 19:49 ` [FFmpeg-devel] [PATCH 3/3] avcodec/ac3dsp: make len a size_t in float_to_fixed24 James Almer
1 sibling, 1 reply; 11+ messages in thread
From: James Almer @ 2023-11-22 19:49 UTC (permalink / raw)
To: ffmpeg-devel
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/ac3dsp.h | 4 ++--
libavcodec/ac3enc_template.c | 2 +-
libavcodec/x86/ac3dsp.asm | 28 ++++++++++++++++++++++++++--
libavcodec/x86/ac3dsp_init.c | 4 ++++
4 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/libavcodec/ac3dsp.h b/libavcodec/ac3dsp.h
index a01bff3d11..25341f3396 100644
--- a/libavcodec/ac3dsp.h
+++ b/libavcodec/ac3dsp.h
@@ -47,9 +47,9 @@ typedef struct AC3DSPContext {
* [-(1<<24),(1<<24)]
*
* @param dst destination array of int32_t.
- * constraints: 16-byte aligned
+ * constraints: 32-byte aligned
* @param src source array of float.
- * constraints: 16-byte aligned
+ * constraints: 32-byte aligned
* @param len number of elements to convert.
* constraints: multiple of 32 greater than zero
*/
diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c
index be4ecebc9c..a16faea681 100644
--- a/libavcodec/ac3enc_template.c
+++ b/libavcodec/ac3enc_template.c
@@ -112,7 +112,7 @@ static void apply_channel_coupling(AC3EncodeContext *s)
{
LOCAL_ALIGNED_16(CoefType, cpl_coords, [AC3_MAX_BLOCKS], [AC3_MAX_CHANNELS][16]);
#if AC3ENC_FLOAT
- LOCAL_ALIGNED_16(int32_t, fixed_cpl_coords, [AC3_MAX_BLOCKS], [AC3_MAX_CHANNELS][16]);
+ LOCAL_ALIGNED_32(int32_t, fixed_cpl_coords, [AC3_MAX_BLOCKS], [AC3_MAX_CHANNELS][16]);
#else
int32_t (*fixed_cpl_coords)[AC3_MAX_CHANNELS][16] = cpl_coords;
#endif
diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
index 42c8310462..e31c58e1c1 100644
--- a/libavcodec/x86/ac3dsp.asm
+++ b/libavcodec/x86/ac3dsp.asm
@@ -21,10 +21,10 @@
%include "libavutil/x86/x86util.asm"
-SECTION_RODATA
+SECTION_RODATA 32
; 16777216.0f - used in ff_float_to_fixed24()
-pf_1_24: times 4 dd 0x4B800000
+pf_1_24: times 8 dd 0x4B800000
; used in ff_ac3_compute_mantissa_size()
cextern ac3_bap_bits
@@ -128,6 +128,30 @@ cglobal float_to_fixed24, 3, 3, 9, dst, src, len
jl .loop
RET
+INIT_YMM avx2
+cglobal float_to_fixed24, 3, 3, 5, dst, src, len
+ movaps m0, [pf_1_24]
+ shl lenq, 2
+ add srcq, lenq
+ add dstq, lenq
+ neg lenq
+.loop:
+ mulps m1, m0, [srcq+lenq+mmsize*0]
+ mulps m2, m0, [srcq+lenq+mmsize*1]
+ mulps m3, m0, [srcq+lenq+mmsize*2]
+ mulps m4, m0, [srcq+lenq+mmsize*3]
+ cvtps2dq m1, m1
+ cvtps2dq m2, m2
+ cvtps2dq m3, m3
+ cvtps2dq m4, m4
+ movdqa [dstq+lenq+mmsize*0], m1
+ movdqa [dstq+lenq+mmsize*1], m2
+ movdqa [dstq+lenq+mmsize*2], m3
+ movdqa [dstq+lenq+mmsize*3], m4
+ add lenq, mmsize*4
+ jl .loop
+ RET
+
;------------------------------------------------------------------------------
; int ff_ac3_compute_mantissa_size(uint16_t mant_cnt[6][16])
;------------------------------------------------------------------------------
diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
index 43b3b4ac85..106121b5b9 100644
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/libavcodec/x86/ac3dsp_init.c
@@ -27,6 +27,7 @@
void ff_ac3_exponent_min_sse2 (uint8_t *exp, int num_reuse_blocks, int nb_coefs);
void ff_float_to_fixed24_sse2 (int32_t *dst, const float *src, unsigned int len);
+void ff_float_to_fixed24_avx2 (int32_t *dst, const float *src, unsigned int len);
int ff_ac3_compute_mantissa_size_sse2(uint16_t mant_cnt[6][16]);
@@ -48,6 +49,9 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
if (!(cpu_flags & AV_CPU_FLAG_ATOM))
c->extract_exponents = ff_ac3_extract_exponents_ssse3;
}
+ if (EXTERNAL_AVX2_FAST(cpu_flags)) {
+ c->float_to_fixed24 = ff_float_to_fixed24_avx2;
+ }
}
#define DOWNMIX_FUNC_OPT(ch, opt) \
--
2.42.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH 3/3] avcodec/ac3dsp: make len a size_t in float_to_fixed24
2023-11-22 19:49 [FFmpeg-devel] [PATCH 1/3] x86/ac3dsp: reduce instruction count inside the float_to_fixed24 loop James Almer
2023-11-22 19:49 ` [FFmpeg-devel] [PATCH 2/3] x86/ac3dsp: add ff_float_to_fixed24_avx2() James Almer
@ 2023-11-22 19:49 ` James Almer
2023-11-22 20:05 ` Rémi Denis-Courmont
2023-11-24 21:01 ` Michael Niedermayer
1 sibling, 2 replies; 11+ messages in thread
From: James Almer @ 2023-11-22 19:49 UTC (permalink / raw)
To: ffmpeg-devel
Should simplify asm implementations, and prevent UB on at least win64.
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/ac3dsp.c | 2 +-
libavcodec/ac3dsp.h | 2 +-
libavcodec/arm/ac3dsp_init_arm.c | 2 +-
libavcodec/mips/ac3dsp_mips.c | 2 +-
libavcodec/x86/ac3dsp_init.c | 4 ++--
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libavcodec/ac3dsp.c b/libavcodec/ac3dsp.c
index 302b786b15..8397e03d32 100644
--- a/libavcodec/ac3dsp.c
+++ b/libavcodec/ac3dsp.c
@@ -54,7 +54,7 @@ static void ac3_exponent_min_c(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
}
}
-static void float_to_fixed24_c(int32_t *dst, const float *src, unsigned int len)
+static void float_to_fixed24_c(int32_t *dst, const float *src, size_t len)
{
const float scale = 1 << 24;
do {
diff --git a/libavcodec/ac3dsp.h b/libavcodec/ac3dsp.h
index 25341f3396..ec2f598451 100644
--- a/libavcodec/ac3dsp.h
+++ b/libavcodec/ac3dsp.h
@@ -53,7 +53,7 @@ typedef struct AC3DSPContext {
* @param len number of elements to convert.
* constraints: multiple of 32 greater than zero
*/
- void (*float_to_fixed24)(int32_t *dst, const float *src, unsigned int len);
+ void (*float_to_fixed24)(int32_t *dst, const float *src, size_t len);
/**
* Calculate bit allocation pointers.
diff --git a/libavcodec/arm/ac3dsp_init_arm.c b/libavcodec/arm/ac3dsp_init_arm.c
index a64aa6ae82..ae989069c9 100644
--- a/libavcodec/arm/ac3dsp_init_arm.c
+++ b/libavcodec/arm/ac3dsp_init_arm.c
@@ -26,7 +26,7 @@
#include "config.h"
void ff_ac3_exponent_min_neon(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
-void ff_float_to_fixed24_neon(int32_t *dst, const float *src, unsigned int len);
+void ff_float_to_fixed24_neon(int32_t *dst, const float *src, size_t len);
void ff_ac3_extract_exponents_neon(uint8_t *exp, int32_t *coef, int nb_coefs);
void ff_ac3_sum_square_butterfly_int32_neon(int64_t sum[4],
const int32_t *coef0,
diff --git a/libavcodec/mips/ac3dsp_mips.c b/libavcodec/mips/ac3dsp_mips.c
index a5eaaf8eb2..3ea3acc185 100644
--- a/libavcodec/mips/ac3dsp_mips.c
+++ b/libavcodec/mips/ac3dsp_mips.c
@@ -203,7 +203,7 @@ static void ac3_update_bap_counts_mips(uint16_t mant_cnt[16], uint8_t *bap,
#if HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
-static void float_to_fixed24_mips(int32_t *dst, const float *src, unsigned int len)
+static void float_to_fixed24_mips(int32_t *dst, const float *src, size_t len)
{
const float scale = 1 << 24;
float src0, src1, src2, src3, src4, src5, src6, src7;
diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
index 106121b5b9..baa2bea3a4 100644
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/libavcodec/x86/ac3dsp_init.c
@@ -26,8 +26,8 @@
void ff_ac3_exponent_min_sse2 (uint8_t *exp, int num_reuse_blocks, int nb_coefs);
-void ff_float_to_fixed24_sse2 (int32_t *dst, const float *src, unsigned int len);
-void ff_float_to_fixed24_avx2 (int32_t *dst, const float *src, unsigned int len);
+void ff_float_to_fixed24_sse2 (int32_t *dst, const float *src, size_t len);
+void ff_float_to_fixed24_avx2 (int32_t *dst, const float *src, size_t len);
int ff_ac3_compute_mantissa_size_sse2(uint16_t mant_cnt[6][16]);
--
2.42.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/3] avcodec/ac3dsp: make len a size_t in float_to_fixed24
2023-11-22 19:49 ` [FFmpeg-devel] [PATCH 3/3] avcodec/ac3dsp: make len a size_t in float_to_fixed24 James Almer
@ 2023-11-22 20:05 ` Rémi Denis-Courmont
2023-11-24 21:01 ` Michael Niedermayer
1 sibling, 0 replies; 11+ messages in thread
From: Rémi Denis-Courmont @ 2023-11-22 20:05 UTC (permalink / raw)
To: ffmpeg-devel
Le keskiviikkona 22. marraskuuta 2023, 21.49.13 EET James Almer a écrit :
> Should simplify asm implementations, and prevent UB on at least win64.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
This one looks good to me, but I am utterly incompetent for the previous two.
--
雷米‧德尼-库尔蒙
http://www.remlab.net/
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/3] x86/ac3dsp: add ff_float_to_fixed24_avx2()
2023-11-22 19:49 ` [FFmpeg-devel] [PATCH 2/3] x86/ac3dsp: add ff_float_to_fixed24_avx2() James Almer
@ 2023-11-23 6:56 ` Kieran Kunhya
2023-11-23 11:51 ` James Almer
0 siblings, 1 reply; 11+ messages in thread
From: Kieran Kunhya @ 2023-11-23 6:56 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, 22 Nov 2023, 19:49 James Almer, <jamrial@gmail.com> wrote:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> libavcodec/ac3dsp.h | 4 ++--
> libavcodec/ac3enc_template.c | 2 +-
> libavcodec/x86/ac3dsp.asm | 28 ++++++++++++++++++++++++++--
> libavcodec/x86/ac3dsp_init.c | 4 ++++
> 4 files changed, 33 insertions(+), 5 deletions(-)
>
I think this is AVX, I might be wrong but I don't see any AVX2.
Kieran
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/3] x86/ac3dsp: add ff_float_to_fixed24_avx2()
2023-11-23 6:56 ` Kieran Kunhya
@ 2023-11-23 11:51 ` James Almer
2023-11-23 15:19 ` Henrik Gramner via ffmpeg-devel
0 siblings, 1 reply; 11+ messages in thread
From: James Almer @ 2023-11-23 11:51 UTC (permalink / raw)
To: ffmpeg-devel
On 11/23/2023 3:56 AM, Kieran Kunhya wrote:
> On Wed, 22 Nov 2023, 19:49 James Almer, <jamrial@gmail.com> wrote:
>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>> libavcodec/ac3dsp.h | 4 ++--
>> libavcodec/ac3enc_template.c | 2 +-
>> libavcodec/x86/ac3dsp.asm | 28 ++++++++++++++++++++++++++--
>> libavcodec/x86/ac3dsp_init.c | 4 ++++
>> 4 files changed, 33 insertions(+), 5 deletions(-)
>>
>
> I think this is AVX, I might be wrong but I don't see any AVX2.
>
> Kieran
movdqa wiht ymm is avx2. I could change it to movaps, but technically
the registers contain floats and i don't know if any old AVX cpu has
penalties for changing domains.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/3] x86/ac3dsp: add ff_float_to_fixed24_avx2()
2023-11-23 11:51 ` James Almer
@ 2023-11-23 15:19 ` Henrik Gramner via ffmpeg-devel
0 siblings, 0 replies; 11+ messages in thread
From: Henrik Gramner via ffmpeg-devel @ 2023-11-23 15:19 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Henrik Gramner
On Thu, Nov 23, 2023 at 12:51 PM James Almer <jamrial@gmail.com> wrote:
> movdqa wiht ymm is avx2. I could change it to movaps, but technically
> the registers contain floats and i don't know if any old AVX cpu has
> penalties for changing domains.
Fwiw I believe what domain the result of fp <-> int conversion
instructions belongs to actually differs between µarchs. Realistically
whether movaps or movdqa is used to store the result to memory is
unlikely to matter in practice though.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/3] avcodec/ac3dsp: make len a size_t in float_to_fixed24
2023-11-22 19:49 ` [FFmpeg-devel] [PATCH 3/3] avcodec/ac3dsp: make len a size_t in float_to_fixed24 James Almer
2023-11-22 20:05 ` Rémi Denis-Courmont
@ 2023-11-24 21:01 ` Michael Niedermayer
2023-11-24 21:03 ` James Almer
1 sibling, 1 reply; 11+ messages in thread
From: Michael Niedermayer @ 2023-11-24 21:01 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1325 bytes --]
On Wed, Nov 22, 2023 at 04:49:13PM -0300, James Almer wrote:
> Should simplify asm implementations, and prevent UB on at least win64.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> libavcodec/ac3dsp.c | 2 +-
> libavcodec/ac3dsp.h | 2 +-
> libavcodec/arm/ac3dsp_init_arm.c | 2 +-
> libavcodec/mips/ac3dsp_mips.c | 2 +-
> libavcodec/x86/ac3dsp_init.c | 4 ++--
> 5 files changed, 6 insertions(+), 6 deletions(-)
In file included from src/libavcodec/mips/ac3dsp_mips.c:57:0:
src/libavcodec/ac3dsp.h:56:62: error: unknown type name ‘size_t’; did you mean ‘__ssize_t’?
void (*float_to_fixed24)(int32_t *dst, const float *src, size_t len);
^~~~~~
__ssize_t
src/ffbuild/common.mak:81: recipe for target 'libavcodec/mips/ac3dsp_mips.o' failed
make: *** [libavcodec/mips/ac3dsp_mips.o] Error 1
make: *** Waiting for unfinished jobs....
mips FAIL
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/3] avcodec/ac3dsp: make len a size_t in float_to_fixed24
2023-11-24 21:01 ` Michael Niedermayer
@ 2023-11-24 21:03 ` James Almer
2023-11-24 23:49 ` Michael Niedermayer
2023-11-26 10:29 ` Anton Khirnov
0 siblings, 2 replies; 11+ messages in thread
From: James Almer @ 2023-11-24 21:03 UTC (permalink / raw)
To: ffmpeg-devel
On 11/24/2023 6:01 PM, Michael Niedermayer wrote:
> On Wed, Nov 22, 2023 at 04:49:13PM -0300, James Almer wrote:
>> Should simplify asm implementations, and prevent UB on at least win64.
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>> libavcodec/ac3dsp.c | 2 +-
>> libavcodec/ac3dsp.h | 2 +-
>> libavcodec/arm/ac3dsp_init_arm.c | 2 +-
>> libavcodec/mips/ac3dsp_mips.c | 2 +-
>> libavcodec/x86/ac3dsp_init.c | 4 ++--
>> 5 files changed, 6 insertions(+), 6 deletions(-)
>
> In file included from src/libavcodec/mips/ac3dsp_mips.c:57:0:
> src/libavcodec/ac3dsp.h:56:62: error: unknown type name ‘size_t’; did you mean ‘__ssize_t’?
> void (*float_to_fixed24)(int32_t *dst, const float *src, size_t len);
> ^~~~~~
> __ssize_t
> src/ffbuild/common.mak:81: recipe for target 'libavcodec/mips/ac3dsp_mips.o' failed
> make: *** [libavcodec/mips/ac3dsp_mips.o] Error 1
> make: *** Waiting for unfinished jobs....
> mips FAIL
Do you know where is size_t defined for this target? stddef.h?
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/3] avcodec/ac3dsp: make len a size_t in float_to_fixed24
2023-11-24 21:03 ` James Almer
@ 2023-11-24 23:49 ` Michael Niedermayer
2023-11-26 10:29 ` Anton Khirnov
1 sibling, 0 replies; 11+ messages in thread
From: Michael Niedermayer @ 2023-11-24 23:49 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1592 bytes --]
On Fri, Nov 24, 2023 at 06:03:29PM -0300, James Almer wrote:
> On 11/24/2023 6:01 PM, Michael Niedermayer wrote:
> > On Wed, Nov 22, 2023 at 04:49:13PM -0300, James Almer wrote:
> > > Should simplify asm implementations, and prevent UB on at least win64.
> > >
> > > Signed-off-by: James Almer <jamrial@gmail.com>
> > > ---
> > > libavcodec/ac3dsp.c | 2 +-
> > > libavcodec/ac3dsp.h | 2 +-
> > > libavcodec/arm/ac3dsp_init_arm.c | 2 +-
> > > libavcodec/mips/ac3dsp_mips.c | 2 +-
> > > libavcodec/x86/ac3dsp_init.c | 4 ++--
> > > 5 files changed, 6 insertions(+), 6 deletions(-)
> >
> > In file included from src/libavcodec/mips/ac3dsp_mips.c:57:0:
> > src/libavcodec/ac3dsp.h:56:62: error: unknown type name ‘size_t’; did you mean ‘__ssize_t’?
> > void (*float_to_fixed24)(int32_t *dst, const float *src, size_t len);
> > ^~~~~~
> > __ssize_t
> > src/ffbuild/common.mak:81: recipe for target 'libavcodec/mips/ac3dsp_mips.o' failed
> > make: *** [libavcodec/mips/ac3dsp_mips.o] Error 1
> > make: *** Waiting for unfinished jobs....
> > mips FAIL
>
> Do you know where is size_t defined for this target? stddef.h?
stddef.h fixes it, yes!
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/3] avcodec/ac3dsp: make len a size_t in float_to_fixed24
2023-11-24 21:03 ` James Almer
2023-11-24 23:49 ` Michael Niedermayer
@ 2023-11-26 10:29 ` Anton Khirnov
1 sibling, 0 replies; 11+ messages in thread
From: Anton Khirnov @ 2023-11-26 10:29 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting James Almer (2023-11-24 22:03:29)
> On 11/24/2023 6:01 PM, Michael Niedermayer wrote:
> > On Wed, Nov 22, 2023 at 04:49:13PM -0300, James Almer wrote:
> >> Should simplify asm implementations, and prevent UB on at least win64.
> >>
> >> Signed-off-by: James Almer <jamrial@gmail.com>
> >> ---
> >> libavcodec/ac3dsp.c | 2 +-
> >> libavcodec/ac3dsp.h | 2 +-
> >> libavcodec/arm/ac3dsp_init_arm.c | 2 +-
> >> libavcodec/mips/ac3dsp_mips.c | 2 +-
> >> libavcodec/x86/ac3dsp_init.c | 4 ++--
> >> 5 files changed, 6 insertions(+), 6 deletions(-)
> >
> > In file included from src/libavcodec/mips/ac3dsp_mips.c:57:0:
> > src/libavcodec/ac3dsp.h:56:62: error: unknown type name ‘size_t’; did you mean ‘__ssize_t’?
> > void (*float_to_fixed24)(int32_t *dst, const float *src, size_t len);
> > ^~~~~~
> > __ssize_t
> > src/ffbuild/common.mak:81: recipe for target 'libavcodec/mips/ac3dsp_mips.o' failed
> > make: *** [libavcodec/mips/ac3dsp_mips.o] Error 1
> > make: *** Waiting for unfinished jobs....
> > mips FAIL
>
> Do you know where is size_t defined for this target? stddef.h?
size_t should _always_ be defined in stddef.h, as per C99 7.17.2
--
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-11-26 10:30 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-22 19:49 [FFmpeg-devel] [PATCH 1/3] x86/ac3dsp: reduce instruction count inside the float_to_fixed24 loop James Almer
2023-11-22 19:49 ` [FFmpeg-devel] [PATCH 2/3] x86/ac3dsp: add ff_float_to_fixed24_avx2() James Almer
2023-11-23 6:56 ` Kieran Kunhya
2023-11-23 11:51 ` James Almer
2023-11-23 15:19 ` Henrik Gramner via ffmpeg-devel
2023-11-22 19:49 ` [FFmpeg-devel] [PATCH 3/3] avcodec/ac3dsp: make len a size_t in float_to_fixed24 James Almer
2023-11-22 20:05 ` Rémi Denis-Courmont
2023-11-24 21:01 ` Michael Niedermayer
2023-11-24 21:03 ` James Almer
2023-11-24 23:49 ` Michael Niedermayer
2023-11-26 10:29 ` Anton Khirnov
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git