CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 12:02:47 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/opencv/opencv.git
etag: W/"1b1cb74492fa947afb7485aa5942ec6b"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=s6lrLxSOX7iD%2FXwRX2A%2FK1qIKfCv2tWgoZNJyVeNChZm40V%2FYoGLGEjzlH6KeQOmSigFnrKHlzNYnGib7hhL8sxLYjEKmg8NJYqpPsQBDCl3v%2FUnh2rLzFKX8sDs1gNREXAQESeyB%2Fh6oDfRlqYWdup5OFcfx8bHwQiOB%2FKXAlvUwbcDWedmP6W4u5dDkpnFMU%2FXpwRzFUjRwqDLtcTmhgPHcL9r5Co2JgSQYPlSB1DCLEwqnnUE6%2F57aKAdjgqHVENNG%2BuOjsDBzkpYp1lVMA%3D%3D--UtfL1T8Kp8dOdULA--CeiFkHJRstLkrsncemxMGw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1158337470.1753617766; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 12:02:46 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 12:02:46 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 8654:2CB2E7:DED8E5:125E0BF:68861566
Merge pull request #26865 from amane-ame:dxt_hal_rvv · opencv/opencv@bb525fe · GitHub
Copy file name to clipboardExpand all lines: 3rdparty/hal_rvv/hal_rvv.hpp
Copy file name to clipboardExpand all lines: 3rdparty/hal_rvv/hal_rvv_1p0/dxt.hpp
Copy file name to clipboardExpand all lines: 3rdparty/hal_rvv/hal_rvv_1p0/minmax.hpp
Copy file name to clipboardExpand all lines: 3rdparty/hal_rvv/hal_rvv_1p0/norm.hpp
Copy file name to clipboardExpand all lines: 3rdparty/hal_rvv/hal_rvv_1p0/norm_diff.hpp
Copy file name to clipboardExpand all lines: modules/core/src/hal_replacement.hpp
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
Commit bb525fe
authored
Merge pull request #26865 from amane-ame:dxt_hal_rvv
Add RISC-V HAL implementation for cv::dft and cv::dct #26865
This patch implements `static cv::DFT` function in RVV_HAL using native intrinsic, optimizing the performance for `cv::dft` and `cv::dct` with data types `32FC1/64FC1/32FC2/64FC2`.
The reason I chose to create a new `cv_hal_dftOcv` interface is that if I were to use the existing interfaces (`cv_hal_dftInit1D` and `cv_hal_dft1D`), it would require handling and parsing the dft flags within HAL, as well as performing preprocessing operations such as handling unit roots. Since these operations are not performance hotspots and do not require optimization, reusing the existing interfaces would result in copying approximately 300 lines of code from `core/src/dxt.cpp` into HAL, which I believe is unnecessary.
Moreover, if I insert the new interface into `static cv::DFT`, both `static cv::RealDFT` and `static cv::DCT` can be optimized as well. The processing performed before and after calling `static cv::DFT` in these functions is also not a performance hotspot.
Tested on MUSE-PI (Spacemit X60) for both gcc 14.2 and clang 20.0.
```
$ opencv_test_core --gtest_filter="*DFT*"
$ opencv_perf_core --gtest_filter="*dft*:*dct*" --perf_min_samples=30 --perf_force_samples=30
```
The head of the perf table is shown below since the table is too long.
View the full perf table here: [hal_rvv_dxt.pdf](https://github.com/user-attachments/files/18622645/hal_rvv_dxt.pdf)
<img width="1017" alt="Untitled" src="https://github.com/user-attachments/assets/609856e7-9c7d-4a95-9923-45c1b77eb3a2" />
### Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [ ] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake1 parent 57a78cb commit bb525feCopy full SHA for bb525fe
File tree
Expand file treeCollapse file tree
7 files changed
+657
-61
lines changedFilter options
- 3rdparty/hal_rvv
- hal_rvv_1p0
- modules/core/src
Expand file treeCollapse file tree
7 files changed
+657
-61
lines changed3rdparty/hal_rvv/hal_rvv.hpp
Copy file name to clipboardExpand all lines: 3rdparty/hal_rvv/hal_rvv.hpp+1Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
| 25 | + | |
25 | 26 |
| |
26 | 27 |
| |
27 | 28 |
| |
|
3rdparty/hal_rvv/hal_rvv_1p0/dxt.hpp
Copy file name to clipboardExpand all lines: 3rdparty/hal_rvv/hal_rvv_1p0/dxt.hpp+569Lines changed: 569 additions & 0 deletions
Large diffs are not rendered by default.
3rdparty/hal_rvv/hal_rvv_1p0/minmax.hpp
Copy file name to clipboardExpand all lines: 3rdparty/hal_rvv/hal_rvv_1p0/minmax.hpp+51-54Lines changed: 51 additions & 54 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 |
| - | |
5 |
| - | |
| 4 | + | |
| 5 | + | |
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 |
| - | |
| 14 | + | |
15 | 15 |
| |
16 |
| - | |
17 |
| - | |
18 |
| - | |
| 16 | + | |
19 | 17 |
| |
20 |
| - | |
21 |
| - | |
22 |
| - | |
23 |
| - | |
24 |
| - | |
25 |
| - | |
26 |
| - | |
27 |
| - | |
28 |
| - | |
29 |
| - | |
30 |
| - | |
31 |
| - | |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 |
| - | |
39 |
| - | |
40 |
| - | |
41 |
| - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
42 | 40 |
| |
43 |
| - | |
44 |
| - | |
45 |
| - | |
46 |
| - | |
47 |
| - | |
48 |
| - | |
49 |
| - | |
50 |
| - | |
51 |
| - | |
52 |
| - | |
53 |
| - | |
54 |
| - | |
55 |
| - | |
56 |
| - | |
57 |
| - | |
58 |
| - | |
59 |
| - | |
60 |
| - | |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 |
| - | |
65 |
| - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
66 | 63 |
| |
67 | 64 |
| |
68 | 65 |
| |
| |||
330 | 327 |
| |
331 | 328 |
| |
332 | 329 |
| |
333 |
| - | |
| 330 | + | |
334 | 331 |
| |
335 | 332 |
|
3rdparty/hal_rvv/hal_rvv_1p0/norm.hpp
Copy file name to clipboardExpand all lines: 3rdparty/hal_rvv/hal_rvv_1p0/norm.hpp+3-3Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| |||
512 | 512 |
| |
513 | 513 |
| |
514 | 514 |
| |
515 |
| - | |
| 515 | + | |
516 | 516 |
| |
517 | 517 |
|
3rdparty/hal_rvv/hal_rvv_1p0/norm_diff.hpp
Copy file name to clipboardExpand all lines: 3rdparty/hal_rvv/hal_rvv_1p0/norm_diff.hpp+4-4Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| |||
590 | 590 |
| |
591 | 591 |
| |
592 | 592 |
| |
593 |
| - | |
| 593 | + | |
594 | 594 |
| |
595 | 595 |
| |
596 | 596 |
| |
| |||
600 | 600 |
| |
601 | 601 |
| |
602 | 602 |
| |
603 |
| - | |
| 603 | + | |
604 | 604 |
| |
605 | 605 |
|
+11Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
844 | 844 |
| |
845 | 845 |
| |
846 | 846 |
| |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
847 | 858 |
| |
848 | 859 |
| |
849 | 860 |
| |
|
modules/core/src/hal_replacement.hpp
Copy file name to clipboardExpand all lines: modules/core/src/hal_replacement.hpp+18Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
756 | 756 |
| |
757 | 757 |
| |
758 | 758 |
| |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
759 | 776 |
| |
760 | 777 |
| |
761 | 778 |
| |
762 | 779 |
| |
| 780 | + | |
763 | 781 |
| |
764 | 782 |
| |
765 | 783 |
| |
|
You can’t perform that action at this time.
0 commit comments