Skip to content

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

Open
lhpqaq wants to merge 2 commits into
google:mainfrom
lhpqaq:rvv_ok
Open

Yuv color gamut conversion and transformYuv420 using Risc-V Vector#334
lhpqaq wants to merge 2 commits into
google:mainfrom
lhpqaq:rvv_ok

Conversation

@lhpqaq

@lhpqaq lhpqaq commented Dec 2, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

lhpqaq commented Dec 4, 2024

Copy link
Copy Markdown
Contributor Author

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

@lhpqaq

lhpqaq commented Dec 9, 2024

Copy link
Copy Markdown
Contributor Author

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

@ram-mohan

Copy link
Copy Markdown
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