#ifndef __layer12_h
#define __layer12_h

typedef unsigned char    al_table[SBLIMIT][16];

typedef struct
{
	const al_table* alloc;   // bit allocation table used
	unsigned int    tab_num; // index of allocation table used
	unsigned int    jsbound; // first subband of joint stereo coding
	unsigned int    sblimit; // total number of subbands
	int             fraction[2][3][SBLIMIT];
	unsigned char   bit_alloc[2*SBLIMIT];
	unsigned char   scale_index[3][2*SBLIMIT];
} layer12;

void init_layer12(layer12*);

#endif
