eptr = ptr + nb_coefs[ch];
memset(ptr, 0, pwd->block_len * sizeof(int16_t));
for (;;) {
- code =
- get_vlc(&pwd->gb, coef_vlc->table, VLCBITS,
- VLCMAX);
+ code = get_vlc(&pwd->gb, coef_vlc->table,
+ VLCBITS, VLCMAX);
if (code < 0)
return -1;
- if (code == 1) {
- /* EOB */
+ if (code == 1) /* EOB */
break;
- } else if (code == 0) {
- /* escape */
+ if (code == 0) { /* escape */
level = get_bits(&pwd->gb, coef_nb_bits);
- /* NOTE: this is rather suboptimal. reading
- block_len_bits would be better */
- run =
- get_bits(&pwd->gb, pwd->frame_len_bits);
- } else {
- /* normal code */
+ /* reading block_len_bits would be better */
+ run = get_bits(&pwd->gb, pwd->frame_len_bits);
+ } else { /* normal code */
run = run_table[code];
level = level_table[code];
}
break;
}
*ptr++ = level;
- /* NOTE: EOB can be omitted */
- if (ptr >= eptr)
+ if (ptr >= eptr) /* EOB can be omitted */
break;
}
}