test_encoder.sh 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #!/bin/bash
  2. INPUTPATH=./test_vectors/input/
  3. BITSTREAMPATH=./test_vectors/bitstream/
  4. ENC=encoder
  5. COMP=signalcompare
  6. cd ..
  7. # 8 kHz
  8. INPUTFILE=testvector_input_8_kHz.pcm
  9. # 8 kHz, 60 ms, 8 kbps, complexity 0
  10. PARAMS=8_kHz_60_ms_8_kbps
  11. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 8000 -packetlength 60 -rate 8000 -complexity 0
  12. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff > test_encoder_report.txt
  13. # 8 kHz, 40 ms, 12 kbps, complexity 1
  14. PARAMS=8_kHz_40_ms_12_kbps
  15. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 8000 -packetlength 40 -rate 12000 -complexity 1
  16. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff >> test_encoder_report.txt
  17. # 8 kHz, 20 ms, 20 kbps, 10% packet loss, FEC
  18. PARAMS=8_kHz_20_ms_20_kbps_10_loss_FEC
  19. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 8000 -packetlength 20 -rate 20000 -loss 10 -inbandFEC 1
  20. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff >> test_encoder_report.txt
  21. # 12 kHz
  22. INPUTFILE=testvector_input_12_kHz.pcm
  23. # 12 kHz, 60 ms, 10 kbps, complexity 0
  24. PARAMS=12_kHz_60_ms_10_kbps
  25. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 12000 -packetlength 60 -rate 10000 -complexity 0
  26. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff >> test_encoder_report.txt
  27. # 12 kHz, 40 ms, 16 kbps, complexity 1
  28. PARAMS=12_kHz_40_ms_16_kbps
  29. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 12000 -packetlength 40 -rate 16000 -complexity 1
  30. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff >> test_encoder_report.txt
  31. # 12 kHz, 20 ms, 24 kbps, 10% packet loss, FEC
  32. PARAMS=12_kHz_20_ms_24_kbps_10_loss_FEC
  33. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 12000 -packetlength 20 -rate 24000 -loss 10 -inbandFEC 1
  34. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff >> test_encoder_report.txt
  35. # 16 kHz
  36. INPUTFILE=testvector_input_16_kHz.pcm
  37. # 16 kHz, 60 ms, 12 kbps, complexity 0
  38. PARAMS=16_kHz_60_ms_12_kbps
  39. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 16000 -packetlength 60 -rate 12000 -complexity 0
  40. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff >> test_encoder_report.txt
  41. # 16 kHz, 40 ms, 20 kbps, complexity 1
  42. PARAMS=16_kHz_40_ms_20_kbps
  43. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 16000 -packetlength 40 -rate 20000 -complexity 1
  44. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff >> test_encoder_report.txt
  45. # 16 kHz, 20 ms, 32 kbps, 10% packet loss, FEC
  46. PARAMS=16_kHz_20_ms_32_kbps_10_loss_FEC
  47. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 16000 -packetlength 20 -rate 32000 -loss 10 -inbandFEC 1
  48. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff >> test_encoder_report.txt
  49. # 24 kHz
  50. INPUTFILE=testvector_input_24_kHz.pcm
  51. # 24 kHz, 60 ms, 16 kbps, complexity 0
  52. PARAMS=24_kHz_60_ms_16_kbps
  53. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 24000 -packetlength 60 -rate 16000 -complexity 0
  54. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff >> test_encoder_report.txt
  55. # 24 kHz, 40 ms, 24 kbps, complexity 1
  56. PARAMS=24_kHz_40_ms_24_kbps
  57. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 24000 -packetlength 40 -rate 24000 -complexity 1
  58. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff >> test_encoder_report.txt
  59. # 24 kHz, 20 ms, 40 kbps, 10% packet loss, FEC
  60. PARAMS=24_kHz_20_ms_40_kbps_10_loss_FEC
  61. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 24000 -packetlength 20 -rate 40000 -loss 10 -inbandFEC 1
  62. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff >> test_encoder_report.txt
  63. # 32 kHz
  64. INPUTFILE=testvector_input_32_kHz.pcm
  65. # 32 kHz, 20 ms, 8 kbps, maxInternal 8kHz
  66. PARAMS=32_kHz_max_8_kHz_20_ms_8_kbps
  67. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 32000 -Fs_maxInternal 8000 -packetlength 20 -rate 8000
  68. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff >> test_encoder_report.txt
  69. # 44100 Hz
  70. INPUTFILE=testvector_input_44100_Hz.pcm
  71. # 44100 Hz, 20 ms, 40 kbps
  72. PARAMS=44100_Hz_20_ms_7_kbps
  73. ./${ENC} ${INPUTPATH}${INPUTFILE} tmp.bit -Fs_API 44100 -packetlength 20 -rate 7000
  74. ./${COMP} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.bit -diff >> test_encoder_report.txt
  75. rm tmp.bit
  76. mv test_encoder_report.txt ./test_vectors/test_encoder_report.txt
  77. echo ""
  78. echo "The results have been saved as test_encoder_report.txt"
  79. echo ""