[NON-BE] Resolve #1197 "OMASA rateswitch to PARAM_ONE_OBJ uses invalid data for the first 2sf"
- Related issues: #1197 (closed)
- Requested reviewers: @vaclav
Reason why this change is needed
When the bitrate switching in the decoder enters the OMASA mode ISM_MASA_MODE_PARAM_ONE_OBJ from another mode, the object metadata in st_ivas->hMasaIsmData is not zeroed and may contain old values. Since the reading and writing of this ringbuffer -like structure is done with an offset of 2 sub-frames the values read for the first 2 subframes are invalid. When staying in the mode, the ringbuffer content is valid.
Description of the change
In OMASA reconfiguration function, when entering ISM_MASA_MODE_PARAM_ONE_OBJ from another mode, zero the ringbuffers for object direction and energy ratio in st_ivas->hMasaIsmData.
In function ivas_omasa_preProcessStereoTransportsForEditedObjects that uses the ratio values, clip the sum to max 1.0f, since the sum of the dequantized values may exceed is by an epsilon.
Affected operating points
- Encoder and bitstream are identical with earlier state.
- Output non-BE: Differences for OMASA bitstreams containing bitrate switching to the mode
ISM_MASA_MODE_PARAM_ONE_OBJ.- An example diff between
mainand the MR. OMASA mode switch every 50 frames. Switch toISM_MASA_MODE_PARAM_ONE_OBJat frames 200, 400, 500, 800, 1000 marked with orange stems (from1sep-MASA,DISC,MASA,1sep-MASA,DISC). Red/blue is difference signal caused by the change. It is limited to the locations where the modeISM_MASA_MODE_PARAM_ONE_OBJis entered and fades out quickly.
- An example diff between
Related to #1197 (closed)
