diff mbox

[FFmpeg-devel] vf_colorspace: Add support for iec61966-2.1 (sRGB) transfer

Message ID 20161018191726.2894-1-vittorio.giovara@gmail.com
State Accepted
Commit ba53d3ae8bfbd9a66b6f18569c1c4c4d0cc03d7a
Headers show

Commit Message

Vittorio Giovara Oct. 18, 2016, 7:17 p.m. UTC
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
---
Special thanks to Andrew Roland for helping me figure out these numbers.
Please keep me in CC.
Vittorio

 libavfilter/vf_colorspace.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Ronald S. Bultje Oct. 20, 2016, 3:57 p.m. UTC | #1
Hi,

On Tue, Oct 18, 2016 at 3:17 PM, Vittorio Giovara <
vittorio.giovara@gmail.com> wrote:

> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
> ---
> Special thanks to Andrew Roland for helping me figure out these numbers.
> Please keep me in CC.
> Vittorio
>
>  libavfilter/vf_colorspace.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
> index 5b060f9..16ad760 100644
> --- a/libavfilter/vf_colorspace.c
> +++ b/libavfilter/vf_colorspace.c
> @@ -229,6 +229,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_IEC61966_2_1] = { 1.055, 0.0031308, 1.0 / 2.4, 12.92 },
>      [AVCOL_TRC_BT2020_10] = { 1.099,  0.018,  0.45, 4.5 },
>      [AVCOL_TRC_BT2020_12] = { 1.0993, 0.0181, 0.45, 4.5 },
>  };
> @@ -1067,6 +1068,8 @@ static const AVOption colorspace_options[] = {
>      ENUM("gamma28",      AVCOL_TRC_GAMMA28,      "trc"),
>      ENUM("smpte170m",    AVCOL_TRC_SMPTE170M,    "trc"),
>      ENUM("smpte240m",    AVCOL_TRC_SMPTE240M,    "trc"),
> +    ENUM("srgb",         AVCOL_TRC_IEC61966_2_1, "trc"),
> +    ENUM("iec61966-2-1", AVCOL_TRC_IEC61966_2_1, "trc"),
>      ENUM("bt2020-10",    AVCOL_TRC_BT2020_10,    "trc"),
>      ENUM("bt2020-12",    AVCOL_TRC_BT2020_12,    "trc"),
>
> --
> 2.10.0


After some discussion offline, I think this is fine. I'll leave it for a
few hours for others to comment on before I push.

Ronald
Michael Niedermayer Oct. 20, 2016, 4:37 p.m. UTC | #2
On Tue, Oct 18, 2016 at 03:17:26PM -0400, Vittorio Giovara wrote:
> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
> ---
> Special thanks to Andrew Roland for helping me figure out these numbers.
> Please keep me in CC.
> Vittorio
> 
>  libavfilter/vf_colorspace.c | 3 +++
>  1 file changed, 3 insertions(+)

LGTM

thx

[...]
Ronald S. Bultje Oct. 24, 2016, 8:08 p.m. UTC | #3
Hi,

On Thu, Oct 20, 2016 at 12:37 PM, Michael Niedermayer <
michael@niedermayer.cc> wrote:

> On Tue, Oct 18, 2016 at 03:17:26PM -0400, Vittorio Giovara wrote:
> > Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
> > ---
> > Special thanks to Andrew Roland for helping me figure out these numbers.
> > Please keep me in CC.
> > Vittorio
> >
> >  libavfilter/vf_colorspace.c | 3 +++
> >  1 file changed, 3 insertions(+)
>
> LGTM


Pushed.

Ronald
diff mbox

Patch

diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index 5b060f9..16ad760 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -229,6 +229,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_IEC61966_2_1] = { 1.055, 0.0031308, 1.0 / 2.4, 12.92 },
     [AVCOL_TRC_BT2020_10] = { 1.099,  0.018,  0.45, 4.5 },
     [AVCOL_TRC_BT2020_12] = { 1.0993, 0.0181, 0.45, 4.5 },
 };
@@ -1067,6 +1068,8 @@  static const AVOption colorspace_options[] = {
     ENUM("gamma28",      AVCOL_TRC_GAMMA28,      "trc"),
     ENUM("smpte170m",    AVCOL_TRC_SMPTE170M,    "trc"),
     ENUM("smpte240m",    AVCOL_TRC_SMPTE240M,    "trc"),
+    ENUM("srgb",         AVCOL_TRC_IEC61966_2_1, "trc"),
+    ENUM("iec61966-2-1", AVCOL_TRC_IEC61966_2_1, "trc"),
     ENUM("bt2020-10",    AVCOL_TRC_BT2020_10,    "trc"),
     ENUM("bt2020-12",    AVCOL_TRC_BT2020_12,    "trc"),