Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1326)

Side by Side Diff: source/row_common.cc

Issue 2367253003: bt709 coefficients for video constrained space (Closed)
Patch Set: bt709 coefficients for video constrained space Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. 2 * Copyright 2011 The LibYuv Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 #undef BG 1136 #undef BG
1137 #undef BR 1137 #undef BR
1138 #undef YGB 1138 #undef YGB
1139 #undef UB 1139 #undef UB
1140 #undef UG 1140 #undef UG
1141 #undef VG 1141 #undef VG
1142 #undef VR 1142 #undef VR
1143 #undef YG 1143 #undef YG
1144 1144
1145 // BT.709 YUV to RGB reference 1145 // BT.709 YUV to RGB reference
1146 // * R = Y - V * -1.28033 1146 // R = (Y - 16) * 1.164 - V * -1.793
1147 // * G = Y - U * 0.21482 - V * 0.38059 1147 // G = (Y - 16) * 1.164 - U * 0.213 - V * 0.533
1148 // * B = Y - U * -2.12798 1148 // B = (Y - 16) * 1.164 - U * -2.112
1149 1149
1150 // Y contribution to R,G,B. Scale and bias. 1150 // Y contribution to R,G,B. Scale and bias.
1151 #define YG 16320 /* round(1.000 * 64 * 256 * 256 / 257) */ 1151 #define YG 16320 /* round(1.000 * 64 * 256 * 256 / 257) */
fbarchard1 2016/09/27 22:12:43 These should now be same as bt601 to compensate fo
1152 #define YGB 32 /* 64 / 2 */ 1152 #define YGB 32 /* 64 / 2 */
1153 1153
1154 // TODO(fbarchard): Find way to express 2.12 instead of 2.0. 1154 // TODO(fbarchard): Find way to express 2.12 instead of 2.0.
1155 // U and V contributions to R,G,B. 1155 // U and V contributions to R,G,B.
1156 #define UB -128 /* max(-128, round(-2.12798 * 64)) */ 1156 #define UB -128 /* max(-128, round(-2.112 * 64)) */
1157 #define UG 14 /* round(0.21482 * 64) */ 1157 #define UG 14 /* round(0.213 * 64) */
1158 #define VG 24 /* round(0.38059 * 64) */ 1158 #define VG 34 /* round(0.533 * 64) */
1159 #define VR -82 /* round(-1.28033 * 64) */ 1159 #define VR -115 /* round(-1.793 * 64) */
1160 1160
1161 // Bias values to round, and subtract 128 from U and V. 1161 // Bias values to round, and subtract 128 from U and V.
1162 #define BB (UB * 128 + YGB) 1162 #define BB (UB * 128 + YGB)
1163 #define BG (UG * 128 + VG * 128 + YGB) 1163 #define BG (UG * 128 + VG * 128 + YGB)
1164 #define BR (VR * 128 + YGB) 1164 #define BR (VR * 128 + YGB)
1165 1165
1166 #if defined(__aarch64__) 1166 #if defined(__aarch64__)
1167 const struct YuvConstants SIMD_ALIGNED(kYuvH709Constants) = { 1167 const struct YuvConstants SIMD_ALIGNED(kYuvH709Constants) = {
1168 { -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR }, 1168 { -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR },
1169 { -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR }, 1169 { -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR },
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
2618 dst_rgb565 += twidth * 2; 2618 dst_rgb565 += twidth * 2;
2619 width -= twidth; 2619 width -= twidth;
2620 } 2620 }
2621 } 2621 }
2622 #endif 2622 #endif
2623 2623
2624 #ifdef __cplusplus 2624 #ifdef __cplusplus
2625 } // extern "C" 2625 } // extern "C"
2626 } // namespace libyuv 2626 } // namespace libyuv
2627 #endif 2627 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698