From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id C21404E4C1 for ; Fri, 23 Jan 2026 12:01:37 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'u3GEC86G0YxayNSH5YrTekJZYkVvhsH+eINa9+DQCJ8=', expected b'bpP8kJ6P4Wzi5R60iDgSrXu7mduvVMV9FDA/4KMTTbo=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1769169622; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=u3GEC86G0YxayNSH5YrTekJZYkVvhsH+eINa9+DQCJ8=; b=3vVEYMBbQU8gukS9oevfbkAzLD2I98dP7WxFLyeM61mUmTVTMmdYQSCuSyen3LoMz4rhb 8om/5FiPK6JwSQMz/uN3F+U2D2vBYVTbP6TU0HIDDdZTeo3C6PlcM4hpKiMyjJDz2W6yPXR HSVb+Bz1I9M+ErhZtVPxxsJiDTHdKUCg7rhnX0yCKwbenkjzVXmmcJeVY+2j+tW5p9jvn4S 75xqMwG2MI+RmzmFeIhcl129niBeuB4q7I28xfOAJr6bEY1Svi/V9TNLmTbESJhCV2xKrvu Zg0lKP+xTEEsQO0xGRg3y/ZmnU5fxgoA9373oDsXHTm3cO5ibDTNS7HbX0DQ== Received: from [172.20.0.4] (unknown [172.20.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 6D3436914DC; Fri, 23 Jan 2026 14:00:22 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1769169603; b=BhYapl8c8pzlPqeTxzBy8TMY7t9nmJupGduUNJrd0PqQpHTA/H9+f9PyN4kXk9bA+PrMz o4xXIsxmAsTT0F9aP3t1ov8jH5tEVMFZnQn3Cu+Y9vDuIn9lSDyF3rBlaIN4B3ad5SNuRS3 K6OUhcUhG7yxF4YPW70btfbuGXPIAKZoMQLOrxfIksAh40MCjuB+B3wlismyWAYo7hv/xMZ PdKBuGn9J9urahDeFRbq5Mj58UQT3pJfrLPvluGSV6Fi4E8rW21ZejkSZErmCzEq8DtPvqT BES4mIqR+Q7HfAWrNaRkraYnj5pSsR6+ZEpZKQxKQh7dxPujXcqCXNsP/c4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1769169603; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=cQAid7qDWRM+PeoF57Lm0GqOmiFgk8rxm/NPN6waKNY=; b=aWzWMz1qCsBOMwO/KaL8u4PTceIAuoNigV68KWi2FtEB4k7CKDvr5Zv1fWVs//AURvz5m 2KalG5ELHGza7ccdMvVga3PcSstnMXDmCm7YPNNC5KGAXz+Bu7EDTUsLuDFFDM83XCYXYEw 1a0eeAH8o3u3lTRL6qzW/U4yVYH34+GQvURs48W9HP/W4NDXly+b9/zCnpaZpdIVzgFiRyy loTchLzLYdt3oYfVhfjE0mBNj1tZCjM5XsO7xbAHfdGgpR/E2sRDO20J6AC7WQ+hEGtqWap gotT4ZE7anbS3/Jy5M9JJqWzROABJyehZsNv5IfA3FEEAcrKXxEx4Z3MnlQg== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1769169595; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=bpP8kJ6P4Wzi5R60iDgSrXu7mduvVMV9FDA/4KMTTbo=; b=H5evhKVB07xOHWLHyinBZOL0hP2IVpQhETZkPfwi/14j+zqUj9sSnu1nQ7kQbx9n6ljPY h3TAk05Wk5vJpWli+yQB1Mve8rKPk6h5GQIoD2b9edX6LXa0wobBSzabDxNg4AdyhhZohQs IY2IpSoGu096Z19mW43lQxkcXBuLqKgi6oZn0oAo3AsSF+Fqy/ZmKXxdB5uFcXF+DX0X6Mf L0CuPKR3pHbhoJjUSUFwWEFp4h4lAPAaq6VwGzB7DjUve5Vq9LDKMXIxiHshBR4OI6AQ2lb jTnMFk++dPG9nhtilqWLtc8VsUbll7BwIpfBuGPrjfzoCJTFdpU2WTzMLNfA== Received: from 69dab402ede7 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id F18A1691426 for ; Fri, 23 Jan 2026 13:59:54 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Fri, 23 Jan 2026 11:59:54 -0000 Message-ID: <176916959514.25.6526749463976340448@4457048688e7> Message-ID-Hash: PGXNB6VD5T2NIYG6YMIRIOD6L54HMQU7 X-Message-ID-Hash: PGXNB6VD5T2NIYG6YMIRIOD6L54HMQU7 X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PR] avfilter/vf_libplacebo: add chroma_location option (PR #21559) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: GeoffreyAA via ffmpeg-devel Cc: GeoffreyAA Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21559 opened by GeoffreyAA URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21559 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21559.patch As noted in #21185, a common use case for libplacebo is converting BT.2020 video to BT.709. Customarily, the former uses a chroma location of "top left," whereas the latter uses "left." `-vf libplacebo=w=-1:h=1080:colorspace=bt709:color_trc=bt709:color_primaries=bt709:range=limited:format=yuv420p` Using this command on UHD video, the output carries over the original top-left chroma siting. In practice, this should make no difference; but it would be ideal and more flexible if one could specify the destination siting. No doubt, another filter could be used downstream, such as zscale, but this would require further processing. So, ideally, this should be done in libplacebo, either in the library or the filter, when the internal RGB is converted to YUV and subsampled, the desired chroma siting being done at that point. This patch adds the chroma_location setting to vf_libplacebo, and updates the documentation (with minimal change). >>From d282319b4d3fa73c6c24f46bd7f51a14069e434b Mon Sep 17 00:00:00 2001 From: GeoffreyAA Date: Fri, 23 Jan 2026 11:32:11 +0000 Subject: [PATCH 1/2] avfilter/vf_libplacebo: add chroma_location option Add chroma_location option so that, in the subsampled-to-subsampled case, the destination's chroma siting can be changed from the source's without having to use other filters. Useful, for example, when converting BT.2020 to BT.709, where the former customarily uses "top left" and the latter "left." --- libavfilter/vf_libplacebo.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index 74c1fd7214..0e62be5e42 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -219,6 +219,7 @@ typedef struct LibplaceboContext { int color_range; int color_primaries; int color_trc; + int chroma_location; int rotation; int alpha_mode; AVDictionary *extra_opts; @@ -1023,6 +1024,7 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) out->height = outlink->h; out->colorspace = outlink->colorspace; out->color_range = outlink->color_range; + out->chroma_location = outlink->chroma_location; out->alpha_mode = outlink->alpha_mode; if (s->deinterlace) out->flags &= ~(AV_FRAME_FLAG_INTERLACED | AV_FRAME_FLAG_TOP_FIELD_FIRST); @@ -1695,6 +1697,17 @@ static const AVOption libplacebo_options[] = { {"arib-std-b67", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_ARIB_STD_B67}, INT_MIN, INT_MAX, STATIC, .unit = "color_trc"}, {"vlog", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_V_LOG}, INT_MIN, INT_MAX, STATIC, .unit = "color_trc"}, + {"chroma_location", "select chroma location", OFFSET(chroma_location), AV_OPT_TYPE_INT, {.i64=-1}, -1, AVCHROMA_LOC_NB-1, DYNAMIC, .unit = "chroma_location"}, + {"auto", "keep the same chroma location", 0, AV_OPT_TYPE_CONST, {.i64=-1}, 0, 0, STATIC, .unit = "chroma_location"}, + {"unspecified", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCHROMA_LOC_UNSPECIFIED}, 0, 0, STATIC, .unit = "chroma_location"}, + {"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCHROMA_LOC_UNSPECIFIED}, 0, 0, STATIC, .unit = "chroma_location"}, + {"left", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCHROMA_LOC_LEFT}, 0, 0, STATIC, .unit = "chroma_location"}, + {"center", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCHROMA_LOC_CENTER}, 0, 0, STATIC, .unit = "chroma_location"}, + {"topleft", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCHROMA_LOC_TOPLEFT}, 0, 0, STATIC, .unit = "chroma_location"}, + {"top", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCHROMA_LOC_TOP}, 0, 0, STATIC, .unit = "chroma_location"}, + {"bottomleft", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCHROMA_LOC_BOTTOMLEFT}, 0, 0, STATIC, .unit = "chroma_location"}, + {"bottom", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCHROMA_LOC_BOTTOM}, 0, 0, STATIC, .unit = "chroma_location"}, + {"rotate", "rotate the input clockwise", OFFSET(rotation), AV_OPT_TYPE_INT, {.i64=PL_ROTATION_0}, PL_ROTATION_0, PL_ROTATION_360, DYNAMIC, .unit = "rotation"}, {"0", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PL_ROTATION_0}, .flags = STATIC, .unit = "rotation"}, {"90", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PL_ROTATION_90}, .flags = STATIC, .unit = "rotation"}, -- 2.52.0 >>From 27993cdfe625c49d2471b135d8cba93b1806e66e Mon Sep 17 00:00:00 2001 From: GeoffreyAA Date: Fri, 23 Jan 2026 11:37:06 +0000 Subject: [PATCH 2/2] doc/filters.texi: update libplacebo documentation, adding chroma_location Update libplacebo documentation, adding chroma_location. --- doc/filters.texi | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/filters.texi b/doc/filters.texi index 8a7e370a60..0f64b4a3fa 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -16689,6 +16689,7 @@ exist. @item color_primaries @item color_trc @item range +@item chroma_location Configure the colorspace that output frames will be delivered in. The default value of @code{auto} outputs frames in the same format as the input frames, leading to no change. For any other value, conversion will be performed. -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org