/AVS_Transcoder_SDK/kernel/audio/AudioTransCoder_Lame/av3enc/src/sam_encode.cpp

https://gitlab.com/jchwei/avs-transcoder · C++ · 118 lines · 70 code · 8 blank · 40 comment · 0 complexity · 9c91e52ca3c4808eceec43af786a88e5 MD5 · raw file

  1. /*
  2. ***********************************************************************
  3. * COPYRIGHT AND WARRANTY INFORMATION
  4. *
  5. * Copyright 2004, Audio Video Coding Standard, Part III
  6. *
  7. * This software module was originally developed by
  8. *
  9. * Lei Miao (win.miaolei@samsung.com), Samsung AIT
  10. * Lei Miao, CBC Multi-channel extension, 2005-09-19
  11. *
  12. * edited by
  13. *
  14. * DISCLAIMER OF WARRANTY
  15. *
  16. * These software programs are available to the users without any
  17. * license fee or royalty on an "as is" basis. The AVS disclaims
  18. * any and all warranties, whether express, implied, or statutory,
  19. * including any implied warranties of merchantability or of fitness
  20. * for a particular purpose. In no event shall the contributors or
  21. * the AVS be liable for any incidental, punitive, or consequential
  22. * damages of any kind whatsoever arising from the use of this program.
  23. *
  24. * This disclaimer of warranty extends to the user of this program
  25. * and user's customers, employees, agents, transferees, successors,
  26. * and assigns.
  27. *
  28. * The AVS does not represent or warrant that the program furnished
  29. * hereunder are free of infringement of any third-party patents.
  30. * Commercial implementations of AVS, including shareware, may be
  31. * subject to royalty fees to patent holders. Information regarding
  32. * the AVS patent policy is available from the AVS Web site at
  33. * http://www.avs.org.cn
  34. *
  35. * THIS IS NOT A GRANT OF PATENT RIGHTS - SEE THE AVS PATENT POLICY.
  36. ************************************************************************
  37. */
  38. #include "sam_encode.h"
  39. #include "av3enc.h"
  40. extern void init_cbc(int , int , FILE *);
  41. extern int cbc(
  42. ChannelInfo channelInfo[],
  43. int nch,
  44. int sampleRateIdx,
  45. int outputformat,
  46. int signal_type,
  47. int windowShape,
  48. int num_window_groups,
  49. int window_group_length[],
  50. short *swb_offset[],
  51. int *scalefac[][8],
  52. int *quant[][8],
  53. int maxSfb,
  54. int stereo_mode,
  55. int *stereo_info[],
  56. int frame_length,
  57. int wflag,
  58. int isExtended,
  59. int channelIdx,
  60. int numChannels,
  61. int mc_present,
  62. int extended_bytes,
  63. AV3EncFramePtr hEncoder);
  64. //#define DllExport
  65. //DllExport void
  66. void
  67. sam_cbc_init(int fsidx, int bitrate, FILE *outFile)
  68. {
  69. init_cbc(fsidx, bitrate, outFile);
  70. }
  71. //DllExport int
  72. int
  73. sam_cbc(
  74. ChannelInfo channelInfo[],
  75. int nch,
  76. int sampleRateIdx,
  77. int outputformat,
  78. int signal_type,
  79. int windowShape,
  80. int num_window_groups,
  81. int window_group_length[],
  82. short *swb_offset[],
  83. int *scalefac[][8],
  84. int *quant[][8],
  85. int maxSfb,
  86. int stereo_mode,
  87. int *stereo_info[],
  88. int frame_length,
  89. int wflag,
  90. int isExtended,
  91. int channelIdx,
  92. int numChannels,
  93. int mc_present,
  94. int extended_bytes,
  95. AV3EncFramePtr hEncoder)
  96. {
  97. int frameSize;
  98. frameSize = cbc(channelInfo, nch,
  99. sampleRateIdx, outputformat,
  100. signal_type, windowShape,
  101. num_window_groups, window_group_length,
  102. swb_offset, scalefac,
  103. quant, maxSfb,
  104. stereo_mode, stereo_info,
  105. frame_length, wflag,
  106. isExtended, channelIdx,
  107. numChannels, mc_present,
  108. extended_bytes, hEncoder);
  109. return frameSize;
  110. }