Commit e14d1c2aca for ffmpeg
commit e14d1c2aca61d437ce49f9ce1ffeb1b8d9bd0127
Author: Niklas Haas <git@haasn.dev>
Date: Fri Jul 17 15:28:52 2026 +0200
swscale/uops: rename misleading mat4 to mat4x5
This used to be a 4x4 matrix at some point during development.
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com>
diff --git a/libswscale/aarch64/ops.c b/libswscale/aarch64/ops.c
index f1d3d698ab..963bfec730 100644
--- a/libswscale/aarch64/ops.c
+++ b/libswscale/aarch64/ops.c
@@ -87,7 +87,7 @@ static int aarch64_setup_linear(const SwsAArch64OpImplParams *p,
for (int j = 0; j < 5; j++) {
const int jj = (j == 0) ? 4 : (j - 1);
if (!(p->par.lin.zero & SWS_MASK(i, jj))) {
- const SwsPixel px = uop->data.mat4[i][jj];
+ const SwsPixel px = uop->data.mat4x5[i][jj];
switch (p->type) {
case SWS_PIXEL_U8: ((uint8_t *) coeffs)[i_coeff++] = px.u8; break;
case SWS_PIXEL_U16: ((uint16_t *) coeffs)[i_coeff++] = px.u16; break;
diff --git a/libswscale/uops.c b/libswscale/uops.c
index eb5b4e881c..21396daf70 100644
--- a/libswscale/uops.c
+++ b/libswscale/uops.c
@@ -497,7 +497,7 @@ static int translate_linear_op(SwsContext *ctx, SwsUOpList *ops,
for (int j = 0; j < 5; j++) {
const AVRational64 k = op->lin.m[i][j];
const SwsPixel px = Q2PIXEL(k);
- uop.data.mat4[i][j] = px;
+ uop.data.mat4x5[i][j] = px;
if (k.num == 0)
uop.par.lin.zero |= SWS_MASK(i, j);
else if (j < 4 && k.num == k.den)
diff --git a/libswscale/uops.h b/libswscale/uops.h
index a297070f76..8660de3c41 100644
--- a/libswscale/uops.h
+++ b/libswscale/uops.h
@@ -302,7 +302,7 @@ typedef struct SwsUOp {
SwsPixel *ptr; /* refstruct */
SwsPixel scalar;
SwsPixel vec4[4];
- SwsPixel mat4[4][5]; /* row major */
+ SwsPixel mat4x5[4][5]; /* row major */
SwsShuffleMask shuffle; /* for SWS_UOP_RW_SHUFFLE */
const SwsLut3D *lut3d; /* for SWS_UOP_LUT_3D; refstruct */
void *opaque; /* reserved for internal use */
diff --git a/libswscale/uops_tmpl.c b/libswscale/uops_tmpl.c
index 4d08502609..e94bfca417 100644
--- a/libswscale/uops_tmpl.c
+++ b/libswscale/uops_tmpl.c
@@ -811,8 +811,8 @@ DECL_SETUP(setup_linear, params, out)
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++)
- c.m[i][j] = uop->data.mat4[i][j].px;
- c.k[i] = uop->data.mat4[i][4].px;
+ c.m[i][j] = uop->data.mat4x5[i][j].px;
+ c.k[i] = uop->data.mat4x5[i][4].px;
}
out->priv.ptr = av_memdup(&c, sizeof(c));
diff --git a/libswscale/x86/ops.c b/libswscale/x86/ops.c
index e79b1cf117..23785c58ca 100644
--- a/libswscale/x86/ops.c
+++ b/libswscale/x86/ops.c
@@ -298,7 +298,7 @@ static int setup_linear(const SwsImplParams *params, SwsImplResult *out)
{
const SwsUOp *uop = params->uop;
if (uop->type == SWS_PIXEL_F32) {
- out->priv.ptr = av_memdup(uop->data.mat4, sizeof(uop->data.mat4));
+ out->priv.ptr = av_memdup(uop->data.mat4x5, sizeof(uop->data.mat4x5));
out->free = ff_op_priv_free;
return out->priv.ptr ? 0 : AVERROR(ENOMEM);
}
@@ -311,7 +311,7 @@ static int setup_linear(const SwsImplParams *params, SwsImplResult *out)
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 5; j++) {
- SwsPixel px = uop->data.mat4[i][j];
+ SwsPixel px = uop->data.mat4x5[i][j];
SwsPixelType type = uop->type;
if (type == SWS_PIXEL_U8) {
type = SWS_PIXEL_U16; /* for pmullw */
diff --git a/tests/checkasm/sw_ops.c b/tests/checkasm/sw_ops.c
index 7b34af4a38..39f05dd03a 100644
--- a/tests/checkasm/sw_ops.c
+++ b/tests/checkasm/sw_ops.c
@@ -600,11 +600,11 @@ static void check_linear(const char *name, SwsUOp *uop)
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 5; j++) {
if (par->zero & SWS_MASK(i, j))
- uop->data.mat4[i][j] = constpx(uop->type, 0);
+ uop->data.mat4x5[i][j] = constpx(uop->type, 0);
else if (par->one & SWS_MASK(i, j))
- uop->data.mat4[i][j] = constpx(uop->type, 1);
+ uop->data.mat4x5[i][j] = constpx(uop->type, 1);
else
- uop->data.mat4[i][j] = rndpx(uop->type);
+ uop->data.mat4x5[i][j] = rndpx(uop->type);
}
}