From e4b257d93d6fc8c5d804c8afba39c642a920127a Mon Sep 17 00:00:00 2001 From: lordmulder Date: Sat, 15 Jul 2017 20:38:23 +0200 Subject: [PATCH] Updated x265 to version 2.5. Now using "multilib" build. --- src/encoder_x265.cpp | 31 ++++++++++++++++++++++--------- src/string_validator.cpp | 2 +- src/thread_binaries.cpp | 13 +++++++++---- src/version.h | 2 +- 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/src/encoder_x265.cpp b/src/encoder_x265.cpp index b40c3c9..06be544 100644 --- a/src/encoder_x265.cpp +++ b/src/encoder_x265.cpp @@ -40,8 +40,8 @@ #include //x265 version info -static const unsigned int VERSION_X265_MINIMUM_VER = 24; -static const unsigned int VERSION_X265_MINIMUM_REV = 36; +static const unsigned int VERSION_X265_MINIMUM_VER = 25; +static const unsigned int VERSION_X265_MINIMUM_REV = 0; // ------------------------------------------------------------ // Helper Macros @@ -160,21 +160,18 @@ public: virtual QString getBinaryPath(const SysinfoModel *sysinfo, const quint32 &encArch, const quint32 &encVariant) const { - QString arch, variant; + QString arch; switch(encArch) { case 0: arch = "x86"; break; case 1: arch = "x64"; break; default: MUTILS_THROW("Unknown encoder arch!"); } - switch(encVariant) + if((encVariant < 0) || (encVariant > 2)) { - case 0: variant = "8bit"; break; - case 1: variant = "10bit"; break; - case 2: variant = "12bit"; break; - default: MUTILS_THROW("Unknown encoder arch!"); + MUTILS_THROW("Unknown encoder variant!"); } - return QString("%1/toolset/%2/x265_%3_%2.exe").arg(sysinfo->getAppPath(), arch, variant); + return QString("%1/toolset/%2/x265_%2.exe").arg(sysinfo->getAppPath(), arch); } virtual QString getHelpCommand(void) const @@ -294,6 +291,22 @@ void X265Encoder::buildCommandLine(QStringList &cmdLine, const bool &usePipe, co { double crf_int = 0.0, crf_frc = 0.0; + cmdLine << "-D"; + switch (m_options->encVariant()) + { + case 0: + cmdLine << QString::number(8); + break; + case 1: + cmdLine << QString::number(10); + break; + case 2: + cmdLine << QString::number(12); + break; + default: + MUTILS_THROW("Unknown encoder variant!"); + } + switch(m_options->rcMode()) { case 0: diff --git a/src/string_validator.cpp b/src/string_validator.cpp index 3c9941e..3861a89 100644 --- a/src/string_validator.cpp +++ b/src/string_validator.cpp @@ -167,7 +167,7 @@ const bool &StringValidator::setStatus(const bool &flag, const QString &toolName QValidator::State StringValidatorEncoder::validate(QString &input, int &pos) const { - static const char *const params[] = {"B", "o", "h", "p", "q", /*"fps", "frames",*/ "preset", "tune", "profile", + static const char *const params[] = {"D", "B", "o", "h", "p", "q", /*"fps", "frames",*/ "preset", "tune", "profile", "stdin", "crf", "bitrate", "qp", "pass", "stats", "output", "help", "quiet", "codec", "y4m", NULL}; const QString commandLine = input.trimmed(); diff --git a/src/thread_binaries.cpp b/src/thread_binaries.cpp index 2490ccc..608a505 100644 --- a/src/thread_binaries.cpp +++ b/src/thread_binaries.cpp @@ -152,7 +152,7 @@ void BinariesCheckThread::checkBinaries3(volatile bool &success, const SysinfoMo { const AbstractEncoderInfo &encInfo = EncoderFactory::getEncoderInfo(encdr); const quint32 archCount = encInfo.getArchitectures().count(); - QSet dependencySet; + QSet filesSet; for (quint32 archIdx = 0; archIdx < archCount; ++archIdx) { const QStringList variants = encInfo.getVariants(); @@ -161,13 +161,18 @@ void BinariesCheckThread::checkBinaries3(volatile bool &success, const SysinfoMo const QStringList dependencies = encInfo.getDependencies(sysinfo, archIdx, varntIdx); for (QStringList::ConstIterator iter = dependencies.constBegin(); iter != dependencies.constEnd(); iter++) { - if (!dependencySet.contains(*iter)) + if (!filesSet.contains(*iter)) { - dependencySet << (*iter); + filesSet << (*iter); binFiles << qMakePair(*iter, true); } } - binFiles << qMakePair(encInfo.getBinaryPath(sysinfo, archIdx, varntIdx), false); + const QString binary = encInfo.getBinaryPath(sysinfo, archIdx, varntIdx); + if (!filesSet.contains(binary)) + { + filesSet << binary; + binFiles << qMakePair(binary, false); + } } } } diff --git a/src/version.h b/src/version.h index 68e4232..b41e4f6 100644 --- a/src/version.h +++ b/src/version.h @@ -26,7 +26,7 @@ #define VER_X264_MAJOR 2 #define VER_X264_MINOR 8 #define VER_X264_PATCH 3 -#define VER_X264_BUILD 1114 +#define VER_X264_BUILD 1115 #define VER_X264_PORTABLE_EDITION (0)