Commit 17128f7b authored by vaclav's avatar vaclav
Browse files

fix issue 1273: fix counter overflow in ISM metadata encoder; under NONBE_1273_ISM_METADATA_COUNTER

parent fdc343de
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -168,6 +168,8 @@
/* any switch which is non-be wrt selection floating point code */
/* all switches in this category should start with "NONBE_" */

#define NONBE_1273_ISM_METADATA_COUNTER                 /* VA: issue 1273: fix counter overflow in ISM metadata encoder */


/* ##################### End NON-BE switches ########################### */

+11 −1
Original line number Diff line number Diff line
@@ -276,7 +276,9 @@ ivas_error ivas_ism_metadata_enc(
                        }
                        else if ( hIsmMeta[ch]->ism_md_fec_cnt_enc == ISM_MD_FEC_CNT_MAX )
                        {

#ifdef NONBE_1273_ISM_METADATA_COUNTER
                            hIsmMeta[ch]->ism_md_fec_cnt_enc = 0;
#endif
                            lowrate_metadata_flag[ch] = 1;

                            hIsmMeta[ch]->position_angle.angle1_diff_cnt = ISM_FEC_MAX;
@@ -555,7 +557,11 @@ ivas_error ivas_ism_metadata_enc(

                if ( hIsmMeta[ch]->ism_metadata_flag == 0 )
                {
#ifdef NONBE_1273_ISM_METADATA_COUNTER
                    hIsmMeta[ch]->ism_md_fec_cnt_enc = min( hIsmMeta[ch]->ism_md_fec_cnt_enc++, ISM_MD_FEC_CNT_MAX );
#else
                    hIsmMeta[ch]->ism_md_fec_cnt_enc++;
#endif
                }
                else
                {
@@ -699,7 +705,11 @@ ivas_error ivas_ism_metadata_enc(

        if ( hIsmMeta[ch]->ism_metadata_flag == 0 )
        {
#ifdef NONBE_1273_ISM_METADATA_COUNTER
            hIsmMeta[ch]->ism_md_fec_cnt_enc = min( hIsmMeta[ch]->ism_md_fec_cnt_enc++, ISM_MD_FEC_CNT_MAX );
#else
            hIsmMeta[ch]->ism_md_fec_cnt_enc++;
#endif
        }
        else
        {