Skip to content

Yuv color gamut conversion and transformYuv420 using Risc-V Vector #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lhpqaq
Copy link
Contributor

@lhpqaq lhpqaq commented Dec 2, 2024

This PR is a mirror relative to #124, with the same content implemented using RVV.
Testing under Riscv32 and Riscv64
image

Command:

(base)  build (rvv_test) ✗ qemu-riscv64 -cpu rv64,v=true,vlen=128,vext_spec=v1.0 -L /usr/riscv64-linux-gnu/ ./ultrahdr_unit_test --gtest_filter=GainMapMathTest.TransformYuv420Rvv   
Running main() from /home/lhp/libultrahdr/third_party/googletest/googletest/src/gtest_main.cc
Note: Google Test filter = GainMapMathTest.TransformYuv420Rvv
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from GainMapMathTest
[ RUN      ] GainMapMathTest.TransformYuv420Rvv
[       OK ] GainMapMathTest.TransformYuv420Rvv (5 ms)
[----------] 1 test from GainMapMathTest (10 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (15 ms total)
[  PASSED  ] 1 test.
(base)  build (rvv_test) ✗ cd ../build32
(base)  build32 (rvv_test) ✗ qemu-riscv32 -cpu rv32,v=true,vlen=128,vext_spec=v1.0 ./ultrahdr_unit_test --gtest_filter=GainMapMathTest.TransformYuv420Rvv
Running main() from /home/lhp/libultrahdr/third_party/googletest/googletest/src/gtest_main.cc
Note: Google Test filter = GainMapMathTest.TransformYuv420Rvv
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from GainMapMathTest
[ RUN      ] GainMapMathTest.TransformYuv420Rvv
[       OK ] GainMapMathTest.TransformYuv420Rvv (5 ms)
[----------] 1 test from GainMapMathTest (8 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (12 ms total)
[  PASSED  ] 1 test.

!!!!!!
------------------------------------------------Note------------------------------------------------

It should be noted that in some cases, the error of y is 2:
image

So this is the only difference compared to #124 (only y)

        EXPECT_NEAR(expect_y1, out1.y, 2);
        EXPECT_NEAR(expect_y2, out2.y, 2);
        EXPECT_NEAR(expect_y3, out3.y, 2);
        EXPECT_NEAR(expect_y4, out4.y, 2);

@ram-mohan
Copy link
Contributor

considerable amount of code seems to be duplicated across archs. for instance weights used in conversion, they can be moved to common place and reused. Also, please wait on further development as we working on some refactoring which may effect some of the changes you are making.

@lhpqaq
Copy link
Contributor Author

lhpqaq commented Dec 4, 2024

I have removed the redundant code related to weights and unit tests. I will also be working on this project long-term.

@lhpqaq
Copy link
Contributor Author

lhpqaq commented Dec 9, 2024

@ram-mohan Hi, I am preparing to port other functions. Is my code structure suitable in the current situation?

@ram-mohan
Copy link
Contributor

@ram-mohan Hi, I am preparing to port other functions. Is my code structure suitable in the current situation?

yes changes look good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants