mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-16 04:32:47 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user