diff --git a/README.chromium b/README.chromium index c63cd045d..588b42ae1 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 520 +Version: 521 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index acaea0831..9672438c4 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 520 +#define LIBYUV_VERSION 521 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/libyuv_test.gyp b/libyuv_test.gyp index 6b3660e5b..77338fd0d 100644 --- a/libyuv_test.gyp +++ b/libyuv_test.gyp @@ -36,6 +36,7 @@ 'unit_test/scale_argb_test.cc', 'unit_test/scale_test.cc', 'unit_test/unit_test.cc', + 'unit_test/video_common_test.cc', 'unit_test/version_test.cc', ], 'conditions': [ diff --git a/source/convert.cc b/source/convert.cc index 11d32cd77..866a6644d 100644 --- a/source/convert.cc +++ b/source/convert.cc @@ -1848,7 +1848,8 @@ int ConvertToI420(const uint8* sample, int src_width, int src_height, int dst_width, int dst_height, RotationMode rotation, - uint32 format) { + uint32 fourcc) { + uint32 format = CanonicalFourCC(fourcc); if (!y || !u || !v || !sample || src_width <= 0 || dst_width <= 0 || src_height == 0 || dst_height == 0) { diff --git a/source/convert_argb.cc b/source/convert_argb.cc index b9ec60f98..fccbc175f 100644 --- a/source/convert_argb.cc +++ b/source/convert_argb.cc @@ -1033,7 +1033,8 @@ int ConvertToARGB(const uint8* sample, size_t sample_size, int src_width, int src_height, int dst_width, int dst_height, RotationMode rotation, - uint32 format) { + uint32 fourcc) { + uint32 format = CanonicalFourCC(fourcc); if (dst_argb == NULL || sample == NULL || src_width <= 0 || dst_width <= 0 || src_height == 0 || dst_height == 0) { diff --git a/source/convert_from.cc b/source/convert_from.cc index 389b5394a..d89e606de 100644 --- a/source/convert_from.cc +++ b/source/convert_from.cc @@ -1060,7 +1060,8 @@ int ConvertFromI420(const uint8* y, int y_stride, const uint8* v, int v_stride, uint8* dst_sample, int dst_sample_stride, int width, int height, - uint32 format) { + uint32 fourcc) { + uint32 format = CanonicalFourCC(fourcc); if (!y || !u|| !v || !dst_sample || width <= 0 || height == 0) { return -1; diff --git a/source/planar_functions.cc b/source/planar_functions.cc index 1b6eac88a..7d4e0f949 100644 --- a/source/planar_functions.cc +++ b/source/planar_functions.cc @@ -982,6 +982,8 @@ int ARGBColorTable(uint8* dst_argb, int dst_stride_argb, // e.g. rgb / qvalue * qvalue + qvalue / 2 // But the low levels implement efficiently with 3 parameters, and could be // used for other high level operations. +// dst_argb[0] = (b * scale >> 16) * interval_size + interval_offset; +// where scale is 1 / interval_size as a fixed point value. // The divide is replaces with a multiply by reciprocal fixed point multiply. // Caveat - although SSE2 saturates, the C function does not and should be used // with care if doing anything but quantization. diff --git a/unit_test/video_common_test.cc b/unit_test/video_common_test.cc new file mode 100644 index 000000000..b6f451868 --- /dev/null +++ b/unit_test/video_common_test.cc @@ -0,0 +1,27 @@ +/* + * Copyright 2012 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include +#include + +#include "libyuv/video_common.h" +#include "../unit_test/unit_test.h" + +namespace libyuv { + +// Tests SVN version against include/libyuv/version.h +// SVN version is bumped by documentation changes as well as code. +// Although the versions should match, once checked in, a tolerance is allowed. +TEST_F(libyuvTest, TestCanonicalFourCC) { + EXPECT_EQ(FOURCC_YUY2, CanonicalFourCC(FOURCC_YUYV)); + EXPECT_EQ(FOURCC_YUY2, CanonicalFourCC(FOURCC_YUVS)); +} + +} // namespace libyuv