Permalink
Browse files

Merge remote-tracking branch 'remotes/origin/FEAT-3852-Include_MediaP…

…ortal_Audio_Renderer' into 1.3.0Alpha

Conflicts:
	DirectShowFilters/TsReader/source/SubtitlePin.cpp
  • Loading branch information...
2 parents e00e8e4 + 33022db commit 0ddcc4e52ac738d8d6dfb6d4332f8622e5017a00 @Sebastiii Sebastiii committed Jun 5, 2012
Showing with 454,560 additions and 1 deletion.
  1. +3 −0 Build/VS_Rebuild_Debug_AudioRenderer.bat
  2. +10 −0 Build/VS_Rebuild_Release_AudioRenderer.bat
  3. +8 −0 DirectShowFilters/Filters.sln
  4. +2,025 −0 DirectShowFilters/MPAudioRenderer/AC3_encoder/ac3enc.cpp
  5. +65 −0 DirectShowFilters/MPAudioRenderer/AC3_encoder/ac3enc.h
  6. +134 −0 DirectShowFilters/MPAudioRenderer/AC3_encoder/bits.cpp
  7. +149 −0 DirectShowFilters/MPAudioRenderer/AC3_encoder/bits.h
  8. +105 −0 DirectShowFilters/MPAudioRenderer/AE_mixer/AEAudioFormat.h
  9. +268 −0 DirectShowFilters/MPAudioRenderer/AE_mixer/AEChannelInfo.cpp
  10. +97 −0 DirectShowFilters/MPAudioRenderer/AE_mixer/AEChannelInfo.h
  11. +339 −0 DirectShowFilters/MPAudioRenderer/AE_mixer/AERemap.cpp
  12. +55 −0 DirectShowFilters/MPAudioRenderer/AE_mixer/AERemap.h
  13. +4,348 −0 DirectShowFilters/MPAudioRenderer/AE_mixer/StdString.h
  14. BIN DirectShowFilters/MPAudioRenderer/AudioRenderer.aps
  15. +269 −0 DirectShowFilters/MPAudioRenderer/AudioRenderer.vcxproj
  16. +205 −0 DirectShowFilters/MPAudioRenderer/AudioRenderer.vcxproj.filters
  17. +161 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/Include/BPMDetect.h
  18. +174 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/Include/FIFOSampleBuffer.h
  19. +221 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/Include/FIFOSamplePipe.h
  20. +149 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/Include/STTypes.h
  21. +255 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/Include/SoundTouch.h
  22. +349 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/3dnow_win.cpp
  23. +184 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/AAFilter.cpp
  24. +91 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/AAFilter.h
  25. +308 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/BPMDetect.cpp
  26. +262 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/FIFOSampleBuffer.cpp
  27. +269 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/FIRFilter.cpp
  28. +164 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/FIRFilter.h
  29. +239 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/PeakFinder.cpp
  30. +93 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/PeakFinder.h
  31. +628 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/RateTransposer.cpp
  32. +159 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/RateTransposer.h
  33. +505 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/SoundTouch.cpp
  34. +1,045 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/TDStretch.cpp
  35. +275 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/TDStretch.h
  36. +62 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/cpu_detect.h
  37. +129 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/cpu_detect_x86_win.cpp
  38. +320 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/mmx_optimized.cpp
  39. +510 −0 DirectShowFilters/MPAudioRenderer/SoundTouch/source/sse_optimized.cpp
  40. BIN DirectShowFilters/MPAudioRenderer/bin/Debug/AudioRenderer.pdb
  41. BIN DirectShowFilters/MPAudioRenderer/bin/Debug/mpaudiorenderer.ax
  42. BIN DirectShowFilters/MPAudioRenderer/bin/Release/mpaudiorenderer.ax
  43. +16 −0 DirectShowFilters/MPAudioRenderer/common.props
  44. +16 −0 DirectShowFilters/MPAudioRenderer/common.vsprops
  45. +18 −0 DirectShowFilters/MPAudioRenderer/debug.props
  46. +19 −0 DirectShowFilters/MPAudioRenderer/debug.vsprops
  47. +1 −0 DirectShowFilters/MPAudioRenderer/libresample/AUTHORS
  48. +340 −0 DirectShowFilters/MPAudioRenderer/libresample/COPYING
  49. +143 −0 DirectShowFilters/MPAudioRenderer/libresample/Cfg/compile
  50. +1,561 −0 DirectShowFilters/MPAudioRenderer/libresample/Cfg/config.guess
  51. +1,686 −0 DirectShowFilters/MPAudioRenderer/libresample/Cfg/config.sub
  52. +630 −0 DirectShowFilters/MPAudioRenderer/libresample/Cfg/depcomp
  53. +520 −0 DirectShowFilters/MPAudioRenderer/libresample/Cfg/install-sh
  54. +9,642 −0 DirectShowFilters/MPAudioRenderer/libresample/Cfg/ltmain.sh
  55. +376 −0 DirectShowFilters/MPAudioRenderer/libresample/Cfg/missing
  56. +1,102 −0 DirectShowFilters/MPAudioRenderer/libresample/ChangeLog
  57. +117 −0 DirectShowFilters/MPAudioRenderer/libresample/INSTALL
  58. +4 −0 DirectShowFilters/MPAudioRenderer/libresample/M4/Makefile.am
  59. +392 −0 DirectShowFilters/MPAudioRenderer/libresample/M4/Makefile.in
  60. +17 −0 DirectShowFilters/MPAudioRenderer/libresample/M4/add_cflags.m4
  61. +26 −0 DirectShowFilters/MPAudioRenderer/libresample/M4/check_signal.m4
  62. +124 −0 DirectShowFilters/MPAudioRenderer/libresample/M4/clip_mode.m4
  63. +155 −0 DirectShowFilters/MPAudioRenderer/libresample/M4/endian.m4
  64. +7,851 −0 DirectShowFilters/MPAudioRenderer/libresample/M4/libtool.m4
  65. +37 −0 DirectShowFilters/MPAudioRenderer/libresample/M4/lrint.m4
  66. +37 −0 DirectShowFilters/MPAudioRenderer/libresample/M4/lrintf.m4
  67. +369 −0 DirectShowFilters/MPAudioRenderer/libresample/M4/ltoptions.m4
  68. +123 −0 DirectShowFilters/MPAudioRenderer/libresample/M4/ltsugar.m4
  69. +23 −0 DirectShowFilters/MPAudioRenderer/libresample/M4/ltversion.m4
  70. +98 −0 DirectShowFilters/MPAudioRenderer/libresample/M4/lt~obsolete.m4
  71. +22 −0 DirectShowFilters/MPAudioRenderer/libresample/Make.bat
  72. +22 −0 DirectShowFilters/MPAudioRenderer/libresample/Makefile.am
  73. +806 −0 DirectShowFilters/MPAudioRenderer/libresample/Makefile.in
  74. +36 −0 DirectShowFilters/MPAudioRenderer/libresample/NEWS
  75. +50 −0 DirectShowFilters/MPAudioRenderer/libresample/README
  76. +2 −0 DirectShowFilters/MPAudioRenderer/libresample/Win32/Makefile.am
  77. +395 −0 DirectShowFilters/MPAudioRenderer/libresample/Win32/Makefile.in
  78. +155 −0 DirectShowFilters/MPAudioRenderer/libresample/Win32/Makefile.mingw.in
  79. +55 −0 DirectShowFilters/MPAudioRenderer/libresample/Win32/Makefile.msvc
  80. +207 −0 DirectShowFilters/MPAudioRenderer/libresample/Win32/config.h
  81. +28 −0 DirectShowFilters/MPAudioRenderer/libresample/Win32/libsamplerate-0.def
  82. +22 −0 DirectShowFilters/MPAudioRenderer/libresample/Win32/unistd.h
  83. +1,183 −0 DirectShowFilters/MPAudioRenderer/libresample/aclocal.m4
  84. +129 −0 DirectShowFilters/MPAudioRenderer/libresample/autogen.sh
  85. +20,141 −0 DirectShowFilters/MPAudioRenderer/libresample/configure
  86. +342 −0 DirectShowFilters/MPAudioRenderer/libresample/configure.ac
  87. +1,099 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/ChangeLog
  88. +7 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/Makefile.am
  89. +445 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/Makefile.in
  90. +36 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/NEWS
  91. +84 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/SRC.css
  92. BIN DirectShowFilters/MPAudioRenderer/libresample/doc/SRC.png
  93. +127 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/api.html
  94. +176 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/api_callback.html
  95. +199 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/api_full.html
  96. +226 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/api_misc.html
  97. +146 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/api_simple.html
  98. +90 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/download.html
  99. +361 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/faq.html
  100. +101 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/history.html
  101. +130 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/index.html
  102. +124 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/license.html
  103. +91 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/lists.html
  104. +179 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/quality.html
  105. +156 −0 DirectShowFilters/MPAudioRenderer/libresample/doc/win32.html
  106. BIN DirectShowFilters/MPAudioRenderer/libresample/libsamplerate-0.dll
  107. BIN DirectShowFilters/MPAudioRenderer/libresample/libsamplerate-0.exp
  108. BIN DirectShowFilters/MPAudioRenderer/libresample/libsamplerate-0.lib
  109. +58 −0 DirectShowFilters/MPAudioRenderer/libresample/libsamplerate.spec.in
  110. +11 −0 DirectShowFilters/MPAudioRenderer/libresample/samplerate.pc.in
  111. +39 −0 DirectShowFilters/MPAudioRenderer/libresample/src/Makefile.am
  112. +656 −0 DirectShowFilters/MPAudioRenderer/libresample/src/Makefile.in
  113. +53 −0 DirectShowFilters/MPAudioRenderer/libresample/src/Version_script.in
  114. +47 −0 DirectShowFilters/MPAudioRenderer/libresample/src/check_asm.sh
  115. +169 −0 DirectShowFilters/MPAudioRenderer/libresample/src/common.h
  116. +207 −0 DirectShowFilters/MPAudioRenderer/libresample/src/config.h
  117. +149 −0 DirectShowFilters/MPAudioRenderer/libresample/src/config.h.in
  118. +2,505 −0 DirectShowFilters/MPAudioRenderer/libresample/src/fastest_coeffs.h
  119. +281 −0 DirectShowFilters/MPAudioRenderer/libresample/src/float_cast.h
  120. +340,281 −0 DirectShowFilters/MPAudioRenderer/libresample/src/high_qual_coeffs.h
  121. +22,480 −0 DirectShowFilters/MPAudioRenderer/libresample/src/mid_qual_coeffs.h
  122. +547 −0 DirectShowFilters/MPAudioRenderer/libresample/src/samplerate.c
  123. +197 −0 DirectShowFilters/MPAudioRenderer/libresample/src/samplerate.h
  124. BIN DirectShowFilters/MPAudioRenderer/libresample/src/samplerate.obj
  125. +222 −0 DirectShowFilters/MPAudioRenderer/libresample/src/src_linear.c
  126. BIN DirectShowFilters/MPAudioRenderer/libresample/src/src_linear.obj
  127. +1,209 −0 DirectShowFilters/MPAudioRenderer/libresample/src/src_sinc.c
  128. BIN DirectShowFilters/MPAudioRenderer/libresample/src/src_sinc.obj
  129. +213 −0 DirectShowFilters/MPAudioRenderer/libresample/src/src_zoh.c
  130. BIN DirectShowFilters/MPAudioRenderer/libresample/src/src_zoh.obj
  131. +525 −0 DirectShowFilters/MPAudioRenderer/source/AC3EncoderFilter.cpp
  132. +89 −0 DirectShowFilters/MPAudioRenderer/source/AC3EncoderFilter.h
  133. +76 −0 DirectShowFilters/MPAudioRenderer/source/AudioClockTracker.cpp
  134. +46 −0 DirectShowFilters/MPAudioRenderer/source/AudioClockTracker.h
  135. +383 −0 DirectShowFilters/MPAudioRenderer/source/BaseAudioSink.cpp
  136. +96 −0 DirectShowFilters/MPAudioRenderer/source/BaseAudioSink.h
  137. +632 −0 DirectShowFilters/MPAudioRenderer/source/BitDepthAdapter.cpp
  138. +80 −0 DirectShowFilters/MPAudioRenderer/source/BitDepthAdapter.h
  139. +474 −0 DirectShowFilters/MPAudioRenderer/source/ChannelMixer.cpp
  140. +67 −0 DirectShowFilters/MPAudioRenderer/source/ChannelMixer.h
  141. +81 −0 DirectShowFilters/MPAudioRenderer/source/ClockAdjuster.cpp
  142. +50 −0 DirectShowFilters/MPAudioRenderer/source/ClockAdjuster.h
  143. +431 −0 DirectShowFilters/MPAudioRenderer/source/DirectSoundRenderer.cpp
  144. +73 −0 DirectShowFilters/MPAudioRenderer/source/DirectSoundRenderer.h
  145. +52 −0 DirectShowFilters/MPAudioRenderer/source/FilterApp.cpp
  146. +33 −0 DirectShowFilters/MPAudioRenderer/source/FilterApp.h
  147. +55 −0 DirectShowFilters/MPAudioRenderer/source/Globals.cpp
  148. +62 −0 DirectShowFilters/MPAudioRenderer/source/Globals.h
  149. +47 −0 DirectShowFilters/MPAudioRenderer/source/IAVSyncClock.h
  150. +60 −0 DirectShowFilters/MPAudioRenderer/source/IAudioSink.h
  151. +61 −0 DirectShowFilters/MPAudioRenderer/source/IRenderDevice.h
  152. +33 −0 DirectShowFilters/MPAudioRenderer/source/IRenderFilter.h
  153. +30 −0 DirectShowFilters/MPAudioRenderer/source/ITimeStretch.h
  154. +128 −0 DirectShowFilters/MPAudioRenderer/source/MediaSeeking.cpp
  155. +752 −0 DirectShowFilters/MPAudioRenderer/source/MpAudioRenderer.cpp
  156. +5 −0 DirectShowFilters/MPAudioRenderer/source/MpAudioRenderer.def
  157. +152 −0 DirectShowFilters/MPAudioRenderer/source/MpAudioRenderer.h
  158. +179 −0 DirectShowFilters/MPAudioRenderer/source/MpAudioRenderer.rc
  159. +994 −0 DirectShowFilters/MPAudioRenderer/source/MultiSoundTouch.cpp
  160. +175 −0 DirectShowFilters/MPAudioRenderer/source/MultiSoundTouch.h
  161. +307 −0 DirectShowFilters/MPAudioRenderer/source/QueuedAudioSink.cpp
  162. +108 −0 DirectShowFilters/MPAudioRenderer/source/QueuedAudioSink.h
  163. +495 −0 DirectShowFilters/MPAudioRenderer/source/SampleRateConverterFilter.cpp
  164. +73 −0 DirectShowFilters/MPAudioRenderer/source/SampleRateConverterFilter.h
  165. +999 −0 DirectShowFilters/MPAudioRenderer/source/Settings.cpp
  166. +214 −0 DirectShowFilters/MPAudioRenderer/source/Settings.h
  167. +346 −0 DirectShowFilters/MPAudioRenderer/source/SettingsProp.cpp
  168. +40 −0 DirectShowFilters/MPAudioRenderer/source/SettingsProp.h
  169. +36 −0 DirectShowFilters/MPAudioRenderer/source/SharedInclude.h
  170. +238 −0 DirectShowFilters/MPAudioRenderer/source/SoundTouchEx.cpp
  171. +93 −0 DirectShowFilters/MPAudioRenderer/source/SoundTouchEx.h
  172. +238 −0 DirectShowFilters/MPAudioRenderer/source/StreamSanitizerFilter.cpp
  173. +51 −0 DirectShowFilters/MPAudioRenderer/source/StreamSanitizerFilter.h
  174. +235 −0 DirectShowFilters/MPAudioRenderer/source/SyncClock.cpp
  175. +83 −0 DirectShowFilters/MPAudioRenderer/source/SyncClock.h
  176. +242 −0 DirectShowFilters/MPAudioRenderer/source/SynchCorrection.cpp
  177. +102 −0 DirectShowFilters/MPAudioRenderer/source/SynchCorrection.h
  178. +54 −0 DirectShowFilters/MPAudioRenderer/source/ThreadDecouplingFilter.cpp
  179. +33 −0 DirectShowFilters/MPAudioRenderer/source/ThreadDecouplingFilter.h
  180. +180 −0 DirectShowFilters/MPAudioRenderer/source/TimeSource.cpp
  181. +22 −0 DirectShowFilters/MPAudioRenderer/source/TimeSource.h
  182. +669 −0 DirectShowFilters/MPAudioRenderer/source/TimeStretchFilter.cpp
  183. +150 −0 DirectShowFilters/MPAudioRenderer/source/TimeStretchFilter.h
  184. +58 −0 DirectShowFilters/MPAudioRenderer/source/VolumeHandler.cpp
  185. +33 −0 DirectShowFilters/MPAudioRenderer/source/VolumeHandler.h
  186. +1,292 −0 DirectShowFilters/MPAudioRenderer/source/WASAPIRenderFilter.cpp
  187. +151 −0 DirectShowFilters/MPAudioRenderer/source/WASAPIRenderFilter.h
  188. +1,429 −0 DirectShowFilters/MPAudioRenderer/source/WASAPIRenderer.cpp
  189. +125 −0 DirectShowFilters/MPAudioRenderer/source/WASAPIRenderer.h
  190. +92 −0 DirectShowFilters/MPAudioRenderer/source/WaitableState.cpp
  191. +57 −0 DirectShowFilters/MPAudioRenderer/source/WaitableState.h
  192. +29 −0 DirectShowFilters/MPAudioRenderer/source/alloctracing.h
  193. +425 −0 DirectShowFilters/MPAudioRenderer/source/dllmain.cpp
  194. +698 −0 DirectShowFilters/MPAudioRenderer/source/dllsetup.cpp
  195. +46 −0 DirectShowFilters/MPAudioRenderer/source/dllsetup.h
  196. +1,007 −0 DirectShowFilters/MPAudioRenderer/source/moreuuids.h
  197. +32 −0 DirectShowFilters/MPAudioRenderer/source/resource.h
  198. +44 −0 DirectShowFilters/MPAudioRenderer/source/stdafx.h
  199. +6 −0 Tools/WASAPI-test/source/guid.cpp
  200. +283 −0 Tools/WASAPI-test/source/main.cpp
  201. +399 −0 Tools/WASAPI-test/source/play.cpp
  202. +24 −0 Tools/WASAPI-test/source/play.h
  203. +351 −0 Tools/WASAPI-test/source/prefs.cpp
  204. +16 −0 Tools/WASAPI-test/source/prefs.h
  205. +20 −0 Tools/WASAPI-test/source/source3.sln
  206. +217 −0 Tools/WASAPI-test/source/source3.vcproj
  207. BIN mediaportal/Core.cpp/DirectShowHelper/bin/Debug/dshowhelper.dll
  208. BIN mediaportal/Core.cpp/DirectShowHelper/bin/Debug/dshowhelper.pdb
  209. BIN mediaportal/Core.cpp/DirectShowHelper/bin/Debug/vc100.pdb
  210. BIN mediaportal/Core.cpp/DirectShowHelper/bin/Release/dshowhelper.dll
  211. +20 −0 mediaportal/Core.cpp/DirectShowHelper/dshowhelper.sln
  212. +1 −1 mediaportal/Core.cpp/DirectShowHelper/source/EVRCustomPresenter.h
  213. +5 −0 mediaportal/Setup/setup.nsi
