Lines Matching refs:chd
157 ChannelData chd[2];
174 static int16_t read_table(ChannelData *chd, uint8_t val, int tab_idx)
179 current = tabs[tab_idx].tab2[((chd->index & 0x7f0) >> 4) * tabs[tab_idx].stride + val];
181 current = - 1 - tabs[tab_idx].tab2[((chd->index & 0x7f0) >> 4)*tabs[tab_idx].stride + 2*tabs[tab_idx].stride-val-1];
183 if (( chd->index += tabs[tab_idx].tab1[val]-(chd->index >> 5) ) < 0)
184 chd->index = 0;
189 static void chomp3(ChannelData *chd, int16_t *output, uint8_t val,
194 int16_t current = read_table(chd, val, tab_idx);
196 current = mace_broken_clip_int16(current + chd->level);
198 chd->level = current - (current >> 3);
202 static void chomp6(ChannelData *chd, int16_t *output, uint8_t val,
206 int16_t current = read_table(chd, val, tab_idx);
208 if ((chd->previous ^ current) >= 0) {
209 chd->factor = FFMIN(chd->factor + 506, 32767);
211 if (chd->factor - 314 < -32768)
212 chd->factor = -32767;
214 chd->factor -= 314;
217 current = mace_broken_clip_int16(current + chd->level);
219 chd->level = (current*chd->factor) >> 15;
222 output[0] = QT_8S_2_16S(chd->previous + chd->prev2 -
223 ((chd->prev2-current) >> 2));
224 output[numChannels] = QT_8S_2_16S(chd->previous + current +
225 ((chd->prev2-current) >> 2));
226 chd->prev2 = chd->previous;
227 chd->previous = current;
275 chomp3(&ctx->chd[i], output, val[1][l], l,
278 chomp6(&ctx->chd[i], output, val[0][l], l,