Updated Changelog.
[LameXP.git] / src / Tools.h
blobe21be2d39ab8b3bf6a7162563c61263ab918377f
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2018 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version, but always including the *additional*
9 // restrictions defined in the "License.txt" file.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this program; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 // http://www.gnu.org/licenses/gpl-2.0.txt
21 ///////////////////////////////////////////////////////////////////////////////
23 #include <stdlib.h>
25 #ifndef LAMEXP_INC_TOOLS
26 #error Please do *not* include TOOLS.H directly!
27 #endif
29 ////////////////////////////////////////////////////////////
30 // CPU FLags
31 ////////////////////////////////////////////////////////////
33 /* CPU_TYPE_<ARCH>_<TYPE> */
34 #define CPU_TYPE_X86_GEN 0x00000001UL //x86, generic
35 #define CPU_TYPE_X86_SSE 0x00000002UL //x86, with SSE and SSE2 support - Intel only!
36 #define CPU_TYPE_X86_AVX 0x00000004UL //x86, with AVX support
37 #define CPU_TYPE_X64_GEN 0x00000008UL //x64, generic
38 #define CPU_TYPE_X64_SSE 0x00000010UL //x64, with SSE and SSE2 support - Intel only!
39 #define CPU_TYPE_X64_AVX 0x00000020UL //x64, with AVX support
41 /* combined CPU types */
42 #define CPU_TYPE_X86_NVX (CPU_TYPE_X86_GEN|CPU_TYPE_X86_SSE)
43 #define CPU_TYPE_X86_SSX (CPU_TYPE_X86_SSE|CPU_TYPE_X86_AVX)
44 #define CPU_TYPE_X86_ALL (CPU_TYPE_X86_GEN|CPU_TYPE_X86_SSX)
45 #define CPU_TYPE_X64_NVX (CPU_TYPE_X64_GEN|CPU_TYPE_X64_SSE)
46 #define CPU_TYPE_X64_SSX (CPU_TYPE_X64_SSE|CPU_TYPE_X64_AVX)
47 #define CPU_TYPE_X64_ALL (CPU_TYPE_X64_GEN|CPU_TYPE_X64_SSX)
48 #define CPU_TYPE_ALL_GEN (CPU_TYPE_X86_GEN|CPU_TYPE_X64_GEN)
49 #define CPU_TYPE_ALL_SSE (CPU_TYPE_X86_SSE|CPU_TYPE_X64_SSE)
50 #define CPU_TYPE_ALL_SSX (CPU_TYPE_X86_SSX|CPU_TYPE_X64_SSX)
51 #define CPU_TYPE_ALL_AVX (CPU_TYPE_X86_AVX|CPU_TYPE_X64_AVX)
52 #define CPU_TYPE_ALL_ALL (CPU_TYPE_X86_ALL|CPU_TYPE_X64_ALL)
54 ////////////////////////////////////////////////////////////
55 // TOOLS
56 ////////////////////////////////////////////////////////////
58 static const struct
60 const char *pcHash;
61 const unsigned int uiCpuType;
62 const char *pcName;
63 const unsigned int uiVersion;
64 const char *pcVersTag;
66 g_lamexp_tools[] =
68 {"4870d7abbc3995dc5ca82147ee33f28c3ee7dc1986fbb0131912effe10c1a209d3f983c5dffd963c31707a5ce39611b4", CPU_TYPE_X86_GEN, "aften.i686.exe", 8, ""},
69 {"fc4e38b11a0f52b68cca79aa2d71c02180b70eb0e592923dee4f0ccf766f1006642369b2178f6a61d1c2506446cc442d", CPU_TYPE_X86_SSX, "aften.sse2.exe", 8, ""},
70 {"b44b1c0e1a8f4633c9bc2e43d0a83ea5edc890e1cccc0054c812d0e64170e5292dc1dfd7430da61b73150831aa16e9c4", CPU_TYPE_X64_ALL, "aften.x64.exe", 8, ""},
71 {"4558728999a05f12fe88566e8308cba0ada200814c2a1bfe2507f49faf8f3994b0d52a829148f5c6321d24faa2718439", CPU_TYPE_ALL_ALL, "avs2wav.exe", 13, ""},
72 {"07834b1b8ecac2f3db79ad048005eca3a284cb759e15d399eb1a560a403122e20db5f08e60319759b8463aeef2410d02", CPU_TYPE_ALL_ALL, "dcaenc.exe", 20120419, ""},
73 {"bb3dd1f872dd5a3110ee1f8199a8318d54cd872b602fc2716e2acfb3eb803c241c7d39b0133462ac0534455309723869", CPU_TYPE_ALL_GEN, "faad.i686.exe", 286, ""},
74 {"86c8e6b8effe8325c14c9b3705494429a5bd1e39a2080bdfa8f0f6bf0a9ae1827c5c5c371b568dc788249ef82143ecd1", CPU_TYPE_ALL_SSE, "faad.sse2.exe", 286, ""},
75 {"5a45cd99ed8ee5df8b4914f5017b1345174c0e896f04ee9dd9aa78eaac712f1a9d807019f31a6138545ec8803d4f005c", CPU_TYPE_ALL_AVX, "faad.avx.exe", 286, ""},
76 {"735654150f5d123660aa8493d322a7181cfd6d6c3e584a53c94c27a5163659b6aab3dd84230f684f8cec3cb565223482", CPU_TYPE_X86_GEN, "flac.x86-i686.exe", 132, ""},
77 {"2ee22f174131615cf342cb3031a4c93adfff0997d84eb1b6794c133c8f19d109c43e67a3f60638705c7afb93427a07f8", CPU_TYPE_X86_SSX, "flac.x86-sse2.exe", 132, ""},
78 {"323ba94d1d3a8f82f4e5a6adf859d0f11d7b0c69fa0254e620724f879edd9d7017e3d2fa78ffe0a615539d8798606a46", CPU_TYPE_X64_NVX, "flac.x64-sse2.exe", 132, ""},
79 {"db5c8b27f876f797d8e2c7dd6c585cff065174c2a006a1642be2b8339be7d17e49b806534e3c9f2de84e66e997c49df7", CPU_TYPE_X64_AVX, "flac.x64-avx.exe", 132, ""},
80 {"c45bcc65f38ecb98adf2e20aafd95341f892a1cca50e402bd299d0b48b71257016f707ae83e4fd302accded26623794a", CPU_TYPE_ALL_ALL, "gpgv.exe", 1422, ""},
81 {"c66992384b6388a7b68f2659624c150b33ff1cacb0c28c0ab2a3249eca4c31e204953f325403f78c077d1735b275ac12", CPU_TYPE_ALL_ALL, "keyring.gpg", UINT_MAX, ""},
82 {"5e95b7d07d4ffc1ed9b2f3ccebd1a13caf6362dad39c594d94a1c15b80ba81b296cb8ce77487bf98c9650ce76f7a845b", CPU_TYPE_X86_GEN, "lame.x86-i686.exe", 31001, "Final"},
83 {"cc5809e842fa0d9ceee2de7ebe3ad4d1cbfdc8b1a7aa91fa14ce3f690bd2280ce23648c178a93d41652189fb06c2600b", CPU_TYPE_X86_SSX, "lame.x86-sse2.exe", 31001, "Final"},
84 {"578b230ce82a1a588d8ba21163acb3b78b4708fb3ef9f9b685a4fcb71a63f027b33aa3b12acd7815502ad9475d63fc3b", CPU_TYPE_X64_NVX, "lame.x64-sse2.exe", 31001, "Final" },
85 {"789e28b1e7dfa43bf4f8a70213fdc77b480e386f7a36c258395240c93d643bae8cee9c8728376e9ec7360e169d5f59ec", CPU_TYPE_X64_AVX, "lame.x64-avx.exe", 31001, "Final" },
86 {"c0f6508f8b7ab515b69f55ed9d5eddb9dad22da4e6268c86e93dc23472f6a049f2dd97a0d4c85b75d8938fb999c19736", CPU_TYPE_X86_GEN, "mac.x86-i686.exe", 433, ""},
87 {"031cb32078841df55691cdb91c9ed0e0c3113b195fe69c56746b0ba607c11f7c978ebe9500a46580926713b9d71454c4", CPU_TYPE_X86_SSX, "mac.x86-sse2.exe", 433, ""},
88 {"8e197a2c759a74ced2acfee18c7cdf37d89534a6568467f886cdebf6c50dba0b79f4f06ee7424c6d6596d94389d03bcc", CPU_TYPE_X64_NVX, "mac.x64-sse2.exe", 433, ""},
89 {"0ef10f812dfa91634da213328e6bfb84b6f8b1882b955f1c3173460d60e559a8f5065125c698552301ed0566b2dc87bf", CPU_TYPE_X64_AVX, "mac.x64-avx.exe", 433, ""},
90 {"1c71d65315e32c5d83c91e5bb69ac3779581bb7e9f1a266351f003d86b4ee40db38435a54c0cfc34e85565eabe14885c", CPU_TYPE_X86_GEN, "mediainfo.i686.exe", 1712, ""},
91 {"b2c02f976e0473d847e36a46a6772729187efaa6cbd3b487046e55c1c6bf5e442ab8457da21da55984ba125f6019ce62", CPU_TYPE_X86_SSX, "mediainfo.sse2.exe", 1712, ""},
92 {"a43c89653e05737f2a11fc8367b0963e6c01a31d8a35e264b010e436aeed4243d9bab9aaac3dc7da95a4d8afb6eae575", CPU_TYPE_X64_ALL, "mediainfo.x64.exe", 1712, ""},
93 {"7e6346a057634ff07b2e1f427035324f7f02100cc996425990f87f71d767fce4c7b101588c7d944ba49cb2d7e51c9bdb", CPU_TYPE_ALL_ALL, "mpcdec.exe", 475, ""},
94 {"950b598ad3b724048fb8f7194908d9b9354cf208548211b559695fdf8494cf2c12e440b96c1593647c6907f6e8d8a2dc", CPU_TYPE_ALL_GEN, "mpg123.i686.exe", 1258, ""},
95 {"edda8ecc591d54ce6c47d29d81c24599f872f98dae2c83e7f7b72ec2fffc8fefa73a0e52656cbf0d851b5a7ef57a9bfa", CPU_TYPE_ALL_SSE, "mpg123.sse2.exe", 1258, ""},
96 {"80b211712cd3c2891455a75e02b21e3cff7c4e0627e491cd5ce5263777d5a28bb9886e58002344eefe48b62a2a1587af", CPU_TYPE_ALL_AVX, "mpg123.avx.exe", 1258, ""},
97 {"dda88fb66a80c362dfa367d07265eee3dcf8ee959191fc7685163fdee694ece7d84000065de217942749b6859d33fa84", CPU_TYPE_ALL_ALL, "mcat.exe", 101, "" },
98 {"f1f2ea5c9e5539620b706e7af68e543bf7a731afb06ccce3815ab34dad64d697e4d6ffcd187a396619b8b52efe7edf88", CPU_TYPE_ALL_ALL, "oggdec.exe", 1101, ""},
99 {"245181321625445ac42fce31d64bf03872e77e2d0dd3c19d6c17ca2771354f096a6040827dd6d00ffd7342c7dd26168e", CPU_TYPE_X86_GEN, "oggenc2.i686.exe", 288135603, "2015"},
100 {"512b8efcd1003a0f67220a450d6ea4466194e8fd49fc090a69b15a858db11499acbf98f984530cd5d37b4b6abdd1c6d8", CPU_TYPE_X86_SSX, "oggenc2.sse2.exe", 288135603, "2015"},
101 {"a07ef67cba5a00d335d07372baf76d4d0573b425afce71a19c1e04eaabbe3f55e60bdd40af5e428224c91df1823eda08", CPU_TYPE_X64_ALL, "oggenc2.x64.exe", 288135603, "2015"},
102 {"c33460db871d6db07e24e5e6e11ac1b6c741e3dbacb705d470edbf5dcbb174898be293ebfa0d3aaa7b31465d857eaaab", CPU_TYPE_ALL_GEN, "opusdec.i686.exe", 20180225, "v1.3-beta-15"},
103 {"b4f016ca9930c8eefef9219e638df31fda7c0f8f80649bbfdf35c16bc0e0502deafe68d392857934a16e7f41c16128d2", CPU_TYPE_ALL_SSE, "opusdec.sse2.exe", 20180225, "v1.3-beta-15"},
104 {"7c72596716320cf10e0720eb49481f31a88cf5d36316a8e8afff2cf026ff08890b6c4e5c10ef1757842b2742f57929e6", CPU_TYPE_ALL_AVX, "opusdec.avx.exe", 20180225, "v1.3-beta-15"},
105 {"b2f0d0874060042e0043ab21a521bc74eeb6f9a2594514c930706d71ec9cf0f20d0f1254b038c8d2c5f5fc281933b0dd", CPU_TYPE_ALL_GEN, "opusenc.i686.exe", 20180225, "v1.3-beta-15"},
106 {"61dc703cda276833c026410ac6597288222d89bcd5f2ea22c16413d84b2fd584ad75286f7c502b556370d3f4fbdca3a1", CPU_TYPE_ALL_SSE, "opusenc.sse2.exe", 20180225, "v1.3-beta-15"},
107 {"503b7a97f65d3af9c53de9507dcdcdf2e503a96448292a4ef6199183044dc7e79938a3a8b1b4fd4ecffdfa1b96dd3709", CPU_TYPE_ALL_AVX, "opusenc.avx.exe", 20180225, "v1.3-beta-15"},
108 {"155b123845f797226d03c44d649de810b13001b70e55e3775559ee78b75c38c9284475d217a86752820cfe1c22f37f69", CPU_TYPE_X86_GEN, "refalac.i686.exe", 164, ""},
109 {"2bdb8a6e4ad05669623173101ccc9287b9d8b6bb5b2062abaadda3e3cceda7040478ef2b404348b52e2232307f8c8f7c", CPU_TYPE_X86_SSX, "refalac.sse2.exe", 164, ""},
110 {"3abae08b7be8d7e054bf48b7a7cbb874955a774dc2db69503490d59daf74db8adfa702401eeace6536810b0ac15dea84", CPU_TYPE_X64_ALL, "refalac.x64.exe", 164, ""},
111 {"d041b60de6c5c6e77cbad84440db57bbeb021af59dd0f7bebd3ede047d9e2ddc2a0c14179472687ba91063743d23e337", CPU_TYPE_ALL_ALL, "shorten.exe", 361, ""},
112 {"3206ebd1b1c6e5db422d7a84117a7ba8256208fc7104a6668d8856c1b6407882f25f1f39e37c8e33affb343300937d2e", CPU_TYPE_ALL_GEN, "sox.i686.exe", 1442, ""},
113 {"16a71940aa5e9b393e83cdfb2a4dda4291ea01858f8ba338510013f25f4d7c53b9b5cffb86404ea49ef28e6795182fd5", CPU_TYPE_ALL_SSE, "sox.sse2.exe", 1442, "" },
114 {"25585ca9e2e025d82d93341a9db8527eb0b4ce451dade607f9784a79ed30e050ced0824835d5467aa0bf0c6b8fe08612", CPU_TYPE_ALL_AVX, "sox.avx.exe", 1442, "" },
115 {"5a4261e1b41a59d1a5bc92e1d2766422a67454d77e06ea29af392811b7b4704e0f3e494ab9cb6375ce9e39257867c5ed", CPU_TYPE_ALL_ALL, "speexdec.exe", 12, ""},
116 {"75d4c18dbb74e2dbf7342698428248d45cc4070d5f95da8831ef755e63dcd7ff9c3a760f289e8ef8b5c06b82548edbd8", CPU_TYPE_ALL_ALL, "tag.exe", 100, ""},
117 {"a83628880da0b7519ec368a74a92da5a5099d8d46aa0583131f92d7321f47c9e16a1841b2a3fb8ffcca7205ef4b1bb0a", CPU_TYPE_ALL_ALL, "tta.exe", 21, ""},
118 {"9e1ade2137ea5cee0ad4657971c314a372df3068594fbe4f77d45b9eb65fa7c69e55027b0df81b6fe072a220e9a8ba8a", CPU_TYPE_ALL_ALL, "valdec.exe", 100, "a"},
119 {"0a2c8afb50aac35b80f34be2e2286bbb4f0876c1ad53fed8dc2f679786671eafdc1a244378abcc2c229fc110bb5cdf79", CPU_TYPE_ALL_ALL, "wget.exe", 1180, ""},
120 {"572b9448bf4a338ecb9727951fdfcc5a219cc69896695cc96b9f6b083690e339910e41558968264a38992e45f2be152c", CPU_TYPE_ALL_ALL, "wma2wav.exe", 20111001, ""},
121 {"5ef85aa6c6521161e19fc9eadd30bac82c3d0eee2374fd6ac543022181f7846ec2198ebe8bc84667e9b92a4a85d07fbb", CPU_TYPE_ALL_ALL, "wupdate.exe", 20171002, ""},
122 {"6021b938769b09d05617c7e91e0cb6cc5f9e40c50cb470455afc21d466b37183b8675822b8797cbf98950a5262ec07a6", CPU_TYPE_X86_GEN, "wvunpack.x86-i686.exe", 5010, ""},
123 {"fa322e127679ac6b5e833e120b590480b3ffc7ffa875705c04ed698f155dc23b40c8922d2f5f78ad1cc9342306289141", CPU_TYPE_X86_SSX, "wvunpack.x86-sse2.exe", 5010, ""},
124 {"d4ca3085aae70160beab778a46a27643f1415bd803ddfecb2791fe964e4bff49ac5a891ef1852f26e867c42ddd6f8806", CPU_TYPE_X64_NVX, "wvunpack.x64-sse2.exe", 5010, ""},
125 {"e2c32a765cbec41cc6e662447a1d70d8261753f2c93aca666bafddcc420c4eaee550d3c730123a84565cf43fffa26c35", CPU_TYPE_X64_AVX, "wvunpack.x64-avx.exe", 5010, ""},
126 {NULL, NULL, NULL, NULL, NULL}
129 ////////////////////////////////////////////////////////////
130 // AAC ENCODERS
131 ////////////////////////////////////////////////////////////
133 typedef struct
135 const char *const toolName;
136 const char *const fileNames[5];
137 const char *const checkArgs;
138 const quint32 toolMinVersion;
139 const quint32 verDigits;
140 const quint32 verShift;
141 const char *const verStr;
142 const char *const regExpVer;
143 const char *const regExpSig;
144 const char *const regExpLib[3];
146 aac_encoder_t;
148 static const aac_encoder_t g_lamexp_aacenc[] =
151 "NeroAAC",
152 { "neroAacEnc.exe", "neroAacDec.exe", "neroAacTag.exe", NULL },
153 "-help",
154 lamexp_toolver_neroaac(), 4, 10, "v?.?.?.?",
155 "Package\\s+version:\\s+(\\d)\\.(\\d)\\.(\\d)\\.(\\d)",
156 "Nero\\s+AAC\\s+Encoder",
157 { NULL }
160 "FhgAacEnc",
161 { "fhgaacenc.exe", "enc_fhgaac.dll", "nsutil.dll", "libmp4v2.dll", NULL },
162 NULL,
163 lamexp_toolver_fhgaacenc(), 2, 0, "????-??-??",
164 "fhgaacenc version (\\d+) by tmkk. Modified by Case (\\d+).",
165 NULL,
166 { NULL }
169 "FdkAacEnc",
170 { "fdkaac.exe", NULL },
171 "--help",
172 lamexp_toolver_fdkaacenc(), 3, 10, "v?.?.?",
173 "fdkaac\\s+(\\d)\\.(\\d)\\.(\\d)",
174 NULL,
175 { NULL }
178 "QAAC",
179 { "qaac.exe", "libsoxr.dll", "libsoxconvolver.dll", NULL },
180 "--check",
181 lamexp_toolver_qaacenc(), 2, 100, "v?.??",
182 "qaac (\\d)\\.(\\d+)",
183 NULL,
184 { "libsoxr-\\d+\\.\\d+\\.\\d+", "libsoxconvolver\\s+\\d+\\.\\d+\\.\\d+" }
187 "QAACx64",
188 { "qaac64.exe", "libsoxr64.dll", "libsoxconvolver64.dll", NULL },
189 "--check",
190 lamexp_toolver_qaacenc(), 2, 100, "v?.??",
191 "qaac (\\d)\\.(\\d+)",
192 NULL,
193 { "libsoxr-\\d+\\.\\d+\\.\\d+", "libsoxconvolver\\s+\\d+\\.\\d+\\.\\d+" }
195 { NULL, { NULL }, NULL, 0, 0, 0, NULL, NULL, NULL, { NULL } }