[non-BE] Resolve "#398 MASA direction field alignment"
- Related issues: #398 (closed)
- Requested reviewers: @vaclav
Description
This MR adds a pre-processing step into MASA metadata handling in the encoder. When the metadata contains two directions, the direction field assignment is aligned / harmonized such that the spatial direction (azimuth + elevation) in one direction field changes as as little as possible over time. The direction field assignment may be "shuffled", e.g., by tandem coding.
The pre-processing adds in the worst case 1.06 WMOPS complexity to the encoder (2dir MASA, each metadata sub-frame has the directions flipped) and +96 words of RAM usage. The decoder is not modified. The decoder complexity is reduced up to 2.1 WMOPS in the case the underlying MASA metadata uses 1sf mode (all 4 sub-frames have the same metadata) and the direction fields were shuffled in the input (without alignment encoding must use 4sf mode with potentially lower frequency resolution, but after alignment 1sf mode with potentially higher frequency resolution can be used).
The bitstreams for 2dir MASA are not BE, since the direction assignment may change, and the decoded output is not BE since the metadata encoding is not agnostic to the field assignment.