@@ -0,0 +1,3 @@
+@ECHO OFF
+
+call "VS_Rebuild_Release_AudioRenderer.bat" Debug
@@ -0,0 +1,10 @@
+@ECHO OFF
+
+rem build init
+set project=AudioRenderer
+call BuildInit.bat %1
+
+rem build
+echo.
+echo Building MPAudioRenderer...
+"%progpath%\Microsoft Visual Studio %vsver%\Common7\IDE\devenv.com" "..\DirectShowFilters\MPAudioRenderer\AudioRenderer.sln" /ReBuild "%BUILD_TYPE% unicode" >> %log%
@@ -34,6 +34,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DSUtil", "..\mediaportal\Co
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "system", "..\mediaportal\Core.cpp\mpc-hc_subs\src\thirdparty\VirtualDub\system\system.vcxproj", "{C2082189-3ECB-4079-91FA-89D3C8A305C0}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AudioRenderer", "MPAudioRenderer\AudioRenderer.vcxproj", "{D0620EF4-1313-40D5-9069-A82F6FE26994}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -140,6 +142,12 @@ Global
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Release|Win32.Build.0 = Release|Win32
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Release|x64.ActiveCfg = Release|x64
{C2082189-3ECB-4079-91FA-89D3C8A305C0}.Release|x64.Build.0 = Release|x64
+ {D0620EF4-1313-40D5-9069-A82F6FE26994}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D0620EF4-1313-40D5-9069-A82F6FE26994}.Debug|Win32.Build.0 = Debug|Win32
+ {D0620EF4-1313-40D5-9069-A82F6FE26994}.Debug|x64.ActiveCfg = Debug|Win32
+ {D0620EF4-1313-40D5-9069-A82F6FE26994}.Release|Win32.ActiveCfg = Release|Win32
+ {D0620EF4-1313-40D5-9069-A82F6FE26994}.Release|Win32.Build.0 = Release|Win32
+ {D0620EF4-1313-40D5-9069-A82F6FE26994}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Oops, something went wrong.
@@ -0,0 +1,65 @@
+//-----------------------------------------------------------------------------
+//
+// MONOGRAM AC3 Encoder
+//
+// Based on libavcodec AC-3 encoder
+//
+// Author : Igor Janos
+//
+//-----------------------------------------------------------------------------
+#pragma once
+
+#include "bits.h"
+
+#define AC3_MAX_CHANNELS 6 /* including LFE channel */
+#define NB_BLOCKS 6 /* number of PCM blocks inside an AC-3 frame */
+#define AC3_FRAME_SIZE (NB_BLOCKS * 256)
+
+/* exponent encoding strategy */
+#define EXP_REUSE 0
+#define EXP_NEW 1
+
+#define EXP_D15 1
+#define EXP_D25 2
+#define EXP_D45 3
+
+/** Delta bit allocation strategy */
+typedef enum {
+ DBA_REUSE = 0,
+ DBA_NEW,
+ DBA_NONE,
+ DBA_RESERVED
+} AC3DeltaStrategy;
+
+/** Channel mode (audio coding mode) */
+typedef enum {
+ AC3_CHMODE_DUALMONO = 0,
+ AC3_CHMODE_MONO,
+ AC3_CHMODE_STEREO,
+ AC3_CHMODE_3F,
+ AC3_CHMODE_2F1R,
+ AC3_CHMODE_3F1R,
+ AC3_CHMODE_2F2R,
+ AC3_CHMODE_3F2R
+} AC3ChannelMode;
+
+struct AC3CodecContext {
+
+ int sample_rate;
+ int bit_rate;
+ int channels;
+ int frame_size;
+ int cutoff;
+
+ void *priv_data; // encode context
+};
+
+
+/*
+ API na AC-3 encoder
+*/
+
+AC3CodecContext *ac3_encoder_open();
+void ac3_encoder_close(AC3CodecContext *encoder);
+int ac3_encoder_init(AC3CodecContext *encoder);
+int ac3_encoder_frame(AC3CodecContext *encoder, short *pcm_samples, uint8 *buf, int buf_size);
@@ -0,0 +1,134 @@
+//-----------------------------------------------------------------------------
+//
+// Musepack Demuxer
+//
+// Author : Igor Janos
+//
+//-----------------------------------------------------------------------------
+#include "..\source\stdafx.h"
+#include "bits.h"
+
+typedef UINT8 uint8;
+typedef UINT16 uint16;
+typedef UINT32 uint32;
+
+
+//-----------------------------------------------------------------------------
+//
+// Bitstream class
+//
+// podporuje citanie bitstreamu
+//
+//----------------------------------------------------------------------------
+
+const int32 Bitstream::EXP_GOLOMB_MAP[2][48] =
+{
+ {
+ 47, 31, 15, 0, 23, 27, 29, 30,
+ 7, 11, 13, 14, 39, 43, 45, 46,
+ 16, 3, 5, 10, 12, 19, 21, 26,
+ 28, 35, 37, 42, 44, 1, 2, 4,
+ 8, 17, 18, 20, 24, 6, 9, 22,
+ 25, 32, 33, 34, 36, 40, 38, 41
+ },
+ {
+ 0, 16, 1, 2, 4, 8, 32, 3,
+ 5, 10, 12, 15, 47, 7, 11, 13,
+ 14, 6, 9, 31, 35, 37, 42, 44,
+ 33, 34, 36, 40, 39, 43, 45, 46,
+ 17, 18, 20, 24, 19, 21, 26, 28,
+ 23, 27, 29, 30, 22, 25, 38, 41
+ }
+};
+
+const int32 Bitstream::EXP_GOLOMB_MAP_INV[2][48] =
+{
+ {
+ 3, 29, 30, 17, 31, 18, 37, 8,
+ 32, 38, 19, 9, 20, 10, 11, 2,
+ 16, 33, 34, 21, 35, 22, 39, 4,
+ 36, 40, 23, 5, 24, 6, 7, 1,
+ 41, 42, 43, 25, 44, 26, 46, 12,
+ 45, 47, 27, 13, 28, 14, 15, 0
+ },
+ {
+ 0, 2, 3, 7, 4, 8, 17, 13,
+ 5, 18, 9, 14, 10, 15, 16, 11,
+ 1, 32, 33, 36, 34, 37, 44, 40,
+ 35, 45, 38, 41, 39, 42, 43, 19,
+ 6, 24, 25, 20, 26, 21, 46, 28,
+ 27, 47, 22, 29, 23, 30, 31, 12
+ }
+};
+
+
+// Exp-Golomb Codes
+
+const int32 Bitstream::EXP_GOLOMB_SIZE[255] =
+{
+ 1, 3, 3, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
+ 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
+ 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
+ 13,13,13,13,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
+};
+
+uint32 Bitstream::Get_UE()
+{
+ int32 len = 0;
+ NeedBits24();
+ while (!UGetBits(1)) len++;
+ NeedBits24();
+ return (len == 0 ? 0 : (1<<len)-1 + UGetBits(len));
+}
+
+int32 Bitstream::Get_SE()
+{
+ int32 len = 0;
+ NeedBits24();
+ while (!UGetBits(1)) len++;
+ if (len == 0) return 0;
+ NeedBits24();
+ int32 val = (1 << len) | UGetBits(len);
+ return (val&1) ? -(val>>1) : (val>>1);
+}
+
+int32 Bitstream::Get_ME(int32 mode)
+{
+ // nacitame UE a potom podla mapovacej tabulky
+ int32 codeNum = Get_UE();
+ if (codeNum >= 48) return -1; // chyba
+ return EXP_GOLOMB_MAP[mode][codeNum];
+}
+
+int32 Bitstream::Get_TE(int32 range)
+{
+ /* ISO/IEC 14496-10 - Section 9.1 */
+ if (range > 1) {
+ return Get_UE();
+ } else {
+ return (!UGetBits(1))&0x01;
+ }
+}
+
+int32 Bitstream::Get_Golomb(int k)
+{
+ int32 l=0;
+ NeedBits();
+ while (UBits(8) == 0) {
+ l += 8;
+ DumpBits(8);
+ NeedBits();
+ }
+ while (UGetBits(1) == 0) l++;
+ NeedBits();
+ return (l << k) | UGetBits(k);
+}
+
@@ -0,0 +1,149 @@
+//-----------------------------------------------------------------------------
+//
+// Bitstream classes.
+//
+// Originally seen in Skal's mpeg-4 video codec. Modified by Igor Janos
+//
+//-----------------------------------------------------------------------------
+#pragma once
+
+// well.. I just like those
+#ifndef uint8
+typedef unsigned char uint8;
+typedef unsigned short uint16;
+typedef unsigned int uint32;
+typedef unsigned __int64 uint64;
+typedef __int8 int8;
+typedef __int16 int16;
+typedef __int32 int32;
+typedef __int64 int64;
+#endif
+
+//-------------------------------------------------------------------------
+//
+// Bitstream class
+//
+//-------------------------------------------------------------------------
+
+class Bitstream
+{
+public:
+ uint32 bitbuf; // bitbuffer
+ uint8 *buf; // byte buffer
+ int32 bits; // pocet bitov v bitbufferi
+ uint8 *start; // zaciatok bufferu
+
+public:
+ static const int32 EXP_GOLOMB_MAP[2][48];
+ static const int32 EXP_GOLOMB_MAP_INV[2][48];
+ static const int32 EXP_GOLOMB_SIZE[255];
+
+public:
+
+ // Konstruktory
+ Bitstream() : bitbuf(0), buf(NULL), bits(0) { };
+ Bitstream(uint8 *b) : bitbuf(0), buf(b), bits(0) { };
+ Bitstream(const Bitstream &b) : bitbuf(b.bitbuf), buf(b.buf), bits(b.bits) { };
+
+ // Operator priradenia = kopia stavu bitstreamu
+ Bitstream &operator =(const Bitstream &b) { bitbuf = b.bitbuf; buf = b.buf; bits = b.bits; return *this; };
+ Bitstream &operator =(const uint8 *b) { bitbuf = 0; buf = (uint8*)b; bits = 0; return *this; };
+ Bitstream &operator =(uint8 *b) { bitbuf = 0; buf = b; bits = 0; return *this; };
+
+ // Resetovanie stavu
+ inline void Init(const uint8 *b) { bitbuf = 0; buf = (uint8*)b; bits = 0; };
+ inline void Init(uint8 *b) { bitbuf = 0; buf = b; bits = 0; };
+
+ // Zistenie stavu bitstreamu
+ inline int32 BitsLeft() { return bits; };
+ inline uint32 BitBuf() { return bitbuf; };
+ inline uint8 *Position() { return buf - (bits/8); };
+
+ // Citanie z bitstreamu
+ inline void DumpBits(int32 n) { bitbuf <<= n; bits -= n; };
+ inline uint32 UBits(int32 n) { return (uint32)(bitbuf >> (32-n)); };
+ inline uint32 UGetBits(int32 n) { uint32 val = (uint32)(bitbuf >> (32-n)); bitbuf <<= n; bits -= n; return val; };
+ inline int32 SBits(int32 n) { return (int32)(bitbuf >> (32-n)); };
+ inline int32 SGetBits(int32 n) { int32 val = (int32)(bitbuf >> (32-n)); bitbuf <<= n; bits -= n; return val; };
+ inline void Markerbit() { DumpBits(1); }
+
+ // Reading variable length size field for Musepack SV8
+ inline int64 GetMpcSize() {
+ int64 ret=0;
+ uint8 tmp;
+ do {
+ NeedBits();
+ tmp = UGetBits(8);
+ ret = (ret<<7) | (tmp&0x7f);
+ } while (tmp&0x80);
+ return ret;
+ }
+
+ // AAC LATM
+ inline int64 LatmGetValue() {
+ NeedBits();
+ uint8 bytesForValue = UGetBits(2);
+ int64 value = 0;
+ for (int i=0; i<=bytesForValue; i++) {
+ NeedBits();
+ value <<= 8;
+ value |= UGetBits(8);
+ }
+ return value;
+ }
+
+ // Zarovnavanie na byty
+ inline int32 IsByteAligned() { return !(bits&0x07); };
+ inline void ByteAlign() { if (bits&0x07) DumpBits(bits&0x07); };
+
+ // Exp-Golomb Codes
+ uint32 Get_UE();
+ int32 Get_SE();
+ int32 Get_ME(int32 mode);
+ int32 Get_TE(int32 range);
+ int32 Get_Golomb(int k);
+
+ inline int32 Size_UE(uint32 val)
+ {
+ if (val<255) return EXP_GOLOMB_SIZE[val];
+ int32 isize=0;
+ val++;
+ if (val >= 0x10000) { isize+= 32; val = (val >> 16)-1; }
+ if (val >= 0x100) { isize+= 16; val = (val >> 8)-1; }
+ return EXP_GOLOMB_SIZE[val] + isize;
+ }
+
+ inline int32 Size_SE(int32 val) { return Size_UE(val <= 0 ? -val*2 : val*2 - 1); }
+ inline int32 Size_TE(int32 range, int32 v) { if (range == 1) return 1; return Size_UE(v); }
+
+ // Loadovanie bitov do bitbufferu
+ inline void NeedBits() { if (bits < 16) { bitbuf |= ((buf[0] << 8) | (buf[1])) << (16-bits); bits += 16; buf += 2; } };
+ inline void NeedBits24() { while (bits<24) { bitbuf |= (buf[0] << (24-bits)); buf++; bits+= 8; } };
+ inline void NeedBits32() { while (bits<32) { bitbuf |= (buf[0] << (24-bits)); buf++; bits+= 8; } };
+
+ // Pisanie do bitstreamu
+ inline void PutBits(int32 val, int32 num) {
+ bits += num;
+ if (num < 32) val &= (1<<num)-1;
+ if (bits > 32) {
+ bits -= 32;
+ bitbuf |= val >> (bits);
+ *buf++ = ( bitbuf >> 24 ) & 0xff;
+ *buf++ = ( bitbuf >> 16 ) & 0xff;
+ *buf++ = ( bitbuf >> 8 ) & 0xff;
+ *buf++ = ( bitbuf >> 0 ) & 0xff;
+ bitbuf = val << (32 - bits);
+ } else
+ bitbuf |= val << (32 - bits);
+ }
+ inline void WriteBits() {
+ while (bits >= 8) {
+ *buf++ = (bitbuf >> 24) & 0xff;
+ bitbuf <<= 8;
+ bits -= 8;
+ }
+ }
+ inline void Put_ByteAlign_Zero() { int32 bl=(bits)&0x07; if (bl<8) { PutBits(0,8-bl); } WriteBits(); }
+ inline void Put_ByteAlign_One() { int32 bl=(bits)&0x07; if (bl<8) { PutBits(0xffffff,8-bl); } WriteBits(); }
+
+};
Oops, something went wrong.

0 comments on commit 0ddcc4e

Please sign in to comment.