Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Using JPEG encoder with MSFT YUV types

jnoring1
Beginner
296 Views

Hi,

I'm working on extracting DIBs from Windows Media files using the WMFSDK, and trying to encode them to the jpeg format. I downloaded the JPEG samples provided by the IPP, and have compiled them, and they work well with RGB bitmaps.

However, I want to re-encode video frames that are outputted in either a YV12 or YUY2 format. YV12 is a 4:2:0 planar YUV format, and YUY2 is a 4:2:2 packed YUV format. I tried to modify the encoding classdefined in encoder.cpp (CJPEGEncoder)that came with the JPEG sample to accept these types, but the resulting file is always garbage (vertical pink lines, and a pretty heavy file size).

If I have the WMFSDK output RGB DIBs, the CJPEGEncoder works well, but the goal is to skip the two unneccessary colorspace conversions that occur (once when the WMFSDK outputs RGB, since it does a colorspace conversion from a YCbCr type, and again when the CJPEGEncoder converts it back to a YCbCr type).

A few other questions regarding JPEG compression that I don't understand:

  1. I noticed the CJPEGEncoder takes a JCOLOR argument in SetSource that specifies the colorspace of the input image (?). But I also noticed that SetDestination takes a JCOLOR argument as well. I don't understand why a JPEG output image would have a JCOLOR type. I'm sure I'm just missing something here; a clarification would be great.
  2. Do the JSS arguments on SetSource and SetDestination refer to the MCU format, or are they associated with the JCOLOR argument? For example, if I submit 4:2:2 YCbCr DIBs, do I need to set this to JS_422?
  3. What is the difference between baseline and progressive encodes?

Any help is much appreciated; thanks in advance.

jer

0 Kudos
3 Replies
jnoring1
Beginner
296 Views
Please delete this; I accidentally posted twice because the forum software tossed a .NET exception.
0 Kudos
jnoring1
Beginner
296 Views

And just in case anyone is interested in the exception:

[ArgumentException: Item has already been added.  Key in dictionary: "mark.wear@topscene.com"  Key being added: "mark.wear@topscene.com"]
   System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) +955
   System.Collections.Hashtable.Add(Object key, Object value) +11
   CommunityServer.Data.SqlCommonDataProvider.GetEmailsTrackingSectionByPostID(Int32 postID) +531
   CommunityServer.Components.Emails.SectionTracking(Post post, EnquePostEmails epm, FormatList formats) +91
   CommunityServer.Discussions.Components.ForumEmails.ForumTracking(Post post) +87
   CommunityServer.Discussions.Components.Posts.AddPost(ForumPost post, User postAuthor) +57
   CommunityServer.Discussions.Controls.CreateEditPost.AddPost(ForumPost post, CreateEditPostMode mode) +406
   CommunityServer.Discussions.Controls.CreateEditPost.PostButton_Click(Object sender, EventArgs e) +250
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1273

0 Kudos
Vladimir_Dudnik
Employee
296 Views

yes, it is known issue. We already reported about that and people from technical support are working on it

Vladimir

0 Kudos
Reply