aboutsummaryrefslogtreecommitdiff
path: root/source/convert.cc
diff options
context:
space:
mode:
authorFrank Barchard <fbarchard@google.com>2022-03-18 18:25:49 -0700
committerlibyuv LUCI CQ <libyuv-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-03-19 01:44:06 +0000
commit124bf08feeaacfa132e52a48d9ce36237c92b713 (patch)
treeffc69db2d291c63ed836aeb241521edddbb6e910 /source/convert.cc
parent95b14b24462d67aede96e30243694732f9471e63 (diff)
downloadlibyuv-124bf08feeaacfa132e52a48d9ce36237c92b713.tar.gz
RGBScale function using 3 steps: RGB24ToARGB, ARGBScale, ARGBToRGB24
1920x1080 to/from 1280x720 to ARGB on Intel Skylake Xeon RGBScaleTo1920x1080_Bilinear (2625 ms) RGBScaleFrom1920x1080_Bilinear (2115 ms) ARGBScaleTo1920x1080_Bilinear (1668 ms) ARGBScaleFrom1920x1080_Bilinear (1164 ms) Bug: b/224814071 Change-Id: Ifc7611b597409771728b13c9c39e5a7e06131021 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3537341 Reviewed-by: Wan-Teh Chang <wtc@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'source/convert.cc')
-rw-r--r--source/convert.cc40
1 files changed, 20 insertions, 20 deletions
diff --git a/source/convert.cc b/source/convert.cc
index 45590a7b..d0116503 100644
--- a/source/convert.cc
+++ b/source/convert.cc
@@ -2091,18 +2091,18 @@ int RGB24ToJ420(const uint8_t* src_rgb24,
#endif
#endif // HAS_RGB24TOYJROW
-{
+ {
#if !defined(HAS_RGB24TOYJROW)
- // Allocate 2 rows of ARGB.
- const int kRowSize = (width * 4 + 31) & ~31;
- align_buffer_64(row, kRowSize * 2);
+ // Allocate 2 rows of ARGB.
+ const int kRowSize = (width * 4 + 31) & ~31;
+ align_buffer_64(row, kRowSize * 2);
#endif
- for (y = 0; y < height - 1; y += 2) {
+ for (y = 0; y < height - 1; y += 2) {
#if defined(HAS_RGB24TOYJROW)
- RGB24ToUVJRow(src_rgb24, src_stride_rgb24, dst_u, dst_v, width);
- RGB24ToYJRow(src_rgb24, dst_y, width);
- RGB24ToYJRow(src_rgb24 + src_stride_rgb24, dst_y + dst_stride_y, width);
+ RGB24ToUVJRow(src_rgb24, src_stride_rgb24, dst_u, dst_v, width);
+ RGB24ToYJRow(src_rgb24, dst_y, width);
+ RGB24ToYJRow(src_rgb24 + src_stride_rgb24, dst_y + dst_stride_y, width);
#else
RGB24ToARGBRow(src_rgb24, row, width);
RGB24ToARGBRow(src_rgb24 + src_stride_rgb24, row + kRowSize, width);
@@ -2110,26 +2110,26 @@ int RGB24ToJ420(const uint8_t* src_rgb24,
ARGBToYJRow(row, dst_y, width);
ARGBToYJRow(row + kRowSize, dst_y + dst_stride_y, width);
#endif
- src_rgb24 += src_stride_rgb24 * 2;
- dst_y += dst_stride_y * 2;
- dst_u += dst_stride_u;
- dst_v += dst_stride_v;
- }
- if (height & 1) {
+ src_rgb24 += src_stride_rgb24 * 2;
+ dst_y += dst_stride_y * 2;
+ dst_u += dst_stride_u;
+ dst_v += dst_stride_v;
+ }
+ if (height & 1) {
#if defined(HAS_RGB24TOYJROW)
- RGB24ToUVJRow(src_rgb24, 0, dst_u, dst_v, width);
- RGB24ToYJRow(src_rgb24, dst_y, width);
+ RGB24ToUVJRow(src_rgb24, 0, dst_u, dst_v, width);
+ RGB24ToYJRow(src_rgb24, dst_y, width);
#else
RGB24ToARGBRow(src_rgb24, row, width);
ARGBToUVJRow(row, 0, dst_u, dst_v, width);
ARGBToYJRow(row, dst_y, width);
#endif
- }
+ }
#if !defined(HAS_RGB24TOYJROW)
- free_aligned_buffer_64(row);
+ free_aligned_buffer_64(row);
#endif
-}
-return 0;
+ }
+ return 0;
}
#undef HAS_RGB24TOYJROW