{"id":475450,"date":"2025-09-17T10:58:04","date_gmt":"2025-09-17T10:58:04","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=475450"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=475450","title":{"rendered":"\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0433\u043e \u0437\u0440\u0435\u043d\u0438\u044f (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 OpenCV) \u0434\u043b\u044f RISC-V"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>OpenCV \u2014 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0430\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0433\u043e \u0437\u0440\u0435\u043d\u0438\u044f \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043d\u0438\u0445. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0445 \u043f\u043e\u0434 RISC-V \u2014 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0417\u0438\u043c\u043d\u0435\u0439 \u0448\u043a\u043e\u043b\u044b RISC-V <a href=\"https:\/\/yadro.com?utm_source=habr&amp;utm_medium=referral&amp;utm_campaign=riscv-school-170925\">YADRO<\/a> \u0441\u0435\u0437\u043e\u043d\u0430 2024\u20132025 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u044c \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u044b \u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430 \u041b\u043e\u0431\u0430\u0447\u0435\u0432\u0441\u043a\u043e\u0433\u043e (\u041d\u041d\u0413\u0423). \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043d\u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443\u0442 \u043e \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c2c\/3b5\/9fe\/c2c3b59fef98721d52f9b49ba6291bf6.jpg\" width=\"780\" height=\"440\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/c2c\/3b5\/9fe\/c2c3b59fef98721d52f9b49ba6291bf6.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c2c\/3b5\/9fe\/c2c3b59fef98721d52f9b49ba6291bf6.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c. \u0418\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0438 \u2014 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043e\u0431\u0449\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 RISC-V Vector Extension (RVV) \u2014 \u0441 \u044d\u0442\u0438\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0448\u0438\u0440\u0438\u043d\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 SIMD, \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u0438 \u0433\u0438\u0431\u043a\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u00ab\u0445\u0432\u043e\u0441\u0442\u0430\u043c\u0438\u00bb.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/509\/4bc\/d7c\/5094bcd7c44131a69fe31e20e63e90ce.png\" width=\"1600\" height=\"897\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/509\/4bc\/d7c\/5094bcd7c44131a69fe31e20e63e90ce.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/509\/4bc\/d7c\/5094bcd7c44131a69fe31e20e63e90ce.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<h3>Flip<\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"https:\/\/docs.opencv.org\/4.x\/d2\/de8\/group__core__array.html#gaca7be533e3dac7feb70fc60635adf441\"><strong>flip<\/strong><\/a> \u2014 \u044d\u0442\u043e \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438\u043b\u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 C++ \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0440\u0435\u0432\u0435\u0440\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0439\u0442\u043e\u0432, \u0430 \u043f\u043e\u0434 RVV \u0435\u0433\u043e \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">inline int flipsu(const uchar * src, size_t sro_step, uchar * dst, size_t dst_step, int width, int height, int flip_code) {  if (flip_code == 0) { \/\/ Vertical flip    for (int i = 0; i &lt; height; ++i) {      const uchar * src_row = sro + i * src_step;      uchar * dst_row = dst + (height \u2013 1 \u2013 i) * dst_step;      int j = 0\uff1b      while (j &lt; width) {        size_t vl = __riscv_vsetvl_e8m1 (width \u2013 j);        vuint8m1_t v_src = __riscv_vle8_v_u8m1(src_row + j, vl);        __riscv_vse8_v_u8m1(dst_row + j, v_src, vl);        j += vl;      }    }} else if (flip_code &gt; 0) { \/\/ Horizontal flip  for (int i = 0; i &lt; height; ++i) {    const uchar * src_row = src + i * src_step;    uchar * dst_row = dst + i * dst_step;    int j = 0;    while (j &lt; width) {      size_t vl = __riscv_vsetvl_e0m1(width \u2013 j);      vuint8m1_t v_src = __riscv_vle8_v_u8m1(src_row + j, vl);            vuint8m1_t v_dst = __riscv_vrgather_vx_u8m1(v_src, vl \u2013 1, vl);      for (size_t k = 1; k &lt; vl; ++k) {        v_dst = __riscv_vrgather_vx_u8m1(v_dst, vl \u2013 1 \u2013 k, vl);      }      __riscv_vse8_v_u8m1(dst_row + (width - j - vl), v_dst, vl);      j += vI;    }  }<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>AddWeighted8u<\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"https:\/\/docs.opencv.org\/4.x\/d3\/ddd\/group__core__hal__functions.html#gab5189f195b48e31675327ad4af3c05a4\"><strong>addWeighted8u<\/strong><\/a> \u2014 \u044d\u0442\u043e \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u043e\u0435 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u043c\u0430\u0442\u0440\u0438\u0446 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u0431\u0440\u0435\u0437\u043a\u043e\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043e [0, 255] \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0432\u043e\u0441\u044c\u043c\u0438\u0431\u0438\u0442\u043d\u044b\u043c\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438. \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432\u0435\u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>dst = alpha*src1 + beta*src2 + gamma<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 RISC-V:<\/p>\n<pre><code class=\"cpp\">inline int addweighted8u(const uchar* src1, size_t step1,  const uchar* src2, size_t step2, uchar* dst, size_t step,  int width, int height, const void* _scalars) {  const float* scalars = static_cast&lt;const float*&gt;(_scalars);  int alpha = 1;  int beta = 1;  int gamma = 0;  int total_elements = width * height;  int j = 0;  while (j &lt; total_elements) {    size_t vl =_riscv_vsetvl_e8m1(total_elements \u2013 j);    \/\/ Calculate the 1D index for src1, src2, and dst    const uint8_t* p_src1 = src1 + j;    const uint8_t* p_src2 = src2 + j;    uint8_t* p_dst = dst + j;    vuint8m1_t v_row1 = __riscv_vle8_v_u8m1(p_src1, vl);    vuint8m1_t v_row2 = __riscv_vle8_v_u8m1(p_src2, vl);    vuint16m2_t v_row1_w = __riscv_vwcvtu_x_x_v_u16m2(v_row1, vl);    vuint16m2_t v_row2_w = __riscv_vwcvtu_x_x_v_u16m2(v_row2, vl);    \/\/ Compute weighted sum    vuint16m2_t v_res = __riscv_vmul_vx_u16m2(v_row1_w, alpha, vl);    v_res = __riscv_vwmaccu_vx_u16m2(v_res, beta, v_row2, vl);    v_res = __riscv_vadd_vx_u16m2(v_res, gamma, vl);    \/\/ Clamp results to [0, 255]    v_res =__riscv_vmaxu_vx_u16m2(v_res, 0.0f, vl);    v_res =_riscv_vminu_vx_u16m2(v_res, 255.0f, vl);<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u043a\u0430\u043b\u044f\u0440\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438 \u043d\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0414\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0438\u0437 uint8_t \u0432 uint16_t (\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0431\u0438\u0442\u043d\u043e\u0441\u0442\u0438) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 vwcvtu. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0442\u0435\u0440\u044f\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441 32-\u0431\u0438\u0442\u043d\u044b\u043c\u0438 float. \u041e\u043d\u0430 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0430 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c, \u043c\u044b \u043e\u0442\u043a\u0430\u0442\u0438\u043b\u0438\u0441\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043a \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0431\u0435\u0437 float. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e, \u043d\u043e \u043a \u0434\u0435\u0434\u043b\u0430\u0439\u043d\u0443 \u043c\u044b \u0443\u0441\u043f\u0435\u043b\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 int. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0443.<\/p>\n<h3>Split8u<\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"https:\/\/docs.opencv.org\/4.x\/d3\/ddd\/group__core__hal__functions.html#ga9a989ec41345fcd2e66cc809fa9a4cb4\"><strong>split8u<\/strong><\/a> \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u043a\u0430\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u043a\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0445:<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/93c\/ba1\/458\/93cba14586b46c53f0a9cde8ee81a8fd.png\" width=\"1322\" height=\"612\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/93c\/ba1\/458\/93cba14586b46c53f0a9cde8ee81a8fd.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/93c\/ba1\/458\/93cba14586b46c53f0a9cde8ee81a8fd.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412 \u043d\u0435\u0439 \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 src, \u0433\u0434\u0435 \u043c\u044b \u0445\u0440\u0430\u043d\u0438\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0432\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 dst \u0434\u043b\u044f \u0435\u0435 \u043e\u0434\u043d\u043e\u043a\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0446\u0438\u043a\u043b\u0443 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 dst \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 src. \u0412\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">vl = __riscv_vsetvlmax_e8m8();i = 0;uchar *dst0 = dst[0], *dst1 = dst[1];for (; i &lt;= len - vl * 4; i += vl * 4) {  auto a1 = __riscv_vlse8_v_u8m_1(src + i * cn, cn, vl);  auto b1 = __riscv_vlse8_v_u8m_1(src + 1 + i * cn, cn, vl);  \u2026  auto a4 = __riscv_vlse8_v_u8m_1(src + (i + Vl + vl + vl) * cn, cn, vl);  auto b4 = __riscv_vise8_v_u8m_1(src + 1 + (i + vl + vl + vl) * cn, cn, vl);__ riscv_vse8_v_ u8m1(dst0 + i, a1, vl);__ riscv_vse8_v_ u8m1(dst1 + i, b1, vi);  ...__ riscv_vse8_v_u8m1(dst0 + i + vl + vl + vl, a4, vl);__ riscv_vse8_v_u8m1(dst1 + i + vl + vl + vl, b4, vl);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041c\u044b \u0432\u0437\u044f\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 vl \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0430 <code>__riscv_vsetvlmax_e8m8()<\/code> \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u043b\u0438 \u0440\u0443\u0447\u043d\u043e\u0439 loop-unrolling \u043d\u0430 \u0447\u0435\u0442\u044b\u0440\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0447\u0442\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041d\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043b\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043c\u0430\u0441\u043a\u0438 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u043e\u0432 \u2014 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2a2\/787\/e29\/2a2787e291683981ff4e9f14d324f8a6.png\" alt=\"Baseline no intr \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f split8u \u0431\u0435\u0437 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u043e\u0432, baseline \u2014 \u0441 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c\u0438, pr m8 \u2014 \u0441 RISC-V \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0430\u043c\u0438\" title=\"Baseline no intr \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f split8u \u0431\u0435\u0437 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u043e\u0432, baseline \u2014 \u0441 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c\u0438, pr m8 \u2014 \u0441 RISC-V \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0430\u043c\u0438\" width=\"1600\" height=\"393\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/2a2\/787\/e29\/2a2787e291683981ff4e9f14d324f8a6.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2a2\/787\/e29\/2a2787e291683981ff4e9f14d324f8a6.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption><em>Baseline no intr \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f split8u \u0431\u0435\u0437 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u043e\u0432, baseline \u2014 \u0441 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c\u0438, pr m8 \u2014 \u0441 RISC-V \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0430\u043c\u0438<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0431\u0435\u0437 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u043e\u0432 \u043d\u0430\u0448\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432 6\u20137, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438 \u0432 12 \u0440\u0430\u0437. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0441 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0430\u043c\u0438 \u0442\u043e\u0436\u0435 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430: \u0443 \u043d\u0430\u0441 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432 2\u20133, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438 \u0432 5 \u0440\u0430\u0437. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"https:\/\/github.com\/opencv\/opencv\/pull\/26884\">\u0432 pull request OpenCV<\/a>.<\/p>\n<h3>InvSqrt32f<\/h3>\n<p><a href=\"https:\/\/docs.opencv.org\/4.x\/d3\/ddd\/group__core__hal__functions.html#gae41866c26362d0ee7d48198f7b1215de\"><strong>InvSqrt32f<\/strong><\/a> \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0440\u043d\u044f. \u041e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 <code>void cv::pow(cv::InputArray src, -0.5, cv::OutputArray dst)<\/code>. \u0412\u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:<\/p>\n<pre><code class=\"cpp\">void invSqrt32f(const float* src, float* dst, int len)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0438, \u043d\u043e \u043e\u043d\u0438 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0439 baseline-\u043a\u043e\u0434. \u0412\u043e\u0442 \u043d\u0430\u0448\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:<\/p>\n<pre><code class=\"cpp\">inline int invsqrt32f (const float *src, float *dst, const int len) {  const size_t vl = __riscv_vsetvl_e32m8(len);  const size_t remainings = len % vl;  auto cal_fun = [&amp;](const size_t i, const size_t vl) {    printf(\"vl=%d,\", vl);    vfloat32m8_t vsrc = __riscv_vle32_v_f32m8(&amp;src[i], vl),          vres;    vres = __riscv_vfsqrt_v_f32m8(vsrc, vl);    vres = __riscv_vfrdiv_vf_f32m8(vres, 1., vl);    _riscv_vse32_V_f32m8(&amp;dst[i], vres, vl);  };  size_t i = 0;  for (; i &lt; len \u2013 remainings; i += vl)    calc_fun(i, vl);  if (remainings) {    size_t tail_len = __riscv_vsetvl_e32m8(len - i);    calc_fun(i, tail_len) ;  \uff5d  return CV_HAL_ERROR_OK;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041e\u043d\u0430 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0432\u043e\u0441\u0435\u043c\u044c \u0447\u0438\u0441\u0435\u043b float32 \u0432 \u0431\u0443\u0444\u0435\u0440, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043a\u043e\u0440\u0435\u043d\u044c, \u0434\u0435\u043b\u0438\u0442 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u043d\u0430 \u043a\u043e\u0440\u0435\u043d\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u044c. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e vl \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b. \u0414\u043b\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. \u0412 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u0445 RISC-V ISA, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0440\u043d\u044f \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u043e\u043b\u0435\u0435 \u0441\u0435\u043c\u0438 \u0437\u043d\u0430\u043a\u043e\u0432, \u0447\u0442\u043e \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c \u043f\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430\u0448\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u0434\u043d\u0438\u043c \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u043e\u043c.<\/p>\n<h3>Sqrt32f<\/h3>\n<p><a href=\"https:\/\/docs.opencv.org\/4.x\/d3\/ddd\/group__core__hal__functions.html#ga99f1449955e5dd00966f4e37fbf72027\"><strong>Sqrt32f<\/strong><\/a> \u2014 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u043c\u0443 \u043a\u043e\u0440\u043d\u044e 32-\u0431\u0438\u0442\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b. \u041f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0435\u0435 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u043a\u043e\u0440\u0435\u043d\u044c. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u0438\u0442\u043e\u0433\u0435 \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u0430\u0441\u044c \u0432 6\u20138,5 \u0440\u0430\u0437, \u043f\u0440\u0438\u0447\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u043e \u043c\u0435\u0440\u0435 \u0440\u043e\u0441\u0442\u0430 \u043c\u0430\u0442\u0440\u0438\u0446:<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/34c\/34a\/9c6\/34c34a9c64cf815d0a8b381f60e4ff6f.png\" width=\"1196\" height=\"286\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/34c\/34a\/9c6\/34c34a9c64cf815d0a8b381f60e4ff6f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/34c\/34a\/9c6\/34c34a9c64cf815d0a8b381f60e4ff6f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041a\u043e\u0434 \u043d\u0430\u0448\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">inline int sqrt32f (const float *src, float *dst, int len) {  const size_t vl = __riscv_vsetvl_e32m8(len);  const size_t remainings = len % vl;  auto calc_fun = [&amp;](const size_t i, const size_t vl) {    vfloat32m8_t vres;    {      vfloat32m8_t vsrc = __riscv_vle32_v_f32m8(&amp;src[i], vl);      vres = __riscv_vfsqrt_v_f32m8(vsrc, vl);    }    _riscv_vse32_v_f32m8(&amp;dst[i], vres, vl);  };  size t i = 0;  for (; i &lt; len \u2013 remainings; i += vl)    calc_fun(i, vl);  if (remainings){    size_t tail_len = __riscv_vsetv1_e32m8(len - i);    calc_fun(i, tail_len);  }  return CV_HAL_ERROR_OK;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>Sqrt64f<\/h3>\n<p>\u0412 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 OpenCV \u0444\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"https:\/\/docs.opencv.org\/4.x\/d3\/ddd\/group__core__hal__functions.html#ga2343231151ea0b652a3aa38f0b57b9e1\"><strong>sqrt64f<\/strong><\/a> \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e, \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432 \u0432 sqrt, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u0442\u0438\u043f\u0430 double. \u0414\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 RVV: \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u0435\u0442\u043e\u0434 \u041d\u044c\u044e\u0442\u043e\u043d\u0430 \u0434\u043b\u044f \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"cpp\">void sqrt64f(const double* src, double* dst, int n) {  ssize_t i = 0;  ssize_t vlmax = __riscv_vsetvlmax_e64m1();  while(i &lt; n) {    ssize_t vl = n - i;    if(vl &gt; vlmax) vl = vlmax;    vl = __riscv_vsetvl_e64m1(vl);    vfloat64m1_t v_x = __riscv_vle64_v_f64m1(&amp;src[i], vl);    vfloat64m1_t result = __riscv_vfmv_v_f_f64m1(static_cast&lt;double&gt;(0), vl);        vfloat64m1_t approx = __riscv_vfmv_v_f_f64m1(static_cast&lt;double&gt;(1), vl);    for(ssize_t step = 0; step &lt; 100; ++step) {      approx = __riscv_vfadd_vv_f64m1(approx, __riscv_vfdiv_vv_f64m1(v_x, approx, vl), vl);      approx = __riscv_vfmul_vf_f64m1(approx, static_cast&lt;double&gt;(0.5), vl);    }    __riscv_vse64_v_f64m1(&amp;dst[i], approx, vl);    i += vl;  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430, \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u0446\u0438\u043a\u043b\u0430 \u0438 \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h3>Exp32f<\/h3>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u2014 <a href=\"https:\/\/docs.opencv.org\/4.x\/d3\/ddd\/group__core__hal__functions.html#gaaa6369f0c58d52fb7faca9d2b697479f\"><strong>exp32f<\/strong><\/a>, \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0443, \u0437\u0430\u0442\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u0435\u043a\u043e\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0431\u043e\u0440 \u043f\u043e \u0442\u0438\u043f\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u044b \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b\u0438 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u0440\u044f\u0434 \u0422\u0435\u0439\u043b\u043e\u0440\u0430 \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b:<\/p>\n<pre><code class=\"cpp\">void exp32f( const float * x, float *y, int n ){  CV INSTRUMENT REGION ();  const float* const expTab_f = cv::details::getExpTab32f(;    const float  A4 = (float) (1.000000000000002438532970795181890933776 \/ EXPPOLY_32F_A0),  A3 = (float) (.6931471805521448196800669615864773144641 \/ EXPPOLY_32F_A0),  A2 = (float) (.2402265109513301490103372422686535526573 \/ EXPPOLY_32F_A0),  A1 = (float) (.5550339366753125211915322047004666939128e-1 \/ EXPPOLY_32F A0);  int i = 0;  const Cv32suf* x = (const Cv32suf*)_x;  float minval = (float)(-exp_max_val\/exp_prescale);  float maxval = (float)(exp_max_val\/exp_prescale);  float postscale = (float)exp_postscale;#if CV_SIMD  const int VECSZ = VTraits&lt;v_float32&gt;::vlanes();  const v_float32 vprescale = vx_setall_f32((float) exp_prescale) ;  const v_float32 vpostscale = vx_setall_f32((float) exp_postscale);  const v_float32 vminval = vx_setall_f32(minval);  const v_float32 vmaxval = vx_setall_f32(maxval) ;  const v_float32 vA1 = vx_setall_f32((float)A1);  const v_float32 vA2 = vx_setall_32((float) A2);  const v_float32 vA3 = vx_setall_f32((float)A3);  const v_float32 vA4 = vx_setall_f32((float)A4);  const v_int32 vidxmask = vx_setall_s32(EXPTAB_MASK) ;  bool y_aligned = (size_t)(void*)y % 32 == 0;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u043e \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438:<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/659\/ba2\/6eb\/659ba26ebaad4a7754bcfe05999b1b0b.png\" width=\"1331\" height=\"655\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/659\/ba2\/6eb\/659ba26ebaad4a7754bcfe05999b1b0b.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/659\/ba2\/6eb\/659ba26ebaad4a7754bcfe05999b1b0b.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u043e \u043d\u0430\u0448\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u0432 OpenCV \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u0431\u044b\u043b\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0438 \u043a \u043a\u043e\u0434\u0443 \u044f\u0432\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432, \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0435\u0433\u043e \u043c\u0435\u043d\u044f\u0442\u044c, \u0438 \u0442\u043e\u0433\u0434\u0430, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u044b \u043f\u0440\u0438\u0434\u0435\u043c \u043a \u043b\u0443\u0447\u0448\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c.<\/p>\n<h3>Exp64f<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441\u0442\u0430\u043b\u0430 <a href=\"https:\/\/docs.opencv.org\/4.x\/d3\/ddd\/group__core__hal__functions.html#ga6cbf3e40dc9952420ab8ef0a32d74f79\"><strong>exp64f<\/strong><\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0442\u043e\u043a, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0430\u043c\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432. \u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0441\u043d\u043e\u0432\u0430 \u043d\u0430\u0448\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u2014 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0447\u0438\u0441\u043b\u0430 2, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u043e\u0432. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0443 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0438 \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0435\u0435 \u0441 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u0440\u044f\u0434 \u0422\u0435\u0439\u043b\u043e\u0440\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b. \u0417\u0430\u0442\u0435\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0446\u0435\u043b\u0443\u044e \u0438 \u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c.<\/p>\n<p>\u0412\u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u2014 \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 2 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0446\u0435\u043b\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0447\u0438\u0441\u043b\u0430 x (2<sup>int<\/sup>):<\/p>\n<pre><code class=\"cpp\">inline vfloat64m8_t pow2_v_i64m8_f64m8(vint64m8_t n, size_t vl){  const int64_t BIAS_64 = 1023;  vint64m8_t exp =_riscv_vadd_vx_i64m8(n, BIAS_64, vl);  vint64m8_t bits =_riscv_vs1l_vx_i64m8(exp, 52, vl);  return __riscv_vreinterpret_v_164m8_f64m8(bits);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439, \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0438\u0445 \u0441 \u0432\u0435\u0441\u043e\u043c, \u0441\u0434\u0432\u0438\u0433\u0430\u0435\u043c \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0431\u0438\u0442\u044b \u0432 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">vfloat64m8_t vx = __riscv_vle64_v_f64m8(sc + i, vl);vx = __riscv_vfmul_vf_f64m8(vx, CL_M_LOG2E, vl);vint64m8_t int_part = __riscv_vfcvt_x_f_v_i64m8(vx, vl);vfloat64m8_t vpow2n = pow2_v_i64m8_f64m8(int_part, vl);vfloat64m8_t frac_part = __riscv_vfsub_vv_f64m8(vx, __riscv_vfcvt_f_x_v_f64m8(int_part, vl), vl);frac_part = _riscv_vfmul_vf_f64m8(frac_part, CV_LOG2, vl);vfloat64m8_t term = frac_part;vfloat64m8_t res = __riscv_vfadd_vf_f64m8(frac_part, 1.0, vl);for (int j= 0; j &lt; 10; ++j) {  term = __riscv_vfmul_vv_f64m8(term, frac_part, vl);  res = __riscv_vfmacc_vf_f64m8(res, factor_term[j], term, vl);}res = _riscv_vfmul_vv_f64m8(res, vpow2n, vl);__riscv_vse64_v_f64m8(dst + i, res, vl);<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u2014 \u044d\u0442\u043e \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0414\u0430\u043b\u044c\u0448\u0435 \u0438\u0434\u0435\u0442 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0445 \u043d\u0430 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0446\u0435\u043b\u0443\u044e \u0438 \u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c. \u0414\u043b\u044f \u0446\u0435\u043b\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0434\u0432\u043e\u0439\u043a\u0438, \u0430 \u0441 \u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u043b\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e \u0440\u044f\u0434\u043e\u043c \u0422\u0435\u0439\u043b\u043e\u0440\u0430 12 \u043f\u043e\u0440\u044f\u0434\u043a\u0430. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u043d\u0430 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0443 \u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>\u041c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0439 \u0438 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Banana Pi k1:<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/58c\/6e9\/047\/58c6e90479b339529ac6998aacb182ec.png\" alt=\"\u041f\u043e \u0438\u0442\u043e\u0433\u0430\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u044b\u043b\u0430 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043e 10-13\" title=\"\u041f\u043e \u0438\u0442\u043e\u0433\u0430\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u044b\u043b\u0430 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043e 10-13\" width=\"1227\" height=\"309\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/58c\/6e9\/047\/58c6e90479b339529ac6998aacb182ec.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/58c\/6e9\/047\/58c6e90479b339529ac6998aacb182ec.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption><em>\u041f\u043e \u0438\u0442\u043e\u0433\u0430\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u044b\u043b\u0430 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043e 10<sup>-13<\/sup><\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u041c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 LMUL M8, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430 M1, M2, M4 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0432 4\u20136 \u0440\u0430\u0437, \u0430 \u043d\u0430 M8 \u2014 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 8 \u0440\u0430\u0437. \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 8, \u0442\u043e \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0438 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043e\u0442 7 \u0434\u043e 7,5 \u0440\u0430\u0437. \u0414\u043b\u044f \u043c\u0430\u0442\u0440\u0438\u0446, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 8 \u2014 \u0432 8, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438 \u0432 9 \u0440\u0430\u0437.<\/p>\n<p>\u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c 10<sup>-13<\/sup> \u043c\u044b \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0441\u0442\u043e\u0432 OpenCV, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f: \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u044f\u0434\u0430 \u0422\u0435\u0439\u043b\u043e\u0440\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043e 12 \u0447\u043b\u0435\u043d\u0430. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0443\u0436\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u044b <a href=\"https:\/\/github.com\/opencv\/opencv\/pull\/26886\">\u0432 pull request \u0434\u043b\u044f OpenCV<\/a>.<\/p>\n<p><em>\u0421\u043e\u0441\u0442\u0430\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u041d\u041d\u0413\u0423: \u0414\u0430\u043d\u0438\u0438\u043b \u0410\u043d\u0443\u0444\u0440\u0438\u0435\u0432, \u0412\u043b\u0430\u0434\u0438\u0441\u043b\u0430\u0432 \u041b\u043e\u0441\u043a\u0443\u0442\u043e\u0432, \u0418\u0433\u043e\u0440\u044c \u0412\u0430\u0440\u0444\u043e\u043b\u043e\u043c\u0435\u0435\u0432, \u041e\u043b\u0435\u0441\u044f \u0414\u0443\u0434\u0447\u0435\u043d\u043a\u043e, \u0410\u043d\u0434\u0440\u0435\u0439 \u0418\u0432\u0430\u043d\u043e\u0432, \u0414\u0430\u0440\u044c\u044f \u041a\u0430\u0440\u0430\u0441\u0435\u0432\u0430, \u0421\u0435\u0440\u0433\u0435\u0439 \u041d\u0438\u043a\u043e\u043d\u043e\u0440\u043e\u0432, \u041b\u0435\u0432 \u041f\u0440\u043e\u0448\u043b\u0435\u0446\u043e\u0432, \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 \u041b\u0435\u0431\u0435\u0434\u0435\u0432, \u0415\u0432\u0433\u0435\u043d\u0438\u0439 \u041a\u043e\u0447\u043d\u0435\u0432.<\/em><\/p>\n<div class=\"persona\"><img decoding=\"async\" class=\"image persona__image\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a1c\/85b\/0ac\/a1c85b0ac0fbc1ce535d70806a15061c.jpg\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a1c\/85b\/0ac\/a1c85b0ac0fbc1ce535d70806a15061c.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a1c\/85b\/0ac\/a1c85b0ac0fbc1ce535d70806a15061c.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<h5 class=\"persona__heading\">\u0414\u043c\u0438\u0442\u0440\u0438\u0439 \u041a\u0443\u0440\u0442\u0430\u0435\u0432<\/h5>\n<p class=\"persona__text\">\u043a\u0443\u0440\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u041f\u041e \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0430 YADRO<\/p>\n<\/div>\n<blockquote>\n<p><em>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 OpenCV \u043f\u043e\u0434 RISC-V, \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0442\u0438\u0432 \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u043e \u0438 \u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u043e\u0432. \u041f\u0440\u043e\u0435\u043a\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u044b\u0448\u0435\u043b \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0417\u0438\u043c\u043d\u0435\u0439 \u0448\u043a\u043e\u043b\u044b. \u0414\u043e \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0434\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0432\u0435\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b <\/em><a href=\"https:\/\/github.com\/opencv\/opencv\/pull\/26884\"><em>split8u<\/em><\/a><em>, <\/em><a href=\"https:\/\/github.com\/opencv\/opencv\/pull\/26887\"><em>invSqrt<\/em><\/a><em>, <\/em><a href=\"https:\/\/github.com\/opencv\/opencv\/pull\/26886\"><em>exp \u0438 sqrt<\/em><\/a><em>, <\/em><a href=\"https:\/\/github.com\/opencv\/opencv\/pull\/26923\"><em>merge<\/em><\/a><em>.<\/em>  <\/p>\n<\/blockquote>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0417\u0438\u043c\u043d\u0435\u0439 \u0448\u043a\u043e\u043b\u044b RISC-V \u0441\u0435\u0437\u043e\u043d\u0430 2024\u20132025:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/yadro\/articles\/907048\/\">\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043b\u0430\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 C#<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/yadro\/articles\/909902\/\">\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 RISC-V \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c PUF \u0432 DRAM<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/947786\/\">https:\/\/habr.com\/ru\/articles\/947786\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>OpenCV \u2014 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0430\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0433\u043e \u0437\u0440\u0435\u043d\u0438\u044f \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043d\u0438\u0445. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0445 \u043f\u043e\u0434 RISC-V \u2014 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0417\u0438\u043c\u043d\u0435\u0439 \u0448\u043a\u043e\u043b\u044b RISC-V YADRO \u0441\u0435\u0437\u043e\u043d\u0430 2024\u20132025 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u044c \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u044b \u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430 \u041b\u043e\u0431\u0430\u0447\u0435\u0432\u0441\u043a\u043e\u0433\u043e (\u041d\u041d\u0413\u0423). \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043d\u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443\u0442 \u043e \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435.\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c. \u0418\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0438 \u2014 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043e\u0431\u0449\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 RISC-V Vector Extension (RVV) \u2014 \u0441 \u044d\u0442\u0438\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0448\u0438\u0440\u0438\u043d\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 SIMD, \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u0438 \u0433\u0438\u0431\u043a\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u00ab\u0445\u0432\u043e\u0441\u0442\u0430\u043c\u0438\u00bb.\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.Flip\u0424\u0443\u043d\u043a\u0446\u0438\u044f flip \u2014 \u044d\u0442\u043e \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438\u043b\u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 C++ \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0440\u0435\u0432\u0435\u0440\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0439\u0442\u043e\u0432, \u0430 \u043f\u043e\u0434 RVV \u0435\u0433\u043e \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438:inline int flipsu(const uchar * src, size_t sro_step, uchar * dst, size_t dst_step, int width, int height, int flip_code) {  if (flip_code == 0) { \/\/ Vertical flip    for (int i = 0; i &lt; height; ++i) {      const uchar * src_row = sro + i * src_step;      uchar * dst_row = dst + (height \u2013 1 \u2013 i) * dst_step;      int j = 0\uff1b      while (j &lt; width) {        size_t vl = __riscv_vsetvl_e8m1 (width \u2013 j);        vuint8m1_t v_src = __riscv_vle8_v_u8m1(src_row + j, vl);        __riscv_vse8_v_u8m1(dst_row + j, v_src, vl);        j += vl;      }    }} else if (flip_code &gt; 0) { \/\/ Horizontal flip  for (int i = 0; i &lt; height; ++i) {    const uchar * src_row = src + i * src_step;    uchar * dst_row = dst + i * dst_step;    int j = 0;    while (j &lt; width) {      size_t vl = __riscv_vsetvl_e0m1(width \u2013 j);      vuint8m1_t v_src = __riscv_vle8_v_u8m1(src_row + j, vl);            vuint8m1_t v_dst = __riscv_vrgather_vx_u8m1(v_src, vl \u2013 1, vl);      for (size_t k = 1; k &lt; vl; ++k) {        v_dst = __riscv_vrgather_vx_u8m1(v_dst, vl \u2013 1 \u2013 k, vl);      }      __riscv_vse8_v_u8m1(dst_row + (width &#8212; j &#8212; vl), v_dst, vl);      j += vI;    }  }AddWeighted8u\u0424\u0443\u043d\u043a\u0446\u0438\u044f addWeighted8u \u2014 \u044d\u0442\u043e \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u043e\u0435 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u043c\u0430\u0442\u0440\u0438\u0446 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u0431\u0440\u0435\u0437\u043a\u043e\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043e [0, 255] \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0432\u043e\u0441\u044c\u043c\u0438\u0431\u0438\u0442\u043d\u044b\u043c\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438. \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432\u0435\u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:dst = alpha*src1 + beta*src2 + gamma\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 RISC-V:inline int addweighted8u(const uchar* src1, size_t step1,  const uchar* src2, size_t step2, uchar* dst, size_t step,  int width, int height, const void* _scalars) {  const float* scalars = static_cast&lt;const float*&gt;(_scalars);  int alpha = 1;  int beta = 1;  int gamma = 0;  int total_elements = width * height;  int j = 0;  while (j &lt; total_elements) {    size_t vl =_riscv_vsetvl_e8m1(total_elements \u2013 j);    \/\/ Calculate the 1D index for src1, src2, and dst    const uint8_t* p_src1 = src1 + j;    const uint8_t* p_src2 = src2 + j;    uint8_t* p_dst = dst + j;    vuint8m1_t v_row1 = __riscv_vle8_v_u8m1(p_src1, vl);    vuint8m1_t v_row2 = __riscv_vle8_v_u8m1(p_src2, vl);    vuint16m2_t v_row1_w = __riscv_vwcvtu_x_x_v_u16m2(v_row1, vl);    vuint16m2_t v_row2_w = __riscv_vwcvtu_x_x_v_u16m2(v_row2, vl);    \/\/ Compute weighted sum    vuint16m2_t v_res = __riscv_vmul_vx_u16m2(v_row1_w, alpha, vl);    v_res = __riscv_vwmaccu_vx_u16m2(v_res, beta, v_row2, vl);    v_res = __riscv_vadd_vx_u16m2(v_res, gamma, vl);    \/\/ Clamp results to [0, 255]    v_res =__riscv_vmaxu_vx_u16m2(v_res, 0.0f, vl);    v_res =_riscv_vminu_vx_u16m2(v_res, 255.0f, vl);\u0421\u043a\u0430\u043b\u044f\u0440\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438 \u043d\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0414\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0438\u0437 uint8_t \u0432 uint16_t (\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0431\u0438\u0442\u043d\u043e\u0441\u0442\u0438) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 vwcvtu. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0442\u0435\u0440\u044f\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441 32-\u0431\u0438\u0442\u043d\u044b\u043c\u0438 float. \u041e\u043d\u0430 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0430 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c, \u043c\u044b \u043e\u0442\u043a\u0430\u0442\u0438\u043b\u0438\u0441\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043a \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0431\u0435\u0437 float. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e, \u043d\u043e \u043a \u0434\u0435\u0434\u043b\u0430\u0439\u043d\u0443 \u043c\u044b \u0443\u0441\u043f\u0435\u043b\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 int. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0443.Split8u\u0424\u0443\u043d\u043a\u0446\u0438\u044f split8u \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u043a\u0430\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u043a\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0445:\u0412 \u043d\u0435\u0439 \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 src, \u0433\u0434\u0435 \u043c\u044b \u0445\u0440\u0430\u043d\u0438\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0432\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 dst \u0434\u043b\u044f \u0435\u0435 \u043e\u0434\u043d\u043e\u043a\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0446\u0438\u043a\u043b\u0443 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 dst \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 src. \u0412\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438:vl = __riscv_vsetvlmax_e8m8();i = 0;uchar *dst0 = dst[0], *dst1 = dst[1];for (; i &lt;= len &#8212; vl * 4; i += vl * 4) {  auto a1 = __riscv_vlse8_v_u8m_1(src + i * cn, cn, vl);  auto b1 = __riscv_vlse8_v_u8m_1(src + 1 + i * cn, cn, vl);  \u2026  auto a4 = __riscv_vlse8_v_u8m_1(src + (i + Vl + vl + vl) * cn, cn, vl);  auto b4 = __riscv_vise8_v_u8m_1(src + 1 + (i + vl + vl + vl) * cn, cn, vl);__ riscv_vse8_v_ u8m1(dst0 + i, a1, vl);__ riscv_vse8_v_ u8m1(dst1 + i, b1, vi);  &#8230;__ riscv_vse8_v_u8m1(dst0 + i + vl + vl + vl, a4, vl);__ riscv_vse8_v_u8m1(dst1 + i + vl + vl + vl, b4, vl);}\u041c\u044b \u0432\u0437\u044f\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 vl \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0430 __riscv_vsetvlmax_e8m8() \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u043b\u0438 \u0440\u0443\u0447\u043d\u043e\u0439 loop-unrolling \u043d\u0430 \u0447\u0435\u0442\u044b\u0440\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0447\u0442\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041d\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043b\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043c\u0430\u0441\u043a\u0438 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u043e\u0432 \u2014 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430.Baseline no intr \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f split8u \u0431\u0435\u0437 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u043e\u0432, baseline \u2014 \u0441 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c\u0438, pr m8 \u2014 \u0441 RISC-V \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0430\u043c\u0438\u041f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0431\u0435\u0437 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u043e\u0432 \u043d\u0430\u0448\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432 6\u20137, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438 \u0432 12 \u0440\u0430\u0437. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0441 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0430\u043c\u0438 \u0442\u043e\u0436\u0435 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430: \u0443 \u043d\u0430\u0441 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432 2\u20133, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438 \u0432 5 \u0440\u0430\u0437. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432 pull request OpenCV.InvSqrt32fInvSqrt32f \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0440\u043d\u044f. \u041e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 void cv::pow(cv::InputArray src, -0.5, cv::OutputArray dst). \u0412\u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:void invSqrt32f(const float* src, float* dst, int len)\u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0438, \u043d\u043e \u043e\u043d\u0438 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0439 baseline-\u043a\u043e\u0434. \u0412\u043e\u0442 \u043d\u0430\u0448\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:inline int invsqrt32f (const float *src, float *dst, const int len) {  const size_t vl = __riscv_vsetvl_e32m8(len);  const size_t remainings = len % vl;  auto cal_fun = [&amp;](const size_t i, const size_t vl) {    printf(&#171;vl=%d,&#187;, vl);    vfloat32m8_t vsrc = __riscv_vle32_v_f32m8(&amp;src[i], vl),          vres;    vres = __riscv_vfsqrt_v_f32m8(vsrc, vl);    vres = __riscv_vfrdiv_vf_f32m8(vres, 1., vl);    _riscv_vse32_V_f32m8(&amp;dst[i], vres, vl);  };  size_t i = 0;  for (; i &lt; len \u2013 remainings; i += vl)    calc_fun(i, vl);  if (remainings) {    size_t tail_len = __riscv_vsetvl_e32m8(len &#8212; i);    calc_fun(i, tail_len) ;  \uff5d  return CV_HAL_ERROR_OK;}\u041e\u043d\u0430 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0432\u043e\u0441\u0435\u043c\u044c \u0447\u0438\u0441\u0435\u043b float32 \u0432 \u0431\u0443\u0444\u0435\u0440, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043a\u043e\u0440\u0435\u043d\u044c, \u0434\u0435\u043b\u0438\u0442 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u043d\u0430 \u043a\u043e\u0440\u0435\u043d\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u044c. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e vl \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b. \u0414\u043b\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. \u0412 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u0445 RISC-V ISA, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0440\u043d\u044f \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u043e\u043b\u0435\u0435 \u0441\u0435\u043c\u0438 \u0437\u043d\u0430\u043a\u043e\u0432, \u0447\u0442\u043e \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c \u043f\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430\u0448\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u0434\u043d\u0438\u043c \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u043e\u043c.Sqrt32fSqrt32f \u2014 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u043c\u0443 \u043a\u043e\u0440\u043d\u044e 32-\u0431\u0438\u0442\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b. \u041f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0435\u0435 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0440\u0438\u043d\u0441\u0438\u043a\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u043a\u043e\u0440\u0435\u043d\u044c. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u0438\u0442\u043e\u0433\u0435 \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u0430\u0441\u044c \u0432 6\u20138,5 \u0440\u0430\u0437, \u043f\u0440\u0438\u0447\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u043e \u043c\u0435\u0440\u0435 \u0440\u043e\u0441\u0442\u0430 \u043c\u0430\u0442\u0440\u0438\u0446:\u041a\u043e\u0434 \u043d\u0430\u0448\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:inline int sqrt32f (const float *src, float *dst, int len) {  const size_t vl = __riscv_vsetvl_e32m8(len);  const size_t remainings = len % vl;  auto calc_fun = [&amp;](const size_t i, const size_t vl) {    vfloat32m8_t vres;    {      vfloat32m8_t vsrc = __riscv_vle32_v_f32m8(&amp;src[i], vl);      vres = __riscv_vfsqrt_v_f32m8(vsrc, vl);    }    _riscv_vse32_v_f32m8(&amp;dst[i], vres, vl);  };  size t i = 0;  for (; i &lt; len \u2013 remainings; i += vl)    calc_fun(i, vl);  if (remainings){    size_t tail_len = __riscv_vsetv1_e32m8(len &#8212; i);    calc_fun(i, tail_len);  }  return CV_HAL_ERROR_OK;}Sqrt64f\u0412 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 OpenCV \u0444\u0443\u043d\u043a\u0446\u0438\u044f sqrt64f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e, \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432 \u0432 sqrt, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u0442\u0438\u043f\u0430 double. \u0414\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 RVV: \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u0435\u0442\u043e\u0434 \u041d\u044c\u044e\u0442\u043e\u043d\u0430 \u0434\u043b\u044f \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.void sqrt64f(const double* src, double* dst, int n) {  ssize_t i = 0;  ssize_t vlmax = __riscv_vsetvlmax_e64m1();  while(i &lt; n) {    ssize_t vl = n &#8212; i;    if(vl &gt; vlmax) vl = vlmax;    vl = __riscv_vsetvl_e64m1(vl);    vfloat64m1_t v_x = __riscv_vle64_v_f64m1(&amp;src[i], vl);    vfloat64m1_t result = __riscv_vfmv_v_f_f64m1(static_cast&lt;double&gt;(0), vl);        vfloat64m1_t approx = __riscv_vfmv_v_f_f64m1(static_cast&lt;double&gt;(1), vl);    for(ssize_t step = 0; step &lt; 100; ++step) {      approx = __riscv_vfadd_vv_f64m1(approx, __riscv_vfdiv_vv_f64m1(v_x, approx, vl), vl);      approx = __riscv_vfmul_vf_f64m1(approx, static_cast&lt;double&gt;(0.5), vl);    }    __riscv_vse64_v_f64m1(&amp;dst[i], approx, vl);    i += vl;  }}\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430, \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u0446\u0438\u043a\u043b\u0430 \u0438 \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.Exp32f\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u2014 exp32f, \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0443, \u0437\u0430\u0442\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u0435\u043a\u043e\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0431\u043e\u0440 \u043f\u043e \u0442\u0438\u043f\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u044b \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b\u0438 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u0440\u044f\u0434 \u0422\u0435\u0439\u043b\u043e\u0440\u0430 \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b:void exp32f( const float * x, float *y, int n ){  CV INSTRUMENT REGION ();  const float* const expTab_f = cv::details::getExpTab32f(;    const float  A4 = (float) (1.000000000000002438532970795181890933776 \/ EXPPOLY_32F_A0),  A3 = (float)&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-475450","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/475450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=475450"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/475450\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=475450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=475450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=475450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}