Community
cancel
Showing results for 
Search instead for 
Did you mean: 
mikl_la
Beginner
45 Views

gray-scale decoding

hi everybody...
i'm in programming a video decoder. input are coded video-files and output should be single decoded image-files. so far it works well, butnow i would like to havethe output files in gray-scale format.

i created a FWVideoRender-Object and set colorformat to GRAY:

---> params.out_data_template.Init(video_info->clip_info.width, video_info->clip_info.height, GRAY);

when i init the VideoRender i geta UMC_ERR_NOT_IMPLEMENTED - error.

so is there any other possibility to do this?

bye...
michael

0 Kudos
3 Replies
Ying_H_Intel
Employee
45 Views

Hello

Are youlooking at UMC:simple_playersample, right?
See fromthe readme.htm file of simple_player sample, it only supports the following foramt,

-f select video render color format

So the color format gray is not implemented. But it is possible to add such implementation.The project color_space_converter provideallcolor conversion support in simple_player. So you may addthe conversion fromYUV to GRAY there, bycall IPP color conversionfunction listed in ippiman.pdf, such as ippiYCbCr420ToBGR_8u_P3C3R, then ippiRGBToGrayGray().

Here is oneUMC KB artile <http://software.intel.com/en-us/articles/getting-started-with-intel-ipp-unified-media-classes-sample...>. It provides several simple source code for your reference.

Regards
Ying
Martin_B_4
Beginner
45 Views

Since all video codecs are in YUV/YCbCr format and the Y luminance is in separate macroblocks and has its own motion vectors, wouldn't it be simple to just ignore the CbCr chrominance at the decoder level, and output only the Y plane? If grayscale output was requested, the decoder could treat the video as being encoded with a single component in the first place. This would be much faster than decoding YCbCr, converting to RGB then back to grayscale.
Ying_H_Intel
Employee
45 Views

Quoting - martin
Since all video codecs are in YUV/YCbCr format and the Y luminance is in separate macroblocks and has its own motion vectors, wouldn't it be simple to just ignore the CbCr chrominance at the decoder level, and output only the Y plane? If grayscale output was requested, the decoder could treat the video as being encoded with a single component in the first place. This would be much faster than decoding YCbCr, converting to RGB then back to grayscale.

Good idea! Yes, to onlyoutput the Y plane should be faster, simplerand more straightforward.It may need some works to modify decoder codeto decode Y plane only. If consideringaddthe grayscale support in color_space_converterproject, it is not necessary to convert to RGB then back to grayscale.Just copy the Y component to required output shoud be ok.

BR
Ying