Commit 64850a95 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

cleanup of qmetadata related functions

[x] Few intermediate float/fixed conversion code cleaned up.
parent a1dcd3c9
Loading
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3293,8 +3293,7 @@ void ivas_qmetadata_to_dirac_fx(
    const int32_t ivas_total_brate,                       /* i  : IVAS total bitrate              */
    const IVAS_FORMAT ivas_format,                        /* i  : IVAS format                     */
    const int16_t hodirac_flag,                           /* i  : flag to indicate HO-DirAC mode  */
    int16_t *dirac_to_spar_md_bands,                      /* o  : DirAC->SPAR MD bands            */
    Word32 q
    int16_t *dirac_to_spar_md_bands                      /* o  : DirAC->SPAR MD bands            */
);
#else
void ivas_qmetadata_to_dirac(
+45 −82

File changed.

Preview size limit exceeded, changes collapsed.

+29 −1
Original line number Diff line number Diff line
@@ -590,7 +590,35 @@ ivas_error ivas_masa_decode(
            }
        }

        ivas_qmetadata_to_dirac_fx(hQMetaData, st_ivas->hDirAC, hMasa, st_ivas->hSpatParamRendCom, ivas_total_brate, ivas_format, 0, 0, 30);
        for ( i = 0; i < st_ivas->hSpatParamRendCom->dirac_md_buffer_length; i++) {
            for ( int j = 0; j < st_ivas->hSpatParamRendCom->num_freq_bands; j++) {
                st_ivas->hSpatParamRendCom->diffuseness_vector_fx[i][j] = float_to_fix(st_ivas->hSpatParamRendCom->diffuseness_vector[i][j], 30);
                st_ivas->hSpatParamRendCom->energy_ratio1_fx[i][j] = float_to_fix(st_ivas->hSpatParamRendCom->energy_ratio1[i][j], 30);
                IF(hQMetaData->no_directions == 2)
                {
                    st_ivas->hSpatParamRendCom->energy_ratio2_fx[i][j] = float_to_fix(st_ivas->hSpatParamRendCom->energy_ratio2[i][j], 30);
                    st_ivas->hSpatParamRendCom->spreadCoherence2_fx[i][j] = float_to_fix16(st_ivas->hSpatParamRendCom->spreadCoherence2[i][j], 15);
                }
                st_ivas->hSpatParamRendCom->surroundingCoherence_fx[i][j] = float_to_fix16(st_ivas->hSpatParamRendCom->surroundingCoherence[i][j], 15);
                st_ivas->hSpatParamRendCom->spreadCoherence_fx[i][j] = float_to_fix16(st_ivas->hSpatParamRendCom->spreadCoherence[i][j], 15);
            }
        }

        ivas_qmetadata_to_dirac_fx(hQMetaData, st_ivas->hDirAC, hMasa, st_ivas->hSpatParamRendCom, ivas_total_brate, ivas_format, 0, 0);

        for ( i = 0; i < st_ivas->hSpatParamRendCom->dirac_md_buffer_length; i++) {
            for ( int j = 0; j < st_ivas->hSpatParamRendCom->num_freq_bands; j++) {
                st_ivas->hSpatParamRendCom->diffuseness_vector[i][j] = fix_to_float(st_ivas->hSpatParamRendCom->diffuseness_vector_fx[i][j], 30);
                st_ivas->hSpatParamRendCom->energy_ratio1[i][j] = fix_to_float(st_ivas->hSpatParamRendCom->energy_ratio1_fx[i][j], 30);
                IF(hQMetaData->no_directions == 2)
                {
                    st_ivas->hSpatParamRendCom->energy_ratio2[i][j] = fix_to_float(st_ivas->hSpatParamRendCom->energy_ratio2_fx[i][j], 30);
                    st_ivas->hSpatParamRendCom->spreadCoherence2[i][j] = fix_to_float(st_ivas->hSpatParamRendCom->spreadCoherence2_fx[i][j], 15);
                }
                st_ivas->hSpatParamRendCom->surroundingCoherence[i][j] = fix_to_float(st_ivas->hSpatParamRendCom->surroundingCoherence_fx[i][j], 15);
                st_ivas->hSpatParamRendCom->spreadCoherence[i][j] = fix_to_float(st_ivas->hSpatParamRendCom->spreadCoherence_fx[i][j], 15);
            }
        }
#else
        ivas_qmetadata_to_dirac( hQMetaData, st_ivas->hDirAC, hMasa, st_ivas->hSpatParamRendCom, ivas_total_brate, ivas_format, 0, 0);
#endif
+39 −39

File changed.

Preview size limit exceeded, changes collapsed.