PR #23135 opened by Marcos Ashton (MarcosAsh)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23135
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23135.patch

## Summary
- ambient_viewing_environment -- exercises av_ambient_viewing_environment_alloc 
with and without the size out-parameter, and 
av_ambient_viewing_environment_create_side_data. Verifies the {0, 1} rational 
defaults, write/read-back of the three AVRational fields, frame side data 
attachment, and OOM paths via av_max_alloc.
  
  Coverage for libavutil/ambient_viewing_environment.c: 60.00% -> 100.00%

- csp -- exercises the five public functions not already covered by 
tests/color_utils (av_csp_luma_coeffs_from_avcsp, 
av_csp_primaries_desc_from_id, av_csp_primaries_id_from_desc, 
av_csp_approximate_trc_gamma, av_csp_approximate_eotf_gamma). Iterates every 
AVCOL_SPC, AVCOL_PRI, and AVCOL_TRC value including the extended ranges, 
round-trips primaries via desc comparison so canonical first-matches (e.g. 
smpte170m for smpte240m) are accepted, checks that a garbage desc returns 
AVCOL_PRI_UNSPECIFIED, and that ut-of-range enums return NULL or 0.0 as 
documented. The trc/eotf gamma values come from static lookup tables so the 
floating point output is bitexact across platforms.
  
  Coverage for libavutil/csp.c: 88.50% -> 94.46%

  Baselines measured from the full FATE suite via coverage.ffmpeg.org as of 
2026-05-17.



>From 955af42329e8b88f9bef0af85b330b1663eb2c00 Mon Sep 17 00:00:00 2001
From: marcos ashton <[email protected]>
Date: Mon, 18 May 2026 00:23:05 +0100
Subject: [PATCH 1/2] tests/fate/libavutil: add FATE test for
 ambient_viewing_environment

Test av_ambient_viewing_environment_alloc with and without the size
out-parameter, and av_ambient_viewing_environment_create_side_data.
Verifies the {0, 1} rational defaults set by get_defaults(),
write/read-back of the three AVRational fields, frame side data
attachment, and OOM paths via av_max_alloc.

Coverage for libavutil/ambient_viewing_environment.c: 60.00% -> 100.00%
---
 .forgejo/CODEOWNERS                           |   2 +
 libavutil/Makefile                            |   1 +
 libavutil/tests/.gitignore                    |   1 +
 libavutil/tests/ambient_viewing_environment.c | 108 ++++++++++++++++++
 tests/fate/libavutil.mak                      |   4 +
 tests/ref/fate/ambient_viewing_environment    |  19 +++
 6 files changed, 135 insertions(+)
 create mode 100644 libavutil/tests/ambient_viewing_environment.c
 create mode 100644 tests/ref/fate/ambient_viewing_environment

diff --git a/.forgejo/CODEOWNERS b/.forgejo/CODEOWNERS
index d3bfa07145..fa0c62218c 100644
--- a/.forgejo/CODEOWNERS
+++ b/.forgejo/CODEOWNERS
@@ -232,11 +232,13 @@ doc/.* @GyanD
 # tests
 # =====
 tests/checkasm/riscv/.* @Courmisch
+libavutil/tests/ambient_viewing_environment.* @MarcosAsh
 libavutil/tests/buffer.* @MarcosAsh
 libavutil/tests/hdr_dynamic_vivid_metadata.* @MarcosAsh
 libavutil/tests/tdrdi.* @MarcosAsh
 libavutil/tests/timestamp.* @MarcosAsh
 tests/ref/.*drawvg.* @ayosec
+tests/ref/fate/ambient_viewing_environment @MarcosAsh
 tests/ref/fate/buffer @MarcosAsh
 tests/ref/fate/hdr_dynamic_vivid_metadata @MarcosAsh
 tests/ref/fate/sub-mcc.* @programmerjake
diff --git a/libavutil/Makefile b/libavutil/Makefile
index b7d6e4906f..3fe02936ef 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -258,6 +258,7 @@ SKIPHEADERS-$(CONFIG_SHADER_COMPRESSION) += zlib_utils.h
 TESTPROGS = adler32                                                     \
             aes                                                         \
             aes_ctr                                                     \
