diff --git a/gui/win_preferences.ui b/gui/win_preferences.ui index 3112b8b..679e130 100644 --- a/gui/win_preferences.ui +++ b/gui/win_preferences.ui @@ -10,7 +10,7 @@ 0 0 379 - 226 + 260 @@ -47,7 +47,7 @@ - + Qt::Horizontal @@ -63,7 +63,7 @@ - + Qt::Horizontal @@ -89,7 +89,7 @@ - + @@ -128,14 +128,14 @@ - + If this option is un-checked (default), then 32-Bit Avisynth will be used - even when using 64-Bit x264. Please be aware that this option does NOT have any effect on 32-Bit systems. - + @@ -155,14 +155,14 @@ Please be aware that this option does NOT have any effect on 32-Bit systems. - + - + - + Shutdown computer as soon as the last job has completed @@ -185,7 +185,7 @@ Please be aware that this option does NOT have any effect on 32-Bit systems. - + Qt::Vertical @@ -201,7 +201,7 @@ Please be aware that this option does NOT have any effect on 32-Bit systems. - + If this option is un-checked (default), then 32-Bit Avisynth will be used - even when using 64-Bit x264. @@ -212,7 +212,7 @@ Please be aware that this option does NOT have any effect on 32-Bit systems. - + Qt::Vertical @@ -228,6 +228,36 @@ Please be aware that this option does NOT have any effect on 32-Bit systems. + + + + + + + + + + + Use 10-Bit version of x264 → implies 'High 10' H.264 Profile + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 8 + + + + diff --git a/src/thread_encode.cpp b/src/thread_encode.cpp index fe78e40..3595e6f 100644 --- a/src/thread_encode.cpp +++ b/src/thread_encode.cpp @@ -71,6 +71,8 @@ QMutex EncodeThread::m_mutex_startProcess; } \ } +#define X264_BINARY(BIN_DIR, IS_10BIT, IS_X64) QString("%1/x264_%2_%3.exe").arg((BIN_DIR), ((IS_10BIT) ? "10bit" : "8bit"), ((IS_X64) ? "x64" : "x86")) + /* * Static vars */ @@ -80,7 +82,7 @@ static const unsigned int REV_MULT = 10000; // Constructor & Destructor /////////////////////////////////////////////////////////////////////////////// -EncodeThread::EncodeThread(const QString &sourceFileName, const QString &outputFileName, const OptionsModel *options, const QString &binDir, bool x264_x64, bool avs2yuv_x64) +EncodeThread::EncodeThread(const QString &sourceFileName, const QString &outputFileName, const OptionsModel *options, const QString &binDir, bool x264_x64, bool x264_10bit, bool avs2yuv_x64) : m_jobId(QUuid::createUuid()), m_sourceFileName(sourceFileName), @@ -88,6 +90,7 @@ EncodeThread::EncodeThread(const QString &sourceFileName, const QString &outputF m_options(new OptionsModel(*options)), m_binDir(binDir), m_x264_x64(x264_x64), + m_x264_10bit(x264_10bit), m_avs2yuv_x64(avs2yuv_x64), m_handle_jobObject(NULL), m_semaphorePaused(0) @@ -200,7 +203,7 @@ void EncodeThread::encode(void) log(tr("\n--- CHECK VERSION ---\n")); unsigned int revision_x264 = UINT_MAX; bool x264_modified = false; - ok = ((revision_x264 = checkVersionX264(m_x264_x64, x264_modified)) != UINT_MAX); + ok = ((revision_x264 = checkVersionX264(m_x264_x64, m_x264_10bit, x264_modified)) != UINT_MAX); CHECK_STATUS(m_abort, ok); //Checking avs2yuv version @@ -259,17 +262,17 @@ void EncodeThread::encode(void) } log(tr("\n--- PASS 1 ---\n")); - ok = runEncodingPass(m_x264_x64, m_avs2yuv_x64, usePipe, frames, indexFile, 1, passLogFile); + ok = runEncodingPass(m_x264_x64, m_x264_10bit, m_avs2yuv_x64, usePipe, frames, indexFile, 1, passLogFile); CHECK_STATUS(m_abort, ok); log(tr("\n--- PASS 2 ---\n")); - ok = runEncodingPass(m_x264_x64, m_avs2yuv_x64, usePipe, frames, indexFile, 2, passLogFile); + ok = runEncodingPass(m_x264_x64, m_x264_10bit, m_avs2yuv_x64, usePipe, frames, indexFile, 2, passLogFile); CHECK_STATUS(m_abort, ok); } else { log(tr("\n--- ENCODING ---\n")); - ok = runEncodingPass(m_x264_x64, m_avs2yuv_x64, usePipe, frames, indexFile); + ok = runEncodingPass(m_x264_x64, m_x264_10bit, m_avs2yuv_x64, usePipe, frames, indexFile); CHECK_STATUS(m_abort, ok); } @@ -280,7 +283,7 @@ void EncodeThread::encode(void) setStatus(JobStatus_Completed); } -bool EncodeThread::runEncodingPass(bool x264_x64, bool avs2yuv_x64, bool usePipe, unsigned int frames, const QString &indexFile, int pass, const QString &passLogFile) +bool EncodeThread::runEncodingPass(bool x264_x64, bool x264_10bit, bool avs2yuv_x64, bool usePipe, unsigned int frames, const QString &indexFile, int pass, const QString &passLogFile) { QProcess processEncode, processAvisynth; @@ -302,10 +305,10 @@ bool EncodeThread::runEncodingPass(bool x264_x64, bool avs2yuv_x64, bool usePipe } } - QStringList cmdLine_Encode = buildCommandLine(usePipe, frames, indexFile, pass, passLogFile); + QStringList cmdLine_Encode = buildCommandLine(usePipe, x264_10bit, frames, indexFile, pass, passLogFile); log("Creating x264 process:"); - if(!startProcess(processEncode, QString("%1/%2.exe").arg(m_binDir, x264_x64 ? "x264_x64" : "x264"), cmdLine_Encode)) + if(!startProcess(processEncode, X264_BINARY(m_binDir, x264_10bit, x264_x64), cmdLine_Encode)) { return false; } @@ -510,7 +513,7 @@ bool EncodeThread::runEncodingPass(bool x264_x64, bool avs2yuv_x64, bool usePipe return true; } -QStringList EncodeThread::buildCommandLine(bool usePipe, unsigned int frames, const QString &indexFile, int pass, const QString &passLogFile) +QStringList EncodeThread::buildCommandLine(bool usePipe, bool use10Bit, unsigned int frames, const QString &indexFile, int pass, const QString &passLogFile) { QStringList cmdLine; double crf_int = 0.0, crf_frc = 0.0; @@ -548,7 +551,21 @@ QStringList EncodeThread::buildCommandLine(bool usePipe, unsigned int frames, co if(m_options->profile().compare("auto", Qt::CaseInsensitive)) { - cmdLine << "--profile" << m_options->profile().toLower(); + if(use10Bit) + { + if(m_options->profile().compare("baseline", Qt::CaseInsensitive) || m_options->profile().compare("main", Qt::CaseInsensitive) || m_options->profile().compare("high", Qt::CaseInsensitive)) + { + log(tr("WARNING: Selected H.264 Profile not compatible with 10-Bit encoding. Ignoring!\n")); + } + else + { + cmdLine << "--profile" << m_options->profile().toLower(); + } + } + else + { + cmdLine << "--profile" << m_options->profile().toLower(); + } } if(!m_options->customX264().isEmpty()) @@ -574,13 +591,13 @@ QStringList EncodeThread::buildCommandLine(bool usePipe, unsigned int frames, co return cmdLine; } -unsigned int EncodeThread::checkVersionX264(bool x64, bool &modified) +unsigned int EncodeThread::checkVersionX264(bool use_x64, bool use_10bit, bool &modified) { QProcess process; QStringList cmdLine = QStringList() << "--version"; log("Creating process:"); - if(!startProcess(process, QString("%1/%2.exe").arg(m_binDir, x64 ? "x264_x64" : "x264"), cmdLine)) + if(!startProcess(process, X264_BINARY(m_binDir, use_10bit, use_x64), cmdLine)) { return false;; } diff --git a/src/thread_encode.h b/src/thread_encode.h index 8c23d41..0ed9b37 100644 --- a/src/thread_encode.h +++ b/src/thread_encode.h @@ -53,7 +53,7 @@ public: JobStatus_Undefined = 666 }; - EncodeThread(const QString &sourceFileName, const QString &outputFileName, const OptionsModel *options, const QString &binDir, bool x264_x64, bool avs2yuv_x64); + EncodeThread(const QString &sourceFileName, const QString &outputFileName, const OptionsModel *options, const QString &binDir, bool x264_x64, bool x264_10bit, bool avs2yuv_x64); ~EncodeThread(void); QUuid getId(void) { return this->m_jobId; }; @@ -90,6 +90,7 @@ protected: const OptionsModel *m_options; const QString m_binDir; const bool m_x264_x64; + const bool m_x264_10bit; const bool m_avs2yuv_x64; //Flags @@ -112,9 +113,9 @@ protected: //Encode functions void encode(void); - bool runEncodingPass(bool x264_x64, bool avs2yuv_x64, bool usePipe, unsigned int frames, const QString &indexFile, int pass = 0, const QString &passLogFile = QString()); - QStringList buildCommandLine(bool usePipe, unsigned int frames, const QString &indexFile, int pass = 0, const QString &passLogFile = QString()); - unsigned int checkVersionX264(bool x64, bool &modified); + bool runEncodingPass(bool x264_x64, bool x264_10bit, bool avs2yuv_x64, bool usePipe, unsigned int frames, const QString &indexFile, int pass = 0, const QString &passLogFile = QString()); + QStringList buildCommandLine(bool usePipe, bool use10Bit, unsigned int frames, const QString &indexFile, int pass = 0, const QString &passLogFile = QString()); + unsigned int checkVersionX264(bool use_x64, bool use_10bit, bool &modified); unsigned int checkVersionAvs2yuv(bool x64); bool checkProperties(bool x64, unsigned int &frames); diff --git a/src/version.h b/src/version.h index 3f7268e..7480834 100644 --- a/src/version.h +++ b/src/version.h @@ -21,11 +21,11 @@ #define VER_X264_MAJOR 2 #define VER_X264_MINOR 0 -#define VER_X264_PATCH 2 -#define VER_X264_BUILD 275 +#define VER_X264_PATCH 3 +#define VER_X264_BUILD 291 -#define VER_X264_MINIMUM_REV 2146 -#define VER_X264_CURRENT_API 120 +#define VER_X264_MINIMUM_REV 2164 +#define VER_X264_CURRENT_API 122 #define VER_X264_AVS2YUV_VER 242 #define VER_X264_PRE_RELEASE (0) diff --git a/src/win_main.cpp b/src/win_main.cpp index daf37a7..577bd5c 100644 --- a/src/win_main.cpp +++ b/src/win_main.cpp @@ -227,6 +227,7 @@ void MainWindow::addButtonPressed(const QString &filePathIn, const QString &file options ? options : m_options, QString("%1/toolset").arg(m_appDir), m_cpuFeatures->x64, + m_preferences.use10BitEncoding, m_cpuFeatures->x64 && m_preferences.useAvisyth64Bit ); @@ -629,7 +630,7 @@ void MainWindow::shutdownComputer(void) */ void MainWindow::init(void) { - static const char *binFiles = "x264.exe:x264_x64.exe:avs2yuv.exe:avs2yuv_x64.exe"; + static const char *binFiles = "x264_8bit_x86.exe:x264_8bit_x64.exe:x264_10bit_x86.exe:x264_10bit_x64.exe:avs2yuv.exe:avs2yuv_x64.exe"; QStringList binaries = QString::fromLatin1(binFiles).split(":", QString::SkipEmptyParts); updateLabelPos(); diff --git a/src/win_preferences.cpp b/src/win_preferences.cpp index eeb8cd6..8b0d8aa 100644 --- a/src/win_preferences.cpp +++ b/src/win_preferences.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #define UPDATE_CHECKBOX(CHKBOX, VALUE) \ { \ @@ -43,10 +44,12 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Preferences *preferences, setFixedSize(minimumSize()); labelRunNextJob->installEventFilter(this); + labelUse10BitEncoding->installEventFilter(this); labelUse64BitAvs2YUV->installEventFilter(this); labelShutdownComputer->installEventFilter(this); connect(resetButton, SIGNAL(clicked()), this, SLOT(resetButtonPressed())); + connect(checkUse10BitEncoding, SIGNAL(toggled(bool)), this, SLOT(use10BitEncodingToggled(bool))); m_preferences = preferences; } @@ -62,7 +65,11 @@ void PreferencesDialog::showEvent(QShowEvent *event) UPDATE_CHECKBOX(checkRunNextJob, m_preferences->autoRunNextJob); UPDATE_CHECKBOX(checkShutdownComputer, m_preferences->shutdownComputer); UPDATE_CHECKBOX(checkUse64BitAvs2YUV, m_preferences->useAvisyth64Bit); - + + checkUse10BitEncoding->blockSignals(true); + UPDATE_CHECKBOX(checkUse10BitEncoding, m_preferences->use10BitEncoding); + checkUse10BitEncoding->blockSignals(false); + spinBoxJobCount->setValue(m_preferences->maxRunningJobCount); checkUse64BitAvs2YUV->setEnabled(m_x64); @@ -73,6 +80,7 @@ bool PreferencesDialog::eventFilter(QObject *o, QEvent *e) { emulateMouseEvent(o, e, labelRunNextJob, checkRunNextJob); emulateMouseEvent(o, e, labelShutdownComputer, checkShutdownComputer); + emulateMouseEvent(o, e, labelUse10BitEncoding, checkUse10BitEncoding); emulateMouseEvent(o, e, labelUse64BitAvs2YUV, checkUse64BitAvs2YUV); return false; } @@ -101,6 +109,7 @@ void PreferencesDialog::done(int n) { m_preferences->autoRunNextJob = checkRunNextJob->isChecked(); m_preferences->shutdownComputer = checkShutdownComputer->isChecked(); + m_preferences->use10BitEncoding = checkUse10BitEncoding->isChecked(); m_preferences->useAvisyth64Bit = checkUse64BitAvs2YUV->isChecked(); m_preferences->maxRunningJobCount = spinBoxJobCount->value(); @@ -114,6 +123,22 @@ void PreferencesDialog::resetButtonPressed(void) showEvent(NULL); } +void PreferencesDialog::use10BitEncodingToggled(bool checked) +{ + if(checked) + { + QString text; + text += tr("Please note that 10−Bit H.264 streams are not currently supported by hardware (standalone) players!
"); + text += tr("To play such streams, you will need an up−to−date ffdshow−tryouts, CoreAVC 3.x or another supported s/w decoder.
"); + text += tr("Also be aware that hardware−acceleration (CUDA, DXVA, etc) usually will not work with 10−Bit H.264 streams.
"); + + if(QMessageBox::warning(this, tr("10-Bit Encoding"), text, tr("Continue"), tr("Revert"), QString(), 1) != 0) + { + UPDATE_CHECKBOX(checkUse10BitEncoding, false); + } + } +} + /////////////////////////////////////////////////////////////////////////////// // Static Functions /////////////////////////////////////////////////////////////////////////////// @@ -125,6 +150,7 @@ void PreferencesDialog::initPreferences(Preferences *preferences) preferences->autoRunNextJob = true; preferences->maxRunningJobCount = 1; preferences->shutdownComputer = false; + preferences->use10BitEncoding = false; preferences->useAvisyth64Bit = false; } @@ -140,6 +166,7 @@ void PreferencesDialog::loadPreferences(Preferences *preferences) preferences->autoRunNextJob = settings.value("auto_run_next_job", QVariant(defaults.autoRunNextJob)).toBool(); preferences->maxRunningJobCount = qBound(1U, settings.value("max_running_job_count", QVariant(defaults.maxRunningJobCount)).toUInt(), 16U); preferences->shutdownComputer = settings.value("shutdown_computer_on_completion", QVariant(defaults.shutdownComputer)).toBool(); + preferences->use10BitEncoding = settings.value("use_10bit_encoding", QVariant(defaults.use10BitEncoding)).toBool(); preferences->useAvisyth64Bit = settings.value("use_64bit_avisynth", QVariant(defaults.useAvisyth64Bit)).toBool(); } @@ -152,6 +179,7 @@ void PreferencesDialog::savePreferences(Preferences *preferences) settings.setValue("auto_run_next_job", preferences->autoRunNextJob); settings.setValue("shutdown_computer_on_completion", preferences->shutdownComputer); settings.setValue("max_running_job_count", preferences->maxRunningJobCount); + settings.setValue("use_10bit_encoding", preferences->use10BitEncoding); settings.setValue("use_64bit_avisynth", preferences->useAvisyth64Bit); settings.sync(); } diff --git a/src/win_preferences.h b/src/win_preferences.h index 57f0a88..9f04252 100644 --- a/src/win_preferences.h +++ b/src/win_preferences.h @@ -33,6 +33,7 @@ public: bool autoRunNextJob; unsigned int maxRunningJobCount; bool shutdownComputer; + bool use10BitEncoding; bool useAvisyth64Bit; } Preferences; @@ -58,4 +59,5 @@ private: private slots: void resetButtonPressed(void); + void use10BitEncodingToggled(bool checked); }; diff --git a/z_build.bat b/z_build.bat index e278f3d..da33dc4 100644 --- a/z_build.bat +++ b/z_build.bat @@ -104,7 +104,7 @@ REM /////////////////////////////////////////////////////////////////////////// REM // Compress REM /////////////////////////////////////////////////////////////////////////// "%UPX3_PATH%\upx.exe" --brute "%PACK_PATH%\*.exe" -"%UPX3_PATH%\upx.exe" --best "%PACK_PATH%\*.dll" +"%UPX3_PATH%\upx.exe" --best "%PACK_PATH%\*.dll" REM /////////////////////////////////////////////////////////////////////////// REM // Attributes @@ -134,6 +134,7 @@ echo #Generated File - Do NOT modify! > "%NSI_FILE%" echo !define ZIP2EXE_NAME `Simple x264 Launcher (%ISO_DATE%)` >> "%NSI_FILE%" echo !define ZIP2EXE_OUTFILE `%OUT_FULL%` >> "%NSI_FILE%" echo !define ZIP2EXE_COMPRESSOR_LZMA >> "%NSI_FILE%" +echo !define ZIP2EXE_COMPRESSOR_SOLID >> "%NSI_FILE%" echo !define ZIP2EXE_INSTALLDIR `$PROGRAMFILES\MuldeR\Simple x264 Launcher v2` >> "%NSI_FILE%" echo !define ZIP2EXE_REGPATH `SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{986E454F-DACA-4326-A9C7-3E46C0BFFDCE}` >> "%NSI_FILE%" echo !define MUI_INSTFILESPAGE_COLORS "C5DEFB 000000" >> "%NSI_FILE%" @@ -142,6 +143,7 @@ echo ShowInstDetails show >> "%NSI_FILE%" echo BrandingText `Created: %ISO_DATE%, %ISO_TIME% [Build #%BUILD_NO%]` >> "%NSI_FILE%" echo InstallDirRegKey HKLM `${ZIP2EXE_REGPATH}` InstallLocation >> "%NSI_FILE%" echo !include `${NSISDIR}\Contrib\zip2exe\Base.nsh` >> "%NSI_FILE%" +echo SetCompressorDictSize 96 >> "%NSI_FILE%" echo !include `${NSISDIR}\Contrib\zip2exe\Modern.nsh` >> "%NSI_FILE%" echo !include `%~dp0\etc\check_os.nsh` >> "%NSI_FILE%" echo !include `%~dp0\etc\finalization.nsh` >> "%NSI_FILE%"