MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / interpolate_cubic

Function interpolate_cubic

dnn/src/arm_common/resize/resize_cv.cpp:1000–1007  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

998 const DecimateAlpha* ytab, int ytab_size, const int* yofs);
999
1000static inline void interpolate_cubic(float x, float* coeffs) {
1001 const float A = -0.75f;
1002
1003 coeffs[0] = ((A * (x + 1) - 5 * A) * (x + 1) + 8 * A) * (x + 1) - 4 * A;
1004 coeffs[1] = ((A + 2) * x - (A + 3)) * x * x + 1;
1005 coeffs[2] = ((A + 2) * (1 - x) - (A + 3)) * (1 - x) * (1 - x) + 1;
1006 coeffs[3] = 1.f - coeffs[0] - coeffs[1] - coeffs[2];
1007}
1008static inline void interpolate_lanczos4(float x, float* coeffs) {
1009 static const double s45 = 0.70710678118654752440084436210485;
1010 static const double cs[][2] = {{1, 0}, {-s45, -s45}, {0, 1}, {s45, -s45},

Callers 1

resize_opencvFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected