- int i, wl_vlc_offs, ct_vlc_offs, sf_vlc_offs, tab_offset;
-
- static const int wl_nb_bits[4] = { 2, 3, 5, 5 };
- static const int wl_nb_codes[4] = { 3, 5, 8, 8 };
- static const uint8_t * const wl_bits[4] = {
- atrac3p_wl_huff_bits1, atrac3p_wl_huff_bits2,
- atrac3p_wl_huff_bits3, atrac3p_wl_huff_bits4
- };
- static const uint8_t * const wl_codes[4] = {
- atrac3p_wl_huff_code1, atrac3p_wl_huff_code2,
- atrac3p_wl_huff_code3, atrac3p_wl_huff_code4
- };
- static const uint8_t * const wl_xlats[4] = {
- atrac3p_wl_huff_xlat1, atrac3p_wl_huff_xlat2, NULL, NULL
- };
-
- static const int ct_nb_bits[4] = { 3, 4, 4, 4 };
- static const int ct_nb_codes[4] = { 4, 8, 8, 8 };
- static const uint8_t * const ct_bits[4] = {
- atrac3p_ct_huff_bits1, atrac3p_ct_huff_bits2,
- atrac3p_ct_huff_bits2, atrac3p_ct_huff_bits3
- };
- static const uint8_t * const ct_codes[4] = {
- atrac3p_ct_huff_code1, atrac3p_ct_huff_code2,
- atrac3p_ct_huff_code2, atrac3p_ct_huff_code3
- };
- static const uint8_t * const ct_xlats[4] = {
- NULL, NULL, atrac3p_ct_huff_xlat1, NULL
- };
-
- static const int sf_nb_bits[8] = { 9, 9, 9, 9, 6, 6, 7, 7 };
- static const int sf_nb_codes[8] = { 64, 64, 64, 64, 16, 16, 16, 16 };
- static const uint8_t * const sf_bits[8] = {
- atrac3p_sf_huff_bits1, atrac3p_sf_huff_bits1, atrac3p_sf_huff_bits2,
- atrac3p_sf_huff_bits3, atrac3p_sf_huff_bits4, atrac3p_sf_huff_bits4,
- atrac3p_sf_huff_bits5, atrac3p_sf_huff_bits6
- };
- static const uint16_t * const sf_codes[8] = {
- atrac3p_sf_huff_code1, atrac3p_sf_huff_code1, atrac3p_sf_huff_code2,
- atrac3p_sf_huff_code3, atrac3p_sf_huff_code4, atrac3p_sf_huff_code4,
- atrac3p_sf_huff_code5, atrac3p_sf_huff_code6
- };
- static const uint8_t * const sf_xlats[8] = {
- atrac3p_sf_huff_xlat1, atrac3p_sf_huff_xlat2, NULL, NULL,
- atrac3p_sf_huff_xlat4, atrac3p_sf_huff_xlat5, NULL, NULL
- };
-
- static const uint8_t * const gain_cbs[11] = {
- atrac3p_huff_gain_npoints1_cb, atrac3p_huff_gain_npoints1_cb,
- atrac3p_huff_gain_lev1_cb, atrac3p_huff_gain_lev2_cb,
- atrac3p_huff_gain_lev3_cb, atrac3p_huff_gain_lev4_cb,
- atrac3p_huff_gain_loc3_cb, atrac3p_huff_gain_loc1_cb,
- atrac3p_huff_gain_loc4_cb, atrac3p_huff_gain_loc2_cb,
- atrac3p_huff_gain_loc5_cb
- };
- static const uint8_t * const gain_xlats[11] = {
- NULL, atrac3p_huff_gain_npoints2_xlat, atrac3p_huff_gain_lev1_xlat,
- atrac3p_huff_gain_lev2_xlat, atrac3p_huff_gain_lev3_xlat,
- atrac3p_huff_gain_lev4_xlat, atrac3p_huff_gain_loc3_xlat,
- atrac3p_huff_gain_loc1_xlat, atrac3p_huff_gain_loc4_xlat,
- atrac3p_huff_gain_loc2_xlat, atrac3p_huff_gain_loc5_xlat
- };
-
- static const uint8_t * const tone_cbs[7] = {
- atrac3p_huff_tonebands_cb, atrac3p_huff_numwavs1_cb,
- atrac3p_huff_numwavs2_cb, atrac3p_huff_wav_ampsf1_cb,
- atrac3p_huff_wav_ampsf2_cb, atrac3p_huff_wav_ampsf3_cb,
- atrac3p_huff_freq_cb
- };
- static const uint8_t * const tone_xlats[7] = {
- NULL, NULL, atrac3p_huff_numwavs2_xlat, atrac3p_huff_wav_ampsf1_xlat,
- atrac3p_huff_wav_ampsf2_xlat, atrac3p_huff_wav_ampsf3_xlat,
- atrac3p_huff_freq_xlat
- };
-
- for (i = 0, wl_vlc_offs = 0, ct_vlc_offs = 2508; i < 4; i++) {
- wl_vlc_tabs[i].table = &tables_data[wl_vlc_offs];
- wl_vlc_tabs[i].table_allocated = 1 << wl_nb_bits[i];
- ct_vlc_tabs[i].table = &tables_data[ct_vlc_offs];
- ct_vlc_tabs[i].table_allocated = 1 << ct_nb_bits[i];
-
- ff_init_vlc_sparse(&wl_vlc_tabs[i], wl_nb_bits[i], wl_nb_codes[i],
- wl_bits[i], 1, 1,
- wl_codes[i], 1, 1,
- wl_xlats[i], 1, 1,
- INIT_VLC_USE_NEW_STATIC);
-
- ff_init_vlc_sparse(&ct_vlc_tabs[i], ct_nb_bits[i], ct_nb_codes[i],
- ct_bits[i], 1, 1,
- ct_codes[i], 1, 1,
- ct_xlats[i], 1, 1,
- INIT_VLC_USE_NEW_STATIC);
-
- wl_vlc_offs += wl_vlc_tabs[i].table_allocated;
- ct_vlc_offs += ct_vlc_tabs[i].table_allocated;