OLD | NEW |
1 /* | 1 /* |
2 * simple math operations | 2 * simple math operations |
3 * Copyright (c) 2001, 2002 Fabrice Bellard | 3 * Copyright (c) 2001, 2002 Fabrice Bellard |
4 * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> et al | 4 * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> et al |
5 * | 5 * |
6 * This file is part of FFmpeg. | 6 * This file is part of FFmpeg. |
7 * | 7 * |
8 * FFmpeg is free software; you can redistribute it and/or | 8 * FFmpeg is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 } | 115 } |
116 #endif | 116 #endif |
117 | 117 |
118 #ifndef sign_extend | 118 #ifndef sign_extend |
119 static inline av_const int sign_extend(int val, unsigned bits) | 119 static inline av_const int sign_extend(int val, unsigned bits) |
120 { | 120 { |
121 return (val << (INT_BIT - bits)) >> (INT_BIT - bits); | 121 return (val << (INT_BIT - bits)) >> (INT_BIT - bits); |
122 } | 122 } |
123 #endif | 123 #endif |
124 | 124 |
| 125 #ifndef zero_extend |
| 126 static inline av_const unsigned zero_extend(unsigned val, unsigned bits) |
| 127 { |
| 128 return (val << (INT_BIT - bits)) >> (INT_BIT - bits); |
| 129 } |
| 130 #endif |
| 131 |
125 #ifndef COPY3_IF_LT | 132 #ifndef COPY3_IF_LT |
126 #define COPY3_IF_LT(x, y, a, b, c, d)\ | 133 #define COPY3_IF_LT(x, y, a, b, c, d)\ |
127 if ((y) < (x)) {\ | 134 if ((y) < (x)) {\ |
128 (x) = (y);\ | 135 (x) = (y);\ |
129 (a) = (b);\ | 136 (a) = (b);\ |
130 (c) = (d);\ | 137 (c) = (d);\ |
131 } | 138 } |
132 #endif | 139 #endif |
133 | 140 |
| 141 #ifndef NEG_SSR32 |
| 142 # define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s))) |
| 143 #endif |
| 144 |
| 145 #ifndef NEG_USR32 |
| 146 # define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s))) |
| 147 #endif |
| 148 |
134 #endif /* AVCODEC_MATHOPS_H */ | 149 #endif /* AVCODEC_MATHOPS_H */ |
135 | 150 |
OLD | NEW |