Fix for 5151331 [CRESPO] testPerformanceExport failed
Ensure encoding width and height are multiple of 16.
Change-Id: Ia077a52a16273cb9f775ebe0f0c66a81a35b9e19
diff --git a/libvideoeditor/vss/mcs/src/M4MCS_API.c b/libvideoeditor/vss/mcs/src/M4MCS_API.c
index 8a93720..5eb2a75 100755
--- a/libvideoeditor/vss/mcs/src/M4MCS_API.c
+++ b/libvideoeditor/vss/mcs/src/M4MCS_API.c
@@ -3732,10 +3732,44 @@
pC->EncodingWidth = pC->InputFileProperties.uiVideoWidth;
uiFrameHeight =
pC->EncodingHeight = pC->InputFileProperties.uiVideoHeight;
+
/**
* Set output video profile and level */
pC->encodingVideoProfile = pC->InputFileProperties.uiVideoProfile;
pC->encodingVideoLevel = pC->InputFileProperties.uiVideoLevel;
+
+ // Clip's original width and height may not be
+ // multiple of 16.
+ // Ensure encoding width and height are multiple of 16
+
+ uint32_t remainder = pC->EncodingWidth % 16;
+ if (remainder != 0) {
+ if (remainder >= 8) {
+ // Roll forward
+ pC->EncodingWidth =
+ pC->EncodingWidth + (16-remainder);
+ } else {
+ // Roll backward
+ pC->EncodingWidth =
+ pC->EncodingWidth - remainder;
+ }
+ uiFrameWidth = pC->EncodingWidth;
+ }
+
+ remainder = pC->EncodingHeight % 16;
+ if (remainder != 0) {
+ if (remainder >= 8) {
+ // Roll forward
+ pC->EncodingHeight =
+ pC->EncodingHeight + (16-remainder);
+ } else {
+ // Roll backward
+ pC->EncodingHeight =
+ pC->EncodingHeight - remainder;
+ }
+ uiFrameHeight = pC->EncodingHeight;
+ }
+
}
else
{