diff --git a/libswscale/ops.c b/libswscale/ops.c index 0e35004c0d..83eb8e162e 100644 --- a/libswscale/ops.c +++ b/libswscale/ops.c @@ -248,29 +248,8 @@ void ff_sws_op_list_update_comps(SwsOpList *ops) switch (op->op) { case SWS_OP_READ: - for (int i = 0; i < op->rw.elems; i++) { - if (ff_sws_pixel_type_is_int(op->type)) { - int bits = 8 * ff_sws_pixel_type_size(op->type) >> op->rw.frac; - if (!op->rw.packed && ops->src.desc) { - /* Use legal value range from pixdesc if available; - * we don't need to do this for packed formats because - * non-byte-aligned packed formats will necessarily go - * through SWS_OP_UNPACK anyway */ - for (int c = 0; c < 4; c++) { - if (ops->src.desc->comp[c].plane == i) { - bits = ops->src.desc->comp[c].depth; - break; - } - } - } - - op->comps.flags[i] |= SWS_COMP_EXACT; - op->comps.min[i] = av_max_q(Q(0), op->comps.min[i]); - op->comps.max[i] = av_min_q(Q((1ULL << bits) - 1), op->comps.max[i]); - } - } - - /* Explicitly strip flags and min/max range data for unread comps */ + /* Active components are preserved from the user-provided value, + * other components are explicitly stripped */ for (int i = op->rw.elems; i < 4; i++) { op->comps.flags[i] = prev.flags[i]; op->comps.min[i] = prev.min[i]; diff --git a/tests/ref/fate/sws-ops-list b/tests/ref/fate/sws-ops-list index 0458a25df4..0210a0a1cc 100644 --- a/tests/ref/fate/sws-ops-list +++ b/tests/ref/fate/sws-ops-list @@ -1 +1 @@ -6b2360c6fa99f5d0e428a97dfeff7189 +d781f3ddfeed4590eb253814366d2d01