+            ambient_viewing_environment                                 \
             audio_fifo                                                  \
             avstring                                                    \
             base64                                                      \
diff --git a/libavutil/tests/.gitignore b/libavutil/tests/.gitignore
index b43c1e395b..47b319bb89 100644
--- a/libavutil/tests/.gitignore
+++ b/libavutil/tests/.gitignore
@@ -1,6 +1,7 @@
 /adler32
 /aes
 /aes_ctr
+/ambient_viewing_environment
 /atomic
 /audio_fifo
 /avstring
diff --git a/libavutil/tests/ambient_viewing_environment.c 
b/libavutil/tests/ambient_viewing_environment.c
new file mode 100644
index 0000000000..f15b76b0c2
--- /dev/null
+++ b/libavutil/tests/ambient_viewing_environment.c
@@ -0,0 +1,108 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <limits.h>
+#include <stdio.h>
+
+#include "libavutil/ambient_viewing_environment.h"
+#include "libavutil/frame.h"
+#include "libavutil/mem.h"
+
+static void print_env(const AVAmbientViewingEnvironment *env)
+{
+    printf("illuminance=%d/%d, light_x=%d/%d, light_y=%d/%d\n",
+           env->ambient_illuminance.num, env->ambient_illuminance.den,
+           env->ambient_light_x.num,     env->ambient_light_x.den,
+           env->ambient_light_y.num,     env->ambient_light_y.den);
+}
+
+int main(void)
+{
+    AVAmbientViewingEnvironment *env;
+    AVFrame *frame;
+    size_t size = 0;
+
+    /* av_ambient_viewing_environment_alloc with size out-param */
+    printf("Testing av_ambient_viewing_environment_alloc(&size)\n");
+    env = av_ambient_viewing_environment_alloc(&size);
+    if (env) {
+        printf("alloc: OK, size_set=%s\n", size == sizeof(*env) ? "yes" : 
"no");
+        print_env(env);
+        av_free(env);
+    } else {
+        printf("alloc: FAIL\n");
+    }
+
+    /* av_ambient_viewing_environment_alloc with NULL size */
+    printf("\nTesting av_ambient_viewing_environment_alloc(NULL)\n");
+    env = av_ambient_viewing_environment_alloc(NULL);
+    if (env) {
+        printf("alloc(NULL): OK\n");
+        print_env(env);
+        av_free(env);
+    } else {
+        printf("alloc(NULL): FAIL\n");
+    }
+
+    /* write and read back */
+    printf("\nTesting write/read back\n");
+    env = av_ambient_viewing_environment_alloc(NULL);
+    if (env) {
+        env->ambient_illuminance = (AVRational){ 314, 10 };
+        env->ambient_light_x     = (AVRational){ 15635, 50000 };
+        env->ambient_light_y     = (AVRational){ 16450, 50000 };
+        print_env(env);
+        av_free(env);
+    }
+
+    /* av_ambient_viewing_environment_create_side_data */
+    printf("\nTesting av_ambient_viewing_environment_create_side_data()\n");
+    frame = av_frame_alloc();
+    if (frame) {
+        env = av_ambient_viewing_environment_create_side_data(frame);
+        if (env) {
+            printf("side_data: OK\n");
+            print_env(env);
+        } else {
+            printf("side_data: FAIL\n");
+        }
+        av_frame_free(&frame);
+    }
+
+    /* OOM paths via av_max_alloc */
+    printf("\nTesting OOM paths\n");
+    av_max_alloc(1);
+    env = av_ambient_viewing_environment_alloc(&size);
+    printf("alloc OOM: %s\n", env ? "FAIL" : "OK");
+    av_free(env);
+    env = av_ambient_viewing_environment_alloc(NULL);
+    printf("alloc(NULL) OOM: %s\n", env ? "FAIL" : "OK");
+    av_free(env);
+    av_max_alloc(INT_MAX);
+
+    frame = av_frame_alloc();
+    if (frame) {
+        av_max_alloc(1);
+        env = av_ambient_viewing_environment_create_side_data(frame);
+        printf("side_data OOM: %s\n", env ? "FAIL" : "OK");
+        av_max_alloc(INT_MAX);
+        av_frame_free(&frame);
+    }
+
+    return 0;
+}
diff --git a/tests/fate/libavutil.mak b/tests/fate/libavutil.mak
index e814ee884c..166c0d8c64 100644
--- a/tests/fate/libavutil.mak
+++ b/tests/fate/libavutil.mak
@@ -13,6 +13,10 @@ fate-aes_ctr: libavutil/tests/aes_ctr$(EXESUF)
 fate-aes_ctr: CMD = run libavutil/tests/aes_ctr$(EXESUF)
 fate-aes_ctr: CMP = null
 
