[x265] [PATCH 3 of 3] improve fillReferenceSamples by merge pixel fill
Min Chen
chenm003 at 163.com
Fri Apr 3 13:10:46 CEST 2015
# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1428059415 -28800
# Node ID 01ca2aaf903cd249308bfd60494b850ad14ad8e9
# Parent 7882a5f07b75fc4691de46067e4a7b8fd0ab11eb
improve fillReferenceSamples by merge pixel fill
---
source/common/predict.cpp | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff -r 7882a5f07b75 -r 01ca2aaf903c source/common/predict.cpp
--- a/source/common/predict.cpp Fri Apr 03 19:10:12 2015 +0800
+++ b/source/common/predict.cpp Fri Apr 03 19:10:15 2015 +0800
@@ -817,7 +817,9 @@
const pixel refSample = *pAdiLineNext;
// Pad unavailable samples with new value
int nextOrTop = X265_MIN(next, leftUnits);
+
// fill left column
+#if HIGH_BIT_DEPTH
while (curr < nextOrTop)
{
for (int i = 0; i < unitHeight; i++)
@@ -836,6 +838,24 @@
adi += unitWidth;
curr++;
}
+#else
+ X265_CHECK(curr <= nextOrTop, "curr must be less than or equal to nextOrTop\n");
+ if (curr < nextOrTop)
+ {
+ const int fillSize = unitHeight * (nextOrTop - curr);
+ memset(adi, refSample, fillSize * sizeof(pixel));
+ curr = nextOrTop;
+ adi += fillSize;
+ }
+
+ if (curr < next)
+ {
+ const int fillSize = unitWidth * (next - curr);
+ memset(adi, refSample, fillSize * sizeof(pixel));
+ curr = next;
+ adi += fillSize;
+ }
+#endif
}
// pad all other reference samples.
More information about the x265-devel
mailing list