From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 2CB63482CA for ; Wed, 22 Nov 2023 19:49:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AE37268CF00; Wed, 22 Nov 2023 21:49:26 +0200 (EET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1CB4368CEDE for ; Wed, 22 Nov 2023 21:49:20 +0200 (EET) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6b709048d8eso183169b3a.2 for ; Wed, 22 Nov 2023 11:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700682558; x=1701287358; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+IkSCY24xaNWzC6cxJrr9xFKp6dYWHSj0Eh2a1LB9rQ=; b=l6ioKbZLzSPtLcG1L1RFkh44uwSZ582aXH1H72yIqdC43+fqAootMBmRVN8+Pos7wj 4HcmZLTOtNSJMGeZKC2lrUO7fSTC4/bp8NTp62zcdDjVehtsrU96lSRGVrCgz5h8wDqa qP3hV01yVMIq8F+ol8DpOu9h/urv8MfcN2u7KJgkAtLJ8NpjReE2DmOD7DKyH1xEiTUk QcAVxmu9YeHJUeffgiGt9jV/kfBJb4mghirxB1EI4SPsaiuF2m0Yi2d/2whldxVOUsan UUy60E6e+kz6eCKIezs9hrVAQYVqk0GzorWT3kMMhrMJScrT1uxU75mWlDiKihjLeMgD BlHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700682558; x=1701287358; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+IkSCY24xaNWzC6cxJrr9xFKp6dYWHSj0Eh2a1LB9rQ=; b=Ay1pJ7XIOcGEMvH3hNhTytn7qnJdkEqFB1CjWmi+E2qvXAmADazTPvU+4pHdE2/KSA 7syJiOrPwv+c287ehd4tUPsQPifuzpYqHgZb+yEM7bhAYfEgtnF1zLW9VfQM/bxFNgDC 5HDFh8Eg+3niy46g14/mn/aCKoxsQOK+xjvivr1pq9d/e6GPijhyE/7BPaXRzZX5K4Xr 8fSnpvQCzYcahietmiEwrwPrSW9yvNd1IAa4MH5mVUZ3Zv/r8dU0JLwmTV+xn1hL91J/ UpKYMYcBGB3NOTCaw+hgESDt9tQV6LHk/Hob2RVbyz206oTmfoHN6iYI2I2kq3nLkK79 pQDQ== X-Gm-Message-State: AOJu0Ywl0VTNk/l1AJEn4d5lKDBfMlaTo4VPe6TM4FixLNF/WG570rg1 2HOVpvzCpDAFB+fKwYsXabME0SvggtU= X-Google-Smtp-Source: AGHT+IETrxWZHnqUwEGDp+CGdhGNjUpXCnLRC6CKQC5PhYAUvLtqBd+1zeA8Njtrgd1fv6cUHJimyA== X-Received: by 2002:a05:6a20:5483:b0:18b:5390:293a with SMTP id i3-20020a056a20548300b0018b5390293amr2586910pzk.3.1700682557818; Wed, 22 Nov 2023 11:49:17 -0800 (PST) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id h18-20020aa786d2000000b00688965c5227sm100156pfo.120.2023.11.22.11.49.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 11:49:17 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 22 Nov 2023 16:49:13 -0300 Message-ID: <20231122194913.9856-3-jamrial@gmail.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231122194913.9856-1-jamrial@gmail.com> References: <20231122194913.9856-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/ac3dsp: make len a size_t in float_to_fixed24 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Should simplify asm implementations, and prevent UB on at least win64. Signed-off-by: James Almer --- 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".