summaryrefslogtreecommitdiff
path: root/libavutil/colorspace.h
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2016-04-24 17:30:56 +0300
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2016-04-24 23:05:04 +0200
commit9779b6262471d553c1ed811ff7312564e39d8adf (patch)
tree4410d1a525abef02dedd8a311abe5caf31d87207 /libavutil/colorspace.h
parent87b8e9500874930667ac966ea2fabdd6222ef6e0 (diff)
downloadffmpeg-9779b6262471d553c1ed811ff7312564e39d8adf.tar.gz
pgssubdec: fix subpicture output colorspace and range
Functionality used before didn't widen the values from limited to full range. Additionally, now the decoder uses BT.709 where it should be used according to the video resolution. Default for not yet set colorimetry is BT.709 due to most observed HDMV content being HD. 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. Fixes #4637
Diffstat (limited to 'libavutil/colorspace.h')
-rw-r--r--libavutil/colorspace.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavutil/colorspace.h b/libavutil/colorspace.h
index 826ffd52c4..7d3f7110c9 100644
--- a/libavutil/colorspace.h
+++ b/libavutil/colorspace.h
@@ -41,6 +41,16 @@
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 = FIX(1.5747*255.0/224.0) * cr + ONE_HALF;\
+ g_add = - FIX(0.1873*255.0/224.0) * cb - FIX(0.4682*255.0/224.0) * cr + \
+ ONE_HALF;\
+ b_add = FIX(1.8556*255.0/224.0) * cb + ONE_HALF;\
+}
+
#define YUV_TO_RGB2_CCIR(r, g, b, y1)\
{\
y = ((y1) - 16) * FIX(255.0/219.0);\