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

Unified Diff: skia/ext/convolver.h

Issue 6334070: SIMD implementation of Convolver for Lanczos filter etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | skia/ext/convolver.cc » ('j') | skia/ext/convolver.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/convolver.h
diff --git a/skia/ext/convolver.h b/skia/ext/convolver.h
index 04d6fe5c52db2e05218b8973c5e90b944e0b5d8f..a93dece7815325ba5c104ae169c3ac0c73568ed8 100644
--- a/skia/ext/convolver.h
+++ b/skia/ext/convolver.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/cpu.h"
// avoid confusion with Mac OS X's math library (Carbon)
#if defined(__APPLE__)
@@ -98,6 +99,13 @@ class ConvolutionFilter1D {
return &filter_values_[filter.data_location];
}
+ inline void PaddingForSIMD(int align) {
brettw 2011/02/21 04:45:45 I would have thought that you'd want to pad up to
jiesun 2011/02/22 21:37:03 padding in SIMD serve two purpose: 1. make element
+ // Padding more coefficients to allow SIMD to load after the last one.
+ // This has to be done after all |AddFilter| calls.
+ for (int i = 0; i < align; ++i)
+ filter_values_.push_back(static_cast<Fixed>(0));
+ }
+
private:
struct FilterInstance {
// Offset within filter_values for this instance of the filter.
@@ -148,6 +156,21 @@ void BGRAConvolve2D(const unsigned char* source_data,
int output_byte_row_stride,
unsigned char* output);
+void BGRAConvolve2D_C(const unsigned char* source_data,
+ int source_byte_row_stride,
brettw 2011/02/21 04:45:45 Style: be sure to align the args in these two func
jiesun 2011/02/22 21:37:03 Done.
+ bool source_has_alpha,
+ const ConvolutionFilter1D& filter_x,
+ const ConvolutionFilter1D& filter_y,
+ int output_byte_row_stride,
+ unsigned char* output);
+
+void BGRAConvolve2D_SSE2(const unsigned char* source_data,
+ int source_byte_row_stride,
+ bool source_has_alpha,
+ const ConvolutionFilter1D& filter_x,
+ const ConvolutionFilter1D& filter_y,
+ int output_byte_row_stride,
+ unsigned char* output);
} // namespace skia
#endif // SKIA_EXT_CONVOLVER_H_
« no previous file with comments | « no previous file | skia/ext/convolver.cc » ('j') | skia/ext/convolver.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698