Hi,
I am developing a windows ce 5.0 based application.
I need the procedure to convert a YCbCr (4:2:2) raw image to jpeg
>From the msdn documentation i have found that IImaginFactory and
related interfaces can be used for jpeg encoding provided the jpeg
codec is installed.
I was able to convert a bitmap to jpeg using the interfaces mentioned
above.
But i am not sure how to porceed for YCbCr (4:2:2) raw data.

It would be very helpful if anyone can provide the steps, I am seriosly
not able to find the same on the net.

Thanks and Regards
Mohammed Anwar

Re: Conversion of YCbCr (4:2:2) to jpeg by Remi

Remi
Fri Dec 29 05:34:51 CST 2006

Hi,

I am not sure you have solution other than doing the YCbCr to RGB conversion
by yourself and thus create the bitmap that will feed the interface you
described. You will find valuable information on the Internet by Googling
"yuv rgb" or "yuv2rgb".
However, I am not an expert and if there is one, I am as interested as you
in the solution :-)

HTH
Remi



Re: Conversion of YCbCr (4:2:2) to jpeg by bluesphere

bluesphere
Fri Dec 29 16:29:23 CST 2006

Try JpegLib by the Independent JPEG Group. Chances are
the Lib accepts the YUV format.


"Anwar" <sm.anwar04@gmail.com> wrote in message
news:1167376321.684325.46080@n51g2000cwc.googlegroups.com...
> Hi,
> I am developing a windows ce 5.0 based application.
> I need the procedure to convert a YCbCr (4:2:2) raw image to jpeg
> >From the msdn documentation i have found that IImaginFactory and
> related interfaces can be used for jpeg encoding provided the jpeg
> codec is installed.
> I was able to convert a bitmap to jpeg using the interfaces mentioned
> above.
> But i am not sure how to porceed for YCbCr (4:2:2) raw data.
>
> It would be very helpful if anyone can provide the steps, I am seriosly
> not able to find the same on the net.
>
> Thanks and Regards
> Mohammed Anwar
>



Re: Conversion of YCbCr (4:2:2) to jpeg by bluesphere

bluesphere
Fri Dec 29 16:44:26 CST 2006

I'm not an expert either but i don't think that going
back to RGB is a good choice.YCbCr (4:2:2) already
achieves some compression. If you convert it back to
RGB and then perform a Jpeg compression you degrade
the samples even more than the original YCbCr has
already done. A Jpeg compression at some point needs
to get the YCbCr samples themselves.


"Remi de Gravelaine" <gravelaine at aton dash sys dot fr> wrote in message
news:Oq%236e1zKHHA.780@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I am not sure you have solution other than doing the YCbCr to RGB
conversion
> by yourself and thus create the bitmap that will feed the interface you
> described. You will find valuable information on the Internet by Googling
> "yuv rgb" or "yuv2rgb".
> However, I am not an expert and if there is one, I am as interested as you
> in the solution :-)
>
> HTH
> Remi
>
>



Re: Conversion of YCbCr (4:2:2) to jpeg by Remi

Remi
Sat Dec 30 11:02:37 CST 2006

> Try JpegLib by the Independent JPEG Group. Chances are
> the Lib accepts the YUV format.

It actually works after minor adaptation to Windows CE, and takes as input
"video lines" in the YUV format.
I agree with you for the potential loss of quality caused by the "YUV 4:2:2
to RGB back to YUV" conversion, although it can theoretically be harmless: I
am not a mathematician but the formulaes used to convert to and from the two
formats look rather reversible. The main picture degradation (half the
colors going to nirvana) comes from the initial "samples to 4:2:2"
conversion. IMO, the effects of extra conversions should be the loss of a
few other colors close to the white and black areas.
Thus, if quality is not an issue, maybe is it simpler for the OP to make the
first conversion and to let MS code perform the second one.
Also consider that if some on-screen display of the captured data is also
needed, maybe RGB format will be needed too, e.g. if a DirectDraw-compliant
video driver is not available.

Remi



Re: Conversion of YCbCr (4:2:2) to jpeg by bluesphere

bluesphere
Sat Dec 30 16:50:04 CST 2006

The lib itself was @ http://www.pocketpcdn.com/

Even though the formula is reversible when you
convert from RGB to YUV you discard samples
and when you convert from YUV to RGB the
missing samples are interpolated.

Happy new year, Remi

"Remi de Gravelaine" <gravelaine at aton dash sys dot fr> wrote in message
news:ejA6WRDLHHA.4384@TK2MSFTNGP03.phx.gbl...
> > Try JpegLib by the Independent JPEG Group. Chances are
> > the Lib accepts the YUV format.
>
> It actually works after minor adaptation to Windows CE, and takes as input
> "video lines" in the YUV format.
> I agree with you for the potential loss of quality caused by the "YUV
4:2:2
> to RGB back to YUV" conversion, although it can theoretically be harmless:
I
> am not a mathematician but the formulaes used to convert to and from the
two
> formats look rather reversible. The main picture degradation (half the
> colors going to nirvana) comes from the initial "samples to 4:2:2"
> conversion. IMO, the effects of extra conversions should be the loss of a
> few other colors close to the white and black areas.
> Thus, if quality is not an issue, maybe is it simpler for the OP to make
the
> first conversion and to let MS code perform the second one.
> Also consider that if some on-screen display of the captured data is also
> needed, maybe RGB format will be needed too, e.g. if a
DirectDraw-compliant
> video driver is not available.
>
> Remi
>
>



Re: Conversion of YCbCr (4:2:2) to jpeg by Remi

Remi
Mon Jan 01 09:23:30 CST 2007

Hi bluesphere, and thanks for the link.

I did my own jpeglib port to CE a few years ago, to save captured video
snapshots to files. With the explainations in
http://www.pocketpcdn.com/articles/jpeglib.html, this should be really easy
to do.

Happy new year.
Remi



Re: Conversion of YCbCr (4:2:2) to jpeg by Anwar

Anwar
Mon Jan 01 23:49:04 CST 2007

Hi Remi,
Does your library convert ycbcr 4:2:2 images to jpeg ?
Remi de Gravelaine wrote:
> Hi bluesphere, and thanks for the link.
>
> I did my own jpeglib port to CE a few years ago, to save captured video
> snapshots to files. With the explainations in
> http://www.pocketpcdn.com/articles/jpeglib.html, this should be really easy
> to do.
>
> Happy new year.
> Remi


Re: Conversion of YCbCr (4:2:2) to jpeg by Remi

Remi
Tue Jan 02 02:57:40 CST 2007

Hi Anwar,

> Does your library convert ycbcr 4:2:2 images to jpeg ?

jpeglib is not my library (I wish I could write such a masterpiece ;-) but
yes, it does convert YUV 4:2:2 to JPEG, on a line-per-line basis.
This library was offered to the public by the Independent JPEG Group (IJG)
about 10 years ago and I suspect it is the earth of about everything that
display JPEG nowadays.
Did you explore the links that bluesphere gave us?

Remi