Commit 0b10348c authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[strip] LC3PLUS_DEC_COLLECT_STATS

parent 90d8fa27
Loading
Loading
Loading
Loading
+0 −49
Original line number Diff line number Diff line
@@ -75,13 +75,6 @@ ivas_error IVAS_LC3PLUS_DEC_Open(
#endif
    numLC3plusFramesPerIvasFrame = (int16_t) ( config.ivas_frame_duration_us / config.lc3plus_frame_duration_us );

#ifdef LC3PLUS_DEC_COLLECT_STATS
    ( *handle )->stats.action_histogram[DEC_ACTION_DECODE_AND_DROP] = 0;
    ( *handle )->stats.action_histogram[DEC_ACTION_DECODE_AND_USE] = 0;
    ( *handle )->stats.action_histogram[DEC_ACTION_SKIP] = 0;
    ( *handle )->stats.action_histogram[DEC_ACTION_CACHE] = 0;
    ( *handle )->stats.num_cached_frames_decoded_and_dropped = 0;
#endif

    ( *handle )->num_decs = 0;
    ( *handle )->pcm_conversion_buffer = NULL;
@@ -456,9 +449,6 @@ void IVAS_LC3PLUS_DEC_Close(
    {
        return;
    }
#ifdef LC3PLUS_DEC_COLLECT_STATS
    printLC3plusDecStats( &( *handle )->stats );
#endif
    for ( uint32_t iDec = 0; iDec < ( *handle )->num_decs; iDec++ )
    {
        if ( NULL != ( *handle )->handles && NULL != ( *handle )->handles[iDec] )
@@ -604,9 +594,6 @@ static ivas_error IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal(
                }
                handle->selective_decoding_states[iDec]->shall_decode_cached_frame = 0;
                handle->selective_decoding_states[iDec]->has_skipped_a_frame = 0;
#ifdef LC3PLUS_DEC_COLLECT_STATS
                handle->stats.num_cached_frames_decoded_and_dropped++;
#endif
            }

            /* reset cache if caching is enabled - it has either been decoded or is not needed */
@@ -614,9 +601,6 @@ static ivas_error IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal(
            {
                handle->bitstream_caches[iDec]->bitstream_cache_size = 0;
            }
#ifdef LC3PLUS_DEC_COLLECT_STATS
            handle->stats.action_histogram[handle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame]]++;
#endif
            switch ( handle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] )
            {
                case DEC_ACTION_DECODE_AND_DROP:
@@ -747,36 +731,3 @@ ivas_error IVAS_LC3PLUS_DEC_Conceal(
}

#ifdef LC3PLUS_DEC_COLLECT_STATS
void printLC3plusDecStats( const IVAS_LC3PLUS_DEC_COLLECT_STATS *stats )
{
    int32_t sum_pushed_frames = 0;
    int32_t sum_decoded_and_dropped_frames, sum_skipped_frames;

    sum_pushed_frames = stats->action_histogram[DEC_ACTION_DECODE_AND_USE] + stats->action_histogram[DEC_ACTION_SKIP] + stats->action_histogram[DEC_ACTION_CACHE];

    sum_decoded_and_dropped_frames =
        stats->action_histogram[DEC_ACTION_DECODE_AND_DROP] + stats->num_cached_frames_decoded_and_dropped;

    sum_skipped_frames = stats->action_histogram[DEC_ACTION_SKIP] + stats->action_histogram[DEC_ACTION_CACHE];

    if ( sum_pushed_frames == 0 )
    {
        printf( "\n Dec didn't run" );
        return;
    }

    printf( "\nsum_pushed_frames: %i\n", sum_pushed_frames );
    printf( "  DECODE_AND_USE count: %i \n", stats->action_histogram[DEC_ACTION_DECODE_AND_USE] );
    printf( "  SKIP count: %i\n", stats->action_histogram[DEC_ACTION_SKIP] );
    printf( "  CACHE count: %i\n", stats->action_histogram[DEC_ACTION_CACHE] );
    printf( "Decoded-and-Dropped:\n" );
    printf( "  DECODE_AND_DROP count: %i \n", stats->action_histogram[DEC_ACTION_DECODE_AND_DROP] );
    printf( "  DEC_CACHE count: %i\n", stats->num_cached_frames_decoded_and_dropped );
    printf( "  perc of req : %f\n", 100.f * (float) sum_decoded_and_dropped_frames / sum_pushed_frames );
    printf( "Workload saved: \n" );
    printf( "   Skipped perc. of req %f\n", 100.f * (float) sum_skipped_frames / sum_pushed_frames );

    return;
}
#endif
+0 −12
Original line number Diff line number Diff line
@@ -56,15 +56,6 @@ typedef enum
    DEC_ACTION_NUM_ENUMS
} SelectiveDecAction;

#ifdef LC3PLUS_DEC_COLLECT_STATS
typedef struct IVAS_LC3PLUS_DEC_COLLECT_STATS
{
    int32_t action_histogram[DEC_ACTION_NUM_ENUMS];
    int32_t num_cached_frames_decoded_and_dropped;
} IVAS_LC3PLUS_DEC_COLLECT_STATS;

void printLC3plusDecStats( const IVAS_LC3PLUS_DEC_COLLECT_STATS *stats );
#endif

typedef struct IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE
{
@@ -95,9 +86,6 @@ typedef struct IVAS_LC3PLUS_DEC_HANDLE
#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING
    int16_t cachingEnabled;
#endif
#ifdef LC3PLUS_DEC_COLLECT_STATS
    IVAS_LC3PLUS_DEC_COLLECT_STATS stats;
#endif
} * IVAS_LC3PLUS_DEC_HANDLE;

ivas_error IVAS_LC3PLUS_DEC_Open(