How can i write yuv420p to rgb Skia Shader with SKSL Language? #2726
Closed
cangunaydin
started this conversation in
General
Replies: 1 comment
-
thanks to help from skia conversation groups i figured it out. half y = sample(yImage,coord * scale).r - 0.0625;
half u = sample(uImage,(coord / 2) * scale).r - 0.5;
half v = sample(vImage,(coord / 2) * scale).r - 0.5; hope it can help someone |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have 3 byte arrays which presents y, u and v plane. Since yuv to rgb conversion takes long time, i want to do the conversion on gpu side.
There are many yuv to rgb conversion algorithms around the internet. So my first try is below, I am inspired from this thread. #1319 (comment)
the outputs you can see here.

I am pretty sure that there is nothing wrong with math formula. Cause i use the same formula in an opengl shader. And it works fine over there. However the problem is more likely about how i pass the data to the sampler. What i do in opengl was sth like this.

so i use red channel only. But here i don't have that option. Instead i use one channel grayscale. So my assumption is to get the data from r channel. But it turns out that after sampling g and b values also exists. So sth wrong with channel or how i pass the byte arrays to gpu or how i approach to the problem :)
I appreciate any feedback and help. Thank you very much.
Beta Was this translation helpful? Give feedback.
All reactions