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

Function MNNSamplerNV21Nearest

source/backend/cpu/compute/ImageProcessFunction.cpp:946–968  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

944}
945
946void MNNSamplerNV21Nearest(const unsigned char* source, unsigned char* dest, MNN::CV::Point* points, size_t sta,
947 size_t count, size_t capacity, size_t iw, size_t ih, size_t yStride) {
948 auto srcY = source;
949
950 auto dstY = dest + sta;
951 auto dstUV = dest + (capacity) + (sta / 2) * 2;
952 auto stride = yStride;
953 if (yStride == 0) {
954 stride = iw;
955 }
956 auto srcUV = source + stride * ih;
957 MNNSamplerC1Nearest(srcY, dstY, points, 0, count, capacity, iw, ih, stride);
958
959 MNN::CV::Point uvPoints[2];
960 uvPoints[0].fX = (points[0].fX - 0.01f) / 2.0f;
961 uvPoints[0].fY = (points[0].fY - 0.01f) / 2.0f;
962 uvPoints[1].fX = points[1].fX;
963 uvPoints[1].fY = points[1].fY;
964 if (yStride == 0) {
965 stride = ((iw + 1) / 2) * 2;
966 }
967 MNNSamplerNearest(srcUV, dstUV, uvPoints, 0, (count + 1) / 2, (iw + 1) / 2, (ih + 1) / 2, stride, 2);
968}
969
970static void _swapUV(const unsigned char* source, unsigned char* dest, size_t countC2) {
971 int sta = 0;

Callers 1

MNNSamplerNV12NearestFunction · 0.85

Calls 2

MNNSamplerC1NearestFunction · 0.85
MNNSamplerNearestFunction · 0.85

Tested by

no test coverage detected