Browse Source

Updated VGMStream to r1050-925-g2b92a562, now with Atrac9 support.

master
Christopher Snowhill 2 years ago
parent
commit
ddc3da7576
100 changed files with 10122 additions and 1030 deletions
  1. +441
    -0
      Frameworks/libatrac9/libatrac9.xcodeproj/project.pbxproj
  2. +26
    -0
      Frameworks/libatrac9/libatrac9/Info.plist
  3. +63
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/.gitattributes
  4. +261
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/.gitignore
  5. +191
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/band_extension.c
  6. +13
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/band_extension.h
  7. +119
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/bit_allocation.c
  8. +6
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/bit_allocation.h
  9. +110
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/bit_reader.c
  10. +13
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/bit_reader.h
  11. +188
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/decinit.c
  12. +19
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/decinit.h
  13. +114
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/decoder.c
  14. +11
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/decoder.h
  15. +33
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/error_codes.h
  16. +152
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/huffCodes.c
  17. +1295
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/huffCodes.h
  18. +80
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/imdct.c
  19. +6
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/imdct.h
  20. +33
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/libatrac9.c
  21. +32
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/libatrac9.h
  22. +31
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/libatrac9.sln
  23. +162
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/libatrac9.vcxproj
  24. +105
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/libatrac9.vcxproj.filters
  25. +54
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/quantization.c
  26. +8
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/quantization.h
  27. +146
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/scale_factors.c
  28. +8
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/scale_factors.h
  29. +160
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/structures.h
  30. +7
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/tables.c
  31. +389
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/tables.h
  32. +423
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/unpack.c
  33. +23
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/unpack.h
  34. +30
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/utility.c
  35. +15
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/C/utility.h
  36. +42
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9.sln
  37. +119
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Atrac9Config.cs
  38. +127
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Atrac9Decoder.cs
  39. +33
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Atrac9Rng.cs
  40. +372
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/BandExtension.cs
  41. +140
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/BitAllocation.cs
  42. +91
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Block.cs
  43. +48
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Channel.cs
  44. +33
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/ChannelConfig.cs
  45. +20
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Frame.cs
  46. +62
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/HuffmanCodebook.cs
  47. +1352
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/HuffmanCodebooks.cs
  48. +8
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/LibAtrac9.csproj
  49. +57
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Quantization.cs
  50. +171
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/ScaleFactors.cs
  51. +33
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Stereo.cs
  52. +115
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Tables.cs
  53. +425
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Unpack.cs
  54. +22
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Utilities/Bit.cs
  55. +132
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Utilities/BitReader.cs
  56. +50
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Utilities/Helpers.cs
  57. +177
    -0
      Frameworks/libatrac9/libatrac9/LibAtrac9/CSharp/LibAtrac9/Utilities/Mdct.cs
  58. +70
    -0
      Frameworks/vgmstream/vgmstream.xcodeproj/project.pbxproj
  59. +15
    -2
      Frameworks/vgmstream/vgmstream/src/coding/at3_decoder.c
  60. +219
    -0
      Frameworks/vgmstream/vgmstream/src/coding/atrac9_decoder.c
  61. +19
    -10
      Frameworks/vgmstream/vgmstream/src/coding/coding.h
  62. +6
    -7
      Frameworks/vgmstream/vgmstream/src/coding/ffmpeg_decoder_utils_ea_xma.c
  63. +3
    -2
      Frameworks/vgmstream/vgmstream/src/coding/ima_decoder.c
  64. +2
    -2
      Frameworks/vgmstream/vgmstream/src/coding/mpeg_decoder.c
  65. +60
    -46
      Frameworks/vgmstream/vgmstream/src/coding/pcm_decoder.c
  66. +28
    -3
      Frameworks/vgmstream/vgmstream/src/coding/psx_decoder.c
  67. +1
    -1
      Frameworks/vgmstream/vgmstream/src/coding/vorbis_custom_decoder.c
  68. +0
    -4
      Frameworks/vgmstream/vgmstream/src/coding/xa_decoder.c
  69. +12
    -4
      Frameworks/vgmstream/vgmstream/src/formats.c
  70. +41
    -24
      Frameworks/vgmstream/vgmstream/src/layout/blocked_ea_1snh.c
  71. +26
    -34
      Frameworks/vgmstream/vgmstream/src/layout/blocked_ea_schl.c
  72. +4
    -3
      Frameworks/vgmstream/vgmstream/src/layout/xa_blocked.c
  73. +1
    -1
      Frameworks/vgmstream/vgmstream/src/meta/ahx.c
  74. +1
    -1
      Frameworks/vgmstream/vgmstream/src/meta/awc.c
  75. +107
    -28
      Frameworks/vgmstream/vgmstream/src/meta/ea_1snh.c
  76. +20
    -2
      Frameworks/vgmstream/vgmstream/src/meta/ea_eaac.c
  77. +51
    -46
      Frameworks/vgmstream/vgmstream/src/meta/ea_schl.c
  78. +1
    -1
      Frameworks/vgmstream/vgmstream/src/meta/fsb.c
  79. +63
    -24
      Frameworks/vgmstream/vgmstream/src/meta/fsb5.c
  80. +1
    -1
      Frameworks/vgmstream/vgmstream/src/meta/genh.c
  81. +40
    -8
      Frameworks/vgmstream/vgmstream/src/meta/gtd.c
  82. +75
    -1
      Frameworks/vgmstream/vgmstream/src/meta/hca_keys.h
  83. +49
    -0
      Frameworks/vgmstream/vgmstream/src/meta/ktss.c
  84. +3
    -1
      Frameworks/vgmstream/vgmstream/src/meta/meta.h
  85. +1
    -1
      Frameworks/vgmstream/vgmstream/src/meta/ngc_vid1.c
  86. +1
    -1
      Frameworks/vgmstream/vgmstream/src/meta/ogg_vorbis_file.c
  87. +1
    -1
      Frameworks/vgmstream/vgmstream/src/meta/ogl.c
  88. +1
    -1
      Frameworks/vgmstream/vgmstream/src/meta/p3d.c
  89. +1
    -1
      Frameworks/vgmstream/vgmstream/src/meta/ps3_msf.c
  90. +278
    -573
      Frameworks/vgmstream/vgmstream/src/meta/riff.c
  91. +1
    -1
      Frameworks/vgmstream/vgmstream/src/meta/sk_aud.c
  92. +1
    -1
      Frameworks/vgmstream/vgmstream/src/meta/sqex_scd.c
  93. +59
    -39
      Frameworks/vgmstream/vgmstream/src/meta/sxd.c
  94. +47
    -0
      Frameworks/vgmstream/vgmstream/src/meta/ta_aac.c
  95. +1
    -1
      Frameworks/vgmstream/vgmstream/src/meta/txth.c
  96. +42
    -18
      Frameworks/vgmstream/vgmstream/src/meta/ubi_raki.c
  97. +21
    -6
      Frameworks/vgmstream/vgmstream/src/meta/wwise.c
  98. +123
    -0
      Frameworks/vgmstream/vgmstream/src/meta/xnb.c
  99. +88
    -34
      Frameworks/vgmstream/vgmstream/src/meta/xvag.c
  100. +142
    -96
      Frameworks/vgmstream/vgmstream/src/vgmstream.c

+ 441
- 0
Frameworks/libatrac9/libatrac9.xcodeproj/project.pbxproj View File

