[x265] [PATCH 4 of 4] width and height padding
kavitha at multicorewareinc.com
kavitha at multicorewareinc.com
Fri Jun 2 19:28:59 CEST 2017
# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1491553422 -19800
# Fri Apr 07 13:53:42 2017 +0530
# Node ID 747ae5fe027c5b2416aa983226c08dde0d7377cc
# Parent 629696c46ab60328d846424dd71e9bb7567450c9
width and height padding
diff -r 629696c46ab6 -r 747ae5fe027c source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp Wed May 24 15:39:51 2017 +0530
+++ b/source/encoder/encoder.cpp Fri Apr 07 13:53:42 2017 +0530
@@ -2374,9 +2374,17 @@
m_conformanceWindow.topOffset = 0;
m_conformanceWindow.bottomOffset = 0;
m_conformanceWindow.leftOffset = 0;
-
/* set pad size if width is not multiple of the minimum CU size */
- if (p->sourceWidth & (p->minCUSize - 1))
+ if (p->scaleFactor == 2 && ((p->sourceWidth / 2) & (p->minCUSize - 1)) && p->analysisMode == X265_ANALYSIS_LOAD)
+ {
+ uint32_t rem = (p->sourceWidth / 2) & (p->minCUSize - 1);
+ uint32_t padsize = p->minCUSize - rem;
+ p->sourceWidth += padsize * 2;
+
+ m_conformanceWindow.bEnabled = true;
+ m_conformanceWindow.rightOffset = padsize * 2;
+ }
+ else if(p->sourceWidth & (p->minCUSize - 1))
{
uint32_t rem = p->sourceWidth & (p->minCUSize - 1);
uint32_t padsize = p->minCUSize - rem;
@@ -2555,9 +2563,16 @@
x265_log(p, X265_LOG_ERROR, "uhd-bd: Disabled\n");
}
}
-
/* set pad size if height is not multiple of the minimum CU size */
- if (p->sourceHeight & (p->minCUSize - 1))
+ if (p->scaleFactor == 2 && ((p->sourceHeight / 2) & (p->minCUSize - 1)) && p->analysisMode == X265_ANALYSIS_LOAD)
+ {
+ uint32_t rem = (p->sourceHeight / 2) & (p->minCUSize - 1);
+ uint32_t padsize = p->minCUSize - rem;
+ p->sourceHeight += padsize * 2;
+ m_conformanceWindow.bEnabled = true;
+ m_conformanceWindow.bottomOffset = padsize * 2;
+ }
+ else if(p->sourceHeight & (p->minCUSize - 1))
{
uint32_t rem = p->sourceHeight & (p->minCUSize - 1);
uint32_t padsize = p->minCUSize - rem;
More information about the x265-devel
mailing list