From patchwork Tue Apr 5 13:47:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 35212 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp308741pzb; Tue, 5 Apr 2022 06:47:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRja7wWntGbM9rjgOF/3XEbkeXmMnaVLNWwArpj98I9Y3W5aZX+mv/qDZW2ilNt/j8QVzG X-Received: by 2002:a17:907:60cc:b0:6e0:dab3:ca76 with SMTP id hv12-20020a17090760cc00b006e0dab3ca76mr3697674ejc.154.1649166469909; Tue, 05 Apr 2022 06:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649166469; cv=none; d=google.com; s=arc-20160816; b=wh6SRrqiwZ1iVCIg3VSm8UE6LMkScTHjScKbUut0VrBbNYpwQoIWmFKk8qefHy2VwR ubWjEFh00n474cw5QkhXUAs80oSQH5D8vkGeiEIG6OSMti2B629XiCyDaqigeytHblZt 06tYtKficlpSlXr++8VGwR8z2gJHJCF6/71qzj+LXc0IZlUUfvL86ClgjhiB7264BzvE C8vYM72gYV+vZSQ4GQitw1nnqqXSirCLANJ6i+Vsn3JZfw6ztgj7paZzKnL+SnsQwUCb baEk0Z9PHraLT7wAdYAdRajd7R1kFX7MkRsCD9WwIrMNH+EdReNaYrhzjAcMzhY2WPS1 5YwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=vvouDv8ZhyFLOghaIYjmt6aSbHhTgvP205Z4+1mRCew=; b=xWC5cjnQcKOFiqjvzM5F94TMScgEiZ/jT7o+fw2UnwaEz/sjf92r6QCV/GLn3Q81N5 LEQ1LoG6lt9aJNQpgkaD8BbbOIpJAIy0Nzc1hiIHh5tVaL2lMW/z6dZCdimIgYVe1g1v JI7o9ffgO/ypE0rrET9DIbMNCyyceIP4QQD4QgTROSZrOJ7CuLtQRSUIW1NptodUGzsl jdXqlBLcp+4tiSZlFHnuyjlqkzE1ZRQVumRrNwaBxEW6dcPieqrS7aD4uKkx7QHfNrM1 2xfwpmmg+N9Sr/NYRCBmHVR0NWg9tOaxPIQnO+PLWsnSVBv+30LN3B7uNyiR7vpoVxN8 7Pew== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=lLGafMrI; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r14-20020a05640251ce00b0041962abfa3fsi9983113edd.387.2022.04.05.06.47.26; Tue, 05 Apr 2022 06:47:49 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=lLGafMrI; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C190268AFC2; Tue, 5 Apr 2022 16:47:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 92EF368B0AD for ; Tue, 5 Apr 2022 16:47:15 +0300 (EEST) Received: by mail-pl1-f175.google.com with SMTP id n8so3963653plh.1 for ; Tue, 05 Apr 2022 06:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=X6MdceYpqMAWHBFQrzH+gjuWu7dXcwnIzlGB7P2eFb8=; b=lLGafMrI91mczdPMgWJQ9eCgm91H4uNr7PWN+EYSMAHQQo8cUQHJJ0FW6yifCxIDUD wa2ZilLp+9R0SKty5u0iEUFOWIQuAReG7ULVSE9rSSfHyxkGCJWubYV0rOYJBWeivVb+ C9dzWflFBIoRw+3j2E02qVcDyT5cWH7yfiMxfVHifDzlCmx3yA0ByKBKe5XSZW6eXbkg hyp699lEBJ2zFad3b6bEv6SzsBZj3cTALyQTNc7MmqhmfskxsSt+AieO14M+sGAbAg20 hgbPa418A3P4bciuByuED85ADiHvgErt7te6qRQDJULBBoPig91s9T3LuOz5L/CiM4oD /ZXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=X6MdceYpqMAWHBFQrzH+gjuWu7dXcwnIzlGB7P2eFb8=; b=OYSKfjqxg5WtzJh8Z4+ZuNv0qdl5Izershcx4CF9DC/7iT4ohfk2Dx14I8/hvMtre+ B+ovcckaEIESM4rq08sSOuP24Fit7IoybApOnNFeWyBb9tpTVZdpoN1JeWIwG2cpdT9K 4KIwSY9JSremDzsO2dnpdUQnL+s9JKkgv3jhTWgOFBY5p/d5KtbEsiN0/5dczDZNEYe0 Y3CsXO6rgsyI0t+Z9dDUhO4p5kc1aiLyHSRAuLHEP33HQmwakOM/Dw/i7cKfywv5z5QU ewflGJDTzGOw7uXpSypolnpsUdOZJOtQ82QheKlzcFDviBREKpv+gUuR+u3RzdxbVOGb pxFA== X-Gm-Message-State: AOAM531dq4MlB2Nr3A0NMtXZA85OhWB/EDuvC7S31BENPWZu3r663Fn5 PHKIy1jVjMYnjYNJfOfoGanpaAdE5yWhKg== X-Received: by 2002:a17:90b:4b43:b0:1c9:85b0:2db8 with SMTP id mi3-20020a17090b4b4300b001c985b02db8mr4189848pjb.23.1649166433583; Tue, 05 Apr 2022 06:47:13 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id c18-20020a056a000ad200b004f0f9696578sm17112705pfl.141.2022.04.05.06.47.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Apr 2022 06:47:13 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 5 Apr 2022 21:47:03 +0800 Message-Id: <1649166427-9667-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1648423513-21261-1-git-send-email-lance.lmwang@gmail.com> References: <1648423513-21261-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v3 1/5] avutil: add ambient viewing environment metadata side data X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: beKP9EqqcjXj From: Limin Wang Signed-off-by: Limin Wang --- libavutil/frame.c | 1 + libavutil/frame.h | 6 +++++ libavutil/mastering_display_metadata.c | 23 +++++++++++++++++ libavutil/mastering_display_metadata.h | 45 ++++++++++++++++++++++++++++++++++ libavutil/version.h | 2 +- 5 files changed, 76 insertions(+), 1 deletion(-) diff --git a/libavutil/frame.c b/libavutil/frame.c index fbb869f..8882da2 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -815,6 +815,7 @@ const char *av_frame_side_data_name(enum AVFrameSideDataType type) case AV_FRAME_DATA_DETECTION_BBOXES: return "Bounding boxes for object detection and classification"; case AV_FRAME_DATA_DOVI_RPU_BUFFER: return "Dolby Vision RPU Data"; case AV_FRAME_DATA_DOVI_METADATA: return "Dolby Vision Metadata"; + case AV_FRAME_DATA_AMBIENT_VIEWING_ENV: return "Ambient Viewing Environment"; } return NULL; } diff --git a/libavutil/frame.h b/libavutil/frame.h index 33fac20..92413c9 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -209,6 +209,12 @@ enum AVFrameSideDataType { * volume transform - CUVA 005.1-2021. */ AV_FRAME_DATA_DYNAMIC_HDR_VIVID, + + /** + * ambient viewing environment for a video frame, as described by + * the AVAmbientViewingEnv + */ + AV_FRAME_DATA_AMBIENT_VIEWING_ENV, }; enum AVActiveFormatDescription { diff --git a/libavutil/mastering_display_metadata.c b/libavutil/mastering_display_metadata.c index 6069347..f094eab 100644 --- a/libavutil/mastering_display_metadata.c +++ b/libavutil/mastering_display_metadata.c @@ -64,3 +64,26 @@ AVContentLightMetadata *av_content_light_metadata_create_side_data(AVFrame *fram return (AVContentLightMetadata *)side_data->data; } + +AVAmbientViewingEnv *av_ambient_viewing_env_alloc(size_t *size) +{ + AVAmbientViewingEnv *metadata = av_mallocz(sizeof(*metadata)); + + if (size) + *size = sizeof(*metadata); + + return metadata; +} + +AVAmbientViewingEnv *av_ambient_viewing_env_create_side_data(AVFrame *frame) +{ + AVFrameSideData *side_data = av_frame_new_side_data(frame, + AV_FRAME_DATA_AMBIENT_VIEWING_ENV, + sizeof(AVAmbientViewingEnv)); + if (!side_data) + return NULL; + + memset(side_data->data, 0, sizeof(AVAmbientViewingEnv)); + + return (AVAmbientViewingEnv *)side_data->data; +} diff --git a/libavutil/mastering_display_metadata.h b/libavutil/mastering_display_metadata.h index c23b07c..c1ba659 100644 --- a/libavutil/mastering_display_metadata.h +++ b/libavutil/mastering_display_metadata.h @@ -125,4 +125,49 @@ AVContentLightMetadata *av_content_light_metadata_alloc(size_t *size); */ AVContentLightMetadata *av_content_light_metadata_create_side_data(AVFrame *frame); +/** + * The characteristics of the nominal ambient viewing environment for + * the display of the associated video content. + * To be used as payload of a AVFrameSideData the appropriate type. + * + * @note The struct should be allocated with av_ambient_viewing_env_alloc() + * and its size is not a part of the public ABI. + */ +typedef struct AVAmbientViewingEnv { + /** + * specifies the environmental illuminance of the ambient viewing + * environment in units of 0.0001 lux. + * ambient_illuminance shall not be equal to 0. + */ + uint32_t ambient_illuminance; + /** + * specify the normalized x and y chromaticity coordinates, respectively, + * of the environmental ambient light in the nominal viewing environment, + * according to the CIE 1931 definition of x and y as specified in ISO + * 11664-1 (see also ISO 11664-3 and CIE 15), in normalized increments of + * 0.00002. The values of ambient_light_x and ambient_light_y shall be in + * the range of 0 to 50000 + */ + uint16_t ambient_light_x; + uint16_t ambient_light_y; +} AVAmbientViewingEnv; + +/** + * Allocate an AVAmbientViewingEnv structure and set its fields to + * default values. The resulting struct can be freed using av_freep(). + * + * @return An AVAmbientViewingEnv filled with default values or NULL + * on failure. + */ +AVAmbientViewingEnv *av_ambient_viewing_env_alloc(size_t *size); + +/** + * Allocate a complete AVAmbientViewingEnv and add it to the frame. + * + * @param frame The frame which side data is added to. + * + * @return The AVAmbientViewingEnv structure to be filled by caller. + */ +AVAmbientViewingEnv *av_ambient_viewing_env_create_side_data(AVFrame *frame); + #endif /* AVUTIL_MASTERING_DISPLAY_METADATA_H */ diff --git a/libavutil/version.h b/libavutil/version.h index 6735c20..998202f 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 57 -#define LIBAVUTIL_VERSION_MINOR 24 +#define LIBAVUTIL_VERSION_MINOR 25 #define LIBAVUTIL_VERSION_MICRO 101 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ From patchwork Tue Apr 5 13:47:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 35211 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp308635pzb; Tue, 5 Apr 2022 06:47:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBw6KaLOC4ellajNShwgVIUSvuyHsGCpAk082tA5rlDA4CJWAZ7Mry07AB3b63xiCCrJMD X-Received: by 2002:a17:907:d2a:b0:6df:8b4b:2b3b with SMTP id gn42-20020a1709070d2a00b006df8b4b2b3bmr3583485ejc.575.1649166457153; Tue, 05 Apr 2022 06:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649166457; cv=none; d=google.com; s=arc-20160816; b=kw5IuMCNMvvsPAlOMN4yS5JkTuGu6ypWoVVRLud0hSNn0RAuIv/KSH2geF62c6ZS8N 6PSZCwE1m53sd2vPC16L8x0oIGdXZlbfAWnGyVAcjqnLs7QaVG9wU9IOjsuyDWt/rDpn K66VZVBfkbthFCqCtm+zVDW7pNHkqdCEkY4mm9u1pUGfVPPHbf3NVd1gYY/tPMjsNEmx N+xeiQh0Xfo7zEvfKVFLY848Cu3UNyY8uV0xKB9wLz/WTLuO0fWOdre/SI6f6TeX61zG AlYGvhb+x3Y5/JzM4Bg7A2+J7A261GfyRd7tlnxpHqT0Ufn1sikrsBKfSPUI4S/lQt9q tNiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=SPRKHnOG0iyafNqpKhw436Pv1838Jt5G9u/kWkJU+S8=; b=u56ou6gjAZv7+y9p+uyjXTkzLepnYcMbEesjJT80TYJctqNYN/Z/AMiRMoJsGUFh1u TIEDFN6/ryi2Jp4fEs7+Q9xO4uIR8OTlg23Gp4TiqncCKXryWvYm4jSZ77/iuCEi0m0S lrk7uWbhT8NNGLGSEP7MmWlSYrf8gaEjfV4nJyGzt6OkWdnca7bSXanI+INcYnMlG4yf mdGG/vIedqGjKfNsLqWCCvYa6WADL0HWt04UavOnG+hicHRVrd19s7MzElXa4LKHfFEU I6prw8X2uKnfheBPNjZGQhQgr/V66afzvb+5v7G7mZsPeHutB3isxscYg13vLG5R4MpD +gUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=mJQHfCbe; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 13-20020a170906310d00b006df76385ddfsi8483158ejx.639.2022.04.05.06.47.36; Tue, 05 Apr 2022 06:47:37 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=mJQHfCbe; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9EA3768B200; Tue, 5 Apr 2022 16:47:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A5E9768B0AD for ; Tue, 5 Apr 2022 16:47:16 +0300 (EEST) Received: by mail-pj1-f51.google.com with SMTP id a16-20020a17090a6d9000b001c7d6c1bb13so2690348pjk.4 for ; Tue, 05 Apr 2022 06:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HLWmbpOCashPQnH8QgSFHANKYOlN7rKWVhbktKTRCqk=; b=mJQHfCbeOzQf2R3LP98eSwOt7zsW5d+FsiS15S4CWOERL+yHl1OekP6dbZxa3umbnr 2gwdifFW0xjkbam7243k23JUJGVk/Zui9YDisituKfN8ns+PKxlhp2NeKrWT79B8YLpU JXdl9+KPs2x5TXdjrLExpKkZPXEfcFNUfEFKnPQsRs/YJfLwAUz4xkK6UL7La/Ojsvh4 +vzD8U0BTTwCWBeaH/PULlnj/3I+n1DUTO7FF30gGO05WQiW+u1gQ6K7GGOLIq4lZ1Xl 9dkLtOo+T0HuuQbliJZZXo51XhxuNuHvoyw4ak7y4UPvhukilKfWkIsLMRcpnli9U5/+ Ta1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HLWmbpOCashPQnH8QgSFHANKYOlN7rKWVhbktKTRCqk=; b=0H+wRT1xCddieQdfRxbFblhl5WDfUFdYev4m5CBWX/wZNT0QvNE7NJNOJKh3JqIqbB NjBbZhDJOsWrLhzL7jY/XuPw8J7I8FJanZj/ug8wvFjR4c3tCTzpCQKO9aXTkCR/1XA/ JWD4zVfeUt6zJYvlAkc2MB0HClVb50G8MClSQHcMSEeu51iNC5C2uKIAJl6Q/sYsVh+2 xKr8JafjJX9pXkTcBBX4Ol2WA6TNsIKr5kzAscWGLFt0E2rsewYp8m8KvmxcypM8aaD3 I6wNuhyiA1n/nsrxoVdxi32UEb/yRSo5ERTKzox/wwLQBGWkoz5KetKhGyP24OmD1vGz 7B4w== X-Gm-Message-State: AOAM533uRrth3XF7NIUCNQB3XqhqIx3Bw+cUyC4AY5TgkBf2GyxXszZy 96Elf6IVFCNKfZE09kraLKc5dGQ9Ky/fpQ== X-Received: by 2002:a17:90b:17ca:b0:1c7:3010:5901 with SMTP id me10-20020a17090b17ca00b001c730105901mr4385397pjb.22.1649166434885; Tue, 05 Apr 2022 06:47:14 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id c18-20020a056a000ad200b004f0f9696578sm17112705pfl.141.2022.04.05.06.47.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Apr 2022 06:47:14 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 5 Apr 2022 21:47:04 +0800 Message-Id: <1649166427-9667-2-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1649166427-9667-1-git-send-email-lance.lmwang@gmail.com> References: <1648423513-21261-1-git-send-email-lance.lmwang@gmail.com> <1649166427-9667-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v3 2/5] avcodec: add support for hevc ambient viewing environment SEI message X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: p7iJh644wD5h From: Limin Wang Signed-off-by: Limin Wang --- libavcodec/hevc_sei.c | 19 +++++++++++++++++++ libavcodec/hevc_sei.h | 8 ++++++++ libavcodec/hevcdec.c | 10 ++++++++++ tests/ref/fate/hevc-dv-rpu | 6 ++++++ 4 files changed, 43 insertions(+) diff --git a/libavcodec/hevc_sei.c b/libavcodec/hevc_sei.c index ec3036f..8c6daf5 100644 --- a/libavcodec/hevc_sei.c +++ b/libavcodec/hevc_sei.c @@ -497,6 +497,23 @@ static int decode_film_grain_characteristics(HEVCSEIFilmGrainCharacteristics *h, return 0; } +static int decode_ambient_viewing_env(HEVCSEIAmbientViewingEnvironment *s, GetBitContext *gb, int size) +{ + if (size < 8) + return AVERROR_INVALIDDATA; + + s->ambient_illuminance = get_bits_long(gb, 32); + s->ambient_light_x = get_bits(gb, 16); + s->ambient_light_y = get_bits(gb, 16); + size -= 8; + + s->present = 1; + + skip_bits_long(gb, 8 * size); + return 0; +} + + static int decode_nal_sei_prefix(GetBitContext *gb, void *logctx, HEVCSEI *s, const HEVCParamSets *ps, int type, int size) { @@ -525,6 +542,8 @@ static int decode_nal_sei_prefix(GetBitContext *gb, void *logctx, HEVCSEI *s, return decode_nal_sei_timecode(&s->timecode, gb); case SEI_TYPE_FILM_GRAIN_CHARACTERISTICS: return decode_film_grain_characteristics(&s->film_grain_characteristics, gb); + case SEI_TYPE_AMBIENT_VIEWING_ENVIRONMENT: + return decode_ambient_viewing_env(&s->ambient_viewing_env, gb, size); default: av_log(logctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", type); skip_bits_long(gb, 8 * size); diff --git a/libavcodec/hevc_sei.h b/libavcodec/hevc_sei.h index f198402..c7623f5 100644 --- a/libavcodec/hevc_sei.h +++ b/libavcodec/hevc_sei.h @@ -134,6 +134,13 @@ typedef struct HEVCSEIFilmGrainCharacteristics { int persistence_flag; } HEVCSEIFilmGrainCharacteristics; +typedef struct HEVCSEIAmbientViewingEnvironment { + int present; + uint32_t ambient_illuminance; + uint16_t ambient_light_x; + uint16_t ambient_light_y; +} HEVCSEIAmbientViewingEnvironment; + typedef struct HEVCSEI { HEVCSEIPictureHash picture_hash; HEVCSEIFramePacking frame_packing; @@ -149,6 +156,7 @@ typedef struct HEVCSEI { HEVCSEIAlternativeTransfer alternative_transfer; HEVCSEITimeCode timecode; HEVCSEIFilmGrainCharacteristics film_grain_characteristics; + HEVCSEIAmbientViewingEnvironment ambient_viewing_env; } HEVCSEI; struct HEVCParamSets; diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 09c07ac..21ed579 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -2998,6 +2998,15 @@ static int set_side_data(HEVCContext *s) } } + if (s->sei.ambient_viewing_env.present > 0) { + AVAmbientViewingEnv *metadata = av_ambient_viewing_env_create_side_data(out); + if (!metadata) + return AVERROR(ENOMEM); + metadata->ambient_illuminance = s->sei.ambient_viewing_env.ambient_illuminance; + metadata->ambient_light_x = s->sei.ambient_viewing_env.ambient_light_x; + metadata->ambient_light_y = s->sei.ambient_viewing_env.ambient_light_y; + } + return 0; } @@ -3800,6 +3809,7 @@ static int hevc_update_thread_context(AVCodecContext *dst, s->sei.mastering_display = s0->sei.mastering_display; s->sei.content_light = s0->sei.content_light; s->sei.alternative_transfer = s0->sei.alternative_transfer; + s->sei.ambient_viewing_env = s0->sei.ambient_viewing_env; ret = export_stream_params_from_sei(s); if (ret < 0) diff --git a/tests/ref/fate/hevc-dv-rpu b/tests/ref/fate/hevc-dv-rpu index 1980ab1..6879f71 100644 --- a/tests/ref/fate/hevc-dv-rpu +++ b/tests/ref/fate/hevc-dv-rpu @@ -117,6 +117,9 @@ source_min_pq=0 source_max_pq=3079 source_diagonal=42 [/SIDE_DATA] +[SIDE_DATA] +side_data_type=Ambient Viewing Environment +[/SIDE_DATA] [/FRAME] [FRAME] [SIDE_DATA] @@ -234,4 +237,7 @@ source_min_pq=0 source_max_pq=3079 source_diagonal=42 [/SIDE_DATA] +[SIDE_DATA] +side_data_type=Ambient Viewing Environment +[/SIDE_DATA] [/FRAME] From patchwork Tue Apr 5 13:47:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 35215 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp308899pzb; Tue, 5 Apr 2022 06:48:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwncODBGk4fjeATAzOvFwwkQkKDB9UEQrquYEUDL3tY41nhPvjZF9QfZ/ON7w8ExtMxvrAJ X-Received: by 2002:a17:906:c092:b0:6ce:1018:9f4e with SMTP id f18-20020a170906c09200b006ce10189f4emr3751142ejz.430.1649166491259; Tue, 05 Apr 2022 06:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649166491; cv=none; d=google.com; s=arc-20160816; b=zyGxBFOg2bRaU+ykw5fq1tG0ACVGPnSHdXA0fCpqMn+anYTtPsqeog/a0El1pKXLOG Flo8B9StGU3kGbBViL+Pb02BmFA01jCGayie8LYkG/H/uGHmCFMgC52tbihXvUFPQVlI xO0z+LkxEeqThO1C/8EcziGdEQ2AmU3FpfNy33FWY1kqEzhRftHUVb5zn2dwQoZk9xBk P0zbAf0Re72CIzfbicGZ+Y4BANx8trjDdcGvtCQG3bXkhuqkHaqSNHuIzCpEj+BZq5Nn 16xl3Fdh9evrDQ4cggRkxPYMUprhzUO6M/o5KRaMVu5scyhXdxm+fv30x/+2UC8iwWGG KBSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=mXsB9XDaeK4NgMdsGiVneOqykRSq8jRlJqetXn/ZJ1U=; b=YY31Cby1shHJvow0sfOI1Vev+ZLnHgwVBBaYwE0sXJhH2Ez3XEmiPSsVWXYF6uZX0d yVlakligTobwMf/6Q1DeN2XQk9JqpwelWcIfYTKfQSlzcUuHcmJprCV9HgLcqe48WgQq D/3VvpouEYnf07j48PEV21E5amqISHjzCVB0cz+MS9WM4TqP3IfCvpvXqHwuZ+Mhb82U FOdEVBQKIuFJKlsCx9elrQh2YbZdzClGdAJHBBP41AdTfP6b12x4qNoQt2BqXUfIDhiK ULtlFccyfI1DPXLlAybDLfbZ9axaeOMQrB+bV4a1S7Bc5VuAYvU7tcamjo27k8zVVTzv +Pqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=IKHKME3+; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i25-20020a170906a29900b006e7f26f7a86si4287626ejz.543.2022.04.05.06.47.48; Tue, 05 Apr 2022 06:48:11 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=IKHKME3+; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AC6B668B22C; Tue, 5 Apr 2022 16:47:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C849D68B160 for ; Tue, 5 Apr 2022 16:47:17 +0300 (EEST) Received: by mail-pj1-f53.google.com with SMTP id gt4so6068169pjb.4 for ; Tue, 05 Apr 2022 06:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gn75qVDQjgrEq49foHLP++BcxTtqMThLDnFk192szFg=; b=IKHKME3+PAhbmedyvC9fcFEB7dyNlFUgbcqHzRsztI2r9wfBBz7tI+5fIK5eXsQ0qg JLOnAN1zKTbxUF+CcrwsXxSZmDy39Ukg0G02p1cKNSk0nFhrvOYG8JSO/1JyKJJRK9u5 Yt0Fu3yV7r43fRumIwkbhNmkelw4zsOUl82S9zpHbG48khHBm3aZItnwES5mhQTm5nv7 snBI092YI90YZ8JZ3dwoPSBuMNr271gEbWLk+dDa6+ujRAMpUvWACNjNA/+Y/v94R12z ml0ESBy+kLXMjiVI4UtIzFys8ENZ2sPlnulzkGdZE6PbhtIpsOux2Viach4InnSDtpDB aONg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gn75qVDQjgrEq49foHLP++BcxTtqMThLDnFk192szFg=; b=Z7HPxQxO5j3y3P28gp6zVfDJfp6NKxMHDqRJy68DNq986zNn6TWJozQz91sXpA8x2E lByEcJZrkcpgIQhDcnYX5luQ8N7xsoIjHaVscqdGD9Er14GOxbLi52uQiqIV6jPUbIar llbPoYKcW1+sNEnSiH9yPzWQ+eYO25lxiGJ6j/0zy8lgG2ViZCPkioHPUUzQbUb7003V er6cOBUO4PODKe38hWB8QR/gdgrt30NPlUSubrY9+jwFq5MHk4zdcbP5HlWzoqgOhZ1w jSd1ucr9IG3JyAsJY26QW0WBTiiyrT+q8Cl6cYgPZsU9G7VnmOc97xkvVLtJ09ulDeIY PJbw== X-Gm-Message-State: AOAM531Ce6WnESG/eBWATFNBIMqVYi1Cf70njBZlyqSnnLoTAf+VwGnV NV2oQi5IRIJ1s4pO3bssFuCEULTB0uBypw== X-Received: by 2002:a17:90a:5296:b0:1ca:78cc:7172 with SMTP id w22-20020a17090a529600b001ca78cc7172mr4299288pjh.99.1649166436117; Tue, 05 Apr 2022 06:47:16 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id c18-20020a056a000ad200b004f0f9696578sm17112705pfl.141.2022.04.05.06.47.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Apr 2022 06:47:15 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 5 Apr 2022 21:47:05 +0800 Message-Id: <1649166427-9667-3-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1649166427-9667-1-git-send-email-lance.lmwang@gmail.com> References: <1648423513-21261-1-git-send-email-lance.lmwang@gmail.com> <1649166427-9667-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v3 3/5] avfilter/vf_showinfo: add support for ambient viewing environment metadata X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: C0MIEUOhGebb From: Limin Wang Signed-off-by: Limin Wang --- libavfilter/vf_showinfo.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c index 12d3931..1e81d26 100644 --- a/libavfilter/vf_showinfo.c +++ b/libavfilter/vf_showinfo.c @@ -651,6 +651,15 @@ static void dump_color_property(AVFilterContext *ctx, AVFrame *frame) av_log(ctx, AV_LOG_INFO, "\n"); } +static void dump_ambient_viewing_env(AVFilterContext *ctx, AVFrameSideData *sd) +{ + const AVAmbientViewingEnv *metadata = (const AVAmbientViewingEnv *)sd->data; + + av_log(ctx, AV_LOG_INFO, "Ambient Viewing Environment: \n"); + av_log(ctx, AV_LOG_INFO, " ambient_illuminance=%d, ambient_light_x=%d, ambient_light_y=%d", + metadata->ambient_illuminance, metadata->ambient_light_x, metadata->ambient_light_y); +} + static void update_sample_stats_8(const uint8_t *src, int len, int64_t *sum, int64_t *sum2) { int i; @@ -812,6 +821,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) case AV_FRAME_DATA_DOVI_METADATA: dump_dovi_metadata(ctx, sd); break; + case AV_FRAME_DATA_AMBIENT_VIEWING_ENV: + dump_ambient_viewing_env(ctx, sd); + break; default: av_log(ctx, AV_LOG_WARNING, "unknown side data type %d " "(%"SIZE_SPECIFIER" bytes)\n", sd->type, sd->size); From patchwork Tue Apr 5 13:47:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 35213 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp308811pzb; Tue, 5 Apr 2022 06:48:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymdLKZKAx5pe1OMziTDJjHc6LsGtgGDIbdPByoJONzFFQphO3imHs5eNQ/4jQwXe72Q/94 X-Received: by 2002:a17:906:3101:b0:6d6:5b64:906f with SMTP id 1-20020a170906310100b006d65b64906fmr3638254ejx.513.1649166480721; Tue, 05 Apr 2022 06:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649166480; cv=none; d=google.com; s=arc-20160816; b=X/fDqdVF4EDDV9Gew3ow8eh5WqoPuQFbvP/O57aC1by/kZAoojm+BXyCt7tfTGFExD EQDZcsi4fmfnNntMEJmcN1rkOODHakIgnv//j3vrwZ0FyfA7zWWyzRp2dIPxDLpARm56 rF+2n/5zyBTnNoN9eIlMXHEmGzwXugeGDLb0SqPSWi1z/o3jgZMh2aaZYDgIbWADA7sg WFLrDQDHPzBTLlil3tDjgJAevJKUeX07+0/WcLO+gbSbjAbGJ4okdepg1hmxAMTVHFPr A9zgRuZbz0Iv9Oc/zwrqj5X1pUQk/dPEIaUbzfEh7M6+y1WV2ZI7LFPY995sQRA2K70P nTAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=Xyr626iQUyYCZ7UkqdCH+5Ua4rOTHAO7ZY0owp6h0z0=; b=OPGZAuazRV9iFeGFO5x02bytr1RIr0XDwX81qDHAR9ztN1b1dzG1j+3taffjRK66bv a3RZIbIPKzWfw21I6WsJw/cZXTexgdm5WOzcuF5T142znzfgnmRpL+zfeLd7xZWZ22BF eDUcQ353bJhq+1Ao0J86NVF1+z1F3Qss5GW/7JCKIQCDFM5DK0UfZvMnZR40pPzO0ugL AYjRbecMp8SKA5C9n/ZL0cq1ot2CNw5U8OmHryPN5dqNMM7wSQoE20r5q1R2h2DyZ1o+ QsaYYva80XWCcuPwzA3mqxajf20PHKYMEcWF9xnK4JU7KxFRBgOi3RLuA+2FBeMU2rnm 6qDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=Gedh2KDF; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l9-20020aa7d949000000b00418c2b5bef5si9222219eds.471.2022.04.05.06.48.00; Tue, 05 Apr 2022 06:48:00 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=Gedh2KDF; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AEC4968B20E; Tue, 5 Apr 2022 16:47:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3D0B168B181 for ; Tue, 5 Apr 2022 16:47:19 +0300 (EEST) Received: by mail-pj1-f43.google.com with SMTP id kw18so5709307pjb.5 for ; Tue, 05 Apr 2022 06:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HKdWzEY7zud1cy3cOd1FNJArkuPu6pApAuj5acwxKuE=; b=Gedh2KDFyf0YKy0ObpyQieLdJMErGotAjRzeLvicX8VzbOvR/JZU7sdhaAOztEnrs0 J63BP1H+xPlZ+bl6Sqq9KEZ9HggwqgvAzAkkswkz8TBK9sPb7yhXoYNO0BrMRmBgYKF9 zJ1Quem6ul1gCuv9BZQKxdDFm2f4n/H2pK02FpKrUA5n03Jt/aSAUNzRfdWqOfqfrmPv MzNHsIVEg03NYN4j0pdEG/aWIORBE7x7XRARWVQbFYVovqUlZQgK6bJ3gF7PYru+KKWc vmOVJFsR/Pa3MvgJ06xy36L3+a/COeWnZZyQvBA3uI6sKI6jfjprCG9F3SKRIn4J7Fkl kE8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HKdWzEY7zud1cy3cOd1FNJArkuPu6pApAuj5acwxKuE=; b=GbyBw5SH532XnYg82iE7Iv2ToyiorNywre88ZVnperRguo+ggYhwuMXRA3esqW9iEP MHwaGvg0yhwwbfJpBRSu9SsO1O6Lb13EtgPcshAV39hxyvQok04vGhyYeCLSV1YJaL8s lNq7q3Y52PilbC5r/ke5VlNBgOxNpMjui0pKVEb9a4wQRZbzm3St8Yjn4JAXtoDJP/s3 TekezfkyzInYbT7py0ztS3Zdc3JdSLZ1lmva+CT4jB3bGZo9obX07bzrI2OIwAOw1Alm NkfKY74pHQJsHp5udCLlOz3riMSAroxh6Mutg/Ih9SK5/uzkkiArTv65oPy4wZEiOzTJ 2TMQ== X-Gm-Message-State: AOAM531Re8iKT+Azx4G2yquB5vTLWlEIVFFc/VfdKIVv/eTEzjKhhMmF jmnOc2Jow2uMHlR+ySY008zvyEs8tQMyTg== X-Received: by 2002:a17:90b:4c49:b0:1c7:d6c1:bb0f with SMTP id np9-20020a17090b4c4900b001c7d6c1bb0fmr4192833pjb.230.1649166437293; Tue, 05 Apr 2022 06:47:17 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id c18-20020a056a000ad200b004f0f9696578sm17112705pfl.141.2022.04.05.06.47.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Apr 2022 06:47:17 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 5 Apr 2022 21:47:06 +0800 Message-Id: <1649166427-9667-4-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1649166427-9667-1-git-send-email-lance.lmwang@gmail.com> References: <1648423513-21261-1-git-send-email-lance.lmwang@gmail.com> <1649166427-9667-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v3 4/5] fftools/ffprobe: add support for ambient viewing environment metadata X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: HVcxg9Uimlvx From: Limin Wang Signed-off-by: Limin Wang --- fftools/ffprobe.c | 5 +++++ tests/ref/fate/hevc-dv-rpu | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 05c167e..a13b93e 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2605,6 +2605,11 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, AVContentLightMetadata *metadata = (AVContentLightMetadata *)sd->data; print_int("max_content", metadata->MaxCLL); print_int("max_average", metadata->MaxFALL); + } else if (sd->type == AV_FRAME_DATA_AMBIENT_VIEWING_ENV) { + AVAmbientViewingEnv *metadata = (AVAmbientViewingEnv *)sd->data; + print_int("ambient_illuminance", metadata->ambient_illuminance); + print_int("ambient_light_x", metadata->ambient_light_x); + print_int("ambient_light_y", metadata->ambient_light_y); } else if (sd->type == AV_FRAME_DATA_ICC_PROFILE) { const AVDictionaryEntry *tag = av_dict_get(sd->metadata, "name", NULL, AV_DICT_MATCH_CASE); if (tag) diff --git a/tests/ref/fate/hevc-dv-rpu b/tests/ref/fate/hevc-dv-rpu index 6879f71..4ad5436 100644 --- a/tests/ref/fate/hevc-dv-rpu +++ b/tests/ref/fate/hevc-dv-rpu @@ -119,6 +119,9 @@ source_diagonal=42 [/SIDE_DATA] [SIDE_DATA] side_data_type=Ambient Viewing Environment +ambient_illuminance=3140000 +ambient_light_x=15635 +ambient_light_y=16450 [/SIDE_DATA] [/FRAME] [FRAME] @@ -239,5 +242,8 @@ source_diagonal=42 [/SIDE_DATA] [SIDE_DATA] side_data_type=Ambient Viewing Environment +ambient_illuminance=3140000 +ambient_light_x=15635 +ambient_light_y=16450 [/SIDE_DATA] [/FRAME] From patchwork Tue Apr 5 13:47:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 35214 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp308903pzb; Tue, 5 Apr 2022 06:48:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRgYaQqf8fh/lOPydjPbv+60IcuOukTeVZMQ/+6eOSe+4YArUthTvO23IKLcOexK0yA3BA X-Received: by 2002:a17:906:4fc4:b0:6da:b4c6:fadb with SMTP id i4-20020a1709064fc400b006dab4c6fadbmr3721646ejw.282.1649166492044; Tue, 05 Apr 2022 06:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649166492; cv=none; d=google.com; s=arc-20160816; b=R5jyjKDAK1kmY9rYb8D9uJFT9mnbDiN6w4lkF56c0MikDAtWZZ6JOMlZ8SNU6vHqze yXKtF+z4vdAm/AHT+AS42wLj/bplyx03biwMwehlt/kZw8GPkNSzCBx+upzmCU9di1H1 uZ+EjndE/yql/4TBEFoLb26yW0NhzOBApnqDdQHIVInPF8orWAOazMfEz0LpI8qXZAVc t+tm4S+uUaNcUQtxeR0d13CRO6T8ZkWd5aZPLo7WFeYcAFPdo/nWHuMU/HuJFyZsaH4y Ay848zcCm5sLpIPVLOG4G7j57duVZ9fOhoaIiF9JI7JyxT45A19WzvqGxmVaws1FDMLg jWeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=s6D+RZ9ltYONcTvSRmpgYtFBoD2RPW0Rf6x9vPDdcOU=; b=AIMw23xGBPI0kPgvyn9f/+3bH8gYCtX5Y7yaLnc1fl0LrFXe6PQM9ZMTagwB9esy06 brZd1mtRBzBE6iykjUozolDMevvANPCccCpU8sx06ObVK9AWYXdjpDo6vThYSbRVLMQv BFt1tVFPuri6QreCFewjKSdF35bOTqcwy7xYdsHXJAKLQaZYIG0C1KbY5iuD/KKgSAf0 ktYcZdhFZjGNfx+ng9roQizgv5kYwXR8p9SLIzJf08Tx0VINXg1DyLafx4zs3ij2ZsKX 64eWle5s+MfBVu8uEd3wCq3747/hDyMh4SHrJ9++58k+4PZzklksifQyNgY0F9P0UJdK v9Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=dr7QtYxV; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id kv11-20020a17090778cb00b006e8035bb2f1si2996175ejc.548.2022.04.05.06.48.11; Tue, 05 Apr 2022 06:48:12 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=dr7QtYxV; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BBCB468B181; Tue, 5 Apr 2022 16:47:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7D6FE68B20E for ; Tue, 5 Apr 2022 16:47:20 +0300 (EEST) Received: by mail-pf1-f179.google.com with SMTP id b13so12209586pfv.0 for ; Tue, 05 Apr 2022 06:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xkAwLY9t/wNjEg3e7uZzuTlJHdjnbCVXOJhxNyKI02k=; b=dr7QtYxVqvWrCDzWGMTPds6I5kEfuz9WNL++dVAvPyiJLJ+yHeMFXLZmECnB7aVCR4 v0v7lreqr0buBvria+59n14HKXP22a8B4x2ZKfhy0yioNKLVDDUe2/jujozRQ5Kk+JPS d/MClbkQClLPiyyYMyi1AsUUcBYNMhvMAwbOVbcQMuC4CIKXI8qjUZmPxDLX9UgJH9y1 sWbn17+G3fARstYMWjT7IWrrOCuLeAFxJ89aba3OYBc80eThEs6PEDz7XmY2Meg3uYlA oksaaqxTJ069+8EtA/1+9kE1UdmKOy6qT/CTi2e/lGxm1cSSSd0e8QRSYPEUKcHIplZz py+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xkAwLY9t/wNjEg3e7uZzuTlJHdjnbCVXOJhxNyKI02k=; b=K8mNMA+BGR/niWAYBpN94vRAZ31jfnaiosjvbd+EszYjScO7bKfkFlNxnJZjSqFEbC UCpDU0UjpMNTfmEug5Suo7X0L/Co5SNZlMIU9ctXrOrZ93lkq3EaFOYbzZSp9hEfl2ya rvMjcJvTVqC1m6/cM/g/jQN00amWawimQAGNxP18JoalFcegQsdEOKkRlx74D2Map+t1 jRiA99vJU2/S6bvhw/XnUzTIFCnAyZVyTA/5+zXQFsV/IT1IqRyzYAWARCyyOygNr/aL 98PH2/QCYDtq7j4mWqWjNmRskVH53H3/3GVReRJMpbsVOJKpV9CxuDNjVWMV6/sqG6a+ a1ug== X-Gm-Message-State: AOAM531H30yYS4+KG9BNEs1GF9e3vihaehF8mxTqY63i0lVfSJmKXQFj f17aaJ9bMQLM6eWVMLRLg8kxc/gXijfYVQ== X-Received: by 2002:a63:7e41:0:b0:398:2829:2d94 with SMTP id o1-20020a637e41000000b0039828292d94mr3061148pgn.173.1649166438503; Tue, 05 Apr 2022 06:47:18 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id c18-20020a056a000ad200b004f0f9696578sm17112705pfl.141.2022.04.05.06.47.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Apr 2022 06:47:18 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 5 Apr 2022 21:47:07 +0800 Message-Id: <1649166427-9667-5-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1649166427-9667-1-git-send-email-lance.lmwang@gmail.com> References: <1648423513-21261-1-git-send-email-lance.lmwang@gmail.com> <1649166427-9667-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v3 5/5] avfilter/vf_showinfo: fix unknown side data type for DOVI_RPU_BUFFER X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 9gkJ/L7403c+ From: Limin Wang Signed-off-by: Limin Wang --- libavfilter/vf_showinfo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c index 1e81d26..18ddf12 100644 --- a/libavfilter/vf_showinfo.c +++ b/libavfilter/vf_showinfo.c @@ -824,6 +824,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) case AV_FRAME_DATA_AMBIENT_VIEWING_ENV: dump_ambient_viewing_env(ctx, sd); break; + case AV_FRAME_DATA_DOVI_RPU_BUFFER: + av_log(ctx, AV_LOG_INFO, "DOVI RPU raw data " + "(%"SIZE_SPECIFIER" bytes)", sd->size); + break; default: av_log(ctx, AV_LOG_WARNING, "unknown side data type %d " "(%"SIZE_SPECIFIER" bytes)\n", sd->type, sd->size);