diff --git a/src/gui/render_templates_hq.h b/src/gui/render_templates_hq.h index 002f1fff..3bfd65e3 100644 --- a/src/gui/render_templates_hq.h +++ b/src/gui/render_templates_hq.h @@ -41,17 +41,17 @@ static inline bool diffYUV(Bit32u yuv1, Bit32u yuv2) Bit32u mask; diff = ((yuv1 & Ymask) - (yuv2 & Ymask)); - mask = diff >> 31; // -1 if value < 0, 0 otherwise + mask = ((Bit32s)diff) >> 31; // ~1/-1 if value < 0, 0 otherwise diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value if (diff > trY) return true; diff = ((yuv1 & Umask) - (yuv2 & Umask)); - mask = diff >> 31; // -1 if value < 0, 0 otherwise + mask = ((Bit32s)diff)>> 31; // ~1/-1 if value < 0, 0 otherwise diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value if (diff > trU) return true; diff = ((yuv1 & Vmask) - (yuv2 & Vmask)); - mask = diff >> 31; // -1 if value < 0, 0 otherwise + mask = ((Bit32s)diff) >> 31; // ~1/-1 if value < 0, 0 otherwise diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value if (diff > trV) return true;