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

Git pushed a commit to branch master
in repository ffmpeg.

commit 3a5b1d762f24bfa428b6dc99152c6fe085c05abe
Author:     Niklas Haas <[email protected]>
AuthorDate: Tue Feb 24 12:24:57 2026 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Thu Feb 26 10:15:52 2026 +0000

    swscale/ops_chain: add ability to match fixed scale factor
    
    This is useful especially for the special case of scaling by common
    not-quite-power-of-two constants like 255 or 1023.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/ops_chain.c | 2 +-
 libswscale/ops_chain.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/libswscale/ops_chain.c b/libswscale/ops_chain.c
index e5fbc4f016..2445154186 100644
--- a/libswscale/ops_chain.c
+++ b/libswscale/ops_chain.c
@@ -184,7 +184,7 @@ static int op_match(const SwsOp *op, const SwsOpEntry 
*entry, const SwsComps nex
         score += av_popcount(SWS_MASK_ALL ^ entry->linear_mask);
         return score;
     case SWS_OP_SCALE:
-        return score;
+        return av_cmp_q(op->c.q, entry->scale) ? 0 : score;
     case SWS_OP_TYPE_NB:
         break;
     }
diff --git a/libswscale/ops_chain.h b/libswscale/ops_chain.h
index 2f5a31793e..0bc8c01283 100644
--- a/libswscale/ops_chain.h
+++ b/libswscale/ops_chain.h
@@ -111,6 +111,7 @@ typedef struct SwsOpEntry {
         uint32_t       linear_mask; /* subset of SwsLinearOp */
         int            dither_size; /* subset of SwsDitherOp */
         int            clear_value; /* clear value for integer clears */
+        AVRational     scale;       /* scale factor for SWS_OP_SCALE */
     };
 
     /* Kernel implementation */

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

Reply via email to