+FATE_LIBAVUTIL += fate-ambient_viewing_environment
+fate-ambient_viewing_environment: 
libavutil/tests/ambient_viewing_environment$(EXESUF)
+fate-ambient_viewing_environment: CMD = run 
libavutil/tests/ambient_viewing_environment$(EXESUF)
+
 FATE_LIBAVUTIL += fate-camellia
 fate-camellia: libavutil/tests/camellia$(EXESUF)
 fate-camellia: CMD = run libavutil/tests/camellia$(EXESUF)
diff --git a/tests/ref/fate/ambient_viewing_environment 
b/tests/ref/fate/ambient_viewing_environment
new file mode 100644
index 0000000000..ef66095c5e
--- /dev/null
+++ b/tests/ref/fate/ambient_viewing_environment
@@ -0,0 +1,19 @@
+Testing av_ambient_viewing_environment_alloc(&size)
+alloc: OK, size_set=yes
+illuminance=0/1, light_x=0/1, light_y=0/1
+
+Testing av_ambient_viewing_environment_alloc(NULL)
+alloc(NULL): OK
+illuminance=0/1, light_x=0/1, light_y=0/1
+
+Testing write/read back
+illuminance=314/10, light_x=15635/50000, light_y=16450/50000
+
+Testing av_ambient_viewing_environment_create_side_data()
+side_data: OK
+illuminance=0/1, light_x=0/1, light_y=0/1
+
+Testing OOM paths
+alloc OOM: OK
+alloc(NULL) OOM: OK
+side_data OOM: OK
-- 
2.52.0


>From 29f50f65609b3fcf95c11ef4d4d4d58ad03a6290 Mon Sep 17 00:00:00 2001
From: marcos ashton <[email protected]>
Date: Mon, 18 May 2026 00:23:43 +0100
Subject: [PATCH 2/2] tests/fate/libavutil: add FATE test for csp

Test the five public functions not already covered by
tests/color_utils: av_csp_luma_coeffs_from_avcsp,
av_csp_primaries_desc_from_id, av_csp_primaries_id_from_desc,
av_csp_approximate_trc_gamma, and av_csp_approximate_eotf_gamma.
Iterates every AVCOL_SPC, AVCOL_PRI, and AVCOL_TRC value including
the extended ranges, round-trips primaries via desc_eq so the
canonical first-match (e.g. smpte170m for smpte240m) is accepted,
checks that a garbage desc returns AVCOL_PRI_UNSPECIFIED, and that
out-of-range enum values return NULL or 0.0 as documented. The
trc/eotf gamma values come from static lookup tables so the
floating point output is bitexact across platforms.

Coverage for libavutil/csp.c: 88.50% -> 94.46%
---
 .forgejo/CODEOWNERS        |   2 +
 libavutil/Makefile         |   1 +
 libavutil/tests/.gitignore |   1 +
 libavutil/tests/csp.c      | 145 +++++++++++++++++++++++++++++++++++++
 tests/fate/libavutil.mak   |   4 +
 tests/ref/fate/csp         | 131 +++++++++++++++++++++++++++++++++
 6 files changed, 284 insertions(+)
 create mode 100644 libavutil/tests/csp.c
 create mode 100644 tests/ref/fate/csp

