Lines Matching defs:chd
159 ChannelData chd[2];
176 static int16_t read_table(ChannelData *chd, uint8_t val, int tab_idx)
181 current = tabs[tab_idx].tab2[((chd->index & 0x7f0) >> 4) * tabs[tab_idx].stride + val];
183 current = - 1 - tabs[tab_idx].tab2[((chd->index & 0x7f0) >> 4)*tabs[tab_idx].stride + 2*tabs[tab_idx].stride-val-1];
185 if (( chd->index += tabs[tab_idx].tab1[val]-(chd->index >> 5) ) < 0)
186 chd->index = 0;
191 static void chomp3(ChannelData *chd, int16_t *output, uint8_t val, int tab_idx)
193 int16_t current = read_table(chd, val, tab_idx);
195 current = mace_broken_clip_int16(current + chd->level);
197 chd->level = current - (current >> 3);
201 static void chomp6(ChannelData *chd, int16_t *output, uint8_t val, int tab_idx)
203 int16_t current = read_table(chd, val, tab_idx);
205 if ((chd->previous ^ current) >= 0) {
206 chd->factor = FFMIN(chd->factor + 506, 32767);
208 if (chd->factor - 314 < -32768)
209 chd->factor = -32767;
211 chd->factor -= 314;
214 current = mace_broken_clip_int16(current + chd->level);
216 chd->level = (current*chd->factor) >> 15;
219 output[0] = QT_8S_2_16S(chd->previous + chd->prev2 -
220 ((chd->prev2-current) >> 2));
221 output[1] = QT_8S_2_16S(chd->previous + current +
222 ((chd->prev2-current) >> 2));
223 chd->prev2 = chd->previous;
224 chd->previous = current;
273 chomp3(&ctx->chd[i], output, val[1][l], l);
275 chomp6(&ctx->chd[i], output, val[0][l], l);