e_homing.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. *****************************************************************************
  3. *
  4. * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001
  5. * R99 Version 3.3.0
  6. * REL-4 Version 4.1.0
  7. *
  8. *****************************************************************************
  9. *
  10. * File : e_homing.c
  11. *
  12. *****************************************************************************
  13. */
  14. /*
  15. *****************************************************************************
  16. * MODULE INCLUDE FILE AND VERSION ID
  17. *****************************************************************************
  18. */
  19. #include "e_homing.h"
  20. const char e_homing_id[] = "@(#)$Id $" e_homing_h;
  21. /*
  22. *****************************************************************************
  23. * INCLUDE FILES
  24. *****************************************************************************
  25. */
  26. #include "typedef.h"
  27. #include "cnst.h"
  28. /*
  29. *****************************************************************************
  30. * PUBLIC PROGRAM CODE
  31. *****************************************************************************
  32. */
  33. /*
  34. ********************************************************************************
  35. *
  36. * Function : encoder_homing_frame_test
  37. * In : input_frame[] one frame of speech samples
  38. * Out : none
  39. * Calls : none
  40. * Tables : none
  41. * Compile Defines : none
  42. * Return : 0 input frame does not match the encoder homing frame pattern
  43. * 1 input frame matches the encoder homing frame pattern
  44. * Information : Checks if all samples of the input frame matches the encoder
  45. * homing frame pattern, which is 0x0008 for all samples.
  46. *
  47. ********************************************************************************
  48. */
  49. Word16 encoder_homing_frame_test (Word16 input_frame[])
  50. {
  51. Word16 i, j;
  52. /* check 160 input samples for matching EHF_MASK: defined in e_homing.h */
  53. for (i = 0; i < L_FRAME; i++)
  54. {
  55. j = input_frame[i] ^ EHF_MASK;
  56. if (j)
  57. break;
  58. }
  59. return !j;
  60. }