diff mbox series

[FFmpeg-devel] vf_colorspace: Added linear trc.

Message ID 20200924190052.25001-1-clawsoon@yahoo.com
State Accepted
Commit a6e72fb46d0601d0fcf44c93c32dd472599b5984
Headers show
Series [FFmpeg-devel] vf_colorspace: Added linear trc. | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andrew Klaassen Sept. 24, 2020, 7 p.m. UTC
This patch adds the coefficients for the linear gamma function (1,0,1,0)
to the colorspace filter.

Signed-off-by: Andrew Klaassen <clawsoon@yahoo.com>
---
 libavfilter/vf_colorspace.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andrew Klaassen Sept. 24, 2020, 7:08 p.m. UTC | #1
On Thursday, September 24, 2020, 03:01:05 p.m. EDT, Andrew Klaassen <clawsoon-at-yahoo.com@ffmpeg.org> wrote:

> This patch adds the coefficients for the linear gamma function (1,0,1,0)
> to the colorspace filter.

I've been looking for an official standards documentation link to add for this, but haven't had luck so far. If it's important to get the patch accepted, I'll keep looking. So far it seems like everybody writing standards documents assumes that "multiply it by one to the power of one" is too trivial to write down.

Thanks.

Andrew
Ronald S. Bultje Sept. 27, 2020, 1:15 p.m. UTC | #2
Hi,

On Thu, Sep 24, 2020 at 3:01 PM Andrew Klaassen <
clawsoon-at-yahoo.com@ffmpeg.org> wrote:

> This patch adds the coefficients for the linear gamma function (1,0,1,0)
> to the colorspace filter.
>
> Signed-off-by: Andrew Klaassen <clawsoon@yahoo.com>
> ---
>  libavfilter/vf_colorspace.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
> index 34f13d9d3c..39af74c221 100644
> --- a/libavfilter/vf_colorspace.c
> +++ b/libavfilter/vf_colorspace.c
> @@ -179,6 +179,7 @@ static const struct TransferCharacteristics
> transfer_characteristics[AVCOL_TRC_N
>      [AVCOL_TRC_GAMMA28]   = { 1.0,    0.0,    1.0 / 2.8, 0.0 },
>      [AVCOL_TRC_SMPTE170M] = { 1.099,  0.018,  0.45, 4.5 },
>      [AVCOL_TRC_SMPTE240M] = { 1.1115, 0.0228, 0.45, 4.0 },
> +    [AVCOL_TRC_LINEAR]    = { 1.0,    0.0,    1.0,  0.0 },
>      [AVCOL_TRC_IEC61966_2_1] = { 1.055, 0.0031308, 1.0 / 2.4, 12.92 },
>      [AVCOL_TRC_IEC61966_2_4] = { 1.099, 0.018, 0.45, 4.5 },
>      [AVCOL_TRC_BT2020_10] = { 1.099,  0.018,  0.45, 4.5 },
> @@ -990,6 +991,7 @@ static const AVOption colorspace_options[] = {
>      ENUM("gamma28",      AVCOL_TRC_GAMMA28,      "trc"),
>      ENUM("smpte170m",    AVCOL_TRC_SMPTE170M,    "trc"),
>      ENUM("smpte240m",    AVCOL_TRC_SMPTE240M,    "trc"),
> +    ENUM("linear",       AVCOL_TRC_LINEAR,       "trc"),
>      ENUM("srgb",         AVCOL_TRC_IEC61966_2_1, "trc"),
>      ENUM("iec61966-2-1", AVCOL_TRC_IEC61966_2_1, "trc"),
>      ENUM("xvycc",        AVCOL_TRC_IEC61966_2_4, "trc"),
> --
> 2.26.2


Merged.

Ronald
Andrew Klaassen Sept. 27, 2020, 1:18 p.m. UTC | #3
On Sunday, September 27, 2020, 09:15:54 a.m. EDT, Ronald S. Bultje <rsbultje@gmail.com> wrote:

> Merged.

Thanks!

Andrew
diff mbox series

Patch

diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index 34f13d9d3c..39af74c221 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -179,6 +179,7 @@  static const struct TransferCharacteristics transfer_characteristics[AVCOL_TRC_N
     [AVCOL_TRC_GAMMA28]   = { 1.0,    0.0,    1.0 / 2.8, 0.0 },
     [AVCOL_TRC_SMPTE170M] = { 1.099,  0.018,  0.45, 4.5 },
     [AVCOL_TRC_SMPTE240M] = { 1.1115, 0.0228, 0.45, 4.0 },
+    [AVCOL_TRC_LINEAR]    = { 1.0,    0.0,    1.0,  0.0 },
     [AVCOL_TRC_IEC61966_2_1] = { 1.055, 0.0031308, 1.0 / 2.4, 12.92 },
     [AVCOL_TRC_IEC61966_2_4] = { 1.099, 0.018, 0.45, 4.5 },
     [AVCOL_TRC_BT2020_10] = { 1.099,  0.018,  0.45, 4.5 },
@@ -990,6 +991,7 @@  static const AVOption colorspace_options[] = {
     ENUM("gamma28",      AVCOL_TRC_GAMMA28,      "trc"),
     ENUM("smpte170m",    AVCOL_TRC_SMPTE170M,    "trc"),
     ENUM("smpte240m",    AVCOL_TRC_SMPTE240M,    "trc"),
+    ENUM("linear",       AVCOL_TRC_LINEAR,       "trc"),
     ENUM("srgb",         AVCOL_TRC_IEC61966_2_1, "trc"),
     ENUM("iec61966-2-1", AVCOL_TRC_IEC61966_2_1, "trc"),
     ENUM("xvycc",        AVCOL_TRC_IEC61966_2_4, "trc"),