tdav_codec_g729.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright (C) 2010-2011 Mamadou Diop.
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango.org>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. /**@file tdav_codec_g729.h
  23. * @brief G729a codec.
  24. * Source from: http://www.itu.int/rec/T-REC-G.729-199611-S!AnnA/en
  25. *
  26. * @author Mamadou Diop <diopmamadou(at)doubango.org>
  27. *
  28. */
  29. #ifndef TINYDAV_CODEC_G729_H
  30. #define TINYDAV_CODEC_G729_H
  31. #include "tinydav_config.h"
  32. #if HAVE_G729
  33. #include "tinymedia/tmedia_codec.h"
  34. #include "g729b/typedef.h"
  35. #include "g729b/ld8a.h"
  36. TDAV_BEGIN_DECLS
  37. /** G.729abb codec */
  38. typedef struct tdav_codec_g729ab_s {
  39. TMEDIA_DECLARE_CODEC_AUDIO;
  40. struct {
  41. Word16 prm[PRM_SIZE+1]; /* Analysis parameters + frame type */
  42. Word16 serial[SERIAL_SIZE]; /* Output bitstream buffer */
  43. Word16 frame; /* frame counter */
  44. /* For G.729B */
  45. Word16 vad_enable;
  46. } encoder;
  47. struct {
  48. Word16 serial[SERIAL_SIZE]; /* Serial stream */
  49. Word16 synth_buf[L_FRAME+M], *synth; /* Synthesis */
  50. Word16 parm[PRM_SIZE+2]; /* Synthesis parameters */
  51. Word16 Az_dec[MP1*2]; /* Decoded Az for post-filter */
  52. Word16 T2[2]; /* Pitch lag for 2 subframes */
  53. /* For G.729B */
  54. Word16 Vad;
  55. } decoder;
  56. }
  57. tdav_codec_g729ab_t;
  58. TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_g729ab_plugin_def_t;
  59. TDAV_END_DECLS
  60. #endif /* TINYDAV_CODEC_G729_H */
  61. #endif