diff mbox series

[FFmpeg-devel,6/7] avfilter/phase_template: Fix left-shift of negative numbers

Message ID GV1P250MB07375A047FEECE27E59B7DD58F3D9@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit cf57147da1e8d93d51288dc40ae1bcd11bbc4a0b
Headers show
Series [FFmpeg-devel,1/7] postproc/postprocess: Remove obsolete MMX(EXT)/3Dnow functions | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Nov. 6, 2022, 4:31 p.m. UTC
Affected the filter-phase FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/phase_template.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavfilter/phase_template.c b/libavfilter/phase_template.c
index 491612b826..8450670234 100644
--- a/libavfilter/phase_template.c
+++ b/libavfilter/phase_template.c
@@ -46,7 +46,7 @@ 
  *
  * (The result is actually multiplied by 25)
  */
-#define DIFF(a, as, b, bs) ((t) = ((*(a) - (b)[bs]) << 2) + (a)[(as) << 1] - (b)[-(bs)], (t) * (t))
+#define DIFF(a, as, b, bs) ((t) = ((*(a) - (b)[bs]) * 4) + (a)[(as) * 2] - (b)[-(bs)], (t) * (t))
 
 /*
  * Find which field combination has the smallest average squared difference