aboutsummaryrefslogtreecommitdiff
path: root/source/planar_functions.cc
diff options
context:
space:
mode:
authorFrank Barchard <fbarchard@google.com>2022-11-17 11:36:30 -0800
committerlibyuv LUCI CQ <libyuv-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-17 23:00:08 +0000
commit8713ba3f0bddfa19943559981acd5aad2d703d5d (patch)
tree54e17dab021cb71f08bbd4a47f895f0119d749fa /source/planar_functions.cc
parent2d2cee418a18b9f1bfa6b8037d4f8da095720695 (diff)
downloadlibyuv-8713ba3f0bddfa19943559981acd5aad2d703d5d.tar.gz
Add vzeroupper to AVX row functions
- move power of two macro to planar functions source - revert row.h IS_ALIGNED change Bug: b/258474032 Change-Id: If87bb8d55c9b9930dd3e378614f8e4faae0870e9 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4035166 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Wan-Teh Chang <wtc@google.com>
Diffstat (limited to 'source/planar_functions.cc')
-rw-r--r--source/planar_functions.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/planar_functions.cc b/source/planar_functions.cc
index 1e3dfaed..25f577b7 100644
--- a/source/planar_functions.cc
+++ b/source/planar_functions.cc
@@ -913,6 +913,9 @@ int NV21ToNV12(const uint8_t* src_y,
return 0;
}
+// Test if tile_height is a power of 2 (16 or 32)
+#define IS_POWEROFTWO(x) (!((x) & ((x)-1)))
+
// Detile a plane of data
// tile width is 16 and assumed.
// tile_height is 16 or 32 for MM21.
@@ -930,7 +933,8 @@ int DetilePlane(const uint8_t* src_y,
int y;
void (*DetileRow)(const uint8_t* src, ptrdiff_t src_tile_stride, uint8_t* dst,
int width) = DetileRow_C;
- if (!src_y || !dst_y || width <= 0 || height == 0 || !IS_POWEROFTWO(tile_height)) {
+ if (!src_y || !dst_y || width <= 0 || height == 0 ||
+ !IS_POWEROFTWO(tile_height)) {
return -1;
}
@@ -986,7 +990,8 @@ int DetilePlane_16(const uint16_t* src_y,
int y;
void (*DetileRow_16)(const uint16_t* src, ptrdiff_t src_tile_stride,
uint16_t* dst, int width) = DetileRow_16_C;
- if (!src_y || !dst_y || width <= 0 || height == 0 || !IS_POWEROFTWO(tile_height)) {
+ if (!src_y || !dst_y || width <= 0 || height == 0 ||
+ !IS_POWEROFTWO(tile_height)) {
return -1;
}