This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit d5bbc8c59859e367ed7003cc00e3428c68629ef4 Author: Zuxy Meng <[email protected]> AuthorDate: Fri Sep 4 21:21:45 2026 -0700 Commit: Zuxy Meng <[email protected]> CommitDate: Thu Oct 1 17:49:31 2026 -0700 avcodec/mips/h264dsp_mmi: Fix edge cases for bi-weight on MMI S16 saturating sum must be computed dot-product-first. The MMI code added the offset to the first product before adding the second product. Swap the paddsh pairs in biweight_pixels16/8/4_8_mmi to form the dot product first. This fixes bi-weight checkasm test for MIPS as MSA already handles these cases. Signed-off-by: Zuxy Meng <[email protected]> --- libavcodec/mips/h264dsp_mmi.c | 14 +++++++------- tests/checkasm/h264dsp.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/mips/h264dsp_mmi.c b/libavcodec/mips/h264dsp_mmi.c index bee4e84e37..c42a5ad98b 100644 --- a/libavcodec/mips/h264dsp_mmi.c +++ b/libavcodec/mips/h264dsp_mmi.c @@ -1170,10 +1170,10 @@ void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src, "pmullh %[ftmp8], %[ftmp8], %[ftmp4] \n\t" "pmullh %[ftmp1], %[ftmp1], %[ftmp3] \n\t" "pmullh %[ftmp2], %[ftmp2], %[ftmp4] \n\t" - "paddsh %[ftmp7], %[ftmp7], %[ftmp5] \n\t" - "paddsh %[ftmp1], %[ftmp1], %[ftmp5] \n\t" "paddsh %[ftmp7], %[ftmp7], %[ftmp8] \n\t" "paddsh %[ftmp1], %[ftmp1], %[ftmp2] \n\t" + "paddsh %[ftmp7], %[ftmp7], %[ftmp5] \n\t" + "paddsh %[ftmp1], %[ftmp1], %[ftmp5] \n\t" "psrah %[ftmp7], %[ftmp7], %[ftmp6] \n\t" "psrah %[ftmp1], %[ftmp1], %[ftmp6] \n\t" "packushb %[ftmp1], %[ftmp1], %[ftmp7] \n\t" @@ -1188,10 +1188,10 @@ void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src, "pmullh %[ftmp8], %[ftmp8], %[ftmp4] \n\t" "pmullh %[ftmp1], %[ftmp1], %[ftmp3] \n\t" "pmullh %[ftmp2], %[ftmp2], %[ftmp4] \n\t" - "paddsh %[ftmp7], %[ftmp7], %[ftmp5] \n\t" - "paddsh %[ftmp1], %[ftmp1], %[ftmp5] \n\t" "paddsh %[ftmp7], %[ftmp7], %[ftmp8] \n\t" "paddsh %[ftmp1], %[ftmp1], %[ftmp2] \n\t" + "paddsh %[ftmp7], %[ftmp7], %[ftmp5] \n\t" + "paddsh %[ftmp1], %[ftmp1], %[ftmp5] \n\t" "psrah %[ftmp7], %[ftmp7], %[ftmp6] \n\t" "psrah %[ftmp1], %[ftmp1], %[ftmp6] \n\t" "packushb %[ftmp1], %[ftmp1], %[ftmp7] \n\t" @@ -1284,10 +1284,10 @@ void ff_h264_biweight_pixels8_8_mmi(uint8_t *dst, uint8_t *src, "pmullh %[ftmp8], %[ftmp8], %[ftmp4] \n\t" "pmullh %[ftmp1], %[ftmp1], %[ftmp3] \n\t" "pmullh %[ftmp2], %[ftmp2], %[ftmp4] \n\t" - "paddsh %[ftmp7], %[ftmp7], %[ftmp5] \n\t" - "paddsh %[ftmp1], %[ftmp1], %[ftmp5] \n\t" "paddsh %[ftmp7], %[ftmp7], %[ftmp8] \n\t" "paddsh %[ftmp1], %[ftmp1], %[ftmp2] \n\t" + "paddsh %[ftmp7], %[ftmp7], %[ftmp5] \n\t" + "paddsh %[ftmp1], %[ftmp1], %[ftmp5] \n\t" "psrah %[ftmp7], %[ftmp7], %[ftmp6] \n\t" "psrah %[ftmp1], %[ftmp1], %[ftmp6] \n\t" "packushb %[ftmp1], %[ftmp1], %[ftmp7] \n\t" @@ -1370,8 +1370,8 @@ void ff_h264_biweight_pixels4_8_mmi(uint8_t *dst, uint8_t *src, "punpcklbh %[ftmp2], %[ftmp2], %[ftmp0] \n\t" "pmullh %[ftmp1], %[ftmp1], %[ftmp3] \n\t" "pmullh %[ftmp2], %[ftmp2], %[ftmp4] \n\t" - "paddsh %[ftmp1], %[ftmp1], %[ftmp5] \n\t" "paddsh %[ftmp1], %[ftmp1], %[ftmp2] \n\t" + "paddsh %[ftmp1], %[ftmp1], %[ftmp5] \n\t" "psrah %[ftmp1], %[ftmp1], %[ftmp6] \n\t" "packushb %[ftmp1], %[ftmp1], %[ftmp0] \n\t" MMI_SWC1(%[ftmp1], %[dst], 0x00) diff --git a/tests/checkasm/h264dsp.c b/tests/checkasm/h264dsp.c index 61839b13d6..6cdc44b5ef 100644 --- a/tests/checkasm/h264dsp.c +++ b/tests/checkasm/h264dsp.c @@ -545,7 +545,7 @@ static void check_weight(void) } // only archs that can pass test -#define H264_CHECK_BIWEIGHT (ARCH_X86 || ARCH_PPC) +#define H264_CHECK_BIWEIGHT (ARCH_X86 || ARCH_PPC || ARCH_MIPS) #if H264_CHECK_BIWEIGHT static void check_biweight(void) -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
