| OLD | NEW |
| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // Use this for variably-sized arrays. | 42 // Use this for variably-sized arrays. |
| 43 #define vp9_copy_array(dest, src, n) { \ | 43 #define vp9_copy_array(dest, src, n) { \ |
| 44 assert(sizeof(*dest) == sizeof(*src)); \ | 44 assert(sizeof(*dest) == sizeof(*src)); \ |
| 45 vpx_memcpy(dest, src, n * sizeof(*src)); \ | 45 vpx_memcpy(dest, src, n * sizeof(*src)); \ |
| 46 } | 46 } |
| 47 | 47 |
| 48 #define vp9_zero(dest) vpx_memset(&(dest), 0, sizeof(dest)) | 48 #define vp9_zero(dest) vpx_memset(&(dest), 0, sizeof(dest)) |
| 49 #define vp9_zero_array(dest, n) vpx_memset(dest, 0, n * sizeof(*dest)) | 49 #define vp9_zero_array(dest, n) vpx_memset(dest, 0, n * sizeof(*dest)) |
| 50 | 50 |
| 51 static INLINE uint8_t clip_pixel(int val) { | 51 static INLINE uint8_t clip_pixel(int val) { |
| 52 return (val > 255) ? 255u : (val < 0) ? 0u : val; | 52 return (val > 255) ? 255 : (val < 0) ? 0 : val; |
| 53 } | 53 } |
| 54 | 54 |
| 55 static INLINE int clamp(int value, int low, int high) { | 55 static INLINE int clamp(int value, int low, int high) { |
| 56 return value < low ? low : (value > high ? high : value); | 56 return value < low ? low : (value > high ? high : value); |
| 57 } | 57 } |
| 58 | 58 |
| 59 static INLINE double fclamp(double value, double low, double high) { | 59 static INLINE double fclamp(double value, double low, double high) { |
| 60 return value < low ? low : (value > high ? high : value); | 60 return value < low ? low : (value > high ? high : value); |
| 61 } | 61 } |
| 62 | 62 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 86 #define VP9_SYNC_CODE_2 0x42 | 86 #define VP9_SYNC_CODE_2 0x42 |
| 87 | 87 |
| 88 #define VP9_FRAME_MARKER 0x2 | 88 #define VP9_FRAME_MARKER 0x2 |
| 89 | 89 |
| 90 | 90 |
| 91 #ifdef __cplusplus | 91 #ifdef __cplusplus |
| 92 } // extern "C" | 92 } // extern "C" |
| 93 #endif | 93 #endif |
| 94 | 94 |
| 95 #endif // VP9_COMMON_VP9_COMMON_H_ | 95 #endif // VP9_COMMON_VP9_COMMON_H_ |
| OLD | NEW |