FACT++  1.0
bool StateMachineRateControl::Step ( int  idx,
float  step 
)
inlineprivate

Definition at line 140 of file ratecontrol.cc.

141  {
142  uint32_t diff = fThresholds[idx]+int16_t(truncf(step));
143  if (diff<fThresholdMin)
144  diff=fThresholdMin;
145  if (diff>0xffff)
146  diff = 0xffff;
147 
148  if (diff==fThresholds[idx])
149  return false;
150 
151  if (fVerbose)
152  {
153  Out() << "Apply: Patch " << setw(3) << idx << " [" << idx/40 << "|" << (idx/4)%10 << "|" << idx%4 << "]";
154  Out() << (step>0 ? " += " : " -= ");
155  Out() << fabs(step) << " (old=" << fThresholds[idx] << ", new=" << diff << ")" << endl;
156  }
157 
158  fThresholds[idx] = diff;
159  fBlock[idx/4] = true;
160 
161  return true;
162  }
vector< bool > fBlock
Definition: ratecontrol.cc:54
std::ostream & Out() const
Definition: MessageImp.h:73
vector< uint32_t > fThresholds
Definition: ratecontrol.cc:98