diff --git a/README.chromium b/README.chromium index 9f34c0425..8d3d46413 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 579 +Version: 581 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 9e158dc47..e8b58732b 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 579 +#define LIBYUV_VERSION 581 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/convert.cc b/source/convert.cc index 874c2c66c..2c80dc5f1 100644 --- a/source/convert.cc +++ b/source/convert.cc @@ -1866,6 +1866,30 @@ int ConvertToI420(const uint8* sample, v, v_stride, dst_width, inv_dst_height); break; + case FOURCC_RGBP: + src = sample + (src_width * crop_y + crop_x) * 2; + r = RGB565ToI420(src, src_width * 2, + y, y_stride, + u, u_stride, + v, v_stride, + dst_width, inv_dst_height); + break; + case FOURCC_RGBO: + src = sample + (src_width * crop_y + crop_x) * 2; + r = ARGB1555ToI420(src, src_width * 2, + y, y_stride, + u, u_stride, + v, v_stride, + dst_width, inv_dst_height); + break; + case FOURCC_R444: + src = sample + (src_width * crop_y + crop_x) * 2; + r = ARGB4444ToI420(src, src_width * 2, + y, y_stride, + u, u_stride, + v, v_stride, + dst_width, inv_dst_height); + break; case FOURCC_24BG: src = sample + (src_width * crop_y + crop_x) * 3; r = RGB24ToI420(src, src_width * 3, @@ -1914,30 +1938,6 @@ int ConvertToI420(const uint8* sample, v, v_stride, dst_width, inv_dst_height); break; - case FOURCC_RGBP: - src = sample + (src_width * crop_y + crop_x) * 2; - r = RGB565ToI420(src, src_width * 2, - y, y_stride, - u, u_stride, - v, v_stride, - dst_width, inv_dst_height); - break; - case FOURCC_RGBO: - src = sample + (src_width * crop_y + crop_x) * 2; - r = ARGB1555ToI420(src, src_width * 2, - y, y_stride, - u, u_stride, - v, v_stride, - dst_width, inv_dst_height); - break; - case FOURCC_R444: - src = sample + (src_width * crop_y + crop_x) * 2; - r = ARGB4444ToI420(src, src_width * 2, - y, y_stride, - u, u_stride, - v, v_stride, - dst_width, inv_dst_height); - break; // TODO(fbarchard): Support cropping Bayer by odd numbers // by adjusting fourcc. case FOURCC_BGGR: @@ -1948,7 +1948,6 @@ int ConvertToI420(const uint8* sample, v, v_stride, dst_width, inv_dst_height); break; - case FOURCC_GBRG: src = sample + (src_width * crop_y + crop_x); r = BayerGBRGToI420(src, src_width, @@ -1957,7 +1956,6 @@ int ConvertToI420(const uint8* sample, v, v_stride, dst_width, inv_dst_height); break; - case FOURCC_GRBG: src = sample + (src_width * crop_y + crop_x); r = BayerGRBGToI420(src, src_width, @@ -1966,7 +1964,6 @@ int ConvertToI420(const uint8* sample, v, v_stride, dst_width, inv_dst_height); break; - case FOURCC_RGGB: src = sample + (src_width * crop_y + crop_x); r = BayerRGGBToI420(src, src_width, @@ -1975,7 +1972,6 @@ int ConvertToI420(const uint8* sample, v, v_stride, dst_width, inv_dst_height); break; - case FOURCC_I400: src = sample + src_width * crop_y + crop_x; r = I400ToI420(src, src_width, @@ -1984,7 +1980,6 @@ int ConvertToI420(const uint8* sample, v, v_stride, dst_width, inv_dst_height); break; - // Biplanar formats case FOURCC_NV12: src = sample + (src_width * crop_y + crop_x); diff --git a/source/convert_from.cc b/source/convert_from.cc index 5856459e9..6949f5933 100644 --- a/source/convert_from.cc +++ b/source/convert_from.cc @@ -1127,6 +1127,31 @@ int ConvertFromI420(const uint8* y, int y_stride, dst_sample_stride ? dst_sample_stride : width, width, height); break; + case FOURCC_NV12: { + uint8* dst_uv = dst_sample + width * height; + r = I420ToNV12(y, y_stride, + u, u_stride, + v, v_stride, + dst_sample, + dst_sample_stride ? dst_sample_stride : width, + dst_uv, + dst_sample_stride ? dst_sample_stride : width, + width, height); + break; + } + case FOURCC_NV21: { + uint8* dst_vu = dst_sample + width * height; + r = I420ToNV21(y, y_stride, + u, u_stride, + v, v_stride, + dst_sample, + dst_sample_stride ? dst_sample_stride : width, + dst_vu, + dst_sample_stride ? dst_sample_stride : width, + width, height); + break; + } + // TODO(fbarchard): Add M420 and Q420. // Triplanar formats // TODO(fbarchard): halfstride instead of halfwidth case FOURCC_I420: