Commit 5e664670 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

re-purpose sba-order bits to signal the number of objects in OSBA at low BR

parent fa43fa46
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -430,6 +430,22 @@ ivas_error ivas_dec_setup(
            /* read Ambisonic (SBA) order */
            st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1];
            st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read];
            if ( ivas_total_brate >= IVAS_256k )
            {
                st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1];
                st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read];
                st_ivas->ism_mode = ISM_SBA_MODE_DISC;
            }
            else
            {
                st_ivas->sba_order = 3;

                st_ivas->nchan_ism = st_ivas->bit_stream[num_bits_read + 1];
                st_ivas->nchan_ism += 2 * st_ivas->bit_stream[num_bits_read];
                st_ivas->nchan_ism++;
                st_ivas->ivas_format = SBA_FORMAT;
                st_ivas->ism_mode = ISM_MODE_NONE;
            }

            /* set Ambisonic (SBA) order used for analysis and coding */
            st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, st_ivas->sba_order );
+2 −2
Original line number Diff line number Diff line
@@ -436,8 +436,8 @@ ivas_error ivas_enc(
            /* Write SBA planar flag */
            push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_planar, SBA_PLANAR_BITS );

            /* Write SBA order */
            push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_order, SBA_ORDER_BITS );
            /* Previously used to signal the SBA order, now re-purposed for the number of objects */
            push_indice( st->hBstr, IND_SMODE, hEncoderConfig->nchan_ism - 1, NO_BITS_MASA_ISM_NO_OBJ );

            /* SBA metadata encoding and SBA metadata bitstream writing */
            if ( ( error = ivas_spar_enc( st_ivas, data_f, input_frame, nb_bits_metadata, hMetaData ) ) != IVAS_ERR_OK )