diff options
author | Jan Ekström <jeebjp@gmail.com> | 2016-04-24 21:30:06 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2016-05-10 12:30:25 +0300 |
commit | 1f77e634bb838f71ff21923b5e9fe3104c831c52 (patch) | |
tree | 49058a2584b6e8c9396d11c9a5efa56065a5a971 /libavutil/colorspace.h | |
parent | 283226e11ccf50a71d25d150fbbf1743f74c6c49 (diff) |
colorspace: Add support for BT709
BT.709 coefficients were gathered from the first two parts of BT.709
to BT.2020 conversion guide in ARIB STD-B62 (Pt. 1, Chapter 6.2.2).
They were additionally confirmed by manually calculating values.
Diffstat (limited to 'libavutil/colorspace.h')
-rw-r--r-- | libavutil/colorspace.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavutil/colorspace.h b/libavutil/colorspace.h index 8757566c78..cc27f38221 100644 --- a/libavutil/colorspace.h +++ b/libavutil/colorspace.h @@ -41,6 +41,17 @@ b_add = FIX(1.77200*255.0/224.0) * cb + ONE_HALF;\ } +#define YUV_TO_RGB1_CCIR_BT709(cb1, cr1) \ + { \ + cb = (cb1) - 128; \ + cr = (cr1) - 128; \ + r_add = ONE_HALF + FIX(1.5747 * 255.0 / 224.0) * cr; \ + g_add = ONE_HALF - FIX(0.1873 * 255.0 / 224.0) * cb - \ + FIX(0.4682 * 255.0 / 224.0) * cr; \ + b_add = ONE_HALF + FIX(1.8556 * 255.0 / 224.0) * cb; \ + } + +// To be used for the BT709 variant as well #define YUV_TO_RGB2_CCIR(r, g, b, y1)\ {\ y = ((y1) - 16) * FIX(255.0/219.0);\ |