Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* Re: [FFmpeg-devel] [PATCH v4] avcodec/h264_mb: Fix tmp buffer overlap
       [not found] <c85c3555-0206-4f1b-a18d-81680d2c39b2@visionular.com>
@ 2025-01-24  4:44 ` Bin Peng
  0 siblings, 0 replies; only message in thread
From: Bin Peng @ 2025-01-24  4:44 UTC (permalink / raw)
  To: ffmpeg-devel

Hi, Michael,

Should I add the attached bitstream to the FATE test?

https://trac.ffmpeg.org/attachment/ticket/11357/inter_weighted_bipred2.264

Regards
Bin Peng


On 2024/12/24 15:49, Bin Peng wrote:
> When decoding a bitstream with weighted-bipred enabled,
> the results on ARM and x86 platforms may differ.
> 
> The reason for the inconsistency is that the value of
> STRIDE_ALIGN differs between platforms. And STRIDE_ALIGN
> is set to the buffer stride of temporary buffers for U
> and V components in mc_part_weighted.
> 
> If the buffer stride is 32 or 64 (as on x86 platforms),
> the U and V pixels can be interleaved row by row without
> overlapping, resulting in correct output.
> However, on ARM platforms where the stride is 16,
> the V component will overwrite part of the U component's pixels,
> leading to incorrect predicted pixels.
> 
> Fixes: ticket 11357
> 
> Signed-off-by: Bin Peng <pengbin@visionular.com>
> ---
>  libavcodec/utils.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 2dbd677920..d280e1c324 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -147,6 +147,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
>      int i;
>      int w_align = 1;
>      int h_align = 1;
> +    int stride_align = STRIDE_ALIGN;
>      AVPixFmtDescriptor const *desc = av_pix_fmt_desc_get(s->pix_fmt);
>  
>      if (desc) {
> @@ -342,13 +343,14 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
>          // increasing witdth ensure that the temporary area is large enough,
>          // the next rounded up width is 32
>          *width = FFMAX(*width, 32);
> +        stride_align = FFMAX(stride_align, 32);
>      }
>      if (s->codec_id == AV_CODEC_ID_SVQ3) {
>          *width = FFMAX(*width, 32);
>      }
>  
>      for (i = 0; i < 4; i++)
> -        linesize_align[i] = STRIDE_ALIGN;
> +        linesize_align[i] = stride_align;
>  }
>  
>  void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height)

_______________________________________________
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] only message in thread

only message in thread, other threads:[~2025-01-24  4:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <c85c3555-0206-4f1b-a18d-81680d2c39b2@visionular.com>
2025-01-24  4:44 ` [FFmpeg-devel] [PATCH v4] avcodec/h264_mb: Fix tmp buffer overlap Bin Peng

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