aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2016-06-21 22:16:16 +0200
committerClément Bœsch <u@pkh.me>2016-06-21 22:16:16 +0200
commite4c07dc4b7e7b7763ed350366a0f665b8865d52a (patch)
treee2cda59ce8e5b20059a2e459a46590d4fde9b2d2 /libavutil
parent363d4a0e65a7240114022ce03cf656e6e29cb181 (diff)
parent1f77e634bb838f71ff21923b5e9fe3104c831c52 (diff)
downloadffmpeg-e4c07dc4b7e7b7763ed350366a0f665b8865d52a.tar.gz
Merge commit '1f77e634bb838f71ff21923b5e9fe3104c831c52'
* commit '1f77e634bb838f71ff21923b5e9fe3104c831c52': colorspace: Add support for BT709 See 9779b6262471d553c1ed811ff7312564e39d8adf Merged-by: Clément Bœsch <u@pkh.me>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/colorspace.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/libavutil/colorspace.h b/libavutil/colorspace.h
index 7d3f7110c9..b6dba2c95f 100644
--- a/libavutil/colorspace.h
+++ b/libavutil/colorspace.h
@@ -41,16 +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 = 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_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);\