Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Tristan Matthews via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Tristan Matthews <httamt@protonmail.com>,
	Tristan Matthews <tmatth@videolan.org>
Subject: Re: [FFmpeg-devel] [PATCH] h264dsp: h264_luma_dc_dequant_idct: constify input
Date: Fri, 20 Jun 2025 17:50:48 +0000
Message-ID: <mailman.3926.1750441861.1384.ffmpeg-devel@ffmpeg.org> (raw)
In-Reply-To: <20250613200241.2994917-1-tmatth@videolan.org>

[-- Attachment #1: Type: message/rfc822, Size: 8468 bytes --]

From: Tristan Matthews <httamt@protonmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Tristan Matthews <tmatth@videolan.org>
Subject: Re: [FFmpeg-devel] [PATCH] h264dsp: h264_luma_dc_dequant_idct: constify input
Date: Fri, 20 Jun 2025 17:50:48 +0000
Message-ID: <cGpNnV4tsnYnqosZx_ftPawkaStsi7zUntbSufgT8gTrO27_V7Cbw_kLIgeSuHmk8wKP66zrKcHCTm0YsGQIQaHoMfKeq-Ll_kKHuNXVaKk=@protonmail.com>

On Friday, June 13th, 2025 at 4:03 PM, Tristan Matthews <tmatth@videolan.org> wrote:

> ---
> libavcodec/h264dsp.h | 2 +-
> libavcodec/h264idct.h | 2 +-
> libavcodec/h264idct_template.c | 2 +-
> libavcodec/loongarch/h264dsp_loongarch.h | 2 +-
> libavcodec/loongarch/h264idct.S | 2 +-
> libavcodec/mips/h264dsp_mips.h | 2 +-
> libavcodec/mips/h264dsp_mmi.c | 2 +-
> libavcodec/x86/h264_idct.asm | 2 +-
> libavcodec/x86/h264dsp_init.c | 2 +-
> 9 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/libavcodec/h264dsp.h b/libavcodec/h264dsp.h
> index 4a9cb1568d..4733288b4a 100644
> --- a/libavcodec/h264dsp.h
> +++ b/libavcodec/h264dsp.h
> @@ -100,7 +100,7 @@ typedef struct H264DSPContext {
> int16_t *block /align 16/,
> int stride, const uint8_t nnzc[5 * 8]);
> void (*h264_luma_dc_dequant_idct)(int16_t *output,
> - int16_t *input /align 16/, int qmul);
> + const int16_t *input /align 16/, int qmul);
> void (*h264_chroma_dc_dequant_idct)(int16_t block, int qmul);
> 
> / bypass-transform */
> diff --git a/libavcodec/h264idct.h b/libavcodec/h264idct.h
> index 6f18df9e5f..8e0b21561a 100644
> --- a/libavcodec/h264idct.h
> +++ b/libavcodec/h264idct.h
> @@ -31,7 +31,7 @@ void ff_h264_idct_add16intra_ ## depth ## c(uint8_t *dst, const int *blockoffse
> void ff_h264_idct8_add4 ## depth ## c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[5 * 8]);\
> void ff_h264_idct_add8_422 ## depth ## c(uint8_t **dest, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[15 * 8]);\
> void ff_h264_idct_add8 ## depth ## c(uint8_t **dest, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[15 * 8]);\
> -void ff_h264_luma_dc_dequant_idct ## depth ## c(int16_t *output, int16_t *input, int qmul);\
> +void ff_h264_luma_dc_dequant_idct ## depth ## c(int16_t *output, const int16_t *input, int qmul);\
> void ff_h264_chroma422_dc_dequant_idct ## depth ## c(int16_t *block, int qmul);\
> void ff_h264_chroma_dc_dequant_idct ## depth ## _c(int16_t block, int qmul);
> 
> diff --git a/libavcodec/h264idct_template.c b/libavcodec/h264idct_template.c
> index db19b5f9fb..72fec8253b 100644
> --- a/libavcodec/h264idct_template.c
> +++ b/libavcodec/h264idct_template.c
> @@ -248,7 +248,7 @@ void FUNCC(ff_h264_idct_add8_422)(uint8_t dest, const int *block_offset, int16
> * IDCT transforms the 16 dc values and dequantizes them.
> * @param qmul quantization parameter
> */
> -void FUNCC(ff_h264_luma_dc_dequant_idct)(int16_t *_output, int16_t *_input, int qmul){
> +void FUNCC(ff_h264_luma_dc_dequant_idct)(int16_t *_output, const int16_t *_input, int qmul){
> #define stride 16
> int i;
> int temp[16];
> diff --git a/libavcodec/loongarch/h264dsp_loongarch.h b/libavcodec/loongarch/h264dsp_loongarch.h
> index e17522dfe0..d51d27fe17 100644
> --- a/libavcodec/loongarch/h264dsp_loongarch.h
> +++ b/libavcodec/loongarch/h264dsp_loongarch.h
> @@ -30,7 +30,7 @@ void ff_h264_idct_add_8_lsx(uint8_t *dst, int16_t *src, int dst_stride);
> void ff_h264_idct8_add_8_lsx(uint8_t *dst, int16_t *src, int dst_stride);
> void ff_h264_idct_dc_add_8_lsx(uint8_t *dst, int16_t *src, int dst_stride);
> void ff_h264_idct8_dc_add_8_lsx(uint8_t *dst, int16_t *src, int dst_stride);
> -void ff_h264_luma_dc_dequant_idct_8_lsx(int16_t *_output, int16_t *_input, int qmul);
> +void ff_h264_luma_dc_dequant_idct_8_lsx(int16_t *_output, const int16_t *_input, int qmul);
> void ff_h264_idct_add16_8_lsx(uint8_t *dst, const int32_t blk_offset,
> int16_t block, int32_t dst_stride,
> const uint8_t nzc[15 * 8]);
> diff --git a/libavcodec/loongarch/h264idct.S b/libavcodec/loongarch/h264idct.S
> index f504cfb714..0c9082e20c 100644
> --- a/libavcodec/loongarch/h264idct.S
> +++ b/libavcodec/loongarch/h264idct.S
> @@ -612,7 +612,7 @@ endfunc
> /
> * IDCT transforms the 16 dc values and dequantizes them.
> * @param qmul quantization parameter
> - * void FUNCC(ff_h264_luma_dc_dequant_idct)(int16_t *_output, int16_t *_input, int qmul){
> + * void FUNCC(ff_h264_luma_dc_dequant_idct)(int16_t *_output, const int16_t *_input, int qmul){
> * LSX optimization is enough for this function.
> */
> function ff_h264_luma_dc_dequant_idct_8_lsx
> diff --git a/libavcodec/mips/h264dsp_mips.h b/libavcodec/mips/h264dsp_mips.h
> index 4a2a2c2559..0edfad4434 100644
> --- a/libavcodec/mips/h264dsp_mips.h
> +++ b/libavcodec/mips/h264dsp_mips.h
> @@ -338,7 +338,7 @@ void ff_h264_idct_add8_8_mmi(uint8_t dest, const int *block_offset,
> int16_t block, int stride, const uint8_t nnzc[158]);
> void ff_h264_idct_add8_422_8_mmi(uint8_t dest, const int *block_offset,
> int16_t block, int stride, const uint8_t nnzc[158]);
> -void ff_h264_luma_dc_dequant_idct_8_mmi(int16_t *output, int16_t *input,
> +void ff_h264_luma_dc_dequant_idct_8_mmi(int16_t *output, const int16_t *input,
> int qmul);
> 
> void ff_h264_weight_pixels16_8_mmi(uint8_t *block, ptrdiff_t stride, int height,
> diff --git a/libavcodec/mips/h264dsp_mmi.c b/libavcodec/mips/h264dsp_mmi.c
> index bae1052dcf..c1c17867fe 100644
> --- a/libavcodec/mips/h264dsp_mmi.c
> +++ b/libavcodec/mips/h264dsp_mmi.c
> @@ -857,7 +857,7 @@ void ff_h264_idct_add8_422_8_mmi(uint8_t dest, const int *block_offset,
> }
> }
> 
> -void ff_h264_luma_dc_dequant_idct_8_mmi(int16_t *output, int16_t *input,
> +void ff_h264_luma_dc_dequant_idct_8_mmi(int16_t *output, const int16_t *input,
> int qmul)
> {
> double ftmp[10];
> diff --git a/libavcodec/x86/h264_idct.asm b/libavcodec/x86/h264_idct.asm
> index d9c3c9c862..a8160b4ccc 100644
> --- a/libavcodec/x86/h264_idct.asm
> +++ b/libavcodec/x86/h264_idct.asm
> @@ -612,7 +612,7 @@ cglobal h264_idct_add8_8, 5, 7 + ARCH_X86_64, 8
> add8_sse2_cycle 3, 0x64
> RET
> 
> -;void ff_h264_luma_dc_dequant_idct_mmx(int16_t *output, int16_t *input, int qmul)
> +;void ff_h264_luma_dc_dequant_idct_mmx(int16_t *output, const int16_t *input, int qmul)
> 
> %macro WALSH4_1D 5
> SUMSUB_BADC w, %4, %3, %2, %1, %5
> diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
> index dc8fc4f720..f8cfeb965f 100644
> --- a/libavcodec/x86/h264dsp_init.c
> +++ b/libavcodec/x86/h264dsp_init.c
> @@ -76,7 +76,7 @@ IDCT_ADD_REP_FUNC2(, 8_422, 8, mmx)
> IDCT_ADD_REP_FUNC2(, 8_422, 10, sse2)
> IDCT_ADD_REP_FUNC2(, 8_422, 10, avx)
> 
> -void ff_h264_luma_dc_dequant_idct_sse2(int16_t *output, int16_t *input, int qmul);
> +void ff_h264_luma_dc_dequant_idct_sse2(int16_t *output, const int16_t *input, int qmul);
> 
> /***************************/
> / deblocking */
> --
> 2.48.1
> 

On second thought maybe this should be dropped as some ASM implementations may want to use the input buffer as scratch space.

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

      reply	other threads:[~2025-06-20 17:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13 20:02 Tristan Matthews
2025-06-20 17:50 ` Tristan Matthews via ffmpeg-devel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mailman.3926.1750441861.1384.ffmpeg-devel@ffmpeg.org \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=httamt@protonmail.com \
    --cc=tmatth@videolan.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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