Skip to content

Commit 69d420e

Browse files
c_sridurkhusika
authored andcommitted
mm-video:vdec: Fix C2D output buffer stride and sliceheight.
-C2D output buffers are aligned to 16 bit width for YUV-SP. Change-Id: I3ed6324eb2c96df159def6c4548ab13bfc95c260
1 parent 5253b43 commit 69d420e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mm-video/vidc/vdec/src/omx_vdec.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ char ouputextradatafilename [] = "/data/extradata";
131131
#define DEVICE_SCRATCH 64
132132
#endif
133133

134+
#define C2D_SP_YBUF_ALIGN 16
134135
/*
135136
#ifdef _ANDROID_
136137
extern "C"{
@@ -8524,10 +8525,13 @@ OMX_ERRORTYPE omx_vdec::update_portdef(OMX_PARAM_PORTDEFINITIONTYPE *portDefn)
85248525
portDefn->format.video.nFrameWidth = drv_ctx.video_resolution.frame_width;
85258526
portDefn->format.video.nStride = drv_ctx.video_resolution.stride;
85268527
portDefn->format.video.nSliceHeight = drv_ctx.video_resolution.scan_lines;
8527-
if ((portDefn->format.video.eColorFormat == OMX_COLOR_FormatYUV420Planar) ||
8528-
(portDefn->format.video.eColorFormat == OMX_COLOR_FormatYUV420SemiPlanar)) {
8528+
if (portDefn->format.video.eColorFormat == OMX_COLOR_FormatYUV420Planar) {
85298529
portDefn->format.video.nStride = drv_ctx.video_resolution.frame_width;
85308530
portDefn->format.video.nFrameHeight = drv_ctx.video_resolution.frame_height;
8531+
} else if (portDefn->format.video.eColorFormat == OMX_COLOR_FormatYUV420SemiPlanar) {
8532+
portDefn->format.video.nStride = drv_ctx.video_resolution.frame_width + (C2D_SP_YBUF_ALIGN-1)&~(C2D_SP_YBUF_ALIGN-1);
8533+
portDefn->format.video.nFrameHeight = drv_ctx.video_resolution.frame_height;
8534+
portDefn->format.video.nSliceHeight = drv_ctx.video_resolution.frame_height;
85318535
}
85328536
DEBUG_PRINT_LOW("update_portdef: PortIndex = %u, Width = %d Height = %d "
85338537
"Stride = %u SliceHeight = %u output format = 0x%x, eColorFormat = 0x%x",

0 commit comments

Comments
 (0)