| Index: media/base/simd/convert_rgb_to_yuv.cc
|
| ===================================================================
|
| --- media/base/simd/convert_rgb_to_yuv.cc (revision 0)
|
| +++ media/base/simd/convert_rgb_to_yuv.cc (revision 0)
|
| @@ -0,0 +1,97 @@
|
| +// 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 "media/base/simd/convert_rgb_to_yuv.h"
|
| +
|
| +#include "build/build_config.h"
|
| +#include "media/base/cpu_features.h"
|
| +#include "media/base/simd/convert_rgb_to_yuv_ssse3.h"
|
| +
|
| +namespace media {
|
| +namespace simd {
|
| +
|
| +void ConvertRGB32toYUV(const uint8* rgbframe,
|
| + uint8* yplane,
|
| + uint8* uplane,
|
| + uint8* vplane,
|
| + int width,
|
| + int height,
|
| + int rgbstride,
|
| + int ystride,
|
| + int uvstride) {
|
| +#if ENABLE_SUBSAMPLING
|
| + for (; height >= 2; height -= 2) {
|
| + ConvertARGBtoYUVEven(rgbframe, yplane, uplane, vplane, width);
|
| + rgbframe += rgbstride;
|
| + yplane += ystride;
|
| +
|
| + ConvertARGBtoYUVOdd(rgbframe, yplane, uplane, vplane, width);
|
| + rgbframe += rgbstride;
|
| + yplane += ystride;
|
| +
|
| + uplane += uvstride;
|
| + vplane += uvstride;
|
| + }
|
| +#else
|
| + for (; height >= 2; height -= 2) {
|
| + ConvertARGBtoYUVRow(rgbframe, yplane, uplane, vplane, width);
|
| + rgbframe += rgbstride;
|
| + yplane += ystride;
|
| +
|
| + ConvertARGBtoYUVRow(rgbframe, yplane, NULL, NULL, width);
|
| + rgbframe += rgbstride;
|
| + yplane += ystride;
|
| +
|
| + uplane += uvstride;
|
| + vplane += uvstride;
|
| + }
|
| +#endif
|
| +
|
| + if (height)
|
| + ConvertARGBtoYUVRow(rgbframe, yplane, uplane, vplane, width);
|
| +}
|
| +
|
| +void ConvertRGB24toYUV(const uint8* rgbframe,
|
| + uint8* yplane,
|
| + uint8* uplane,
|
| + uint8* vplane,
|
| + int width,
|
| + int height,
|
| + int rgbstride,
|
| + int ystride,
|
| + int uvstride) {
|
| +#if ENABLE_SUBSAMPLING
|
| + for (; height >= 2; height -= 2) {
|
| + ConvertRGBtoYUVEven(rgbframe, yplane, uplane, vplane, width);
|
| + rgbframe += rgbstride;
|
| + yplane += ystride;
|
| +
|
| + ConvertRGBtoYUVOdd(rgbframe, yplane, uplane, vplane, width);
|
| + rgbframe += rgbstride;
|
| + yplane += ystride;
|
| +
|
| + uplane += uvstride;
|
| + vplane += uvstride;
|
| + }
|
| +#else
|
| + for (; height >= 2; height -= 2) {
|
| + ConvertRGBtoYUVRow(rgbframe, yplane, uplane, vplane, width);
|
| + rgbframe += rgbstride;
|
| + yplane += ystride;
|
| +
|
| + ConvertRGBtoYUVRow(rgbframe, yplane, NULL, NULL, width);
|
| + rgbframe += rgbstride;
|
| + yplane += ystride;
|
| +
|
| + uplane += uvstride;
|
| + vplane += uvstride;
|
| + }
|
| +#endif
|
| +
|
| + if (height)
|
| + ConvertRGBtoYUVRow(rgbframe, yplane, uplane, vplane, width);
|
| +}
|
| +
|
| +} // namespace simd
|
| +} // namespace media
|
|
|
| Property changes on: media\base\simd\convert_rgb_to_yuv.cc
|
| ___________________________________________________________________
|
| Added: svn:eol-style
|
| + LF
|
|
|
|
|