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

YUV data to BMP file

stsybikov
Beginner
333 Views

Hi,

I have the issue to save YUV 1920x1080 data that I received from the video stream (single frame) as bitmap file. The created bitmap image has three separate gray pictures. The size of full image is correct 1920x1080

My sample code:

CIppImage src(1920,1080,3,3);

src.Attach(1920,1080,3,3, pFrameBuffer, 0);

src.Color(IC_YCBCR);

src.Sampling(IS_411);

src.ComponentOrder(0);

src.Format(IF_FIXED);

PARAMS_BITMAP params_bmp;

err = SaveImageBMP(src,params_bmp, fileout);

I tried to use SameImageBMP function from picnic and uic_transcoder_con samples - the same result.

I am able to save YUV buffer as bitmap file using standard bitmap functionality with correct size and colors but I want to use Intel process to do this.

Any suggestion what I did wrong.

Thank you in advance,

Sergey

0 Kudos
3 Replies
Chao_Y_Intel
Moderator
333 Views
Hello, I checked the SaveImageBMP() function code. I only take the following three color space: ... switch(image.NChannels()) { case 1: imageCn.ColorSpec().SetEnumColorSpace(Grayscale); break; case 3: imageCn.ColorSpec().SetEnumColorSpace(BGR); break; case 4: imageCn.ColorSpec().SetEnumColorSpace(BGRA); break; default: break; } so, you need to covert the YUV data to BGR data first, than save to the BMP file. Thanks, Chao
0 Kudos
stsybikov
Beginner
333 Views
Hi Chao: OK I will try do that. The other question. Do you know where video and image encoding have been processed when I used Intel API? On the Intel chip? Or on the PC RAM? Thank you. Sergey
0 Kudos
Chao_Y_Intel
Moderator
333 Views
Hi Sergey, I am not quite sure I understand the question. basically, Intel IPP is software encoder/decoder, so the encoding and decoding parts are processed by the CPUs. Thanks, Chao
0 Kudos
Reply