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

Git pushed a commit to branch master
in repository ffmpeg.

commit 7b60f3469e1ff909f059068bee23c640a1165a7b
Author:     Niklas Haas <[email protected]>
AuthorDate: Fri Jul 17 12:45:38 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Fri Oct 2 14:11:50 2026 +0200

    swscale/ops: lift the SWS_OP_LINEAR float-only restriction
    
    The reference backend does not need any change, it's already written to
    handle integer linear ops as a result of the previous commits.
    
    The x86 and aarch64 implementations will be updated in a future commit.
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Niklas Haas <[email protected]>
    Signed-off-by: Ramiro Polla <[email protected]>
---
 libswscale/ops.c  | 1 -
 libswscale/ops.h  | 7 ++++++-
 libswscale/uops.c | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/libswscale/ops.c b/libswscale/ops.c
index 0df8ec5acb..c07261c61e 100644
--- a/libswscale/ops.c
+++ b/libswscale/ops.c
@@ -244,7 +244,6 @@ void ff_sws_apply_op_q(const SwsOp *op, AVRational64 x[4])
             x[i] = av_max_q64(x[i], op->clamp.limit[i]);
         return;
     case SWS_OP_LINEAR: {
-        av_assert1(!ff_sws_pixel_type_is_int(op->type));
         const AVRational64 orig[4] = { x[0], x[1], x[2], x[3] };
         for (int i = 0; i < 4; i++) {
             AVRational64 sum = op->lin.m[i][4];
diff --git a/libswscale/ops.h b/libswscale/ops.h
index 465f5d4d49..1bebae6455 100644
--- a/libswscale/ops.h
+++ b/libswscale/ops.h
@@ -54,9 +54,9 @@ typedef enum SwsOpType {
     SWS_OP_MIN,             /* numeric minimum */
     SWS_OP_MAX,             /* numeric maximum */
     SWS_OP_SCALE,           /* multiplication by scalar */
+    SWS_OP_LINEAR,          /* generalized linear affine transform */
 
     /* Floating-point only arithmetic operations. */
-    SWS_OP_LINEAR,          /* generalized linear affine transform */
     SWS_OP_DITHER,          /* add dithering noise */
 
     /* Filtering operations. */
@@ -195,6 +195,11 @@ typedef struct SwsLinearOp {
      *   [ Out.y ] = [ F G H I J ] * [ x y z w 1 ]
      *   [ Out.z ] = [ K L M N O ]
      *   [ Out.w ] = [ P Q R S T ]
+     *
+     * Note: For integer types, these entries may exceed the value range of
+     * the pixel type itself. It's implied that implementations will perform
+     * all intermediate calculations modulo 2^N where N is the bit depth of
+     * the pixel type, including the final result.
      */
     AVRational64 m[4][5];
 } SwsLinearOp;
diff --git a/libswscale/uops.c b/libswscale/uops.c
index bd9c729402..316572d472 100644
--- a/libswscale/uops.c
+++ b/libswscale/uops.c
@@ -538,7 +538,7 @@ static int translate_linear_op(SwsContext *ctx, SwsUOpList 
*ops,
         }
     }
 
-    if (flags & SWS_UOP_FLAG_FMA) {
+    if ((flags & SWS_UOP_FLAG_FMA) && !ff_sws_pixel_type_is_int(op->type)) {
         /* multiplication by 1 and 0 are always exact by definition */
         uop.uop = SWS_UOP_LINEAR_FMA;
         uop.par.lin.exact = exact | uop.par.lin.zero | uop.par.lin.one;

-- 
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]

Reply via email to