@@ -15,7 +15,9 @@ INTEL_G4A = \
exa_wm_ca.g4a \
exa_wm_ca_srcalpha.g4a \
exa_wm_write.g4a \
+ exa_wm_yuv_rgb_bt601_full.g4a \
exa_wm_yuv_rgb_bt601_limited.g4a \
+ exa_wm_yuv_rgb_bt709_full.g4a \
exa_wm_yuv_rgb_bt709_limited.g4a \
exa_wm_xy.g4a \
$(NULL)
@@ -46,7 +48,9 @@ INTEL_G4B = \
exa_wm_ca.g4b \
exa_wm_ca_srcalpha.g4b \
exa_wm_write.g4b \
+ exa_wm_yuv_rgb_bt601_full.g4b \
exa_wm_yuv_rgb_bt601_limited.g4b \
+ exa_wm_yuv_rgb_bt709_full.g4b \
exa_wm_yuv_rgb_bt709_limited.g4b \
exa_wm_xy.g4b \
$(NULL)
@@ -69,7 +73,9 @@ INTEL_G4B_GEN5 = \
exa_wm_ca.g4b.gen5 \
exa_wm_ca_srcalpha.g4b.gen5 \
exa_wm_write.g4b.gen5 \
+ exa_wm_yuv_rgb_bt601_full.g4b.gen5 \
exa_wm_yuv_rgb_bt601_limited.g4b.gen5 \
+ exa_wm_yuv_rgb_bt709_full.g4b.gen5 \
exa_wm_yuv_rgb_bt709_limited.g4b.gen5 \
exa_wm_xy.g4b.gen5 \
$(NULL)
@@ -91,7 +97,9 @@ INTEL_G5A = \
exa_wm_ca.g5a \
exa_wm_ca_srcalpha.g5a \
exa_wm_write.g5a \
+ exa_wm_yuv_rgb_bt601_full.g5a \
exa_wm_yuv_rgb_bt601_limited.g5a \
+ exa_wm_yuv_rgb_bt709_full.g5a \
exa_wm_yuv_rgb_bt709_limited.g5a \
exa_wm_xy.g5a \
$(NULL)
@@ -113,7 +121,9 @@ INTEL_G5B = \
exa_wm_ca.g5b \
exa_wm_ca_srcalpha.g5b \
exa_wm_write.g5b \
+ exa_wm_yuv_rgb_bt601_full.g5b \
exa_wm_yuv_rgb_bt601_limited.g5b \
+ exa_wm_yuv_rgb_bt709_full.g5b \
exa_wm_yuv_rgb_bt709_limited.g5b \
exa_wm_xy.g5b \
$(NULL)
@@ -138,7 +148,9 @@ INTEL_G6A = \
exa_wm_ca_srcalpha.g6a \
exa_wm_noca.g6a \
exa_wm_write.g6a \
+ exa_wm_yuv_rgb_bt601_full.g6a \
exa_wm_yuv_rgb_bt601_limited.g6a \
+ exa_wm_yuv_rgb_bt709_full.g6a \
exa_wm_yuv_rgb_bt709_limited.g6a \
$(NULL)
@@ -157,7 +169,9 @@ INTEL_G6B = \
exa_wm_ca_srcalpha.g6b \
exa_wm_noca.g6b \
exa_wm_write.g6b \
+ exa_wm_yuv_rgb_bt601_full.g6b \
exa_wm_yuv_rgb_bt601_limited.g6b \
+ exa_wm_yuv_rgb_bt709_full.g6b \
exa_wm_yuv_rgb_bt709_limited.g6b \
$(NULL)
@@ -173,7 +187,9 @@ INTEL_G7A = \
exa_wm_src_sample_nv12.g7a \
exa_wm_src_sample_planar.g7a \
exa_wm_write.g7a \
+ exa_wm_yuv_rgb_bt601_full.g7a \
exa_wm_yuv_rgb_bt601_limited.g7a \
+ exa_wm_yuv_rgb_bt709_full.g7a \
exa_wm_yuv_rgb_bt709_limited.g7a \
$(NULL)
@@ -189,7 +205,9 @@ INTEL_G7B = \
exa_wm_src_sample_nv12.g7b \
exa_wm_src_sample_planar.g7b \
exa_wm_write.g7b \
+ exa_wm_yuv_rgb_bt601_full.g7b \
exa_wm_yuv_rgb_bt601_limited.g7b \
+ exa_wm_yuv_rgb_bt709_full.g7b \
exa_wm_yuv_rgb_bt709_limited.g7b \
$(NULL)
@@ -199,7 +217,9 @@ INTEL_G8A = \
exa_wm_src_sample_nv12.g8a \
exa_wm_src_sample_planar.g8a \
exa_wm_write.g8a \
+ exa_wm_yuv_rgb_bt601_full.g8a \
exa_wm_yuv_rgb_bt601_limited.g8a \
+ exa_wm_yuv_rgb_bt709_full.g8a \
exa_wm_yuv_rgb_bt709_limited.g8a \
$(NULL)
@@ -209,7 +229,9 @@ INTEL_G8B = \
exa_wm_src_sample_nv12.g8b \
exa_wm_src_sample_planar.g8b \
exa_wm_write.g8b \
+ exa_wm_yuv_rgb_bt601_full.g8b \
exa_wm_yuv_rgb_bt601_limited.g8b \
+ exa_wm_yuv_rgb_bt709_full.g8b \
exa_wm_yuv_rgb_bt709_limited.g8b \
$(NULL)
new file mode 100644
@@ -0,0 +1,109 @@
+/*
+ * Copyright © 2006 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Packard <keithp@keithp.com>
+ * Eric Anholt <eric@anholt.net>
+ *
+ */
+
+include(`exa_wm.g4i')
+
+define(`YCbCr_base', `src_sample_base')
+
+define(`Cr', `src_sample_r')
+define(`Cr_01', `src_sample_r_01')
+define(`Cr_23', `src_sample_r_23')
+
+define(`Y', `src_sample_g')
+define(`Y_01', `src_sample_g_01')
+define(`Y_23', `src_sample_g_23')
+
+define(`Cb', `src_sample_b')
+define(`Cb_01', `src_sample_b_01')
+define(`Cb_23', `src_sample_b_23')
+
+define(`Crn', `mask_sample_r')
+define(`Crn_01', `mask_sample_r_01')
+define(`Crn_23', `mask_sample_r_23')
+
+define(`Yn', `mask_sample_g')
+define(`Yn_01', `mask_sample_g_01')
+define(`Yn_23', `mask_sample_g_23')
+
+define(`Cbn', `mask_sample_b')
+define(`Cbn_01', `mask_sample_b_01')
+define(`Cbn_23', `mask_sample_b_23')
+
+ /* color space conversion function:
+ * R = Clamp ( Y +
+ * 255/128(1.0-Kr)(Cr-128/255), 0, 1)
+ * G = Clamp ( Y -
+ * 255/128(1.0-Kr)Kr/Kg(Cr-128/255) -
+ * 255/128(1.0-Kb)Kb/Kg(Cb-128/255), 0, 1)
+ * B = Clamp ( Y +
+ * 255/128(1.0-Kb)(Cb-128/255), 0, 1)
+ *
+ * BT.601:
+ * Kr = 0.299
+ * Kb = 0.114
+ * Kg = (1.0 - Kr - Kb) = 0.587
+ */
+
+ /* Normalize Y, Cb and Cr:
+ *
+ * Yn = Y
+ * Crn = Cr - 128 / 255
+ * Cbn = Cb - 128 / 255
+ */
+mov (16) Yn<1>F Y<8,8,1>F { compr align1 };
+add (16) Crn<1>F Cr<8,8,1>F -0.501961F { compr align1 };
+
+add (16) Cbn<1>F Cb<8,8,1>F -0.501961F { compr align1 };
+
+ /*
+ * R = Yn +
+ * Crn * 255/128 * (1.0 - Kr)
+ */
+mov (16) acc0<1>F Yn<8,8,1>F { compr align1 };
+mac.sat(16) src_sample_r<1>F Crn<8,8,1>F 1.397F { compr align1 };
+
+ /*
+ * G = Yn -
+ * Crn * 255/128 * (1.0 - Kr) * Kr / Kg -
+ * Cbn * 255/128 * (1.0 - Kb) * Kb / Kg
+ */
+mov (16) acc0<1>F Yn<8,8,1>F { compr align1 };
+mac (16) acc0<1>F Crn<8,8,1>F -0.711F { compr align1 };
+mac.sat(16) src_sample_g<1>F Cbn<8,8,1>F -0.343F { compr align1 };
+
+ /*
+ * B = Yn +
+ * Cbn * 255/128 * (1.0 - Kb)
+ */
+mov (16) acc0<1>F Yn<8,8,1>F { compr align1 };
+mac.sat(16) src_sample_b<1>F Cbn<8,8,1>F 1.765F { compr align1 };
+
+ /*
+ * A = 1.0
+ */
+mov (16) src_sample_a<1>F 1.0F { compr align1 };
new file mode 100644
@@ -0,0 +1,11 @@
+ { 0x00802001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00802040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00802040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x21c07fbd, 0x008d02c0, 0x3fb2d0e5 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00802048, 0x24007fbc, 0x008d02c0, 0xbf360419 },
+ { 0x80802048, 0x22007fbd, 0x008d0340, 0xbeaf9db2 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x22407fbd, 0x008d0340, 0x3fe1eb85 },
+ { 0x00802001, 0x228003fd, 0x00000000, 0x3f800000 },
new file mode 100644
@@ -0,0 +1,11 @@
+ { 0x00802001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00802040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00802040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x21c07fbd, 0x008d02c0, 0x3fb2d0e5 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00802048, 0x24007fbc, 0x008d02c0, 0xbf360419 },
+ { 0x80802048, 0x22007fbd, 0x008d0340, 0xbeaf9db2 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x22407fbd, 0x008d0340, 0x3fe1eb85 },
+ { 0x00802001, 0x228003fd, 0x00000000, 0x3f800000 },
new file mode 120000
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_full.g4a
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,11 @@
+ { 0x00802001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00802040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00802040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x21c07fbd, 0x008d02c0, 0x3fb2d0e5 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00802048, 0x24007fbc, 0x008d02c0, 0xbf360419 },
+ { 0x80802048, 0x22007fbd, 0x008d0340, 0xbeaf9db2 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x22407fbd, 0x008d0340, 0x3fe1eb85 },
+ { 0x00802001, 0x228003fd, 0x00000000, 0x3f800000 },
new file mode 120000
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_full.g4a
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,11 @@
+ { 0x00800001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00800040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00800040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x21c07fbd, 0x008d02c0, 0x3fb2d0e5 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00800048, 0x24007fbc, 0x008d02c0, 0xbf360419 },
+ { 0x80800048, 0x22007fbd, 0x008d0340, 0xbeaf9db2 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x22407fbd, 0x008d0340, 0x3fe1eb85 },
+ { 0x00800001, 0x228003fd, 0x00000000, 0x3f800000 },
new file mode 120000
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_full.g4a
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,11 @@
+ { 0x00800001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00800040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00800040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x21c07fbd, 0x008d02c0, 0x3fb2d0e5 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00800048, 0x24007fbc, 0x008d02c0, 0xbf360419 },
+ { 0x80800048, 0x22007fbd, 0x008d0340, 0xbeaf9db2 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x22407fbd, 0x008d0340, 0x3fe1eb85 },
+ { 0x00800001, 0x228003fd, 0x00000000, 0x3f800000 },
new file mode 100644
@@ -0,0 +1,116 @@
+/*
+ * Copyright © 2006 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Packard <keithp@keithp.com>
+ * Eric Anholt <eric@anholt.net>
+ *
+ */
+
+include(`exa_wm.g4i')
+
+define(`YCbCr_base', `src_sample_base')
+
+define(`Cr', `src_sample_r')
+define(`Cr_01', `src_sample_r_01')
+define(`Cr_23', `src_sample_r_23')
+
+define(`Y', `src_sample_g')
+define(`Y_01', `src_sample_g_01')
+define(`Y_23', `src_sample_g_23')
+
+define(`Cb', `src_sample_b')
+define(`Cb_01', `src_sample_b_01')
+define(`Cb_23', `src_sample_b_23')
+
+define(`Crn', `mask_sample_r')
+define(`Crn_01', `mask_sample_r_01')
+define(`Crn_23', `mask_sample_r_23')
+
+define(`Yn', `mask_sample_g')
+define(`Yn_01', `mask_sample_g_01')
+define(`Yn_23', `mask_sample_g_23')
+
+define(`Cbn', `mask_sample_b')
+define(`Cbn_01', `mask_sample_b_01')
+define(`Cbn_23', `mask_sample_b_23')
+
+ /* color space conversion function:
+ * R = Clamp ( 255/(235-16)(Y-16/255) +
+ * 255/112(1.0-Kr)(Cr-128/255), 0, 1)
+ * G = Clamp ( 255/(235-16)(Y-16/255) -
+ * 255/112(1.0-Kr)Kr/Kg(Cr-128/255) -
+ * 255/112(1.0-Kb)Kb/Kg(Cb-128/255), 0, 1)
+ * B = Clamp ( 255/(235-16)(Y-16/255) +
+ * 255/112(1.0-Kb)(Cb-128/255), 0, 1)
+ *
+ * BT.601:
+ * Kr = 0.299
+ * Kb = 0.114
+ * Kg = (1.0 - Kr - Kb) = 0.587
+ */
+
+ /* Normalize Y, Cb and Cr:
+ *
+ * Yn = Y
+ * Crn = Cr - 128 / 255
+ * Cbn = Cb - 128 / 255
+ */
+mov (16) Yn<1>F Y<8,8,1>F { compr align1 };
+add (16) Crn<1>F Cr<8,8,1>F -0.501961F { compr align1 };
+
+add (16) Cbn<1>F Cb<8,8,1>F -0.501961F { compr align1 };
+
+ /*
+ * R = Yn +
+ * Crn * 255/128 * (1.0 - Kr)
+ */
+mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_r_01<1>F Crn_01<8,8,1>F 1.397F { compr align1 };
+
+mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_r_23<1>F Crn_23<8,8,1>F 1.397F { compr align1 };
+ /*
+ * G = Yn -
+ * Crn * 255/128 * (1.0 - Kr) * Kr / Kg -
+ * Cbn * 255/128 * (1.0 - Kb) * Kb / Kg
+ */
+mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+mac (8) acc0<1>F Crn_01<8,8,1>F -0.711F { compr align1 };
+mac.sat(8) src_sample_g_01<1>F Cbn_01<8,8,1>F -0.343F { compr align1 };
+
+mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
+mac (8) acc0<1>F Crn_23<8,8,1>F -0.711F { compr align1 };
+mac.sat(16) src_sample_g_23<1>F Cbn_23<8,8,1>F -0.343F { compr align1 };
+ /*
+ * B = Yn +
+ * Cbn * 255/128 * (1.0 - Kb)
+ */
+mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_b_01<1>F Cbn_01<8,8,1>F 1.765F { compr align1 };
+
+mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_b_23<1>F Cbn_23<8,8,1>F 1.765F { compr align1 };
+ /*
+ * A = 1.0
+ */
+mov (16) src_sample_a<1>F 1.0F { compr align1 };
new file mode 100644
@@ -0,0 +1,18 @@
+ { 0x00800001, 0x23003ae8, 0x008d0200, 0x00000000 },
+ { 0x00800040, 0x22c03ae8, 0x3e8d01c0, 0xbf008084 },
+ { 0x00800040, 0x23403ae8, 0x3e8d0240, 0xbf008084 },
+ { 0x00600001, 0x24003ae0, 0x008d0300, 0x00000000 },
+ { 0x80600048, 0x21c03ae8, 0x3e8d02c0, 0x3fb2d0e5 },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+ { 0x80600048, 0x21e03ae8, 0x3e8d02e0, 0x3fb2d0e5 },
+ { 0x00600001, 0x24003ae0, 0x008d0300, 0x00000000 },
+ { 0x00600048, 0x24003ae0, 0x3e8d02c0, 0xbf360419 },
+ { 0x80600048, 0x22003ae8, 0x3e8d0340, 0xbeaf9db2 },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+ { 0x00600048, 0x24003ae0, 0x3e8d02e0, 0xbf360419 },
+ { 0x80800048, 0x22203ae8, 0x3e8d0360, 0xbeaf9db2 },
+ { 0x00600001, 0x24003ae0, 0x008d0300, 0x00000000 },
+ { 0x80600048, 0x22403ae8, 0x3e8d0340, 0x3fe1eb85 },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+ { 0x80600048, 0x22603ae8, 0x3e8d0360, 0x3fe1eb85 },
+ { 0x00800001, 0x22803ee8, 0x38000000, 0x3f800000 },
@@ -55,7 +55,6 @@ define(`Cbn_01', `mask_sample_b_01')
define(`Cbn_23', `mask_sample_b_23')
/* color space conversion function:
- * Cy = 255/(235-16)
* R = Clamp ( 255/(235-16)(Y-16/255) +
* 255/112(1.0-Kr)(Cr-128/255), 0, 1)
* G = Clamp ( 255/(235-16)(Y-16/255) -
new file mode 100644
@@ -0,0 +1,109 @@
+/*
+ * Copyright © 2006 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Packard <keithp@keithp.com>
+ * Eric Anholt <eric@anholt.net>
+ *
+ */
+
+include(`exa_wm.g4i')
+
+define(`YCbCr_base', `src_sample_base')
+
+define(`Cr', `src_sample_r')
+define(`Cr_01', `src_sample_r_01')
+define(`Cr_23', `src_sample_r_23')
+
+define(`Y', `src_sample_g')
+define(`Y_01', `src_sample_g_01')
+define(`Y_23', `src_sample_g_23')
+
+define(`Cb', `src_sample_b')
+define(`Cb_01', `src_sample_b_01')
+define(`Cb_23', `src_sample_b_23')
+
+define(`Crn', `mask_sample_r')
+define(`Crn_01', `mask_sample_r_01')
+define(`Crn_23', `mask_sample_r_23')
+
+define(`Yn', `mask_sample_g')
+define(`Yn_01', `mask_sample_g_01')
+define(`Yn_23', `mask_sample_g_23')
+
+define(`Cbn', `mask_sample_b')
+define(`Cbn_01', `mask_sample_b_01')
+define(`Cbn_23', `mask_sample_b_23')
+
+ /* color space conversion function:
+ * R = Clamp ( Y +
+ * 255/128(1.0-Kr)(Cr-128/255), 0, 1)
+ * G = Clamp ( Y -
+ * 255/128(1.0-Kr)Kr/Kg(Cr-128/255) -
+ * 255/128(1.0-Kb)Kb/Kg(Cb-128/255), 0, 1)
+ * B = Clamp ( Y +
+ * 255/128(1.0-Kb)(Cb-128/255), 0, 1)
+ *
+ * BT.709:
+ * Kr = .2126
+ * Kb = .0722
+ * Kg = (1.0 - Kr - Kb) = 0.7152
+ */
+
+ /* Normalize Y, Cb and Cr:
+ *
+ * Yn = Y
+ * Crn = Cr - 128 / 255
+ * Cbn = Cb - 128 / 255
+ */
+mov (16) Yn<1>F Y<8,8,1>F { compr align1 };
+add (16) Crn<1>F Cr<8,8,1>F -0.501961F { compr align1 };
+
+add (16) Cbn<1>F Cb<8,8,1>F -0.501961F { compr align1 };
+
+ /*
+ * R = Yn +
+ * Crn * 255/128 * (1.0 - Kr)
+ */
+mov (16) acc0<1>F Yn<8,8,1>F { compr align1 };
+mac.sat(16) src_sample_r<1>F Crn<8,8,1>F 1.569F { compr align1 };
+
+ /*
+ * G = Yn -
+ * Crn * 255/128 * (1.0 - Kr) * Kr / Kg -
+ * Cbn * 255/128 * (1.0 - Kb) * Kb / Kg
+ */
+mov (16) acc0<1>F Yn<8,8,1>F { compr align1 };
+mac (16) acc0<1>F Crn<8,8,1>F -0.466F { compr align1 };
+mac.sat(16) src_sample_g<1>F Cbn<8,8,1>F -0.187F { compr align1 };
+
+ /*
+ * B = Yn +
+ * Cbn * 255/128 * (1.0 - Kb)
+ */
+mov (16) acc0<1>F Yn<8,8,1>F { compr align1 };
+mac.sat(16) src_sample_b<1>F Cbn<8,8,1>F 1.848F { compr align1 };
+
+ /*
+ * A = 1.0
+ */
+mov (16) src_sample_a<1>F 1.0F { compr align1 };
new file mode 100644
@@ -0,0 +1,11 @@
+ { 0x00802001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00802040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00802040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x21c07fbd, 0x008d02c0, 0x3fc8d4fe },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00802048, 0x24007fbc, 0x008d02c0, 0xbeee978d },
+ { 0x80802048, 0x22007fbd, 0x008d0340, 0xbe3f7cee },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x22407fbd, 0x008d0340, 0x3fec8b44 },
+ { 0x00802001, 0x228003fd, 0x00000000, 0x3f800000 },
new file mode 100644
@@ -0,0 +1,11 @@
+ { 0x00802001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00802040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00802040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x21c07fbd, 0x008d02c0, 0x3fc8d4fe },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00802048, 0x24007fbc, 0x008d02c0, 0xbeee978d },
+ { 0x80802048, 0x22007fbd, 0x008d0340, 0xbe3f7cee },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x22407fbd, 0x008d0340, 0x3fec8b44 },
+ { 0x00802001, 0x228003fd, 0x00000000, 0x3f800000 },
new file mode 120000
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_full.g4a
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,11 @@
+ { 0x00802001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00802040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00802040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x21c07fbd, 0x008d02c0, 0x3fc8d4fe },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00802048, 0x24007fbc, 0x008d02c0, 0xbeee978d },
+ { 0x80802048, 0x22007fbd, 0x008d0340, 0xbe3f7cee },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x22407fbd, 0x008d0340, 0x3fec8b44 },
+ { 0x00802001, 0x228003fd, 0x00000000, 0x3f800000 },
new file mode 120000
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_full.g4a
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,11 @@
+ { 0x00800001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00800040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00800040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x21c07fbd, 0x008d02c0, 0x3fc8d4fe },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00800048, 0x24007fbc, 0x008d02c0, 0xbeee978d },
+ { 0x80800048, 0x22007fbd, 0x008d0340, 0xbe3f7cee },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x22407fbd, 0x008d0340, 0x3fec8b44 },
+ { 0x00800001, 0x228003fd, 0x00000000, 0x3f800000 },
new file mode 120000
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_full.g4a
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,11 @@
+ { 0x00800001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00800040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00800040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x21c07fbd, 0x008d02c0, 0x3fc8d4fe },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00800048, 0x24007fbc, 0x008d02c0, 0xbeee978d },
+ { 0x80800048, 0x22007fbd, 0x008d0340, 0xbe3f7cee },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x22407fbd, 0x008d0340, 0x3fec8b44 },
+ { 0x00800001, 0x228003fd, 0x00000000, 0x3f800000 },
new file mode 100644
@@ -0,0 +1,116 @@
+/*
+ * Copyright © 2006 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Packard <keithp@keithp.com>
+ * Eric Anholt <eric@anholt.net>
+ *
+ */
+
+include(`exa_wm.g4i')
+
+define(`YCbCr_base', `src_sample_base')
+
+define(`Cr', `src_sample_r')
+define(`Cr_01', `src_sample_r_01')
+define(`Cr_23', `src_sample_r_23')
+
+define(`Y', `src_sample_g')
+define(`Y_01', `src_sample_g_01')
+define(`Y_23', `src_sample_g_23')
+
+define(`Cb', `src_sample_b')
+define(`Cb_01', `src_sample_b_01')
+define(`Cb_23', `src_sample_b_23')
+
+define(`Crn', `mask_sample_r')
+define(`Crn_01', `mask_sample_r_01')
+define(`Crn_23', `mask_sample_r_23')
+
+define(`Yn', `mask_sample_g')
+define(`Yn_01', `mask_sample_g_01')
+define(`Yn_23', `mask_sample_g_23')
+
+define(`Cbn', `mask_sample_b')
+define(`Cbn_01', `mask_sample_b_01')
+define(`Cbn_23', `mask_sample_b_23')
+
+ /* color space conversion function:
+ * R = Clamp ( Y +
+ * 255/128(1.0-Kr)(Cr-128/255), 0, 1)
+ * G = Clamp ( Y -
+ * 255/128(1.0-Kr)Kr/Kg(Cr-128/255) -
+ * 255/128(1.0-Kb)Kb/Kg(Cb-128/255), 0, 1)
+ * B = Clamp ( Y +
+ * 255/128(1.0-Kb)(Cb-128/255), 0, 1)
+ *
+ * BT.709:
+ * Kr = .2126
+ * Kb = .0722
+ * Kg = (1.0 - Kr - Kb) = 0.7152
+ */
+
+ /* Normalize Y, Cb and Cr:
+ *
+ * Yn = Y
+ * Crn = Cr - 128 / 255
+ * Cbn = Cb - 128 / 255
+ */
+mov (16) Yn<1>F Y<8,8,1>F { compr align1 };
+add (16) Crn<1>F Cr<8,8,1>F -0.501961F { compr align1 };
+
+add (16) Cbn<1>F Cb<8,8,1>F -0.501961F { compr align1 };
+
+ /*
+ * R = Yn +
+ * Crn * 255/128 * (1.0 - Kr)
+ */
+mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_r_01<1>F Crn_01<8,8,1>F 1.569F { compr align1 };
+
+mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_r_23<1>F Crn_23<8,8,1>F 1.569F { compr align1 };
+ /*
+ * G = Yn -
+ * Crn * 255/128 * (1.0 - Kr) * Kr / Kg
+ * Cbn * 255/128 * (1.0 - Kb) * Kb / Kg
+ */
+mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+mac (8) acc0<1>F Crn_01<8,8,1>F -0.466F { compr align1 };
+mac.sat(8) src_sample_g_01<1>F Cbn_01<8,8,1>F -0.187F { compr align1 };
+
+mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
+mac (8) acc0<1>F Crn_23<8,8,1>F -0.466F { compr align1 };
+mac.sat(16) src_sample_g_23<1>F Cbn_23<8,8,1>F -0.187F { compr align1 };
+ /*
+ * B = Yn +
+ * Cbn * 255/128 * (1.0 - Kb)
+ */
+mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_b_01<1>F Cbn_01<8,8,1>F 1.848F { compr align1 };
+
+mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_b_23<1>F Cbn_23<8,8,1>F 1.848F { compr align1 };
+ /*
+ * A = 1.0
+ */
+mov (16) src_sample_a<1>F 1.0F { compr align1 };
new file mode 100644
@@ -0,0 +1,18 @@
+ { 0x00800001, 0x23003ae8, 0x008d0200, 0x00000000 },
+ { 0x00800040, 0x22c03ae8, 0x3e8d01c0, 0xbf008084 },
+ { 0x00800040, 0x23403ae8, 0x3e8d0240, 0xbf008084 },
+ { 0x00600001, 0x24003ae0, 0x008d0300, 0x00000000 },
+ { 0x80600048, 0x21c03ae8, 0x3e8d02c0, 0x3fc8d4fe },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+ { 0x80600048, 0x21e03ae8, 0x3e8d02e0, 0x3fc8d4fe },
+ { 0x00600001, 0x24003ae0, 0x008d0300, 0x00000000 },
+ { 0x00600048, 0x24003ae0, 0x3e8d02c0, 0xbeee978d },
+ { 0x80600048, 0x22003ae8, 0x3e8d0340, 0xbe3f7cee },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+ { 0x00600048, 0x24003ae0, 0x3e8d02e0, 0xbeee978d },
+ { 0x80800048, 0x22203ae8, 0x3e8d0360, 0xbe3f7cee },
+ { 0x00600001, 0x24003ae0, 0x008d0300, 0x00000000 },
+ { 0x80600048, 0x22403ae8, 0x3e8d0340, 0x3fec8b44 },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+ { 0x80600048, 0x22603ae8, 0x3e8d0360, 0x3fec8b44 },
+ { 0x00800001, 0x22803ee8, 0x38000000, 0x3f800000 },
@@ -147,6 +147,54 @@ static const uint32_t ps_kernel_nv12_bt709_limited_static[][4] = {
#include "exa_wm_write.g4b"
};
+static const uint32_t ps_kernel_packed_bt601_full_static[][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_affine.g4b"
+#include "exa_wm_src_sample_argb.g4b"
+#include "exa_wm_yuv_rgb_bt601_full.g4b"
+#include "exa_wm_write.g4b"
+};
+
+static const uint32_t ps_kernel_planar_bt601_full_static[][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_affine.g4b"
+#include "exa_wm_src_sample_planar.g4b"
+#include "exa_wm_yuv_rgb_bt601_full.g4b"
+#include "exa_wm_write.g4b"
+};
+
+static const uint32_t ps_kernel_nv12_bt601_full_static[][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_affine.g4b"
+#include "exa_wm_src_sample_nv12.g4b"
+#include "exa_wm_yuv_rgb_bt601_full.g4b"
+#include "exa_wm_write.g4b"
+};
+
+static const uint32_t ps_kernel_packed_bt709_full_static[][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_affine.g4b"
+#include "exa_wm_src_sample_argb.g4b"
+#include "exa_wm_yuv_rgb_bt709_full.g4b"
+#include "exa_wm_write.g4b"
+};
+
+static const uint32_t ps_kernel_planar_bt709_full_static[][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_affine.g4b"
+#include "exa_wm_src_sample_planar.g4b"
+#include "exa_wm_yuv_rgb_bt709_full.g4b"
+#include "exa_wm_write.g4b"
+};
+
+static const uint32_t ps_kernel_nv12_bt709_full_static[][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_affine.g4b"
+#include "exa_wm_src_sample_nv12.g4b"
+#include "exa_wm_yuv_rgb_bt709_full.g4b"
+#include "exa_wm_write.g4b"
+};
+
#define NOKERNEL(kernel_enum, func, masked) \
[kernel_enum] = {func, 0, masked}
#define KERNEL(kernel_enum, kernel, masked) \
@@ -178,6 +226,14 @@ static const struct wm_kernel_info {
KERNEL(WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited_static, false),
KERNEL(WM_KERNEL_VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited_static, false),
KERNEL(WM_KERNEL_VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited_static, false),
+
+ KERNEL(WM_KERNEL_VIDEO_PLANAR_BT601_FULL, ps_kernel_planar_bt601_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_NV12_BT601_FULL, ps_kernel_nv12_bt601_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PACKED_BT601_FULL, ps_kernel_packed_bt601_full_static, false),
+
+ KERNEL(WM_KERNEL_VIDEO_PLANAR_BT709_FULL, ps_kernel_planar_bt709_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_NV12_BT709_FULL, ps_kernel_nv12_bt709_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PACKED_BT709_FULL, ps_kernel_packed_bt709_full_static, false),
};
#undef KERNEL
@@ -1439,19 +1495,34 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_XVMC:
- return video->colorspace ?
- WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
- WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PLANAR_BT709_FULL :
+ WM_KERNEL_VIDEO_PLANAR_BT601_FULL;
+ else
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
- return video->colorspace ?
- WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
- WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_NV12_BT709_FULL :
+ WM_KERNEL_VIDEO_NV12_BT601_FULL;
+ else
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
default:
- return video->colorspace ?
- WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
- WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PACKED_BT709_FULL :
+ WM_KERNEL_VIDEO_PACKED_BT601_FULL;
+ else
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
@@ -2693,6 +2693,14 @@ typedef enum {
WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
+ WM_KERNEL_VIDEO_PLANAR_BT601_FULL,
+ WM_KERNEL_VIDEO_NV12_BT601_FULL,
+ WM_KERNEL_VIDEO_PACKED_BT601_FULL,
+
+ WM_KERNEL_VIDEO_PLANAR_BT709_FULL,
+ WM_KERNEL_VIDEO_NV12_BT709_FULL,
+ WM_KERNEL_VIDEO_PACKED_BT709_FULL,
+
KERNEL_COUNT
} wm_kernel_t;
@@ -137,6 +137,54 @@ static const uint32_t ps_kernel_nv12_bt709_limited_static[][4] = {
#include "exa_wm_write.g5b"
};
+static const uint32_t ps_kernel_packed_bt601_full_static[][4] = {
+#include "exa_wm_xy.g5b"
+#include "exa_wm_src_affine.g5b"
+#include "exa_wm_src_sample_argb.g5b"
+#include "exa_wm_yuv_rgb_bt601_full.g5b"
+#include "exa_wm_write.g5b"
+};
+
+static const uint32_t ps_kernel_planar_bt601_full_static[][4] = {
+#include "exa_wm_xy.g5b"
+#include "exa_wm_src_affine.g5b"
+#include "exa_wm_src_sample_planar.g5b"
+#include "exa_wm_yuv_rgb_bt601_full.g5b"
+#include "exa_wm_write.g5b"
+};
+
+static const uint32_t ps_kernel_nv12_bt601_full_static[][4] = {
+#include "exa_wm_xy.g5b"
+#include "exa_wm_src_affine.g5b"
+#include "exa_wm_src_sample_nv12.g5b"
+#include "exa_wm_yuv_rgb_bt601_full.g5b"
+#include "exa_wm_write.g5b"
+};
+
+static const uint32_t ps_kernel_packed_bt709_full_static[][4] = {
+#include "exa_wm_xy.g5b"
+#include "exa_wm_src_affine.g5b"
+#include "exa_wm_src_sample_argb.g5b"
+#include "exa_wm_yuv_rgb_bt709_full.g5b"
+#include "exa_wm_write.g5b"
+};
+
+static const uint32_t ps_kernel_planar_bt709_full_static[][4] = {
+#include "exa_wm_xy.g5b"
+#include "exa_wm_src_affine.g5b"
+#include "exa_wm_src_sample_planar.g5b"
+#include "exa_wm_yuv_rgb_bt709_full.g5b"
+#include "exa_wm_write.g5b"
+};
+
+static const uint32_t ps_kernel_nv12_bt709_full_static[][4] = {
+#include "exa_wm_xy.g5b"
+#include "exa_wm_src_affine.g5b"
+#include "exa_wm_src_sample_nv12.g5b"
+#include "exa_wm_yuv_rgb_bt709_full.g5b"
+#include "exa_wm_write.g5b"
+};
+
#define NOKERNEL(kernel_enum, func, masked) \
[kernel_enum] = {func, 0, masked}
#define KERNEL(kernel_enum, kernel, masked) \
@@ -168,6 +216,14 @@ static const struct wm_kernel_info {
KERNEL(WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited_static, false),
KERNEL(WM_KERNEL_VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited_static, false),
KERNEL(WM_KERNEL_VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited_static, false),
+
+ KERNEL(WM_KERNEL_VIDEO_PLANAR_BT601_FULL, ps_kernel_planar_bt601_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_NV12_BT601_FULL, ps_kernel_nv12_bt601_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PACKED_BT601_FULL, ps_kernel_packed_bt601_full_static, false),
+
+ KERNEL(WM_KERNEL_VIDEO_PLANAR_BT709_FULL, ps_kernel_planar_bt709_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_NV12_BT709_FULL, ps_kernel_nv12_bt709_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PACKED_BT709_FULL, ps_kernel_packed_bt709_full_static, false),
};
#undef KERNEL
@@ -1389,19 +1445,34 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_XVMC:
- return video->colorspace ?
- WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
- WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PLANAR_BT709_FULL :
+ WM_KERNEL_VIDEO_PLANAR_BT601_FULL;
+ else
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
- return video->colorspace ?
- WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
- WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_NV12_BT709_FULL :
+ WM_KERNEL_VIDEO_NV12_BT601_FULL;
+ else
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
default:
- return video->colorspace ?
- WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
- WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PACKED_BT709_FULL :
+ WM_KERNEL_VIDEO_PACKED_BT601_FULL;
+ else
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
@@ -2773,6 +2773,14 @@ typedef enum {
WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
+ WM_KERNEL_VIDEO_PLANAR_BT601_FULL,
+ WM_KERNEL_VIDEO_NV12_BT601_FULL,
+ WM_KERNEL_VIDEO_PACKED_BT601_FULL,
+
+ WM_KERNEL_VIDEO_PLANAR_BT709_FULL,
+ WM_KERNEL_VIDEO_NV12_BT709_FULL,
+ WM_KERNEL_VIDEO_PACKED_BT709_FULL,
+
KERNEL_COUNT
} wm_kernel_t;
#endif
@@ -143,6 +143,48 @@ static const uint32_t ps_kernel_nv12_bt709_limited[][4] = {
#include "exa_wm_write.g6b"
};
+static const uint32_t ps_kernel_packed_bt601_full[][4] = {
+#include "exa_wm_src_affine.g6b"
+#include "exa_wm_src_sample_argb.g6b"
+#include "exa_wm_yuv_rgb_bt601_full.g6b"
+#include "exa_wm_write.g6b"
+};
+
+static const uint32_t ps_kernel_planar_bt601_full[][4] = {
+#include "exa_wm_src_affine.g6b"
+#include "exa_wm_src_sample_planar.g6b"
+#include "exa_wm_yuv_rgb_bt601_full.g6b"
+#include "exa_wm_write.g6b"
+};
+
+static const uint32_t ps_kernel_nv12_bt601_full[][4] = {
+#include "exa_wm_src_affine.g6b"
+#include "exa_wm_src_sample_nv12.g6b"
+#include "exa_wm_yuv_rgb_bt601_full.g6b"
+#include "exa_wm_write.g6b"
+};
+
+static const uint32_t ps_kernel_packed_bt709_full[][4] = {
+#include "exa_wm_src_affine.g6b"
+#include "exa_wm_src_sample_argb.g6b"
+#include "exa_wm_yuv_rgb_bt709_full.g6b"
+#include "exa_wm_write.g6b"
+};
+
+static const uint32_t ps_kernel_planar_bt709_full[][4] = {
+#include "exa_wm_src_affine.g6b"
+#include "exa_wm_src_sample_planar.g6b"
+#include "exa_wm_yuv_rgb_bt709_full.g6b"
+#include "exa_wm_write.g6b"
+};
+
+static const uint32_t ps_kernel_nv12_bt709_full[][4] = {
+#include "exa_wm_src_affine.g6b"
+#include "exa_wm_src_sample_nv12.g6b"
+#include "exa_wm_yuv_rgb_bt709_full.g6b"
+#include "exa_wm_write.g6b"
+};
+
#define NOKERNEL(kernel_enum, func, ns) \
[GEN6_WM_KERNEL_##kernel_enum] = {#kernel_enum, func, 0, ns}
#define KERNEL(kernel_enum, kernel, ns) \
@@ -169,7 +211,6 @@ static const struct wm_kernel_info {
NOKERNEL(OPACITY, brw_wm_kernel__affine_opacity, 2),
NOKERNEL(OPACITY_P, brw_wm_kernel__projective_opacity, 2),
-
KERNEL(VIDEO_PLANAR_BT601_LIMITED, ps_kernel_planar_bt601_limited, 7),
KERNEL(VIDEO_NV12_BT601_LIMITED, ps_kernel_nv12_bt601_limited, 7),
KERNEL(VIDEO_PACKED_BT601_LIMITED, ps_kernel_packed_bt601_limited, 2),
@@ -177,6 +218,14 @@ static const struct wm_kernel_info {
KERNEL(VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited, 7),
KERNEL(VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited, 7),
KERNEL(VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited, 2),
+
+ KERNEL(VIDEO_PLANAR_BT601_FULL, ps_kernel_planar_bt601_full, 7),
+ KERNEL(VIDEO_NV12_BT601_FULL, ps_kernel_nv12_bt601_full, 7),
+ KERNEL(VIDEO_PACKED_BT601_FULL, ps_kernel_packed_bt601_full, 2),
+
+ KERNEL(VIDEO_PLANAR_BT709_FULL, ps_kernel_planar_bt709_full, 7),
+ KERNEL(VIDEO_NV12_BT709_FULL, ps_kernel_nv12_bt709_full, 7),
+ KERNEL(VIDEO_PACKED_BT709_FULL, ps_kernel_packed_bt709_full, 2),
};
#undef KERNEL
@@ -1663,19 +1712,34 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_XVMC:
- return video->colorspace ?
- GEN6_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
- GEN6_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT709_FULL :
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
- return video->colorspace ?
- GEN6_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
- GEN6_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN6_WM_KERNEL_VIDEO_NV12_BT709_FULL :
+ GEN6_WM_KERNEL_VIDEO_NV12_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN6_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ GEN6_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
default:
- return video->colorspace ?
- GEN6_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
- GEN6_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT709_FULL :
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
@@ -235,6 +235,48 @@ static const uint32_t ps_kernel_nv12_bt709_limited[][4] = {
#include "exa_wm_write.g7b"
};
+static const uint32_t ps_kernel_packed_bt601_full[][4] = {
+#include "exa_wm_src_affine.g7b"
+#include "exa_wm_src_sample_argb.g7b"
+#include "exa_wm_yuv_rgb_bt601_full.g7b"
+#include "exa_wm_write.g7b"
+};
+
+static const uint32_t ps_kernel_planar_bt601_full[][4] = {
+#include "exa_wm_src_affine.g7b"
+#include "exa_wm_src_sample_planar.g7b"
+#include "exa_wm_yuv_rgb_bt601_full.g7b"
+#include "exa_wm_write.g7b"
+};
+
+static const uint32_t ps_kernel_nv12_bt601_full[][4] = {
+#include "exa_wm_src_affine.g7b"
+#include "exa_wm_src_sample_nv12.g7b"
+#include "exa_wm_yuv_rgb_bt601_full.g7b"
+#include "exa_wm_write.g7b"
+};
+
+static const uint32_t ps_kernel_packed_bt709_full[][4] = {
+#include "exa_wm_src_affine.g7b"
+#include "exa_wm_src_sample_argb.g7b"
+#include "exa_wm_yuv_rgb_bt709_full.g7b"
+#include "exa_wm_write.g7b"
+};
+
+static const uint32_t ps_kernel_planar_bt709_full[][4] = {
+#include "exa_wm_src_affine.g7b"
+#include "exa_wm_src_sample_planar.g7b"
+#include "exa_wm_yuv_rgb_bt709_full.g7b"
+#include "exa_wm_write.g7b"
+};
+
+static const uint32_t ps_kernel_nv12_bt709_full[][4] = {
+#include "exa_wm_src_affine.g7b"
+#include "exa_wm_src_sample_nv12.g7b"
+#include "exa_wm_yuv_rgb_bt709_full.g7b"
+#include "exa_wm_write.g7b"
+};
+
static const uint32_t ps_kernel_rgb[][4] = {
#include "exa_wm_src_affine.g7b"
#include "exa_wm_src_sample_argb.g7b"
@@ -272,6 +314,12 @@ static const struct wm_kernel_info {
KERNEL(VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited, 7),
KERNEL(VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited, 7),
KERNEL(VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited, 2),
+ KERNEL(VIDEO_PLANAR_BT601_FULL, ps_kernel_planar_bt601_full, 7),
+ KERNEL(VIDEO_NV12_BT601_FULL, ps_kernel_nv12_bt601_full, 7),
+ KERNEL(VIDEO_PACKED_BT601_FULL, ps_kernel_packed_bt601_full, 2),
+ KERNEL(VIDEO_PLANAR_BT709_FULL, ps_kernel_planar_bt709_full, 7),
+ KERNEL(VIDEO_NV12_BT709_FULL, ps_kernel_nv12_bt709_full, 7),
+ KERNEL(VIDEO_PACKED_BT709_FULL, ps_kernel_packed_bt709_full, 2),
KERNEL(VIDEO_RGB, ps_kernel_rgb, 2),
};
#undef KERNEL
@@ -1876,23 +1924,38 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_XVMC:
- return video->colorspace ?
- GEN7_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
- GEN7_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT709_FULL :
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
- return video->colorspace ?
- GEN7_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
- GEN7_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN7_WM_KERNEL_VIDEO_NV12_BT709_FULL :
+ GEN7_WM_KERNEL_VIDEO_NV12_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN7_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ GEN7_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
case FOURCC_RGB888:
case FOURCC_RGB565:
return GEN7_WM_KERNEL_VIDEO_RGB;
default:
- return video->colorspace ?
- GEN7_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
- GEN7_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT709_FULL :
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
@@ -135,6 +135,48 @@ static const uint32_t ps_kernel_nv12_bt709_limited[][4] = {
#include "exa_wm_write.g8b"
};
+static const uint32_t ps_kernel_packed_bt601_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_argb.g8b"
+#include "exa_wm_yuv_rgb_bt601_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_planar_bt601_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_planar.g8b"
+#include "exa_wm_yuv_rgb_bt601_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_nv12_bt601_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_nv12.g8b"
+#include "exa_wm_yuv_rgb_bt601_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_packed_bt709_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_argb.g8b"
+#include "exa_wm_yuv_rgb_bt709_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_planar_bt709_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_planar.g8b"
+#include "exa_wm_yuv_rgb_bt709_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_nv12_bt709_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_nv12.g8b"
+#include "exa_wm_yuv_rgb_bt709_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
static const uint32_t ps_kernel_rgb[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_argb.g8b"
@@ -176,6 +218,12 @@ static const struct wm_kernel_info {
KERNEL(VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited, 7),
KERNEL(VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited, 7),
KERNEL(VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited, 2),
+ KERNEL(VIDEO_PLANAR_BT601_FULL, ps_kernel_planar_bt601_full, 7),
+ KERNEL(VIDEO_NV12_BT601_FULL, ps_kernel_nv12_bt601_full, 7),
+ KERNEL(VIDEO_PACKED_BT601_FULL, ps_kernel_packed_bt601_full, 2),
+ KERNEL(VIDEO_PLANAR_BT709_FULL, ps_kernel_planar_bt709_full, 7),
+ KERNEL(VIDEO_NV12_BT709_FULL, ps_kernel_nv12_bt709_full, 7),
+ KERNEL(VIDEO_PACKED_BT709_FULL, ps_kernel_packed_bt709_full, 2),
KERNEL(VIDEO_RGB, ps_kernel_rgb, 2),
#endif
};
@@ -3827,23 +3875,38 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_XVMC:
- return video->colorspace ?
- GEN8_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
- GEN8_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT709_FULL :
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
- return video->colorspace ?
- GEN8_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
- GEN8_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN8_WM_KERNEL_VIDEO_NV12_BT709_FULL :
+ GEN8_WM_KERNEL_VIDEO_NV12_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN8_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ GEN8_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
case FOURCC_RGB888:
case FOURCC_RGB565:
return GEN8_WM_KERNEL_VIDEO_RGB;
default:
- return video->colorspace ?
- GEN8_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
- GEN8_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT709_FULL :
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
@@ -136,6 +136,48 @@ static const uint32_t ps_kernel_nv12_bt709_limited[][4] = {
#include "exa_wm_write.g8b"
};
+static const uint32_t ps_kernel_packed_bt601_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_argb.g8b"
+#include "exa_wm_yuv_rgb_bt601_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_planar_bt601_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_planar.g8b"
+#include "exa_wm_yuv_rgb_bt601_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_nv12_bt601_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_nv12.g8b"
+#include "exa_wm_yuv_rgb_bt601_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_packed_bt709_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_argb.g8b"
+#include "exa_wm_yuv_rgb_bt709_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_planar_bt709_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_planar.g8b"
+#include "exa_wm_yuv_rgb_bt709_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_nv12_bt709_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_nv12.g8b"
+#include "exa_wm_yuv_rgb_bt709_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
static const uint32_t ps_kernel_rgb[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_argb.g8b"
@@ -177,6 +219,12 @@ static const struct wm_kernel_info {
KERNEL(VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited, 7),
KERNEL(VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited, 7),
KERNEL(VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited, 2),
+ KERNEL(VIDEO_PLANAR_BT601_FULL, ps_kernel_planar_bt601_full, 7),
+ KERNEL(VIDEO_NV12_BT601_FULL, ps_kernel_nv12_bt601_full, 7),
+ KERNEL(VIDEO_PACKED_BT601_FULL, ps_kernel_packed_bt601_full, 2),
+ KERNEL(VIDEO_PLANAR_BT709_FULL, ps_kernel_planar_bt709_full, 7),
+ KERNEL(VIDEO_NV12_BT709_FULL, ps_kernel_nv12_bt709_full, 7),
+ KERNEL(VIDEO_PACKED_BT709_FULL, ps_kernel_packed_bt709_full, 2),
KERNEL(VIDEO_RGB, ps_kernel_rgb, 2),
#endif
};
@@ -3890,23 +3938,38 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_XVMC:
- return video->colorspace ?
- GEN9_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
- GEN9_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT709_FULL :
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
- return video->colorspace ?
- GEN9_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
- GEN9_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN9_WM_KERNEL_VIDEO_NV12_BT709_FULL :
+ GEN9_WM_KERNEL_VIDEO_NV12_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN9_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ GEN9_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
case FOURCC_RGB888:
case FOURCC_RGB565:
return GEN9_WM_KERNEL_VIDEO_RGB;
default:
- return video->colorspace ?
- GEN9_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
- GEN9_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT709_FULL :
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
@@ -448,6 +448,14 @@ enum {
GEN6_WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
GEN6_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT601_FULL,
+ GEN6_WM_KERNEL_VIDEO_NV12_BT601_FULL,
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT601_FULL,
+
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT709_FULL,
+ GEN6_WM_KERNEL_VIDEO_NV12_BT709_FULL,
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT709_FULL,
+
GEN6_KERNEL_COUNT
};
@@ -504,6 +512,14 @@ enum {
GEN7_WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
GEN7_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT601_FULL,
+ GEN7_WM_KERNEL_VIDEO_NV12_BT601_FULL,
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT601_FULL,
+
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT709_FULL,
+ GEN7_WM_KERNEL_VIDEO_NV12_BT709_FULL,
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT709_FULL,
+
GEN7_WM_KERNEL_VIDEO_RGB,
GEN7_WM_KERNEL_COUNT
};
@@ -563,6 +579,14 @@ enum {
GEN8_WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
GEN8_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT601_FULL,
+ GEN8_WM_KERNEL_VIDEO_NV12_BT601_FULL,
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT601_FULL,
+
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT709_FULL,
+ GEN8_WM_KERNEL_VIDEO_NV12_BT709_FULL,
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT709_FULL,
+
GEN8_WM_KERNEL_VIDEO_RGB,
GEN8_WM_KERNEL_COUNT
};
@@ -620,6 +644,14 @@ enum {
GEN9_WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
GEN9_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT601_FULL,
+ GEN9_WM_KERNEL_VIDEO_NV12_BT601_FULL,
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT601_FULL,
+
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT709_FULL,
+ GEN9_WM_KERNEL_VIDEO_NV12_BT709_FULL,
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT709_FULL,
+
GEN9_WM_KERNEL_VIDEO_RGB,
GEN9_WM_KERNEL_COUNT
};
@@ -101,6 +101,7 @@ struct sna_video {
bool has_color_key;
unsigned colorspace;
+ unsigned color_range;
unsigned colorspace_changed;
/** YUV data buffers */