ShapePeakMagnitudeToDecibel
Converts a peak magnitude value into a decibel value.Syntax
Parameters
peakMagnitudeType: UINT32 The peak magnitude value to be converted.
Return value
Type: float The resulting decibel value.Remarks
In the audio engine of a title, managing headroom can be very difficult. For this reason, each SHAPE block maintains state associated with signal overhead and gain. Each block (except the SRC blocks) maintains whether internal saturation has occurred during processing. In addition to the internal saturation flag, each hardware block also maintains two 4-bit numbers representing the magnitude of the output of the hardware block. The magnitude is calculated by determining the peak output during the audio frame, and counting the leading zeros of the absolute value of the peak. One 4-bit number is maintained with the persistent peak magnitude; the other is reset by the hardware each audio frame. In addition to monitoring the peak magnitude of each individual hardware block, the peak magnitude of the mix buffers is also maintained. As the output of a hardware block is added to a mix buffer, the peak magnitude is calculated in the same manner (counting leading zeros). Each hardware block state maintains an additional pair of 4-bit peak-magnitude values. These values represent the peak magnitude of the mix buffer after the output of the hardware block has been accumulated into the mix buffer. One 4-bit number represents the ongoing, persistent peak magnitude; the other is updated every audio frame. The peak magnitude values are saved in the context of the SHAPE blocks, even though the mix-buffer state is actually represented. Peak magnitude is encoded according to the following table.
To help manage overhead and avoid overflow and saturation, in addition to fine-grain gain settings, a 0 to 7-bit right shift can be performed on the output of a hardware block before accumulation into the output mix buffer. This is designated in the context of each SHAPE hardware block.
Requirements
Header: shapecontexts.h Supported platforms: XBOX One family consoles and XBOX Series consolesSee also
Overview of SHAPEShapeContexts
