This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 933b195bcb2cf1cd8e2c7ba0967452074f01e77d
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Wed Jul 22 11:34:40 2026 +0200
Commit:     Andreas Rheinhardt <[email protected]>
CommitDate: Sat Aug 1 16:50:06 2026 +0200

    avcodec/vc1dsp: Avoid negating unnecessarily
    
    Due to the earlier "if (a1 < a0 || a2 < a0)" check
    it is guaranteed that min(a1,a2) is < a0, allowing
    simplifications.
    
    Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavcodec/vc1dsp.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c
index dd143b114c..355e4b8b02 100644
--- a/libavcodec/vc1dsp.c
+++ b/libavcodec/vc1dsp.c
@@ -166,17 +166,11 @@ static av_always_inline int vc1_filter_line(uint8_t *src, 
ptrdiff_t stride, int
             clip = ((clip ^ clip_sign) - clip_sign) >> 1;
             if (clip) {
                 int a3     = FFMIN(a1, a2);
-                int d      = 5 * (a3 - a0);
-                int d_sign = (d >> 31);
+                int d      = (5 * (a0 - a3)) >> 3;
 
-                d       = ((d ^ d_sign) - d_sign) >> 3;
-                d_sign ^= a0_sign;
-
-                if (d_sign ^ clip_sign)
-                    d = 0;
-                else {
+                if (a0_sign ^ clip_sign) {
                     d = FFMIN(d, clip);
-                    d = (d ^ d_sign) - d_sign; /* Restore sign */
+                    d = (d ^ clip_sign) - clip_sign; /* Restore sign */
                     src[-1 * stride] = av_clip_uint8(src[-1 * stride] - d);
                     src[ 0 * stride] = av_clip_uint8(src[ 0 * stride] + d);
                 }

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to