src/main/java/net/sourceforge/jaad/aac/sbr/SBR.java
private void sbr_envelope(IBitStream ld, int ch) throws AACException {
		int env, band;
		int delta = 0;
		int[][] t_huff, f_huff;

		if((this.L_E[ch]==1)&&(this.bs_frame_class[ch]==FIXFIX))
			this.amp_res[ch] = false;
		else
			this.amp_res[ch] = this.bs_amp_res;

		if((this.bs_coupling)&&(ch==1)) {
			delta = 1;
			if(this.amp_res[ch]) {
				t_huff = T_HUFFMAN_ENV_BAL_3_0DB;
				f_huff = F_HUFFMAN_ENV_BAL_3_0DB;
			}
			else {
				t_huff = T_HUFFMAN_ENV_BAL_1_5DB;
				f_huff = F_HUFFMAN_ENV_BAL_1_5DB;
			}
		}
		else {
			delta = 0;
			if(this.amp_res[ch]) {
				t_huff = T_HUFFMAN_ENV_3_0DB;
				f_huff = F_HUFFMAN_ENV_3_0DB;
			}
			else {
				t_huff = T_HUFFMAN_ENV_1_5DB;
				f_huff = F_HUFFMAN_ENV_1_5DB;
			}
		}

		for(env = 0; env<this.L_E[ch]; env++) {
			if(this.bs_df_env[ch][env]==0) {
				if(this.bs_coupling&&(ch==1)) {
					if(this.amp_res[ch]) {
						this.E[ch][0][env] = ld.readBits(5)<<delta;
					}
					else {
						this.E[ch][0][env] = ld.readBits(6)<<delta;
					}
				}
				else {
					if(this.amp_res[ch]) {
						this.E[ch][0][env] = ld.readBits(6)<<delta;
					}
					else {
						this.E[ch][0][env] = ld.readBits(7)<<delta;
					}
				}

				for(band = 1; band<this.n[this.f[ch][env]]; band++) {
					this.E[ch][band][env] = (decodeHuffman(ld, f_huff)<<delta);
				}

			}
			else {
				for(band = 0; band<this.n[this.f[ch][env]]; band++) {
					this.E[ch][band][env] = (decodeHuffman(ld, t_huff)<<delta);
				}
			}
		}

		NoiseEnvelope.extract_envelope_data(this, ch);
	}
private void sbr_envelope(IBitStream ld, int ch) throws AACException {
		int env, band;
		int delta = 0;
		int[][] t_huff, f_huff;

		if((this.L_E[ch]==1)&&(this.bs_frame_class[ch]==FIXFIX))
			this.amp_res[ch] = false;
		else
			this.amp_res[ch] = this.bs_amp_res;

		if((this.bs_coupling)&&(ch==1)) {
			delta = 1;
			if(this.amp_res[ch]) {
				t_huff = T_HUFFMAN_ENV_BAL_3_0DB;
				f_huff = F_HUFFMAN_ENV_BAL_3_0DB;
			}
			else {
				t_huff = T_HUFFMAN_ENV_BAL_1_5DB;
				f_huff = F_HUFFMAN_ENV_BAL_1_5DB;
			}
		}
		else {
			delta = 0;
			if(this.amp_res[ch]) {
				t_huff = T_HUFFMAN_ENV_3_0DB;
				f_huff = F_HUFFMAN_ENV_3_0DB;
			}
			else {
				t_huff = T_HUFFMAN_ENV_1_5DB;
				f_huff = F_HUFFMAN_ENV_1_5DB;
			}
		}

		for(env = 0; env<this.L_E[ch]; env++) {
			if(this.bs_df_env[ch][env]==0) {
				if(this.bs_coupling&&(ch==1)) {
					if(this.amp_res[ch]) {
						this.E[ch][0][env] = ld.readBits(5)<<delta;
					}
					else {
						this.E[ch][0][env] = ld.readBits(6)<<delta;
					}
				}
				else {
					if(this.amp_res[ch]) {
						this.E[ch][0][env] = ld.readBits(6)<<delta;
					}
					else {
						this.E[ch][0][env] = ld.readBits(7)<<delta;
					}
				}

				for(band = 1; band<this.n[this.f[ch][env]]; band++) {
					this.E[ch][band][env] = (decodeHuffman(ld, f_huff)<<delta);
				}

			}
			else {
				for(band = 0; band<this.n[this.f[ch][env]]; band++) {
					this.E[ch][band][env] = (decodeHuffman(ld, t_huff)<<delta);
				}
			}
		}

		NoiseEnvelope.extract_envelope_data(this, ch);
	}
private void sbr_envelope ( IBitStream ld , int ch ) throws AACException { int env , band ; int delta = 0 ; int [ ] [ ] t_huff , f_huff ; if ( ( this . L_E [ ch ] == 1 ) && ( this . bs_frame_class [ ch ] == FIXFIX ) ) this . amp_res [ ch ] = false ; else this . amp_res [ ch ] = this . bs_amp_res ; if ( ( this . bs_coupling ) && ( ch == 1 ) ) { delta = 1 ; if ( this . amp_res [ ch ] ) { t_huff = T_HUFFMAN_ENV_BAL_3_0DB ; f_huff = F_HUFFMAN_ENV_BAL_3_0DB ; } else { t_huff = T_HUFFMAN_ENV_BAL_1_5DB ; f_huff = F_HUFFMAN_ENV_BAL_1_5DB ; } } else { delta = 0 ; if ( this . amp_res [ ch ] ) { t_huff = T_HUFFMAN_ENV_3_0DB ; f_huff = F_HUFFMAN_ENV_3_0DB ; } else { t_huff = T_HUFFMAN_ENV_1_5DB ; f_huff = F_HUFFMAN_ENV_1_5DB ; } } for ( env = 0 ; env < this . L_E [ ch ] ; env ++ ) { if ( this . bs_df_env [ ch ] [ env ] == 0 ) { if ( this . bs_coupling && ( ch == 1 ) ) { if ( this . amp_res [ ch ] ) { this . E [ ch ] [ 0 ] [ env ] = ld . readBits ( 5 ) << delta ; } else { this . E [ ch ] [ 0 ] [ env ] = ld . readBits ( 6 ) << delta ; } } else { if ( this . amp_res [ ch ] ) { this . E [ ch ] [ 0 ] [ env ] = ld . readBits ( 6 ) << delta ; } else { this . E [ ch ] [ 0 ] [ env ] = ld . readBits ( 7 ) << delta ; } } for ( band = 1 ; band < this . n [ this . f [ ch ] [ env ] ] ; band ++ ) { this . E [ ch ] [ band ] [ env ] = ( decodeHuffman ( ld , f_huff ) << delta ) ; } } else { for ( band = 0 ; band < this . n [ this . f [ ch ] [ env ] ] ; band ++ ) { this . E [ ch ] [ band ] [ env ] = ( decodeHuffman ( ld , t_huff ) << delta ) ; } } } NoiseEnvelope . extract_envelope_data ( this , ch ) ; }
/* table 10
/ * table 10