summaryrefslogtreecommitdiff
path: root/third_party/libyuv/source/video_common.cc
diff options
context:
space:
mode:
authorJohann <johannkoenig@google.com>2018-04-04 11:50:39 -0700
committerJohann <johannkoenig@google.com>2018-06-21 06:23:44 -0700
commit42c7213960bb0a263cbfaf5b220fbbc06d236757 (patch)
tree62890d6ad8e9eebe3ef373b7bb35a7fcaac61177 /third_party/libyuv/source/video_common.cc
parent862d6f48c5be17ee710ecb9e143cb91e54136160 (diff)
downloadlibvpx-42c7213960bb0a263cbfaf5b220fbbc06d236757.tar
libvpx-42c7213960bb0a263cbfaf5b220fbbc06d236757.tar.gz
libvpx-42c7213960bb0a263cbfaf5b220fbbc06d236757.tar.bz2
libvpx-42c7213960bb0a263cbfaf5b220fbbc06d236757.zip
third_party/libyuv: update to a37e7bfe
Fix mingw builds for x86_32 by updating past: https://chromium.googlesource.com/libyuv/libyuv/+/8fa02df3c0591754958a50 Pick up upstream fixes for clang 5 builds with --disable-optimizations. Disable libyuv by default when building for msa. We have not been able to update libyuv because of build issues with mips. This can be revisited when we update the mips compiler used in Jenkins. BUG=webm:1509,libyuv:793,webm:1514,webm:1518 Change-Id: Id0b9947cb5e0aa74f2f74746524ab6ff2d48796f
Diffstat (limited to 'third_party/libyuv/source/video_common.cc')
-rw-r--r--third_party/libyuv/source/video_common.cc51
1 files changed, 24 insertions, 27 deletions
diff --git a/third_party/libyuv/source/video_common.cc b/third_party/libyuv/source/video_common.cc
index 00fb71e18..92384c050 100644
--- a/third_party/libyuv/source/video_common.cc
+++ b/third_party/libyuv/source/video_common.cc
@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
#include "libyuv/video_common.h"
#ifdef __cplusplus
@@ -16,40 +15,39 @@ namespace libyuv {
extern "C" {
#endif
-#define ARRAY_SIZE(x) (int)(sizeof(x) / sizeof(x[0]))
-
struct FourCCAliasEntry {
- uint32 alias;
- uint32 canonical;
+ uint32_t alias;
+ uint32_t canonical;
};
-static const struct FourCCAliasEntry kFourCCAliases[] = {
- {FOURCC_IYUV, FOURCC_I420},
- {FOURCC_YU12, FOURCC_I420},
- {FOURCC_YU16, FOURCC_I422},
- {FOURCC_YU24, FOURCC_I444},
- {FOURCC_YUYV, FOURCC_YUY2},
- {FOURCC_YUVS, FOURCC_YUY2}, // kCMPixelFormat_422YpCbCr8_yuvs
- {FOURCC_HDYC, FOURCC_UYVY},
- {FOURCC_2VUY, FOURCC_UYVY}, // kCMPixelFormat_422YpCbCr8
- {FOURCC_JPEG, FOURCC_MJPG}, // Note: JPEG has DHT while MJPG does not.
- {FOURCC_DMB1, FOURCC_MJPG},
- {FOURCC_BA81, FOURCC_BGGR}, // deprecated.
- {FOURCC_RGB3, FOURCC_RAW },
- {FOURCC_BGR3, FOURCC_24BG},
- {FOURCC_CM32, FOURCC_BGRA}, // kCMPixelFormat_32ARGB
- {FOURCC_CM24, FOURCC_RAW }, // kCMPixelFormat_24RGB
- {FOURCC_L555, FOURCC_RGBO}, // kCMPixelFormat_16LE555
- {FOURCC_L565, FOURCC_RGBP}, // kCMPixelFormat_16LE565
- {FOURCC_5551, FOURCC_RGBO}, // kCMPixelFormat_16LE5551
+#define NUM_ALIASES 18
+static const struct FourCCAliasEntry kFourCCAliases[NUM_ALIASES] = {
+ {FOURCC_IYUV, FOURCC_I420},
+ {FOURCC_YU12, FOURCC_I420},
+ {FOURCC_YU16, FOURCC_I422},
+ {FOURCC_YU24, FOURCC_I444},
+ {FOURCC_YUYV, FOURCC_YUY2},
+ {FOURCC_YUVS, FOURCC_YUY2}, // kCMPixelFormat_422YpCbCr8_yuvs
+ {FOURCC_HDYC, FOURCC_UYVY},
+ {FOURCC_2VUY, FOURCC_UYVY}, // kCMPixelFormat_422YpCbCr8
+ {FOURCC_JPEG, FOURCC_MJPG}, // Note: JPEG has DHT while MJPG does not.
+ {FOURCC_DMB1, FOURCC_MJPG},
+ {FOURCC_BA81, FOURCC_BGGR}, // deprecated.
+ {FOURCC_RGB3, FOURCC_RAW},
+ {FOURCC_BGR3, FOURCC_24BG},
+ {FOURCC_CM32, FOURCC_BGRA}, // kCMPixelFormat_32ARGB
+ {FOURCC_CM24, FOURCC_RAW}, // kCMPixelFormat_24RGB
+ {FOURCC_L555, FOURCC_RGBO}, // kCMPixelFormat_16LE555
+ {FOURCC_L565, FOURCC_RGBP}, // kCMPixelFormat_16LE565
+ {FOURCC_5551, FOURCC_RGBO}, // kCMPixelFormat_16LE5551
};
// TODO(fbarchard): Consider mapping kCMPixelFormat_32BGRA to FOURCC_ARGB.
// {FOURCC_BGRA, FOURCC_ARGB}, // kCMPixelFormat_32BGRA
LIBYUV_API
-uint32 CanonicalFourCC(uint32 fourcc) {
+uint32_t CanonicalFourCC(uint32_t fourcc) {
int i;
- for (i = 0; i < ARRAY_SIZE(kFourCCAliases); ++i) {
+ for (i = 0; i < NUM_ALIASES; ++i) {
if (kFourCCAliases[i].alias == fourcc) {
return kFourCCAliases[i].canonical;
}
@@ -62,4 +60,3 @@ uint32 CanonicalFourCC(uint32 fourcc) {
} // extern "C"
} // namespace libyuv
#endif
-