From: Mingyue G. <min...@vi...> - 2014-04-29 15:29:34
|
Hello everyone, I'm doing an urgent job, mainly concerned on: - compress RGB888/YUV420 to 12-bit JPEG My input is RGB888, 8 bits for each channel, and I add four zeros at the end, which means if red channel is 0xFF, then new one is 0xFF0. I'm sure my input (RGB888 8 bit for each channel) is right, and I followed install.txt to compile a 12-bit libjpeg by steps below: - in jmoreconfig.h, change BITS_IN_JSAMPLE to 12 - in jconfig.h, undefine support for BMP, GIF and TARGA - no make test (since testcases not support 12-bit libjpeg) I linked the right 12-bit version of libjpeg I just generated (either libjpeg-6b or libjpeg-9a), included the right header file in source codes, but the result I get here is very strange. I cannot even open the new jpeg file. By the way, the code I'm using is from the officially example.c, barely modified. I extend the raw RGB to short data in order to support the 12 bit. I know my input may be wrong, but at least I should be able to load the jpeg in the viewer even it shows a crap picture. I figured the problem is jpeg header the libjpeg created, because there should be SOI in the jpeg file (starting with 0xff c0), but there isn't. Please find the crap jpeg in the attachment. Really hope someone could help me out here! I've been struggled for a week! Thank you no matter if you can help. Sincerely, Myue |