

#ifndef BANDS_H
#define BANDS_H

#include "ssc_macro.h"
#include "ssc_mode.h"
#include "rc_decode.h"
#include "ssc_pulsealloc.h"



#ifndef HW_OPTI5
void denormalise_bands(const AUDIOMode *m, const short * SSC_RESTRICT X,
	int * SSC_RESTRICT freq, const short *bandE, int end, int M);
#else
void denormalise_bands(const AUDIOMode *m, const short * X,
	int * freq, const short *bandE, int end);
#endif



void mono_band_denorm(const AUDIOMode *m, const short * X,
	int * freq, const short *bandLogE, int end);


#define ZERO_SPR       (0)
#define ONE_SPR      (1)
#define Default_SPR     (2)
#define THREE_SPR (3)



void forward_haar(short *X, int N0, int stride);






void all_subband_quantization(const AUDIOMode *m, short end,
	short * X, short * Y, unsigned char *collapse_masks, short *pulses,
	int shortBlocks, int spread, int dual_stereo, int intensity, short *tf_res,
	int total_bits, int balance, ec_ctx *ec, int codedBands, unsigned int *seed//  , short *base_norm
	);

void coll_prevent(const AUDIOMode *m, short *X_, unsigned char *collapse_masks, int size,
	short end, short *logE, short *prev1logE,
	short *prev2logE, short *pulses, unsigned int seed);



unsigned int audio_lcg_rand(unsigned int seed);

#endif /* BANDS_H */
