/* Extracts an integer clear operation (subset) from the given linear op. */ static av_noinline bool extract_constant_rows(SwsLinearOp *c, SwsComps prev, SwsConst *out_clear) { SwsConst clear = {0}; bool ret = false; for (int i = 0; i < 4; i++) { bool const_row = c->m[i][4].den == 1; /* offset is integer */ for (int j = 0; j < 4; j++) { const_row &= c->m[i][j].num == 0 || /* scalar is zero */ (prev.flags[j] & SWS_COMP_ZERO); /* input is zero */ } if (const_row && (c->mask & SWS_MASK_ROW(i))) { clear.q4[i] = c->m[i][4]; for (int j = 0; j < 5; j++) c->m[i][j] = Q(i == j); c->mask &= ~SWS_MASK_ROW(i); ret = true; } } if (ret) *out_clear = clear; return ret; }