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

Side by Side Diff: media/base/simd/filter_yuv_sse2.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 4 years, 12 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_c.cc ('k') | media/base/simd/linear_scale_yuv_to_rgb_mmx.asm » ('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 #if defined(_MSC_VER) 7 #if defined(_MSC_VER)
6 #include <intrin.h> 8 #include <intrin.h>
7 #else 9 #else
8 #include <mmintrin.h> 10 #include <mmintrin.h>
9 #include <emmintrin.h> 11 #include <emmintrin.h>
10 #endif 12 #endif
11 13
12 #include "media/base/simd/filter_yuv.h" 14 #include "media/base/simd/filter_yuv.h"
13 15
14 namespace media { 16 namespace media {
15 17
16 void FilterYUVRows_SSE2(uint8* dest, 18 void FilterYUVRows_SSE2(uint8_t* dest,
17 const uint8* src0, 19 const uint8_t* src0,
18 const uint8* src1, 20 const uint8_t* src1,
19 int width, 21 int width,
20 uint8 fraction) { 22 uint8_t fraction) {
21 int pixel = 0; 23 int pixel = 0;
22 24
23 // Process the unaligned bytes first. 25 // Process the unaligned bytes first.
24 int unaligned_width = 26 int unaligned_width =
25 (16 - (reinterpret_cast<uintptr_t>(dest) & 15)) & 15; 27 (16 - (reinterpret_cast<uintptr_t>(dest) & 15)) & 15;
26 while (pixel < width && pixel < unaligned_width) { 28 while (pixel < width && pixel < unaligned_width) {
27 dest[pixel] = (src0[pixel] * (256 - fraction) + 29 dest[pixel] = (src0[pixel] * (256 - fraction) +
28 src1[pixel] * fraction) >> 8; 30 src1[pixel] * fraction) >> 8;
29 ++pixel; 31 ++pixel;
30 } 32 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 65 }
64 66
65 while (pixel < width) { 67 while (pixel < width) {
66 dest[pixel] = (src0[pixel] * (256 - fraction) + 68 dest[pixel] = (src0[pixel] * (256 - fraction) +
67 src1[pixel] * fraction) >> 8; 69 src1[pixel] * fraction) >> 8;
68 ++pixel; 70 ++pixel;
69 } 71 }
70 } 72 }
71 73
72 } // namespace media 74 } // namespace media
OLDNEW
« no previous file with comments | « media/base/simd/filter_yuv_c.cc ('k') | media/base/simd/linear_scale_yuv_to_rgb_mmx.asm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698