diff options
author | James Almer <jamrial@gmail.com> | 2023-11-22 16:41:00 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2023-11-22 18:33:00 -0300 |
commit | 567c67c6c8cb9be083f56198bfa979e4bda84c99 (patch) | |
tree | f7a0b62ad4029b149be2b22c0838e4ec47bb8249 | |
parent | 4af412be7153405e43930ac73fc7d91d7ded19eb (diff) | |
download | ffmpeg-567c67c6c8cb9be083f56198bfa979e4bda84c99.tar.gz |
avcodec/ac3dsp: make len a size_t in float_to_fixed24
Should simplify asm implementations, and prevent UB on at least win64.
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavcodec/ac3dsp.c | 2 | ||||
-rw-r--r-- | libavcodec/ac3dsp.h | 2 | ||||
-rw-r--r-- | libavcodec/arm/ac3dsp_init_arm.c | 2 | ||||
-rw-r--r-- | libavcodec/mips/ac3dsp_mips.c | 2 | ||||
-rw-r--r-- | libavcodec/x86/ac3dsp_init.c | 2 |
5 files changed, 5 insertions, 5 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 a01bff3d11..9996ef19ec 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 43b3b4ac85..472d39fa5e 100644 --- a/libavcodec/x86/ac3dsp_init.c +++ b/libavcodec/x86/ac3dsp_init.c @@ -26,7 +26,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_sse2 (int32_t *dst, const float *src, size_t len); int ff_ac3_compute_mantissa_size_sse2(uint16_t mant_cnt[6][16]); |