Commit c3adc16e authored by bayers's avatar bayers
Browse files

* fixed memory leaks in ParamMC only bit rate switching

* added remapping of parameter buffers for ParamMC if the number of TCs stay the same and the number of parameter bands are different on a bit rate switch
parent e3d323ab
Loading
Loading
Loading
Loading
+90 −1
Original line number Diff line number Diff line
@@ -329,6 +329,92 @@ void ivas_param_mc_default_icc_map(
    return;
}

#ifdef MC_BITRATE_SWITCHING
int16_t ivas_param_mc_get_num_param_bands(
    const MC_LS_SETUP mc_ls_setup,             /* i  : MC ls setup                      */
    const int32_t ivas_total_brate             /* i  : IVAS total bitrate               */
    )
{
    int16_t num_parameter_bands;
    num_parameter_bands = 0;

        /* parameter bands */
    switch ( mc_ls_setup )
    {
        case MC_LS_SETUP_5_1:
            switch ( ivas_total_brate )
            {
                case IVAS_48k:
                    num_parameter_bands = 10;
                    break;
                case IVAS_64k:
                case IVAS_80k:
                    num_parameter_bands = 14;
                    break;
                default:
                    assert( 0 && "PARAM_MC: bitrate for CICP6 not supported!" );
            }
            break;

        case MC_LS_SETUP_7_1:
            switch ( ivas_total_brate )
            {
                case IVAS_48k:
                    num_parameter_bands = 10;
                    break;
                case IVAS_64k:
                case IVAS_80k:
                    num_parameter_bands = 14;
                    break;
                case IVAS_96k:
                    num_parameter_bands = 20;
                    break;
            }
            break;
        case MC_LS_SETUP_5_1_2:
            switch ( ivas_total_brate )
            {
                case IVAS_48k:
                    num_parameter_bands = 10;
                    break;
                case IVAS_64k:
                case IVAS_80k:
                    num_parameter_bands = 14;
                    break;
                case IVAS_96k:
                    num_parameter_bands = 20;
                    break;
            }
            break;
        case MC_LS_SETUP_5_1_4:
            switch ( ivas_total_brate )
            {
                case IVAS_96k:
                    num_parameter_bands = 14;
                    break;
                case IVAS_128k:
                    num_parameter_bands = 20;
                    break;
            }
            break;
        case MC_LS_SETUP_7_1_4:
            switch ( ivas_total_brate )
            {
                case IVAS_128k:
                    num_parameter_bands = 20;
                    break;
                case IVAS_160k:
                    num_parameter_bands = 20;
                    break;
            }
            break;
        default:
            assert( 0 && "PARAM_MC: channel configuration not supportet!" );
    }

    return num_parameter_bands;
}
#endif

/*-------------------------------------------------------------------------
 * Local functions
@@ -427,6 +513,9 @@ static void ivas_param_mc_set_coding_scheme(
            assert( 0 && "PARAM_MC: channel configuration not supported!" );
    }

    #ifdef MC_BITRATE_SWITCHING
    hMetadataPMC->num_parameter_bands = ivas_param_mc_get_num_param_bands( mc_ls_setup, ivas_total_brate );
    #else
    /* parameter bands */
    switch ( mc_ls_setup )
    {
@@ -500,6 +589,6 @@ static void ivas_param_mc_set_coding_scheme(
        default:
            assert( 0 && "PARAM_MC: channel configuration not supportet!" );
    }

#endif
    return;
}
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@

#ifdef DEBUGGING

/*#define MEM_COUNT_DETAILS*/                   /* RAM counting tool: print per sub-structure details */
#define MEM_COUNT_DETAILS                       /* RAM counting tool: print per sub-structure details */

/*#define DEBUG_MODE_INFO*/                     /* output most important parameters to the subdirectory "res/" */
#ifdef DEBUG_MODE_INFO
+274 −66

File changed.

Preview size limit exceeded, changes collapsed.

+52 −0

File changed.

Preview size limit exceeded, changes collapsed.

+9 −0
Original line number Diff line number Diff line
@@ -328,6 +328,15 @@ ivas_error ivas_corecoder_enc_reconfig(
                return error;
            }
        }
#ifdef MC_BITRATE_SWITCHING
        else if (st_ivas->nCPE > 1 && st_ivas->hMCT == NULL && st_ivas->hEncoderConfig->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMMC)
        {
            if ( ( error = create_mct_enc( st_ivas ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }
#endif

        /* metadata handling for CPEs */
        if ( st_ivas->nCPE > 0 )
Loading