Solved

How to make BITMAPINFO from YUV 4:2:0

Posted on 2000-05-14
10
378 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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
 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

860 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