diff --git a/.forgejo/CODEOWNERS b/.forgejo/CODEOWNERS
index fa0c62218c..3ada7b3e18 100644
--- a/.forgejo/CODEOWNERS
+++ b/.forgejo/CODEOWNERS
@@ -234,12 +234,14 @@ doc/.* @GyanD
 tests/checkasm/riscv/.* @Courmisch
 libavutil/tests/ambient_viewing_environment.* @MarcosAsh
 libavutil/tests/buffer.* @MarcosAsh
+libavutil/tests/csp.* @MarcosAsh
 libavutil/tests/hdr_dynamic_vivid_metadata.* @MarcosAsh
 libavutil/tests/tdrdi.* @MarcosAsh
 libavutil/tests/timestamp.* @MarcosAsh
 tests/ref/.*drawvg.* @ayosec
 tests/ref/fate/ambient_viewing_environment @MarcosAsh
 tests/ref/fate/buffer @MarcosAsh
+tests/ref/fate/csp @MarcosAsh
 tests/ref/fate/hdr_dynamic_vivid_metadata @MarcosAsh
 tests/ref/fate/sub-mcc.* @programmerjake
 tests/ref/fate/tdrdi @MarcosAsh
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 3fe02936ef..a43ca5ec2d 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -270,6 +270,7 @@ TESTPROGS = adler32                                         
            \
             channel_layout                                              \
             color_utils                                                 \
             cpu                                                         \
+            csp                                                         \
             crc                                                         \
             des                                                         \
             detection_bbox                                              \
diff --git a/libavutil/tests/.gitignore b/libavutil/tests/.gitignore
index 47b319bb89..38aa09022b 100644
--- a/libavutil/tests/.gitignore
+++ b/libavutil/tests/.gitignore
@@ -16,6 +16,7 @@
 /cpu
 /cpu_init
 /crc
+/csp
 /des
 /detection_bbox
 /dict
