Crash in SBA encoder for 24.4 kbps HOA3 input with longer testvector
Basic info
Bug description
The SBA encoder crashes at 24.4 kbps with the ltv48_HOA3.wav
input signal, see console log below. I tried some earlier commits and this happens before the merge of the SBA br switching and even before merging the AGC changes (a4fcf9b8).
IVAS_cod -sba 3 -max_band swb 24400 32 ltv48_HOA3_32_SBA.pcm ltv48_HOA3_SBA_b24_4_swb_cbr.192
==================================================================================================
IVAS Codec Baseline
Based on EVS Codec (Floating Point) 3GPP TS26.443 Nov 04, 2021,
Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
==================================================================================================
Internal fatal error: Error: Too low bitrate (13200 bps) for ACELP@16k in frame 609. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Error: Too low bitrate (13200 bps) for ACELP@16k in frame 609. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 24250 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Indice ID = 1 with value 3 is trying to re-write an existing indice (frame 610) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Error: Too low bitrate (6100 bps) for ACELP@16k in frame 610. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 46550 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-3200 bps) for ACELP@16k in frame 611. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 1088 with value 65535 exceeds the range of 8 bits (frame 611) !
In function: push_indice(), lib_com/bitstream.c:250
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 60500 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Indice ID = 1 with value 3 is trying to re-write an existing indice (frame 612) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Error: Too low bitrate (-11350 bps) for ACELP@16k in frame 612. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 1088 with value 65535 exceeds the range of 8 bits (frame 612) !
In function: push_indice(), lib_com/bitstream.c:250
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 73200 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-18100 bps) for ACELP@16k in frame 613. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 1088 with value 65535 exceeds the range of 8 bits (frame 613) !
In function: push_indice(), lib_com/bitstream.c:250
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 84600 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-25450 bps) for ACELP@16k in frame 614. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Error: Too low bitrate (-25450 bps) for ACELP@16k in frame 614. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 106100 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-34650 bps) for ACELP@16k in frame 615. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Error: Too low bitrate (-34650 bps) for ACELP@16k in frame 615. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 128900 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-43150 bps) for ACELP@16k in frame 616. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 1088 with value 65535 exceeds the range of 8 bits (frame 616) !
In function: push_indice(), lib_com/bitstream.c:250
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 142050 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-50550 bps) for ACELP@16k in frame 617. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 1088 with value 65535 exceeds the range of 8 bits (frame 617) !
In function: push_indice(), lib_com/bitstream.c:250
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 154100 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-57950 bps) for ACELP@16k in frame 618. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 1088 with value 65535 exceeds the range of 8 bits (frame 618) !
In function: push_indice(), lib_com/bitstream.c:250
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 166150 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-66650 bps) for ACELP@16k in frame 619. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Error: Too low bitrate (-66650 bps) for ACELP@16k in frame 619. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 189000 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-74550 bps) for ACELP@16k in frame 620. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Error: Too low bitrate (-74550 bps) for ACELP@16k in frame 620. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 210500 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-83600 bps) for ACELP@16k in frame 621. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 1088 with value 65535 exceeds the range of 8 bits (frame 621) !
In function: push_indice(), lib_com/bitstream.c:250
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 224200 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-92500 bps) for ACELP@16k in frame 622. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 1088 with value 65535 exceeds the range of 8 bits (frame 622) !
In function: push_indice(), lib_com/bitstream.c:250
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 237750 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-101200 bps) for ACELP@16k in frame 623. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 1088 with value 65535 exceeds the range of 8 bits (frame 623) !
In function: push_indice(), lib_com/bitstream.c:250
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 251100 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-108650 bps) for ACELP@16k in frame 624. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 1088 with value 65535 exceeds the range of 8 bits (frame 624) !
In function: push_indice(), lib_com/bitstream.c:250
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 263200 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-117000 bps) for ACELP@16k in frame 625. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 1088 with value 65535 exceeds the range of 8 bits (frame 625) !
In function: push_indice(), lib_com/bitstream.c:250
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 276200 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-124400 bps) for ACELP@16k in frame 626. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 1088 with value 65535 exceeds the range of 8 bits (frame 626) !
In function: push_indice(), lib_com/bitstream.c:250
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 288250 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-132400 bps) for ACELP@16k in frame 627. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 1088 with value 65535 exceeds the range of 8 bits (frame 627) !
In function: push_indice(), lib_com/bitstream.c:250
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 300900 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Error: Too low bitrate (-140750 bps) for ACELP@16k in frame 628. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Error: Too low bitrate (-140750 bps) for ACELP@16k in frame 628. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Indice ID = 102 with value 15665 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 7288 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 36 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 983 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 1 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 15569 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 1919 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 36 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 57 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 1 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 64774 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 535 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 36 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 48 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 1 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 28676 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 3813 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Indice ID = 102 with value 36 is trying to re-write an existing indice (frame 628) !
In function: push_indice(), lib_com/bitstream.c:290
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 315250 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Error: Too low bitrate (-149000 bps) for ACELP@16k in frame 629. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Error: Too low bitrate (-149000 bps) for ACELP@16k in frame 629. Exiting!
In function: config_acelp1(), lib_com/bits_alloc.c:594
Internal fatal error: Bitstream write size mismatch! Actual bitrate: 337100 vs. Reference bitrate: 24400
In function: write_indices_ivas(), lib_com/bitstream.c:960
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
Internal fatal error: Total number of indices exceeded: 2640 !
In function: push_next_indice(), lib_com/bitstream.c:347
IVAS_cod: lib_enc/ivas_qmetadata_enc.c:430: ivas_qmetadata_enc_encode: Assertion `bits_dir_bands[0] == bits_ec' failed.
Input audio file: /local/knj/ivas-codec/out_sba/pcm/ltv48_HOA3_32_SBA.pcm
Output bitstream file: /local/knj/ivas-codec/out_sba/enc/ltv48_HOA3_SBA_b24_4_swb_cbr.192
Max. encoded bandwidth: SWB
Input sampling rate: 32000 Hz
Bitrate: 24.40 kbps
IVAS format: Scene Based Audio, Ambisonic order 3 - AGC default mode
------ Running the encoder ------
Frames processed: 487
Ways to reproduce
Either do (this assumes you have the ivas-pc-testfiles repo checked out in parallel)
python3 ./scripts/runIvasCodec.py -p scripts/config/ci_linux_ltv.json -I ../ivas-pc-testfiles/ltv48_HOA3.wav -m SBA_b24_4_swb_cbr -o out_sba
cat out_sba/logs/ltv48_HOA3_SBA_b24_4_swb_cbr.enc.txt
or use this command line after resampling to 32kHz:
IVAS_cod -sba 3 -max_band swb 24400 32 ltv48_HOA3_32_SBA.pcm ltv48_HOA3_SBA_b24_4_swb_cbr.192