Lines Matching refs:sb
979 int sb, i, delta, delta_bits, min_val, pred; in decode_gainc_levels() local
985 for (sb = 0; sb < coded_subbands; sb++) in decode_gainc_levels()
986 for (i = 0; i < chan->gain_data[sb].num_points; i++) in decode_gainc_levels()
987 chan->gain_data[sb].lev_code[i] = get_bits(gb, 4); in decode_gainc_levels()
991 for (sb = 0; sb < coded_subbands; sb++) in decode_gainc_levels()
992 for (i = 0; i < chan->gain_data[sb].num_points; i++) { in decode_gainc_levels()
995 pred = (i >= ref_chan->gain_data[sb].num_points) in decode_gainc_levels()
996 ? 7 : ref_chan->gain_data[sb].lev_code[i]; in decode_gainc_levels()
997 chan->gain_data[sb].lev_code[i] = (pred + delta) & 0xF; in decode_gainc_levels()
1000 for (sb = 0; sb < coded_subbands; sb++) in decode_gainc_levels()
1001 gainc_level_mode1m(gb, ctx, &chan->gain_data[sb]); in decode_gainc_levels()
1006 for (sb = 0; sb < coded_subbands; sb++) in decode_gainc_levels()
1007 if (chan->gain_data[sb].num_points > 0) { in decode_gainc_levels()
1009 gainc_level_mode1m(gb, ctx, &chan->gain_data[sb]); in decode_gainc_levels()
1011 gainc_level_mode3s(&chan->gain_data[sb], in decode_gainc_levels()
1012 &ref_chan->gain_data[sb]); in decode_gainc_levels()
1018 for (sb = 1; sb < coded_subbands; sb++) in decode_gainc_levels()
1019 for (i = 0; i < chan->gain_data[sb].num_points; i++) { in decode_gainc_levels()
1022 pred = (i >= chan->gain_data[sb - 1].num_points) in decode_gainc_levels()
1023 ? 7 : chan->gain_data[sb - 1].lev_code[i]; in decode_gainc_levels()
1024 chan->gain_data[sb].lev_code[i] = (pred + delta) & 0xF; in decode_gainc_levels()
1030 for (sb = 0; sb < coded_subbands; sb++) in decode_gainc_levels()
1031 gainc_level_mode3s(&chan->gain_data[sb], in decode_gainc_levels()
1032 &ref_chan->gain_data[sb]); in decode_gainc_levels()
1037 for (sb = 0; sb < coded_subbands; sb++) in decode_gainc_levels()
1038 for (i = 0; i < chan->gain_data[sb].num_points; i++) { in decode_gainc_levels()
1039 chan->gain_data[sb].lev_code[i] = min_val + get_bitsz(gb, delta_bits); in decode_gainc_levels()
1040 if (chan->gain_data[sb].lev_code[i] > 15) in decode_gainc_levels()
1117 int sb, i, delta, delta_bits, min_val, pred, more_than_ref; in decode_gainc_loc_codes() local
1125 for (sb = 0; sb < coded_subbands; sb++) in decode_gainc_loc_codes()
1126 for (i = 0; i < chan->gain_data[sb].num_points; i++) in decode_gainc_loc_codes()
1127 gainc_loc_mode0(gb, ctx, &chan->gain_data[sb], i); in decode_gainc_loc_codes()
1131 for (sb = 0; sb < coded_subbands; sb++) { in decode_gainc_loc_codes()
1132 if (chan->gain_data[sb].num_points <= 0) in decode_gainc_loc_codes()
1134 dst = &chan->gain_data[sb]; in decode_gainc_loc_codes()
1135 ref = &ref_chan->gain_data[sb]; in decode_gainc_loc_codes()
1170 for (sb = 0; sb < coded_subbands; sb++) in decode_gainc_loc_codes()
1171 gainc_loc_mode1(gb, ctx, &chan->gain_data[sb]); in decode_gainc_loc_codes()
1175 for (sb = 0; sb < coded_subbands; sb++) { in decode_gainc_loc_codes()
1176 if (chan->gain_data[sb].num_points <= 0) in decode_gainc_loc_codes()
1178 dst = &chan->gain_data[sb]; in decode_gainc_loc_codes()
1179 ref = &ref_chan->gain_data[sb]; in decode_gainc_loc_codes()
1183 for (i = 0; i < chan->gain_data[sb].num_points; i++) in decode_gainc_loc_codes()
1191 for (sb = 1; sb < coded_subbands; sb++) { in decode_gainc_loc_codes()
1192 if (chan->gain_data[sb].num_points <= 0) in decode_gainc_loc_codes()
1194 dst = &chan->gain_data[sb]; in decode_gainc_loc_codes()
1221 for (sb = 0; sb < coded_subbands; sb++) in decode_gainc_loc_codes()
1222 for (i = 0; i < chan->gain_data[sb].num_points; i++) { in decode_gainc_loc_codes()
1223 if (i >= ref_chan->gain_data[sb].num_points) in decode_gainc_loc_codes()
1224 gainc_loc_mode0(gb, ctx, &chan->gain_data[sb], i); in decode_gainc_loc_codes()
1226 chan->gain_data[sb].loc_code[i] = in decode_gainc_loc_codes()
1227 ref_chan->gain_data[sb].loc_code[i]; in decode_gainc_loc_codes()
1233 for (sb = 0; sb < coded_subbands; sb++) in decode_gainc_loc_codes()
1234 for (i = 0; i < chan->gain_data[sb].num_points; i++) in decode_gainc_loc_codes()
1235 chan->gain_data[sb].loc_code[i] = min_val + i + in decode_gainc_loc_codes()
1242 for (sb = 0; sb < coded_subbands; sb++) { in decode_gainc_loc_codes()
1243 dst = &chan->gain_data[sb]; in decode_gainc_loc_codes()
1244 for (i = 0; i < chan->gain_data[sb].num_points; i++) { in decode_gainc_loc_codes()
1249 ch_num, sb, i, dst->loc_code[i]); in decode_gainc_loc_codes()
1270 int ch_num, coded_subbands, sb, ret; in decode_gainc_data() local
1289 for (sb = coded_subbands; sb < ctx->channels[ch_num].num_gain_subbands; sb++) in decode_gainc_data()
1290 ctx->channels[ch_num].gain_data[sb] = in decode_gainc_data()
1291 ctx->channels[ch_num].gain_data[sb - 1]; in decode_gainc_data()
1313 int sb; in decode_tones_envelope() local
1318 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) { in decode_tones_envelope()
1319 if (!band_has_tones[sb]) in decode_tones_envelope()
1321 dst[sb].pend_env.has_start_point = get_bits1(gb); in decode_tones_envelope()
1322 dst[sb].pend_env.start_pos = dst[sb].pend_env.has_start_point in decode_tones_envelope()
1324 dst[sb].pend_env.has_stop_point = get_bits1(gb); in decode_tones_envelope()
1325 dst[sb].pend_env.stop_pos = dst[sb].pend_env.has_stop_point in decode_tones_envelope()
1329 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) { in decode_tones_envelope()
1330 if (!band_has_tones[sb]) in decode_tones_envelope()
1332 dst[sb].pend_env.has_start_point = ref[sb].pend_env.has_start_point; in decode_tones_envelope()
1333 dst[sb].pend_env.has_stop_point = ref[sb].pend_env.has_stop_point; in decode_tones_envelope()
1334 dst[sb].pend_env.start_pos = ref[sb].pend_env.start_pos; in decode_tones_envelope()
1335 dst[sb].pend_env.stop_pos = ref[sb].pend_env.stop_pos; in decode_tones_envelope()
1355 int mode, sb, delta; in decode_band_numwavs() local
1362 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) in decode_band_numwavs()
1363 if (band_has_tones[sb]) in decode_band_numwavs()
1364 dst[sb].num_wavs = get_bits(gb, 4); in decode_band_numwavs()
1367 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) in decode_band_numwavs()
1368 if (band_has_tones[sb]) in decode_band_numwavs()
1369 dst[sb].num_wavs = in decode_band_numwavs()
1374 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) in decode_band_numwavs()
1375 if (band_has_tones[sb]) { in decode_band_numwavs()
1379 dst[sb].num_wavs = (ref[sb].num_wavs + delta) & 0xF; in decode_band_numwavs()
1383 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) in decode_band_numwavs()
1384 if (band_has_tones[sb]) in decode_band_numwavs()
1385 dst[sb].num_wavs = ref[sb].num_wavs; in decode_band_numwavs()
1390 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) in decode_band_numwavs()
1391 if (band_has_tones[sb]) { in decode_band_numwavs()
1392 if (ctx->waves_info->tones_index + dst[sb].num_wavs > 48) { in decode_band_numwavs()
1395 ctx->waves_info->tones_index + dst[sb].num_wavs, in decode_band_numwavs()
1399 dst[sb].start_index = ctx->waves_info->tones_index; in decode_band_numwavs()
1400 ctx->waves_info->tones_index += dst[sb].num_wavs; in decode_band_numwavs()
1418 int sb, i, direction, nbits, pred, delta; in decode_tones_frequency() local
1424 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) { in decode_tones_frequency()
1425 if (!band_has_tones[sb] || !dst[sb].num_wavs) in decode_tones_frequency()
1427 iwav = &ctx->waves_info->waves[dst[sb].start_index]; in decode_tones_frequency()
1428 direction = (dst[sb].num_wavs > 1) ? get_bits1(gb) : 0; in decode_tones_frequency()
1430 if (dst[sb].num_wavs) in decode_tones_frequency()
1431 iwav[dst[sb].num_wavs - 1].freq_index = get_bits(gb, 10); in decode_tones_frequency()
1432 for (i = dst[sb].num_wavs - 2; i >= 0 ; i--) { in decode_tones_frequency()
1437 for (i = 0; i < dst[sb].num_wavs; i++) { in decode_tones_frequency()
1449 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) { in decode_tones_frequency()
1450 if (!band_has_tones[sb] || !dst[sb].num_wavs) in decode_tones_frequency()
1452 iwav = &ctx->waves_info->waves[ref[sb].start_index]; in decode_tones_frequency()
1453 owav = &ctx->waves_info->waves[dst[sb].start_index]; in decode_tones_frequency()
1454 for (i = 0; i < dst[sb].num_wavs; i++) { in decode_tones_frequency()
1458 pred = (i < ref[sb].num_wavs) ? iwav[i].freq_index : in decode_tones_frequency()
1459 (ref[sb].num_wavs ? iwav[ref[sb].num_wavs - 1].freq_index : 0); in decode_tones_frequency()
1478 int mode, sb, j, i, diff, maxdiff, fi, delta, pred; in decode_tones_amplitude() local
1485 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) { in decode_tones_amplitude()
1486 if (!band_has_tones[sb] || !dst[sb].num_wavs) in decode_tones_amplitude()
1488 wsrc = &ctx->waves_info->waves[dst[sb].start_index]; in decode_tones_amplitude()
1489 wref = &ctx->waves_info->waves[ref[sb].start_index]; in decode_tones_amplitude()
1490 for (j = 0; j < dst[sb].num_wavs; j++) { in decode_tones_amplitude()
1491 for (i = 0, fi = 0, maxdiff = 1024; i < ref[sb].num_wavs; i++) { in decode_tones_amplitude()
1500 refwaves[dst[sb].start_index + j] = fi + ref[sb].start_index; in decode_tones_amplitude()
1501 else if (j < ref[sb].num_wavs) in decode_tones_amplitude()
1502 refwaves[dst[sb].start_index + j] = j + ref[sb].start_index; in decode_tones_amplitude()
1504 refwaves[dst[sb].start_index + j] = -1; in decode_tones_amplitude()
1513 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) { in decode_tones_amplitude()
1514 if (!band_has_tones[sb] || !dst[sb].num_wavs) in decode_tones_amplitude()
1517 for (i = 0; i < dst[sb].num_wavs; i++) in decode_tones_amplitude()
1518 ctx->waves_info->waves[dst[sb].start_index + i].amp_sf = get_bits(gb, 6); in decode_tones_amplitude()
1520 ctx->waves_info->waves[dst[sb].start_index].amp_sf = get_bits(gb, 6); in decode_tones_amplitude()
1524 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) { in decode_tones_amplitude()
1525 if (!band_has_tones[sb] || !dst[sb].num_wavs) in decode_tones_amplitude()
1528 for (i = 0; i < dst[sb].num_wavs; i++) in decode_tones_amplitude()
1529 ctx->waves_info->waves[dst[sb].start_index + i].amp_sf = in decode_tones_amplitude()
1533 ctx->waves_info->waves[dst[sb].start_index].amp_sf = in decode_tones_amplitude()
1539 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) { in decode_tones_amplitude()
1540 if (!band_has_tones[sb] || !dst[sb].num_wavs) in decode_tones_amplitude()
1542 for (i = 0; i < dst[sb].num_wavs; i++) { in decode_tones_amplitude()
1546 pred = refwaves[dst[sb].start_index + i] >= 0 ? in decode_tones_amplitude()
1547 ctx->waves_info->waves[refwaves[dst[sb].start_index + i]].amp_sf : 34; in decode_tones_amplitude()
1548 ctx->waves_info->waves[dst[sb].start_index + i].amp_sf = (pred + delta) & 0x3F; in decode_tones_amplitude()
1553 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) { in decode_tones_amplitude()
1554 if (!band_has_tones[sb]) in decode_tones_amplitude()
1556 for (i = 0; i < dst[sb].num_wavs; i++) in decode_tones_amplitude()
1557 ctx->waves_info->waves[dst[sb].start_index + i].amp_sf = in decode_tones_amplitude()
1558 refwaves[dst[sb].start_index + i] >= 0 in decode_tones_amplitude()
1559 ? ctx->waves_info->waves[refwaves[dst[sb].start_index + i]].amp_sf in decode_tones_amplitude()
1578 int sb, i; in decode_tones_phase() local
1582 for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) { in decode_tones_phase()
1583 if (!band_has_tones[sb]) in decode_tones_phase()
1585 wparam = &ctx->waves_info->waves[dst[sb].start_index]; in decode_tones_phase()
1586 for (i = 0; i < dst[sb].num_wavs; i++) in decode_tones_phase()