| 393 | */ |
| 394 | |
| 395 | static void decode_envelope(COOKContext *q, COOKSubpacket *p, int* quant_index_table) { |
| 396 | int i,j, vlc_index; |
| 397 | |
| 398 | quant_index_table[0]= get_bits(&q->gb,6) - 6; //This is used later in categorize |
| 399 | |
| 400 | for (i=1 ; i < p->total_subbands ; i++){ |
| 401 | vlc_index=i; |
| 402 | if (i >= p->js_subband_start * 2) { |
| 403 | vlc_index-=p->js_subband_start; |
| 404 | } else { |
| 405 | vlc_index/=2; |
| 406 | if(vlc_index < 1) vlc_index = 1; |
| 407 | } |
| 408 | if (vlc_index>13) vlc_index = 13; //the VLC tables >13 are identical to No. 13 |
| 409 | |
| 410 | j = get_vlc2(&q->gb, q->envelope_quant_index[vlc_index-1].table, |
| 411 | q->envelope_quant_index[vlc_index-1].bits,2); |
| 412 | quant_index_table[i] = quant_index_table[i-1] + j - 12; //differential encoding |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | /** |
| 417 | * Calculate the category and category_index vector. |
no test coverage detected