6/02/2012

MSM7x30/8x55 - How to check display width/height and source width/height from video decoder

Frame buffer for video decoder output should have multiple of 16 width and multiple of 16/32 height sized buffer

because minimum processing unit of video compression is 16x16 image block, a.k.a., macroblock (MB).



For height, it must be multiple of 32 if the video is interlaced picture.



Due to this video compression characteristic, video renderer should have two kinds of width/height values from video decoder for correct display.

One is source width/height, size of frame buffer. The other is display width/height, size of real image which should be shown to user.



User can check two kinds of value by calling OMX "GetParameter" function with "OMX_IndexParamPortDefinition".

The value will be sent through "OMX_VIDEO_PORTDEFINITIONTYPE" structure as below.



portDefn->format.video.nFrameHeight = drv_ctx.video_resolution.frame_height;

---> source height (multiple of 16 or 32)
portDefn->format.video.nFrameWidth = drv_ctx.video_resolution.frame_width;

---> source width (multiple of 16)
portDefn->format.video.nStride = drv_ctx.video_resolution.stride;

---> display width (real size to be displayed)
portDefn->format.video.nSliceHeight = drv_ctx.video_resolution.scan_lines;

---> display height (real size to be displayed)

No comments:

Post a Comment