MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / KeysCubicKernelFunc

Class KeysCubicKernelFunc

tensorflow/core/kernels/sampling_kernels.h:122–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120};
121
122struct KeysCubicKernelFunc {
123 // http://ieeexplore.ieee.org/document/1163711/
124 // R. G. Keys. Cubic convolution interpolation for digital image
125 // processing. IEEE Transactions on Acoustics, Speech, and Signal
126 // Processing, 29(6):1153–1160, 1981.
127 float operator()(float x) const {
128 x = std::abs(x);
129 if (x >= 2.0f) {
130 return 0.0f;
131 } else if (x >= 1.0f) {
132 return ((-0.5f * x + 2.5f) * x - 4.0f) * x + 2.0f;
133 } else {
134 return ((1.5f * x - 2.5f) * x) * x + 1.0f;
135 }
136 }
137 float Radius() const { return 2.f; }
138};
139
140struct MitchellCubicKernelFunc {
141 // https://doi.org/10.1145/378456.378514

Callers 1

CreateKeysCubicKernelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected