Solved

How to make BITMAPINFO from YUV 4:2:0

Posted on 2000-05-14
10
376 Views
Last Modified: 2012-06-21
Dear All,

 If i have a YUV 4:2:0 raw data file, how can i convert it into BITMAPINFO data? Any example or simple codes?

Thank you very much

LittleBoy
0
Comment
Question by:littleboy
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 2808213
All I can tell you is that it isn't simple at all. I probably have the code somewhere in the library but since it is tightly linked with my own source I cannot show it to you. But simple it is not.
0
 

Author Comment

by:littleboy
ID: 2808338
Dear CJ S

 Thanks for your comment, however, can you tell me more hint, for example, it is better to convert the RGB raw data to BITMAPINFO or convert the YUV raw data to BITMAPINFO??
 So, as you said, it is not simple, but what is the difficult part? Writing the headers? or what?

Thanks a lot.

Littleboy
0
 

Author Comment

by:littleboy
ID: 2808383
Dear CJ S

 Thanks for your comment, however, can you tell me more hint, for example, it is better to convert the RGB raw data to BITMAPINFO or convert the YUV raw data to BITMAPINFO??
 So, as you said, it is not simple, but what is the difficult part? Writing the headers? or what?

Thanks a lot.

Littleboy
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 180 total points
ID: 2808516
Well,
I have written a few image transformation thingies. And am currently doing the JFIF JPEG.

Depending on how your YUV Raw image is set up you can decide what way to choose. The easiest way to convert raw data is to RGB values (unsigned char r, g , b). These values can then be put in like a DIB-section which is also a BITMAPINFO.

Of course you have to find yourself the way the image is set up. First you'll find the header.....but how long will it be? A BITMAPINFOHEADER will always be 42 (if i recall right), and other images will (most of the times) have a speciall marker (like the JPEG 0xFF). With right after the marker a Length attribute of how long that header is.

It just totally depends how the image is set up....try to find that out, and read the image information. Then transform those values to readable RGB for your program.

Good luck,
CJ
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2808568
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2826565
littleboy???
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2826600
yes??????

oh, damn you mean the other guy

HAHAHAHA.....sorry
0
 

Expert Comment

by:mj@f544695
ID: 2827742
If you just need code to do this,
try ImageMagick at http://www.imagemagick.org.

--Mark Johnson
0
 

Author Comment

by:littleboy
ID: 2827993
Dear All,
 
 Thanks all, however, the intel page contains the MMX method of converting YUV to RGB only, in fact, what I need most is to convert RGB into BITMAPINFO. However, by the help of CS_J, I gain some ideas on how to do that.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2828413
Thank you, if you need more specific help about a few things you can email me at
cj@infolder.com
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now