Commit a444b46f authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Fix addressing 128k quality

parent 27b76eaf
Loading
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -318,6 +318,10 @@ typedef enum
#ifdef MASA_AND_OBJECTS 
#define BRATE_ISM_INACTIVE                      2450 /* CoreCoder bitrate in ISM no meta / inactive frames */
#define BITS_ISM_INACTIVE                       ( BRATE_ISM_INACTIVE / FRAMES_PER_SEC )
#ifdef OMASA_ENERGIES
#define ADJUST_ISM_BRATE_NEG                    6000
#define ADJUST_ISM_BRATE_POS                    8000
#endif
#endif

#define ISM_AZIMUTH_NBITS                       7
@@ -1221,12 +1225,10 @@ enum
#define MASA_STEREO_MIN_BITRATE                 IVAS_24k4
#ifdef MASA_AND_OBJECTS
#define MAXIMUM_OMASA_FREQ_BANDS                8                           /* Corresponds to maximum number of coding bands at 32 kbps */

#ifdef FIX_OMASA_STEREO_SWITCHING
#define OMASA_STEREO_SW_CNT_MAX                 100
#define OMASA_STEREO_SW_CNT_MAX2                5
#endif

#endif

#define MASA_BIT_REDUCT_PARAM                   10

lib_com/ivas_prot.h

100755 → 100644
+12 −0
Original line number Diff line number Diff line
@@ -817,6 +817,10 @@ ivas_error ivas_ism_enc(
    float data[MAX_NUM_OBJECTS][L_FRAME48k],                    /* i  : input signal                                */
    const int16_t input_frame,                                  /* i  : input frame length per channel              */
    int16_t *nb_bits_metadata                                   /* i  : number of metadata bits                     */
#ifdef OMASA_ENERGIES
     ,
     int16_t flag_omasa_brate
#endif 
);

ivas_error ivas_ism_metadata_enc(
@@ -837,6 +841,10 @@ ivas_error ivas_ism_metadata_enc(
    const int16_t ism_extended_metadata_flag                    /* i  : Extended metadata flag                      */
#ifdef MASA_AND_OBJECTS
   ,const float lp_noise_CPE                                    /* i  : LP filterend total noise estimation         */
#ifdef OMASA_ENERGIES
    ,
    int16_t flag_omasa_brate
#endif
#ifdef FIX_OMASA_STEREO_SWITCHING
   ,int16_t *omasa_stereo_sw_cnt
#endif
@@ -4625,6 +4633,10 @@ ivas_error ivas_masa_encode(
    const int16_t idx_separated_object,                         /* i  : index of the separated object                   */
    OMASA_ENC_HANDLE hOMasa,                                    /* i  : OMASA encoder handle                            */
    const int16_t ism_imp                                       /* i  : importance of separated object                  */
#ifdef OMASA_ENERGIES
    ,
    int16_t  flag_omasa_brate                                   /* i: flag for using less bitrate for objects in OMASA  */
#endif
#endif
);

lib_com/options.h

100755 → 100644
+1 −0
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@
#define MASA_AND_OBJECTS                                /* Nokia: Combination of MASA and objects */
#ifdef MASA_AND_OBJECTS
#define MASAISM_EDIT_OBJECTS                            /* Nokia: Temporary command line editing of object directions in the decoder */
#define OMASA_ENERGIES
#define FIX_OMASA_STEREO_SWITCHING  // VA: introduce  Unified/MDCT stereo switching for 3ISM @96 kbps and 4ISM @128 kbps 
#endif

+3 −2
Original line number Diff line number Diff line
@@ -97,6 +97,9 @@ ivas_error ivas_cpe_dec(

    sts[0]->BER_detect |= st_ivas->BER_detect;
    sts[1]->BER_detect |= st_ivas->BER_detect;
#ifdef FIX_OMASA_STEREO_SWITCHING
    element_brate_ref = hCPE->element_brate;
#endif

#ifdef FIX_OMASA_STEREO_SWITCHING
    element_brate_ref = hCPE->element_brate;
@@ -105,7 +108,6 @@ ivas_error ivas_cpe_dec(
    /*------------------------------------------------------------------*
     * Read stereo technology info & audio bandwidth
     *-----------------------------------------------------------------*/

#ifdef FIX_OMASA_STEREO_SWITCHING
    if ( st_ivas->ivas_format == MASA_ISM_FORMAT )
    {
@@ -131,7 +133,6 @@ ivas_error ivas_cpe_dec(
        }
    }
#endif

    read_stereo_mode_and_bwidth( hCPE, st_ivas );

    /*----------------------------------------------------------------*
+8 −0
Original line number Diff line number Diff line
@@ -242,6 +242,14 @@ ivas_error ivas_masa_decode(
                            ( *nb_bits_read ) += ISM_METADATA_VAD_FLAG_BITS;
                        }
                    }
#ifdef OMASA_ENERGIES
                    st_ivas->flag_omasa_brate = 0;
                    if ( st_ivas->nchan_ism >= 3 && ivas_total_brate == IVAS_128k )
                    {
                        st_ivas->flag_omasa_brate = st->bit_stream[( st->next_bit_pos )--];
                        ( *nb_bits_read ) += 1;
                    }
#endif
                }
            }
#endif
Loading