From c90eb5ba7e77fa0c430354ed8fdcd67ebdc17b9c Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Wed, 21 Jan 2009 21:08:34 +0200 Subject: Use of -funroll-loops option to improve SBC encoder performance Added the use of -funroll-loops gcc option for SBC. Also in order to gain better effect, 'sbc_pack_frame' function body moved to an inline function, which gets instantiated for 4 different subbands/channels combinations. So that 'frame_subbands' and 'frame_channels' arguments become compile time constants and can be better optimized by the compiler. --- sbc/sbc_primitives.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sbc/sbc_primitives.h') diff --git a/sbc/sbc_primitives.h b/sbc/sbc_primitives.h index 91b72eef..a418ed8a 100644 --- a/sbc/sbc_primitives.h +++ b/sbc/sbc_primitives.h @@ -28,6 +28,12 @@ #define SCALE_OUT_BITS 15 +#ifdef __GNUC__ +#define SBC_ALWAYS_INLINE __attribute__((always_inline)) +#else +#define SBC_ALWAYS_INLINE inline +#endif + struct sbc_encoder_state { int subbands; int position[2]; -- cgit