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

Side by Side Diff: media/base/simd/filter_yuv_c.cc

Issue 1542013004: Switch to standard integer types in media/, take 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more stddef Created 5 years 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h>
6
5 #include "media/base/simd/filter_yuv.h" 7 #include "media/base/simd/filter_yuv.h"
6 8
7 namespace media { 9 namespace media {
8 10
9 void FilterYUVRows_C(uint8* ybuf, const uint8* y0_ptr, const uint8* y1_ptr, 11 void FilterYUVRows_C(uint8_t* ybuf,
10 int source_width, uint8 source_y_fraction) { 12 const uint8_t* y0_ptr,
11 uint8 y1_fraction = source_y_fraction; 13 const uint8_t* y1_ptr,
12 uint16 y0_fraction = 256 - y1_fraction; 14 int source_width,
13 uint8* end = ybuf + source_width; 15 uint8_t source_y_fraction) {
14 uint8* rounded_end = ybuf + (source_width & ~7); 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);
15 20
16 while (ybuf < rounded_end) { 21 while (ybuf < rounded_end) {
17 ybuf[0] = (y0_ptr[0] * y0_fraction + y1_ptr[0] * y1_fraction) >> 8; 22 ybuf[0] = (y0_ptr[0] * y0_fraction + y1_ptr[0] * y1_fraction) >> 8;
18 ybuf[1] = (y0_ptr[1] * y0_fraction + y1_ptr[1] * y1_fraction) >> 8; 23 ybuf[1] = (y0_ptr[1] * y0_fraction + y1_ptr[1] * y1_fraction) >> 8;
19 ybuf[2] = (y0_ptr[2] * y0_fraction + y1_ptr[2] * y1_fraction) >> 8; 24 ybuf[2] = (y0_ptr[2] * y0_fraction + y1_ptr[2] * y1_fraction) >> 8;
20 ybuf[3] = (y0_ptr[3] * y0_fraction + y1_ptr[3] * y1_fraction) >> 8; 25 ybuf[3] = (y0_ptr[3] * y0_fraction + y1_ptr[3] * y1_fraction) >> 8;
21 ybuf[4] = (y0_ptr[4] * y0_fraction + y1_ptr[4] * y1_fraction) >> 8; 26 ybuf[4] = (y0_ptr[4] * y0_fraction + y1_ptr[4] * y1_fraction) >> 8;
22 ybuf[5] = (y0_ptr[5] * y0_fraction + y1_ptr[5] * y1_fraction) >> 8; 27 ybuf[5] = (y0_ptr[5] * y0_fraction + y1_ptr[5] * y1_fraction) >> 8;
23 ybuf[6] = (y0_ptr[6] * y0_fraction + y1_ptr[6] * y1_fraction) >> 8; 28 ybuf[6] = (y0_ptr[6] * y0_fraction + y1_ptr[6] * y1_fraction) >> 8;
24 ybuf[7] = (y0_ptr[7] * y0_fraction + y1_ptr[7] * y1_fraction) >> 8; 29 ybuf[7] = (y0_ptr[7] * y0_fraction + y1_ptr[7] * y1_fraction) >> 8;
25 y0_ptr += 8; 30 y0_ptr += 8;
26 y1_ptr += 8; 31 y1_ptr += 8;
27 ybuf += 8; 32 ybuf += 8;
28 } 33 }
29 34
30 while (ybuf < end) { 35 while (ybuf < end) {
31 ybuf[0] = (y0_ptr[0] * y0_fraction + y1_ptr[0] * y1_fraction) >> 8; 36 ybuf[0] = (y0_ptr[0] * y0_fraction + y1_ptr[0] * y1_fraction) >> 8;
32 ++ybuf; 37 ++ybuf;
33 ++y0_ptr; 38 ++y0_ptr;
34 ++y1_ptr; 39 ++y1_ptr;
35 } 40 }
36 } 41 }
37 42
38 } // namespace media 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