aboutsummaryrefslogtreecommitdiff
path: root/source/scale.cc
diff options
context:
space:
mode:
authorFrank Barchard <fbarchard@google.com>2021-02-05 16:14:25 -0800
committerFrank Barchard <fbarchard@chromium.org>2021-02-06 00:26:55 +0000
commit942c5084482d8592883be66151e0dea502f4cbc0 (patch)
treee02d37c46fb6e9d06d5165fc86ce483b70928524 /source/scale.cc
parent60d37a064bc0307017537ed3091b1b0204213855 (diff)
downloadlibyuv-942c5084482d8592883be66151e0dea502f4cbc0.tar.gz
BT.2020 Full Range yuvconstants
new color util to compute constants needed based on white point. [ RUN ] LibYUVColorTest.TestFullYUVV hist -2 -1 0 1 2 red 0 1627136 13670144 1479936 0 green 319285 3456836 9243059 3440771 317265 blue 0 1561088 14202112 1014016 0 Bug: libyuv:877, b/178283356 Change-Id: If432ebfab76b01302fdb416a153c4f26ca0832d6 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2678859 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Reviewed-by: richard winterton <rrwinterton@gmail.com>
Diffstat (limited to 'source/scale.cc')
-rw-r--r--source/scale.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/scale.cc b/source/scale.cc
index 34c05699..16771cd8 100644
--- a/source/scale.cc
+++ b/source/scale.cc
@@ -1336,7 +1336,7 @@ void ScalePlaneBilinearUp(int src_width,
}
}
-// Scale plane, horizontally 2 times, vertically any time.
+// Scale plane, horizontally up by 2 times.
// Uses linear filter horizontally, nearest vertically.
// This is an optimized version for scaling up a plane to 2 times of
// its original width, using linear interpolation.
@@ -1356,7 +1356,7 @@ void ScalePlaneUp2_Linear(int src_width,
int dy;
// This function can only scale up by 2 times horizontally.
- assert(src_width * 2 == dst_width || src_width * 2 == dst_width + 1);
+ assert(src_width == ((dst_width + 1) / 2));
#ifdef HAS_SCALEROWUP2LINEAR_SSE2
if (TestCpuFlag(kCpuHasSSE2)) {
@@ -1396,7 +1396,7 @@ void ScalePlaneUp2_Linear(int src_width,
}
}
-// Scale plane, 2 times.
+// Scale plane, up by 2 times.
// This is an optimized version for scaling up a plane to 2 times of
// its original size, using bilinear interpolation.
// This is used to scale U and V planes of I420 to I444.
@@ -1414,7 +1414,7 @@ void ScalePlaneUp2_Bilinear(int src_width,
int x;
// This function can only scale up by 2 times.
- assert(src_width * 2 == dst_width || src_width * 2 == dst_width + 1);
+ assert(src_width == ((dst_width + 1) / 2));
assert(src_height * 2 == dst_height || src_height * 2 == dst_height + 1);
#ifdef HAS_SCALEROWUP2LINEAR_SSE2
@@ -1449,7 +1449,7 @@ void ScalePlaneUp2_Bilinear(int src_width,
for (x = 0; x < src_height - 1; ++x) {
Scale2RowUp(src_ptr, src_stride, dst_ptr, dst_stride, dst_width);
src_ptr += src_stride;
- // TODO test performance of writing one row of destination at a time
+ // TODO: Test performance of writing one row of destination at a time.
dst_ptr += 2 * dst_stride;
}
if (!(dst_height & 1)) {
@@ -1458,7 +1458,7 @@ void ScalePlaneUp2_Bilinear(int src_width,
}
}
-// Scale at most 14bit plane, horizontally 2 times.
+// Scale at most 14 bit plane, horizontally up by 2 times.
// This is an optimized version for scaling up a plane to 2 times of
// its original width, using linear interpolation.
// stride is in count of uint16_t.
@@ -1478,7 +1478,7 @@ void ScalePlaneUp2_16_Linear(int src_width,
int dy;
// This function can only scale up by 2 times horizontally.
- assert(src_width * 2 == dst_width || src_width * 2 == dst_width + 1);
+ assert(src_width == ((dst_width + 1) / 2));
#ifdef HAS_SCALEROWUP2LINEAR_SSE2
if (TestCpuFlag(kCpuHasSSE2)) {
@@ -1512,7 +1512,7 @@ void ScalePlaneUp2_16_Linear(int src_width,
}
}
-// Scale at most 12bit plane, up 2 times.
+// Scale at most 12 bit plane, up by 2 times.
// This is an optimized version for scaling up a plane to 2 times of
// its original size, using bilinear interpolation.
// stride is in count of uint16_t.
@@ -1531,7 +1531,7 @@ void ScalePlaneUp2_16_Bilinear(int src_width,
int x;
// This function can only scale up by 2 times.
- assert(src_width * 2 == dst_width || src_width * 2 == dst_width + 1);
+ assert(src_width == ((dst_width + 1) / 2));
assert(src_height * 2 == dst_height || src_height * 2 == dst_height + 1);
#ifdef HAS_SCALEROWUP2LINEAR_SSE2