From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id 2070E4D915
	for <ffmpegdev@gitmailbox.com>; Mon, 21 Apr 2025 07:04:02 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 51722687D96;
	Mon, 21 Apr 2025 10:03:56 +0300 (EEST)
Received: from out162-62-57-210.mail.qq.com (out162-62-57-210.mail.qq.com
 [162.62.57.210])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2D206687C1E
 for <ffmpeg-devel@ffmpeg.org>; Mon, 21 Apr 2025 10:03:48 +0300 (EEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com;
 s=s201512; t=1745219018;
 bh=w13EBJ0jAH1ROhzR5JNcgR1HxN6ykgZe6EUjFeGuXHs=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To;
 b=hMnEU84PMZGYY94lUNGY6t7CRdodw05p+sI5Ywl91FTVuv0T7yVq+BA+wS3Y2ph+D
 h2louXr9UlgTQm9IrBp2YPmPtKZ8JFDGnZgcAVRgkpdf+p513Q8wuss/OHd+x9/HDM
 P2SplfmENoZfXhuQgX/TCe8wI6ZLQZwnsEfXVDq0=
Received: from smtpclient.apple ([119.147.10.242])
 by newxmesmtplogicsvrszb20-0.qq.com (NewEsmtp) with SMTP
 id E58547D; Mon, 21 Apr 2025 15:03:37 +0800
X-QQ-mid: xmsmtpt1745219017tha8ymi1o
Message-ID: <tencent_B2336B55C62905CEB8654B731BE84F73F705@qq.com>
X-QQ-XMAILINFO: OVAgSpUT8SOPwXkWuNx/D3RNlT00ClBbx0xUT3wptx/kG5YDE7AICIKAewuJCP
 NQhAAFkxI9tC8XZkGtoVsfd40Wd5CpaXDID3Gze1a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Mail 16.0 \(3826.400.131.1.6\))
From: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org>
In-Reply-To: <20250421060452.4014124-1-hiccupzhu@gmail.com>
Date: Mon, 21 Apr 2025 15:03:27 +0800
X-OQ-MSGID: <BFBCE935-DB71-4516-A304-7FB566AB002A@foxmail.com>
References: <20250421060452.4014124-1-hiccupzhu@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
X-Mailer: Apple Mail (2.3826.400.131.1.6)
Subject: Re: [FFmpeg-devel] [PATCH] avfilter/volume: optimize redundant code
 for af_volume
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Shiqi Zhu <hiccupzhu@gmail.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/tencent_B2336B55C62905CEB8654B731BE84F73F705@qq.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>



> On Apr 21, 2025, at 14:04, Shiqi Zhu <hiccupzhu@gmail.com> wrote:
> 
> Signed-off-by: Shiqi Zhu <hiccupzhu@gmail.com>
> ---
> libavfilter/af_volume.c | 18 ++++++------------
> 1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c
> index 471bffeceb..c16188524d 100644
> --- a/libavfilter/af_volume.c
> +++ b/libavfilter/af_volume.c
> @@ -178,34 +178,28 @@ static inline void scale_samples_u8_small(uint8_t *dst, const uint8_t *src,
>         dst[i] = av_clip_uint8((((src[i] - 128) * volume + 128) >> 8) + 128);
> }
> 
> -static inline void scale_samples_s16(uint8_t *dst, const uint8_t *src,
> +static inline void scale_samples_s16(int16_t *dst, const int16_t *src,
>                                      int nb_samples, int volume)
> {
>     int i;
> -    int16_t *smp_dst       = (int16_t *)dst;
> -    const int16_t *smp_src = (const int16_t *)src;
>     for (i = 0; i < nb_samples; i++)
> -        smp_dst[i] = av_clip_int16(((int64_t)smp_src[i] * volume + 128) >> 8);
> +        dst[i] = av_clip_int16(((int64_t)src[i] * volume + 128) >> 8);
> }
> 
> -static inline void scale_samples_s16_small(uint8_t *dst, const uint8_t *src,
> +static inline void scale_samples_s16_small(int16_t *dst, const int16_t *src,
>                                            int nb_samples, int volume)
> {
>     int i;
> -    int16_t *smp_dst       = (int16_t *)dst;
> -    const int16_t *smp_src = (const int16_t *)src;
>     for (i = 0; i < nb_samples; i++)
> -        smp_dst[i] = av_clip_int16((smp_src[i] * volume + 128) >> 8);
> +        dst[i] = av_clip_int16((src[i] * volume + 128) >> 8);
> }
> 
> -static inline void scale_samples_s32(uint8_t *dst, const uint8_t *src,
> +static inline void scale_samples_s32(int32_t *dst, const int32_t *src,
>                                      int nb_samples, int volume)
> {
>     int i;
> -    int32_t *smp_dst       = (int32_t *)dst;
> -    const int32_t *smp_src = (const int32_t *)src;
>     for (i = 0; i < nb_samples; i++)
> -        smp_dst[i] = av_clipl_int32((((int64_t)smp_src[i] * volume + 128) >> 8));
> +        dst[i] = av_clipl_int32((((int64_t)src[i] * volume + 128) >> 8));
> }
> 
> static av_cold void volume_init(VolumeContext *vol)

NAK. They are incompatible function pointer types.

> -- 
> 2.34.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".

_______________________________________________
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".