* Fill samples for given subband */
| 126 | * Fill samples for given subband |
| 127 | */ |
| 128 | static inline void idx_to_quant(MPCContext *c, GetBitContext *gb, int idx, int *dst) |
| 129 | { |
| 130 | int i, i1, t; |
| 131 | switch(idx){ |
| 132 | case -1: |
| 133 | for(i = 0; i < SAMPLES_PER_BAND; i++){ |
| 134 | *dst++ = (av_lfg_get(&c->rnd) & 0x3FC) - 510; |
| 135 | } |
| 136 | break; |
| 137 | case 1: |
| 138 | i1 = get_bits1(gb); |
| 139 | for(i = 0; i < SAMPLES_PER_BAND/3; i++){ |
| 140 | t = get_vlc2(gb, quant_vlc[0][i1], 9, 2); |
| 141 | *dst++ = mpc7_idx30[t]; |
| 142 | *dst++ = mpc7_idx31[t]; |
| 143 | *dst++ = mpc7_idx32[t]; |
| 144 | } |
| 145 | break; |
| 146 | case 2: |
| 147 | i1 = get_bits1(gb); |
| 148 | for(i = 0; i < SAMPLES_PER_BAND/2; i++){ |
| 149 | t = get_vlc2(gb, quant_vlc[1][i1], 9, 2); |
| 150 | *dst++ = mpc7_idx50[t]; |
| 151 | *dst++ = mpc7_idx51[t]; |
| 152 | } |
| 153 | break; |
| 154 | case 3: case 4: case 5: case 6: case 7: |
| 155 | i1 = get_bits1(gb); |
| 156 | for(i = 0; i < SAMPLES_PER_BAND; i++) |
| 157 | *dst++ = get_vlc2(gb, quant_vlc[idx-1][i1], 9, 2); |
| 158 | break; |
| 159 | case 8: case 9: case 10: case 11: case 12: |
| 160 | case 13: case 14: case 15: case 16: case 17: |
| 161 | t = (1 << (idx - 2)) - 1; |
| 162 | for(i = 0; i < SAMPLES_PER_BAND; i++) |
| 163 | *dst++ = get_bits(gb, idx - 1) - t; |
| 164 | break; |
| 165 | default: // case 0 and -2..-17 |
| 166 | return; |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | static int get_scale_idx(GetBitContext *gb, int ref) |
| 171 | { |
no test coverage detected