diff --git a/libavutil/tests/csp.c b/libavutil/tests/csp.c
new file mode 100644
index 0000000000..f21966452e
--- /dev/null
+++ b/libavutil/tests/csp.c
@@ -0,0 +1,145 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdio.h>
+
+#include "libavutil/csp.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/pixfmt.h"
+
+static void print_cie(const char *label, AVCIExy xy)
+{
+    printf("  %s=(%d/%d, %d/%d)\n", label,
+           xy.x.num, xy.x.den, xy.y.num, xy.y.den);
+}
+
+static int cie_eq(AVCIExy a, AVCIExy b)
+{
+    return av_cmp_q(a.x, b.x) == 0 && av_cmp_q(a.y, b.y) == 0;
+}
+
+static int desc_eq(const AVColorPrimariesDesc *a, const AVColorPrimariesDesc 
*b)
+{
+    return cie_eq(a->wp,     b->wp)     &&
+           cie_eq(a->prim.r, b->prim.r) &&
+           cie_eq(a->prim.g, b->prim.g) &&
+           cie_eq(a->prim.b, b->prim.b);
+}
+
+int main(void)
+{
+    /* av_csp_luma_coeffs_from_avcsp: iterate every defined colorspace */
+    printf("Testing av_csp_luma_coeffs_from_avcsp()\n");
+    for (enum AVColorSpace csp = 0; csp < AVCOL_SPC_NB; csp++) {
+        const AVLumaCoefficients *c = av_csp_luma_coeffs_from_avcsp(csp);
+        const char *name = av_color_space_name(csp);
+        if (!c) {
+            printf("csp=%-16s -> NULL\n", name ? name : "?");
+            continue;
+        }
+        printf("csp=%-16s -> cr=%d/%d cg=%d/%d cb=%d/%d\n",
+               name ? name : "?",
+               c->cr.num, c->cr.den,
+               c->cg.num, c->cg.den,
+               c->cb.num, c->cb.den);
+    }
+    /* out-of-range enum */
+    printf("csp=AVCOL_SPC_NB         -> %s\n",
+           av_csp_luma_coeffs_from_avcsp(AVCOL_SPC_NB) ? "FAIL" : "NULL");
+
+    /* av_csp_primaries_desc_from_id + av_csp_primaries_id_from_desc */
+    printf("\nTesting av_csp_primaries_desc_from_id() round trip\n");
+    for (enum AVColorPrimaries prm = 0; prm < AVCOL_PRI_EXT_NB; prm++) {
+        const AVColorPrimariesDesc *d;
+        const AVColorPrimariesDesc *d_back;
+        enum AVColorPrimaries back;
+        const char *name, *back_name, *status;
+
+        if (prm == AVCOL_PRI_NB)
+            prm = AVCOL_PRI_EXT_BASE;
+
+        d    = av_csp_primaries_desc_from_id(prm);
+        name = av_color_primaries_name(prm);
+        if (!d) {
+            printf("prm=%-16s -> NULL\n", name ? name : "?");
+            continue;
+        }
+        printf("prm=%-16s ->\n", name ? name : "?");
+        print_cie("wp ", d->wp);
+        print_cie("r  ", d->prim.r);
+        print_cie("g  ", d->prim.g);
+        print_cie("b  ", d->prim.b);
+
+        /* For colorspaces with identical primaries (e.g. smpte170m and
+         * smpte240m), the canonical first match may differ from the input
+         * enum, so compare descs not enums.  id_from_desc only searches
+         * the base AVCOL_PRI_* range and returns UNSPECIFIED for
+         * extended-range inputs that have no base match. */
+        back      = av_csp_primaries_id_from_desc(d);
+        d_back    = av_csp_primaries_desc_from_id(back);
+        back_name = av_color_primaries_name(back);
+        if (back == AVCOL_PRI_UNSPECIFIED)
+            status = prm >= AVCOL_PRI_EXT_BASE ? "ext-no-base-match"
+                                               : "MISMATCH";
+        else
+            status = d_back && desc_eq(d, d_back) ? "OK" : "MISMATCH";
+        printf("  round-trip id=%-16s desc=%s\n",
+               back_name ? back_name : "?", status);
+    }
+    /* out-of-range enum */
+    printf("prm=AVCOL_PRI_NB         -> %s\n",
+           av_csp_primaries_desc_from_id(AVCOL_PRI_NB) ? "FAIL" : "NULL");
+
+    /* id_from_desc on a garbage description returns UNSPECIFIED */
+    {
+        AVColorPrimariesDesc garbage = {
+            .wp   = { { 0, 1 }, { 0, 1 } },
+            .prim = {
+                .r = { { 0, 1 }, { 0, 1 } },
+                .g = { { 0, 1 }, { 0, 1 } },
+                .b = { { 0, 1 }, { 0, 1 } },
+            },
+        };
+        enum AVColorPrimaries back = av_csp_primaries_id_from_desc(&garbage);
+        printf("garbage desc -> %s (expect AVCOL_PRI_UNSPECIFIED)\n",
+               av_color_primaries_name(back) ? av_color_primaries_name(back) : 
"?");
+    }
+
+    /* av_csp_approximate_trc_gamma + av_csp_approximate_eotf_gamma:
+     * both return values from static tables, so output is bitexact. */
+    printf("\nTesting av_csp_approximate_{trc,eotf}_gamma()\n");
+    for (enum AVColorTransferCharacteristic trc = 0; trc < AVCOL_TRC_EXT_NB; 
trc++) {
+        const char *name;
+        double g_trc, g_eotf;
+
+        if (trc == AVCOL_TRC_NB)
+            trc = AVCOL_TRC_EXT_BASE;
+
+        name   = av_color_transfer_name(trc);
+        g_trc  = av_csp_approximate_trc_gamma(trc);
+        g_eotf = av_csp_approximate_eotf_gamma(trc);
+        printf("trc=%-16s trc_gamma=%.6f eotf_gamma=%.6f\n",
+               name ? name : "?", g_trc, g_eotf);
+    }
+    /* out-of-range enum: both must return 0.0 */
+    printf("trc=AVCOL_TRC_NB         trc_gamma=%.6f eotf_gamma=%.6f\n",
+           av_csp_approximate_trc_gamma(AVCOL_TRC_NB),
+           av_csp_approximate_eotf_gamma(AVCOL_TRC_NB));
+
+    return 0;
+}
diff --git a/tests/fate/libavutil.mak b/tests/fate/libavutil.mak
index 166c0d8c64..a2ea57d939 100644
--- a/tests/fate/libavutil.mak
+++ b/tests/fate/libavutil.mak
@@ -73,6 +73,10 @@ FATE_LIBAVUTIL += fate-color_utils
 fate-color_utils: libavutil/tests/color_utils$(EXESUF)
 fate-color_utils: CMD = run libavutil/tests/color_utils$(EXESUF)
 
