[FFmpeg-trac] #11357(avcodec:new): H.264 decoder bug on Arm
FFmpeg
trac at avcodec.org
Tue Dec 17 05:38:06 EET 2024
#11357: H.264 decoder bug on Arm
--------------------------------------+-----------------------------------
Reporter: Bin Peng | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: avcodec
Version: git-master | Resolution:
Keywords: H264 decoder | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
--------------------------------------+-----------------------------------
Comment (by Bin Peng):
The reason for the inconsistency is that the value of STRIDE_ALIGN differs
between platforms. On x86 platforms, it is greater than 16 (typically 32
or 64), while on ARM platforms, it is 16.
https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/internal.h#L39
The STRIDE_ALIGN is set to the buffer stride of temporary buffers for U
and V components in mc_part_weighted.
{{{
uint8_t *tmp_cb = sl->bipred_scratchpad;
uint8_t *tmp_cr = sl->bipred_scratchpad + (16 << pixel_shift);
}}}
https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/h264_mb.c#L410
But the offset of temporary buffers for U and V components is hardcoded to
16.
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.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11357#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list