| 557 | } |
| 558 | |
| 559 | float decodepitch(int r) |
| 560 | { |
| 561 | const int thres = (1 << 22) + (1 << 22) / 3; |
| 562 | r = (r << (24 - PITCHBITS)) - (1 << 23); |
| 563 | if(r > thres) r = r * 4 - thres * 3; |
| 564 | else if(r < -thres) r = r * 4 + thres * 3; |
| 565 | float p = float(r) * MAXPITCH / (1 << 24); |
| 566 | return clamp(p, -MAXPITCH, MAXPITCH); |
| 567 | } |
| 568 | |
| 569 | int encodeyaw(float y) // yaw value quantisation: simple rounded integer |
| 570 | { |
no outgoing calls
no test coverage detected