GPUOpen-LibrariesAndSDKs / RadeonImageFilter

https://gpuopen.com/radeon-prorender-suite/
Other
48 stars 14 forks source link

Motion blur filter outputs a broken image #8

Closed Umio-Yasuno closed 3 years ago

Umio-Yasuno commented 3 years ago

Hello.
I made rif-cmd for the purpose of testing RIF.

Motion Blur filter will output a broken image depending on the image size and extension. If the source is a 640x360 JPEG image, the filter will always output a broken image.

Is this a bug in RIF?

(The images were taken by me. I declare it to be in the public domain.)

Source (PNG, 640x360) : source png

Radius [5] (PNG, 640x360) : test_radius_5 rif-radius_5.log

Radius [10] (PNG, 640x360) : test_radius_10 rif-radius_10.log

OS: Debian GNU/Linux bullseye/sid CPU: Ryzen 5 2600 GPU: Radeon RX 560 4GB (Polaris11, gfx803) OpenCL: OpenCL 2.0 AMD-APP (3212.0)

BenjaminCoquelle commented 3 years ago

can you create a RIF trace please?

Umio-Yasuno commented 3 years ago

Radius [5]: rif-trace-1610910843-1.6.2.0xbdf2aac0.tar.gz

Radius [10]: rif-trace-1610911169-1.6.2.0xbdf2aac0.tar.gz

BenjaminCoquelle commented 3 years ago

thanks we will look at it asap

stmuxa commented 3 years ago

Hi @Umio-Yasuno I confirm a bug in motion filter here. You can either use a temporal workaround before you execute queue

rifImageFilterSetParameter1u(filter_MOTION_BLUR, "radius", 4u));
rifImageFilterSetParameter1u(filter_MOTION_BLUR, "radius", 5u));

or wait for next version.

Umio-Yasuno commented 3 years ago

Thanks, @stmuxa In the case of PNG, it will output an image with no problem.

However, in the case of JPEG images, it keeps outputting broken images.
This may be a different problem, as other filters do that as well.

Source (JPEG, 640x360) :

Bloom (deafult value) rif-trace-1610965982-1.6.2.0xbdf2aac0.tar.gz

Motion Blur (deafult value) rif-trace-1610966462-1.6.2.0xbdf2aac0.tar.gz

stmuxa commented 3 years ago

RadeonImageFilter has nothing to do with image formats like PNG and JPEG, it works with raw images only. I extracted in/out images from the traces you sent, and they do not seem corrupted.

Bloom (deafult value) rif-trace-1610965982-1.6.2.0xbdf2aac0.tar.gz

input image_0 output image_1

Motion Blur (deafult value) rif-trace-1610966462-1.6.2.0xbdf2aac0.tar.gz

input image_0

output image_1

Umio-Yasuno commented 3 years ago

Sorry, there may be a problem with the implementation of my image file writing process.
I will try another way.

Umio-Yasuno commented 3 years ago

It's solved!
By setting the type of rif_image_desc to RIF_COMPONENT_TYPE_UINT8 , rif-cmd was able to output JPEG images without any problems. 

Umio-Yasuno commented 3 years ago

I have confirmed the fix in v1.7.0 . Thank you.