Intel-Media-SDK / MediaSDK

The Intel® Media SDK
MIT License
926 stars 457 forks source link

Color is not right after jpeg decoding to rgb4 #2958

Closed cvidkal closed 2 years ago

cvidkal commented 2 years ago

System information

Issue behavior

Describe the current behavior

I use media sdk sample_decode to decode jpg to rgb4, when I dump the rga4 bytes to png, the color is not same as the original jpg ./sample_decode jpeg -jpeg_rgb -rgb4 -i ~/2.jpeg -gpucopy::on -o test.rgb And I Use OpenCV to load test.rgb, then use imwrite to write png file.

original jpg 2 decoded rgb4 png test

Describe the expected behavior

Debug information

brmarkus commented 2 years ago

Can you maybe share the original file 2.jpeg and the dumped file test.rgb, please? Can you confirm the decoded (and converted to RGB4) input is what you expect (e.g. by rendering on the screen)?

cvidkal commented 2 years ago

test.zip 2.jpg and test.rgb are in test.zip above.

The decoded file (test.rgb) I think is 4 channel image (RGBA or BGRA) , I loaded it and use opencv to show, didn't get the same image as the original encoded one (2.jpeg). I don't know what's the problem is. Could you please some advice ?

brmarkus commented 2 years ago

When using the "test.rgb" and display in one of my "raw content viewer" tools then I can see the correct picture when selecting the color-format like "AYUV 4:4:4:4". Are you sure your OpenCV code interprets the raw data in "test.rgb" correctly?

cvidkal commented 2 years ago

Thanks for you reply. I got right result after I removed -jpeg_rgb in command line parameters