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

Side by Side Diff: media/base/simd/filter_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 unified diff | Download patch
« no previous file with comments | « media/base/simd/filter_yuv.h ('k') | media/base/simd/filter_yuv_sse2.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <stdint.h>
6
7 #include "media/base/simd/filter_yuv.h"
8
9 namespace media {
10
11 void FilterYUVRows_C(uint8_t* ybuf,
12 const uint8_t* y0_ptr,
13 const uint8_t* y1_ptr,
14 int source_width,
15 uint8_t source_y_fraction) {
16 uint8_t y1_fraction = source_y_fraction;
17 uint16_t y0_fraction = 256 - y1_fraction;
18 uint8_t* end = ybuf + source_width;
19 uint8_t* rounded_end = ybuf + (source_width & ~7);
20
21 while (ybuf < rounded_end) {
22 ybuf[0] = (y0_ptr[0] * y0_fraction + y1_ptr[0] * y1_fraction) >> 8;
23 ybuf[1] = (y0_ptr[1] * y0_fraction + y1_ptr[1] * y1_fraction) >> 8;
24 ybuf[2] = (y0_ptr[2] * y0_fraction + y1_ptr[2] * y1_fraction) >> 8;
25 ybuf[3] = (y0_ptr[3] * y0_fraction + y1_ptr[3] * y1_fraction) >> 8;
26 ybuf[4] = (y0_ptr[4] * y0_fraction + y1_ptr[4] * y1_fraction) >> 8;
27 ybuf[5] = (y0_ptr[5] * y0_fraction + y1_ptr[5] * y1_fraction) >> 8;
28 ybuf[6] = (y0_ptr[6] * y0_fraction + y1_ptr[6] * y1_fraction) >> 8;
29 ybuf[7] = (y0_ptr[7] * y0_fraction + y1_ptr[7] * y1_fraction) >> 8;
30 y0_ptr += 8;
31 y1_ptr += 8;
32 ybuf += 8;
33 }
34
35 while (ybuf < end) {
36 ybuf[0] = (y0_ptr[0] * y0_fraction + y1_ptr[0] * y1_fraction) >> 8;
37 ++ybuf;
38 ++y0_ptr;
39 ++y1_ptr;
40 }
41 }
42
43 } // namespace media
OLDNEW
« no previous file with comments | « media/base/simd/filter_yuv.h ('k') | media/base/simd/filter_yuv_sse2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698