MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DetermineStep

Function DetermineStep

AudioEncode/aencode.cpp:900–917  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

898}
899
900void DetermineStep(Encoder &enc) {
901 int32_t lo = 1;
902 int32_t hi = 0x7FFF;
903
904 do {
905 const int32_t midPoint = (lo + hi) >> 1;
906 int32_t errorAmt = calc_bits(enc, midPoint);
907 if (enc.m_threshold < errorAmt) {
908 lo = midPoint + 1;
909 } else {
910 hi = midPoint - 1;
911 }
912 } while (hi >= lo);
913
914 if (enc.m_currBlockBitValue != lo) {
915 calc_bits(enc, lo);
916 }
917}
918
919void WriteBands(Encoder &enc) {
920 enc.m_bits.WriteBits(enc.m_currBlockBitPower, 4);

Callers 1

ProcessBlockFunction · 0.85

Calls 1

calc_bitsFunction · 0.85

Tested by

no test coverage detected