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 <git@haasn.dev>
This commit is contained in:
Niklas Haas
2026-02-24 12:24:57 +01:00
committed by Niklas Haas
parent a71c115b77
commit 3a5b1d762f
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -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;
}
+1
View File
@@ -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 */