2
0

test_decoder.sh 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #!/bin/bash
  2. BITSTREAMPATH=./test_vectors/bitstream/
  3. OUTPUTPATH=./test_vectors/output/
  4. DEC=decoder
  5. COMP=signalcompare
  6. cd ..
  7. # 8 kHz
  8. # 8 kHz, 60 ms, 8 kbps, complexity 0
  9. PARAMS=8_kHz_60_ms_8_kbps
  10. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm
  11. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm -fs 24000 > test_decoder_report.txt
  12. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 8000
  13. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_8_kHz_out.pcm tmp.pcm -fs 8000 >> test_decoder_report.txt
  14. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 12000
  15. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_12_kHz_out.pcm tmp.pcm -fs 12000 >> test_decoder_report.txt
  16. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 16000
  17. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_16_kHz_out.pcm tmp.pcm -fs 16000 >> test_decoder_report.txt
  18. # 8 kHz, 40 ms, 12 kbps, complexity 1
  19. PARAMS=8_kHz_40_ms_12_kbps
  20. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm
  21. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt
  22. # 8 kHz, 20 ms, 20 kbps, 10% packet loss, FEC
  23. PARAMS=8_kHz_20_ms_20_kbps_10_loss_FEC
  24. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -loss 10
  25. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt
  26. # 12 kHz
  27. # 12 kHz, 60 ms, 10 kbps, complexity 0
  28. PARAMS=12_kHz_60_ms_10_kbps
  29. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm
  30. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt
  31. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 12000
  32. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_12_kHz_out.pcm tmp.pcm -fs 12000 >> test_decoder_report.txt
  33. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 16000
  34. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_16_kHz_out.pcm tmp.pcm -fs 16000 >> test_decoder_report.txt
  35. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 32000
  36. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_32_kHz_out.pcm tmp.pcm -fs 32000 >> test_decoder_report.txt
  37. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 44100
  38. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_44100_Hz_out.pcm tmp.pcm -fs 44100 >> test_decoder_report.txt
  39. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 48000
  40. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_48_kHz_out.pcm tmp.pcm -fs 48000 >> test_decoder_report.txt
  41. # 12 kHz, 40 ms, 16 kbps, complexity 1
  42. PARAMS=12_kHz_40_ms_16_kbps
  43. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm
  44. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt
  45. # 12 kHz, 20 ms, 24 kbps, 10% packet loss, FEC
  46. PARAMS=12_kHz_20_ms_24_kbps_10_loss_FEC
  47. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -loss 10
  48. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt
  49. # 16 kHz
  50. # 16 kHz, 60 ms, 12 kbps, complexity 0
  51. PARAMS=16_kHz_60_ms_12_kbps
  52. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm
  53. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt
  54. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 16000
  55. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_16_kHz_out.pcm tmp.pcm -fs 16000 >> test_decoder_report.txt
  56. # 16 kHz, 40 ms, 20 kbps, complexity 1
  57. PARAMS=16_kHz_40_ms_20_kbps
  58. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm
  59. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt
  60. # 16 kHz, 20 ms, 32 kbps, 10% packet loss, FEC
  61. PARAMS=16_kHz_20_ms_32_kbps_10_loss_FEC
  62. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -loss 10
  63. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt
  64. # 24 kHz
  65. # 24 kHz, 60 ms, 16 kbps, complexity 0
  66. PARAMS=24_kHz_60_ms_16_kbps
  67. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm
  68. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt
  69. # 24 kHz, 40 ms, 24 kbps, complexity 1
  70. PARAMS=24_kHz_40_ms_24_kbps
  71. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm
  72. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt
  73. # 24 kHz, 20 ms, 40 kbps, 10% packet loss, FEC
  74. PARAMS=24_kHz_20_ms_40_kbps_10_loss_FEC
  75. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -loss 10
  76. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt
  77. # 32 kHz
  78. # 32 kHz, 20 ms, 8 kbps, maxInternal 8kHz
  79. PARAMS=32_kHz_max_8_kHz_20_ms_8_kbps
  80. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm
  81. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt
  82. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 32000
  83. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_32_kHz_out.pcm tmp.pcm -fs 32000 >> test_decoder_report.txt
  84. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 44100
  85. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_44100_Hz_out.pcm tmp.pcm -fs 44100 >> test_decoder_report.txt
  86. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 48000
  87. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_48_kHz_out.pcm tmp.pcm -fs 48000 >> test_decoder_report.txt
  88. # 44100 Hz
  89. # 44100 Hz, 20 ms, 40 kbps
  90. PARAMS=44100_Hz_20_ms_7_kbps
  91. ./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm
  92. ./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt
  93. rm tmp.pcm
  94. mv test_decoder_report.txt ./test_vectors/test_decoder_report.txt
  95. echo ""
  96. echo "The results have been saved as test_decoder_report.txt"
  97. echo ""