static int unpack_SQVH(COOKContext *q, int category, int* subband_coef_index,
                       int* subband_coef_sign) {
    int i,j;
    int vlc, vd ,tmp, result;
    vd = vd_tab[category];
    result = 0;
    for(i=0 ; i<vpr_tab[category] ; i++){
        vlc = get_vlc2(&q->gb, q->sqvh[category].table, q->sqvh[category].bits, 3);
        if (q->bits_per_subpacket < get_bits_count(&q->gb)){
            vlc = 0;
            result = 1;
        }
        for(j=vd-1 ; j>=0 ; j--){
            tmp = (vlc * invradix_tab[category])/0x100000;
            subband_coef_index[vd*i+j] = vlc - tmp * (kmax_tab[category]+1);
            vlc = tmp;
        }
        for(j=0 ; j<vd ; j++){
            if (subband_coef_index[i*vd + j]) {
                if(get_bits_count(&q->gb) < q->bits_per_subpacket){
                    subband_coef_sign[i*vd+j] = get_bits1(&q->gb);
                } else {
                    result=1;
                    subband_coef_sign[i*vd+j]=0;
                }
            } else {
                subband_coef_sign[i*vd+j]=0;
            }
        }
    }
    return result;
}
['static void decode_vectors(COOKContext* q, int* category,\n                           int *quant_index_table, float* mlt_buffer){\n    int subband_coef_index[SUBBAND_SIZE];\n    int subband_coef_sign[SUBBAND_SIZE];\n    int band, j;\n    int index=0;\n    for(band=0 ; band<q->total_subbands ; band++){\n        index = category[band];\n        if(category[band] < 7){\n            if(unpack_SQVH(q, category[band], subband_coef_index, subband_coef_sign)){\n                index=7;\n                for(j=0 ; j<q->total_subbands ; j++) category[band+j]=7;\n            }\n        }\n        if(index==7) {\n            memset(subband_coef_index, 0, sizeof(subband_coef_index));\n            memset(subband_coef_sign, 0, sizeof(subband_coef_sign));\n        }\n        q->scalar_dequant(q, index, quant_index_table[band],\n                          subband_coef_index, subband_coef_sign,\n                          &mlt_buffer[band * SUBBAND_SIZE]);\n    }\n    if(q->total_subbands*SUBBAND_SIZE >= q->samples_per_channel){\n        return;\n    }\n}', 'static int unpack_SQVH(COOKContext *q, int category, int* subband_coef_index,\n                       int* subband_coef_sign) {\n    int i,j;\n    int vlc, vd ,tmp, result;\n    vd = vd_tab[category];\n    result = 0;\n    for(i=0 ; i<vpr_tab[category] ; i++){\n        vlc = get_vlc2(&q->gb, q->sqvh[category].table, q->sqvh[category].bits, 3);\n        if (q->bits_per_subpacket < get_bits_count(&q->gb)){\n            vlc = 0;\n            result = 1;\n        }\n        for(j=vd-1 ; j>=0 ; j--){\n            tmp = (vlc * invradix_tab[category])/0x100000;\n            subband_coef_index[vd*i+j] = vlc - tmp * (kmax_tab[category]+1);\n            vlc = tmp;\n        }\n        for(j=0 ; j<vd ; j++){\n            if (subband_coef_index[i*vd + j]) {\n                if(get_bits_count(&q->gb) < q->bits_per_subpacket){\n                    subband_coef_sign[i*vd+j] = get_bits1(&q->gb);\n                } else {\n                    result=1;\n                    subband_coef_sign[i*vd+j]=0;\n                }\n            } else {\n                subband_coef_sign[i*vd+j]=0;\n            }\n        }\n    }\n    return result;\n}']