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

Function interpolate_cubic

dnn/src/x86/resize/resize_cv.cpp:1405–1412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1403 const DecimateAlpha* ytab, int ytab_size, const int* yofs);
1404
1405static inline void interpolate_cubic(float x, float* coeffs) {
1406 const float A = -0.75f;
1407
1408 coeffs[0] = ((A * (x + 1) - 5 * A) * (x + 1) + 8 * A) * (x + 1) - 4 * A;
1409 coeffs[1] = ((A + 2) * x - (A + 3)) * x * x + 1;
1410 coeffs[2] = ((A + 2) * (1 - x) - (A + 3)) * (1 - x) * (1 - x) + 1;
1411 coeffs[3] = 1.f - coeffs[0] - coeffs[1] - coeffs[2];
1412}
1413static inline void interpolate_lanczos4(float x, float* coeffs) {
1414 static const double s45 = 0.70710678118654752440084436210485;
1415 static const double cs[][2] = {{1, 0}, {-s45, -s45}, {0, 1}, {s45, -s45},

Callers 3

resize_opencvFunction · 0.70
repFunction · 0.50
resize_opencvFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected