diff options
author | William Wilgus <me.theuser@yahoo.com> | 2019-01-04 02:01:18 -0600 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2021-04-23 14:23:04 +0000 |
commit | 14c6bb798d6bebc80f07e863236adbaf8d156a9c (patch) | |
tree | 551a4b641906c2626af844fa3239c1b2b1ff0ad3 /lib/rbcodec/codecs/libopus/silk/arm/macros_armv5e.h | |
parent | 75d93937965ec4df70d37df6d4feea04577c996b (diff) | |
download | rockbox-14c6bb798d6bebc80f07e863236adbaf8d156a9c.tar.gz rockbox-14c6bb798d6bebc80f07e863236adbaf8d156a9c.zip |
Sync opus codec to upstream git
Change-Id: I0cfcc0005c4ad7bfbb1aaf454188ce70fb043dc1
Diffstat (limited to 'lib/rbcodec/codecs/libopus/silk/arm/macros_armv5e.h')
-rw-r--r-- | lib/rbcodec/codecs/libopus/silk/arm/macros_armv5e.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/rbcodec/codecs/libopus/silk/arm/macros_armv5e.h b/lib/rbcodec/codecs/libopus/silk/arm/macros_armv5e.h index aad4117e46..b14ec65ddb 100644 --- a/lib/rbcodec/codecs/libopus/silk/arm/macros_armv5e.h +++ b/lib/rbcodec/codecs/libopus/silk/arm/macros_armv5e.h | |||
@@ -29,6 +29,11 @@ POSSIBILITY OF SUCH DAMAGE. | |||
29 | #ifndef SILK_MACROS_ARMv5E_H | 29 | #ifndef SILK_MACROS_ARMv5E_H |
30 | #define SILK_MACROS_ARMv5E_H | 30 | #define SILK_MACROS_ARMv5E_H |
31 | 31 | ||
32 | /* This macro only avoids the undefined behaviour from a left shift of | ||
33 | a negative value. It should only be used in macros that can't include | ||
34 | SigProc_FIX.h. In other cases, use silk_LSHIFT32(). */ | ||
35 | #define SAFE_SHL(a,b) ((opus_int32)((opus_uint32)(a) << (b))) | ||
36 | |||
32 | /* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */ | 37 | /* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */ |
33 | #undef silk_SMULWB | 38 | #undef silk_SMULWB |
34 | static OPUS_INLINE opus_int32 silk_SMULWB_armv5e(opus_int32 a, opus_int16 b) | 39 | static OPUS_INLINE opus_int32 silk_SMULWB_armv5e(opus_int32 a, opus_int16 b) |
@@ -190,7 +195,7 @@ static OPUS_INLINE opus_int32 silk_CLZ16_armv5(opus_int16 in16) | |||
190 | "#silk_CLZ16\n\t" | 195 | "#silk_CLZ16\n\t" |
191 | "clz %0, %1;\n" | 196 | "clz %0, %1;\n" |
192 | : "=r"(res) | 197 | : "=r"(res) |
193 | : "r"(in16<<16|0x8000) | 198 | : "r"(SAFE_SHL(in16,16)|0x8000) |
194 | ); | 199 | ); |
195 | return res; | 200 | return res; |
196 | } | 201 | } |
@@ -210,4 +215,6 @@ static OPUS_INLINE opus_int32 silk_CLZ32_armv5(opus_int32 in32) | |||
210 | } | 215 | } |
211 | #define silk_CLZ32(in32) (silk_CLZ32_armv5(in32)) | 216 | #define silk_CLZ32(in32) (silk_CLZ32_armv5(in32)) |
212 | 217 | ||
218 | #undef SAFE_SHL | ||
219 | |||
213 | #endif /* SILK_MACROS_ARMv5E_H */ | 220 | #endif /* SILK_MACROS_ARMv5E_H */ |