Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: source/convert.cc

Issue 2271053003: Allow NULL for dst_y in planar formats. BUG=libyuv:631 TEST=unittests build/pass (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: Allow NULL for dst_y in planar formats. BUG=libyuv:631 TEST=unittests build/pass Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | source/convert_from.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/convert.cc
diff --git a/source/convert.cc b/source/convert.cc
index d0896cfb6da06f7576d4d1782c543848349b59c7..cd667bf5605cba6f7404770d30ff9f45f3c27638 100644
--- a/source/convert.cc
+++ b/source/convert.cc
@@ -44,7 +44,7 @@ static int I4xxToI420(const uint8* src_y, int src_stride_y,
src_uv_width == 0 || src_uv_height == 0) {
return -1;
}
- // TODO(fbarchard): make Y optional.
+ // TODO(fbarchard): support NULL for dst_y
fbarchard1 2016/08/24 22:34:16 check dst_y is not null.
ScalePlane(src_y, src_stride_y, src_y_width, src_y_height,
dst_y, dst_stride_y, dst_y_width, dst_y_height,
kFilterBilinear);
@@ -70,8 +70,8 @@ int I420Copy(const uint8* src_y, int src_stride_y,
int width, int height) {
int halfwidth = (width + 1) >> 1;
int halfheight = (height + 1) >> 1;
- if (!src_y || !src_u || !src_v ||
- !dst_y || !dst_u || !dst_v ||
+ if (!src_u || !src_v ||
+ !dst_u || !dst_v ||
width <= 0 || height == 0) {
return -1;
}
@@ -167,7 +167,7 @@ int I400ToI420(const uint8* src_y, int src_stride_y,
int width, int height) {
int halfwidth = (width + 1) >> 1;
int halfheight = (height + 1) >> 1;
- if (!src_y || !dst_y || !dst_u || !dst_v ||
+ if (!dst_u || !dst_v ||
width <= 0 || height == 0) {
return -1;
}
@@ -178,7 +178,9 @@ int I400ToI420(const uint8* src_y, int src_stride_y,
src_y = src_y + (height - 1) * src_stride_y;
src_stride_y = -src_stride_y;
}
- CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
+ if (dst_y) {
+ CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
+ }
SetPlane(dst_u, dst_stride_u, halfwidth, halfheight, 128);
SetPlane(dst_v, dst_stride_v, halfwidth, halfheight, 128);
return 0;
@@ -1435,8 +1437,8 @@ int Android420ToI420(const uint8* src_y, int src_stride_y,
const int vu_off = src_v - src_u;
int halfwidth = (width + 1) >> 1;
int halfheight = (height + 1) >> 1;
- if (!src_y || !src_u || !src_v ||
- !dst_y || !dst_u || !dst_v ||
+ if (!src_u || !src_v ||
+ !dst_u || !dst_v ||
width <= 0 || height == 0) {
return -1;
}
« no previous file with comments | « no previous file | source/convert_from.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698