@@ -0,0 +1,441 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objects = {

/* Begin PBXBuildFile section */
830EBDF020045FF80023AA10 /* tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBDB920045FF80023AA10 /* tables.c */; };
830EBDF120045FF80023AA10 /* libatrac9.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBDBA20045FF80023AA10 /* libatrac9.c */; };
830EBDF220045FF80023AA10 /* huffCodes.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBDBB20045FF80023AA10 /* huffCodes.c */; };
830EBDF320045FF80023AA10 /* imdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBDBC20045FF80023AA10 /* imdct.c */; };
830EBDF420045FF80023AA10 /* scale_factors.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDBD20045FF80023AA10 /* scale_factors.h */; };
830EBDF520045FF80023AA10 /* utility.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBDBE20045FF80023AA10 /* utility.c */; };
830EBDF620045FF80023AA10 /* quantization.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDBF20045FF80023AA10 /* quantization.h */; };
830EBDF720045FF80023AA10 /* band_extension.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBDC020045FF80023AA10 /* band_extension.c */; };
830EBDF820045FF80023AA10 /* unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBDC120045FF80023AA10 /* unpack.c */; };
830EBDF920045FF80023AA10 /* bit_reader.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDC220045FF80023AA10 /* bit_reader.h */; };
830EBDFA20045FF80023AA10 /* decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDC320045FF80023AA10 /* decoder.h */; };
830EBDFB20045FF80023AA10 /* decinit.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBDC420045FF80023AA10 /* decinit.c */; };
830EBDFC20045FF80023AA10 /* bit_allocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDC520045FF80023AA10 /* bit_allocation.h */; };
830EBDFE20045FF80023AA10 /* libatrac9.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDC720045FF80023AA10 /* libatrac9.h */; settings = {ATTRIBUTES = (Public, ); }; };
830EBDFF20045FF80023AA10 /* tables.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDC820045FF80023AA10 /* tables.h */; };
830EBE0020045FF80023AA10 /* scale_factors.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBDC920045FF80023AA10 /* scale_factors.c */; };
830EBE0120045FF80023AA10 /* error_codes.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDCA20045FF80023AA10 /* error_codes.h */; };
830EBE0220045FF80023AA10 /* imdct.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDCB20045FF80023AA10 /* imdct.h */; };
830EBE0420045FF80023AA10 /* huffCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDCD20045FF80023AA10 /* huffCodes.h */; };
830EBE0520045FF80023AA10 /* decinit.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDCE20045FF80023AA10 /* decinit.h */; };
830EBE0620045FF80023AA10 /* decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBDCF20045FF80023AA10 /* decoder.c */; };
830EBE0720045FF80023AA10 /* bit_reader.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBDD020045FF80023AA10 /* bit_reader.c */; };
830EBE0820045FF80023AA10 /* unpack.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDD120045FF80023AA10 /* unpack.h */; };
830EBE0A20045FF80023AA10 /* quantization.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBDD320045FF80023AA10 /* quantization.c */; };
830EBE0B20045FF80023AA10 /* utility.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDD420045FF80023AA10 /* utility.h */; };
830EBE0C20045FF80023AA10 /* band_extension.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDD520045FF80023AA10 /* band_extension.h */; };
830EBE0D20045FF80023AA10 /* bit_allocation.c in Sources */ = {isa = PBXBuildFile; fileRef = 830EBDD620045FF80023AA10 /* bit_allocation.c */; };
830EBE0E20045FF80023AA10 /* structures.h in Headers */ = {isa = PBXBuildFile; fileRef = 830EBDD720045FF80023AA10 /* structures.h */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
830EBD8720045F190023AA10 /* libatrac9.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = libatrac9.framework; sourceTree = BUILT_PRODUCTS_DIR; };
830EBD8B20045F190023AA10 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
830EBDB920045FF80023AA10 /* tables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tables.c; sourceTree = "<group>"; };
830EBDBA20045FF80023AA10 /* libatrac9.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = libatrac9.c; sourceTree = "<group>"; };
830EBDBB20045FF80023AA10 /* huffCodes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = huffCodes.c; sourceTree = "<group>"; };
830EBDBC20045FF80023AA10 /* imdct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = imdct.c; sourceTree = "<group>"; };
830EBDBD20045FF80023AA10 /* scale_factors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scale_factors.h; sourceTree = "<group>"; };
830EBDBE20045FF80023AA10 /* utility.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = utility.c; sourceTree = "<group>"; };
830EBDBF20045FF80023AA10 /* quantization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = quantization.h; sourceTree = "<group>"; };
830EBDC020045FF80023AA10 /* band_extension.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = band_extension.c; sourceTree = "<group>"; };
830EBDC120045FF80023AA10 /* unpack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = unpack.c; sourceTree = "<group>"; };
830EBDC220045FF80023AA10 /* bit_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bit_reader.h; sourceTree = "<group>"; };
830EBDC320045FF80023AA10 /* decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = decoder.h; sourceTree = "<group>"; };
830EBDC420045FF80023AA10 /* decinit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = decinit.c; sourceTree = "<group>"; };
830EBDC520045FF80023AA10 /* bit_allocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bit_allocation.h; sourceTree = "<group>"; };
830EBDC720045FF80023AA10 /* libatrac9.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libatrac9.h; sourceTree = "<group>"; };
830EBDC820045FF80023AA10 /* tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tables.h; sourceTree = "<group>"; };
830EBDC920045FF80023AA10 /* scale_factors.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = scale_factors.c; sourceTree = "<group>"; };
830EBDCA20045FF80023AA10 /* error_codes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = error_codes.h; sourceTree = "<group>"; };
830EBDCB20045FF80023AA10 /* imdct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = imdct.h; sourceTree = "<group>"; };
830EBDCD20045FF80023AA10 /* huffCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = huffCodes.h; sourceTree = "<group>"; };
830EBDCE20045FF80023AA10 /* decinit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = decinit.h; sourceTree = "<group>"; };
830EBDCF20045FF80023AA10 /* decoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = decoder.c; sourceTree = "<group>"; };
830EBDD020045FF80023AA10 /* bit_reader.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bit_reader.c; sourceTree = "<group>"; };
830EBDD120045FF80023AA10 /* unpack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unpack.h; sourceTree = "<group>"; };
830EBDD320045FF80023AA10 /* quantization.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = quantization.c; sourceTree = "<group>"; };
830EBDD420045FF80023AA10 /* utility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utility.h; sourceTree = "<group>"; };
830EBDD520045FF80023AA10 /* band_extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = band_extension.h; sourceTree = "<group>"; };
830EBDD620045FF80023AA10 /* bit_allocation.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bit_allocation.c; sourceTree = "<group>"; };
830EBDD720045FF80023AA10 /* structures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = structures.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
830EBD8320045F190023AA10 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
830EBD7D20045F190023AA10 = {
isa = PBXGroup;
children = (
830EBD8920045F190023AA10 /* libatrac9 */,
830EBD8820045F190023AA10 /* Products */,
);
sourceTree = "<group>";
};
830EBD8820045F190023AA10 /* Products */ = {
isa = PBXGroup;
children = (
830EBD8720045F190023AA10 /* libatrac9.framework */,
);
name = Products;
sourceTree = "<group>";
};
830EBD8920045F190023AA10 /* libatrac9 */ = {
isa = PBXGroup;
children = (
830EBD9C20045FF80023AA10 /* LibAtrac9 */,
830EBD8B20045F190023AA10 /* Info.plist */,
);
path = libatrac9;
sourceTree = "<group>";
};
830EBD9C20045FF80023AA10 /* LibAtrac9 */ = {
isa = PBXGroup;
children = (
830EBDB820045FF80023AA10 /* C */,
);
path = LibAtrac9;
sourceTree = "<group>";
};
830EBDB820045FF80023AA10 /* C */ = {
isa = PBXGroup;
children = (
830EBDC020045FF80023AA10 /* band_extension.c */,
830EBDD520045FF80023AA10 /* band_extension.h */,
830EBDD620045FF80023AA10 /* bit_allocation.c */,
830EBDC520045FF80023AA10 /* bit_allocation.h */,
830EBDD020045FF80023AA10 /* bit_reader.c */,
830EBDC220045FF80023AA10 /* bit_reader.h */,
830EBDC420045FF80023AA10 /* decinit.c */,
830EBDCE20045FF80023AA10 /* decinit.h */,
830EBDCF20045FF80023AA10 /* decoder.c */,
830EBDC320045FF80023AA10 /* decoder.h */,
830EBDCA20045FF80023AA10 /* error_codes.h */,
830EBDBB20045FF80023AA10 /* huffCodes.c */,
830EBDCD20045FF80023AA10 /* huffCodes.h */,
830EBDBC20045FF80023AA10 /* imdct.c */,
830EBDCB20045FF80023AA10 /* imdct.h */,
830EBDBA20045FF80023AA10 /* libatrac9.c */,
830EBDC720045FF80023AA10 /* libatrac9.h */,
830EBDD320045FF80023AA10 /* quantization.c */,
830EBDBF20045FF80023AA10 /* quantization.h */,
830EBDC920045FF80023AA10 /* scale_factors.c */,
830EBDBD20045FF80023AA10 /* scale_factors.h */,
830EBDD720045FF80023AA10 /* structures.h */,
830EBDB920045FF80023AA10 /* tables.c */,
830EBDC820045FF80023AA10 /* tables.h */,
830EBDC120045FF80023AA10 /* unpack.c */,
830EBDD120045FF80023AA10 /* unpack.h */,
830EBDBE20045FF80023AA10 /* utility.c */,
830EBDD420045FF80023AA10 /* utility.h */,
);
path = C;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
830EBD8420045F190023AA10 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
830EBDFE20045FF80023AA10 /* libatrac9.h in Headers */,
830EBE0220045FF80023AA10 /* imdct.h in Headers */,
830EBE0520045FF80023AA10 /* decinit.h in Headers */,
830EBE0420045FF80023AA10 /* huffCodes.h in Headers */,
830EBE0B20045FF80023AA10 /* utility.h in Headers */,
830EBE0820045FF80023AA10 /* unpack.h in Headers */,
830EBDF420045FF80023AA10 /* scale_factors.h in Headers */,
830EBE0C20045FF80023AA10 /* band_extension.h in Headers */,
830EBE0120045FF80023AA10 /* error_codes.h in Headers */,
830EBDFA20045FF80023AA10 /* decoder.h in Headers */,
830EBDFF20045FF80023AA10 /* tables.h in Headers */,
830EBDF920045FF80023AA10 /* bit_reader.h in Headers */,
830EBE0E20045FF80023AA10 /* structures.h in Headers */,
830EBDFC20045FF80023AA10 /* bit_allocation.h in Headers */,
830EBDF620045FF80023AA10 /* quantization.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
830EBD8620045F190023AA10 /* libatrac9 */ = {
isa = PBXNativeTarget;
buildConfigurationList = 830EBD8F20045F190023AA10 /* Build configuration list for PBXNativeTarget "libatrac9" */;
buildPhases = (
830EBD8220045F190023AA10 /* Sources */,
830EBD8320045F190023AA10 /* Frameworks */,
830EBD8420045F190023AA10 /* Headers */,
830EBD8520045F190023AA10 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = libatrac9;
productName = libatrac9;
productReference = 830EBD8720045F190023AA10 /* libatrac9.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
830EBD7E20045F190023AA10 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0920;
ORGANIZATIONNAME = "Christopher Snowhill";
TargetAttributes = {
830EBD8620045F190023AA10 = {
CreatedOnToolsVersion = 9.2;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 830EBD8120045F190023AA10 /* Build configuration list for PBXProject "libatrac9" */;
compatibilityVersion = "Xcode 8.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 830EBD7D20045F190023AA10;
productRefGroup = 830EBD8820045F190023AA10 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
830EBD8620045F190023AA10 /* libatrac9 */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
830EBD8520045F190023AA10 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
830EBD8220045F190023AA10 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
830EBE0620045FF80023AA10 /* decoder.c in Sources */,
830EBDF720045FF80023AA10 /* band_extension.c in Sources */,
830EBE0020045FF80023AA10 /* scale_factors.c in Sources */,
830EBDF520045FF80023AA10 /* utility.c in Sources */,
830EBDFB20045FF80023AA10 /* decinit.c in Sources */,
830EBE0720045FF80023AA10 /* bit_reader.c in Sources */,
830EBE0A20045FF80023AA10 /* quantization.c in Sources */,
830EBDF820045FF80023AA10 /* unpack.c in Sources */,
830EBDF020045FF80023AA10 /* tables.c in Sources */,
830EBDF320045FF80023AA10 /* imdct.c in Sources */,
830EBDF220045FF80023AA10 /* huffCodes.c in Sources */,
830EBDF120045FF80023AA10 /* libatrac9.c in Sources */,
830EBE0D20045FF80023AA10 /* bit_allocation.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
830EBD8D20045F190023AA10 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INSTALL_PATH = "@loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
830EBD8E20045F190023AA10 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INSTALL_PATH = "@loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
830EBD9020045F190023AA10 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = N6E749HJ2X;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
HEADER_SEARCH_PATHS = libatrac9/LibAtrac9/C;
INFOPLIST_FILE = libatrac9/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.7;
PRODUCT_BUNDLE_IDENTIFIER = net.kode54.libatrac9;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
};
name = Debug;
};
830EBD9120045F190023AA10 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = N6E749HJ2X;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
HEADER_SEARCH_PATHS = libatrac9/LibAtrac9/C;
INFOPLIST_FILE = libatrac9/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.7;
PRODUCT_BUNDLE_IDENTIFIER = net.kode54.libatrac9;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
830EBD8120045F190023AA10 /* Build configuration list for PBXProject "libatrac9" */ = {
isa = XCConfigurationList;
buildConfigurations = (
830EBD8D20045F190023AA10 /* Debug */,
830EBD8E20045F190023AA10 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
830EBD8F20045F190023AA10 /* Build configuration list for PBXNativeTarget "libatrac9" */ = {
isa = XCConfigurationList;
buildConfigurations = (
830EBD9020045F190023AA10 /* Debug */,
830EBD9120045F190023AA10 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 830EBD7E20045F190023AA10 /* Project object */;
}

+ 26
- 0
Frameworks/libatrac9/libatrac9/Info.plist View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2018 Christopher Snowhill. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

+ 63
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/.gitattributes View File

@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

+ 261
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/.gitignore View File

@@ -0,0 +1,261 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
project.fragment.lock.json
artifacts/

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
#*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

# Microsoft Azure Build Output
csx/
*.build.csdef

# Microsoft Azure Emulator
ecf/
rcf/

# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe
paket-files/

# FAKE - F# Make
.fake/

# JetBrains Rider
.idea/
*.sln.iml

# CodeRush
.cr/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc

+ 191
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/band_extension.c View File

@@ -0,0 +1,191 @@
#include "band_extension.h"
#include "tables.h"
#include "utility.h"
#include <math.h>

void ApplyBandExtension(block* block)
{
if (!block->BandExtensionEnabled || !block->HasExtensionData) return;

for (int i = 0; i < block->ChannelCount; i++)
{
ApplyBandExtensionChannel(&block->Channels[i]);
}
}

void ApplyBandExtensionChannel(channel* channel)
{
const int groupAUnit = channel->Block->QuantizationUnitCount;
int* scaleFactors = channel->ScaleFactors;
double* spectra = channel->Spectra;
double scales[6];
int* values = channel->BexValues;

const bex_group* bex_info = &BexGroupInfo[channel->Block->QuantizationUnitCount - 13];
const int bandCount = bex_info->band_count;
const int groupBUnit = bex_info->group_b_unit;
const int groupCUnit = bex_info->group_c_unit;

const int totalUnits = max(groupCUnit, 22);
const int bexQuantUnits = totalUnits - groupAUnit;

const int groupABin = QuantUnitToCoeffIndex[groupAUnit];
const int groupBBin = QuantUnitToCoeffIndex[groupBUnit];
const int groupCBin = QuantUnitToCoeffIndex[groupCUnit];
const int totalBins = QuantUnitToCoeffIndex[totalUnits];

FillHighFrequencies(spectra, groupABin, groupBBin, groupCBin, totalBins);

double groupAScale, groupBScale, groupCScale;
double rate, scale, mult;

switch (channel->BexMode)
{
case 0:
switch (bandCount)
{
case 3:
scales[0] = BexMode0Bands3[0][values[0]];
scales[1] = BexMode0Bands3[1][values[0]];
scales[2] = BexMode0Bands3[2][values[1]];
scales[3] = BexMode0Bands3[3][values[2]];
scales[4] = BexMode0Bands3[4][values[3]];
break;
case 4:
scales[0] = BexMode0Bands4[0][values[0]];
scales[1] = BexMode0Bands4[1][values[0]];
scales[2] = BexMode0Bands4[2][values[1]];
scales[3] = BexMode0Bands4[3][values[2]];
scales[4] = BexMode0Bands4[4][values[3]];
break;
case 5:
scales[0] = BexMode0Bands5[0][values[0]];
scales[1] = BexMode0Bands5[1][values[1]];
scales[2] = BexMode0Bands5[2][values[1]];
break;
}

scales[bexQuantUnits - 1] = SpectrumScale[scaleFactors[groupAUnit]];

AddNoiseToSpectrum(channel, QuantUnitToCoeffIndex[totalUnits - 1],
QuantUnitToCoeffCount[totalUnits - 1]);
ScaleBexQuantUnits(spectra, scales, groupAUnit, totalUnits);
break;
case 1:
for (int i = groupAUnit; i < totalUnits; i++)
{
scales[i - groupAUnit] = SpectrumScale[scaleFactors[i]];
}

AddNoiseToSpectrum(channel, groupABin, totalBins - groupABin);
ScaleBexQuantUnits(spectra, scales, groupAUnit, totalUnits);
break;
case 2:
groupAScale = BexMode2Scale[values[0]];
groupBScale = BexMode2Scale[values[1]];

for (int i = groupABin; i < groupBBin; i++)
{
spectra[i] *= groupAScale;
}

for (int i = groupBBin; i < groupCBin; i++)
{
spectra[i] *= groupBScale;
}
return;
case 3:
rate = pow(2, BexMode3Rate[values[1]]);
scale = BexMode3Initial[values[0]];
for (int i = groupABin; i < totalBins; i++)
{
scale *= rate;
spectra[i] *= scale;
}
return;
case 4:
mult = BexMode4Multiplier[values[0]];
groupAScale = 0.7079468 * mult;
groupBScale = 0.5011902 * mult;
groupCScale = 0.3548279 * mult;

for (int i = groupABin; i < groupBBin; i++)
{
spectra[i] *= groupAScale;
}

for (int i = groupBBin; i < groupCBin; i++)
{
spectra[i] *= groupBScale;
}

for (int i = groupCBin; i < totalBins; i++)
{
spectra[i] *= groupCScale;
}
}
}

void ScaleBexQuantUnits(double* spectra, double* scales, int startUnit, int totalUnits)
{
for (int i = startUnit; i < totalUnits; i++)
{
for (int k = QuantUnitToCoeffIndex[i]; k < QuantUnitToCoeffIndex[i + 1]; k++)
{
spectra[k] *= scales[i - startUnit];
}
}
}

void FillHighFrequencies(double* spectra, int groupABin, int groupBBin, int groupCBin, int totalBins)
{
for (int i = 0; i < groupBBin - groupABin; i++)
{
spectra[groupABin + i] = spectra[groupABin - i - 1];
}

for (int i = 0; i < groupCBin - groupBBin; i++)
{
spectra[groupBBin + i] = spectra[groupBBin - i - 1];
}

for (int i = 0; i < totalBins - groupCBin; i++)
{
spectra[groupCBin + i] = spectra[groupCBin - i - 1];
}
}

void AddNoiseToSpectrum(channel* channel, int index, int count)
{
if (!channel->rng.initialized)
{
int* sf = channel->ScaleFactors;
const unsigned short seed = (unsigned short)(543 * (sf[8] + sf[12] + sf[15] + 1));
rng_init(&channel->rng, seed);
}
for (int i = 0; i < count; i++)
{
channel->Spectra[i + index] = rng_next(&channel->rng) / 65535.0 * 2.0 - 1.0;
}
}

void rng_init(rng_cxt* rng, unsigned short seed)
{
const int startValue = 0x4D93 * (seed ^ (seed >> 14));

rng->stateA = (unsigned short)(3 - startValue);
rng->stateB = (unsigned short)(2 - startValue);
rng->stateC = (unsigned short)(1 - startValue);
rng->stateD = (unsigned short)(0 - startValue);
rng->initialized = TRUE;
}

unsigned short rng_next(rng_cxt* rng)
{
const unsigned short t = (unsigned short)(rng->stateD ^ (rng->stateD << 5));
rng->stateD = rng->stateC;
rng->stateC = rng->stateB;
rng->stateB = rng->stateA;
rng->stateA = (unsigned short)(t ^ rng->stateA ^ ((t ^ (rng->stateA >> 5)) >> 4));
return rng->stateA;
}

+ 13
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/band_extension.h View File

@@ -0,0 +1,13 @@
#pragma once

#include "structures.h"

void ApplyBandExtension(block* block);
void ApplyBandExtensionChannel(channel* channel);

void ScaleBexQuantUnits(double* spectra, double* scales, int startUnit, int totalUnits);
void FillHighFrequencies(double* spectra, int groupABin, int groupBBin, int groupCBin, int totalBins);
void AddNoiseToSpectrum(channel* channel, int index, int count);

void rng_init(rng_cxt* rng, unsigned short seed);
unsigned short rng_next(rng_cxt* rng);

+ 119
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/bit_allocation.c View File

@@ -0,0 +1,119 @@
#include "bit_allocation.h"
#include "tables.h"
#include "utility.h"
#include <string.h>

at9_status CreateGradient(block* block)
{
int valueCount = block->GradientEndValue - block->GradientStartValue;
int unitCount = block->GradientEndUnit - block->GradientStartUnit;

for (int i = 0; i < block->GradientEndUnit; i++)
{
block->Gradient[i] = block->GradientStartValue;
}

for (int i = block->GradientEndUnit; i <= block->QuantizationUnitCount; i++)
{
block->Gradient[i] = block->GradientEndValue;
}
if (unitCount <= 0) return ERR_SUCCESS;
if (valueCount == 0) return ERR_SUCCESS;

const unsigned char* curve = GradientCurves[unitCount - 1];
if (valueCount <= 0)
{
double scale = (-valueCount - 1) / 31.0;
int baseVal = block->GradientStartValue - 1;
for (int i = block->GradientStartUnit; i < block->GradientEndUnit; i++)
{
block->Gradient[i] = baseVal - (int)(curve[i - block->GradientStartUnit] * scale);
}
}
else
{
double scale = (valueCount - 1) / 31.0;
int baseVal = block->GradientStartValue + 1;
for (int i = block->GradientStartUnit; i < block->GradientEndUnit; i++)
{
block->Gradient[i] = baseVal + (int)(curve[i - block->GradientStartUnit] * scale);
}
}

return ERR_SUCCESS;
}

void CalculateMask(channel* channel)
{
memset(channel->PrecisionMask, 0, sizeof(channel->PrecisionMask));
for (int i = 1; i < channel->Block->QuantizationUnitCount; i++)
{
const int delta = channel->ScaleFactors[i] - channel->ScaleFactors[i - 1];
if (delta > 1)
{
channel->PrecisionMask[i] += min(delta - 1, 5);
}
else if (delta < -1)
{
channel->PrecisionMask[i - 1] += min(delta * -1 - 1, 5);
}
}
}

void CalculatePrecisions(channel* channel)
{
block* block = channel->Block;

if (block->GradientMode != 0)
{
for (int i = 0; i < block->QuantizationUnitCount; i++)
{
channel->Precisions[i] = channel->ScaleFactors[i] + channel->PrecisionMask[i] - block->Gradient[i];
if (channel->Precisions[i] > 0)
{
switch (block->GradientMode)
{
case 1:
channel->Precisions[i] /= 2;
break;
case 2:
channel->Precisions[i] = 3 * channel->Precisions[i] / 8;
break;
case 3:
channel->Precisions[i] /= 4;
break;
}
}
}
}
else
{
for (int i = 0; i < block->QuantizationUnitCount; i++)
{
channel->Precisions[i] = channel->ScaleFactors[i] - block->Gradient[i];
}
}

for (int i = 0; i < block->QuantizationUnitCount; i++)
{
if (channel->Precisions[i] < 1)
{
channel->Precisions[i] = 1;
}
}

for (int i = 0; i < block->GradientBoundary; i++)
{
channel->Precisions[i]++;
}

for (int i = 0; i < block->QuantizationUnitCount; i++)
{
channel->PrecisionsFine[i] = 0;
if (channel->Precisions[i] > 15)
{
channel->PrecisionsFine[i] = channel->Precisions[i] - 15;
channel->Precisions[i] = 15;
}
}
}

+ 6
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/bit_allocation.h View File

@@ -0,0 +1,6 @@
#pragma once
#include "unpack.h"

at9_status CreateGradient(block* block);
void CalculateMask(channel* channel);
void CalculatePrecisions(channel* channel);

+ 110
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/bit_reader.c View File

@@ -0,0 +1,110 @@
#include "bit_reader.h"
#include "utility.h"

static int peek_int_fallback(bit_reader_cxt* br, int bit_count);

void init_bit_reader_cxt(bit_reader_cxt* br, const void * buffer)
{
br->buffer = buffer;
br->position = 0;
}

int read_int(bit_reader_cxt* br, const int bits)
{
const int value = peek_int(br, bits);
br->position += bits;
return value;
}

int read_signed_int(bit_reader_cxt* br, const int bits)
{
const int value = peek_int(br, bits);
br->position += bits;
return SignExtend32(value, bits);
}

int read_offset_binary(bit_reader_cxt* br, const int bits)
{
const int offset = 1 << (bits - 1);
const int value = peek_int(br, bits) - offset;
br->position += bits;
return value;
}

int peek_int(bit_reader_cxt* br, const int bits)
{
const int byte_index = br->position / 8;
const int bit_index = br->position % 8;
const unsigned char* buffer = br->buffer;

if (bits <= 9)
{
int value = buffer[byte_index] << 8 | buffer[byte_index + 1];
value &= 0xFFFF >> bit_index;
value >>= 16 - bits - bit_index;
return value;
}

if (bits <= 17)
{
int value = buffer[byte_index] << 16 | buffer[byte_index + 1] << 8 | buffer[byte_index + 2];
value &= 0xFFFFFF >> bit_index;
value >>= 24 - bits - bit_index;
return value;
}

if (bits <= 25)
{
int value = buffer[byte_index] << 24
| buffer[byte_index + 1] << 16
| buffer[byte_index + 2] << 8
| buffer[byte_index + 3];

value &= (int)(0xFFFFFFFF >> bit_index);
value >>= 32 - bits - bit_index;
return value;
}
return peek_int_fallback(br, bits);
}

void align_position(bit_reader_cxt* br, const unsigned int multiple)
{
const int position = br->position;
if (position % multiple == 0)
{
return;
}

br->position = position + multiple - position % multiple;
}

static int peek_int_fallback(bit_reader_cxt* br, int bit_count)
{
int value = 0;
int byte_index = br->position / 8;
int bit_index = br->position % 8;
const unsigned char* buffer = br->buffer;

while (bit_count > 0)
{
if (bit_index >= 8)
{
bit_index = 0;
byte_index++;
}

int bits_to_read = bit_count;
if (bits_to_read > 8 - bit_index)
{
bits_to_read = 8 - bit_index;
}

const int mask = 0xFF >> bit_index;
const int current_byte = (mask & buffer[byte_index]) >> (8 - bit_index - bits_to_read);

value = (value << bits_to_read) | current_byte;
bit_index += bits_to_read;
bit_count -= bits_to_read;
}
return value;
}

+ 13
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/bit_reader.h View File

@@ -0,0 +1,13 @@
#pragma once

typedef struct {
const unsigned char * buffer;
int position;
} bit_reader_cxt;

void init_bit_reader_cxt(bit_reader_cxt* br, const void * buffer);
int peek_int(bit_reader_cxt* br, const int bits);
int read_int(bit_reader_cxt* br, const int bits);
int read_signed_int(bit_reader_cxt* br, const int bits);
int read_offset_binary(bit_reader_cxt* br, const int bits);
void align_position(bit_reader_cxt* br, const unsigned int multiple);

+ 188
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/decinit.c View File

@@ -0,0 +1,188 @@
#include "bit_reader.h"
#include "decinit.h"
#include "error_codes.h"
#include "structures.h"
#include "tables.h"
#include <string.h>
#include <math.h>
#include "utility.h"

static int BlockTypeToChannelCount(BlockType block_type);

at9_status init_decoder(atrac9_handle* handle, unsigned char* config_data, int wlength)
{
ERROR_CHECK(init_config_data(&handle->config, config_data));
ERROR_CHECK(init_frame(handle));
init_mdct_tables(handle->config.FrameSamplesPower);
init_huffman_codebooks();
handle->wlength = wlength;
handle->initialized = 1;
return ERR_SUCCESS;
}

at9_status init_config_data(ConfigData* config, unsigned char* config_data)
{
memcpy(config->ConfigData, config_data, CONFIG_DATA_SIZE);
ERROR_CHECK(read_config_data(config));

config->FramesPerSuperframe = 1 << config->SuperframeIndex;
config->SuperframeBytes = config->FrameBytes << config->SuperframeIndex;

config->ChannelConfig = ChannelConfigs[config->ChannelConfigIndex];
config->ChannelCount = config->ChannelConfig.ChannelCount;
config->SampleRate = SampleRates[config->SampleRateIndex];
config->HighSampleRate = config->SampleRateIndex > 7;
config->FrameSamplesPower = SamplingRateIndexToFrameSamplesPower[config->SampleRateIndex];
config->FrameSamples = 1 << config->FrameSamplesPower;
config->SuperframeSamples = config->FrameSamples * config->FramesPerSuperframe;

return ERR_SUCCESS;
}

at9_status read_config_data(ConfigData* config)
{
bit_reader_cxt br;
init_bit_reader_cxt(&br, &config->ConfigData);

const int header = read_int(&br, 8);
config->SampleRateIndex = read_int(&br, 4);
config->ChannelConfigIndex = read_int(&br, 3);
const int validation_bit = read_int(&br, 1);
config->FrameBytes = read_int(&br, 11) + 1;
config->SuperframeIndex = read_int(&br, 2);

if (header != 0xFE || validation_bit != 0)
{
return ERR_BAD_CONFIG_DATA;
}

return ERR_SUCCESS;
}

at9_status init_frame(atrac9_handle* handle)
{
const int block_count = handle->config.ChannelConfig.BlockCount;
handle->frame.config = &handle->config;

for (int i = 0; i < block_count; i++)
{
ERROR_CHECK(init_block(&handle->frame.Blocks[i], &handle->frame, i));
}

return ERR_SUCCESS;
}

at9_status init_block(block* block, frame* parent_frame, int block_index)
{
block->Frame = parent_frame;
block->BlockIndex = block_index;
block->config = parent_frame->config;
block->BlockType = block->config->ChannelConfig.Types[block_index];
block->ChannelCount = BlockTypeToChannelCount(block->BlockType);

for (int i = 0; i < block->ChannelCount; i++)
{
ERROR_CHECK(init_channel(&block->Channels[i], block, i));
}

return ERR_SUCCESS;
}

at9_status init_channel(channel* channel, block* parent_block, int channel_index)
{
channel->Block = parent_block;
channel->Frame = parent_block->Frame;
channel->config = parent_block->config;
channel->ChannelIndex = channel_index;
channel->mdct.bits = parent_block->config->FrameSamplesPower;
return ERR_SUCCESS;
}

void init_huffman_codebooks()
{
init_huffman_set(HuffmanScaleFactorsUnsigned, sizeof(HuffmanScaleFactorsUnsigned) / sizeof(HuffmanCodebook));
init_huffman_set(HuffmanScaleFactorsSigned, sizeof(HuffmanScaleFactorsSigned) / sizeof(HuffmanCodebook));
init_huffman_set(HuffmanSpectrum, sizeof(HuffmanSpectrum) / sizeof(HuffmanCodebook));
}

void init_huffman_set(const HuffmanCodebook* codebooks, int count)
{
for (int i = 0; i < count; i++)
{
InitHuffmanCodebook(&codebooks[i]);
}
}

void init_mdct_tables(int frameSizePower)
{
for (int i = 0; i < 9; i++)
{
GenerateTrigTables(i);
GenerateShuffleTable(i);
}
GenerateMdctWindow(frameSizePower);
GenerateImdctWindow(frameSizePower);
}

void GenerateTrigTables(int sizeBits)
{
const int size = 1 << sizeBits;
double* sinTab = SinTables[sizeBits];
double* cosTab = CosTables[sizeBits];

for (int i = 0; i < size; i++)
{
const double value = M_PI * (4 * i + 1) / (4 * size);
sinTab[i] = sin(value);
cosTab[i] = cos(value);
}
}

void GenerateShuffleTable(int sizeBits)
{
const int size = 1 << sizeBits;
int* table = ShuffleTables[sizeBits];

for (int i = 0; i < size; i++)
{
table[i] = BitReverse32(i ^ (i / 2), sizeBits);
}
}

void GenerateMdctWindow(int frameSizePower)
{
const int frameSize = 1 << frameSizePower;
double* mdct = MdctWindow[frameSizePower - 6];

for (int i = 0; i < frameSize; i++)
{
mdct[i] = (sin(((i + 0.5) / frameSize - 0.5) * M_PI) + 1.0) * 0.5;
}
}

void GenerateImdctWindow(int frameSizePower)
{
const int frameSize = 1 << frameSizePower;
double* imdct = ImdctWindow[frameSizePower - 6];
double* mdct = MdctWindow[frameSizePower - 6];

for (int i = 0; i < frameSize; i++)
{
imdct[i] = mdct[i] / (mdct[frameSize - 1 - i] * mdct[frameSize - 1 - i] + mdct[i] * mdct[i]);
}
}

static int BlockTypeToChannelCount(BlockType block_type)
{
switch (block_type)
{
case Mono:
return 1;
case Stereo:
return 2;
case LFE:
return 1;
default:
return 0;
}
}

+ 19
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/decinit.h View File

@@ -0,0 +1,19 @@
#pragma once

#include "error_codes.h"
#include "structures.h"
#include "huffCodes.h"

at9_status init_decoder(atrac9_handle* handle, unsigned char * config_data, int wlength);
at9_status init_config_data(ConfigData* config, unsigned char * config_data);
at9_status read_config_data(ConfigData* config);
at9_status init_frame(atrac9_handle* handle);
at9_status init_block(block* block, frame* parent_frame, int block_index);
at9_status init_channel(channel* channel, block* parent_block, int channel_index);
void init_huffman_codebooks();
void init_huffman_set(const HuffmanCodebook* codebooks, int count);
void GenerateTrigTables(int sizeBits);
void GenerateShuffleTable(int sizeBits);
void init_mdct_tables(int frameSizePower);
void GenerateMdctWindow(int frameSizePower);
void GenerateImdctWindow(int frameSizePower);

+ 114
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/decoder.c View File

@@ -0,0 +1,114 @@
#include <string.h>
#include "decoder.h"
#include "unpack.h"
#include "quantization.h"
#include "tables.h"
#include "imdct.h"
#include <math.h>
#include "utility.h"
#include "band_extension.h"

at9_status Decode(atrac9_handle* handle, const unsigned char* audio, unsigned char* pcm, int* bytesUsed)
{
handle->frame.frameNum++;
bit_reader_cxt br;
init_bit_reader_cxt(&br, audio);
ERROR_CHECK(DecodeFrame(&handle->frame, &br));

PcmFloatToShort(&handle->frame, (short*)pcm);

*bytesUsed = br.position / 8;
return ERR_SUCCESS;
}

at9_status DecodeFrame(frame* frame, bit_reader_cxt* br)
{
ERROR_CHECK(UnpackFrame(frame, br));

for (int i = 0; i < frame->config->ChannelConfig.BlockCount; i++)
{
block* block = &frame->Blocks[i];

DequantizeSpectra(block);
ApplyIntensityStereo(block);
ScaleSpectrumBlock(block);
ApplyBandExtension(block);
ImdctBlock(block);
}

return ERR_SUCCESS;
}

void PcmFloatToShort(frame* frame, short* pcmOut)
{
const int endSample = frame->config->FrameSamples;
short* dest = pcmOut;
for (int d = 0, s = 0; s < endSample; d++, s++)
{
for (int i = 0; i < frame->config->ChannelConfig.BlockCount; i++)
{
block* block = &frame->Blocks[i];

for (int j = 0; j < block->ChannelCount; j++)
{
channel* channel = &block->Channels[j];
double* pcmSrc = channel->Pcm;

const double sample = pcmSrc[d];
const int roundedSample = (int)floor(sample + 0.5);
*dest++ = Clamp16(roundedSample);
}
}
}
}

void ImdctBlock(block* block)
{
for (int i = 0; i < block->ChannelCount; i++)
{
channel* channel = &block->Channels[i];

RunImdct(&channel->mdct, channel->Spectra, channel->Pcm);
}
}

void ApplyIntensityStereo(block* block)
{
if (block->BlockType != Stereo) return;

const int totalUnits = block->QuantizationUnitCount;
const int stereoUnits = block->StereoQuantizationUnit;
if (stereoUnits >= totalUnits) return;

channel* source = &block->Channels[block->PrimaryChannelIndex == 0 ? 0 : 1];
channel* dest = &block->Channels[block->PrimaryChannelIndex == 0 ? 1 : 0];

for (int i = stereoUnits; i < totalUnits; i++)
{
const int sign = block->JointStereoSigns[i];
for (int sb = QuantUnitToCoeffIndex[i]; sb < QuantUnitToCoeffIndex[i + 1]; sb++)
{
if (sign > 0)
{
dest->Spectra[sb] = -source->Spectra[sb];
}
else
{
dest->Spectra[sb] = source->Spectra[sb];
}
}
}
}

int GetCodecInfo(atrac9_handle* handle, CodecInfo * pCodecInfo)
{
pCodecInfo->channels = handle->config.ChannelCount;
pCodecInfo->channelConfigIndex = handle->config.ChannelConfigIndex;
pCodecInfo->samplingRate = handle->config.SampleRate;
pCodecInfo->superframeSize = handle->config.SuperframeBytes;
pCodecInfo->framesInSuperframe = handle->config.FramesPerSuperframe;
pCodecInfo->frameSamples = handle->config.FrameSamples;
pCodecInfo->wlength = handle->wlength;
memcpy(pCodecInfo->configData, handle->config.ConfigData, CONFIG_DATA_SIZE);
return ERR_SUCCESS;
}

+ 11
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/decoder.h View File

@@ -0,0 +1,11 @@
#pragma once
#include "bit_reader.h"
#include "error_codes.h"
#include "structures.h"

at9_status Decode(atrac9_handle* handle, const unsigned char* audio, unsigned char* pcm, int* bytesUsed);
at9_status DecodeFrame(frame* frame, bit_reader_cxt* br);
void ImdctBlock(block* block);
void ApplyIntensityStereo(block* block);
void PcmFloatToShort(frame* frame, short* pcmOut);
int GetCodecInfo(atrac9_handle* handle, CodecInfo* pCodecInfo);

+ 33
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/error_codes.h View File

@@ -0,0 +1,33 @@
#pragma once

typedef enum at9_status
{
ERR_SUCCESS = 0,

ERR_NOT_IMPLEMENTED = 0x80000000,

ERR_BAD_CONFIG_DATA = 0x81000000,
ERR_UNPACK_SUPERFRAME_FLAG_INVALID = 0x82000000,
ERR_UNPACK_REUSE_BAND_PARAMS_INVALID,
ERR_UNPACK_BAND_PARAMS_INVALID,

ERR_UNPACK_GRAD_BOUNDARY_INVALID = 0x82100000,
ERR_UNPACK_GRAD_START_UNIT_OOB,
ERR_UNPACK_GRAD_END_UNIT_OOB,
ERR_UNPACK_GRAD_START_VALUE_OOB,
ERR_UNPACK_GRAD_END_VALUE_OOB,
ERR_UNPACK_GRAD_END_UNIT_INVALID, // start_unit > end_unit

ERR_UNPACK_SCALE_FACTOR_MODE_INVALID,
ERR_UNPACK_SCALE_FACTOR_OOB,

ERR_UNPACK_EXTENSION_DATA_INVALID
} at9_status;

#define ERROR_CHECK(x) do { \
at9_status status = (x); \
if (status != ERR_SUCCESS) { \
return status; \
} \
} while (0)

+ 152
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/huffCodes.c View File

@@ -0,0 +1,152 @@
#include "huffCodes.h"
#include "utility.h"

int ReadHuffmanValue(const HuffmanCodebook* huff, bit_reader_cxt* br, int is_signed)
{
const int code = peek_int(br, huff->MaxBitSize);
const unsigned char value = huff->Lookup[code];
const int bits = huff->Bits[value];
br->position += bits;
return is_signed ? SignExtend32(value, huff->ValueBits) : value;
}

void DecodeHuffmanValues(int* spectrum, int index, int bandCount, const HuffmanCodebook* huff, const int* values)
{
const int valueCount = bandCount >> huff->ValueCountPower;
const int mask = (1 << huff->ValueBits) - 1;

for (int i = 0; i < valueCount; i++)
{
int value = values[i];
for (int j = 0; j < huff->ValueCount; j++)
{
spectrum[index++] = SignExtend32(value & mask, huff->ValueBits);
value >>= huff->ValueBits;
}
}
}

void InitHuffmanCodebook(const HuffmanCodebook* codebook)
{
const int huffLength = codebook->Length;
if (huffLength == 0) return;

unsigned char* dest = codebook->Lookup;

for (int i = 0; i < huffLength; i++)
{
if (codebook->Bits[i] == 0) continue;
const int unusedBits = codebook->MaxBitSize - codebook->Bits[i];

const int start = codebook->Codes[i] << unusedBits;
const int length = 1 << unusedBits;
const int end = start + length;

for (int j = start; j < end; j++)
{
dest[j] = i;
}
}
}

HuffmanCodebook HuffmanScaleFactorsUnsigned[7] = {
{0},
{ScaleFactorsA1Bits, ScaleFactorsA1Codes, ScaleFactorsA1Lookup, 2, 1, 0, 1, 2, 1},
{ScaleFactorsA2Bits, ScaleFactorsA2Codes, ScaleFactorsA2Lookup, 4, 1, 0, 2, 4, 3},
{ScaleFactorsA3Bits, ScaleFactorsA3Codes, ScaleFactorsA3Lookup, 8, 1, 0, 3, 8, 6},
{ScaleFactorsA4Bits, ScaleFactorsA4Codes, ScaleFactorsA4Lookup, 16, 1, 0, 4, 16, 8},
{ScaleFactorsA5Bits, ScaleFactorsA5Codes, ScaleFactorsA5Lookup, 32, 1, 0, 5, 32, 8},
{ScaleFactorsA6Bits, ScaleFactorsA6Codes, ScaleFactorsA6Lookup, 64, 1, 0, 6, 64, 8},
};

HuffmanCodebook HuffmanScaleFactorsSigned[6] = {
{0},
{0},
{ScaleFactorsB2Bits, ScaleFactorsB2Codes, ScaleFactorsB2Lookup, 4, 1, 0, 2, 4, 2},
{ScaleFactorsB3Bits, ScaleFactorsB3Codes, ScaleFactorsB3Lookup, 8, 1, 0, 3, 8, 6},
{ScaleFactorsB4Bits, ScaleFactorsB4Codes, ScaleFactorsB4Lookup, 16, 1, 0, 4, 16, 8},
{ScaleFactorsB5Bits, ScaleFactorsB5Codes, ScaleFactorsB5Lookup, 32, 1, 0, 5, 32, 8},
};

HuffmanCodebook HuffmanSpectrum[2][8][4] = {
{
{0},
{0},
{
{SpectrumA21Bits, SpectrumA21Codes, SpectrumA21Lookup, 16, 2, 1, 2, 4, 3},
{SpectrumA22Bits, SpectrumA22Codes, SpectrumA22Lookup, 256, 4, 2, 2, 4, 8},
{SpectrumA23Bits, SpectrumA23Codes, SpectrumA23Lookup, 256, 4, 2, 2, 4, 9},
{SpectrumA24Bits, SpectrumA24Codes, SpectrumA24Lookup, 256, 4, 2, 2, 4, 10}
},
{
{SpectrumA31Bits, SpectrumA31Codes, SpectrumA31Lookup, 64, 2, 1, 3, 8, 7},
{SpectrumA32Bits, SpectrumA32Codes, SpectrumA32Lookup, 64, 2, 1, 3, 8, 7},
{SpectrumA33Bits, SpectrumA33Codes, SpectrumA33Lookup, 64, 2, 1, 3, 8, 8},
{SpectrumA34Bits, SpectrumA34Codes, SpectrumA34Lookup, 64, 2, 1, 3, 8, 10}
},
{
{SpectrumA41Bits, SpectrumA41Codes, SpectrumA41Lookup, 256, 2, 1, 4, 16, 9},
{SpectrumA42Bits, SpectrumA42Codes, SpectrumA42Lookup, 256, 2, 1, 4, 16, 10},
{SpectrumA43Bits, SpectrumA43Codes, SpectrumA43Lookup, 256, 2, 1, 4, 16, 10},
{SpectrumA44Bits, SpectrumA44Codes, SpectrumA44Lookup, 256, 2, 1, 4, 16, 10}
},
{
{SpectrumA51Bits, SpectrumA51Codes, SpectrumA51Lookup, 32, 1, 0, 5, 32, 6},
{SpectrumA52Bits, SpectrumA52Codes, SpectrumA52Lookup, 32, 1, 0, 5, 32, 6},
{SpectrumA53Bits, SpectrumA53Codes, SpectrumA53Lookup, 32, 1, 0, 5, 32, 7},
{SpectrumA54Bits, SpectrumA54Codes, SpectrumA54Lookup, 32, 1, 0, 5, 32, 8}
},
{
{SpectrumA61Bits, SpectrumA61Codes, SpectrumA61Lookup, 64, 1, 0, 6, 64, 7},
{SpectrumA62Bits, SpectrumA62Codes, SpectrumA62Lookup, 64, 1, 0, 6, 64, 7},
{SpectrumA63Bits, SpectrumA63Codes, SpectrumA63Lookup, 64, 1, 0, 6, 64, 8},
{SpectrumA64Bits, SpectrumA64Codes, SpectrumA64Lookup, 64, 1, 0, 6, 64, 9}
},
{
{SpectrumA71Bits, SpectrumA71Codes, SpectrumA71Lookup, 128, 1, 0, 7, 128, 8},
{SpectrumA72Bits, SpectrumA72Codes, SpectrumA72Lookup, 128, 1, 0, 7, 128, 8},
{SpectrumA73Bits, SpectrumA73Codes, SpectrumA73Lookup, 128, 1, 0, 7, 128, 9},
{SpectrumA74Bits, SpectrumA74Codes, SpectrumA74Lookup, 128, 1, 0, 7, 128, 10}
}
},
{
{0},
{0},
{
{0},
{SpectrumB22Bits, SpectrumB22Codes, SpectrumB22Lookup, 256, 4, 2, 2, 4, 10},
{SpectrumB23Bits, SpectrumB23Codes, SpectrumB23Lookup, 256, 4, 2, 2, 4, 10},
{SpectrumB24Bits, SpectrumB24Codes, SpectrumB24Lookup, 256, 4, 2, 2, 4, 10}
},
{
{0},
{SpectrumB32Bits, SpectrumB32Codes, SpectrumB32Lookup, 64, 2, 1, 3, 8, 9},
{SpectrumB33Bits, SpectrumB33Codes, SpectrumB33Lookup, 64, 2, 1, 3, 8, 10},
{SpectrumB34Bits, SpectrumB34Codes, SpectrumB34Lookup, 64, 2, 1, 3, 8, 10}
},
{
{0},
{SpectrumB42Bits, SpectrumB42Codes, SpectrumB42Lookup, 256, 2, 1, 4, 16, 10},
{SpectrumB43Bits, SpectrumB43Codes, SpectrumB43Lookup, 256, 2, 1, 4, 16, 10},
{SpectrumB44Bits, SpectrumB44Codes, SpectrumB44Lookup, 256, 2, 1, 4, 16, 10}
},
{
{0},
{SpectrumB52Bits, SpectrumB52Codes, SpectrumB52Lookup, 32, 1, 0, 5, 32, 7},
{SpectrumB53Bits, SpectrumB53Codes, SpectrumB53Lookup, 32, 1, 0, 5, 32, 8},
{SpectrumB54Bits, SpectrumB54Codes, SpectrumB54Lookup, 32, 1, 0, 5, 32, 9}
},
{
{0},
{SpectrumB62Bits, SpectrumB62Codes, SpectrumB62Lookup, 64, 1, 0, 6, 64, 8},
{SpectrumB63Bits, SpectrumB63Codes, SpectrumB63Lookup, 64, 1, 0, 6, 64, 9},
{SpectrumB64Bits, SpectrumB64Codes, SpectrumB64Lookup, 64, 1, 0, 6, 64, 10}
},
{
{0},
{SpectrumB72Bits, SpectrumB72Codes, SpectrumB72Lookup, 128, 1, 0, 7, 128, 9},
{SpectrumB73Bits, SpectrumB73Codes, SpectrumB73Lookup, 128, 1, 0, 7, 128, 10},
{SpectrumB74Bits, SpectrumB74Codes, SpectrumB74Lookup, 128, 1, 0, 7, 128, 10}
}
}
};

+ 1295
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/huffCodes.h
File diff suppressed because it is too large
View File


+ 80
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/imdct.c View File

@@ -0,0 +1,80 @@
#include "imdct.h"
#include "tables.h"

void RunImdct(mdct* mdct, double* input, double* output)
{
const int size = 1 << mdct->bits;
const int half = size / 2;
double dctOut[MAX_FRAME_SAMPLES];
const double* window = ImdctWindow[mdct->bits - 6];
double* previous = mdct->_imdctPrevious;

Dct4(mdct, input, dctOut);

for (int i = 0; i < half; i++)
{
output[i] = window[i] * dctOut[i + half] + previous[i];
output[i + half] = window[i + half] * -dctOut[size - 1 - i] - previous[i + half];
previous[i] = window[size - 1 - i] * -dctOut[half - i - 1];
previous[i + half] = window[half - i - 1] * dctOut[i];
}
}

void Dct4(mdct* mdct, double* input, double* output)
{
int MdctBits = mdct->bits;
int MdctSize = 1 << MdctBits;
const int* shuffleTable = ShuffleTables[MdctBits];
const double* sinTable = SinTables[MdctBits];
const double* cosTable = CosTables[MdctBits];
double dctTemp[MAX_FRAME_SAMPLES];

int size = MdctSize;
int lastIndex = size - 1;
int halfSize = size / 2;

for (int i = 0; i < halfSize; i++)
{
int i2 = i * 2;
double a = input[i2];
double b = input[lastIndex - i2];
double sin = sinTable[i];
double cos = cosTable[i];
dctTemp[i2] = a * cos + b * sin;
dctTemp[i2 + 1] = a * sin - b * cos;
}
int stageCount = MdctBits - 1;

for (int stage = 0; stage < stageCount; stage++)
{
int blockCount = 1 << stage;
int blockSizeBits = stageCount - stage;
int blockHalfSizeBits = blockSizeBits - 1;
int blockSize = 1 << blockSizeBits;
int blockHalfSize = 1 << blockHalfSizeBits;
sinTable = SinTables[blockHalfSizeBits];
cosTable = CosTables[blockHalfSizeBits];

for (int block = 0; block < blockCount; block++)
{
for (int i = 0; i < blockHalfSize; i++)
{
int frontPos = (block * blockSize + i) * 2;
int backPos = frontPos + blockSize;
double a = dctTemp[frontPos] - dctTemp[backPos];
double b = dctTemp[frontPos + 1] - dctTemp[backPos + 1];
double sin = sinTable[i];
double cos = cosTable[i];
dctTemp[frontPos] += dctTemp[backPos];
dctTemp[frontPos + 1] += dctTemp[backPos + 1];
dctTemp[backPos] = a * cos + b * sin;
dctTemp[backPos + 1] = a * sin - b * cos;
}
}
}

for (int i = 0; i < MdctSize; i++)
{
output[i] = dctTemp[shuffleTable[i]];
}
}

+ 6
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/imdct.h View File

@@ -0,0 +1,6 @@
#pragma once

#include "structures.h"

void RunImdct(mdct* mdct, double* input, double* output);
void Dct4(mdct* mdct, double* input, double* output);

+ 33
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/libatrac9.c View File

@@ -0,0 +1,33 @@
#include "libatrac9.h"
#include "structures.h"
#include <stdlib.h>
#include <string.h>
#include "decinit.h"
#include "decoder.h"

void* Atrac9GetHandle()
{
struct atrac9_handle* handle = malloc(sizeof(atrac9_handle));
memset(handle, 0, sizeof(atrac9_handle));
return handle;
}

void Atrac9ReleaseHandle(void* handle)
{
free(handle);
}

int Atrac9InitDecoder(void* handle, unsigned char * pConfigData)
{
return init_decoder(handle, pConfigData, 16);
}

int Atrac9Decode(void* handle, const unsigned char *pAtrac9Buffer, short *pPcmBuffer, int *pNBytesUsed)
{
return Decode(handle, pAtrac9Buffer, (unsigned char*)pPcmBuffer, pNBytesUsed);
}

int Atrac9GetCodecInfo(void* handle, Atrac9CodecInfo * pCodecInfo)
{
return GetCodecInfo(handle, (CodecInfo*)pCodecInfo);
}

+ 32
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/libatrac9.h View File

@@ -0,0 +1,32 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif

#define ATRAC9_CONFIG_DATA_SIZE 4

typedef struct {
int channels;
int channelConfigIndex;
int samplingRate;
int superframeSize;
int framesInSuperframe;
int frameSamples;
int wlength;
unsigned char configData[ATRAC9_CONFIG_DATA_SIZE];
double MdctWindow[3][256];
double ImdctWindow[3][256];
} Atrac9CodecInfo;

void* Atrac9GetHandle(void);
void Atrac9ReleaseHandle(void* handle);

int Atrac9InitDecoder(void* handle, unsigned char *pConfigData);
int Atrac9Decode(void* handle, const unsigned char *pAtrac9Buffer, short *pPcmBuffer, int *pNBytesUsed);

int Atrac9GetCodecInfo(void* handle, Atrac9CodecInfo *pCodecInfo);

#ifdef __cplusplus
}
#endif

+ 31
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/libatrac9.sln View File

@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2010
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libatrac9", "libatrac9.vcxproj", "{2425F2CC-BB1B-4069-BC10-1C7F535EF8E8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2425F2CC-BB1B-4069-BC10-1C7F535EF8E8}.Debug|x64.ActiveCfg = Debug|x64
{2425F2CC-BB1B-4069-BC10-1C7F535EF8E8}.Debug|x64.Build.0 = Debug|x64
{2425F2CC-BB1B-4069-BC10-1C7F535EF8E8}.Debug|x86.ActiveCfg = Debug|Win32
{2425F2CC-BB1B-4069-BC10-1C7F535EF8E8}.Debug|x86.Build.0 = Debug|Win32
{2425F2CC-BB1B-4069-BC10-1C7F535EF8E8}.Release|x64.ActiveCfg = Release|x64
{2425F2CC-BB1B-4069-BC10-1C7F535EF8E8}.Release|x64.Build.0 = Release|x64
{2425F2CC-BB1B-4069-BC10-1C7F535EF8E8}.Release|x86.ActiveCfg = Release|Win32
{2425F2CC-BB1B-4069-BC10-1C7F535EF8E8}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB003D83-77D8-4E7B-896D-7C9ADA458F73}
EndGlobalSection
EndGlobal

+ 162
- 0
Frameworks/libatrac9/libatrac9/LibAtrac9/C/libatrac9.vcxproj View File

@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{2425F2CC-BB1B-4069-BC10-1C7F535EF8E8}</ProjectGuid>
<RootNamespace>libatrac9</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
<ProjectName>libatrac9</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />