Commit c5f14e3a authored by vaclav's avatar vaclav
Browse files

output number of frames where Limiter is applied; under DEBUGGING

parent a3aa6460
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -792,6 +792,12 @@ int main(
    }

#ifdef DEBUGGING
    int32_t cnt_frames_limited;
    if ( ( cnt_frames_limited = IVAS_ENC_GetCntFramesLimited( hIvasEnc ) ) > 0 )
    {
        fprintf( stdout, "\nLimiter applied in %d frames.\n\n", cnt_frames_limited );
    }

    print_snr();
#endif
    /*------------------------------------------------------------------------------------------*
+23 −0
Original line number Diff line number Diff line
@@ -2417,3 +2417,26 @@ static void init_encoder_config(

    return;
}

#ifdef DEBUGGING

/*---------------------------------------------------------------------*
 * IVAS_ENC_GetCntFramesLimited()
 *
 * return number of frames where limiter is applied
 *---------------------------------------------------------------------*/

int32_t IVAS_ENC_GetCntFramesLimited(
    IVAS_ENC_HANDLE hIvasEnc /* i  : IVAS encoder handle   */
)
{
    if ( hIvasEnc->st_ivas->hLimiter == NULL )
    {
        return 0;
    }
    else
    {
        return hIvasEnc->st_ivas->hLimiter->cnt_frames_limited;
    }
}
#endif
+5 −0
Original line number Diff line number Diff line
@@ -383,6 +383,11 @@ void IVAS_ENC_PrintDisclaimer(
    void
);

#ifdef DEBUGGING
int32_t IVAS_ENC_GetCntFramesLimited(
    IVAS_ENC_HANDLE hIvasEnc                        /* i  : IVAS encoder handle                                                                                 */
);
#endif
/* clang-format on */

#endif /* LIB_ENC_H */