Commit 1edf97b8 authored by vaclav's avatar vaclav
Browse files

fix reading of ISM SID signaling

parent e7c84423
Loading
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -174,7 +174,12 @@ ivas_error ivas_dec_get_format_fx(
            /* read the number of objects */
            nchan_ism = 1;
            move16();
#ifdef FIX_HRTF_LOAD
            k = sub( k, 1 );
            WHILE( st_ivas->bit_stream[k] && ( nchan_ism < MAX_NUM_OBJECTS ) )
#else
            WHILE( st_ivas->bit_stream[k - 1] && nchan_ism < MAX_NUM_OBJECTS )
#endif
            {
                nchan_ism = add( nchan_ism, 1 );
                k = sub( k, 1 );
@@ -481,14 +486,13 @@ ivas_error ivas_dec_get_format_fx(
                BREAK;
        }

        if ( st_ivas->ivas_format == ISM_FORMAT )
        IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) )
        {
            /* read the number of objects */
            nchan_ism = 1;
            move16();
#ifdef FIX_HRTF_LOAD
            k = sub( sub( k, 1 ), SID_FORMAT_NBITS );
            move16();
            WHILE( st_ivas->bit_stream[k] && ( nchan_ism < MAX_NUM_OBJECTS ) )
#else
            WHILE( st_ivas->bit_stream[k - 1 - SID_FORMAT_NBITS] && nchan_ism < MAX_NUM_OBJECTS )
@@ -610,7 +614,6 @@ ivas_error ivas_dec_setup(
            move16();
            k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) );
            k = sub( k, 1 );

            WHILE( st_ivas->bit_stream[k] && ( nchan_ism < MAX_NUM_OBJECTS ) )
            {
                nchan_ism = add( nchan_ism, 1 );
@@ -1009,8 +1012,6 @@ ivas_error ivas_dec_setup(
            move16();
            k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) );
            k = sub( sub( k, 1 ), SID_FORMAT_NBITS );
            move16();

            WHILE( st_ivas->bit_stream[k] && ( nchan_ism < MAX_NUM_OBJECTS ) )
            {
                nchan_ism = add( nchan_ism, 1 );