Avoiding processing on alpha channel #1388
Replies: 3 comments
-
For simple pointwise filters, the number of channels that get evaluated is In general Halide determines what to evaluate using the size of the output. On Fri, Jul 15, 2016 at 8:18 PM, RileyLee [email protected] wrote:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your response Adam. |
Beta Was this translation helpful? Give feedback.
-
It doesn't matter how many channels the input has. The computation is output(x, y, c) = select(c < 3, input(x, y, clamp(c, 0, 2)), 255); The clamp lets Halide know that you only need channels 0, 1, and 2 of all On Fri, Jul 22, 2016 at 10:50 AM, RileyLee [email protected] wrote:
|
Beta Was this translation helpful? Give feedback.
-
I'm writing high-performance image processing filters in Halide. The input and output buffers are all defined in rgb-alpha four channels. When I'm processing the input image, the generated C code loops from channel 0 to channel 3. This happens in every single function in my code. I did tried to use
out.bound(0,3)
in the processing step and usefinal(x,y,c) = select(c<3,out(x,y,c),255)
in the end. But the code cannot be compiled correctly. Does anyone have the same issue when doing optimization?Beta Was this translation helpful? Give feedback.
All reactions