- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I am trying to adapt the IJG decoder sample to a DirectShow filter which outputs YV12, NV12, YUY2 etc to the renderer's input pin.
Initial quick code walkthrough :i found that the output of the jpeg decoder is to a DIB file. What changes are needed to make the core decoder library to output to a YUV buffer format of my choice ( NV12 etc.,)
files in question - djpeg.c , ....jinit_write_bmp(...)...
IPP version used -- 6.1.2.041 / windows xp / intel core duo
Thanks in advance
alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alex,
The output data for IJG sample is the RGB format. If you want to use other color spaces, you can call IPP color conversion functions to convert the RGB data to other format.(check the IPP manual, ippiman, "Image Color Conversion" part).
Attached is the sample code that decodes a JPEG files into an image buffer (RGB), which may provide some help to use IJG samples.
Thanks,
Chao
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alex,
The output data for IJG sample is the RGB format. If you want to use other color spaces, you can call IPP color conversion functions to convert the RGB data to other format.(check the IPP manual, ippiman, "Image Color Conversion" part).
Attached is the sample code that decodes a JPEG files into an image buffer (RGB), which may provide some help to use IJG samples.
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Chao.
I just want to confirm that there is no way to avoid one more buffer-copying ( using host cpu cycles ) from RGB to some YUV foramt.
It would be nice if the decoder can write the scan lines directly to a YUV buffer
--alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex,
To directly get the YUV data, you can set the output color space as JCS_YCbCr, like the following code:
...
jpeg_create_decompress(&dinfo);
jpeg_stdio_src(&dinfo, file);
jpeg_read_header(&dinfo, TRUE);
dinfo.out_color_space = JCS_YCbCr;
jpeg_start_decompress(&dinfo);
while (dinfo.output_scanline < img->height)
jpeg_read_scanlines(&dinfo, img->data + dinfo.output_scanline, 16);
....
Thanks,
Chao
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page