Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1404)

Unified Diff: media/base/simd/convert_rgb_to_yuv_c.cc

Issue 2694113002: Delete media/base/yuv_convert and dependents. Prefer libyuv. (Closed)
Patch Set: Fix media_unittests. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/simd/convert_rgb_to_yuv.h ('k') | media/base/simd/convert_rgb_to_yuv_sse2.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/simd/convert_rgb_to_yuv_c.cc
diff --git a/media/base/simd/convert_rgb_to_yuv_c.cc b/media/base/simd/convert_rgb_to_yuv_c.cc
deleted file mode 100644
index a43e431846b9b0c566433857097376debce95b69..0000000000000000000000000000000000000000
--- a/media/base/simd/convert_rgb_to_yuv_c.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <stdint.h>
-
-#include "build/build_config.h"
-#include "media/base/simd/convert_rgb_to_yuv.h"
-
-namespace media {
-
-static int clip_byte(int x) {
- if (x > 255)
- return 255;
- else if (x < 0)
- return 0;
- else
- return x;
-}
-
-void ConvertRGB32ToYUV_C(const uint8_t* rgbframe,
- uint8_t* yplane,
- uint8_t* uplane,
- uint8_t* vplane,
- int width,
- int height,
- int rgbstride,
- int ystride,
- int uvstride) {
-#if defined(OS_ANDROID)
- const int r = 0;
- const int g = 1;
- const int b = 2;
-#else
- const int r = 2;
- const int g = 1;
- const int b = 0;
-#endif
-
- for (int i = 0; i < height; ++i) {
- for (int j = 0; j < width; ++j) {
- // Since the input pixel format is RGB32, there are 4 bytes per pixel.
- const uint8_t* pixel = rgbframe + 4 * j;
- yplane[j] = clip_byte(((pixel[r] * 66 + pixel[g] * 129 +
- pixel[b] * 25 + 128) >> 8) + 16);
- if (i % 2 == 0 && j % 2 == 0) {
- uplane[j / 2] = clip_byte(((pixel[r] * -38 + pixel[g] * -74 +
- pixel[b] * 112 + 128) >> 8) + 128);
- vplane[j / 2] = clip_byte(((pixel[r] * 112 + pixel[g] * -94 +
- pixel[b] * -18 + 128) >> 8) + 128);
- }
- }
- rgbframe += rgbstride;
- yplane += ystride;
- if (i % 2 == 0) {
- uplane += uvstride;
- vplane += uvstride;
- }
- }
-}
-
-void ConvertRGB24ToYUV_C(const uint8_t* rgbframe,
- uint8_t* yplane,
- uint8_t* uplane,
- uint8_t* vplane,
- int width,
- int height,
- int rgbstride,
- int ystride,
- int uvstride) {
- for (int i = 0; i < height; ++i) {
- for (int j = 0; j < width; ++j) {
- // Since the input pixel format is RGB24, there are 3 bytes per pixel.
- const uint8_t* pixel = rgbframe + 3 * j;
- yplane[j] = clip_byte(((pixel[2] * 66 + pixel[1] * 129 +
- pixel[0] * 25 + 128) >> 8) + 16);
- if (i % 2 == 0 && j % 2 == 0) {
- uplane[j / 2] = clip_byte(((pixel[2] * -38 + pixel[1] * -74 +
- pixel[0] * 112 + 128) >> 8) + 128);
- vplane[j / 2] = clip_byte(((pixel[2] * 112 + pixel[1] * -94 +
- pixel[0] * -18 + 128) >> 8) + 128);
- }
- }
-
- rgbframe += rgbstride;
- yplane += ystride;
- if (i % 2 == 0) {
- uplane += uvstride;
- vplane += uvstride;
- }
- }
-}
-
-} // namespace media
« no previous file with comments | « media/base/simd/convert_rgb_to_yuv.h ('k') | media/base/simd/convert_rgb_to_yuv_sse2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698