# HG changeset patch # User Mychaela Falconia # Date 1712175337 0 # Node ID b55451463161cb3c2471f114af38307ae1d9d626 # Parent 6ac30bef2b4b79dbd2c48be8f1bc7c89da96805d amrdiff: recognize DHF transform diff -r 6ac30bef2b4b -r b55451463161 amrdiff/amrdiff.c --- a/amrdiff/amrdiff.c Wed Apr 03 20:10:38 2024 +0000 +++ b/amrdiff/amrdiff.c Wed Apr 03 20:15:37 2024 +0000 @@ -12,6 +12,26 @@ #include "etsi.h" #include "amr_defs.h" +const uint8_t amr122_dhf_bits[244] = { +0,0,0,0,1,0,0,0,0,1,0,1,0,1,0,0,1,1,0,1,1,0,1,1,1,0,0,1,0,1,1,0,1,0,1,0,1,0,1,0, +1,0,1,0,1,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,1,0,1,1,0,0,0,0,1,1,1,1,1,1,1,0,1,1,0,0,1,1,0, +1,0,0,0,0,0,1,1,0,1,1,1,1,0,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0, +0,0,0,1,0,1,0,1,1,0,0,0,0,1,0,1,0,1,0,0,1,1,1,1,0,0,0,1,0,0,0,0,1,1,1,1,0,1,1,0, +1,0,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,0,1,0,1,0, +0,0,0,0 +}; + +const uint8_t efr_dhf_bits[244] = { +0,0,0,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,1,1,0,1,0,0,1,0,0,1,0,0,0,0,1,1,1,1,1,0,1,0, +1,0,1,0,1,1,0,1,0,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,1,1,0,1,0,0,0,0,1,1,0,0,0, +0,1,1,0,0,0,0,0,0,1,1,1,1,0,1,1,0,0,0,0,1,1,0,0,0,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0, +1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0, +1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0, +}; + main(argc, argv) char **argv; { @@ -99,7 +119,12 @@ amr_sp, efr_sp); continue; } - if (bcmp(amr_bits+1, efr_bits, 244)) + if (!bcmp(amr_bits+1, efr_bits, 244)) + continue; + if (!bcmp(amr_bits+1, amr122_dhf_bits, 244) && + !bcmp(efr_bits, efr_dhf_bits, 244)) + printf("frame #%u: DHF transform\n", frame_no); + else printf("frame #%u: bits differ\n", frame_no); } exit(0);