+FATE_LIBAVUTIL += fate-csp
+fate-csp: libavutil/tests/csp$(EXESUF)
+fate-csp: CMD = run libavutil/tests/csp$(EXESUF)
+
 FATE_LIBAVUTIL += fate-des
 fate-des: libavutil/tests/des$(EXESUF)
 fate-des: CMD = run libavutil/tests/des$(EXESUF)
diff --git a/tests/ref/fate/csp b/tests/ref/fate/csp
new file mode 100644
index 0000000000..bc36bc66ba
--- /dev/null
+++ b/tests/ref/fate/csp
@@ -0,0 +1,131 @@
+Testing av_csp_luma_coeffs_from_avcsp()
+csp=gbr              -> cr=100000/100000 cg=100000/100000 cb=100000/100000
+csp=bt709            -> cr=21260/100000 cg=71520/100000 cb=7220/100000
+csp=unknown          -> NULL
+csp=reserved         -> NULL
+csp=fcc              -> cr=30000/100000 cg=59000/100000 cb=11000/100000
+csp=bt470bg          -> cr=29900/100000 cg=58700/100000 cb=11400/100000
+csp=smpte170m        -> cr=29900/100000 cg=58700/100000 cb=11400/100000
+csp=smpte240m        -> cr=21200/100000 cg=70100/100000 cb=8700/100000
+csp=ycgco            -> cr=25000/100000 cg=50000/100000 cb=25000/100000
+csp=bt2020nc         -> cr=26270/100000 cg=67800/100000 cb=5930/100000
+csp=bt2020c          -> cr=26270/100000 cg=67800/100000 cb=5930/100000
+csp=smpte2085        -> NULL
+csp=chroma-derived-nc -> NULL
+csp=chroma-derived-c -> NULL
+csp=ictcp            -> NULL
+csp=ipt-c2           -> NULL
+csp=ycgco-re         -> NULL
+csp=ycgco-ro         -> NULL
+csp=AVCOL_SPC_NB         -> NULL
+
+Testing av_csp_primaries_desc_from_id() round trip
+prm=reserved         -> NULL
+prm=bt709            ->
+  wp =(31270/100000, 32900/100000)
+  r  =(64000/100000, 33000/100000)
+  g  =(30000/100000, 60000/100000)
+  b  =(15000/100000, 6000/100000)
+  round-trip id=bt709            desc=OK
+prm=unknown          -> NULL
+prm=reserved         -> NULL
+prm=bt470m           ->
+  wp =(31000/100000, 31600/100000)
+  r  =(67000/100000, 33000/100000)
+  g  =(21000/100000, 71000/100000)
+  b  =(14000/100000, 8000/100000)
+  round-trip id=bt470m           desc=OK
+prm=bt470bg          ->
+  wp =(31270/100000, 32900/100000)
+  r  =(64000/100000, 33000/100000)
+  g  =(29000/100000, 60000/100000)
+  b  =(15000/100000, 6000/100000)
+  round-trip id=bt470bg          desc=OK
+prm=smpte170m        ->
+  wp =(31270/100000, 32900/100000)
+  r  =(63000/100000, 34000/100000)
+  g  =(31000/100000, 59500/100000)
+  b  =(15500/100000, 7000/100000)
+  round-trip id=smpte170m        desc=OK
+prm=smpte240m        ->
+  wp =(31270/100000, 32900/100000)
+  r  =(63000/100000, 34000/100000)
+  g  =(31000/100000, 59500/100000)
+  b  =(15500/100000, 7000/100000)
+  round-trip id=smpte170m        desc=OK
+prm=film             ->
+  wp =(31000/100000, 31600/100000)
+  r  =(68100/100000, 31900/100000)
+  g  =(24300/100000, 69200/100000)
+  b  =(14500/100000, 4900/100000)
+  round-trip id=film             desc=OK
+prm=bt2020           ->
+  wp =(31270/100000, 32900/100000)
+  r  =(70800/100000, 29200/100000)
+  g  =(17000/100000, 79700/100000)
+  b  =(13100/100000, 4600/100000)
+  round-trip id=bt2020           desc=OK
+prm=smpte428         ->
+  wp =(1/3, 1/3)
+  r  =(73500/100000, 26500/100000)
+  g  =(27400/100000, 71800/100000)
+  b  =(16700/100000, 900/100000)
+  round-trip id=smpte428         desc=OK
+prm=smpte431         ->
+  wp =(31400/100000, 35100/100000)
+  r  =(68000/100000, 32000/100000)
+  g  =(26500/100000, 69000/100000)
+  b  =(15000/100000, 6000/100000)
+  round-trip id=smpte431         desc=OK
+prm=smpte432         ->
+  wp =(31270/100000, 32900/100000)
+  r  =(68000/100000, 32000/100000)
+  g  =(26500/100000, 69000/100000)
+  b  =(15000/100000, 6000/100000)
+  round-trip id=smpte432         desc=OK
+prm=?                -> NULL
+prm=?                -> NULL
+prm=?                -> NULL
+prm=?                -> NULL
+prm=?                -> NULL
+prm=?                -> NULL
+prm=?                -> NULL
+prm=?                -> NULL
+prm=?                -> NULL
+prm=ebu3213          ->
+  wp =(31270/100000, 32900/100000)
+  r  =(63000/100000, 34000/100000)
+  g  =(29500/100000, 60500/100000)
+  b  =(15500/100000, 7700/100000)
+  round-trip id=ebu3213          desc=OK
+prm=vgamut           ->
+  wp =(31270/100000, 32900/100000)
+  r  =(73000/100000, 28000/100000)
+  g  =(16500/100000, 84000/100000)
+  b  =(10000/100000, -2999/100000)
+  round-trip id=unknown          desc=ext-no-base-match
+prm=AVCOL_PRI_NB         -> NULL
+garbage desc -> unknown (expect AVCOL_PRI_UNSPECIFIED)
+
+Testing av_csp_approximate_{trc,eotf}_gamma()
+trc=reserved         trc_gamma=0.000000 eotf_gamma=0.000000
+trc=bt709            trc_gamma=1.961000 eotf_gamma=2.200000
+trc=unknown          trc_gamma=0.000000 eotf_gamma=0.000000
+trc=reserved         trc_gamma=0.000000 eotf_gamma=0.000000
+trc=bt470m           trc_gamma=2.200000 eotf_gamma=2.200000
+trc=bt470bg          trc_gamma=2.800000 eotf_gamma=2.800000
+trc=smpte170m        trc_gamma=1.961000 eotf_gamma=2.200000
+trc=smpte240m        trc_gamma=1.961000 eotf_gamma=2.200000
+trc=linear           trc_gamma=1.000000 eotf_gamma=1.000000
+trc=log100           trc_gamma=0.000000 eotf_gamma=0.000000
+trc=log316           trc_gamma=0.000000 eotf_gamma=0.000000
+trc=iec61966-2-4     trc_gamma=0.000000 eotf_gamma=0.000000
+trc=bt1361e          trc_gamma=1.961000 eotf_gamma=2.200000
+trc=iec61966-2-1     trc_gamma=2.200000 eotf_gamma=2.200000
+trc=bt2020-10        trc_gamma=1.961000 eotf_gamma=2.200000
+trc=bt2020-12        trc_gamma=1.961000 eotf_gamma=2.200000
+trc=smpte2084        trc_gamma=0.000000 eotf_gamma=0.000000
+trc=smpte428         trc_gamma=2.600000 eotf_gamma=2.600000
+trc=arib-std-b67     trc_gamma=0.000000 eotf_gamma=0.000000
+trc=vlog             trc_gamma=2.200000 eotf_gamma=2.200000
+trc=AVCOL_TRC_NB         trc_gamma=0.000000 eotf_gamma=0.000000
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to