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

Side by Side Diff: source/scale_common.cc

Issue 1533643005: Add rounding to InterpolateRow for improved quality and consistency. (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: lint fix in unittest Created 5 years 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 | « source/scale_argb.cc ('k') | unit_test/planar_test.cc » ('j') | 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 2013 The LibYuv Project Authors. All rights reserved. 2 * Copyright 2013 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 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 void (*InterpolateRow)(uint8* dst_argb, const uint8* src_argb, 869 void (*InterpolateRow)(uint8* dst_argb, const uint8* src_argb,
870 ptrdiff_t src_stride, int dst_width, int source_y_fraction) = 870 ptrdiff_t src_stride, int dst_width, int source_y_fraction) =
871 InterpolateRow_C; 871 InterpolateRow_C;
872 const int max_y = (src_height > 1) ? ((src_height - 1) << 16) - 1 : 0; 872 const int max_y = (src_height > 1) ? ((src_height - 1) << 16) - 1 : 0;
873 int j; 873 int j;
874 assert(bpp >= 1 && bpp <= 4); 874 assert(bpp >= 1 && bpp <= 4);
875 assert(src_height != 0); 875 assert(src_height != 0);
876 assert(dst_width > 0); 876 assert(dst_width > 0);
877 assert(dst_height > 0); 877 assert(dst_height > 0);
878 src_argb += (x >> 16) * bpp; 878 src_argb += (x >> 16) * bpp;
879 #if defined(HAS_INTERPOLATEROW_SSE2)
880 if (TestCpuFlag(kCpuHasSSE2)) {
881 InterpolateRow = InterpolateRow_Any_SSE2;
882 if (IS_ALIGNED(dst_width_bytes, 16)) {
883 InterpolateRow = InterpolateRow_SSE2;
884 }
885 }
886 #endif
887 #if defined(HAS_INTERPOLATEROW_SSSE3) 879 #if defined(HAS_INTERPOLATEROW_SSSE3)
888 if (TestCpuFlag(kCpuHasSSSE3)) { 880 if (TestCpuFlag(kCpuHasSSSE3)) {
889 InterpolateRow = InterpolateRow_Any_SSSE3; 881 InterpolateRow = InterpolateRow_Any_SSSE3;
890 if (IS_ALIGNED(dst_width_bytes, 16)) { 882 if (IS_ALIGNED(dst_width_bytes, 16)) {
891 InterpolateRow = InterpolateRow_SSSE3; 883 InterpolateRow = InterpolateRow_SSSE3;
892 } 884 }
893 } 885 }
894 #endif 886 #endif
895 #if defined(HAS_INTERPOLATEROW_AVX2) 887 #if defined(HAS_INTERPOLATEROW_AVX2)
896 if (TestCpuFlag(kCpuHasAVX2)) { 888 if (TestCpuFlag(kCpuHasAVX2)) {
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 *dx = -*dx; 1120 *dx = -*dx;
1129 // src_width = -src_width; // Caller must do this. 1121 // src_width = -src_width; // Caller must do this.
1130 } 1122 }
1131 } 1123 }
1132 #undef CENTERSTART 1124 #undef CENTERSTART
1133 1125
1134 #ifdef __cplusplus 1126 #ifdef __cplusplus
1135 } // extern "C" 1127 } // extern "C"
1136 } // namespace libyuv 1128 } // namespace libyuv
1137 #endif 1129 #endif
OLDNEW
« no previous file with comments | « source/scale_argb.cc ('k') | unit_test/planar_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698