Commit 88c706dd authored by vaclav's avatar vaclav
Browse files

Merge branch '1273-counter-overflow-in-ivas-metadata-encoder' into 'main'

[non-BE] Resolve "Counter overflow in ISM metadata encoder"

See merge request !1998
parents 3794957f ac2a76be
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -169,6 +169,8 @@
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_GSC_BSTR                              /* VA: issue 1264: Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */
#define NONBE_1273_ISM_METADATA_COUNTER                 /* VA: issue 1273: fix counter overflow in ISM metadata encoder */


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

+9 −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;
@@ -556,6 +558,9 @@ ivas_error ivas_ism_metadata_enc(
                if ( hIsmMeta[ch]->ism_metadata_flag == 0 )
                {
                    hIsmMeta[ch]->ism_md_fec_cnt_enc++;
#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 );
#endif
                }
                else
                {
@@ -700,6 +705,9 @@ ivas_error ivas_ism_metadata_enc(
        if ( hIsmMeta[ch]->ism_metadata_flag == 0 )
        {
            hIsmMeta[ch]->ism_md_fec_cnt_enc++;
#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 );
#endif
        }
        else
        {