MCPcopy Create free account
hub / github.com/alibaba/MNN / MNNSamplerCopyCommon

Function MNNSamplerCopyCommon

source/backend/cpu/compute/ImageProcessFunction.cpp:844–856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

842}
843
844void MNNSamplerCopyCommon(const unsigned char* source, unsigned char* dest, MNN::CV::Point* points, size_t sta,
845 size_t count, size_t iw, size_t ih, size_t yStride, int bpp) {
846 dest = dest + bpp * sta;
847 MNN::CV::Point curPoints;
848 curPoints.fX = points[0].fX;
849 curPoints.fY = points[0].fY;
850 float xMax = iw - 1;
851 float yMax = ih - 1;
852 int y = (int)roundf(__clamp(curPoints.fY, 0, yMax));
853 int x = (int)roundf(__clamp(curPoints.fX, 0, xMax));
854 auto sourcePos = y * yStride + bpp * x;
855 ::memcpy(dest, source + sourcePos, bpp * count);
856}
857
858void MNNSamplerI420Copy(const unsigned char* source, unsigned char* dest, MNN::CV::Point* points, size_t sta,
859 size_t count, size_t capacity, size_t iw, size_t ih, size_t yStride) {

Callers 3

MNNSamplerC1CopyFunction · 0.85
MNNSamplerC3CopyFunction · 0.85
MNNSamplerC4CopyFunction · 0.85

Calls 1

__clampFunction · 0.70

Tested by

no test coverage detected