aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWan-Teh Chang <wtc@google.com>2023-07-31 13:00:00 -0700
committerlibyuv LUCI CQ <libyuv-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-07-31 20:53:54 +0000
commita8a37a25c9e1cf11bcd6ef7958551ccbbc5976ae (patch)
tree5b5f8e51878e65f8a16728e21ccff279437c2f21
parentc60ac4025cd88ec9139cc01d6021fa81a8d2c085 (diff)
downloadlibyuv-a8a37a25c9e1cf11bcd6ef7958551ccbbc5976ae.tar.gz
Eliminate a common subexpression in YPixel()
Save the value of a common subexpression in a local variable. Change-Id: I5724fcf341900cb2a65eb37b505194b8d3c3da9a Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4735651 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Wan-Teh Chang <wtc@google.com>
-rw-r--r--source/row_common.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/row_common.cc b/source/row_common.cc
index fdd49a65..7591c6b6 100644
--- a/source/row_common.cc
+++ b/source/row_common.cc
@@ -1875,9 +1875,10 @@ static __inline void YPixel(uint8_t y,
int yg = yuvconstants->kYToRgb[0];
#endif
uint32_t y1 = (uint32_t)(y * 0x0101 * yg) >> 16;
- *b = STATIC_CAST(uint8_t, Clamp(((int32_t)(y1) + ygb) >> 6));
- *g = STATIC_CAST(uint8_t, Clamp(((int32_t)(y1) + ygb) >> 6));
- *r = STATIC_CAST(uint8_t, Clamp(((int32_t)(y1) + ygb) >> 6));
+ uint8_t b8 = STATIC_CAST(uint8_t, Clamp(((int32_t)(y1) + ygb) >> 6));
+ *b = b8;
+ *g = b8;
+ *r = b8;
}
void I444ToARGBRow_C(const uint8_t* src_y,