Skip to content

Floating-point leftovers: lib_enc/lib_enc_fx.c, IVAS_ENC_FeedObjectMetadata()

Bug description

In IVAS_ENC_FeedObjectMetadata() there is a block of code which apparently converts floating-point object metadata into fixed-point representation:

Word32 azimuth_fx = float_to_fix( metadata.azimuth, Q22 );     /* Q22 */
Word32 elevation_fx = float_to_fix( metadata.elevation, Q22 ); /* Q22 */
Word16 radius_fx = float_to_fix16( metadata.radius, Q9 );      /* Q9 */
Word32 yaw_fx = float_to_fix( metadata.yaw, Q22 );             /* Q22 */
Word32 pitch_fx = float_to_fix( metadata.pitch, Q22 );         /* Q22 */

The struct IVAS_ISM_METADATA has apparently both representations - fx and fl, so it's strange that the floating-point values are used:

typedef struct _IVAS_ISM_METADATA
{
    Word32 azimuth_fx;    /* Q22 */
    Word32 elevation_fx;  /* Q22 */
    Word16 radius_fx;     /* Q9 */
    Word32 spread_fx;     /* Q22 */
    Word32 gainFactor_fx; /* Q31 */
    Word32 yaw_fx;        /* Q22 */
    Word32 pitch_fx;      /* Q22 */
    float azimuth;
    float elevation;
    float radius;
    float spread;
    float gainFactor;
    float yaw;
    float pitch;
    Word16 non_diegetic_flag;

} IVAS_ISM_METADATA;