OSDN Git Service

sbc: Rename sbc_analyze_4b_xx to sbc_analyze_xx
[android-x86/external-bluetooth-sbc.git] / sbc / sbc_primitives.h
index 3d01c11..e01c957 100644 (file)
@@ -2,7 +2,8 @@
  *
  *  Bluetooth low-complexity, subband codec (SBC) library
  *
- *  Copyright (C) 2004-2009  Marcel Holtmann <marcel@holtmann.org>
+ *  Copyright (C) 2008-2010  Nokia Corporation
+ *  Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
  *  Copyright (C) 2004-2005  Henryk Ploetz <henryk@ploetzli.ch>
  *  Copyright (C) 2005-2006  Brad Midgley <bmidgley@xmission.com>
  *
 #define SBC_X_BUFFER_SIZE 328
 
 #ifdef __GNUC__
-#define SBC_ALWAYS_INLINE __attribute__((always_inline))
+#define SBC_ALWAYS_INLINE inline __attribute__((always_inline))
 #else
 #define SBC_ALWAYS_INLINE inline
 #endif
 
 struct sbc_encoder_state {
        int position;
+       /* Number of consecutive blocks handled by the encoder */
+       uint8_t increment;
        int16_t SBC_ALIGNED X[2][SBC_X_BUFFER_SIZE];
        /* Polyphase analysis filter for 4 subbands configuration,
-        * it handles 4 blocks at once */
-       void (*sbc_analyze_4b_4s)(int16_t *x, int32_t *out, int out_stride);
+        * it handles "increment" blocks at once */
+       void (*sbc_analyze_4s)(struct sbc_encoder_state *state,
+                       int16_t *x, int32_t *out, int out_stride);
        /* Polyphase analysis filter for 8 subbands configuration,
-        * it handles 4 blocks at once */
-       void (*sbc_analyze_4b_8s)(int16_t *x, int32_t *out, int out_stride);
+        * it handles "increment" blocks at once */
+       void (*sbc_analyze_8s)(struct sbc_encoder_state *state,
+                       int16_t *x, int32_t *out, int out_stride);
        /* Process input data (deinterleave, endian conversion, reordering),
         * depending on the number of subbands and input data byte order */
        int (*sbc_enc_process_input_4s_le)(int position,
@@ -62,6 +67,10 @@ struct sbc_encoder_state {
        void (*sbc_calc_scalefactors)(int32_t sb_sample_f[16][2][8],
                        uint32_t scale_factor[2][8],
                        int blocks, int channels, int subbands);
+       /* Scale factors calculation with joint stereo support */
+       int (*sbc_calc_scalefactors_j)(int32_t sb_sample_f[16][2][8],
+                       uint32_t scale_factor[2][8],
+                       int blocks, int subbands);
        const char *implementation_info;
 };