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

Function calc_cache_8uc1_2

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

Source from the content-addressed store, hash-verified

551}
552
553void calc_cache_8uc1_2(
554 const Mat8u& src, const Mat8u& dst, const AlignedVector<int>& tabsx,
555 const AlignedVector<int>& tabsy, const AlignedVector<int>& tabrx,
556 const AlignedVector<int>& tabry, int dx, AlignedVector<int>& cache0,
557 AlignedVector<int>& cache1) {
558 (void)tabrx;
559 const uchar* psrc0 = src.ptr(tabsx[dx] + 0);
560 const uchar* psrc1 = src.ptr(tabsx[dx] + 1);
561 int dstcols = dst.cols();
562 int dy = 0;
563
564 // 4 pixels each time
565 for (; dy < dstcols; ++dy) {
566 const uchar* pcsrc00 = psrc0 + (tabsy[dy] + 0);
567 const uchar* pcsrc01 = psrc0 + (tabsy[dy] + 1);
568 const uchar* pcsrc10 = psrc1 + (tabsy[dy] + 0);
569 const uchar* pcsrc11 = psrc1 + (tabsy[dy] + 1);
570 int ry = tabry[dy];
571 int iry = (1 << SCALE) - ry;
572 cache0[dy] = pcsrc01[0] * ry + pcsrc00[0] * iry;
573 cache1[dy] = pcsrc11[0] * ry + pcsrc10[0] * iry;
574 }
575}
576
577void calc_cache_8uc3_1(
578 const Mat8u& src, const Mat8u& dst, const AlignedVector<int>& tabsx,

Callers 1

resize_linear_8u_neonFunction · 0.70

Calls 2

ptrMethod · 0.45
colsMethod · 0.45

Tested by

no test coverage detected