Freescale / libimxvpuapi

i.MX VPU API Library
GNU Lesser General Public License v2.1
88 stars 54 forks source link

Encode 8 bit greyscale JPEG #15

Closed Coimbra1984 closed 8 years ago

Coimbra1984 commented 8 years ago

Hi,

I'm trying to encode a JPEG image from a raw 8 bit greyscale image. I took jpeg-enc-example.c as an example and tried with pixel format IMX_VPU_COLOR_FORMAT_YUV400, but did not succeed. In the attachments you will find my code+Makefile img.raw is the raw input file with a resolution of 1280*964 (8 bits per pixel). I also attached a png version of that image (input.png). My code creates an output file (out.jpeg), which should be the JPEG compressed raw input image. I tested my code on a seco SBC-A62-J-QUAD with this linux: https://github.com/UDOOboard/linux_kernel/tree/imx_3.14.28_1.0.0_ga_a62

I run my program with ./main -i img.raw -o out.jpeg -q 90

I think I have to change some of the encodings parameters, but did not succeed, can anyone help?

Regards

data.zip

dv1 commented 8 years ago

Weird. I ran tests the other day with greyscale JPEGs and it worked. I'll test with your data.

dv1 commented 8 years ago

Got it. Color format was passed on when using the regular interface, but not when using the simplified JPEG one. Fixed in latest commit.

Coimbra1984 commented 8 years ago

Okay, I just tested your changes, it is working as expected now.