Resolve "BASOP assert in OMASA decoder with frame error"
- Related issues: #2640 (closed)
- Requested reviewers: @kiene @vasilache
Reason why this change is needed
- There is an assert present. This seems to be caused by very large difference in exponent of smoothed target power and subtract power. Such state is expected in normal operations as subtract power could be even zero or close to it when target power can be large. Float does not suffer here.
Description of the change
- Add saturation to shift operations on if and else path. The assert was on the if path but the else path could maybe hit the same situation. The saturation brings the ratio still to very safe value when considering the decisions done based on it later on.
Affected operating points
- Potential decoder and renderer non-BE (but would crash otherwise). However, the change is in extreme range of a decision variable so probably stays BE.
- MASA and OMASA with FOA/HOA output
Closes #2640 (closed)