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

Side by Side Diff: source/libvpx/vpx_ports/mem_ops.h

Issue 478033002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « source/libvpx/vpx/vpx_integer.h ('k') | source/libvpx/vpx_ports/mem_ops_aligned.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 const MAU_T *mem = (const MAU_T *)vmem; 126 const MAU_T *mem = (const MAU_T *)vmem;
127 127
128 val = mem[3] << 24; 128 val = mem[3] << 24;
129 val |= mem[2] << 16; 129 val |= mem[2] << 16;
130 val |= mem[1] << 8; 130 val |= mem[1] << 8;
131 val |= mem[0]; 131 val |= mem[0];
132 return val; 132 return val;
133 } 133 }
134 134
135 #define mem_get_s_generic(end,sz) \ 135 #define mem_get_s_generic(end,sz) \
136 static signed MEM_VALUE_T mem_get_s##end##sz(const void *vmem) {\ 136 static VPX_INLINE signed MEM_VALUE_T mem_get_s##end##sz(const void *vmem) {\
137 const MAU_T *mem = (const MAU_T*)vmem;\ 137 const MAU_T *mem = (const MAU_T*)vmem;\
138 signed MEM_VALUE_T val = mem_get_##end##sz(mem);\ 138 signed MEM_VALUE_T val = mem_get_##end##sz(mem);\
139 return (val << (MEM_VALUE_T_SZ_BITS - sz)) >> (MEM_VALUE_T_SZ_BITS - sz);\ 139 return (val << (MEM_VALUE_T_SZ_BITS - sz)) >> (MEM_VALUE_T_SZ_BITS - sz);\
140 } 140 }
141 141
142 #undef mem_get_sbe16 142 #undef mem_get_sbe16
143 #define mem_get_sbe16 mem_ops_wrap_symbol(mem_get_sbe16) 143 #define mem_get_sbe16 mem_ops_wrap_symbol(mem_get_sbe16)
144 mem_get_s_generic(be, 16) 144 mem_get_s_generic(be, 16)
145 145
146 #undef mem_get_sbe24 146 #undef mem_get_sbe24
(...skipping 11 matching lines...) Expand all
158 #undef mem_get_sle24 158 #undef mem_get_sle24
159 #define mem_get_sle24 mem_ops_wrap_symbol(mem_get_sle24) 159 #define mem_get_sle24 mem_ops_wrap_symbol(mem_get_sle24)
160 mem_get_s_generic(le, 24) 160 mem_get_s_generic(le, 24)
161 161
162 #undef mem_get_sle32 162 #undef mem_get_sle32
163 #define mem_get_sle32 mem_ops_wrap_symbol(mem_get_sle32) 163 #define mem_get_sle32 mem_ops_wrap_symbol(mem_get_sle32)
164 mem_get_s_generic(le, 32) 164 mem_get_s_generic(le, 32)
165 165
166 #undef mem_put_be16 166 #undef mem_put_be16
167 #define mem_put_be16 mem_ops_wrap_symbol(mem_put_be16) 167 #define mem_put_be16 mem_ops_wrap_symbol(mem_put_be16)
168 static void mem_put_be16(void *vmem, MEM_VALUE_T val) { 168 static VPX_INLINE void mem_put_be16(void *vmem, MEM_VALUE_T val) {
169 MAU_T *mem = (MAU_T *)vmem; 169 MAU_T *mem = (MAU_T *)vmem;
170 170
171 mem[0] = (val >> 8) & 0xff; 171 mem[0] = (val >> 8) & 0xff;
172 mem[1] = (val >> 0) & 0xff; 172 mem[1] = (val >> 0) & 0xff;
173 } 173 }
174 174
175 #undef mem_put_be24 175 #undef mem_put_be24
176 #define mem_put_be24 mem_ops_wrap_symbol(mem_put_be24) 176 #define mem_put_be24 mem_ops_wrap_symbol(mem_put_be24)
177 static void mem_put_be24(void *vmem, MEM_VALUE_T val) { 177 static VPX_INLINE void mem_put_be24(void *vmem, MEM_VALUE_T val) {
178 MAU_T *mem = (MAU_T *)vmem; 178 MAU_T *mem = (MAU_T *)vmem;
179 179
180 mem[0] = (val >> 16) & 0xff; 180 mem[0] = (val >> 16) & 0xff;
181 mem[1] = (val >> 8) & 0xff; 181 mem[1] = (val >> 8) & 0xff;
182 mem[2] = (val >> 0) & 0xff; 182 mem[2] = (val >> 0) & 0xff;
183 } 183 }
184 184
185 #undef mem_put_be32 185 #undef mem_put_be32
186 #define mem_put_be32 mem_ops_wrap_symbol(mem_put_be32) 186 #define mem_put_be32 mem_ops_wrap_symbol(mem_put_be32)
187 static void mem_put_be32(void *vmem, MEM_VALUE_T val) { 187 static VPX_INLINE void mem_put_be32(void *vmem, MEM_VALUE_T val) {
188 MAU_T *mem = (MAU_T *)vmem; 188 MAU_T *mem = (MAU_T *)vmem;
189 189
190 mem[0] = (val >> 24) & 0xff; 190 mem[0] = (val >> 24) & 0xff;
191 mem[1] = (val >> 16) & 0xff; 191 mem[1] = (val >> 16) & 0xff;
192 mem[2] = (val >> 8) & 0xff; 192 mem[2] = (val >> 8) & 0xff;
193 mem[3] = (val >> 0) & 0xff; 193 mem[3] = (val >> 0) & 0xff;
194 } 194 }
195 195
196 #undef mem_put_le16 196 #undef mem_put_le16
197 #define mem_put_le16 mem_ops_wrap_symbol(mem_put_le16) 197 #define mem_put_le16 mem_ops_wrap_symbol(mem_put_le16)
198 static void mem_put_le16(void *vmem, MEM_VALUE_T val) { 198 static VPX_INLINE void mem_put_le16(void *vmem, MEM_VALUE_T val) {
199 MAU_T *mem = (MAU_T *)vmem; 199 MAU_T *mem = (MAU_T *)vmem;
200 200
201 mem[0] = (val >> 0) & 0xff; 201 mem[0] = (val >> 0) & 0xff;
202 mem[1] = (val >> 8) & 0xff; 202 mem[1] = (val >> 8) & 0xff;
203 } 203 }
204 204
205 #undef mem_put_le24 205 #undef mem_put_le24
206 #define mem_put_le24 mem_ops_wrap_symbol(mem_put_le24) 206 #define mem_put_le24 mem_ops_wrap_symbol(mem_put_le24)
207 static void mem_put_le24(void *vmem, MEM_VALUE_T val) { 207 static VPX_INLINE void mem_put_le24(void *vmem, MEM_VALUE_T val) {
208 MAU_T *mem = (MAU_T *)vmem; 208 MAU_T *mem = (MAU_T *)vmem;
209 209
210 mem[0] = (val >> 0) & 0xff; 210 mem[0] = (val >> 0) & 0xff;
211 mem[1] = (val >> 8) & 0xff; 211 mem[1] = (val >> 8) & 0xff;
212 mem[2] = (val >> 16) & 0xff; 212 mem[2] = (val >> 16) & 0xff;
213 } 213 }
214 214
215 #undef mem_put_le32 215 #undef mem_put_le32
216 #define mem_put_le32 mem_ops_wrap_symbol(mem_put_le32) 216 #define mem_put_le32 mem_ops_wrap_symbol(mem_put_le32)
217 static void mem_put_le32(void *vmem, MEM_VALUE_T val) { 217 static VPX_INLINE void mem_put_le32(void *vmem, MEM_VALUE_T val) {
218 MAU_T *mem = (MAU_T *)vmem; 218 MAU_T *mem = (MAU_T *)vmem;
219 219
220 mem[0] = (val >> 0) & 0xff; 220 mem[0] = (val >> 0) & 0xff;
221 mem[1] = (val >> 8) & 0xff; 221 mem[1] = (val >> 8) & 0xff;
222 mem[2] = (val >> 16) & 0xff; 222 mem[2] = (val >> 16) & 0xff;
223 mem[3] = (val >> 24) & 0xff; 223 mem[3] = (val >> 24) & 0xff;
224 } 224 }
225 225
226 #endif // VPX_PORTS_MEM_OPS_H_ 226 #endif // VPX_PORTS_MEM_OPS_H_
OLDNEW
« no previous file with comments | « source/libvpx/vpx/vpx_integer.h ('k') | source/libvpx/vpx_ports/mem_ops_aligned.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698