From 24ab739e1e606101fda3f834ee2cee7d40bc4216 Mon Sep 17 00:00:00 2001 From: Zhou Qiankang Date: Sat, 21 Dec 2024 20:25:41 +0800 Subject: [PATCH] fix: unify line endings to LF * A project should ensure the same line endings --- .clang-format | 2 +- addons/avisynthproxy/avsproxy.sln | 44 +- addons/avisynthproxy/avsproxy.vcproj | 526 +- autononreg/js/audio/lame.js | 56 +- autononreg/js/audio/stream.js | 34 +- autononreg/js/codecwrite/codecwrite.js | 68 +- autononreg/js/dialogFactory/integer.js | 24 +- autononreg/js/dialogFactory/menu.js | 44 +- autononreg/js/dialogFactory/toggle.js | 24 +- autononreg/js/dialogFactory/unit/bar.js | 14 +- autononreg/js/dialogFactory/unit/binhex.js | 12 +- autononreg/js/dialogFactory/unit/bitrate.js | 12 +- autononreg/js/dialogFactory/unit/button.js | 8 +- autononreg/js/dialogFactory/unit/dirsel.js | 14 +- autononreg/js/dialogFactory/unit/encoding.js | 12 +- autononreg/js/dialogFactory/unit/fileread.js | 12 +- autononreg/js/dialogFactory/unit/float.js | 12 +- autononreg/js/dialogFactory/unit/frame.js | 8 +- autononreg/js/dialogFactory/unit/hex.js | 8 +- autononreg/js/dialogFactory/unit/integer.js | 12 +- autononreg/js/dialogFactory/unit/matrix.js | 8 +- autononreg/js/dialogFactory/unit/menu.js | 12 +- autononreg/js/dialogFactory/unit/notch.js | 12 +- .../js/dialogFactory/unit/readonlytext.js | 12 +- autononreg/js/dialogFactory/unit/slider.js | 8 +- autononreg/js/dialogFactory/unit/tabs.js | 12 +- autononreg/js/dialogFactory/unit/text.js | 12 +- .../js/dialogFactory/unit/threadcount.js | 8 +- autononreg/js/dialogFactory/unit/toggle.js | 8 +- autononreg/js/fcctest.js | 46 +- autononreg/js/fpstest.js | 62 +- autononreg/js/functiontest/assert.js | 14 +- autononreg/js/functiontest/crash.js | 14 +- autononreg/js/functiontest/direread.js | 34 +- autononreg/js/functiontest/fcctest.js | 48 +- autononreg/js/functiontest/fileread.js | 36 +- autononreg/js/functiontest/fpstest.js | 66 +- autononreg/js/functiontest/savejpg_seek.js | 36 +- autononreg/js/functiontest/width.js | 70 +- autononreg/js/nbframestest.js | 28 +- autononreg/js/setContainer.js | 54 +- autononreg/js/utils/trytoreadall.js | 78 +- autononreg/js/videofunc/dumpEditing.js | 10 +- autononreg/js/videofunc/dumpTiming.js | 10 +- autononreg/js/videofunc/size.js | 30 +- autononreg/js/videofunc/type.js | 30 +- autononreg/js/width.js | 66 +- autononreg/py/avidemux/pyAudioTracksCount.py | 34 +- autononreg/py/avidemux/pyBmp.py | 18 +- autononreg/py/avidemux/pyDoubleLoad.py | 20 +- autononreg/py/avidemux/pyFrequency.py | 48 +- autononreg/py/avidemux/pyJpeg.py | 18 +- autononreg/py/avidemux/pySaveAudio.py | 18 +- autononreg/py/avidemux/pyWidth.py | 36 +- autononreg/py/dialogFactory/pyInteger.py | 24 +- autononreg/py/dialogFactory/pyMenu.py | 36 +- autononreg/py/dialogFactory/pyTimeStamp.py | 26 +- autononreg/py/dialogFactory/pyToggle.py | 24 +- autononreg/py/editor/pyDumpAllSegs.py | 14 +- autononreg/py/editor/pyDumpSegment0.py | 14 +- autononreg/py/editor/pyDumpTiming.py | 16 +- autononreg/py/editor/pyFrameSize.py | 18 +- autononreg/py/editor/pyGetNbSegment.py | 14 +- autononreg/py/editor/pyHexDump.py | 28 +- autononreg/py/editor/pyNextFrame.py | 42 +- autononreg/py/editor/pyPtsDts.py | 12 +- autononreg/py/gui/pyDirSelect.py | 6 +- autononreg/py/gui/pyDisplayError.py | 4 +- autononreg/py/gui/pyDisplayInfo.py | 4 +- autononreg/py/gui/pyFileSel.py | 14 +- avidemux/cli/CMakeLists.txt | 326 +- .../common/ADM_audioCodec/src/CMakeLists.txt | 20 +- .../src/ADM_soundtouch/AAFilter.cpp | 444 +- .../src/ADM_soundtouch/AAFilter.h | 186 +- .../src/ADM_soundtouch/FIFOSampleBuffer.cpp | 550 +- .../src/ADM_soundtouch/FIFOSampleBuffer.h | 360 +- .../src/ADM_soundtouch/FIFOSamplePipe.h | 460 +- .../src/ADM_soundtouch/FIRFilter.cpp | 650 +- .../src/ADM_soundtouch/FIRFilter.h | 280 +- .../src/ADM_soundtouch/InterpolateCubic.cpp | 394 +- .../src/ADM_soundtouch/InterpolateCubic.h | 138 +- .../src/ADM_soundtouch/InterpolateLinear.cpp | 592 +- .../src/ADM_soundtouch/InterpolateLinear.h | 196 +- .../src/ADM_soundtouch/InterpolateShannon.cpp | 364 +- .../src/ADM_soundtouch/InterpolateShannon.h | 148 +- .../src/ADM_soundtouch/PeakFinder.cpp | 554 +- .../src/ADM_soundtouch/PeakFinder.h | 180 +- .../src/ADM_soundtouch/RateTransposer.cpp | 630 +- .../src/ADM_soundtouch/RateTransposer.h | 328 +- .../src/ADM_soundtouch/STTypes.h | 382 +- .../src/ADM_soundtouch/SoundTouch.cpp | 1074 +-- .../src/ADM_soundtouch/SoundTouch.h | 696 +- .../src/ADM_soundtouch/TDStretch.cpp | 2202 ++--- .../src/ADM_soundtouch/TDStretch.h | 558 +- .../src/ADM_soundtouch/mmx_optimized.cpp | 792 +- .../src/ADM_soundtouch/sse_optimized.cpp | 730 +- avidemux/common/ADM_icons/tray/film1.xpm | 568 +- avidemux/common/ADM_icons/tray/film11.xpm | 568 +- avidemux/common/ADM_icons/tray/film13.xpm | 568 +- avidemux/common/ADM_icons/tray/film15.xpm | 568 +- avidemux/common/ADM_icons/tray/film17.xpm | 568 +- avidemux/common/ADM_icons/tray/film19.xpm | 568 +- avidemux/common/ADM_icons/tray/film21.xpm | 568 +- avidemux/common/ADM_icons/tray/film23.xpm | 568 +- avidemux/common/ADM_icons/tray/film3.xpm | 568 +- avidemux/common/ADM_icons/tray/film5.xpm | 568 +- avidemux/common/ADM_icons/tray/film7.xpm | 568 +- avidemux/common/ADM_icons/tray/film9.xpm | 568 +- .../ADM_libraries/ADM_libsdl/CMakeLists.txt | 12 +- avidemux/common/ADM_libraries/CMakeLists.txt | 6 +- avidemux/common/ADM_render/CMakeLists.txt | 168 +- .../common/ADM_render/GUI_sdlRenderHelper.m | 278 +- avidemux/common/ADM_script2/CMakeLists.txt | 2 +- avidemux/common/ADM_videoCodec/CMakeLists.txt | 2 +- avidemux/gtk/ADM_UIs/src/CMakeLists.txt | 62 +- .../ADM_dialog/CMakeLists.txt | 82 +- .../ADM_filters/CMakeLists.txt | 18 +- .../ADM_gui2/CMakeLists.txt | 20 +- .../ADM_gui2/GUI_gtkRenderHelper.m | 36 +- .../ADM_userInterfaces/ADM_ocr/CMakeLists.txt | 14 +- .../ADM_toolkit_gtk/CMakeLists.txt | 24 +- .../ADM_userInterfaces/glade/CMakeLists.txt | 22 +- .../glade/main/CMakeLists.txt | 16 +- .../glade/old/project_newencoding.glade | 2550 +++--- .../glade/old/project_properties.glade | 2330 +++--- .../glade/old/project_x264.glade | 7218 ++++++++--------- avidemux/gtk/CMakeLists.txt | 294 +- avidemux/qt4/ADM_UIs/CMakeLists.txt | 4 +- avidemux/qt4/ADM_jobs/CMakeLists.txt | 2 +- avidemux/qt4/ADM_jobs/src/CMakeLists.txt | 216 +- avidemux/qt4/ADM_openGL/CMakeLists.txt | 2 +- avidemux/qt4/ADM_openGL/src/CMakeLists.txt | 24 +- avidemux/qt4/ADM_update/CMakeLists.txt | 2 +- avidemux/qt4/ADM_update/src/CMakeLists.txt | 28 +- .../ADM_filters/CMakeLists.txt | 30 +- .../ADM_userInterfaces/ADM_gui/CMakeLists.txt | 96 +- .../ADM_gui/fonts/DSEG-LICENSE.txt | 190 +- .../ADM_userInterfaces/ADM_ocr/CMakeLists.txt | 24 +- avidemux/qt4/CMakeLists.txt | 510 +- avidemux/qt4/old.cmake | 608 +- avidemux/winInstaller/Build-Info.txt | 54 +- avidemux/winInstaller/InstallOptions.ini | 72 +- avidemux/winInstaller/UAC.nsh | 596 +- avidemux/winInstaller/What's New.html | 142 +- avidemux/winInstaller/avidemux_cross32Qt5.nsi | 220 +- avidemux/winInstaller/avidemux_cross64Qt5.nsi | 196 +- avidemux/winInstaller/avidemux_crossQt5.nsi | 802 +- .../winInstaller/avidemux_nativeVcQt5.nsi | 232 +- avidemux/winInstaller/old/avidemux.nsi | 3632 ++++----- avidemux/winInstaller/old/avidemux_cross.nsi | 3176 ++++---- .../winInstaller/old/avidemux_cross64.nsi | 3186 ++++---- .../winInstaller/qtifw/config/config.xml.in | 30 +- .../org.avidemux.dev/meta/installscript.qs | 62 +- .../org.avidemux.dev/meta/package.xml.in | 14 +- .../data/scripts/auto_uninstall.js | 46 +- .../org.avidemux.run/meta/installscript.js | 308 +- .../org.avidemux.run/meta/license.txt | 678 +- .../org.avidemux.run/meta/package.xml.in | 32 +- .../org.avidemux.run/meta/targetwidget.ui | 166 +- avidemux/winInstaller/qtifw/split.bash | 54 +- avidemux/winInstaller/revision.xslt | 22 +- avidemux/winInstaller/svnlog.xslt | 264 +- .../ADM_core/include/ADM_crashdump_vs.h | 22 +- avidemux_core/ADM_core/src/ADM_folder_vs.cpp | 596 +- .../include/ADM_coreSubtitles_export.h | 106 +- .../ADM_coreSubtitles/src/CMakeLists.txt | 12 +- .../ffmpeg_package/patches/createPatches.sh | 92 +- .../ADM_ad_mad/ADM_libMad/CMakeLists.txt | 38 +- .../ADM_ad_mad/CMakeLists.txt | 68 +- .../ADM_autoScrips/CMakeLists.txt | 14 +- .../NativeAvisynth/ADM_nativeAvs.cpp | 892 +- .../NativeAvisynth/ADM_nativeAvs.h | 224 +- .../NativeAvisynth/ADM_nativeAvsAudio.cpp | 198 +- .../NativeAvisynth/ADM_nativeAvsPlugin.cpp | 84 +- .../NativeAvisynth/CMakeLists.txt | 166 +- .../ADM_demuxers/NativeAvisynth/Syntax.avs | 88 +- .../ADM_demuxers/NativeAvisynth/avisynth.h | 2766 +++---- .../NativeAvisynth/avs/alignment.h | 268 +- .../ADM_demuxers/NativeAvisynth/avs/capi.h | 132 +- .../ADM_demuxers/NativeAvisynth/avs/config.h | 140 +- .../ADM_demuxers/NativeAvisynth/avs/cpuid.h | 160 +- .../ADM_demuxers/NativeAvisynth/avs/minmax.h | 108 +- .../ADM_demuxers/NativeAvisynth/avs/types.h | 114 +- .../ADM_demuxers/NativeAvisynth/avs/win.h | 108 +- .../VapourSynth/qt4/CMakeLists.txt | 152 +- .../ADM_muxers/muxerMplex/CMakeLists.txt | 66 +- .../qtScript/src/exampleScript/Dialog.admjs | 56 +- .../qtScript/src/footer.html | 24 +- .../qtScript/src/header.html | 96 +- .../src/ADM_script_spiderMonkey.v | 14 +- .../spiderMonkey/src/smjs/CMakeLists.txt | 46 +- .../src/src_dialogFactory/CMakeLists.txt | 44 +- .../tinyPy/src/ADM_script_tinyPy.v | 14 +- .../ADM_videoDecoder/CMakeLists.txt | 4 +- .../ADM_videoEncoder/CMakeLists.txt | 70 +- .../ADM_videoEncoder/ffv1/CMakeLists.txt | 28 +- .../ADM_videoEncoder/huff/CMakeLists.txt | 28 +- .../ADM_videoEncoder/jpeg/CMakeLists.txt | 28 +- .../ADM_videoEncoder/png/CMakeLists.txt | 24 +- .../ADM_videoEncoder/yv12/CMakeLists.txt | 24 +- .../ADM_videoFilters/CMakeLists.txt | 116 +- .../ADM_videoFilters/Srt/CMakeLists.txt | 74 +- .../ADM_videoFilters/TIsophote/HELP FILE.txt | 236 +- .../Tdeint/ADM_vidTdeint_util.txt | 6288 +++++++------- .../ADM_videoFilters6/CMakeLists.txt | 182 +- .../ass/ADM_libass/CMakeLists.txt | 114 +- .../blend/ADM_vidBlendFrames.cpp | 450 +- .../ADM_videoFilters6/blend/blend.conf | 4 +- cmake/FindBourne.cmake | 48 +- cmake/FindGitSvn.cmake | 140 +- cmake/FindGnuMake.cmake | 48 +- cmake/FindPatch.cmake | 78 +- cmake/FindSDL.cmake | 326 +- cmake/FindSubversion.cmake | 228 +- cmake/FindTar.cmake | 36 +- cmake/Po.cmake | 92 +- cmake/_CMakeParseArguments.cmake | 276 +- cmake/admCheckAudioEncoderLibs.cmake | 418 +- cmake/admCheckFaad.cmake | 96 +- cmake/admCheckFdkAac.cmake | 72 +- cmake/admCheckFontConfig.cmake | 48 +- cmake/admCheckFreeType.cmake | 118 +- cmake/admCheckFtello.cmake | 48 +- cmake/admCheckGettext.cmake | 102 +- cmake/admCheckGtk.cmake | 124 +- cmake/admCheckLibxml2.cmake | 54 +- cmake/admCheckMiscLibs.cmake | 196 +- cmake/admCheckOpus.cmake | 46 +- cmake/admCheckQt4.cmake | 178 +- cmake/admCheckRequiredLibs.cmake | 124 +- cmake/admCheckSpiderMonkey.cmake | 24 +- cmake/admCheckSqlLite.cmake | 54 +- cmake/admCheckVapourSynth.cmake | 94 +- cmake/admCheckVpx.cmake | 96 +- cmake/admCheckX264.cmake | 80 +- cmake/admCheckXvid.cmake | 38 +- cmake/admConfigHelper.cmake | 408 +- cmake/admConfigSummary.cmake | 190 +- cmake/admDetermineSystem.cmake | 222 +- cmake/admFFmpegBuild.cmake | 34 +- cmake/admFFmpegBuild.cmake.original | 836 +- cmake/admFFmpegBuild_crossMingw.cmake | 232 +- cmake/admFFmpegBuild_vs_import.cmake | 214 +- cmake/admFFmpegPrepareGit.cmake | 64 +- cmake/admFFmpegPrepareSvn.cmake | 122 +- cmake/admFFmpegPrepareTar.cmake | 62 +- cmake/admFFmpegUtil.cmake | 208 +- cmake/admOpenGl.cmake | 18 +- cmake/attic/FindThreads.cmake | 160 +- .../cmake_compile_check/CheckFunctionExists.c | 46 +- cmake/cmake_win32_rc/VersionInfo.in | 164 +- cmake/cmake_win32_rc/VersionResource.rc | 104 +- .../generate_product_version.cmake | 214 +- cmake/cmake_win32_rc/language_utf8.patch | 56 +- cmake/config.h.cmake | 134 +- cmake/ffmpeg_configure.sh.cmake | 2 +- cmake/ffmpeg_make.sh.cmake | 4 +- .../Set Common Environment Variables.bat | 158 +- foreignBuilds/mswin/aften/Perform Build.bat | 116 +- foreignBuilds/mswin/avidemux/1. Build.bat | 108 +- .../mswin/avidemux/1a. Pre-build.bat | 60 +- .../mswin/avidemux/1b. Perform Build.bat | 158 +- .../mswin/avidemux/1c. Post-build.bat | 196 +- .../mswin/avidemux/2. Create Packages.bat | 92 +- .../mswin/avidemux/2a. Update Notes.bat | 38 +- .../mswin/avidemux/2b. Package SDK.bat | 36 +- .../mswin/avidemux/2c. Package Build.bat | 68 +- .../Set Avidemux Environment Variables.bat | 134 +- .../mswin/avidemux/Tools/Build Plugins.bat | 116 +- .../avidemux/Tools/Build Qt Translations.bat | 44 +- .../avidemux/Tools/Get Revision Number.bat | 18 +- .../mswin/avidemux/Tools/package_notes.xslt | 252 +- .../mswin/avidemux/Tools/touch_files.xslt | 302 +- .../mswin/avsproxy/Perform Build.bat | 60 +- foreignBuilds/mswin/dcaenc/Perform Build.bat | 148 +- foreignBuilds/mswin/expat/Perform Build.bat | 142 +- foreignBuilds/mswin/faac/Perform Build.bat | 134 +- foreignBuilds/mswin/faac/makefile | 8 +- foreignBuilds/mswin/faad/Perform Build.bat | 134 +- foreignBuilds/mswin/faad/makefile | 8 +- .../mswin/fontconfig/Perform Build.bat | 144 +- .../mswin/freetype/Perform Build.bat | 144 +- foreignBuilds/mswin/fribidi/Perform Build.bat | 158 +- foreignBuilds/mswin/js/Perform Build.bat | 158 +- foreignBuilds/mswin/js/WINNT6.1.mk | 50 +- foreignBuilds/mswin/lame/Perform Build.bat | 148 +- foreignBuilds/mswin/libogg/Perform Build.bat | 140 +- .../mswin/libvorbis/Perform Build.bat | 142 +- foreignBuilds/mswin/libvpx/Perform Build.bat | 138 +- foreignBuilds/mswin/nspr/Perform Build.bat | 170 +- .../mswin/opencore-amr/Perform Build.bat | 140 +- foreignBuilds/mswin/qt/Perform Build.bat | 220 +- foreignBuilds/mswin/sqlite/Perform Build.bat | 142 +- foreignBuilds/mswin/twolame/Perform Build.bat | 140 +- .../mswin/win-iconv/Perform Build.bat | 120 +- foreignBuilds/mswin/x264/Perform Build.bat | 104 +- foreignBuilds/mswin/xvid/Perform Build.bat | 158 +- foreignBuilds/mswin/xvid/configure.patch | 18 +- foreignBuilds/mswin/zlib/Perform Build.bat | 138 +- myOwnPlugins/demuxer/CMakeLists.txt | 164 +- 300 files changed, 38901 insertions(+), 38901 deletions(-) diff --git a/.clang-format b/.clang-format index 8336369246..9a3f7e4208 100644 --- a/.clang-format +++ b/.clang-format @@ -1,4 +1,4 @@ ---- +--- BasedOnStyle: Microsoft Language: Cpp Standard: Auto diff --git a/addons/avisynthproxy/avsproxy.sln b/addons/avisynthproxy/avsproxy.sln index 2f81e9c27f..cb36b9adba 100755 --- a/addons/avisynthproxy/avsproxy.sln +++ b/addons/avisynthproxy/avsproxy.sln @@ -1,22 +1,22 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avsproxy", "avsproxy.vcxproj", "{FDA95A7F-919C-4343-96C6-FB0F59FFE5B0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {FDA95A7F-919C-4343-96C6-FB0F59FFE5B0}.Debug|Win32.ActiveCfg = Debug|Win32 - {FDA95A7F-919C-4343-96C6-FB0F59FFE5B0}.Debug|Win32.Build.0 = Debug|Win32 - {FDA95A7F-919C-4343-96C6-FB0F59FFE5B0}.Release|Win32.ActiveCfg = Release|Win32 - {FDA95A7F-919C-4343-96C6-FB0F59FFE5B0}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avsproxy", "avsproxy.vcxproj", "{FDA95A7F-919C-4343-96C6-FB0F59FFE5B0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FDA95A7F-919C-4343-96C6-FB0F59FFE5B0}.Debug|Win32.ActiveCfg = Debug|Win32 + {FDA95A7F-919C-4343-96C6-FB0F59FFE5B0}.Debug|Win32.Build.0 = Debug|Win32 + {FDA95A7F-919C-4343-96C6-FB0F59FFE5B0}.Release|Win32.ActiveCfg = Release|Win32 + {FDA95A7F-919C-4343-96C6-FB0F59FFE5B0}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/addons/avisynthproxy/avsproxy.vcproj b/addons/avisynthproxy/avsproxy.vcproj index e3bb174c69..6092e1479d 100755 --- a/addons/avisynthproxy/avsproxy.vcproj +++ b/addons/avisynthproxy/avsproxy.vcproj @@ -1,263 +1,263 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/autononreg/js/audio/lame.js b/autononreg/js/audio/lame.js index 34606ec5cd..e55a39ae7b 100644 --- a/autononreg/js/audio/lame.js +++ b/autononreg/js/audio/lame.js @@ -1,28 +1,28 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -var app = new Avidemux(); -var file="/work/samples/dual_avi.avi"; -var fps; -/* Load file -*/ -print("lamepreset Test Start"); -app.load(file); -app.audio.codec("lame",128); -//displayInfo("Changing preset"); -/* Test get fps -*/ -if(!app.audio.lamePreset("CBR")) -{ - displayError("CBR preset failed"); -} -if(!app.audio.lamePreset("ABR")) -{ - displayError("ABR preset failed"); -} -if(!app.audio.lamePreset("EXtreme")) -{ - displayError("Extreme preset failed"); -} -print("lamepreset Test End"); - -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +var app = new Avidemux(); +var file="/work/samples/dual_avi.avi"; +var fps; +/* Load file +*/ +print("lamepreset Test Start"); +app.load(file); +app.audio.codec("lame",128); +//displayInfo("Changing preset"); +/* Test get fps +*/ +if(!app.audio.lamePreset("CBR")) +{ + displayError("CBR preset failed"); +} +if(!app.audio.lamePreset("ABR")) +{ + displayError("ABR preset failed"); +} +if(!app.audio.lamePreset("EXtreme")) +{ + displayError("Extreme preset failed"); +} +print("lamepreset Test End"); + +/* End of test +*/ diff --git a/autononreg/js/audio/stream.js b/autononreg/js/audio/stream.js index d5c2ce83a5..233fda2b3c 100644 --- a/autononreg/js/audio/stream.js +++ b/autononreg/js/audio/stream.js @@ -1,17 +1,17 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -var app = new Avidemux(); -var file="/work/samples/dual_avi.avi"; -var fps; -/* Load file -*/ -print("Audio Test Start"); -app.load(file); -/* Test get fps -*/ -fps=app.audio.getNbTracks(); -displayInfo("# "+fps); -app.audio.setTrack(1); -print("Audio Test End"); - -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +var app = new Avidemux(); +var file="/work/samples/dual_avi.avi"; +var fps; +/* Load file +*/ +print("Audio Test Start"); +app.load(file); +/* Test get fps +*/ +fps=app.audio.getNbTracks(); +displayInfo("# "+fps); +app.audio.setTrack(1); +print("Audio Test End"); + +/* End of test +*/ diff --git a/autononreg/js/codecwrite/codecwrite.js b/autononreg/js/codecwrite/codecwrite.js index 0fd337816e..851429d337 100644 --- a/autononreg/js/codecwrite/codecwrite.js +++ b/autononreg/js/codecwrite/codecwrite.js @@ -1,34 +1,34 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -var app = new Avidemux(); -var file="/work/samples/2mn.avi"; -var dir="/tmp/"; -/* Load file -*/ -if(!app.load(file)) -{ - displayError("Failed to load "+file); -} -/* - Save using all codec with their default settings -*/ -app.setContainer("AVI"); -/* - -*/ -doit("XVID4","xvid4"); -doit("Mpeg4","xvid4"); -doit("H263","xvid4"); -doit("FFHUFF","xvid4"); -doit("HUFF","xvid4"); -doit("FFV1","xvid4"); -doit("Mjpeg","xvid4"); -doit("x264","xvid4"); -/* End of test -*/ -function doit(codec,out) -{ -app.video.codec(codec,"CQ=4",""); -app.save(dir+out+".avi"); -return true; - -} +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +var app = new Avidemux(); +var file="/work/samples/2mn.avi"; +var dir="/tmp/"; +/* Load file +*/ +if(!app.load(file)) +{ + displayError("Failed to load "+file); +} +/* + Save using all codec with their default settings +*/ +app.setContainer("AVI"); +/* + +*/ +doit("XVID4","xvid4"); +doit("Mpeg4","xvid4"); +doit("H263","xvid4"); +doit("FFHUFF","xvid4"); +doit("HUFF","xvid4"); +doit("FFV1","xvid4"); +doit("Mjpeg","xvid4"); +doit("x264","xvid4"); +/* End of test +*/ +function doit(codec,out) +{ +app.video.codec(codec,"CQ=4",""); +app.save(dir+out+".avi"); +return true; + +} diff --git a/autononreg/js/dialogFactory/integer.js b/autononreg/js/dialogFactory/integer.js index 54e91ecc1c..34ac01cf3a 100644 --- a/autononreg/js/dialogFactory/integer.js +++ b/autononreg/js/dialogFactory/integer.js @@ -1,12 +1,12 @@ - var toggle = new DFInteger("Integer (5-10)",5,10); - var dlgWizard = new DialogFactory("Dialog Factory toggle"); - - - toggle.value=7; - dlgWizard.addControl(toggle); - - if (dlgWizard.show()) - { - var out="toggle "+toggle.value; - print(out); - } + var toggle = new DFInteger("Integer (5-10)",5,10); + var dlgWizard = new DialogFactory("Dialog Factory toggle"); + + + toggle.value=7; + dlgWizard.addControl(toggle); + + if (dlgWizard.show()) + { + var out="toggle "+toggle.value; + print(out); + } diff --git a/autononreg/js/dialogFactory/menu.js b/autononreg/js/dialogFactory/menu.js index a0647b83b7..4151980b0f 100644 --- a/autononreg/js/dialogFactory/menu.js +++ b/autononreg/js/dialogFactory/menu.js @@ -1,22 +1,22 @@ - var aspectRatios = [[1, 1], [4, 3], [16, 9]]; - var mnuResolution = new DFMenu("Resolution:"); - var mnuSourceRatio = new DFMenu("Source Aspect Ratio:"); - var mnuDestinationRatio = new DFMenu("Destination Aspect Ratio:"); - var dlgWizard = new DialogFactory("Dialog Factory menu"); - var i; - - for (i = 0; i < aspectRatios.length; i++) - { - mnuSourceRatio.addItem(aspectRatios[i][0].toString() + ":" + aspectRatios[i][1].toString()); - mnuDestinationRatio.addItem(aspectRatios[i][0].toString() + ":" + aspectRatios[i][1].toString()); - } - - - dlgWizard.addControl(mnuSourceRatio); - dlgWizard.addControl(mnuDestinationRatio); - - if (dlgWizard.show()) - { - var out="source index"+mnuSourceRatio.index+", dest index="+mnuDestinationRatio.index; - print(out); - } + var aspectRatios = [[1, 1], [4, 3], [16, 9]]; + var mnuResolution = new DFMenu("Resolution:"); + var mnuSourceRatio = new DFMenu("Source Aspect Ratio:"); + var mnuDestinationRatio = new DFMenu("Destination Aspect Ratio:"); + var dlgWizard = new DialogFactory("Dialog Factory menu"); + var i; + + for (i = 0; i < aspectRatios.length; i++) + { + mnuSourceRatio.addItem(aspectRatios[i][0].toString() + ":" + aspectRatios[i][1].toString()); + mnuDestinationRatio.addItem(aspectRatios[i][0].toString() + ":" + aspectRatios[i][1].toString()); + } + + + dlgWizard.addControl(mnuSourceRatio); + dlgWizard.addControl(mnuDestinationRatio); + + if (dlgWizard.show()) + { + var out="source index"+mnuSourceRatio.index+", dest index="+mnuDestinationRatio.index; + print(out); + } diff --git a/autononreg/js/dialogFactory/toggle.js b/autononreg/js/dialogFactory/toggle.js index 07ee10f28d..70b91a75f9 100644 --- a/autononreg/js/dialogFactory/toggle.js +++ b/autononreg/js/dialogFactory/toggle.js @@ -1,12 +1,12 @@ - var toggle = new DFToggle("Toggle:"); - var dlgWizard = new DialogFactory("Dialog Factory toggle"); - - - toggle.value=0; - dlgWizard.addControl(toggle); - - if (dlgWizard.show()) - { - var out="toggle "+toggle.value; - print(out); - } + var toggle = new DFToggle("Toggle:"); + var dlgWizard = new DialogFactory("Dialog Factory toggle"); + + + toggle.value=0; + dlgWizard.addControl(toggle); + + if (dlgWizard.show()) + { + var out="toggle "+toggle.value; + print(out); + } diff --git a/autononreg/js/dialogFactory/unit/bar.js b/autononreg/js/dialogFactory/unit/bar.js index 7bbb7466bc..54baff7dad 100644 --- a/autononreg/js/dialogFactory/unit/bar.js +++ b/autononreg/js/dialogFactory/unit/bar.js @@ -1,7 +1,7 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory bar"); - admTestFacBar(); -print("/Testing factory bar"); - -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory bar"); + admTestFacBar(); +print("/Testing factory bar"); + +/* End of test +*/ diff --git a/autononreg/js/dialogFactory/unit/binhex.js b/autononreg/js/dialogFactory/unit/binhex.js index 6f8a13d86b..97b806f81c 100644 --- a/autononreg/js/dialogFactory/unit/binhex.js +++ b/autononreg/js/dialogFactory/unit/binhex.js @@ -1,6 +1,6 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory Hex"); - admTestFacHex(); -print("Testing factory Hex"); -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory Hex"); + admTestFacHex(); +print("Testing factory Hex"); +/* End of test +*/ diff --git a/autononreg/js/dialogFactory/unit/bitrate.js b/autononreg/js/dialogFactory/unit/bitrate.js index fb2c66eb43..a1ded90984 100644 --- a/autononreg/js/dialogFactory/unit/bitrate.js +++ b/autononreg/js/dialogFactory/unit/bitrate.js @@ -1,6 +1,6 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory Bitrate"); - admTestFacBitrate(); -print("Testing factory Bitrate"); -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory Bitrate"); + admTestFacBitrate(); +print("Testing factory Bitrate"); +/* End of test +*/ diff --git a/autononreg/js/dialogFactory/unit/button.js b/autononreg/js/dialogFactory/unit/button.js index 1e79ab1333..359bec1b11 100644 --- a/autononreg/js/dialogFactory/unit/button.js +++ b/autononreg/js/dialogFactory/unit/button.js @@ -1,4 +1,4 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory Button"); - admTestFacButton(); -print("Testing factory Button"); +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory Button"); + admTestFacButton(); +print("Testing factory Button"); diff --git a/autononreg/js/dialogFactory/unit/dirsel.js b/autononreg/js/dialogFactory/unit/dirsel.js index a8e567bdaf..e6a41ac815 100644 --- a/autononreg/js/dialogFactory/unit/dirsel.js +++ b/autononreg/js/dialogFactory/unit/dirsel.js @@ -1,7 +1,7 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory DirSel"); - admTestFacDirSel(); -print("Testing factory DirSel"); - -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory DirSel"); + admTestFacDirSel(); +print("Testing factory DirSel"); + +/* End of test +*/ diff --git a/autononreg/js/dialogFactory/unit/encoding.js b/autononreg/js/dialogFactory/unit/encoding.js index 4a6e9de3b0..da47fea448 100644 --- a/autononreg/js/dialogFactory/unit/encoding.js +++ b/autononreg/js/dialogFactory/unit/encoding.js @@ -1,6 +1,6 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory FileSel"); -admTestEncoding(); -print("Testing factory FileSel"); -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory FileSel"); +admTestEncoding(); +print("Testing factory FileSel"); +/* End of test +*/ diff --git a/autononreg/js/dialogFactory/unit/fileread.js b/autononreg/js/dialogFactory/unit/fileread.js index 650aa726ef..50a431a48e 100644 --- a/autononreg/js/dialogFactory/unit/fileread.js +++ b/autononreg/js/dialogFactory/unit/fileread.js @@ -1,6 +1,6 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory FileSel"); - admTestFacFile(); -print("Testing factory FileSel"); -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory FileSel"); + admTestFacFile(); +print("Testing factory FileSel"); +/* End of test +*/ diff --git a/autononreg/js/dialogFactory/unit/float.js b/autononreg/js/dialogFactory/unit/float.js index ff074a292f..6042b691a8 100644 --- a/autononreg/js/dialogFactory/unit/float.js +++ b/autononreg/js/dialogFactory/unit/float.js @@ -1,6 +1,6 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory Float"); - admTestFacFloat(); -print("Testing factory Float"); -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory Float"); + admTestFacFloat(); +print("Testing factory Float"); +/* End of test +*/ diff --git a/autononreg/js/dialogFactory/unit/frame.js b/autononreg/js/dialogFactory/unit/frame.js index 8c17b55602..27a9fe7080 100644 --- a/autononreg/js/dialogFactory/unit/frame.js +++ b/autononreg/js/dialogFactory/unit/frame.js @@ -1,4 +1,4 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory Frame"); - admTestFacFrame(); -print("Testing factory Frame"); +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory Frame"); + admTestFacFrame(); +print("Testing factory Frame"); diff --git a/autononreg/js/dialogFactory/unit/hex.js b/autononreg/js/dialogFactory/unit/hex.js index 6a0db63861..57e430edaf 100644 --- a/autononreg/js/dialogFactory/unit/hex.js +++ b/autononreg/js/dialogFactory/unit/hex.js @@ -1,4 +1,4 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory hex"); - admTestFacHex(); -print("Testing factory hex"); +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory hex"); + admTestFacHex(); +print("Testing factory hex"); diff --git a/autononreg/js/dialogFactory/unit/integer.js b/autononreg/js/dialogFactory/unit/integer.js index 9af1a0ca19..7bda7c818a 100644 --- a/autononreg/js/dialogFactory/unit/integer.js +++ b/autononreg/js/dialogFactory/unit/integer.js @@ -1,6 +1,6 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory int"); - admTestFacInt(); -print("Testing factory int"); -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory int"); + admTestFacInt(); +print("Testing factory int"); +/* End of test +*/ diff --git a/autononreg/js/dialogFactory/unit/matrix.js b/autononreg/js/dialogFactory/unit/matrix.js index 1347c8089b..cca1c8b2a7 100644 --- a/autononreg/js/dialogFactory/unit/matrix.js +++ b/autononreg/js/dialogFactory/unit/matrix.js @@ -1,4 +1,4 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory Matrix"); - admTestFacMatrix(); -print("Testing factory Matrix"); +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory Matrix"); + admTestFacMatrix(); +print("Testing factory Matrix"); diff --git a/autononreg/js/dialogFactory/unit/menu.js b/autononreg/js/dialogFactory/unit/menu.js index 776a6afc19..ba33db4c7e 100644 --- a/autononreg/js/dialogFactory/unit/menu.js +++ b/autononreg/js/dialogFactory/unit/menu.js @@ -1,6 +1,6 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory Menu"); - admTestFacMenu(); -print("Testing factory Menu"); -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory Menu"); + admTestFacMenu(); +print("Testing factory Menu"); +/* End of test +*/ diff --git a/autononreg/js/dialogFactory/unit/notch.js b/autononreg/js/dialogFactory/unit/notch.js index 3fe7e2084d..9dc9ce5e56 100644 --- a/autononreg/js/dialogFactory/unit/notch.js +++ b/autononreg/js/dialogFactory/unit/notch.js @@ -1,6 +1,6 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory Notch"); - admTestFacNotch(); -print("Testing factory Notch"); -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory Notch"); + admTestFacNotch(); +print("Testing factory Notch"); +/* End of test +*/ diff --git a/autononreg/js/dialogFactory/unit/readonlytext.js b/autononreg/js/dialogFactory/unit/readonlytext.js index e24529cac2..a8600c027b 100644 --- a/autononreg/js/dialogFactory/unit/readonlytext.js +++ b/autononreg/js/dialogFactory/unit/readonlytext.js @@ -1,6 +1,6 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory RoTexy"); - admTestFacRoText(); -print("Testing factory RoText"); -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory RoTexy"); + admTestFacRoText(); +print("Testing factory RoText"); +/* End of test +*/ diff --git a/autononreg/js/dialogFactory/unit/slider.js b/autononreg/js/dialogFactory/unit/slider.js index 62c5188be2..3d4a48651a 100644 --- a/autononreg/js/dialogFactory/unit/slider.js +++ b/autononreg/js/dialogFactory/unit/slider.js @@ -1,4 +1,4 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory Slider"); - admTestFacSlider(); -print("Testing factory Slider"); +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory Slider"); + admTestFacSlider(); +print("Testing factory Slider"); diff --git a/autononreg/js/dialogFactory/unit/tabs.js b/autononreg/js/dialogFactory/unit/tabs.js index 38ea712075..ebe40d3d03 100644 --- a/autononreg/js/dialogFactory/unit/tabs.js +++ b/autononreg/js/dialogFactory/unit/tabs.js @@ -1,6 +1,6 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory Tabs"); - admTestFacTab(); -print("Testing factory Tabs"); -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory Tabs"); + admTestFacTab(); +print("Testing factory Tabs"); +/* End of test +*/ diff --git a/autononreg/js/dialogFactory/unit/text.js b/autononreg/js/dialogFactory/unit/text.js index f4f1f671ca..e3771f25aa 100644 --- a/autononreg/js/dialogFactory/unit/text.js +++ b/autononreg/js/dialogFactory/unit/text.js @@ -1,6 +1,6 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory Text"); - admTestFacText(); -print("Testing factory Text"); -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory Text"); + admTestFacText(); +print("Testing factory Text"); +/* End of test +*/ diff --git a/autononreg/js/dialogFactory/unit/threadcount.js b/autononreg/js/dialogFactory/unit/threadcount.js index b1d1c2dede..0e2a0e0ebc 100644 --- a/autononreg/js/dialogFactory/unit/threadcount.js +++ b/autononreg/js/dialogFactory/unit/threadcount.js @@ -1,4 +1,4 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory ThreadCount"); - admTestFacThreadCount(); -print("Testing factory ThreadCount"); +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory ThreadCount"); + admTestFacThreadCount(); +print("Testing factory ThreadCount"); diff --git a/autononreg/js/dialogFactory/unit/toggle.js b/autononreg/js/dialogFactory/unit/toggle.js index b1efc38050..00c006fb19 100644 --- a/autononreg/js/dialogFactory/unit/toggle.js +++ b/autononreg/js/dialogFactory/unit/toggle.js @@ -1,4 +1,4 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -print("Testing factory Toggle"); - admTestFacToggle(); -print("Testing factory Toggle"); +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +print("Testing factory Toggle"); + admTestFacToggle(); +print("Testing factory Toggle"); diff --git a/autononreg/js/fcctest.js b/autononreg/js/fcctest.js index c863dc280c..59a089bc6d 100644 --- a/autononreg/js/fcctest.js +++ b/autononreg/js/fcctest.js @@ -1,23 +1,23 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -var app = new Avidemux(); -var file="/work/samples/2mn.avi"; -var goodfcc="DIV3"; -var fps; -/* Load file -*/ -app.load(file); -/* Test get fps -*/ -fps=app.video.getFCC(); -//app.displayInfo("FPS "+fps); -if(fps==goodfcc) -{ -} -else -{ - app.displayError("Good:"+goodfcc+"Bad:"+fps); - app.displayError("Wrong fcc "); -} - -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +var app = new Avidemux(); +var file="/work/samples/2mn.avi"; +var goodfcc="DIV3"; +var fps; +/* Load file +*/ +app.load(file); +/* Test get fps +*/ +fps=app.video.getFCC(); +//app.displayInfo("FPS "+fps); +if(fps==goodfcc) +{ +} +else +{ + app.displayError("Good:"+goodfcc+"Bad:"+fps); + app.displayError("Wrong fcc "); +} + +/* End of test +*/ diff --git a/autononreg/js/fpstest.js b/autononreg/js/fpstest.js index a64fa4140c..4deff46825 100644 --- a/autononreg/js/fpstest.js +++ b/autononreg/js/fpstest.js @@ -1,31 +1,31 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -var app = new Avidemux(); -var file="/work/samples/2mn.avi"; -var goodfps=23976; -var fps; -/* Load file -*/ -app.load(file); -/* Test get fps -*/ -fps=app.video.getFps1000(); -//app.displayInfo("FPS "+fps); -if(fps==goodfps) -{ -} -else -{ - app.displayError("Wrong fps "); -} -fps=10000; -app.video.setFps1000(fps); -fps=90; -fps=app.video.getFps1000(); -//app.displayInfo("FPS "+fps); -if(fps!=10000) -{ - app.displayError("Testfps failed"); -} - -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +var app = new Avidemux(); +var file="/work/samples/2mn.avi"; +var goodfps=23976; +var fps; +/* Load file +*/ +app.load(file); +/* Test get fps +*/ +fps=app.video.getFps1000(); +//app.displayInfo("FPS "+fps); +if(fps==goodfps) +{ +} +else +{ + app.displayError("Wrong fps "); +} +fps=10000; +app.video.setFps1000(fps); +fps=90; +fps=app.video.getFps1000(); +//app.displayInfo("FPS "+fps); +if(fps!=10000) +{ + app.displayError("Testfps failed"); +} + +/* End of test +*/ diff --git a/autononreg/js/functiontest/assert.js b/autononreg/js/functiontest/assert.js index acf766d7cd..d18354fd34 100644 --- a/autononreg/js/functiontest/assert.js +++ b/autononreg/js/functiontest/assert.js @@ -1,7 +1,7 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -var app = new Avidemux(); - - assertTest(); - -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +var app = new Avidemux(); + + assertTest(); + +/* End of test +*/ diff --git a/autononreg/js/functiontest/crash.js b/autononreg/js/functiontest/crash.js index 3e2786bb31..ac1bc3802e 100644 --- a/autononreg/js/functiontest/crash.js +++ b/autononreg/js/functiontest/crash.js @@ -1,7 +1,7 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -var app = new Avidemux(); - - crashTest(); - -/* End of test -*/ +//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux +var app = new Avidemux(); + + crashTest(); + +/* End of test +*/ diff --git a/autononreg/js/functiontest/direread.js b/autononreg/js/functiontest/direread.js index d2d2106cba..3fe9b517fe 100644 --- a/autononreg/js/functiontest/direread.js +++ b/autononreg/js/functiontest/direread.js @@ -1,17 +1,17 @@ -//AD <- These first 4 characters need to be the first 4 characters to identify the ECMAScript file to Avidemux -var app = new Avidemux(); -var count; -var file; -/* Load file -*/ -print("DirRead Test Start"); -count=allFilesFrom("/work/samples/"); -print("FPS "+count); -for(i=0;i>>>>>>>>>>>>>>>>>>>>>output"+red+".\n") +gui=Gui() +red=gui.dirSelect("Select a directory ") +print(">>>>>>>>>>>>>>>>>>>>>>output"+red+".\n") diff --git a/autononreg/py/gui/pyDisplayError.py b/autononreg/py/gui/pyDisplayError.py index d228f21dd2..f6826a4c5e 100644 --- a/autononreg/py/gui/pyDisplayError.py +++ b/autononreg/py/gui/pyDisplayError.py @@ -1,2 +1,2 @@ -gui=Gui() -gui.displayError("oops","something went wrong!") +gui=Gui() +gui.displayError("oops","something went wrong!") diff --git a/autononreg/py/gui/pyDisplayInfo.py b/autononreg/py/gui/pyDisplayInfo.py index c5b5b9067f..fb7cc0382b 100644 --- a/autononreg/py/gui/pyDisplayInfo.py +++ b/autononreg/py/gui/pyDisplayInfo.py @@ -1,2 +1,2 @@ -gui=Gui() -gui.displayInfo("Hey","Hello World") +gui=Gui() +gui.displayInfo("Hey","Hello World") diff --git a/autononreg/py/gui/pyFileSel.py b/autononreg/py/gui/pyFileSel.py index 543637ea2d..f5150c98ab 100644 --- a/autononreg/py/gui/pyFileSel.py +++ b/autononreg/py/gui/pyFileSel.py @@ -1,7 +1,7 @@ -gui=Gui() -red=gui.fileReadSelect("Select a file read") -mix=":::::::::: output = @"+red+"@\n" -mix -print(mix) -red=gui.fileWriteSelect("Select a file write") -print(">>>>>>>>>>>>>>>>>>>>>>output<"+str(red)+"@.\n") +gui=Gui() +red=gui.fileReadSelect("Select a file read") +mix=":::::::::: output = @"+red+"@\n" +mix +print(mix) +red=gui.fileWriteSelect("Select a file write") +print(">>>>>>>>>>>>>>>>>>>>>>output<"+str(red)+"@.\n") diff --git a/avidemux/cli/CMakeLists.txt b/avidemux/cli/CMakeLists.txt index 5a4c6a92d3..52d0d0055b 100644 --- a/avidemux/cli/CMakeLists.txt +++ b/avidemux/cli/CMakeLists.txt @@ -1,163 +1,163 @@ -cmake_minimum_required(VERSION 3.7) - -PROJECT(Avidemux_CLI) - -set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake" "${CMAKE_MODULE_PATH}") -include(avidemuxVersion) - -MESSAGE("") -MESSAGE("#########################################") -MESSAGE("Configure for avidemux Cli Started") -MESSAGE("#########################################") -MESSAGE("") - -MESSAGE(STATUS "Checking for avidemux development files ..") - -IF(NOT FAKEROOT) - SET(AVIDEMUX_FAKEROOT "") -else(NOT FAKEROOT) - SET(AVIDEMUX_FAKEROOT "${FAKEROOT}") -endif(NOT FAKEROOT) - -SET(ADM_HEADER_DIR ${AVIDEMUX_FAKEROOT}${CMAKE_INSTALL_PREFIX}/include/avidemux/${AVIDEMUX_API_VERSION}) -SET(ADM_CMAKE_DIR ${ADM_HEADER_DIR}/cmake) -# Common definitions... -SET(CMAKE_MODULE_PATH "${ADM_CMAKE_DIR}" "${CMAKE_MODULE_PATH}") -MESSAGE(STATUS "Checking for avidemux include folder (i.e. CMAKE_INSTALL_PREFIX/include/avidemux/${AVIDEMUX_API_VERSION}") -if(NOT EXISTS "${ADM_HEADER_DIR}") - MESSAGE(STATUS "Make sure you installed all the files.\n i cannot find avidemux include folder.cmake .\nSet CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") - MESSAGE(FATAL_ERROR "Aborting") -endif(NOT EXISTS "${ADM_HEADER_DIR}") - -MESSAGE(STATUS "Found avidemux include folder. good.") -MESSAGE(STATUS "Checking for cmake subfolder") - -if(NOT EXISTS "${ADM_CMAKE_DIR}/commonCmakeApplication.cmake") - MESSAGE(STATUS "Make sure you installed all the files.\n I cannot find content of the cmake subfolder .\n") - MESSAGE(STATUS "Set CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") - MESSAGE(STATUS "I was looking for commonCmakeApplication.cmake in ${ADM_CMAKE_DIR}") - MESSAGE(FATAL_ERROR "Aborting") -endif(NOT EXISTS "${ADM_CMAKE_DIR}/commonCmakeApplication.cmake") -MESSAGE(STATUS "Found cmake subfolder.good.") - - -include(commonCmakeApplication) -INCLUDE(admWindRes) - -# ######################################### -# Config -# ######################################### -ADD_DEFINITIONS(-DADM_UI_TYPE_BUILD=ADM_UI_CLI) -SET(CONFIG_HEADER_TYPE ADM_BUILD_CLI) -SET(UI_SUFFIX cli) - -CONFIGURE_FILE("${ADM_CMAKE_DIR}/config.h.cmake" "${CMAKE_BINARY_DIR}/config/cli/config.h") -MESSAGE(STATUS "CLI config.h generated") - -INCLUDE_DIRECTORIES(BEFORE "${CMAKE_BINARY_DIR}/config/cli/") - -# ####################################### -# Add subdirectories -# ####################################### -ADD_SUBDIRECTORY(../common ./common) -ADD_SUBDIRECTORY(ADM_UIs ./ADM_UIsCli) -ADD_SUBDIRECTORY(ADM_userInterfaces ./ADM_userInterfacesCli) - -SDLify(../common/main.cpp) -if (ADM_SUBVERSION) - ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_SUBVERSION=\"${ADM_SUBVERSION}\"") -endif (ADM_SUBVERSION) -ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_VERSION=\"${AVIDEMUX_VERSION}\"") - -# ########################################## -# Version Info -# ########################################## -if (WIN32) - WINDRESIFY(mainCLI "${CMAKE_CURRENT_SOURCE_DIR}/../common/xpm/adm.ico" src "avidemux_cli" "Avidemux Video Editor, CLI Version") - SET(ADM_EXE_SRCS ${ADM_EXE_SRCS} ${src}) -endif (WIN32) - -# ########################################## -# Executable -# ########################################## -include_directories("${PTHREAD_INCLUDE_DIR}") -ADD_EXECUTABLE(avidemux3_cli ${ADM_EXE_SRCS}) - -# ########################################## -# Construct common libraries -# ########################################## -FOREACH (_libName ${commonLibs1}) - TARGET_LINK_LIBRARIES(avidemux3_cli ${_libName}) -ENDFOREACH (_libName ${commonLibs1}) - -TARGET_LINK_LIBRARIES(avidemux3_cli ADM_filtersCli6) - -FOREACH (_libName ${commonLibs2}) - TARGET_LINK_LIBRARIES(avidemux3_cli ${_libName}) -ENDFOREACH (_libName ${commonLibs2}) - -FOREACH (_libName ${coreLibs}) - TARGET_LINK_LIBRARIES(avidemux3_cli ${_libName}) -ENDFOREACH (_libName ${coreLibs}) - -# ############################################ -# Add gtk specific libs -# ############################################ -TARGET_LINK_LIBRARIES(avidemux3_cli - ADM_UI_Cli6 - ADM_dialogCli6 - ADM_toolkit6 - ADM_coreAudio6 - ADM_coreUtils6 - ADM_gui2Cli6 - ADM_toolkitCli6 - ADM_shellCli -) - -# ########################################## -# External libs -# ########################################## -# gettext -IF (GETTEXT_FOUND) - TARGET_LINK_LIBRARIES(avidemux3_cli ${GETTEXT_LIBRARY_DIR}) -ENDIF (GETTEXT_FOUND) - - -# SDL -IF (USE_SDL) - TARGET_LINK_LIBRARIES(avidemux3_cli ${SDL2_LIBRARY} ${SDL2_MAIN}) -ENDIF (USE_SDL) - -# ########################################## -# OS Specific -# ########################################## -if (WIN32 OR APPLE) - set_property(TARGET avidemux3_cli PROPERTY OUTPUT_NAME avidemux_cli) -endif (WIN32 OR APPLE) - -IF (MINGW) - target_link_libraries(avidemux3_cli winmm -mwindows -Wl,-subsystem,console -Wl,--export-all-symbols) -ENDIF (MINGW) - -# Needed by RubberBand -if (APPLE) - #target_link_libraries(avidemux3_cli "-framework Accelerate") - # Silence missing nullability specifier warnings on macOS - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-nullability-completeness") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nullability-completeness") -endif (APPLE) - -# ########################################## -# Install -# ########################################## -ADM_LINK_THREAD(avidemux3_cli) -ADM_INSTALL_BIN(avidemux3_cli) - -DISPLAY_SUMMARY_LIST() - -include(admPackager) -admPackager(cliPackage) -INSTALL(FILES ${CMAKE_BINARY_DIR}/config/cli/config.h DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_API_VERSION}/cli" COMPONENT dev) -INSTALL(FILES ${CMAKE_SOURCE_DIR}/ADM_UIs/include/ADM_UI_Cli6_export.h DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_API_VERSION}/cli/ADM_UIs" COMPONENT dev) -MESSAGE("") - +cmake_minimum_required(VERSION 3.7) + +PROJECT(Avidemux_CLI) + +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake" "${CMAKE_MODULE_PATH}") +include(avidemuxVersion) + +MESSAGE("") +MESSAGE("#########################################") +MESSAGE("Configure for avidemux Cli Started") +MESSAGE("#########################################") +MESSAGE("") + +MESSAGE(STATUS "Checking for avidemux development files ..") + +IF(NOT FAKEROOT) + SET(AVIDEMUX_FAKEROOT "") +else(NOT FAKEROOT) + SET(AVIDEMUX_FAKEROOT "${FAKEROOT}") +endif(NOT FAKEROOT) + +SET(ADM_HEADER_DIR ${AVIDEMUX_FAKEROOT}${CMAKE_INSTALL_PREFIX}/include/avidemux/${AVIDEMUX_API_VERSION}) +SET(ADM_CMAKE_DIR ${ADM_HEADER_DIR}/cmake) +# Common definitions... +SET(CMAKE_MODULE_PATH "${ADM_CMAKE_DIR}" "${CMAKE_MODULE_PATH}") +MESSAGE(STATUS "Checking for avidemux include folder (i.e. CMAKE_INSTALL_PREFIX/include/avidemux/${AVIDEMUX_API_VERSION}") +if(NOT EXISTS "${ADM_HEADER_DIR}") + MESSAGE(STATUS "Make sure you installed all the files.\n i cannot find avidemux include folder.cmake .\nSet CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") + MESSAGE(FATAL_ERROR "Aborting") +endif(NOT EXISTS "${ADM_HEADER_DIR}") + +MESSAGE(STATUS "Found avidemux include folder. good.") +MESSAGE(STATUS "Checking for cmake subfolder") + +if(NOT EXISTS "${ADM_CMAKE_DIR}/commonCmakeApplication.cmake") + MESSAGE(STATUS "Make sure you installed all the files.\n I cannot find content of the cmake subfolder .\n") + MESSAGE(STATUS "Set CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") + MESSAGE(STATUS "I was looking for commonCmakeApplication.cmake in ${ADM_CMAKE_DIR}") + MESSAGE(FATAL_ERROR "Aborting") +endif(NOT EXISTS "${ADM_CMAKE_DIR}/commonCmakeApplication.cmake") +MESSAGE(STATUS "Found cmake subfolder.good.") + + +include(commonCmakeApplication) +INCLUDE(admWindRes) + +# ######################################### +# Config +# ######################################### +ADD_DEFINITIONS(-DADM_UI_TYPE_BUILD=ADM_UI_CLI) +SET(CONFIG_HEADER_TYPE ADM_BUILD_CLI) +SET(UI_SUFFIX cli) + +CONFIGURE_FILE("${ADM_CMAKE_DIR}/config.h.cmake" "${CMAKE_BINARY_DIR}/config/cli/config.h") +MESSAGE(STATUS "CLI config.h generated") + +INCLUDE_DIRECTORIES(BEFORE "${CMAKE_BINARY_DIR}/config/cli/") + +# ####################################### +# Add subdirectories +# ####################################### +ADD_SUBDIRECTORY(../common ./common) +ADD_SUBDIRECTORY(ADM_UIs ./ADM_UIsCli) +ADD_SUBDIRECTORY(ADM_userInterfaces ./ADM_userInterfacesCli) + +SDLify(../common/main.cpp) +if (ADM_SUBVERSION) + ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_SUBVERSION=\"${ADM_SUBVERSION}\"") +endif (ADM_SUBVERSION) +ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_VERSION=\"${AVIDEMUX_VERSION}\"") + +# ########################################## +# Version Info +# ########################################## +if (WIN32) + WINDRESIFY(mainCLI "${CMAKE_CURRENT_SOURCE_DIR}/../common/xpm/adm.ico" src "avidemux_cli" "Avidemux Video Editor, CLI Version") + SET(ADM_EXE_SRCS ${ADM_EXE_SRCS} ${src}) +endif (WIN32) + +# ########################################## +# Executable +# ########################################## +include_directories("${PTHREAD_INCLUDE_DIR}") +ADD_EXECUTABLE(avidemux3_cli ${ADM_EXE_SRCS}) + +# ########################################## +# Construct common libraries +# ########################################## +FOREACH (_libName ${commonLibs1}) + TARGET_LINK_LIBRARIES(avidemux3_cli ${_libName}) +ENDFOREACH (_libName ${commonLibs1}) + +TARGET_LINK_LIBRARIES(avidemux3_cli ADM_filtersCli6) + +FOREACH (_libName ${commonLibs2}) + TARGET_LINK_LIBRARIES(avidemux3_cli ${_libName}) +ENDFOREACH (_libName ${commonLibs2}) + +FOREACH (_libName ${coreLibs}) + TARGET_LINK_LIBRARIES(avidemux3_cli ${_libName}) +ENDFOREACH (_libName ${coreLibs}) + +# ############################################ +# Add gtk specific libs +# ############################################ +TARGET_LINK_LIBRARIES(avidemux3_cli + ADM_UI_Cli6 + ADM_dialogCli6 + ADM_toolkit6 + ADM_coreAudio6 + ADM_coreUtils6 + ADM_gui2Cli6 + ADM_toolkitCli6 + ADM_shellCli +) + +# ########################################## +# External libs +# ########################################## +# gettext +IF (GETTEXT_FOUND) + TARGET_LINK_LIBRARIES(avidemux3_cli ${GETTEXT_LIBRARY_DIR}) +ENDIF (GETTEXT_FOUND) + + +# SDL +IF (USE_SDL) + TARGET_LINK_LIBRARIES(avidemux3_cli ${SDL2_LIBRARY} ${SDL2_MAIN}) +ENDIF (USE_SDL) + +# ########################################## +# OS Specific +# ########################################## +if (WIN32 OR APPLE) + set_property(TARGET avidemux3_cli PROPERTY OUTPUT_NAME avidemux_cli) +endif (WIN32 OR APPLE) + +IF (MINGW) + target_link_libraries(avidemux3_cli winmm -mwindows -Wl,-subsystem,console -Wl,--export-all-symbols) +ENDIF (MINGW) + +# Needed by RubberBand +if (APPLE) + #target_link_libraries(avidemux3_cli "-framework Accelerate") + # Silence missing nullability specifier warnings on macOS + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-nullability-completeness") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nullability-completeness") +endif (APPLE) + +# ########################################## +# Install +# ########################################## +ADM_LINK_THREAD(avidemux3_cli) +ADM_INSTALL_BIN(avidemux3_cli) + +DISPLAY_SUMMARY_LIST() + +include(admPackager) +admPackager(cliPackage) +INSTALL(FILES ${CMAKE_BINARY_DIR}/config/cli/config.h DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_API_VERSION}/cli" COMPONENT dev) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/ADM_UIs/include/ADM_UI_Cli6_export.h DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_API_VERSION}/cli/ADM_UIs" COMPONENT dev) +MESSAGE("") + diff --git a/avidemux/common/ADM_audioCodec/src/CMakeLists.txt b/avidemux/common/ADM_audioCodec/src/CMakeLists.txt index 1d0c5391e4..40328dc2df 100644 --- a/avidemux/common/ADM_audioCodec/src/CMakeLists.txt +++ b/avidemux/common/ADM_audioCodec/src/CMakeLists.txt @@ -1,10 +1,10 @@ -INCLUDE_DIRECTORIES(../include) -SET(ADM_audiocodec_SRCS -ADM_8bits.cpp -ADM_lpcm.cpp -ADM_audiocodec.cpp -ADM_codecpcm16.cpp -ADM_codecpcmfloat.cpp -ADM_pluginLoad.cpp) - -ADD_LIBRARY(ADM_audiocodec6 STATIC ${ADM_audiocodec_SRCS}) +INCLUDE_DIRECTORIES(../include) +SET(ADM_audiocodec_SRCS +ADM_8bits.cpp +ADM_lpcm.cpp +ADM_audiocodec.cpp +ADM_codecpcm16.cpp +ADM_codecpcmfloat.cpp +ADM_pluginLoad.cpp) + +ADD_LIBRARY(ADM_audiocodec6 STATIC ${ADM_audiocodec_SRCS}) diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/AAFilter.cpp b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/AAFilter.cpp index 3f29fe571c..f6790a45ba 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/AAFilter.cpp +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/AAFilter.cpp @@ -1,222 +1,222 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// FIR low-pass (anti-alias) filter with filter coefficient design routine and -/// MMX optimization. -/// -/// Anti-alias filter is used to prevent folding of high frequencies when -/// transposing the sample rate with interpolation. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#include -#include "ADM_default.h" -#include -#include -#include "AAFilter.h" -#include "FIRFilter.h" - -using namespace soundtouch; - -#define PI 3.14159265358979323846 -#define TWOPI (2 * PI) - -// define this to save AA filter coefficients to a file -// #define _DEBUG_SAVE_AAFILTER_COEFFICIENTS 1 - -#ifdef _DEBUG_SAVE_AAFILTER_COEFFICIENTS - #include - - static void _DEBUG_SAVE_AAFIR_COEFFS(SAMPLETYPE *coeffs, int len) - { - FILE *fptr = fopen("aa_filter_coeffs.txt", "wt"); - if (fptr == NULL) return; - - for (int i = 0; i < len; i ++) - { - double temp = coeffs[i]; - fprintf(fptr, "%lf\n", temp); - } - fclose(fptr); - } - -#else - #define _DEBUG_SAVE_AAFIR_COEFFS(x, y) -#endif - -/***************************************************************************** - * - * Implementation of the class 'AAFilter' - * - *****************************************************************************/ - -AAFilter::AAFilter(uint len) -{ - pFIR = FIRFilter::newInstance(); - cutoffFreq = 0.5; - setLength(len); -} - - -AAFilter::~AAFilter() -{ - delete pFIR; -} - - -// Sets new anti-alias filter cut-off edge frequency, scaled to -// sampling frequency (nyquist frequency = 0.5). -// The filter will cut frequencies higher than the given frequency. -void AAFilter::setCutoffFreq(double newCutoffFreq) -{ - cutoffFreq = newCutoffFreq; - calculateCoeffs(); -} - - -// Sets number of FIR filter taps -void AAFilter::setLength(uint newLength) -{ - length = newLength; - calculateCoeffs(); -} - - -// Calculates coefficients for a low-pass FIR filter using Hamming window -void AAFilter::calculateCoeffs() -{ - uint i; - double cntTemp, temp, tempCoeff,h, w; - double wc; - double scaleCoeff, sum; - double *work; - SAMPLETYPE *coeffs; - - ADM_assert(length >= 2); - ADM_assert(length % 4 == 0); - ADM_assert(cutoffFreq >= 0); - ADM_assert(cutoffFreq <= 0.5); - - work = new double[length]; - coeffs = new SAMPLETYPE[length]; - - wc = 2.0 * PI * cutoffFreq; - tempCoeff = TWOPI / (double)length; - - sum = 0; - for (i = 0; i < length; i ++) - { - cntTemp = (double)i - (double)(length / 2); - - temp = cntTemp * wc; - if (temp != 0) - { - h = sin(temp) / temp; // sinc function - } - else - { - h = 1.0; - } - w = 0.54 + 0.46 * cos(tempCoeff * cntTemp); // hamming window - - temp = w * h; - work[i] = temp; - - // calc net sum of coefficients - sum += temp; - } - - // ensure the sum of coefficients is larger than zero - ADM_assert(sum > 0); - - // ensure we've really designed a lowpass filter... - ADM_assert(work[length/2] > 0); - ADM_assert(work[length/2 + 1] > -1e-6); - ADM_assert(work[length/2 - 1] > -1e-6); - - // Calculate a scaling coefficient in such a way that the result can be - // divided by 16384 - scaleCoeff = 16384.0f / sum; - - for (i = 0; i < length; i ++) - { - temp = work[i] * scaleCoeff; - // scale & round to nearest integer - temp += (temp >= 0) ? 0.5 : -0.5; - // ensure no overfloods - ADM_assert(temp >= -32768 && temp <= 32767); - coeffs[i] = (SAMPLETYPE)temp; - } - - // Set coefficients. Use divide factor 14 => divide result by 2^14 = 16384 - pFIR->setCoefficients(coeffs, length, 14); - - _DEBUG_SAVE_AAFIR_COEFFS(coeffs, length); - - delete[] work; - delete[] coeffs; -} - - -// Applies the filter to the given sequence of samples. -// Note : The amount of outputted samples is by value of 'filter length' -// smaller than the amount of input samples. -uint AAFilter::evaluate(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels) const -{ - return pFIR->evaluate(dest, src, numSamples, numChannels); -} - - -/// Applies the filter to the given src & dest pipes, so that processed amount of -/// samples get removed from src, and produced amount added to dest -/// Note : The amount of outputted samples is by value of 'filter length' -/// smaller than the amount of input samples. -uint AAFilter::evaluate(FIFOSampleBuffer &dest, FIFOSampleBuffer &src) const -{ - SAMPLETYPE *pdest; - const SAMPLETYPE *psrc; - uint numSrcSamples; - uint result; - int numChannels = src.getChannels(); - - ADM_assert(numChannels == dest.getChannels()); - - numSrcSamples = src.numSamples(); - psrc = src.ptrBegin(); - pdest = dest.ptrEnd(numSrcSamples); - result = pFIR->evaluate(pdest, psrc, numSrcSamples, numChannels); - src.receiveSamples(result); - dest.putSamples(result); - - return result; -} - - -uint AAFilter::getLength() const -{ - return pFIR->getLength(); -} +//////////////////////////////////////////////////////////////////////////////// +/// +/// FIR low-pass (anti-alias) filter with filter coefficient design routine and +/// MMX optimization. +/// +/// Anti-alias filter is used to prevent folding of high frequencies when +/// transposing the sample rate with interpolation. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include "ADM_default.h" +#include +#include +#include "AAFilter.h" +#include "FIRFilter.h" + +using namespace soundtouch; + +#define PI 3.14159265358979323846 +#define TWOPI (2 * PI) + +// define this to save AA filter coefficients to a file +// #define _DEBUG_SAVE_AAFILTER_COEFFICIENTS 1 + +#ifdef _DEBUG_SAVE_AAFILTER_COEFFICIENTS + #include + + static void _DEBUG_SAVE_AAFIR_COEFFS(SAMPLETYPE *coeffs, int len) + { + FILE *fptr = fopen("aa_filter_coeffs.txt", "wt"); + if (fptr == NULL) return; + + for (int i = 0; i < len; i ++) + { + double temp = coeffs[i]; + fprintf(fptr, "%lf\n", temp); + } + fclose(fptr); + } + +#else + #define _DEBUG_SAVE_AAFIR_COEFFS(x, y) +#endif + +/***************************************************************************** + * + * Implementation of the class 'AAFilter' + * + *****************************************************************************/ + +AAFilter::AAFilter(uint len) +{ + pFIR = FIRFilter::newInstance(); + cutoffFreq = 0.5; + setLength(len); +} + + +AAFilter::~AAFilter() +{ + delete pFIR; +} + + +// Sets new anti-alias filter cut-off edge frequency, scaled to +// sampling frequency (nyquist frequency = 0.5). +// The filter will cut frequencies higher than the given frequency. +void AAFilter::setCutoffFreq(double newCutoffFreq) +{ + cutoffFreq = newCutoffFreq; + calculateCoeffs(); +} + + +// Sets number of FIR filter taps +void AAFilter::setLength(uint newLength) +{ + length = newLength; + calculateCoeffs(); +} + + +// Calculates coefficients for a low-pass FIR filter using Hamming window +void AAFilter::calculateCoeffs() +{ + uint i; + double cntTemp, temp, tempCoeff,h, w; + double wc; + double scaleCoeff, sum; + double *work; + SAMPLETYPE *coeffs; + + ADM_assert(length >= 2); + ADM_assert(length % 4 == 0); + ADM_assert(cutoffFreq >= 0); + ADM_assert(cutoffFreq <= 0.5); + + work = new double[length]; + coeffs = new SAMPLETYPE[length]; + + wc = 2.0 * PI * cutoffFreq; + tempCoeff = TWOPI / (double)length; + + sum = 0; + for (i = 0; i < length; i ++) + { + cntTemp = (double)i - (double)(length / 2); + + temp = cntTemp * wc; + if (temp != 0) + { + h = sin(temp) / temp; // sinc function + } + else + { + h = 1.0; + } + w = 0.54 + 0.46 * cos(tempCoeff * cntTemp); // hamming window + + temp = w * h; + work[i] = temp; + + // calc net sum of coefficients + sum += temp; + } + + // ensure the sum of coefficients is larger than zero + ADM_assert(sum > 0); + + // ensure we've really designed a lowpass filter... + ADM_assert(work[length/2] > 0); + ADM_assert(work[length/2 + 1] > -1e-6); + ADM_assert(work[length/2 - 1] > -1e-6); + + // Calculate a scaling coefficient in such a way that the result can be + // divided by 16384 + scaleCoeff = 16384.0f / sum; + + for (i = 0; i < length; i ++) + { + temp = work[i] * scaleCoeff; + // scale & round to nearest integer + temp += (temp >= 0) ? 0.5 : -0.5; + // ensure no overfloods + ADM_assert(temp >= -32768 && temp <= 32767); + coeffs[i] = (SAMPLETYPE)temp; + } + + // Set coefficients. Use divide factor 14 => divide result by 2^14 = 16384 + pFIR->setCoefficients(coeffs, length, 14); + + _DEBUG_SAVE_AAFIR_COEFFS(coeffs, length); + + delete[] work; + delete[] coeffs; +} + + +// Applies the filter to the given sequence of samples. +// Note : The amount of outputted samples is by value of 'filter length' +// smaller than the amount of input samples. +uint AAFilter::evaluate(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels) const +{ + return pFIR->evaluate(dest, src, numSamples, numChannels); +} + + +/// Applies the filter to the given src & dest pipes, so that processed amount of +/// samples get removed from src, and produced amount added to dest +/// Note : The amount of outputted samples is by value of 'filter length' +/// smaller than the amount of input samples. +uint AAFilter::evaluate(FIFOSampleBuffer &dest, FIFOSampleBuffer &src) const +{ + SAMPLETYPE *pdest; + const SAMPLETYPE *psrc; + uint numSrcSamples; + uint result; + int numChannels = src.getChannels(); + + ADM_assert(numChannels == dest.getChannels()); + + numSrcSamples = src.numSamples(); + psrc = src.ptrBegin(); + pdest = dest.ptrEnd(numSrcSamples); + result = pFIR->evaluate(pdest, psrc, numSrcSamples, numChannels); + src.receiveSamples(result); + dest.putSamples(result); + + return result; +} + + +uint AAFilter::getLength() const +{ + return pFIR->getLength(); +} diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/AAFilter.h b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/AAFilter.h index 8e5697f796..81d836b750 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/AAFilter.h +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/AAFilter.h @@ -1,93 +1,93 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// Sampled sound tempo changer/time stretch algorithm. Changes the sound tempo -/// while maintaining the original pitch by using a time domain WSOLA-like method -/// with several performance-increasing tweaks. -/// -/// Anti-alias filter is used to prevent folding of high frequencies when -/// transposing the sample rate with interpolation. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef AAFilter_H -#define AAFilter_H - -#include "STTypes.h" -#include "FIFOSampleBuffer.h" - -namespace soundtouch -{ - -class AAFilter -{ -protected: - class FIRFilter *pFIR; - - /// Low-pass filter cut-off frequency, negative = invalid - double cutoffFreq; - - /// num of filter taps - uint length; - - /// Calculate the FIR coefficients realizing the given cutoff-frequency - void calculateCoeffs(); -public: - AAFilter(uint length); - - ~AAFilter(); - - /// Sets new anti-alias filter cut-off edge frequency, scaled to sampling - /// frequency (nyquist frequency = 0.5). The filter will cut off the - /// frequencies than that. - void setCutoffFreq(double newCutoffFreq); - - /// Sets number of FIR filter taps, i.e. ~filter complexity - void setLength(uint newLength); - - uint getLength() const; - - /// Applies the filter to the given sequence of samples. - /// Note : The amount of outputted samples is by value of 'filter length' - /// smaller than the amount of input samples. - uint evaluate(SAMPLETYPE *dest, - const SAMPLETYPE *src, - uint numSamples, - uint numChannels) const; - - /// Applies the filter to the given src & dest pipes, so that processed amount of - /// samples get removed from src, and produced amount added to dest - /// Note : The amount of outputted samples is by value of 'filter length' - /// smaller than the amount of input samples. - uint evaluate(FIFOSampleBuffer &dest, - FIFOSampleBuffer &src) const; - -}; - -} - -#endif +//////////////////////////////////////////////////////////////////////////////// +/// +/// Sampled sound tempo changer/time stretch algorithm. Changes the sound tempo +/// while maintaining the original pitch by using a time domain WSOLA-like method +/// with several performance-increasing tweaks. +/// +/// Anti-alias filter is used to prevent folding of high frequencies when +/// transposing the sample rate with interpolation. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef AAFilter_H +#define AAFilter_H + +#include "STTypes.h" +#include "FIFOSampleBuffer.h" + +namespace soundtouch +{ + +class AAFilter +{ +protected: + class FIRFilter *pFIR; + + /// Low-pass filter cut-off frequency, negative = invalid + double cutoffFreq; + + /// num of filter taps + uint length; + + /// Calculate the FIR coefficients realizing the given cutoff-frequency + void calculateCoeffs(); +public: + AAFilter(uint length); + + ~AAFilter(); + + /// Sets new anti-alias filter cut-off edge frequency, scaled to sampling + /// frequency (nyquist frequency = 0.5). The filter will cut off the + /// frequencies than that. + void setCutoffFreq(double newCutoffFreq); + + /// Sets number of FIR filter taps, i.e. ~filter complexity + void setLength(uint newLength); + + uint getLength() const; + + /// Applies the filter to the given sequence of samples. + /// Note : The amount of outputted samples is by value of 'filter length' + /// smaller than the amount of input samples. + uint evaluate(SAMPLETYPE *dest, + const SAMPLETYPE *src, + uint numSamples, + uint numChannels) const; + + /// Applies the filter to the given src & dest pipes, so that processed amount of + /// samples get removed from src, and produced amount added to dest + /// Note : The amount of outputted samples is by value of 'filter length' + /// smaller than the amount of input samples. + uint evaluate(FIFOSampleBuffer &dest, + FIFOSampleBuffer &src) const; + +}; + +} + +#endif diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIFOSampleBuffer.cpp b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIFOSampleBuffer.cpp index 84ab7dd513..b13c9cbefe 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIFOSampleBuffer.cpp +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIFOSampleBuffer.cpp @@ -1,275 +1,275 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// A buffer class for temporarily storaging sound samples, operates as a -/// first-in-first-out pipe. -/// -/// Samples are added to the end of the sample buffer with the 'putSamples' -/// function, and are received from the beginning of the buffer by calling -/// the 'receiveSamples' function. The class automatically removes the -/// outputted samples from the buffer, as well as grows the buffer size -/// whenever necessary. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include -#include "ADM_default.h" - -#include "FIFOSampleBuffer.h" - -using namespace soundtouch; - -// Constructor -FIFOSampleBuffer::FIFOSampleBuffer(int numChannels) -{ - ADM_assert(numChannels > 0); - sizeInBytes = 0; // reasonable initial value - buffer = NULL; - bufferUnaligned = NULL; - samplesInBuffer = 0; - bufferPos = 0; - channels = (uint)numChannels; - ensureCapacity(32); // allocate initial capacity -} - - -// destructor -FIFOSampleBuffer::~FIFOSampleBuffer() -{ - delete[] bufferUnaligned; - bufferUnaligned = NULL; - buffer = NULL; -} - - -// Sets number of channels, 1 = mono, 2 = stereo -void FIFOSampleBuffer::setChannels(int numChannels) -{ - uint usedBytes; - - if (!verifyNumberOfChannels(numChannels)) return; - - usedBytes = channels * samplesInBuffer; - channels = (uint)numChannels; - samplesInBuffer = usedBytes / channels; -} - - -// if output location pointer 'bufferPos' isn't zero, 'rewinds' the buffer and -// zeroes this pointer by copying samples from the 'bufferPos' pointer -// location on to the beginning of the buffer. -void FIFOSampleBuffer::rewind() -{ - if (buffer && bufferPos) - { - memmove(buffer, ptrBegin(), sizeof(SAMPLETYPE) * channels * samplesInBuffer); - bufferPos = 0; - } -} - - -// Adds 'numSamples' pcs of samples from the 'samples' memory position to -// the sample buffer. -void FIFOSampleBuffer::putSamples(const SAMPLETYPE *samples, uint nSamples) -{ - memcpy(ptrEnd(nSamples), samples, sizeof(SAMPLETYPE) * nSamples * channels); - samplesInBuffer += nSamples; -} - - -// Increases the number of samples in the buffer without copying any actual -// samples. -// -// This function is used to update the number of samples in the sample buffer -// when accessing the buffer directly with 'ptrEnd' function. Please be -// careful though! -void FIFOSampleBuffer::putSamples(uint nSamples) -{ - uint req; - - req = samplesInBuffer + nSamples; - ensureCapacity(req); - samplesInBuffer += nSamples; -} - - -// Returns a pointer to the end of the used part of the sample buffer (i.e. -// where the new samples are to be inserted). This function may be used for -// inserting new samples into the sample buffer directly. Please be careful! -// -// Parameter 'slackCapacity' tells the function how much free capacity (in -// terms of samples) there _at least_ should be, in order to the caller to -// successfully insert all the required samples to the buffer. When necessary, -// the function grows the buffer size to comply with this requirement. -// -// When using this function as means for inserting new samples, also remember -// to increase the sample count afterwards, by calling the -// 'putSamples(numSamples)' function. -SAMPLETYPE *FIFOSampleBuffer::ptrEnd(uint slackCapacity) -{ - ensureCapacity(samplesInBuffer + slackCapacity); - return buffer + samplesInBuffer * channels; -} - - -// Returns a pointer to the beginning of the currently non-outputted samples. -// This function is provided for accessing the output samples directly. -// Please be careful! -// -// When using this function to output samples, also remember to 'remove' the -// outputted samples from the buffer by calling the -// 'receiveSamples(numSamples)' function -SAMPLETYPE *FIFOSampleBuffer::ptrBegin() -{ - ADM_assert(buffer); - return buffer + bufferPos * channels; -} - - -// Ensures that the buffer has enough capacity, i.e. space for _at least_ -// 'capacityRequirement' number of samples. The buffer is grown in steps of -// 4 kilobytes to eliminate the need for frequently growing up the buffer, -// as well as to round the buffer size up to the virtual memory page size. -void FIFOSampleBuffer::ensureCapacity(uint capacityRequirement) -{ - SAMPLETYPE *tempUnaligned, *temp; - - if (capacityRequirement > getCapacity()) - { - // enlarge the buffer in 4kbyte steps (round up to next 4k boundary) - sizeInBytes = (capacityRequirement * channels * sizeof(SAMPLETYPE) + 4095) & (uint)-4096; - ADM_assert(sizeInBytes % 2 == 0); - tempUnaligned = new SAMPLETYPE[sizeInBytes / sizeof(SAMPLETYPE) + 16 / sizeof(SAMPLETYPE)]; - if (tempUnaligned == NULL) - { - ST_THROW_RT_ERROR("Couldn't allocate memory!\n"); - } - // Align the buffer to begin at 16byte cache line boundary for optimal performance - temp = (SAMPLETYPE *)SOUNDTOUCH_ALIGN_POINTER_16(tempUnaligned); - if (samplesInBuffer) - { - memcpy(temp, ptrBegin(), samplesInBuffer * channels * sizeof(SAMPLETYPE)); - } - delete[] bufferUnaligned; - buffer = temp; - bufferUnaligned = tempUnaligned; - bufferPos = 0; - } - else - { - // simply rewind the buffer (if necessary) - rewind(); - } -} - - -// Returns the current buffer capacity in terms of samples -uint FIFOSampleBuffer::getCapacity() const -{ - return sizeInBytes / (channels * sizeof(SAMPLETYPE)); -} - - -// Returns the number of samples currently in the buffer -uint FIFOSampleBuffer::numSamples() const -{ - return samplesInBuffer; -} - - -// Output samples from beginning of the sample buffer. Copies demanded number -// of samples to output and removes them from the sample buffer. If there -// are less than 'numsample' samples in the buffer, returns all available. -// -// Returns number of samples copied. -uint FIFOSampleBuffer::receiveSamples(SAMPLETYPE *output, uint maxSamples) -{ - uint num; - - num = (maxSamples > samplesInBuffer) ? samplesInBuffer : maxSamples; - - memcpy(output, ptrBegin(), channels * sizeof(SAMPLETYPE) * num); - return receiveSamples(num); -} - - -// Removes samples from the beginning of the sample buffer without copying them -// anywhere. Used to reduce the number of samples in the buffer, when accessing -// the sample buffer with the 'ptrBegin' function. -uint FIFOSampleBuffer::receiveSamples(uint maxSamples) -{ - if (maxSamples >= samplesInBuffer) - { - uint temp; - - temp = samplesInBuffer; - samplesInBuffer = 0; - return temp; - } - - samplesInBuffer -= maxSamples; - bufferPos += maxSamples; - - return maxSamples; -} - - -// Returns nonzero if the sample buffer is empty -int FIFOSampleBuffer::isEmpty() const -{ - return (samplesInBuffer == 0) ? 1 : 0; -} - - -// Clears the sample buffer -void FIFOSampleBuffer::clear() -{ - samplesInBuffer = 0; - bufferPos = 0; -} - - -/// allow trimming (downwards) amount of samples in pipeline. -/// Returns adjusted amount of samples -uint FIFOSampleBuffer::adjustAmountOfSamples(uint numSamples) -{ - if (numSamples < samplesInBuffer) - { - samplesInBuffer = numSamples; - } - return samplesInBuffer; -} - - -/// Add silence to end of buffer -void FIFOSampleBuffer::addSilent(uint nSamples) -{ - memset(ptrEnd(nSamples), 0, sizeof(SAMPLETYPE) * nSamples * channels); - samplesInBuffer += nSamples; -} +//////////////////////////////////////////////////////////////////////////////// +/// +/// A buffer class for temporarily storaging sound samples, operates as a +/// first-in-first-out pipe. +/// +/// Samples are added to the end of the sample buffer with the 'putSamples' +/// function, and are received from the beginning of the buffer by calling +/// the 'receiveSamples' function. The class automatically removes the +/// outputted samples from the buffer, as well as grows the buffer size +/// whenever necessary. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include "ADM_default.h" + +#include "FIFOSampleBuffer.h" + +using namespace soundtouch; + +// Constructor +FIFOSampleBuffer::FIFOSampleBuffer(int numChannels) +{ + ADM_assert(numChannels > 0); + sizeInBytes = 0; // reasonable initial value + buffer = NULL; + bufferUnaligned = NULL; + samplesInBuffer = 0; + bufferPos = 0; + channels = (uint)numChannels; + ensureCapacity(32); // allocate initial capacity +} + + +// destructor +FIFOSampleBuffer::~FIFOSampleBuffer() +{ + delete[] bufferUnaligned; + bufferUnaligned = NULL; + buffer = NULL; +} + + +// Sets number of channels, 1 = mono, 2 = stereo +void FIFOSampleBuffer::setChannels(int numChannels) +{ + uint usedBytes; + + if (!verifyNumberOfChannels(numChannels)) return; + + usedBytes = channels * samplesInBuffer; + channels = (uint)numChannels; + samplesInBuffer = usedBytes / channels; +} + + +// if output location pointer 'bufferPos' isn't zero, 'rewinds' the buffer and +// zeroes this pointer by copying samples from the 'bufferPos' pointer +// location on to the beginning of the buffer. +void FIFOSampleBuffer::rewind() +{ + if (buffer && bufferPos) + { + memmove(buffer, ptrBegin(), sizeof(SAMPLETYPE) * channels * samplesInBuffer); + bufferPos = 0; + } +} + + +// Adds 'numSamples' pcs of samples from the 'samples' memory position to +// the sample buffer. +void FIFOSampleBuffer::putSamples(const SAMPLETYPE *samples, uint nSamples) +{ + memcpy(ptrEnd(nSamples), samples, sizeof(SAMPLETYPE) * nSamples * channels); + samplesInBuffer += nSamples; +} + + +// Increases the number of samples in the buffer without copying any actual +// samples. +// +// This function is used to update the number of samples in the sample buffer +// when accessing the buffer directly with 'ptrEnd' function. Please be +// careful though! +void FIFOSampleBuffer::putSamples(uint nSamples) +{ + uint req; + + req = samplesInBuffer + nSamples; + ensureCapacity(req); + samplesInBuffer += nSamples; +} + + +// Returns a pointer to the end of the used part of the sample buffer (i.e. +// where the new samples are to be inserted). This function may be used for +// inserting new samples into the sample buffer directly. Please be careful! +// +// Parameter 'slackCapacity' tells the function how much free capacity (in +// terms of samples) there _at least_ should be, in order to the caller to +// successfully insert all the required samples to the buffer. When necessary, +// the function grows the buffer size to comply with this requirement. +// +// When using this function as means for inserting new samples, also remember +// to increase the sample count afterwards, by calling the +// 'putSamples(numSamples)' function. +SAMPLETYPE *FIFOSampleBuffer::ptrEnd(uint slackCapacity) +{ + ensureCapacity(samplesInBuffer + slackCapacity); + return buffer + samplesInBuffer * channels; +} + + +// Returns a pointer to the beginning of the currently non-outputted samples. +// This function is provided for accessing the output samples directly. +// Please be careful! +// +// When using this function to output samples, also remember to 'remove' the +// outputted samples from the buffer by calling the +// 'receiveSamples(numSamples)' function +SAMPLETYPE *FIFOSampleBuffer::ptrBegin() +{ + ADM_assert(buffer); + return buffer + bufferPos * channels; +} + + +// Ensures that the buffer has enough capacity, i.e. space for _at least_ +// 'capacityRequirement' number of samples. The buffer is grown in steps of +// 4 kilobytes to eliminate the need for frequently growing up the buffer, +// as well as to round the buffer size up to the virtual memory page size. +void FIFOSampleBuffer::ensureCapacity(uint capacityRequirement) +{ + SAMPLETYPE *tempUnaligned, *temp; + + if (capacityRequirement > getCapacity()) + { + // enlarge the buffer in 4kbyte steps (round up to next 4k boundary) + sizeInBytes = (capacityRequirement * channels * sizeof(SAMPLETYPE) + 4095) & (uint)-4096; + ADM_assert(sizeInBytes % 2 == 0); + tempUnaligned = new SAMPLETYPE[sizeInBytes / sizeof(SAMPLETYPE) + 16 / sizeof(SAMPLETYPE)]; + if (tempUnaligned == NULL) + { + ST_THROW_RT_ERROR("Couldn't allocate memory!\n"); + } + // Align the buffer to begin at 16byte cache line boundary for optimal performance + temp = (SAMPLETYPE *)SOUNDTOUCH_ALIGN_POINTER_16(tempUnaligned); + if (samplesInBuffer) + { + memcpy(temp, ptrBegin(), samplesInBuffer * channels * sizeof(SAMPLETYPE)); + } + delete[] bufferUnaligned; + buffer = temp; + bufferUnaligned = tempUnaligned; + bufferPos = 0; + } + else + { + // simply rewind the buffer (if necessary) + rewind(); + } +} + + +// Returns the current buffer capacity in terms of samples +uint FIFOSampleBuffer::getCapacity() const +{ + return sizeInBytes / (channels * sizeof(SAMPLETYPE)); +} + + +// Returns the number of samples currently in the buffer +uint FIFOSampleBuffer::numSamples() const +{ + return samplesInBuffer; +} + + +// Output samples from beginning of the sample buffer. Copies demanded number +// of samples to output and removes them from the sample buffer. If there +// are less than 'numsample' samples in the buffer, returns all available. +// +// Returns number of samples copied. +uint FIFOSampleBuffer::receiveSamples(SAMPLETYPE *output, uint maxSamples) +{ + uint num; + + num = (maxSamples > samplesInBuffer) ? samplesInBuffer : maxSamples; + + memcpy(output, ptrBegin(), channels * sizeof(SAMPLETYPE) * num); + return receiveSamples(num); +} + + +// Removes samples from the beginning of the sample buffer without copying them +// anywhere. Used to reduce the number of samples in the buffer, when accessing +// the sample buffer with the 'ptrBegin' function. +uint FIFOSampleBuffer::receiveSamples(uint maxSamples) +{ + if (maxSamples >= samplesInBuffer) + { + uint temp; + + temp = samplesInBuffer; + samplesInBuffer = 0; + return temp; + } + + samplesInBuffer -= maxSamples; + bufferPos += maxSamples; + + return maxSamples; +} + + +// Returns nonzero if the sample buffer is empty +int FIFOSampleBuffer::isEmpty() const +{ + return (samplesInBuffer == 0) ? 1 : 0; +} + + +// Clears the sample buffer +void FIFOSampleBuffer::clear() +{ + samplesInBuffer = 0; + bufferPos = 0; +} + + +/// allow trimming (downwards) amount of samples in pipeline. +/// Returns adjusted amount of samples +uint FIFOSampleBuffer::adjustAmountOfSamples(uint numSamples) +{ + if (numSamples < samplesInBuffer) + { + samplesInBuffer = numSamples; + } + return samplesInBuffer; +} + + +/// Add silence to end of buffer +void FIFOSampleBuffer::addSilent(uint nSamples) +{ + memset(ptrEnd(nSamples), 0, sizeof(SAMPLETYPE) * nSamples * channels); + samplesInBuffer += nSamples; +} diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIFOSampleBuffer.h b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIFOSampleBuffer.h index 6c5785a6e2..890570a99a 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIFOSampleBuffer.h +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIFOSampleBuffer.h @@ -1,180 +1,180 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// A buffer class for temporarily storaging sound samples, operates as a -/// first-in-first-out pipe. -/// -/// Samples are added to the end of the sample buffer with the 'putSamples' -/// function, and are received from the beginning of the buffer by calling -/// the 'receiveSamples' function. The class automatically removes the -/// output samples from the buffer as well as grows the storage size -/// whenever necessary. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef FIFOSampleBuffer_H -#define FIFOSampleBuffer_H - -#include "FIFOSamplePipe.h" - -namespace soundtouch -{ - -/// Sample buffer working in FIFO (first-in-first-out) principle. The class takes -/// care of storage size adjustment and data moving during input/output operations. -/// -/// Notice that in case of stereo audio, one sample is considered to consist of -/// both channel data. -class FIFOSampleBuffer : public FIFOSamplePipe -{ -private: - /// Sample buffer. - SAMPLETYPE *buffer; - - // Raw unaligned buffer memory. 'buffer' is made aligned by pointing it to first - // 16-byte aligned location of this buffer - SAMPLETYPE *bufferUnaligned; - - /// Sample buffer size in bytes - uint sizeInBytes; - - /// How many samples are currently in buffer. - uint samplesInBuffer; - - /// Channels, 1=mono, 2=stereo. - uint channels; - - /// Current position pointer to the buffer. This pointer is increased when samples are - /// removed from the pipe so that it's necessary to actually rewind buffer (move data) - /// only new data when is put to the pipe. - uint bufferPos; - - /// Rewind the buffer by moving data from position pointed by 'bufferPos' to real - /// beginning of the buffer. - void rewind(); - - /// Ensures that the buffer has capacity for at least this many samples. - void ensureCapacity(uint capacityRequirement); - - /// Returns current capacity. - uint getCapacity() const; - -public: - - /// Constructor - FIFOSampleBuffer(int numChannels = 2 ///< Number of channels, 1=mono, 2=stereo. - ///< Default is stereo. - ); - - /// destructor - ~FIFOSampleBuffer() override; - - /// Returns a pointer to the beginning of the output samples. - /// This function is provided for accessing the output samples directly. - /// Please be careful for not to corrupt the book-keeping! - /// - /// When using this function to output samples, also remember to 'remove' the - /// output samples from the buffer by calling the - /// 'receiveSamples(numSamples)' function - virtual SAMPLETYPE *ptrBegin() override; - - /// Returns a pointer to the end of the used part of the sample buffer (i.e. - /// where the new samples are to be inserted). This function may be used for - /// inserting new samples into the sample buffer directly. Please be careful - /// not corrupt the book-keeping! - /// - /// When using this function as means for inserting new samples, also remember - /// to increase the sample count afterwards, by calling the - /// 'putSamples(numSamples)' function. - SAMPLETYPE *ptrEnd( - uint slackCapacity ///< How much free capacity (in samples) there _at least_ - ///< should be so that the caller can successfully insert the - ///< desired samples to the buffer. If necessary, the function - ///< grows the buffer size to comply with this requirement. - ); - - /// Adds 'numSamples' pcs of samples from the 'samples' memory position to - /// the sample buffer. - virtual void putSamples(const SAMPLETYPE *samples, ///< Pointer to samples. - uint numSamples ///< Number of samples to insert. - ) override; - - /// Adjusts the book-keeping to increase number of samples in the buffer without - /// copying any actual samples. - /// - /// This function is used to update the number of samples in the sample buffer - /// when accessing the buffer directly with 'ptrEnd' function. Please be - /// careful though! - virtual void putSamples(uint numSamples ///< Number of samples been inserted. - ); - - /// Output samples from beginning of the sample buffer. Copies requested samples to - /// output buffer and removes them from the sample buffer. If there are less than - /// 'numsample' samples in the buffer, returns all that available. - /// - /// \return Number of samples returned. - virtual uint receiveSamples(SAMPLETYPE *output, ///< Buffer where to copy output samples. - uint maxSamples ///< How many samples to receive at max. - ) override; - - /// Adjusts book-keeping so that given number of samples are removed from beginning of the - /// sample buffer without copying them anywhere. - /// - /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly - /// with 'ptrBegin' function. - virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. - ) override; - - /// Returns number of samples currently available. - virtual uint numSamples() const override; - - /// Sets number of channels, 1 = mono, 2 = stereo. - void setChannels(int numChannels); - - /// Get number of channels - int getChannels() - { - return channels; - } - - /// Returns nonzero if there aren't any samples available for outputting. - virtual int isEmpty() const override; - - /// Clears all the samples. - virtual void clear() override; - - /// allow trimming (downwards) amount of samples in pipeline. - /// Returns adjusted amount of samples - uint adjustAmountOfSamples(uint numSamples) override; - - /// Add silence to end of buffer - void addSilent(uint nSamples); -}; - -} - -#endif +//////////////////////////////////////////////////////////////////////////////// +/// +/// A buffer class for temporarily storaging sound samples, operates as a +/// first-in-first-out pipe. +/// +/// Samples are added to the end of the sample buffer with the 'putSamples' +/// function, and are received from the beginning of the buffer by calling +/// the 'receiveSamples' function. The class automatically removes the +/// output samples from the buffer as well as grows the storage size +/// whenever necessary. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef FIFOSampleBuffer_H +#define FIFOSampleBuffer_H + +#include "FIFOSamplePipe.h" + +namespace soundtouch +{ + +/// Sample buffer working in FIFO (first-in-first-out) principle. The class takes +/// care of storage size adjustment and data moving during input/output operations. +/// +/// Notice that in case of stereo audio, one sample is considered to consist of +/// both channel data. +class FIFOSampleBuffer : public FIFOSamplePipe +{ +private: + /// Sample buffer. + SAMPLETYPE *buffer; + + // Raw unaligned buffer memory. 'buffer' is made aligned by pointing it to first + // 16-byte aligned location of this buffer + SAMPLETYPE *bufferUnaligned; + + /// Sample buffer size in bytes + uint sizeInBytes; + + /// How many samples are currently in buffer. + uint samplesInBuffer; + + /// Channels, 1=mono, 2=stereo. + uint channels; + + /// Current position pointer to the buffer. This pointer is increased when samples are + /// removed from the pipe so that it's necessary to actually rewind buffer (move data) + /// only new data when is put to the pipe. + uint bufferPos; + + /// Rewind the buffer by moving data from position pointed by 'bufferPos' to real + /// beginning of the buffer. + void rewind(); + + /// Ensures that the buffer has capacity for at least this many samples. + void ensureCapacity(uint capacityRequirement); + + /// Returns current capacity. + uint getCapacity() const; + +public: + + /// Constructor + FIFOSampleBuffer(int numChannels = 2 ///< Number of channels, 1=mono, 2=stereo. + ///< Default is stereo. + ); + + /// destructor + ~FIFOSampleBuffer() override; + + /// Returns a pointer to the beginning of the output samples. + /// This function is provided for accessing the output samples directly. + /// Please be careful for not to corrupt the book-keeping! + /// + /// When using this function to output samples, also remember to 'remove' the + /// output samples from the buffer by calling the + /// 'receiveSamples(numSamples)' function + virtual SAMPLETYPE *ptrBegin() override; + + /// Returns a pointer to the end of the used part of the sample buffer (i.e. + /// where the new samples are to be inserted). This function may be used for + /// inserting new samples into the sample buffer directly. Please be careful + /// not corrupt the book-keeping! + /// + /// When using this function as means for inserting new samples, also remember + /// to increase the sample count afterwards, by calling the + /// 'putSamples(numSamples)' function. + SAMPLETYPE *ptrEnd( + uint slackCapacity ///< How much free capacity (in samples) there _at least_ + ///< should be so that the caller can successfully insert the + ///< desired samples to the buffer. If necessary, the function + ///< grows the buffer size to comply with this requirement. + ); + + /// Adds 'numSamples' pcs of samples from the 'samples' memory position to + /// the sample buffer. + virtual void putSamples(const SAMPLETYPE *samples, ///< Pointer to samples. + uint numSamples ///< Number of samples to insert. + ) override; + + /// Adjusts the book-keeping to increase number of samples in the buffer without + /// copying any actual samples. + /// + /// This function is used to update the number of samples in the sample buffer + /// when accessing the buffer directly with 'ptrEnd' function. Please be + /// careful though! + virtual void putSamples(uint numSamples ///< Number of samples been inserted. + ); + + /// Output samples from beginning of the sample buffer. Copies requested samples to + /// output buffer and removes them from the sample buffer. If there are less than + /// 'numsample' samples in the buffer, returns all that available. + /// + /// \return Number of samples returned. + virtual uint receiveSamples(SAMPLETYPE *output, ///< Buffer where to copy output samples. + uint maxSamples ///< How many samples to receive at max. + ) override; + + /// Adjusts book-keeping so that given number of samples are removed from beginning of the + /// sample buffer without copying them anywhere. + /// + /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly + /// with 'ptrBegin' function. + virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. + ) override; + + /// Returns number of samples currently available. + virtual uint numSamples() const override; + + /// Sets number of channels, 1 = mono, 2 = stereo. + void setChannels(int numChannels); + + /// Get number of channels + int getChannels() + { + return channels; + } + + /// Returns nonzero if there aren't any samples available for outputting. + virtual int isEmpty() const override; + + /// Clears all the samples. + virtual void clear() override; + + /// allow trimming (downwards) amount of samples in pipeline. + /// Returns adjusted amount of samples + uint adjustAmountOfSamples(uint numSamples) override; + + /// Add silence to end of buffer + void addSilent(uint nSamples); +}; + +} + +#endif diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIFOSamplePipe.h b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIFOSamplePipe.h index 663c5c6131..8d415a00a7 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIFOSamplePipe.h +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIFOSamplePipe.h @@ -1,230 +1,230 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// 'FIFOSamplePipe' : An abstract base class for classes that manipulate sound -/// samples by operating like a first-in-first-out pipe: New samples are fed -/// into one end of the pipe with the 'putSamples' function, and the processed -/// samples are received from the other end with the 'receiveSamples' function. -/// -/// 'FIFOProcessor' : A base class for classes the do signal processing with -/// the samples while operating like a first-in-first-out pipe. When samples -/// are input with the 'putSamples' function, the class processes them -/// and moves the processed samples to the given 'output' pipe object, which -/// may be either another processing stage, or a fifo sample buffer object. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef FIFOSamplePipe_H -#define FIFOSamplePipe_H - -#include -#include -#include "STTypes.h" - -namespace soundtouch -{ - -/// Abstract base class for FIFO (first-in-first-out) sample processing classes. -class FIFOSamplePipe -{ -protected: - - bool verifyNumberOfChannels(int nChannels) const - { - if ((nChannels > 0) && (nChannels <= SOUNDTOUCH_MAX_CHANNELS)) - { - return true; - } - ST_THROW_RT_ERROR("Error: Illegal number of channels"); - return false; - } - -public: - // virtual default destructor - virtual ~FIFOSamplePipe() {} - - - /// Returns a pointer to the beginning of the output samples. - /// This function is provided for accessing the output samples directly. - /// Please be careful for not to corrupt the book-keeping! - /// - /// When using this function to output samples, also remember to 'remove' the - /// output samples from the buffer by calling the - /// 'receiveSamples(numSamples)' function - virtual SAMPLETYPE *ptrBegin() = 0; - - /// Adds 'numSamples' pcs of samples from the 'samples' memory position to - /// the sample buffer. - virtual void putSamples(const SAMPLETYPE *samples, ///< Pointer to samples. - uint numSamples ///< Number of samples to insert. - ) = 0; - - - // Moves samples from the 'other' pipe instance to this instance. - void moveSamples(FIFOSamplePipe &other ///< Other pipe instance where from the receive the data. - ) - { - int oNumSamples = other.numSamples(); - - putSamples(other.ptrBegin(), oNumSamples); - other.receiveSamples(oNumSamples); - }; - - /// Output samples from beginning of the sample buffer. Copies requested samples to - /// output buffer and removes them from the sample buffer. If there are less than - /// 'numsample' samples in the buffer, returns all that available. - /// - /// \return Number of samples returned. - virtual uint receiveSamples(SAMPLETYPE *output, ///< Buffer where to copy output samples. - uint maxSamples ///< How many samples to receive at max. - ) = 0; - - /// Adjusts book-keeping so that given number of samples are removed from beginning of the - /// sample buffer without copying them anywhere. - /// - /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly - /// with 'ptrBegin' function. - virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. - ) = 0; - - /// Returns number of samples currently available. - virtual uint numSamples() const = 0; - - // Returns nonzero if there aren't any samples available for outputting. - virtual int isEmpty() const = 0; - - /// Clears all the samples. - virtual void clear() = 0; - - /// allow trimming (downwards) amount of samples in pipeline. - /// Returns adjusted amount of samples - virtual uint adjustAmountOfSamples(uint numSamples) = 0; - -}; - - -/// Base-class for sound processing routines working in FIFO principle. With this base -/// class it's easy to implement sound processing stages that can be chained together, -/// so that samples that are fed into beginning of the pipe automatically go through -/// all the processing stages. -/// -/// When samples are input to this class, they're first processed and then put to -/// the FIFO pipe that's defined as output of this class. This output pipe can be -/// either other processing stage or a FIFO sample buffer. -class FIFOProcessor :public FIFOSamplePipe -{ -protected: - /// Internal pipe where processed samples are put. - FIFOSamplePipe *output; - - /// Sets output pipe. - void setOutPipe(FIFOSamplePipe *pOutput) - { - assert(output == NULL); - assert(pOutput != NULL); - output = pOutput; - } - - /// Constructor. Doesn't define output pipe; it has to be set be - /// 'setOutPipe' function. - FIFOProcessor() - { - output = NULL; - } - - /// Constructor. Configures output pipe. - FIFOProcessor(FIFOSamplePipe *pOutput ///< Output pipe. - ) - { - output = pOutput; - } - - /// Destructor. - virtual ~FIFOProcessor() override - { - } - - /// Returns a pointer to the beginning of the output samples. - /// This function is provided for accessing the output samples directly. - /// Please be careful for not to corrupt the book-keeping! - /// - /// When using this function to output samples, also remember to 'remove' the - /// output samples from the buffer by calling the - /// 'receiveSamples(numSamples)' function - virtual SAMPLETYPE *ptrBegin() override - { - return output->ptrBegin(); - } - -public: - - /// Output samples from beginning of the sample buffer. Copies requested samples to - /// output buffer and removes them from the sample buffer. If there are less than - /// 'numsample' samples in the buffer, returns all that available. - /// - /// \return Number of samples returned. - virtual uint receiveSamples(SAMPLETYPE *outBuffer, ///< Buffer where to copy output samples. - uint maxSamples ///< How many samples to receive at max. - ) override - { - return output->receiveSamples(outBuffer, maxSamples); - } - - /// Adjusts book-keeping so that given number of samples are removed from beginning of the - /// sample buffer without copying them anywhere. - /// - /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly - /// with 'ptrBegin' function. - virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. - ) override - { - return output->receiveSamples(maxSamples); - } - - /// Returns number of samples currently available. - virtual uint numSamples() const override - { - return output->numSamples(); - } - - /// Returns nonzero if there aren't any samples available for outputting. - virtual int isEmpty() const override - { - return output->isEmpty(); - } - - /// allow trimming (downwards) amount of samples in pipeline. - /// Returns adjusted amount of samples - virtual uint adjustAmountOfSamples(uint numSamples) override - { - return output->adjustAmountOfSamples(numSamples); - } -}; - -} - -#endif +//////////////////////////////////////////////////////////////////////////////// +/// +/// 'FIFOSamplePipe' : An abstract base class for classes that manipulate sound +/// samples by operating like a first-in-first-out pipe: New samples are fed +/// into one end of the pipe with the 'putSamples' function, and the processed +/// samples are received from the other end with the 'receiveSamples' function. +/// +/// 'FIFOProcessor' : A base class for classes the do signal processing with +/// the samples while operating like a first-in-first-out pipe. When samples +/// are input with the 'putSamples' function, the class processes them +/// and moves the processed samples to the given 'output' pipe object, which +/// may be either another processing stage, or a fifo sample buffer object. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef FIFOSamplePipe_H +#define FIFOSamplePipe_H + +#include +#include +#include "STTypes.h" + +namespace soundtouch +{ + +/// Abstract base class for FIFO (first-in-first-out) sample processing classes. +class FIFOSamplePipe +{ +protected: + + bool verifyNumberOfChannels(int nChannels) const + { + if ((nChannels > 0) && (nChannels <= SOUNDTOUCH_MAX_CHANNELS)) + { + return true; + } + ST_THROW_RT_ERROR("Error: Illegal number of channels"); + return false; + } + +public: + // virtual default destructor + virtual ~FIFOSamplePipe() {} + + + /// Returns a pointer to the beginning of the output samples. + /// This function is provided for accessing the output samples directly. + /// Please be careful for not to corrupt the book-keeping! + /// + /// When using this function to output samples, also remember to 'remove' the + /// output samples from the buffer by calling the + /// 'receiveSamples(numSamples)' function + virtual SAMPLETYPE *ptrBegin() = 0; + + /// Adds 'numSamples' pcs of samples from the 'samples' memory position to + /// the sample buffer. + virtual void putSamples(const SAMPLETYPE *samples, ///< Pointer to samples. + uint numSamples ///< Number of samples to insert. + ) = 0; + + + // Moves samples from the 'other' pipe instance to this instance. + void moveSamples(FIFOSamplePipe &other ///< Other pipe instance where from the receive the data. + ) + { + int oNumSamples = other.numSamples(); + + putSamples(other.ptrBegin(), oNumSamples); + other.receiveSamples(oNumSamples); + }; + + /// Output samples from beginning of the sample buffer. Copies requested samples to + /// output buffer and removes them from the sample buffer. If there are less than + /// 'numsample' samples in the buffer, returns all that available. + /// + /// \return Number of samples returned. + virtual uint receiveSamples(SAMPLETYPE *output, ///< Buffer where to copy output samples. + uint maxSamples ///< How many samples to receive at max. + ) = 0; + + /// Adjusts book-keeping so that given number of samples are removed from beginning of the + /// sample buffer without copying them anywhere. + /// + /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly + /// with 'ptrBegin' function. + virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. + ) = 0; + + /// Returns number of samples currently available. + virtual uint numSamples() const = 0; + + // Returns nonzero if there aren't any samples available for outputting. + virtual int isEmpty() const = 0; + + /// Clears all the samples. + virtual void clear() = 0; + + /// allow trimming (downwards) amount of samples in pipeline. + /// Returns adjusted amount of samples + virtual uint adjustAmountOfSamples(uint numSamples) = 0; + +}; + + +/// Base-class for sound processing routines working in FIFO principle. With this base +/// class it's easy to implement sound processing stages that can be chained together, +/// so that samples that are fed into beginning of the pipe automatically go through +/// all the processing stages. +/// +/// When samples are input to this class, they're first processed and then put to +/// the FIFO pipe that's defined as output of this class. This output pipe can be +/// either other processing stage or a FIFO sample buffer. +class FIFOProcessor :public FIFOSamplePipe +{ +protected: + /// Internal pipe where processed samples are put. + FIFOSamplePipe *output; + + /// Sets output pipe. + void setOutPipe(FIFOSamplePipe *pOutput) + { + assert(output == NULL); + assert(pOutput != NULL); + output = pOutput; + } + + /// Constructor. Doesn't define output pipe; it has to be set be + /// 'setOutPipe' function. + FIFOProcessor() + { + output = NULL; + } + + /// Constructor. Configures output pipe. + FIFOProcessor(FIFOSamplePipe *pOutput ///< Output pipe. + ) + { + output = pOutput; + } + + /// Destructor. + virtual ~FIFOProcessor() override + { + } + + /// Returns a pointer to the beginning of the output samples. + /// This function is provided for accessing the output samples directly. + /// Please be careful for not to corrupt the book-keeping! + /// + /// When using this function to output samples, also remember to 'remove' the + /// output samples from the buffer by calling the + /// 'receiveSamples(numSamples)' function + virtual SAMPLETYPE *ptrBegin() override + { + return output->ptrBegin(); + } + +public: + + /// Output samples from beginning of the sample buffer. Copies requested samples to + /// output buffer and removes them from the sample buffer. If there are less than + /// 'numsample' samples in the buffer, returns all that available. + /// + /// \return Number of samples returned. + virtual uint receiveSamples(SAMPLETYPE *outBuffer, ///< Buffer where to copy output samples. + uint maxSamples ///< How many samples to receive at max. + ) override + { + return output->receiveSamples(outBuffer, maxSamples); + } + + /// Adjusts book-keeping so that given number of samples are removed from beginning of the + /// sample buffer without copying them anywhere. + /// + /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly + /// with 'ptrBegin' function. + virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. + ) override + { + return output->receiveSamples(maxSamples); + } + + /// Returns number of samples currently available. + virtual uint numSamples() const override + { + return output->numSamples(); + } + + /// Returns nonzero if there aren't any samples available for outputting. + virtual int isEmpty() const override + { + return output->isEmpty(); + } + + /// allow trimming (downwards) amount of samples in pipeline. + /// Returns adjusted amount of samples + virtual uint adjustAmountOfSamples(uint numSamples) override + { + return output->adjustAmountOfSamples(numSamples); + } +}; + +} + +#endif diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIRFilter.cpp b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIRFilter.cpp index d303fb095e..3553c1ebe1 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIRFilter.cpp +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIRFilter.cpp @@ -1,325 +1,325 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// General FIR digital filter routines with MMX optimization. -/// -/// Notes : MMX optimized functions reside in a separate, platform-specific file, -/// e.g. 'mmx_win.cpp' or 'mmx_gcc.cpp' -/// -/// This source file contains OpenMP optimizations that allow speeding up the -/// corss-correlation algorithm by executing it in several threads / CPU cores -/// in parallel. See the following article link for more detailed discussion -/// about SoundTouch OpenMP optimizations: -/// http://www.softwarecoven.com/parallel-computing-in-embedded-mobile-devices -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include -#include "FIRFilter.h" - -#include "ADM_default.h" - -using namespace soundtouch; - -/***************************************************************************** - * - * Implementation of the class 'FIRFilter' - * - *****************************************************************************/ - -FIRFilter::FIRFilter() -{ - resultDivFactor = 0; - resultDivider = 0; - length = 0; - lengthDiv8 = 0; - filterCoeffs = NULL; - filterCoeffsStereo = NULL; -} - - -FIRFilter::~FIRFilter() -{ - delete[] filterCoeffs; - delete[] filterCoeffsStereo; -} - - -// Usual C-version of the filter routine for stereo sound -uint FIRFilter::evaluateFilterStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples) const -{ - int j, end; -#ifdef SOUNDTOUCH_FLOAT_SAMPLES - // when using floating point samples, use a scaler instead of a divider - // because division is much slower operation than multiplying. - double dScaler = 1.0 / (double)resultDivider; -#endif - // hint compiler autovectorization that loop length is divisible by 8 - int ilength = length & -8; - - ADM_assert((length != 0) && (length == ilength) && (src != NULL) && (dest != NULL) && (filterCoeffs != NULL)); - - end = 2 * (numSamples - ilength); - - #pragma omp parallel for - for (j = 0; j < end; j += 2) - { - const SAMPLETYPE *ptr; - LONG_SAMPLETYPE suml, sumr; - - suml = sumr = 0; - ptr = src + j; - - for (int i = 0; i < ilength; i ++) - { - suml += ptr[2 * i] * filterCoeffsStereo[2 * i]; - sumr += ptr[2 * i + 1] * filterCoeffsStereo[2 * i + 1]; - } - -#ifdef SOUNDTOUCH_INTEGER_SAMPLES - suml >>= resultDivFactor; - sumr >>= resultDivFactor; - // saturate to 16 bit integer limits - suml = (suml < -32768) ? -32768 : (suml > 32767) ? 32767 : suml; - // saturate to 16 bit integer limits - sumr = (sumr < -32768) ? -32768 : (sumr > 32767) ? 32767 : sumr; -#endif // SOUNDTOUCH_INTEGER_SAMPLES - dest[j] = (SAMPLETYPE)suml; - dest[j + 1] = (SAMPLETYPE)sumr; - } - return numSamples - ilength; -} - - -// Usual C-version of the filter routine for mono sound -uint FIRFilter::evaluateFilterMono(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples) const -{ - int j, end; -#ifdef SOUNDTOUCH_FLOAT_SAMPLES - // when using floating point samples, use a scaler instead of a divider - // because division is much slower operation than multiplying. - double dScaler = 1.0 / (double)resultDivider; -#endif - - // hint compiler autovectorization that loop length is divisible by 8 - int ilength = length & -8; - - ADM_assert(ilength != 0); - - end = numSamples - ilength; - #pragma omp parallel for - for (j = 0; j < end; j ++) - { - const SAMPLETYPE *pSrc = src + j; - LONG_SAMPLETYPE sum; - int i; - - sum = 0; - for (i = 0; i < ilength; i ++) - { - sum += pSrc[i] * filterCoeffs[i]; - } -#ifdef SOUNDTOUCH_INTEGER_SAMPLES - sum >>= resultDivFactor; - // saturate to 16 bit integer limits - sum = (sum < -32768) ? -32768 : (sum > 32767) ? 32767 : sum; -#endif // SOUNDTOUCH_INTEGER_SAMPLES - dest[j] = (SAMPLETYPE)sum; - } - return end; -} - - -uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels) -{ - int j, end; - -#ifdef SOUNDTOUCH_FLOAT_SAMPLES - // when using floating point samples, use a scaler instead of a divider - // because division is much slower operation than multiplying. - double dScaler = 1.0 / (double)resultDivider; -#endif - - ADM_assert(length != 0); - ADM_assert(src != NULL); - ADM_assert(dest != NULL); - ADM_assert(filterCoeffs != NULL); - ADM_assert(numChannels < 16); - - // hint compiler autovectorization that loop length is divisible by 8 - int ilength = length & -8; - - end = numChannels * (numSamples - ilength); - - #pragma omp parallel for - for (j = 0; j < end; j += numChannels) - { - const SAMPLETYPE *ptr; - LONG_SAMPLETYPE sums[16]; - uint c; - int i; - - for (c = 0; c < numChannels; c ++) - { - sums[c] = 0; - } - - ptr = src + j; - - for (i = 0; i < ilength; i ++) - { - SAMPLETYPE coef=filterCoeffs[i]; - for (c = 0; c < numChannels; c ++) - { - sums[c] += ptr[0] * coef; - ptr ++; - } - } - - for (c = 0; c < numChannels; c ++) - { -#ifdef SOUNDTOUCH_INTEGER_SAMPLES - sums[c] >>= resultDivFactor; -#endif // SOUNDTOUCH_INTEGER_SAMPLES - dest[j+c] = (SAMPLETYPE)sums[c]; - } - } - return numSamples - ilength; -} - - -// Set filter coeffiecients and length. -// -// Throws an exception if filter length isn't divisible by 8 -void FIRFilter::setCoefficients(const SAMPLETYPE *coeffs, uint newLength, uint uResultDivFactor) -{ - ADM_assert(newLength > 0); - if (newLength % 8) ST_THROW_RT_ERROR("FIR filter length not divisible by 8"); - - #ifdef SOUNDTOUCH_FLOAT_SAMPLES - // scale coefficients already here if using floating samples - double scale = 1.0 / resultDivider; - #else - short scale = 1; - #endif - - lengthDiv8 = newLength / 8; - length = lengthDiv8 * 8; - ADM_assert(length == newLength); - - resultDivFactor = uResultDivFactor; - resultDivider = (SAMPLETYPE)::pow(2.0, (int)resultDivFactor); - - delete[] filterCoeffs; - filterCoeffs = new SAMPLETYPE[length]; - delete[] filterCoeffsStereo; - filterCoeffsStereo = new SAMPLETYPE[length*2]; - for (uint i = 0; i < length; i ++) - { - filterCoeffs[i] = (SAMPLETYPE)(coeffs[i] * scale); - // create also stereo set of filter coefficients: this allows compiler - // to autovectorize filter evaluation much more efficiently - filterCoeffsStereo[2 * i] = (SAMPLETYPE)(coeffs[i] * scale); - filterCoeffsStereo[2 * i + 1] = (SAMPLETYPE)(coeffs[i] * scale); - } -} - - -uint FIRFilter::getLength() const -{ - return length; -} - - -// Applies the filter to the given sequence of samples. -// -// Note : The amount of outputted samples is by value of 'filter_length' -// smaller than the amount of input samples. -uint FIRFilter::evaluate(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels) -{ - ADM_assert(length > 0); - ADM_assert(lengthDiv8 * 8 == length); - - if (numSamples < length) return 0; - -#ifndef USE_MULTICH_ALWAYS - if (numChannels == 1) - { - return evaluateFilterMono(dest, src, numSamples); - } - else if (numChannels == 2) - { - return evaluateFilterStereo(dest, src, numSamples); - } - else -#endif // USE_MULTICH_ALWAYS - { - ADM_assert(numChannels > 0); - return evaluateFilterMulti(dest, src, numSamples, numChannels); - } -} - - -// Operator 'new' is overloaded so that it automatically creates a suitable instance -// depending on if we've a MMX-capable CPU available or not. -void * FIRFilter::operator new(size_t s) -{ - // Notice! don't use "new FIRFilter" directly, use "newInstance" to create a new instance instead! - ST_THROW_RT_ERROR("Error in FIRFilter::new: Don't use 'new FIRFilter', use 'newInstance' member instead!"); - return newInstance(); -} - - -FIRFilter * FIRFilter::newInstance() -{ - // Check if MMX/SSE instruction set extensions supported by CPU - -#ifdef SOUNDTOUCH_ALLOW_MMX - // MMX routines available only with integer sample types - if (CpuCaps::hasMMX()) - { - return ::new FIRFilterMMX; - } - else -#endif // SOUNDTOUCH_ALLOW_MMX - -#ifdef SOUNDTOUCH_ALLOW_SSE - if (CpuCaps::hasSSE()) - { - // SSE support - return ::new FIRFilterSSE; - } - else -#endif // SOUNDTOUCH_ALLOW_SSE - - { - // ISA optimizations not supported, use plain C version - return ::new FIRFilter; - } -} +//////////////////////////////////////////////////////////////////////////////// +/// +/// General FIR digital filter routines with MMX optimization. +/// +/// Notes : MMX optimized functions reside in a separate, platform-specific file, +/// e.g. 'mmx_win.cpp' or 'mmx_gcc.cpp' +/// +/// This source file contains OpenMP optimizations that allow speeding up the +/// corss-correlation algorithm by executing it in several threads / CPU cores +/// in parallel. See the following article link for more detailed discussion +/// about SoundTouch OpenMP optimizations: +/// http://www.softwarecoven.com/parallel-computing-in-embedded-mobile-devices +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include "FIRFilter.h" + +#include "ADM_default.h" + +using namespace soundtouch; + +/***************************************************************************** + * + * Implementation of the class 'FIRFilter' + * + *****************************************************************************/ + +FIRFilter::FIRFilter() +{ + resultDivFactor = 0; + resultDivider = 0; + length = 0; + lengthDiv8 = 0; + filterCoeffs = NULL; + filterCoeffsStereo = NULL; +} + + +FIRFilter::~FIRFilter() +{ + delete[] filterCoeffs; + delete[] filterCoeffsStereo; +} + + +// Usual C-version of the filter routine for stereo sound +uint FIRFilter::evaluateFilterStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples) const +{ + int j, end; +#ifdef SOUNDTOUCH_FLOAT_SAMPLES + // when using floating point samples, use a scaler instead of a divider + // because division is much slower operation than multiplying. + double dScaler = 1.0 / (double)resultDivider; +#endif + // hint compiler autovectorization that loop length is divisible by 8 + int ilength = length & -8; + + ADM_assert((length != 0) && (length == ilength) && (src != NULL) && (dest != NULL) && (filterCoeffs != NULL)); + + end = 2 * (numSamples - ilength); + + #pragma omp parallel for + for (j = 0; j < end; j += 2) + { + const SAMPLETYPE *ptr; + LONG_SAMPLETYPE suml, sumr; + + suml = sumr = 0; + ptr = src + j; + + for (int i = 0; i < ilength; i ++) + { + suml += ptr[2 * i] * filterCoeffsStereo[2 * i]; + sumr += ptr[2 * i + 1] * filterCoeffsStereo[2 * i + 1]; + } + +#ifdef SOUNDTOUCH_INTEGER_SAMPLES + suml >>= resultDivFactor; + sumr >>= resultDivFactor; + // saturate to 16 bit integer limits + suml = (suml < -32768) ? -32768 : (suml > 32767) ? 32767 : suml; + // saturate to 16 bit integer limits + sumr = (sumr < -32768) ? -32768 : (sumr > 32767) ? 32767 : sumr; +#endif // SOUNDTOUCH_INTEGER_SAMPLES + dest[j] = (SAMPLETYPE)suml; + dest[j + 1] = (SAMPLETYPE)sumr; + } + return numSamples - ilength; +} + + +// Usual C-version of the filter routine for mono sound +uint FIRFilter::evaluateFilterMono(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples) const +{ + int j, end; +#ifdef SOUNDTOUCH_FLOAT_SAMPLES + // when using floating point samples, use a scaler instead of a divider + // because division is much slower operation than multiplying. + double dScaler = 1.0 / (double)resultDivider; +#endif + + // hint compiler autovectorization that loop length is divisible by 8 + int ilength = length & -8; + + ADM_assert(ilength != 0); + + end = numSamples - ilength; + #pragma omp parallel for + for (j = 0; j < end; j ++) + { + const SAMPLETYPE *pSrc = src + j; + LONG_SAMPLETYPE sum; + int i; + + sum = 0; + for (i = 0; i < ilength; i ++) + { + sum += pSrc[i] * filterCoeffs[i]; + } +#ifdef SOUNDTOUCH_INTEGER_SAMPLES + sum >>= resultDivFactor; + // saturate to 16 bit integer limits + sum = (sum < -32768) ? -32768 : (sum > 32767) ? 32767 : sum; +#endif // SOUNDTOUCH_INTEGER_SAMPLES + dest[j] = (SAMPLETYPE)sum; + } + return end; +} + + +uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels) +{ + int j, end; + +#ifdef SOUNDTOUCH_FLOAT_SAMPLES + // when using floating point samples, use a scaler instead of a divider + // because division is much slower operation than multiplying. + double dScaler = 1.0 / (double)resultDivider; +#endif + + ADM_assert(length != 0); + ADM_assert(src != NULL); + ADM_assert(dest != NULL); + ADM_assert(filterCoeffs != NULL); + ADM_assert(numChannels < 16); + + // hint compiler autovectorization that loop length is divisible by 8 + int ilength = length & -8; + + end = numChannels * (numSamples - ilength); + + #pragma omp parallel for + for (j = 0; j < end; j += numChannels) + { + const SAMPLETYPE *ptr; + LONG_SAMPLETYPE sums[16]; + uint c; + int i; + + for (c = 0; c < numChannels; c ++) + { + sums[c] = 0; + } + + ptr = src + j; + + for (i = 0; i < ilength; i ++) + { + SAMPLETYPE coef=filterCoeffs[i]; + for (c = 0; c < numChannels; c ++) + { + sums[c] += ptr[0] * coef; + ptr ++; + } + } + + for (c = 0; c < numChannels; c ++) + { +#ifdef SOUNDTOUCH_INTEGER_SAMPLES + sums[c] >>= resultDivFactor; +#endif // SOUNDTOUCH_INTEGER_SAMPLES + dest[j+c] = (SAMPLETYPE)sums[c]; + } + } + return numSamples - ilength; +} + + +// Set filter coeffiecients and length. +// +// Throws an exception if filter length isn't divisible by 8 +void FIRFilter::setCoefficients(const SAMPLETYPE *coeffs, uint newLength, uint uResultDivFactor) +{ + ADM_assert(newLength > 0); + if (newLength % 8) ST_THROW_RT_ERROR("FIR filter length not divisible by 8"); + + #ifdef SOUNDTOUCH_FLOAT_SAMPLES + // scale coefficients already here if using floating samples + double scale = 1.0 / resultDivider; + #else + short scale = 1; + #endif + + lengthDiv8 = newLength / 8; + length = lengthDiv8 * 8; + ADM_assert(length == newLength); + + resultDivFactor = uResultDivFactor; + resultDivider = (SAMPLETYPE)::pow(2.0, (int)resultDivFactor); + + delete[] filterCoeffs; + filterCoeffs = new SAMPLETYPE[length]; + delete[] filterCoeffsStereo; + filterCoeffsStereo = new SAMPLETYPE[length*2]; + for (uint i = 0; i < length; i ++) + { + filterCoeffs[i] = (SAMPLETYPE)(coeffs[i] * scale); + // create also stereo set of filter coefficients: this allows compiler + // to autovectorize filter evaluation much more efficiently + filterCoeffsStereo[2 * i] = (SAMPLETYPE)(coeffs[i] * scale); + filterCoeffsStereo[2 * i + 1] = (SAMPLETYPE)(coeffs[i] * scale); + } +} + + +uint FIRFilter::getLength() const +{ + return length; +} + + +// Applies the filter to the given sequence of samples. +// +// Note : The amount of outputted samples is by value of 'filter_length' +// smaller than the amount of input samples. +uint FIRFilter::evaluate(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels) +{ + ADM_assert(length > 0); + ADM_assert(lengthDiv8 * 8 == length); + + if (numSamples < length) return 0; + +#ifndef USE_MULTICH_ALWAYS + if (numChannels == 1) + { + return evaluateFilterMono(dest, src, numSamples); + } + else if (numChannels == 2) + { + return evaluateFilterStereo(dest, src, numSamples); + } + else +#endif // USE_MULTICH_ALWAYS + { + ADM_assert(numChannels > 0); + return evaluateFilterMulti(dest, src, numSamples, numChannels); + } +} + + +// Operator 'new' is overloaded so that it automatically creates a suitable instance +// depending on if we've a MMX-capable CPU available or not. +void * FIRFilter::operator new(size_t s) +{ + // Notice! don't use "new FIRFilter" directly, use "newInstance" to create a new instance instead! + ST_THROW_RT_ERROR("Error in FIRFilter::new: Don't use 'new FIRFilter', use 'newInstance' member instead!"); + return newInstance(); +} + + +FIRFilter * FIRFilter::newInstance() +{ + // Check if MMX/SSE instruction set extensions supported by CPU + +#ifdef SOUNDTOUCH_ALLOW_MMX + // MMX routines available only with integer sample types + if (CpuCaps::hasMMX()) + { + return ::new FIRFilterMMX; + } + else +#endif // SOUNDTOUCH_ALLOW_MMX + +#ifdef SOUNDTOUCH_ALLOW_SSE + if (CpuCaps::hasSSE()) + { + // SSE support + return ::new FIRFilterSSE; + } + else +#endif // SOUNDTOUCH_ALLOW_SSE + + { + // ISA optimizations not supported, use plain C version + return ::new FIRFilter; + } +} diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIRFilter.h b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIRFilter.h index 90b730fcb5..cc90feb4f3 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIRFilter.h +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/FIRFilter.h @@ -1,140 +1,140 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// General FIR digital filter routines with MMX optimization. -/// -/// Note : MMX optimized functions reside in a separate, platform-specific file, -/// e.g. 'mmx_win.cpp' or 'mmx_gcc.cpp' -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef FIRFilter_H -#define FIRFilter_H - -#include -#include "STTypes.h" - -namespace soundtouch -{ - -class FIRFilter -{ -protected: - // Number of FIR filter taps - uint length; - // Number of FIR filter taps divided by 8 - uint lengthDiv8; - - // Result divider factor in 2^k format - uint resultDivFactor; - - // Result divider value. - SAMPLETYPE resultDivider; - - // Memory for filter coefficients - SAMPLETYPE *filterCoeffs; - SAMPLETYPE *filterCoeffsStereo; - - virtual uint evaluateFilterStereo(SAMPLETYPE *dest, - const SAMPLETYPE *src, - uint numSamples) const; - virtual uint evaluateFilterMono(SAMPLETYPE *dest, - const SAMPLETYPE *src, - uint numSamples) const; - virtual uint evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels); - -public: - FIRFilter(); - virtual ~FIRFilter(); - - /// Operator 'new' is overloaded so that it automatically creates a suitable instance - /// depending on if we've a MMX-capable CPU available or not. - static void * operator new(size_t s); - - static FIRFilter *newInstance(); - - /// Applies the filter to the given sequence of samples. - /// Note : The amount of outputted samples is by value of 'filter_length' - /// smaller than the amount of input samples. - /// - /// \return Number of samples copied to 'dest'. - uint evaluate(SAMPLETYPE *dest, - const SAMPLETYPE *src, - uint numSamples, - uint numChannels); - - uint getLength() const; - - virtual void setCoefficients(const SAMPLETYPE *coeffs, - uint newLength, - uint uResultDivFactor); -}; - - -// Optional subclasses that implement CPU-specific optimizations: - -#ifdef SOUNDTOUCH_ALLOW_MMX - -/// Class that implements MMX optimized functions exclusive for 16bit integer samples type. - class FIRFilterMMX : public FIRFilter - { - protected: - short *filterCoeffsUnalign; - short *filterCoeffsAlign; - - virtual uint evaluateFilterStereo(short *dest, const short *src, uint numSamples) const override; - public: - FIRFilterMMX(); - ~FIRFilterMMX(); - - virtual void setCoefficients(const short *coeffs, uint newLength, uint uResultDivFactor) override; - }; - -#endif // SOUNDTOUCH_ALLOW_MMX - - -#ifdef SOUNDTOUCH_ALLOW_SSE - /// Class that implements SSE optimized functions exclusive for floating point samples type. - class FIRFilterSSE : public FIRFilter - { - protected: - float *filterCoeffsUnalign; - float *filterCoeffsAlign; - - virtual uint evaluateFilterStereo(float *dest, const float *src, uint numSamples) const override; - public: - FIRFilterSSE(); - ~FIRFilterSSE(); - - virtual void setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor) override; - }; - -#endif // SOUNDTOUCH_ALLOW_SSE - -} - -#endif // FIRFilter_H +//////////////////////////////////////////////////////////////////////////////// +/// +/// General FIR digital filter routines with MMX optimization. +/// +/// Note : MMX optimized functions reside in a separate, platform-specific file, +/// e.g. 'mmx_win.cpp' or 'mmx_gcc.cpp' +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef FIRFilter_H +#define FIRFilter_H + +#include +#include "STTypes.h" + +namespace soundtouch +{ + +class FIRFilter +{ +protected: + // Number of FIR filter taps + uint length; + // Number of FIR filter taps divided by 8 + uint lengthDiv8; + + // Result divider factor in 2^k format + uint resultDivFactor; + + // Result divider value. + SAMPLETYPE resultDivider; + + // Memory for filter coefficients + SAMPLETYPE *filterCoeffs; + SAMPLETYPE *filterCoeffsStereo; + + virtual uint evaluateFilterStereo(SAMPLETYPE *dest, + const SAMPLETYPE *src, + uint numSamples) const; + virtual uint evaluateFilterMono(SAMPLETYPE *dest, + const SAMPLETYPE *src, + uint numSamples) const; + virtual uint evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels); + +public: + FIRFilter(); + virtual ~FIRFilter(); + + /// Operator 'new' is overloaded so that it automatically creates a suitable instance + /// depending on if we've a MMX-capable CPU available or not. + static void * operator new(size_t s); + + static FIRFilter *newInstance(); + + /// Applies the filter to the given sequence of samples. + /// Note : The amount of outputted samples is by value of 'filter_length' + /// smaller than the amount of input samples. + /// + /// \return Number of samples copied to 'dest'. + uint evaluate(SAMPLETYPE *dest, + const SAMPLETYPE *src, + uint numSamples, + uint numChannels); + + uint getLength() const; + + virtual void setCoefficients(const SAMPLETYPE *coeffs, + uint newLength, + uint uResultDivFactor); +}; + + +// Optional subclasses that implement CPU-specific optimizations: + +#ifdef SOUNDTOUCH_ALLOW_MMX + +/// Class that implements MMX optimized functions exclusive for 16bit integer samples type. + class FIRFilterMMX : public FIRFilter + { + protected: + short *filterCoeffsUnalign; + short *filterCoeffsAlign; + + virtual uint evaluateFilterStereo(short *dest, const short *src, uint numSamples) const override; + public: + FIRFilterMMX(); + ~FIRFilterMMX(); + + virtual void setCoefficients(const short *coeffs, uint newLength, uint uResultDivFactor) override; + }; + +#endif // SOUNDTOUCH_ALLOW_MMX + + +#ifdef SOUNDTOUCH_ALLOW_SSE + /// Class that implements SSE optimized functions exclusive for floating point samples type. + class FIRFilterSSE : public FIRFilter + { + protected: + float *filterCoeffsUnalign; + float *filterCoeffsAlign; + + virtual uint evaluateFilterStereo(float *dest, const float *src, uint numSamples) const override; + public: + FIRFilterSSE(); + ~FIRFilterSSE(); + + virtual void setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor) override; + }; + +#endif // SOUNDTOUCH_ALLOW_SSE + +} + +#endif // FIRFilter_H diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateCubic.cpp b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateCubic.cpp index 10597f9261..2575db0c5f 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateCubic.cpp +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateCubic.cpp @@ -1,197 +1,197 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// Cubic interpolation routine. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include "InterpolateCubic.h" -#include "STTypes.h" -#include "ADM_default.h" - -using namespace soundtouch; - -// cubic interpolation coefficients -static const float _coeffs[]= -{ -0.5f, 1.0f, -0.5f, 0.0f, - 1.5f, -2.5f, 0.0f, 1.0f, - -1.5f, 2.0f, 0.5f, 0.0f, - 0.5f, -0.5f, 0.0f, 0.0f}; - - -InterpolateCubic::InterpolateCubic() -{ - fract = 0; -} - - -void InterpolateCubic::resetRegisters() -{ - fract = 0; -} - - -/// Transpose mono audio. Returns number of produced output samples, and -/// updates "srcSamples" to amount of consumed source samples -int InterpolateCubic::transposeMono(SAMPLETYPE *pdest, - const SAMPLETYPE *psrc, - int &srcSamples) -{ - int i; - int srcSampleEnd = srcSamples - 4; - int srcCount = 0; - - i = 0; - while (srcCount < srcSampleEnd) - { - float out; - const float x3 = 1.0f; - const float x2 = (float)fract; // x - const float x1 = x2*x2; // x^2 - const float x0 = x1*x2; // x^3 - float y0, y1, y2, y3; - - ADM_assert(fract < 1.0); - - y0 = _coeffs[0] * x0 + _coeffs[1] * x1 + _coeffs[2] * x2 + _coeffs[3] * x3; - y1 = _coeffs[4] * x0 + _coeffs[5] * x1 + _coeffs[6] * x2 + _coeffs[7] * x3; - y2 = _coeffs[8] * x0 + _coeffs[9] * x1 + _coeffs[10] * x2 + _coeffs[11] * x3; - y3 = _coeffs[12] * x0 + _coeffs[13] * x1 + _coeffs[14] * x2 + _coeffs[15] * x3; - - out = y0 * psrc[0] + y1 * psrc[1] + y2 * psrc[2] + y3 * psrc[3]; - - pdest[i] = (SAMPLETYPE)out; - i ++; - - // update position fraction - fract += rate; - // update whole positions - int whole = (int)fract; - fract -= whole; - psrc += whole; - srcCount += whole; - } - srcSamples = srcCount; - return i; -} - - -/// Transpose stereo audio. Returns number of produced output samples, and -/// updates "srcSamples" to amount of consumed source samples -int InterpolateCubic::transposeStereo(SAMPLETYPE *pdest, - const SAMPLETYPE *psrc, - int &srcSamples) -{ - int i; - int srcSampleEnd = srcSamples - 4; - int srcCount = 0; - - i = 0; - while (srcCount < srcSampleEnd) - { - const float x3 = 1.0f; - const float x2 = (float)fract; // x - const float x1 = x2*x2; // x^2 - const float x0 = x1*x2; // x^3 - float y0, y1, y2, y3; - float out0, out1; - - ADM_assert(fract < 1.0); - - y0 = _coeffs[0] * x0 + _coeffs[1] * x1 + _coeffs[2] * x2 + _coeffs[3] * x3; - y1 = _coeffs[4] * x0 + _coeffs[5] * x1 + _coeffs[6] * x2 + _coeffs[7] * x3; - y2 = _coeffs[8] * x0 + _coeffs[9] * x1 + _coeffs[10] * x2 + _coeffs[11] * x3; - y3 = _coeffs[12] * x0 + _coeffs[13] * x1 + _coeffs[14] * x2 + _coeffs[15] * x3; - - out0 = y0 * psrc[0] + y1 * psrc[2] + y2 * psrc[4] + y3 * psrc[6]; - out1 = y0 * psrc[1] + y1 * psrc[3] + y2 * psrc[5] + y3 * psrc[7]; - - pdest[2*i] = (SAMPLETYPE)out0; - pdest[2*i+1] = (SAMPLETYPE)out1; - i ++; - - // update position fraction - fract += rate; - // update whole positions - int whole = (int)fract; - fract -= whole; - psrc += 2*whole; - srcCount += whole; - } - srcSamples = srcCount; - return i; -} - - -/// Transpose multi-channel audio. Returns number of produced output samples, and -/// updates "srcSamples" to amount of consumed source samples -int InterpolateCubic::transposeMulti(SAMPLETYPE *pdest, - const SAMPLETYPE *psrc, - int &srcSamples) -{ - int i; - int srcSampleEnd = srcSamples - 4; - int srcCount = 0; - - i = 0; - while (srcCount < srcSampleEnd) - { - const float x3 = 1.0f; - const float x2 = (float)fract; // x - const float x1 = x2*x2; // x^2 - const float x0 = x1*x2; // x^3 - float y0, y1, y2, y3; - - ADM_assert(fract < 1.0); - - y0 = _coeffs[0] * x0 + _coeffs[1] * x1 + _coeffs[2] * x2 + _coeffs[3] * x3; - y1 = _coeffs[4] * x0 + _coeffs[5] * x1 + _coeffs[6] * x2 + _coeffs[7] * x3; - y2 = _coeffs[8] * x0 + _coeffs[9] * x1 + _coeffs[10] * x2 + _coeffs[11] * x3; - y3 = _coeffs[12] * x0 + _coeffs[13] * x1 + _coeffs[14] * x2 + _coeffs[15] * x3; - - for (int c = 0; c < numChannels; c ++) - { - float out; - out = y0 * psrc[c] + y1 * psrc[c + numChannels] + y2 * psrc[c + 2 * numChannels] + y3 * psrc[c + 3 * numChannels]; - pdest[0] = (SAMPLETYPE)out; - pdest ++; - } - i ++; - - // update position fraction - fract += rate; - // update whole positions - int whole = (int)fract; - fract -= whole; - psrc += numChannels*whole; - srcCount += whole; - } - srcSamples = srcCount; - return i; -} +//////////////////////////////////////////////////////////////////////////////// +/// +/// Cubic interpolation routine. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include "InterpolateCubic.h" +#include "STTypes.h" +#include "ADM_default.h" + +using namespace soundtouch; + +// cubic interpolation coefficients +static const float _coeffs[]= +{ -0.5f, 1.0f, -0.5f, 0.0f, + 1.5f, -2.5f, 0.0f, 1.0f, + -1.5f, 2.0f, 0.5f, 0.0f, + 0.5f, -0.5f, 0.0f, 0.0f}; + + +InterpolateCubic::InterpolateCubic() +{ + fract = 0; +} + + +void InterpolateCubic::resetRegisters() +{ + fract = 0; +} + + +/// Transpose mono audio. Returns number of produced output samples, and +/// updates "srcSamples" to amount of consumed source samples +int InterpolateCubic::transposeMono(SAMPLETYPE *pdest, + const SAMPLETYPE *psrc, + int &srcSamples) +{ + int i; + int srcSampleEnd = srcSamples - 4; + int srcCount = 0; + + i = 0; + while (srcCount < srcSampleEnd) + { + float out; + const float x3 = 1.0f; + const float x2 = (float)fract; // x + const float x1 = x2*x2; // x^2 + const float x0 = x1*x2; // x^3 + float y0, y1, y2, y3; + + ADM_assert(fract < 1.0); + + y0 = _coeffs[0] * x0 + _coeffs[1] * x1 + _coeffs[2] * x2 + _coeffs[3] * x3; + y1 = _coeffs[4] * x0 + _coeffs[5] * x1 + _coeffs[6] * x2 + _coeffs[7] * x3; + y2 = _coeffs[8] * x0 + _coeffs[9] * x1 + _coeffs[10] * x2 + _coeffs[11] * x3; + y3 = _coeffs[12] * x0 + _coeffs[13] * x1 + _coeffs[14] * x2 + _coeffs[15] * x3; + + out = y0 * psrc[0] + y1 * psrc[1] + y2 * psrc[2] + y3 * psrc[3]; + + pdest[i] = (SAMPLETYPE)out; + i ++; + + // update position fraction + fract += rate; + // update whole positions + int whole = (int)fract; + fract -= whole; + psrc += whole; + srcCount += whole; + } + srcSamples = srcCount; + return i; +} + + +/// Transpose stereo audio. Returns number of produced output samples, and +/// updates "srcSamples" to amount of consumed source samples +int InterpolateCubic::transposeStereo(SAMPLETYPE *pdest, + const SAMPLETYPE *psrc, + int &srcSamples) +{ + int i; + int srcSampleEnd = srcSamples - 4; + int srcCount = 0; + + i = 0; + while (srcCount < srcSampleEnd) + { + const float x3 = 1.0f; + const float x2 = (float)fract; // x + const float x1 = x2*x2; // x^2 + const float x0 = x1*x2; // x^3 + float y0, y1, y2, y3; + float out0, out1; + + ADM_assert(fract < 1.0); + + y0 = _coeffs[0] * x0 + _coeffs[1] * x1 + _coeffs[2] * x2 + _coeffs[3] * x3; + y1 = _coeffs[4] * x0 + _coeffs[5] * x1 + _coeffs[6] * x2 + _coeffs[7] * x3; + y2 = _coeffs[8] * x0 + _coeffs[9] * x1 + _coeffs[10] * x2 + _coeffs[11] * x3; + y3 = _coeffs[12] * x0 + _coeffs[13] * x1 + _coeffs[14] * x2 + _coeffs[15] * x3; + + out0 = y0 * psrc[0] + y1 * psrc[2] + y2 * psrc[4] + y3 * psrc[6]; + out1 = y0 * psrc[1] + y1 * psrc[3] + y2 * psrc[5] + y3 * psrc[7]; + + pdest[2*i] = (SAMPLETYPE)out0; + pdest[2*i+1] = (SAMPLETYPE)out1; + i ++; + + // update position fraction + fract += rate; + // update whole positions + int whole = (int)fract; + fract -= whole; + psrc += 2*whole; + srcCount += whole; + } + srcSamples = srcCount; + return i; +} + + +/// Transpose multi-channel audio. Returns number of produced output samples, and +/// updates "srcSamples" to amount of consumed source samples +int InterpolateCubic::transposeMulti(SAMPLETYPE *pdest, + const SAMPLETYPE *psrc, + int &srcSamples) +{ + int i; + int srcSampleEnd = srcSamples - 4; + int srcCount = 0; + + i = 0; + while (srcCount < srcSampleEnd) + { + const float x3 = 1.0f; + const float x2 = (float)fract; // x + const float x1 = x2*x2; // x^2 + const float x0 = x1*x2; // x^3 + float y0, y1, y2, y3; + + ADM_assert(fract < 1.0); + + y0 = _coeffs[0] * x0 + _coeffs[1] * x1 + _coeffs[2] * x2 + _coeffs[3] * x3; + y1 = _coeffs[4] * x0 + _coeffs[5] * x1 + _coeffs[6] * x2 + _coeffs[7] * x3; + y2 = _coeffs[8] * x0 + _coeffs[9] * x1 + _coeffs[10] * x2 + _coeffs[11] * x3; + y3 = _coeffs[12] * x0 + _coeffs[13] * x1 + _coeffs[14] * x2 + _coeffs[15] * x3; + + for (int c = 0; c < numChannels; c ++) + { + float out; + out = y0 * psrc[c] + y1 * psrc[c + numChannels] + y2 * psrc[c + 2 * numChannels] + y3 * psrc[c + 3 * numChannels]; + pdest[0] = (SAMPLETYPE)out; + pdest ++; + } + i ++; + + // update position fraction + fract += rate; + // update whole positions + int whole = (int)fract; + fract -= whole; + psrc += numChannels*whole; + srcCount += whole; + } + srcSamples = srcCount; + return i; +} diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateCubic.h b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateCubic.h index 251c23f14e..d7e9db6498 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateCubic.h +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateCubic.h @@ -1,69 +1,69 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// Cubic interpolation routine. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef _InterpolateCubic_H_ -#define _InterpolateCubic_H_ - -#include "RateTransposer.h" -#include "STTypes.h" - -namespace soundtouch -{ - -class InterpolateCubic : public TransposerBase -{ -protected: - virtual int transposeMono(SAMPLETYPE *dest, - const SAMPLETYPE *src, - int &srcSamples) override; - virtual int transposeStereo(SAMPLETYPE *dest, - const SAMPLETYPE *src, - int &srcSamples) override; - virtual int transposeMulti(SAMPLETYPE *dest, - const SAMPLETYPE *src, - int &srcSamples) override; - - double fract; - -public: - InterpolateCubic(); - - virtual void resetRegisters() override; - - int getLatency() const - { - return 1; - } -}; - -} - -#endif +//////////////////////////////////////////////////////////////////////////////// +/// +/// Cubic interpolation routine. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef _InterpolateCubic_H_ +#define _InterpolateCubic_H_ + +#include "RateTransposer.h" +#include "STTypes.h" + +namespace soundtouch +{ + +class InterpolateCubic : public TransposerBase +{ +protected: + virtual int transposeMono(SAMPLETYPE *dest, + const SAMPLETYPE *src, + int &srcSamples) override; + virtual int transposeStereo(SAMPLETYPE *dest, + const SAMPLETYPE *src, + int &srcSamples) override; + virtual int transposeMulti(SAMPLETYPE *dest, + const SAMPLETYPE *src, + int &srcSamples) override; + + double fract; + +public: + InterpolateCubic(); + + virtual void resetRegisters() override; + + int getLatency() const + { + return 1; + } +}; + +} + +#endif diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateLinear.cpp b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateLinear.cpp index e727f9f987..d6ba01770d 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateLinear.cpp +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateLinear.cpp @@ -1,296 +1,296 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// Linear interpolation algorithm. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#include "ADM_default.h" -#include -#include "InterpolateLinear.h" - -using namespace soundtouch; - -////////////////////////////////////////////////////////////////////////////// -// -// InterpolateLinearInteger - integer arithmetic implementation -// - -/// fixed-point interpolation routine precision -#define SCALE 65536 - - -// Constructor -InterpolateLinearInteger::InterpolateLinearInteger() : TransposerBase() -{ - // Notice: use local function calling syntax for sake of clarity, - // to indicate the fact that C++ constructor can't call virtual functions. - resetRegisters(); - setRate(1.0f); -} - - -void InterpolateLinearInteger::resetRegisters() -{ - iFract = 0; -} - - -// Transposes the sample rate of the given samples using linear interpolation. -// 'Mono' version of the routine. Returns the number of samples returned in -// the "dest" buffer -int InterpolateLinearInteger::transposeMono(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) -{ - int i; - int srcSampleEnd = srcSamples - 1; - int srcCount = 0; - - i = 0; - while (srcCount < srcSampleEnd) - { - LONG_SAMPLETYPE temp; - - ADM_assert(iFract < SCALE); - - temp = (SCALE - iFract) * src[0] + iFract * src[1]; - dest[i] = (SAMPLETYPE)(temp / SCALE); - i++; - - iFract += iRate; - - int iWhole = iFract / SCALE; - iFract -= iWhole * SCALE; - srcCount += iWhole; - src += iWhole; - } - srcSamples = srcCount; - - return i; -} - - -// Transposes the sample rate of the given samples using linear interpolation. -// 'Stereo' version of the routine. Returns the number of samples returned in -// the "dest" buffer -int InterpolateLinearInteger::transposeStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) -{ - int i; - int srcSampleEnd = srcSamples - 1; - int srcCount = 0; - - i = 0; - while (srcCount < srcSampleEnd) - { - LONG_SAMPLETYPE temp0; - LONG_SAMPLETYPE temp1; - - ADM_assert(iFract < SCALE); - - temp0 = (SCALE - iFract) * src[0] + iFract * src[2]; - temp1 = (SCALE - iFract) * src[1] + iFract * src[3]; - dest[0] = (SAMPLETYPE)(temp0 / SCALE); - dest[1] = (SAMPLETYPE)(temp1 / SCALE); - dest += 2; - i++; - - iFract += iRate; - - int iWhole = iFract / SCALE; - iFract -= iWhole * SCALE; - srcCount += iWhole; - src += 2*iWhole; - } - srcSamples = srcCount; - - return i; -} - - -int InterpolateLinearInteger::transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) -{ - int i; - int srcSampleEnd = srcSamples - 1; - int srcCount = 0; - - i = 0; - while (srcCount < srcSampleEnd) - { - LONG_SAMPLETYPE temp, vol1; - - ADM_assert(iFract < SCALE); - vol1 = (LONG_SAMPLETYPE)(SCALE - iFract); - for (int c = 0; c < numChannels; c ++) - { - temp = vol1 * src[c] + iFract * src[c + numChannels]; - dest[0] = (SAMPLETYPE)(temp / SCALE); - dest ++; - } - i++; - - iFract += iRate; - - int iWhole = iFract / SCALE; - iFract -= iWhole * SCALE; - srcCount += iWhole; - src += iWhole * numChannels; - } - srcSamples = srcCount; - - return i; -} - - -// Sets new target iRate. Normal iRate = 1.0, smaller values represent slower -// iRate, larger faster iRates. -void InterpolateLinearInteger::setRate(double newRate) -{ - iRate = (int)(newRate * SCALE + 0.5); - TransposerBase::setRate(newRate); -} - - -////////////////////////////////////////////////////////////////////////////// -// -// InterpolateLinearFloat - floating point arithmetic implementation -// -////////////////////////////////////////////////////////////////////////////// - - -// Constructor -InterpolateLinearFloat::InterpolateLinearFloat() : TransposerBase() -{ - // Notice: use local function calling syntax for sake of clarity, - // to indicate the fact that C++ constructor can't call virtual functions. - resetRegisters(); - setRate(1.0); -} - - -void InterpolateLinearFloat::resetRegisters() -{ - fract = 0; -} - - -// Transposes the sample rate of the given samples using linear interpolation. -// 'Mono' version of the routine. Returns the number of samples returned in -// the "dest" buffer -int InterpolateLinearFloat::transposeMono(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) -{ - int i; - int srcSampleEnd = srcSamples - 1; - int srcCount = 0; - - i = 0; - while (srcCount < srcSampleEnd) - { - double out; - ADM_assert(fract < 1.0); - - out = (1.0 - fract) * src[0] + fract * src[1]; - dest[i] = (SAMPLETYPE)out; - i ++; - - // update position fraction - fract += rate; - // update whole positions - int whole = (int)fract; - fract -= whole; - src += whole; - srcCount += whole; - } - srcSamples = srcCount; - return i; -} - - -// Transposes the sample rate of the given samples using linear interpolation. -// 'Mono' version of the routine. Returns the number of samples returned in -// the "dest" buffer -int InterpolateLinearFloat::transposeStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) -{ - int i; - int srcSampleEnd = srcSamples - 1; - int srcCount = 0; - - i = 0; - while (srcCount < srcSampleEnd) - { - double out0, out1; - ADM_assert(fract < 1.0); - - out0 = (1.0 - fract) * src[0] + fract * src[2]; - out1 = (1.0 - fract) * src[1] + fract * src[3]; - dest[2*i] = (SAMPLETYPE)out0; - dest[2*i+1] = (SAMPLETYPE)out1; - i ++; - - // update position fraction - fract += rate; - // update whole positions - int whole = (int)fract; - fract -= whole; - src += 2*whole; - srcCount += whole; - } - srcSamples = srcCount; - return i; -} - - -int InterpolateLinearFloat::transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) -{ - int i; - int srcSampleEnd = srcSamples - 1; - int srcCount = 0; - - i = 0; - while (srcCount < srcSampleEnd) - { - float temp, vol1, fract_float; - - vol1 = (float)(1.0 - fract); - fract_float = (float)fract; - for (int c = 0; c < numChannels; c ++) - { - temp = vol1 * src[c] + fract_float * src[c + numChannels]; - *dest = (SAMPLETYPE)temp; - dest ++; - } - i++; - - fract += rate; - - int iWhole = (int)fract; - fract -= iWhole; - srcCount += iWhole; - src += iWhole * numChannels; - } - srcSamples = srcCount; - - return i; -} +//////////////////////////////////////////////////////////////////////////////// +/// +/// Linear interpolation algorithm. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#include "ADM_default.h" +#include +#include "InterpolateLinear.h" + +using namespace soundtouch; + +////////////////////////////////////////////////////////////////////////////// +// +// InterpolateLinearInteger - integer arithmetic implementation +// + +/// fixed-point interpolation routine precision +#define SCALE 65536 + + +// Constructor +InterpolateLinearInteger::InterpolateLinearInteger() : TransposerBase() +{ + // Notice: use local function calling syntax for sake of clarity, + // to indicate the fact that C++ constructor can't call virtual functions. + resetRegisters(); + setRate(1.0f); +} + + +void InterpolateLinearInteger::resetRegisters() +{ + iFract = 0; +} + + +// Transposes the sample rate of the given samples using linear interpolation. +// 'Mono' version of the routine. Returns the number of samples returned in +// the "dest" buffer +int InterpolateLinearInteger::transposeMono(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) +{ + int i; + int srcSampleEnd = srcSamples - 1; + int srcCount = 0; + + i = 0; + while (srcCount < srcSampleEnd) + { + LONG_SAMPLETYPE temp; + + ADM_assert(iFract < SCALE); + + temp = (SCALE - iFract) * src[0] + iFract * src[1]; + dest[i] = (SAMPLETYPE)(temp / SCALE); + i++; + + iFract += iRate; + + int iWhole = iFract / SCALE; + iFract -= iWhole * SCALE; + srcCount += iWhole; + src += iWhole; + } + srcSamples = srcCount; + + return i; +} + + +// Transposes the sample rate of the given samples using linear interpolation. +// 'Stereo' version of the routine. Returns the number of samples returned in +// the "dest" buffer +int InterpolateLinearInteger::transposeStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) +{ + int i; + int srcSampleEnd = srcSamples - 1; + int srcCount = 0; + + i = 0; + while (srcCount < srcSampleEnd) + { + LONG_SAMPLETYPE temp0; + LONG_SAMPLETYPE temp1; + + ADM_assert(iFract < SCALE); + + temp0 = (SCALE - iFract) * src[0] + iFract * src[2]; + temp1 = (SCALE - iFract) * src[1] + iFract * src[3]; + dest[0] = (SAMPLETYPE)(temp0 / SCALE); + dest[1] = (SAMPLETYPE)(temp1 / SCALE); + dest += 2; + i++; + + iFract += iRate; + + int iWhole = iFract / SCALE; + iFract -= iWhole * SCALE; + srcCount += iWhole; + src += 2*iWhole; + } + srcSamples = srcCount; + + return i; +} + + +int InterpolateLinearInteger::transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) +{ + int i; + int srcSampleEnd = srcSamples - 1; + int srcCount = 0; + + i = 0; + while (srcCount < srcSampleEnd) + { + LONG_SAMPLETYPE temp, vol1; + + ADM_assert(iFract < SCALE); + vol1 = (LONG_SAMPLETYPE)(SCALE - iFract); + for (int c = 0; c < numChannels; c ++) + { + temp = vol1 * src[c] + iFract * src[c + numChannels]; + dest[0] = (SAMPLETYPE)(temp / SCALE); + dest ++; + } + i++; + + iFract += iRate; + + int iWhole = iFract / SCALE; + iFract -= iWhole * SCALE; + srcCount += iWhole; + src += iWhole * numChannels; + } + srcSamples = srcCount; + + return i; +} + + +// Sets new target iRate. Normal iRate = 1.0, smaller values represent slower +// iRate, larger faster iRates. +void InterpolateLinearInteger::setRate(double newRate) +{ + iRate = (int)(newRate * SCALE + 0.5); + TransposerBase::setRate(newRate); +} + + +////////////////////////////////////////////////////////////////////////////// +// +// InterpolateLinearFloat - floating point arithmetic implementation +// +////////////////////////////////////////////////////////////////////////////// + + +// Constructor +InterpolateLinearFloat::InterpolateLinearFloat() : TransposerBase() +{ + // Notice: use local function calling syntax for sake of clarity, + // to indicate the fact that C++ constructor can't call virtual functions. + resetRegisters(); + setRate(1.0); +} + + +void InterpolateLinearFloat::resetRegisters() +{ + fract = 0; +} + + +// Transposes the sample rate of the given samples using linear interpolation. +// 'Mono' version of the routine. Returns the number of samples returned in +// the "dest" buffer +int InterpolateLinearFloat::transposeMono(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) +{ + int i; + int srcSampleEnd = srcSamples - 1; + int srcCount = 0; + + i = 0; + while (srcCount < srcSampleEnd) + { + double out; + ADM_assert(fract < 1.0); + + out = (1.0 - fract) * src[0] + fract * src[1]; + dest[i] = (SAMPLETYPE)out; + i ++; + + // update position fraction + fract += rate; + // update whole positions + int whole = (int)fract; + fract -= whole; + src += whole; + srcCount += whole; + } + srcSamples = srcCount; + return i; +} + + +// Transposes the sample rate of the given samples using linear interpolation. +// 'Mono' version of the routine. Returns the number of samples returned in +// the "dest" buffer +int InterpolateLinearFloat::transposeStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) +{ + int i; + int srcSampleEnd = srcSamples - 1; + int srcCount = 0; + + i = 0; + while (srcCount < srcSampleEnd) + { + double out0, out1; + ADM_assert(fract < 1.0); + + out0 = (1.0 - fract) * src[0] + fract * src[2]; + out1 = (1.0 - fract) * src[1] + fract * src[3]; + dest[2*i] = (SAMPLETYPE)out0; + dest[2*i+1] = (SAMPLETYPE)out1; + i ++; + + // update position fraction + fract += rate; + // update whole positions + int whole = (int)fract; + fract -= whole; + src += 2*whole; + srcCount += whole; + } + srcSamples = srcCount; + return i; +} + + +int InterpolateLinearFloat::transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) +{ + int i; + int srcSampleEnd = srcSamples - 1; + int srcCount = 0; + + i = 0; + while (srcCount < srcSampleEnd) + { + float temp, vol1, fract_float; + + vol1 = (float)(1.0 - fract); + fract_float = (float)fract; + for (int c = 0; c < numChannels; c ++) + { + temp = vol1 * src[c] + fract_float * src[c + numChannels]; + *dest = (SAMPLETYPE)temp; + dest ++; + } + i++; + + fract += rate; + + int iWhole = (int)fract; + fract -= iWhole; + srcCount += iWhole; + src += iWhole * numChannels; + } + srcSamples = srcCount; + + return i; +} diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateLinear.h b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateLinear.h index 6104faeab5..e31340ce33 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateLinear.h +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateLinear.h @@ -1,98 +1,98 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// Linear interpolation routine. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef _InterpolateLinear_H_ -#define _InterpolateLinear_H_ - -#include "RateTransposer.h" -#include "STTypes.h" - -namespace soundtouch -{ - -/// Linear transposer class that uses integer arithmetic -class InterpolateLinearInteger : public TransposerBase -{ -protected: - int iFract; - int iRate; - - virtual int transposeMono(SAMPLETYPE *dest, - const SAMPLETYPE *src, - int &srcSamples) override; - virtual int transposeStereo(SAMPLETYPE *dest, - const SAMPLETYPE *src, - int &srcSamples) override; - virtual int transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) override; -public: - InterpolateLinearInteger(); - - /// Sets new target rate. Normal rate = 1.0, smaller values represent slower - /// rate, larger faster rates. - virtual void setRate(double newRate) override; - - virtual void resetRegisters() override; - - int getLatency() const - { - return 0; - } -}; - - -/// Linear transposer class that uses floating point arithmetic -class InterpolateLinearFloat : public TransposerBase -{ -protected: - double fract; - - virtual int transposeMono(SAMPLETYPE *dest, - const SAMPLETYPE *src, - int &srcSamples); - virtual int transposeStereo(SAMPLETYPE *dest, - const SAMPLETYPE *src, - int &srcSamples); - virtual int transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples); - -public: - InterpolateLinearFloat(); - - virtual void resetRegisters(); - - int getLatency() const - { - return 0; - } -}; - -} - -#endif +//////////////////////////////////////////////////////////////////////////////// +/// +/// Linear interpolation routine. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef _InterpolateLinear_H_ +#define _InterpolateLinear_H_ + +#include "RateTransposer.h" +#include "STTypes.h" + +namespace soundtouch +{ + +/// Linear transposer class that uses integer arithmetic +class InterpolateLinearInteger : public TransposerBase +{ +protected: + int iFract; + int iRate; + + virtual int transposeMono(SAMPLETYPE *dest, + const SAMPLETYPE *src, + int &srcSamples) override; + virtual int transposeStereo(SAMPLETYPE *dest, + const SAMPLETYPE *src, + int &srcSamples) override; + virtual int transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples) override; +public: + InterpolateLinearInteger(); + + /// Sets new target rate. Normal rate = 1.0, smaller values represent slower + /// rate, larger faster rates. + virtual void setRate(double newRate) override; + + virtual void resetRegisters() override; + + int getLatency() const + { + return 0; + } +}; + + +/// Linear transposer class that uses floating point arithmetic +class InterpolateLinearFloat : public TransposerBase +{ +protected: + double fract; + + virtual int transposeMono(SAMPLETYPE *dest, + const SAMPLETYPE *src, + int &srcSamples); + virtual int transposeStereo(SAMPLETYPE *dest, + const SAMPLETYPE *src, + int &srcSamples); + virtual int transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples); + +public: + InterpolateLinearFloat(); + + virtual void resetRegisters(); + + int getLatency() const + { + return 0; + } +}; + +} + +#endif diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateShannon.cpp b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateShannon.cpp index fa253f8ad5..d7e80993ed 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateShannon.cpp +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateShannon.cpp @@ -1,182 +1,182 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// Sample interpolation routine using 8-tap band-limited Shannon interpolation -/// with kaiser window. -/// -/// Notice. This algorithm is remarkably much heavier than linear or cubic -/// interpolation, and not remarkably better than cubic algorithm. Thus mostly -/// for experimental purposes -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#include -#include "InterpolateShannon.h" -#include "STTypes.h" -#include "ADM_default.h" - -using namespace soundtouch; - - -/// Kaiser window with beta = 2.0 -/// Values scaled down by 5% to avoid overflows -static const double _kaiser8[8] = -{ - 0.41778693317814, - 0.64888025049173, - 0.83508562409944, - 0.93887857733412, - 0.93887857733412, - 0.83508562409944, - 0.64888025049173, - 0.41778693317814 -}; - - -InterpolateShannon::InterpolateShannon() -{ - fract = 0; -} - - -void InterpolateShannon::resetRegisters() -{ - fract = 0; -} - - -#define PI 3.1415926536 -#define sinc(x) (sin(PI * (x)) / (PI * (x))) - -/// Transpose mono audio. Returns number of produced output samples, and -/// updates "srcSamples" to amount of consumed source samples -int InterpolateShannon::transposeMono(SAMPLETYPE *pdest, - const SAMPLETYPE *psrc, - int &srcSamples) -{ - int i; - int srcSampleEnd = srcSamples - 8; - int srcCount = 0; - - i = 0; - while (srcCount < srcSampleEnd) - { - double out; - ADM_assert(fract < 1.0); - - out = psrc[0] * sinc(-3.0 - fract) * _kaiser8[0]; - out += psrc[1] * sinc(-2.0 - fract) * _kaiser8[1]; - out += psrc[2] * sinc(-1.0 - fract) * _kaiser8[2]; - if (fract < 1e-6) - { - out += psrc[3] * _kaiser8[3]; // sinc(0) = 1 - } - else - { - out += psrc[3] * sinc(- fract) * _kaiser8[3]; - } - out += psrc[4] * sinc( 1.0 - fract) * _kaiser8[4]; - out += psrc[5] * sinc( 2.0 - fract) * _kaiser8[5]; - out += psrc[6] * sinc( 3.0 - fract) * _kaiser8[6]; - out += psrc[7] * sinc( 4.0 - fract) * _kaiser8[7]; - - pdest[i] = (SAMPLETYPE)out; - i ++; - - // update position fraction - fract += rate; - // update whole positions - int whole = (int)fract; - fract -= whole; - psrc += whole; - srcCount += whole; - } - srcSamples = srcCount; - return i; -} - - -/// Transpose stereo audio. Returns number of produced output samples, and -/// updates "srcSamples" to amount of consumed source samples -int InterpolateShannon::transposeStereo(SAMPLETYPE *pdest, - const SAMPLETYPE *psrc, - int &srcSamples) -{ - int i; - int srcSampleEnd = srcSamples - 8; - int srcCount = 0; - - i = 0; - while (srcCount < srcSampleEnd) - { - double out0, out1, w; - ADM_assert(fract < 1.0); - - w = sinc(-3.0 - fract) * _kaiser8[0]; - out0 = psrc[0] * w; out1 = psrc[1] * w; - w = sinc(-2.0 - fract) * _kaiser8[1]; - out0 += psrc[2] * w; out1 += psrc[3] * w; - w = sinc(-1.0 - fract) * _kaiser8[2]; - out0 += psrc[4] * w; out1 += psrc[5] * w; - w = _kaiser8[3] * ((fract < 1e-5) ? 1.0 : sinc(- fract)); // sinc(0) = 1 - out0 += psrc[6] * w; out1 += psrc[7] * w; - w = sinc( 1.0 - fract) * _kaiser8[4]; - out0 += psrc[8] * w; out1 += psrc[9] * w; - w = sinc( 2.0 - fract) * _kaiser8[5]; - out0 += psrc[10] * w; out1 += psrc[11] * w; - w = sinc( 3.0 - fract) * _kaiser8[6]; - out0 += psrc[12] * w; out1 += psrc[13] * w; - w = sinc( 4.0 - fract) * _kaiser8[7]; - out0 += psrc[14] * w; out1 += psrc[15] * w; - - pdest[2*i] = (SAMPLETYPE)out0; - pdest[2*i+1] = (SAMPLETYPE)out1; - i ++; - - // update position fraction - fract += rate; - // update whole positions - int whole = (int)fract; - fract -= whole; - psrc += 2*whole; - srcCount += whole; - } - srcSamples = srcCount; - return i; -} - - -/// Transpose stereo audio. Returns number of produced output samples, and -/// updates "srcSamples" to amount of consumed source samples -int InterpolateShannon::transposeMulti(SAMPLETYPE *pdest, - const SAMPLETYPE *psrc, - int &srcSamples) -{ - // not implemented - ADM_assert(false); - return 0; -} +//////////////////////////////////////////////////////////////////////////////// +/// +/// Sample interpolation routine using 8-tap band-limited Shannon interpolation +/// with kaiser window. +/// +/// Notice. This algorithm is remarkably much heavier than linear or cubic +/// interpolation, and not remarkably better than cubic algorithm. Thus mostly +/// for experimental purposes +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include "InterpolateShannon.h" +#include "STTypes.h" +#include "ADM_default.h" + +using namespace soundtouch; + + +/// Kaiser window with beta = 2.0 +/// Values scaled down by 5% to avoid overflows +static const double _kaiser8[8] = +{ + 0.41778693317814, + 0.64888025049173, + 0.83508562409944, + 0.93887857733412, + 0.93887857733412, + 0.83508562409944, + 0.64888025049173, + 0.41778693317814 +}; + + +InterpolateShannon::InterpolateShannon() +{ + fract = 0; +} + + +void InterpolateShannon::resetRegisters() +{ + fract = 0; +} + + +#define PI 3.1415926536 +#define sinc(x) (sin(PI * (x)) / (PI * (x))) + +/// Transpose mono audio. Returns number of produced output samples, and +/// updates "srcSamples" to amount of consumed source samples +int InterpolateShannon::transposeMono(SAMPLETYPE *pdest, + const SAMPLETYPE *psrc, + int &srcSamples) +{ + int i; + int srcSampleEnd = srcSamples - 8; + int srcCount = 0; + + i = 0; + while (srcCount < srcSampleEnd) + { + double out; + ADM_assert(fract < 1.0); + + out = psrc[0] * sinc(-3.0 - fract) * _kaiser8[0]; + out += psrc[1] * sinc(-2.0 - fract) * _kaiser8[1]; + out += psrc[2] * sinc(-1.0 - fract) * _kaiser8[2]; + if (fract < 1e-6) + { + out += psrc[3] * _kaiser8[3]; // sinc(0) = 1 + } + else + { + out += psrc[3] * sinc(- fract) * _kaiser8[3]; + } + out += psrc[4] * sinc( 1.0 - fract) * _kaiser8[4]; + out += psrc[5] * sinc( 2.0 - fract) * _kaiser8[5]; + out += psrc[6] * sinc( 3.0 - fract) * _kaiser8[6]; + out += psrc[7] * sinc( 4.0 - fract) * _kaiser8[7]; + + pdest[i] = (SAMPLETYPE)out; + i ++; + + // update position fraction + fract += rate; + // update whole positions + int whole = (int)fract; + fract -= whole; + psrc += whole; + srcCount += whole; + } + srcSamples = srcCount; + return i; +} + + +/// Transpose stereo audio. Returns number of produced output samples, and +/// updates "srcSamples" to amount of consumed source samples +int InterpolateShannon::transposeStereo(SAMPLETYPE *pdest, + const SAMPLETYPE *psrc, + int &srcSamples) +{ + int i; + int srcSampleEnd = srcSamples - 8; + int srcCount = 0; + + i = 0; + while (srcCount < srcSampleEnd) + { + double out0, out1, w; + ADM_assert(fract < 1.0); + + w = sinc(-3.0 - fract) * _kaiser8[0]; + out0 = psrc[0] * w; out1 = psrc[1] * w; + w = sinc(-2.0 - fract) * _kaiser8[1]; + out0 += psrc[2] * w; out1 += psrc[3] * w; + w = sinc(-1.0 - fract) * _kaiser8[2]; + out0 += psrc[4] * w; out1 += psrc[5] * w; + w = _kaiser8[3] * ((fract < 1e-5) ? 1.0 : sinc(- fract)); // sinc(0) = 1 + out0 += psrc[6] * w; out1 += psrc[7] * w; + w = sinc( 1.0 - fract) * _kaiser8[4]; + out0 += psrc[8] * w; out1 += psrc[9] * w; + w = sinc( 2.0 - fract) * _kaiser8[5]; + out0 += psrc[10] * w; out1 += psrc[11] * w; + w = sinc( 3.0 - fract) * _kaiser8[6]; + out0 += psrc[12] * w; out1 += psrc[13] * w; + w = sinc( 4.0 - fract) * _kaiser8[7]; + out0 += psrc[14] * w; out1 += psrc[15] * w; + + pdest[2*i] = (SAMPLETYPE)out0; + pdest[2*i+1] = (SAMPLETYPE)out1; + i ++; + + // update position fraction + fract += rate; + // update whole positions + int whole = (int)fract; + fract -= whole; + psrc += 2*whole; + srcCount += whole; + } + srcSamples = srcCount; + return i; +} + + +/// Transpose stereo audio. Returns number of produced output samples, and +/// updates "srcSamples" to amount of consumed source samples +int InterpolateShannon::transposeMulti(SAMPLETYPE *pdest, + const SAMPLETYPE *psrc, + int &srcSamples) +{ + // not implemented + ADM_assert(false); + return 0; +} diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateShannon.h b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateShannon.h index 75876e127c..332059df42 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateShannon.h +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/InterpolateShannon.h @@ -1,74 +1,74 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// Sample interpolation routine using 8-tap band-limited Shannon interpolation -/// with kaiser window. -/// -/// Notice. This algorithm is remarkably much heavier than linear or cubic -/// interpolation, and not remarkably better than cubic algorithm. Thus mostly -/// for experimental purposes -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef _InterpolateShannon_H_ -#define _InterpolateShannon_H_ - -#include "RateTransposer.h" -#include "STTypes.h" - -namespace soundtouch -{ - -class InterpolateShannon : public TransposerBase -{ -protected: - int transposeMono(SAMPLETYPE *dest, - const SAMPLETYPE *src, - int &srcSamples) override; - int transposeStereo(SAMPLETYPE *dest, - const SAMPLETYPE *src, - int &srcSamples) override; - int transposeMulti(SAMPLETYPE *dest, - const SAMPLETYPE *src, - int &srcSamples) override; - - double fract; - -public: - InterpolateShannon(); - - void resetRegisters() override; - - int getLatency() const - { - return 3; - } -}; - -} - -#endif +//////////////////////////////////////////////////////////////////////////////// +/// +/// Sample interpolation routine using 8-tap band-limited Shannon interpolation +/// with kaiser window. +/// +/// Notice. This algorithm is remarkably much heavier than linear or cubic +/// interpolation, and not remarkably better than cubic algorithm. Thus mostly +/// for experimental purposes +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef _InterpolateShannon_H_ +#define _InterpolateShannon_H_ + +#include "RateTransposer.h" +#include "STTypes.h" + +namespace soundtouch +{ + +class InterpolateShannon : public TransposerBase +{ +protected: + int transposeMono(SAMPLETYPE *dest, + const SAMPLETYPE *src, + int &srcSamples) override; + int transposeStereo(SAMPLETYPE *dest, + const SAMPLETYPE *src, + int &srcSamples) override; + int transposeMulti(SAMPLETYPE *dest, + const SAMPLETYPE *src, + int &srcSamples) override; + + double fract; + +public: + InterpolateShannon(); + + void resetRegisters() override; + + int getLatency() const + { + return 3; + } +}; + +} + +#endif diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/PeakFinder.cpp b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/PeakFinder.cpp index a3a81602fe..66f2f3eeaa 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/PeakFinder.cpp +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/PeakFinder.cpp @@ -1,277 +1,277 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// Peak detection routine. -/// -/// The routine detects highest value on an array of values and calculates the -/// precise peak location as a mass-center of the 'hump' around the peak value. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#include -#include "ADM_default.h" - -#include "PeakFinder.h" - -using namespace soundtouch; - -#define max(x, y) (((x) > (y)) ? (x) : (y)) - - -PeakFinder::PeakFinder() -{ - minPos = maxPos = 0; -} - - -// Finds real 'top' of a peak hump from neighnourhood of the given 'peakpos'. -int PeakFinder::findTop(const float *data, int peakpos) const -{ - int i; - int start, end; - float refvalue; - - refvalue = data[peakpos]; - - // seek within ±10 points - start = peakpos - 10; - if (start < minPos) start = minPos; - end = peakpos + 10; - if (end > maxPos) end = maxPos; - - for (i = start; i <= end; i ++) - { - if (data[i] > refvalue) - { - peakpos = i; - refvalue = data[i]; - } - } - - // failure if max value is at edges of seek range => it's not peak, it's at slope. - if ((peakpos == start) || (peakpos == end)) return 0; - - return peakpos; -} - - -// Finds 'ground level' of a peak hump by starting from 'peakpos' and proceeding -// to direction defined by 'direction' until next 'hump' after minimum value will -// begin -int PeakFinder::findGround(const float *data, int peakpos, int direction) const -{ - int lowpos; - int pos; - int climb_count; - float refvalue; - float delta; - - climb_count = 0; - refvalue = data[peakpos]; - lowpos = peakpos; - - pos = peakpos; - - while ((pos > minPos+1) && (pos < maxPos-1)) - { - int prevpos; - - prevpos = pos; - pos += direction; - - // calculate derivate - delta = data[pos] - data[prevpos]; - if (delta <= 0) - { - // going downhill, ok - if (climb_count) - { - climb_count --; // decrease climb count - } - - // check if new minimum found - if (data[pos] < refvalue) - { - // new minimum found - lowpos = pos; - refvalue = data[pos]; - } - } - else - { - // going uphill, increase climbing counter - climb_count ++; - if (climb_count > 5) break; // we've been climbing too long => it's next uphill => quit - } - } - return lowpos; -} - - -// Find offset where the value crosses the given level, when starting from 'peakpos' and -// proceeds to direction defined in 'direction' -int PeakFinder::findCrossingLevel(const float *data, float level, int peakpos, int direction) const -{ - float peaklevel; - int pos; - - peaklevel = data[peakpos]; - ADM_assert(peaklevel >= level); - pos = peakpos; - while ((pos >= minPos) && (pos + direction < maxPos)) - { - if (data[pos + direction] < level) return pos; // crossing found - pos += direction; - } - return -1; // not found -} - - -// Calculates the center of mass location of 'data' array items between 'firstPos' and 'lastPos' -double PeakFinder::calcMassCenter(const float *data, int firstPos, int lastPos) const -{ - int i; - float sum; - float wsum; - - sum = 0; - wsum = 0; - for (i = firstPos; i <= lastPos; i ++) - { - sum += (float)i * data[i]; - wsum += data[i]; - } - - if (wsum < 1e-6) return 0; - return sum / wsum; -} - - -/// get exact center of peak near given position by calculating local mass of center -double PeakFinder::getPeakCenter(const float *data, int peakpos) const -{ - float peakLevel; // peak level - int crosspos1, crosspos2; // position where the peak 'hump' crosses cutting level - float cutLevel; // cutting value - float groundLevel; // ground level of the peak - int gp1, gp2; // bottom positions of the peak 'hump' - - // find ground positions. - gp1 = findGround(data, peakpos, -1); - gp2 = findGround(data, peakpos, 1); - - peakLevel = data[peakpos]; - - if (gp1 == gp2) - { - // avoid rounding errors when all are equal - ADM_assert(gp1 == peakpos); - cutLevel = groundLevel = peakLevel; - } else { - // get average of the ground levels - groundLevel = 0.5f * (data[gp1] + data[gp2]); - - // calculate 70%-level of the peak - cutLevel = 0.70f * peakLevel + 0.30f * groundLevel; - } - - // find mid-level crossings - crosspos1 = findCrossingLevel(data, cutLevel, peakpos, -1); - crosspos2 = findCrossingLevel(data, cutLevel, peakpos, 1); - - if ((crosspos1 < 0) || (crosspos2 < 0)) return 0; // no crossing, no peak.. - - // calculate mass center of the peak surroundings - return calcMassCenter(data, crosspos1, crosspos2); -} - - -double PeakFinder::detectPeak(const float *data, int aminPos, int amaxPos) -{ - - int i; - int peakpos; // position of peak level - double highPeak, peak; - - this->minPos = aminPos; - this->maxPos = amaxPos; - - // find absolute peak - peakpos = minPos; - peak = data[minPos]; - for (i = minPos + 1; i < maxPos; i ++) - { - if (data[i] > peak) - { - peak = data[i]; - peakpos = i; - } - } - - // Calculate exact location of the highest peak mass center - highPeak = getPeakCenter(data, peakpos); - peak = highPeak; - - // Now check if the highest peak were in fact harmonic of the true base beat peak - // - sometimes the highest peak can be Nth harmonic of the true base peak yet - // just a slightly higher than the true base - - for (i = 1; i < 3; i ++) - { - double peaktmp, harmonic; - int i1,i2; - - harmonic = (double)pow(2.0, i); - peakpos = (int)(highPeak / harmonic + 0.5f); - if (peakpos < minPos) break; - peakpos = findTop(data, peakpos); // seek true local maximum index - if (peakpos == 0) continue; // no local max here - - // calculate mass-center of possible harmonic peak - peaktmp = getPeakCenter(data, peakpos); - - // accept harmonic peak if - // (a) it is found - // (b) is within ±4% of the expected harmonic interval - // (c) has at least half x-corr value of the max. peak - - double diff = harmonic * peaktmp / highPeak; - if ((diff < 0.96) || (diff > 1.04)) continue; // peak too afar from expected - - // now compare to highest detected peak - i1 = (int)(highPeak + 0.5); - i2 = (int)(peaktmp + 0.5); - if (data[i2] >= 0.4*data[i1]) - { - // The harmonic is at least half as high primary peak, - // thus use the harmonic peak instead - peak = peaktmp; - } - } - - return peak; -} +//////////////////////////////////////////////////////////////////////////////// +/// +/// Peak detection routine. +/// +/// The routine detects highest value on an array of values and calculates the +/// precise peak location as a mass-center of the 'hump' around the peak value. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include "ADM_default.h" + +#include "PeakFinder.h" + +using namespace soundtouch; + +#define max(x, y) (((x) > (y)) ? (x) : (y)) + + +PeakFinder::PeakFinder() +{ + minPos = maxPos = 0; +} + + +// Finds real 'top' of a peak hump from neighnourhood of the given 'peakpos'. +int PeakFinder::findTop(const float *data, int peakpos) const +{ + int i; + int start, end; + float refvalue; + + refvalue = data[peakpos]; + + // seek within ±10 points + start = peakpos - 10; + if (start < minPos) start = minPos; + end = peakpos + 10; + if (end > maxPos) end = maxPos; + + for (i = start; i <= end; i ++) + { + if (data[i] > refvalue) + { + peakpos = i; + refvalue = data[i]; + } + } + + // failure if max value is at edges of seek range => it's not peak, it's at slope. + if ((peakpos == start) || (peakpos == end)) return 0; + + return peakpos; +} + + +// Finds 'ground level' of a peak hump by starting from 'peakpos' and proceeding +// to direction defined by 'direction' until next 'hump' after minimum value will +// begin +int PeakFinder::findGround(const float *data, int peakpos, int direction) const +{ + int lowpos; + int pos; + int climb_count; + float refvalue; + float delta; + + climb_count = 0; + refvalue = data[peakpos]; + lowpos = peakpos; + + pos = peakpos; + + while ((pos > minPos+1) && (pos < maxPos-1)) + { + int prevpos; + + prevpos = pos; + pos += direction; + + // calculate derivate + delta = data[pos] - data[prevpos]; + if (delta <= 0) + { + // going downhill, ok + if (climb_count) + { + climb_count --; // decrease climb count + } + + // check if new minimum found + if (data[pos] < refvalue) + { + // new minimum found + lowpos = pos; + refvalue = data[pos]; + } + } + else + { + // going uphill, increase climbing counter + climb_count ++; + if (climb_count > 5) break; // we've been climbing too long => it's next uphill => quit + } + } + return lowpos; +} + + +// Find offset where the value crosses the given level, when starting from 'peakpos' and +// proceeds to direction defined in 'direction' +int PeakFinder::findCrossingLevel(const float *data, float level, int peakpos, int direction) const +{ + float peaklevel; + int pos; + + peaklevel = data[peakpos]; + ADM_assert(peaklevel >= level); + pos = peakpos; + while ((pos >= minPos) && (pos + direction < maxPos)) + { + if (data[pos + direction] < level) return pos; // crossing found + pos += direction; + } + return -1; // not found +} + + +// Calculates the center of mass location of 'data' array items between 'firstPos' and 'lastPos' +double PeakFinder::calcMassCenter(const float *data, int firstPos, int lastPos) const +{ + int i; + float sum; + float wsum; + + sum = 0; + wsum = 0; + for (i = firstPos; i <= lastPos; i ++) + { + sum += (float)i * data[i]; + wsum += data[i]; + } + + if (wsum < 1e-6) return 0; + return sum / wsum; +} + + +/// get exact center of peak near given position by calculating local mass of center +double PeakFinder::getPeakCenter(const float *data, int peakpos) const +{ + float peakLevel; // peak level + int crosspos1, crosspos2; // position where the peak 'hump' crosses cutting level + float cutLevel; // cutting value + float groundLevel; // ground level of the peak + int gp1, gp2; // bottom positions of the peak 'hump' + + // find ground positions. + gp1 = findGround(data, peakpos, -1); + gp2 = findGround(data, peakpos, 1); + + peakLevel = data[peakpos]; + + if (gp1 == gp2) + { + // avoid rounding errors when all are equal + ADM_assert(gp1 == peakpos); + cutLevel = groundLevel = peakLevel; + } else { + // get average of the ground levels + groundLevel = 0.5f * (data[gp1] + data[gp2]); + + // calculate 70%-level of the peak + cutLevel = 0.70f * peakLevel + 0.30f * groundLevel; + } + + // find mid-level crossings + crosspos1 = findCrossingLevel(data, cutLevel, peakpos, -1); + crosspos2 = findCrossingLevel(data, cutLevel, peakpos, 1); + + if ((crosspos1 < 0) || (crosspos2 < 0)) return 0; // no crossing, no peak.. + + // calculate mass center of the peak surroundings + return calcMassCenter(data, crosspos1, crosspos2); +} + + +double PeakFinder::detectPeak(const float *data, int aminPos, int amaxPos) +{ + + int i; + int peakpos; // position of peak level + double highPeak, peak; + + this->minPos = aminPos; + this->maxPos = amaxPos; + + // find absolute peak + peakpos = minPos; + peak = data[minPos]; + for (i = minPos + 1; i < maxPos; i ++) + { + if (data[i] > peak) + { + peak = data[i]; + peakpos = i; + } + } + + // Calculate exact location of the highest peak mass center + highPeak = getPeakCenter(data, peakpos); + peak = highPeak; + + // Now check if the highest peak were in fact harmonic of the true base beat peak + // - sometimes the highest peak can be Nth harmonic of the true base peak yet + // just a slightly higher than the true base + + for (i = 1; i < 3; i ++) + { + double peaktmp, harmonic; + int i1,i2; + + harmonic = (double)pow(2.0, i); + peakpos = (int)(highPeak / harmonic + 0.5f); + if (peakpos < minPos) break; + peakpos = findTop(data, peakpos); // seek true local maximum index + if (peakpos == 0) continue; // no local max here + + // calculate mass-center of possible harmonic peak + peaktmp = getPeakCenter(data, peakpos); + + // accept harmonic peak if + // (a) it is found + // (b) is within ±4% of the expected harmonic interval + // (c) has at least half x-corr value of the max. peak + + double diff = harmonic * peaktmp / highPeak; + if ((diff < 0.96) || (diff > 1.04)) continue; // peak too afar from expected + + // now compare to highest detected peak + i1 = (int)(highPeak + 0.5); + i2 = (int)(peaktmp + 0.5); + if (data[i2] >= 0.4*data[i1]) + { + // The harmonic is at least half as high primary peak, + // thus use the harmonic peak instead + peak = peaktmp; + } + } + + return peak; +} diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/PeakFinder.h b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/PeakFinder.h index 9fe66adac5..bf46daa17b 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/PeakFinder.h +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/PeakFinder.h @@ -1,90 +1,90 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// The routine detects highest value on an array of values and calculates the -/// precise peak location as a mass-center of the 'hump' around the peak value. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef _PeakFinder_H_ -#define _PeakFinder_H_ - -namespace soundtouch -{ - -class PeakFinder -{ -protected: - /// Min, max allowed peak positions within the data vector - int minPos, maxPos; - - /// Calculates the mass center between given vector items. - double calcMassCenter(const float *data, ///< Data vector. - int firstPos, ///< Index of first vector item belonging to the peak. - int lastPos ///< Index of last vector item belonging to the peak. - ) const; - - /// Finds the data vector index where the monotoniously decreasing signal crosses the - /// given level. - int findCrossingLevel(const float *data, ///< Data vector. - float level, ///< Goal crossing level. - int peakpos, ///< Peak position index within the data vector. - int direction /// Direction where to proceed from the peak: 1 = right, -1 = left. - ) const; - - // Finds real 'top' of a peak hump from neighnourhood of the given 'peakpos'. - int findTop(const float *data, int peakpos) const; - - - /// Finds the 'ground' level, i.e. smallest level between two neighbouring peaks, to right- - /// or left-hand side of the given peak position. - int findGround(const float *data, /// Data vector. - int peakpos, /// Peak position index within the data vector. - int direction /// Direction where to proceed from the peak: 1 = right, -1 = left. - ) const; - - /// get exact center of peak near given position by calculating local mass of center - double getPeakCenter(const float *data, int peakpos) const; - -public: - /// Constructor. - PeakFinder(); - - /// Detect exact peak position of the data vector by finding the largest peak 'hump' - /// and calculating the mass-center location of the peak hump. - /// - /// \return The location of the largest base harmonic peak hump. - double detectPeak(const float *data, /// Data vector to be analyzed. The data vector has - /// to be at least 'maxPos' items long. - int minPos, ///< Min allowed peak location within the vector data. - int maxPos ///< Max allowed peak location within the vector data. - ); -}; - -} - -#endif // _PeakFinder_H_ +//////////////////////////////////////////////////////////////////////////////// +/// +/// The routine detects highest value on an array of values and calculates the +/// precise peak location as a mass-center of the 'hump' around the peak value. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef _PeakFinder_H_ +#define _PeakFinder_H_ + +namespace soundtouch +{ + +class PeakFinder +{ +protected: + /// Min, max allowed peak positions within the data vector + int minPos, maxPos; + + /// Calculates the mass center between given vector items. + double calcMassCenter(const float *data, ///< Data vector. + int firstPos, ///< Index of first vector item belonging to the peak. + int lastPos ///< Index of last vector item belonging to the peak. + ) const; + + /// Finds the data vector index where the monotoniously decreasing signal crosses the + /// given level. + int findCrossingLevel(const float *data, ///< Data vector. + float level, ///< Goal crossing level. + int peakpos, ///< Peak position index within the data vector. + int direction /// Direction where to proceed from the peak: 1 = right, -1 = left. + ) const; + + // Finds real 'top' of a peak hump from neighnourhood of the given 'peakpos'. + int findTop(const float *data, int peakpos) const; + + + /// Finds the 'ground' level, i.e. smallest level between two neighbouring peaks, to right- + /// or left-hand side of the given peak position. + int findGround(const float *data, /// Data vector. + int peakpos, /// Peak position index within the data vector. + int direction /// Direction where to proceed from the peak: 1 = right, -1 = left. + ) const; + + /// get exact center of peak near given position by calculating local mass of center + double getPeakCenter(const float *data, int peakpos) const; + +public: + /// Constructor. + PeakFinder(); + + /// Detect exact peak position of the data vector by finding the largest peak 'hump' + /// and calculating the mass-center location of the peak hump. + /// + /// \return The location of the largest base harmonic peak hump. + double detectPeak(const float *data, /// Data vector to be analyzed. The data vector has + /// to be at least 'maxPos' items long. + int minPos, ///< Min allowed peak location within the vector data. + int maxPos ///< Max allowed peak location within the vector data. + ); +}; + +} + +#endif // _PeakFinder_H_ diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/RateTransposer.cpp b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/RateTransposer.cpp index 0e2348d20d..bdd208edee 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/RateTransposer.cpp +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/RateTransposer.cpp @@ -1,315 +1,315 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// Sample rate transposer. Changes sample rate by using linear interpolation -/// together with anti-alias filtering (first order interpolation with anti- -/// alias filtering should be quite adequate for this application) -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#include -#include "ADM_default.h" -#include -#include -#include "RateTransposer.h" -#include "InterpolateLinear.h" -#include "InterpolateCubic.h" -#include "InterpolateShannon.h" -#include "AAFilter.h" - -using namespace soundtouch; - -// Define default interpolation algorithm here -TransposerBase::ALGORITHM TransposerBase::algorithm = TransposerBase::CUBIC; - - -// Constructor -RateTransposer::RateTransposer() : FIFOProcessor(&outputBuffer) -{ - bUseAAFilter = -#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER - true; -#else - // Disable Anti-alias filter if desirable to avoid click at rate change zero value crossover - false; -#endif - - // Instantiates the anti-alias filter - pAAFilter = new AAFilter(64); - pTransposer = TransposerBase::newInstance(); - clear(); -} - - -RateTransposer::~RateTransposer() -{ - delete pAAFilter; - delete pTransposer; -} - - -/// Enables/disables the anti-alias filter. Zero to disable, nonzero to enable -void RateTransposer::enableAAFilter(bool newMode) -{ -#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER - // Disable Anti-alias filter if desirable to avoid click at rate change zero value crossover - bUseAAFilter = newMode; - clear(); -#endif -} - - -/// Returns nonzero if anti-alias filter is enabled. -bool RateTransposer::isAAFilterEnabled() const -{ - return bUseAAFilter; -} - - -AAFilter *RateTransposer::getAAFilter() -{ - return pAAFilter; -} - - -// Sets new target iRate. Normal iRate = 1.0, smaller values represent slower -// iRate, larger faster iRates. -void RateTransposer::setRate(double newRate) -{ - double fCutoff; - - pTransposer->setRate(newRate); - - // design a new anti-alias filter - if (newRate > 1.0) - { - fCutoff = 0.5 / newRate; - } - else - { - fCutoff = 0.5 * newRate; - } - pAAFilter->setCutoffFreq(fCutoff); -} - - -// Adds 'nSamples' pcs of samples from the 'samples' memory position into -// the input of the object. -void RateTransposer::putSamples(const SAMPLETYPE *samples, uint nSamples) -{ - processSamples(samples, nSamples); -} - - -// Transposes sample rate by applying anti-alias filter to prevent folding. -// Returns amount of samples returned in the "dest" buffer. -// The maximum amount of samples that can be returned at a time is set by -// the 'set_returnBuffer_size' function. -void RateTransposer::processSamples(const SAMPLETYPE *src, uint nSamples) -{ - uint count; - - if (nSamples == 0) return; - - // Store samples to input buffer - inputBuffer.putSamples(src, nSamples); - - // If anti-alias filter is turned off, simply transpose without applying - // the filter - if (bUseAAFilter == false) - { - count = pTransposer->transpose(outputBuffer, inputBuffer); - return; - } - - ADM_assert(pAAFilter); - - // Transpose with anti-alias filter - if (pTransposer->rate < 1.0f) - { - // If the parameter 'Rate' value is smaller than 1, first transpose - // the samples and then apply the anti-alias filter to remove aliasing. - - // Transpose the samples, store the result to end of "midBuffer" - pTransposer->transpose(midBuffer, inputBuffer); - - // Apply the anti-alias filter for transposed samples in midBuffer - pAAFilter->evaluate(outputBuffer, midBuffer); - } - else - { - // If the parameter 'Rate' value is larger than 1, first apply the - // anti-alias filter to remove high frequencies (prevent them from folding - // over the lover frequencies), then transpose. - - // Apply the anti-alias filter for samples in inputBuffer - pAAFilter->evaluate(midBuffer, inputBuffer); - - // Transpose the AA-filtered samples in "midBuffer" - pTransposer->transpose(outputBuffer, midBuffer); - } -} - - -// Sets the number of channels, 1 = mono, 2 = stereo -void RateTransposer::setChannels(int nChannels) -{ - if (!verifyNumberOfChannels(nChannels) || - (pTransposer->numChannels == nChannels)) return; - - pTransposer->setChannels(nChannels); - inputBuffer.setChannels(nChannels); - midBuffer.setChannels(nChannels); - outputBuffer.setChannels(nChannels); -} - - -// Clears all the samples in the object -void RateTransposer::clear() -{ - outputBuffer.clear(); - midBuffer.clear(); - inputBuffer.clear(); - pTransposer->resetRegisters(); - - // prefill buffer to avoid losing first samples at beginning of stream - int prefill = getLatency(); - inputBuffer.addSilent(prefill); -} - - -// Returns nonzero if there aren't any samples available for outputting. -int RateTransposer::isEmpty() const -{ - int res; - - res = FIFOProcessor::isEmpty(); - if (res == 0) return 0; - return inputBuffer.isEmpty(); -} - - -/// Return approximate initial input-output latency -int RateTransposer::getLatency() const -{ - return pTransposer->getLatency() + - ((bUseAAFilter) ? (pAAFilter->getLength() / 2) : 0); -} - - -////////////////////////////////////////////////////////////////////////////// -// -// TransposerBase - Base class for interpolation -// - -// static function to set interpolation algorithm -void TransposerBase::setAlgorithm(TransposerBase::ALGORITHM a) -{ - TransposerBase::algorithm = a; -} - - -// Transposes the sample rate of the given samples using linear interpolation. -// Returns the number of samples returned in the "dest" buffer -int TransposerBase::transpose(FIFOSampleBuffer &dest, FIFOSampleBuffer &src) -{ - int numSrcSamples = src.numSamples(); - int sizeDemand = (int)((double)numSrcSamples / rate) + 8; - int numOutput; - SAMPLETYPE *psrc = src.ptrBegin(); - SAMPLETYPE *pdest = dest.ptrEnd(sizeDemand); - -#ifndef USE_MULTICH_ALWAYS - if (numChannels == 1) - { - numOutput = transposeMono(pdest, psrc, numSrcSamples); - } - else if (numChannels == 2) - { - numOutput = transposeStereo(pdest, psrc, numSrcSamples); - } - else -#endif // USE_MULTICH_ALWAYS - { - ADM_assert(numChannels > 0); - numOutput = transposeMulti(pdest, psrc, numSrcSamples); - } - dest.putSamples(numOutput); - src.receiveSamples(numSrcSamples); - return numOutput; -} - - -TransposerBase::TransposerBase() -{ - numChannels = 0; - rate = 1.0f; -} - - -TransposerBase::~TransposerBase() -{ -} - - -void TransposerBase::setChannels(int channels) -{ - numChannels = channels; - resetRegisters(); -} - - -void TransposerBase::setRate(double newRate) -{ - rate = newRate; -} - - -// static factory function -TransposerBase *TransposerBase::newInstance() -{ -#ifdef SOUNDTOUCH_INTEGER_SAMPLES - // Notice: For integer arithmetic support only linear algorithm (due to simplest calculus) - return ::new InterpolateLinearInteger; -#else - switch (algorithm) - { - case LINEAR: - return new InterpolateLinearFloat; - - case CUBIC: - return new InterpolateCubic; - - case SHANNON: - return new InterpolateShannon; - - default: - ADM_assert(false); - return NULL; - } -#endif -} +//////////////////////////////////////////////////////////////////////////////// +/// +/// Sample rate transposer. Changes sample rate by using linear interpolation +/// together with anti-alias filtering (first order interpolation with anti- +/// alias filtering should be quite adequate for this application) +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include "ADM_default.h" +#include +#include +#include "RateTransposer.h" +#include "InterpolateLinear.h" +#include "InterpolateCubic.h" +#include "InterpolateShannon.h" +#include "AAFilter.h" + +using namespace soundtouch; + +// Define default interpolation algorithm here +TransposerBase::ALGORITHM TransposerBase::algorithm = TransposerBase::CUBIC; + + +// Constructor +RateTransposer::RateTransposer() : FIFOProcessor(&outputBuffer) +{ + bUseAAFilter = +#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER + true; +#else + // Disable Anti-alias filter if desirable to avoid click at rate change zero value crossover + false; +#endif + + // Instantiates the anti-alias filter + pAAFilter = new AAFilter(64); + pTransposer = TransposerBase::newInstance(); + clear(); +} + + +RateTransposer::~RateTransposer() +{ + delete pAAFilter; + delete pTransposer; +} + + +/// Enables/disables the anti-alias filter. Zero to disable, nonzero to enable +void RateTransposer::enableAAFilter(bool newMode) +{ +#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER + // Disable Anti-alias filter if desirable to avoid click at rate change zero value crossover + bUseAAFilter = newMode; + clear(); +#endif +} + + +/// Returns nonzero if anti-alias filter is enabled. +bool RateTransposer::isAAFilterEnabled() const +{ + return bUseAAFilter; +} + + +AAFilter *RateTransposer::getAAFilter() +{ + return pAAFilter; +} + + +// Sets new target iRate. Normal iRate = 1.0, smaller values represent slower +// iRate, larger faster iRates. +void RateTransposer::setRate(double newRate) +{ + double fCutoff; + + pTransposer->setRate(newRate); + + // design a new anti-alias filter + if (newRate > 1.0) + { + fCutoff = 0.5 / newRate; + } + else + { + fCutoff = 0.5 * newRate; + } + pAAFilter->setCutoffFreq(fCutoff); +} + + +// Adds 'nSamples' pcs of samples from the 'samples' memory position into +// the input of the object. +void RateTransposer::putSamples(const SAMPLETYPE *samples, uint nSamples) +{ + processSamples(samples, nSamples); +} + + +// Transposes sample rate by applying anti-alias filter to prevent folding. +// Returns amount of samples returned in the "dest" buffer. +// The maximum amount of samples that can be returned at a time is set by +// the 'set_returnBuffer_size' function. +void RateTransposer::processSamples(const SAMPLETYPE *src, uint nSamples) +{ + uint count; + + if (nSamples == 0) return; + + // Store samples to input buffer + inputBuffer.putSamples(src, nSamples); + + // If anti-alias filter is turned off, simply transpose without applying + // the filter + if (bUseAAFilter == false) + { + count = pTransposer->transpose(outputBuffer, inputBuffer); + return; + } + + ADM_assert(pAAFilter); + + // Transpose with anti-alias filter + if (pTransposer->rate < 1.0f) + { + // If the parameter 'Rate' value is smaller than 1, first transpose + // the samples and then apply the anti-alias filter to remove aliasing. + + // Transpose the samples, store the result to end of "midBuffer" + pTransposer->transpose(midBuffer, inputBuffer); + + // Apply the anti-alias filter for transposed samples in midBuffer + pAAFilter->evaluate(outputBuffer, midBuffer); + } + else + { + // If the parameter 'Rate' value is larger than 1, first apply the + // anti-alias filter to remove high frequencies (prevent them from folding + // over the lover frequencies), then transpose. + + // Apply the anti-alias filter for samples in inputBuffer + pAAFilter->evaluate(midBuffer, inputBuffer); + + // Transpose the AA-filtered samples in "midBuffer" + pTransposer->transpose(outputBuffer, midBuffer); + } +} + + +// Sets the number of channels, 1 = mono, 2 = stereo +void RateTransposer::setChannels(int nChannels) +{ + if (!verifyNumberOfChannels(nChannels) || + (pTransposer->numChannels == nChannels)) return; + + pTransposer->setChannels(nChannels); + inputBuffer.setChannels(nChannels); + midBuffer.setChannels(nChannels); + outputBuffer.setChannels(nChannels); +} + + +// Clears all the samples in the object +void RateTransposer::clear() +{ + outputBuffer.clear(); + midBuffer.clear(); + inputBuffer.clear(); + pTransposer->resetRegisters(); + + // prefill buffer to avoid losing first samples at beginning of stream + int prefill = getLatency(); + inputBuffer.addSilent(prefill); +} + + +// Returns nonzero if there aren't any samples available for outputting. +int RateTransposer::isEmpty() const +{ + int res; + + res = FIFOProcessor::isEmpty(); + if (res == 0) return 0; + return inputBuffer.isEmpty(); +} + + +/// Return approximate initial input-output latency +int RateTransposer::getLatency() const +{ + return pTransposer->getLatency() + + ((bUseAAFilter) ? (pAAFilter->getLength() / 2) : 0); +} + + +////////////////////////////////////////////////////////////////////////////// +// +// TransposerBase - Base class for interpolation +// + +// static function to set interpolation algorithm +void TransposerBase::setAlgorithm(TransposerBase::ALGORITHM a) +{ + TransposerBase::algorithm = a; +} + + +// Transposes the sample rate of the given samples using linear interpolation. +// Returns the number of samples returned in the "dest" buffer +int TransposerBase::transpose(FIFOSampleBuffer &dest, FIFOSampleBuffer &src) +{ + int numSrcSamples = src.numSamples(); + int sizeDemand = (int)((double)numSrcSamples / rate) + 8; + int numOutput; + SAMPLETYPE *psrc = src.ptrBegin(); + SAMPLETYPE *pdest = dest.ptrEnd(sizeDemand); + +#ifndef USE_MULTICH_ALWAYS + if (numChannels == 1) + { + numOutput = transposeMono(pdest, psrc, numSrcSamples); + } + else if (numChannels == 2) + { + numOutput = transposeStereo(pdest, psrc, numSrcSamples); + } + else +#endif // USE_MULTICH_ALWAYS + { + ADM_assert(numChannels > 0); + numOutput = transposeMulti(pdest, psrc, numSrcSamples); + } + dest.putSamples(numOutput); + src.receiveSamples(numSrcSamples); + return numOutput; +} + + +TransposerBase::TransposerBase() +{ + numChannels = 0; + rate = 1.0f; +} + + +TransposerBase::~TransposerBase() +{ +} + + +void TransposerBase::setChannels(int channels) +{ + numChannels = channels; + resetRegisters(); +} + + +void TransposerBase::setRate(double newRate) +{ + rate = newRate; +} + + +// static factory function +TransposerBase *TransposerBase::newInstance() +{ +#ifdef SOUNDTOUCH_INTEGER_SAMPLES + // Notice: For integer arithmetic support only linear algorithm (due to simplest calculus) + return ::new InterpolateLinearInteger; +#else + switch (algorithm) + { + case LINEAR: + return new InterpolateLinearFloat; + + case CUBIC: + return new InterpolateCubic; + + case SHANNON: + return new InterpolateShannon; + + default: + ADM_assert(false); + return NULL; + } +#endif +} diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/RateTransposer.h b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/RateTransposer.h index 411f4e897d..bd02eff13f 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/RateTransposer.h +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/RateTransposer.h @@ -1,164 +1,164 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// Sample rate transposer. Changes sample rate by using linear interpolation -/// together with anti-alias filtering (first order interpolation with anti- -/// alias filtering should be quite adequate for this application). -/// -/// Use either of the derived classes of 'RateTransposerInteger' or -/// 'RateTransposerFloat' for corresponding integer/floating point tranposing -/// algorithm implementation. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef RateTransposer_H -#define RateTransposer_H - -#include -#include "AAFilter.h" -#include "FIFOSamplePipe.h" -#include "FIFOSampleBuffer.h" - -#include "STTypes.h" - -namespace soundtouch -{ - -/// Abstract base class for transposer implementations (linear, advanced vs integer, float etc) -class TransposerBase -{ -public: - enum ALGORITHM { - LINEAR = 0, - CUBIC, - SHANNON - }; - -protected: - virtual int transposeMono(SAMPLETYPE *dest, - const SAMPLETYPE *src, - int &srcSamples) = 0; - virtual int transposeStereo(SAMPLETYPE *dest, - const SAMPLETYPE *src, - int &srcSamples) = 0; - virtual int transposeMulti(SAMPLETYPE *dest, - const SAMPLETYPE *src, - int &srcSamples) = 0; - - static ALGORITHM algorithm; - -public: - double rate; - int numChannels; - - TransposerBase(); - virtual ~TransposerBase(); - - virtual int transpose(FIFOSampleBuffer &dest, FIFOSampleBuffer &src); - virtual void setRate(double newRate); - virtual void setChannels(int channels); - virtual int getLatency() const = 0; - - virtual void resetRegisters() = 0; - - // static factory function - static TransposerBase *newInstance(); - - // static function to set interpolation algorithm - static void setAlgorithm(ALGORITHM a); -}; - - -/// A common linear samplerate transposer class. -/// -class RateTransposer : public FIFOProcessor -{ -protected: - /// Anti-alias filter object - AAFilter *pAAFilter; - TransposerBase *pTransposer; - - /// Buffer for collecting samples to feed the anti-alias filter between - /// two batches - FIFOSampleBuffer inputBuffer; - - /// Buffer for keeping samples between transposing & anti-alias filter - FIFOSampleBuffer midBuffer; - - /// Output sample buffer - FIFOSampleBuffer outputBuffer; - - bool bUseAAFilter; - - - /// Transposes sample rate by applying anti-alias filter to prevent folding. - /// Returns amount of samples returned in the "dest" buffer. - /// The maximum amount of samples that can be returned at a time is set by - /// the 'set_returnBuffer_size' function. - void processSamples(const SAMPLETYPE *src, - uint numSamples); - -public: - RateTransposer(); - virtual ~RateTransposer() override; - - /// Returns the output buffer object - FIFOSamplePipe *getOutput() { return &outputBuffer; }; - - /// Return anti-alias filter object - AAFilter *getAAFilter(); - - /// Enables/disables the anti-alias filter. Zero to disable, nonzero to enable - void enableAAFilter(bool newMode); - - /// Returns nonzero if anti-alias filter is enabled. - bool isAAFilterEnabled() const; - - /// Sets new target rate. Normal rate = 1.0, smaller values represent slower - /// rate, larger faster rates. - virtual void setRate(double newRate); - - /// Sets the number of channels, 1 = mono, 2 = stereo - void setChannels(int channels); - - /// Adds 'numSamples' pcs of samples from the 'samples' memory position into - /// the input of the object. - void putSamples(const SAMPLETYPE *samples, uint numSamples) override; - - /// Clears all the samples in the object - void clear() override; - - /// Returns nonzero if there aren't any samples available for outputting. - int isEmpty() const override; - - /// Return approximate initial input-output latency - int getLatency() const; -}; - -} - -#endif +//////////////////////////////////////////////////////////////////////////////// +/// +/// Sample rate transposer. Changes sample rate by using linear interpolation +/// together with anti-alias filtering (first order interpolation with anti- +/// alias filtering should be quite adequate for this application). +/// +/// Use either of the derived classes of 'RateTransposerInteger' or +/// 'RateTransposerFloat' for corresponding integer/floating point tranposing +/// algorithm implementation. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef RateTransposer_H +#define RateTransposer_H + +#include +#include "AAFilter.h" +#include "FIFOSamplePipe.h" +#include "FIFOSampleBuffer.h" + +#include "STTypes.h" + +namespace soundtouch +{ + +/// Abstract base class for transposer implementations (linear, advanced vs integer, float etc) +class TransposerBase +{ +public: + enum ALGORITHM { + LINEAR = 0, + CUBIC, + SHANNON + }; + +protected: + virtual int transposeMono(SAMPLETYPE *dest, + const SAMPLETYPE *src, + int &srcSamples) = 0; + virtual int transposeStereo(SAMPLETYPE *dest, + const SAMPLETYPE *src, + int &srcSamples) = 0; + virtual int transposeMulti(SAMPLETYPE *dest, + const SAMPLETYPE *src, + int &srcSamples) = 0; + + static ALGORITHM algorithm; + +public: + double rate; + int numChannels; + + TransposerBase(); + virtual ~TransposerBase(); + + virtual int transpose(FIFOSampleBuffer &dest, FIFOSampleBuffer &src); + virtual void setRate(double newRate); + virtual void setChannels(int channels); + virtual int getLatency() const = 0; + + virtual void resetRegisters() = 0; + + // static factory function + static TransposerBase *newInstance(); + + // static function to set interpolation algorithm + static void setAlgorithm(ALGORITHM a); +}; + + +/// A common linear samplerate transposer class. +/// +class RateTransposer : public FIFOProcessor +{ +protected: + /// Anti-alias filter object + AAFilter *pAAFilter; + TransposerBase *pTransposer; + + /// Buffer for collecting samples to feed the anti-alias filter between + /// two batches + FIFOSampleBuffer inputBuffer; + + /// Buffer for keeping samples between transposing & anti-alias filter + FIFOSampleBuffer midBuffer; + + /// Output sample buffer + FIFOSampleBuffer outputBuffer; + + bool bUseAAFilter; + + + /// Transposes sample rate by applying anti-alias filter to prevent folding. + /// Returns amount of samples returned in the "dest" buffer. + /// The maximum amount of samples that can be returned at a time is set by + /// the 'set_returnBuffer_size' function. + void processSamples(const SAMPLETYPE *src, + uint numSamples); + +public: + RateTransposer(); + virtual ~RateTransposer() override; + + /// Returns the output buffer object + FIFOSamplePipe *getOutput() { return &outputBuffer; }; + + /// Return anti-alias filter object + AAFilter *getAAFilter(); + + /// Enables/disables the anti-alias filter. Zero to disable, nonzero to enable + void enableAAFilter(bool newMode); + + /// Returns nonzero if anti-alias filter is enabled. + bool isAAFilterEnabled() const; + + /// Sets new target rate. Normal rate = 1.0, smaller values represent slower + /// rate, larger faster rates. + virtual void setRate(double newRate); + + /// Sets the number of channels, 1 = mono, 2 = stereo + void setChannels(int channels); + + /// Adds 'numSamples' pcs of samples from the 'samples' memory position into + /// the input of the object. + void putSamples(const SAMPLETYPE *samples, uint numSamples) override; + + /// Clears all the samples in the object + void clear() override; + + /// Returns nonzero if there aren't any samples available for outputting. + int isEmpty() const override; + + /// Return approximate initial input-output latency + int getLatency() const; +}; + +} + +#endif diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/STTypes.h b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/STTypes.h index fa7bf7c2d5..b14cddd6aa 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/STTypes.h +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/STTypes.h @@ -1,191 +1,191 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// Common type definitions for SoundTouch audio processing library. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef STTypes_H -#define STTypes_H - -typedef unsigned int uint; -typedef unsigned long ulong; - -// Patch for MinGW: on Win64 long is 32-bit -#ifdef _WIN64 - typedef unsigned long long ulongptr; -#else - typedef ulong ulongptr; -#endif - - -// Helper macro for aligning pointer up to next 16-byte boundary -#define SOUNDTOUCH_ALIGN_POINTER_16(x) ( ( (ulongptr)(x) + 15 ) & ~(ulongptr)15 ) - - -#if (defined(__GNUC__) && !defined(ANDROID)) - // In GCC, include soundtouch_config.h made by config scritps. - // Skip this in Android compilation that uses GCC but without configure scripts. - #include "soundtouch_config.h" -#endif - - -namespace soundtouch -{ - /// Max allowed number of channels - #define SOUNDTOUCH_MAX_CHANNELS 16 - - /// Activate these undef's to overrule the possible sampletype - /// setting inherited from some other header file: - #undef SOUNDTOUCH_INTEGER_SAMPLES - #undef SOUNDTOUCH_FLOAT_SAMPLES - - /// If following flag is defined, always uses multichannel processing - /// routines also for mono and stero sound. This is for routine testing - /// purposes; output should be same with either routines, yet disabling - /// the dedicated mono/stereo processing routines will result in slower - /// runtime performance so recommendation is to keep this off. - // #define USE_MULTICH_ALWAYS - - #if (defined(__SOFTFP__) && defined(ANDROID)) - // For Android compilation: Force use of Integer samples in case that - // compilation uses soft-floating point emulation - soft-fp is way too slow - #undef SOUNDTOUCH_FLOAT_SAMPLES - #define SOUNDTOUCH_INTEGER_SAMPLES 1 - #endif - - #if !(SOUNDTOUCH_INTEGER_SAMPLES || SOUNDTOUCH_FLOAT_SAMPLES) - - /// Choose either 32bit floating point or 16bit integer sampletype - /// by choosing one of the following defines, unless this selection - /// has already been done in some other file. - //// - /// Notes: - /// - In Windows environment, choose the sample format with the - /// following defines. - /// - In GNU environment, the floating point samples are used by - /// default, but integer samples can be chosen by giving the - /// following switch to the configure script: - /// ./configure --enable-integer-samples - /// However, if you still prefer to select the sample format here - /// also in GNU environment, then please #undef the INTEGER_SAMPLE - /// and FLOAT_SAMPLE defines first as in comments above. - //#define SOUNDTOUCH_INTEGER_SAMPLES 1 //< 16bit integer samples - #define SOUNDTOUCH_FLOAT_SAMPLES 1 //< 32bit float samples - - #endif - - #if (_M_IX86 || __i386__ || __x86_64__ || _M_X64) - /// Define this to allow X86-specific assembler/intrinsic optimizations. - /// Notice that library contains also usual C++ versions of each of these - /// these routines, so if you're having difficulties getting the optimized - /// routines compiled for whatever reason, you may disable these optimizations - /// to make the library compile. - - #define SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS 1 - - /// In GNU environment, allow the user to override this setting by - /// giving the following switch to the configure script: - /// ./configure --disable-x86-optimizations - /// ./configure --enable-x86-optimizations=no - #ifdef SOUNDTOUCH_DISABLE_X86_OPTIMIZATIONS - #undef SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS - #endif - #else - /// Always disable optimizations when not using a x86 systems. - #undef SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS - - #endif - - // If defined, allows the SIMD-optimized routines to skip unevenly aligned - // memory offsets that can cause performance penalty in some SIMD implementations. - // Causes slight compromise in sound quality. - // #define SOUNDTOUCH_ALLOW_NONEXACT_SIMD_OPTIMIZATION 1 - - - #ifdef SOUNDTOUCH_INTEGER_SAMPLES - // 16bit integer sample type - typedef short SAMPLETYPE; - // data type for sample accumulation: Use 32bit integer to prevent overflows - typedef long LONG_SAMPLETYPE; - - #ifdef SOUNDTOUCH_FLOAT_SAMPLES - // check that only one sample type is defined - #error "conflicting sample types defined" - #endif // SOUNDTOUCH_FLOAT_SAMPLES - - #ifdef SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS - // Allow MMX optimizations (not available in X64 mode) - #if (!_M_X64) - #define SOUNDTOUCH_ALLOW_MMX 1 - #endif - #endif - - #else - - // floating point samples - typedef float SAMPLETYPE; - // data type for sample accumulation: Use float also here to enable - // efficient autovectorization - typedef float LONG_SAMPLETYPE; - - #ifdef SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS - // Allow SSE optimizations - #define SOUNDTOUCH_ALLOW_SSE 1 - #endif - - #endif // SOUNDTOUCH_INTEGER_SAMPLES - - #if ((SOUNDTOUCH_ALLOW_SSE) || (__SSE__) || (SOUNDTOUCH_USE_NEON)) - #if SOUNDTOUCH_ALLOW_NONEXACT_SIMD_OPTIMIZATION - #define ST_SIMD_AVOID_UNALIGNED - #endif - #endif - -} - -// define ST_NO_EXCEPTION_HANDLING switch to disable throwing std exceptions: -#define ST_NO_EXCEPTION_HANDLING 1 -#ifdef ST_NO_EXCEPTION_HANDLING - // Exceptions disabled. Throw asserts instead if enabled. - #include "ADM_default.h" - #define ST_THROW_RT_ERROR(x) {ADM_assert((x) && 0);} -#else - #error only ADM_assert can be used - // use c++ standard exceptions - #include - #include - #define ST_THROW_RT_ERROR(x) {throw std::runtime_error(x);} -#endif - -// When this #define is active, eliminates a clicking sound when the "rate" or "pitch" -// parameter setting crosses from value <1 to >=1 or vice versa during processing. -// Default is off as such crossover is untypical case and involves a slight sound -// quality compromise. -//#define SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER 1 - -#endif +//////////////////////////////////////////////////////////////////////////////// +/// +/// Common type definitions for SoundTouch audio processing library. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef STTypes_H +#define STTypes_H + +typedef unsigned int uint; +typedef unsigned long ulong; + +// Patch for MinGW: on Win64 long is 32-bit +#ifdef _WIN64 + typedef unsigned long long ulongptr; +#else + typedef ulong ulongptr; +#endif + + +// Helper macro for aligning pointer up to next 16-byte boundary +#define SOUNDTOUCH_ALIGN_POINTER_16(x) ( ( (ulongptr)(x) + 15 ) & ~(ulongptr)15 ) + + +#if (defined(__GNUC__) && !defined(ANDROID)) + // In GCC, include soundtouch_config.h made by config scritps. + // Skip this in Android compilation that uses GCC but without configure scripts. + #include "soundtouch_config.h" +#endif + + +namespace soundtouch +{ + /// Max allowed number of channels + #define SOUNDTOUCH_MAX_CHANNELS 16 + + /// Activate these undef's to overrule the possible sampletype + /// setting inherited from some other header file: + #undef SOUNDTOUCH_INTEGER_SAMPLES + #undef SOUNDTOUCH_FLOAT_SAMPLES + + /// If following flag is defined, always uses multichannel processing + /// routines also for mono and stero sound. This is for routine testing + /// purposes; output should be same with either routines, yet disabling + /// the dedicated mono/stereo processing routines will result in slower + /// runtime performance so recommendation is to keep this off. + // #define USE_MULTICH_ALWAYS + + #if (defined(__SOFTFP__) && defined(ANDROID)) + // For Android compilation: Force use of Integer samples in case that + // compilation uses soft-floating point emulation - soft-fp is way too slow + #undef SOUNDTOUCH_FLOAT_SAMPLES + #define SOUNDTOUCH_INTEGER_SAMPLES 1 + #endif + + #if !(SOUNDTOUCH_INTEGER_SAMPLES || SOUNDTOUCH_FLOAT_SAMPLES) + + /// Choose either 32bit floating point or 16bit integer sampletype + /// by choosing one of the following defines, unless this selection + /// has already been done in some other file. + //// + /// Notes: + /// - In Windows environment, choose the sample format with the + /// following defines. + /// - In GNU environment, the floating point samples are used by + /// default, but integer samples can be chosen by giving the + /// following switch to the configure script: + /// ./configure --enable-integer-samples + /// However, if you still prefer to select the sample format here + /// also in GNU environment, then please #undef the INTEGER_SAMPLE + /// and FLOAT_SAMPLE defines first as in comments above. + //#define SOUNDTOUCH_INTEGER_SAMPLES 1 //< 16bit integer samples + #define SOUNDTOUCH_FLOAT_SAMPLES 1 //< 32bit float samples + + #endif + + #if (_M_IX86 || __i386__ || __x86_64__ || _M_X64) + /// Define this to allow X86-specific assembler/intrinsic optimizations. + /// Notice that library contains also usual C++ versions of each of these + /// these routines, so if you're having difficulties getting the optimized + /// routines compiled for whatever reason, you may disable these optimizations + /// to make the library compile. + + #define SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS 1 + + /// In GNU environment, allow the user to override this setting by + /// giving the following switch to the configure script: + /// ./configure --disable-x86-optimizations + /// ./configure --enable-x86-optimizations=no + #ifdef SOUNDTOUCH_DISABLE_X86_OPTIMIZATIONS + #undef SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS + #endif + #else + /// Always disable optimizations when not using a x86 systems. + #undef SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS + + #endif + + // If defined, allows the SIMD-optimized routines to skip unevenly aligned + // memory offsets that can cause performance penalty in some SIMD implementations. + // Causes slight compromise in sound quality. + // #define SOUNDTOUCH_ALLOW_NONEXACT_SIMD_OPTIMIZATION 1 + + + #ifdef SOUNDTOUCH_INTEGER_SAMPLES + // 16bit integer sample type + typedef short SAMPLETYPE; + // data type for sample accumulation: Use 32bit integer to prevent overflows + typedef long LONG_SAMPLETYPE; + + #ifdef SOUNDTOUCH_FLOAT_SAMPLES + // check that only one sample type is defined + #error "conflicting sample types defined" + #endif // SOUNDTOUCH_FLOAT_SAMPLES + + #ifdef SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS + // Allow MMX optimizations (not available in X64 mode) + #if (!_M_X64) + #define SOUNDTOUCH_ALLOW_MMX 1 + #endif + #endif + + #else + + // floating point samples + typedef float SAMPLETYPE; + // data type for sample accumulation: Use float also here to enable + // efficient autovectorization + typedef float LONG_SAMPLETYPE; + + #ifdef SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS + // Allow SSE optimizations + #define SOUNDTOUCH_ALLOW_SSE 1 + #endif + + #endif // SOUNDTOUCH_INTEGER_SAMPLES + + #if ((SOUNDTOUCH_ALLOW_SSE) || (__SSE__) || (SOUNDTOUCH_USE_NEON)) + #if SOUNDTOUCH_ALLOW_NONEXACT_SIMD_OPTIMIZATION + #define ST_SIMD_AVOID_UNALIGNED + #endif + #endif + +} + +// define ST_NO_EXCEPTION_HANDLING switch to disable throwing std exceptions: +#define ST_NO_EXCEPTION_HANDLING 1 +#ifdef ST_NO_EXCEPTION_HANDLING + // Exceptions disabled. Throw asserts instead if enabled. + #include "ADM_default.h" + #define ST_THROW_RT_ERROR(x) {ADM_assert((x) && 0);} +#else + #error only ADM_assert can be used + // use c++ standard exceptions + #include + #include + #define ST_THROW_RT_ERROR(x) {throw std::runtime_error(x);} +#endif + +// When this #define is active, eliminates a clicking sound when the "rate" or "pitch" +// parameter setting crosses from value <1 to >=1 or vice versa during processing. +// Default is off as such crossover is untypical case and involves a slight sound +// quality compromise. +//#define SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER 1 + +#endif diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/SoundTouch.cpp b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/SoundTouch.cpp index af84c3b879..cd2ff22385 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/SoundTouch.cpp +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/SoundTouch.cpp @@ -1,537 +1,537 @@ -////////////////////////////////////////////////////////////////////////////// -/// -/// SoundTouch - main class for tempo/pitch/rate adjusting routines. -/// -/// Notes: -/// - Initialize the SoundTouch object instance by setting up the sound stream -/// parameters with functions 'setSampleRate' and 'setChannels', then set -/// desired tempo/pitch/rate settings with the corresponding functions. -/// -/// - The SoundTouch class behaves like a first-in-first-out pipeline: The -/// samples that are to be processed are fed into one of the pipe by calling -/// function 'putSamples', while the ready processed samples can be read -/// from the other end of the pipeline with function 'receiveSamples'. -/// -/// - The SoundTouch processing classes require certain sized 'batches' of -/// samples in order to process the sound. For this reason the classes buffer -/// incoming samples until there are enough of samples available for -/// processing, then they carry out the processing step and consequently -/// make the processed samples available for outputting. -/// -/// - For the above reason, the processing routines introduce a certain -/// 'latency' between the input and output, so that the samples input to -/// SoundTouch may not be immediately available in the output, and neither -/// the amount of outputtable samples may not immediately be in direct -/// relationship with the amount of previously input samples. -/// -/// - The tempo/pitch/rate control parameters can be altered during processing. -/// Please notice though that they aren't currently protected by semaphores, -/// so in multi-thread application external semaphore protection may be -/// required. -/// -/// - This class utilizes classes 'TDStretch' for tempo change (without modifying -/// pitch) and 'RateTransposer' for changing the playback rate (that is, both -/// tempo and pitch in the same ratio) of the sound. The third available control -/// 'pitch' (change pitch but maintain tempo) is produced by a combination of -/// combining the two other controls. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#include "ADM_default.h" -#include -#include -#include -#include - -#include "SoundTouch.h" -#include "TDStretch.h" -#include "RateTransposer.h" - -using namespace soundtouch; - -/// test if two floating point numbers are equal -#define TEST_FLOAT_EQUAL(a, b) (fabs(a - b) < 1e-10) - - -/// Print library version string for autoconf -extern "C" void soundtouch_ac_test() -{ - printf("SoundTouch Version: %s\n",SOUNDTOUCH_VERSION); -} - - -SoundTouch::SoundTouch() -{ - // Initialize rate transposer and tempo changer instances - - pRateTransposer = new RateTransposer(); - pTDStretch = TDStretch::newInstance(); - - setOutPipe(pTDStretch); - - rate = tempo = 0; - - virtualPitch = - virtualRate = - virtualTempo = 1.0; - - calcEffectiveRateAndTempo(); - - samplesExpectedOut = 0; - samplesOutput = 0; - - channels = 0; - bSrateSet = false; -} - - -SoundTouch::~SoundTouch() -{ - delete pRateTransposer; - delete pTDStretch; -} - - -/// Get SoundTouch library version string -const char *SoundTouch::getVersionString() -{ - static const char *_version = SOUNDTOUCH_VERSION; - - return _version; -} - - -/// Get SoundTouch library version Id -uint SoundTouch::getVersionId() -{ - return SOUNDTOUCH_VERSION_ID; -} - - -// Sets the number of channels, 1 = mono, 2 = stereo -void SoundTouch::setChannels(uint numChannels) -{ - if (!verifyNumberOfChannels(numChannels)) return; - - channels = numChannels; - pRateTransposer->setChannels((int)numChannels); - pTDStretch->setChannels((int)numChannels); -} - - -// Sets new rate control value. Normal rate = 1.0, smaller values -// represent slower rate, larger faster rates. -void SoundTouch::setRate(double newRate) -{ - virtualRate = newRate; - calcEffectiveRateAndTempo(); -} - - -// Sets new rate control value as a difference in percents compared -// to the original rate (-50 .. +100 %) -void SoundTouch::setRateChange(double newRate) -{ - virtualRate = 1.0 + 0.01 * newRate; - calcEffectiveRateAndTempo(); -} - - -// Sets new tempo control value. Normal tempo = 1.0, smaller values -// represent slower tempo, larger faster tempo. -void SoundTouch::setTempo(double newTempo) -{ - virtualTempo = newTempo; - calcEffectiveRateAndTempo(); -} - - -// Sets new tempo control value as a difference in percents compared -// to the original tempo (-50 .. +100 %) -void SoundTouch::setTempoChange(double newTempo) -{ - virtualTempo = 1.0 + 0.01 * newTempo; - calcEffectiveRateAndTempo(); -} - - -// Sets new pitch control value. Original pitch = 1.0, smaller values -// represent lower pitches, larger values higher pitch. -void SoundTouch::setPitch(double newPitch) -{ - virtualPitch = newPitch; - calcEffectiveRateAndTempo(); -} - - -// Sets pitch change in octaves compared to the original pitch -// (-1.00 .. +1.00) -void SoundTouch::setPitchOctaves(double newPitch) -{ - virtualPitch = exp(0.69314718056 * newPitch); - calcEffectiveRateAndTempo(); -} - - -// Sets pitch change in semi-tones compared to the original pitch -// (-12 .. +12) -void SoundTouch::setPitchSemiTones(int newPitch) -{ - setPitchOctaves((double)newPitch / 12.0); -} - - -void SoundTouch::setPitchSemiTones(double newPitch) -{ - setPitchOctaves(newPitch / 12.0); -} - - -// Calculates 'effective' rate and tempo values from the -// nominal control values. -void SoundTouch::calcEffectiveRateAndTempo() -{ - double oldTempo = tempo; - double oldRate = rate; - - tempo = virtualTempo / virtualPitch; - rate = virtualPitch * virtualRate; - - if (!TEST_FLOAT_EQUAL(rate,oldRate)) pRateTransposer->setRate(rate); - if (!TEST_FLOAT_EQUAL(tempo, oldTempo)) pTDStretch->setTempo(tempo); - -#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER - if (rate <= 1.0f) - { - if (output != pTDStretch) - { - FIFOSamplePipe *tempoOut; - - ADM_assert(output == pRateTransposer); - // move samples in the current output buffer to the output of pTDStretch - tempoOut = pTDStretch->getOutput(); - tempoOut->moveSamples(*output); - // move samples in pitch transposer's store buffer to tempo changer's input - // deprecated : pTDStretch->moveSamples(*pRateTransposer->getStore()); - - output = pTDStretch; - } - } - else -#endif - { - if (output != pRateTransposer) - { - FIFOSamplePipe *transOut; - - ADM_assert(output == pTDStretch); - // move samples in the current output buffer to the output of pRateTransposer - transOut = pRateTransposer->getOutput(); - transOut->moveSamples(*output); - // move samples in tempo changer's input to pitch transposer's input - pRateTransposer->moveSamples(*pTDStretch->getInput()); - - output = pRateTransposer; - } - } -} - - -// Sets sample rate. -void SoundTouch::setSampleRate(uint srate) -{ - // set sample rate, leave other tempo changer parameters as they are. - pTDStretch->setParameters((int)srate); - bSrateSet = true; -} - - -// Adds 'numSamples' pcs of samples from the 'samples' memory position into -// the input of the object. -void SoundTouch::putSamples(const SAMPLETYPE *samples, uint nSamples) -{ - if (bSrateSet == false) - { - ST_THROW_RT_ERROR("SoundTouch : Sample rate not defined"); - } - else if (channels == 0) - { - ST_THROW_RT_ERROR("SoundTouch : Number of channels not defined"); - } - - // accumulate how many samples are expected out from processing, given the current - // processing setting - samplesExpectedOut += (double)nSamples / ((double)rate * (double)tempo); - -#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER - if (rate <= 1.0f) - { - // transpose the rate down, output the transposed sound to tempo changer buffer - ADM_assert(output == pTDStretch); - pRateTransposer->putSamples(samples, nSamples); - pTDStretch->moveSamples(*pRateTransposer); - } - else -#endif - { - // evaluate the tempo changer, then transpose the rate up, - ADM_assert(output == pRateTransposer); - pTDStretch->putSamples(samples, nSamples); - pRateTransposer->moveSamples(*pTDStretch); - } -} - - -// Flushes the last samples from the processing pipeline to the output. -// Clears also the internal processing buffers. -// -// Note: This function is meant for extracting the last samples of a sound -// stream. This function may introduce additional blank samples in the end -// of the sound stream, and thus it's not recommended to call this function -// in the middle of a sound stream. -void SoundTouch::flush() -{ - int i; - int numStillExpected; - SAMPLETYPE *buff = new SAMPLETYPE[128 * channels]; - - // how many samples are still expected to output - numStillExpected = (int)((long)(samplesExpectedOut + 0.5) - samplesOutput); - if (numStillExpected < 0) numStillExpected = 0; - - memset(buff, 0, 128 * channels * sizeof(SAMPLETYPE)); - // "Push" the last active samples out from the processing pipeline by - // feeding blank samples into the processing pipeline until new, - // processed samples appear in the output (not however, more than - // 24ksamples in any case) - for (i = 0; (numStillExpected > (int)numSamples()) && (i < 200); i ++) - { - putSamples(buff, 128); - } - - adjustAmountOfSamples(numStillExpected); - - delete[] buff; - - // Clear input buffers - pTDStretch->clearInput(); - // yet leave the output intouched as that's where the - // flushed samples are! -} - - -// Changes a setting controlling the processing system behaviour. See the -// 'SETTING_...' defines for available setting ID's. -bool SoundTouch::setSetting(int settingId, int value) -{ - int sampleRate, sequenceMs, seekWindowMs, overlapMs; - - // read current tdstretch routine parameters - pTDStretch->getParameters(&sampleRate, &sequenceMs, &seekWindowMs, &overlapMs); - - switch (settingId) - { - case SETTING_USE_AA_FILTER : - // enables / disabless anti-alias filter - pRateTransposer->enableAAFilter((value != 0) ? true : false); - return true; - - case SETTING_AA_FILTER_LENGTH : - // sets anti-alias filter length - pRateTransposer->getAAFilter()->setLength(value); - return true; - - case SETTING_USE_QUICKSEEK : - // enables / disables tempo routine quick seeking algorithm - pTDStretch->enableQuickSeek((value != 0) ? true : false); - return true; - - case SETTING_SEQUENCE_MS: - // change time-stretch sequence duration parameter - pTDStretch->setParameters(sampleRate, value, seekWindowMs, overlapMs); - return true; - - case SETTING_SEEKWINDOW_MS: - // change time-stretch seek window length parameter - pTDStretch->setParameters(sampleRate, sequenceMs, value, overlapMs); - return true; - - case SETTING_OVERLAP_MS: - // change time-stretch overlap length parameter - pTDStretch->setParameters(sampleRate, sequenceMs, seekWindowMs, value); - return true; - - default : - return false; - } -} - - -// Reads a setting controlling the processing system behaviour. See the -// 'SETTING_...' defines for available setting ID's. -// -// Returns the setting value. -int SoundTouch::getSetting(int settingId) const -{ - int temp; - - switch (settingId) - { - case SETTING_USE_AA_FILTER : - return (uint)pRateTransposer->isAAFilterEnabled(); - - case SETTING_AA_FILTER_LENGTH : - return pRateTransposer->getAAFilter()->getLength(); - - case SETTING_USE_QUICKSEEK : - return (uint)pTDStretch->isQuickSeekEnabled(); - - case SETTING_SEQUENCE_MS: - pTDStretch->getParameters(NULL, &temp, NULL, NULL); - return temp; - - case SETTING_SEEKWINDOW_MS: - pTDStretch->getParameters(NULL, NULL, &temp, NULL); - return temp; - - case SETTING_OVERLAP_MS: - pTDStretch->getParameters(NULL, NULL, NULL, &temp); - return temp; - - case SETTING_NOMINAL_INPUT_SEQUENCE : - { - int size = pTDStretch->getInputSampleReq(); - -#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER - if (rate <= 1.0) - { - // transposing done before timestretch, which impacts latency - return (int)(size * rate + 0.5); - } -#endif - return size; - } - - case SETTING_NOMINAL_OUTPUT_SEQUENCE : - { - int size = pTDStretch->getOutputBatchSize(); - - if (rate > 1.0) - { - // transposing done after timestretch, which impacts latency - return (int)(size / rate + 0.5); - } - return size; - } - - case SETTING_INITIAL_LATENCY: - { - double latency = pTDStretch->getLatency(); - int latency_tr = pRateTransposer->getLatency(); - -#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER - if (rate <= 1.0) - { - // transposing done before timestretch, which impacts latency - latency = (latency + latency_tr) * rate; - } - else -#endif - { - latency += (double)latency_tr / rate; - } - - return (int)(latency + 0.5); - } - - default : - return 0; - } -} - - -// Clears all the samples in the object's output and internal processing -// buffers. -void SoundTouch::clear() -{ - samplesExpectedOut = 0; - samplesOutput = 0; - pRateTransposer->clear(); - pTDStretch->clear(); -} - - -/// Returns number of samples currently unprocessed. -uint SoundTouch::numUnprocessedSamples() const -{ - FIFOSamplePipe * psp; - if (pTDStretch) - { - psp = pTDStretch->getInput(); - if (psp) - { - return psp->numSamples(); - } - } - return 0; -} - - -/// Output samples from beginning of the sample buffer. Copies requested samples to -/// output buffer and removes them from the sample buffer. If there are less than -/// 'numsample' samples in the buffer, returns all that available. -/// -/// \return Number of samples returned. -uint SoundTouch::receiveSamples(SAMPLETYPE *output, uint maxSamples) -{ - uint ret = FIFOProcessor::receiveSamples(output, maxSamples); - samplesOutput += (long)ret; - return ret; -} - - -/// Adjusts book-keeping so that given number of samples are removed from beginning of the -/// sample buffer without copying them anywhere. -/// -/// Used to reduce the number of samples in the buffer when accessing the sample buffer directly -/// with 'ptrBegin' function. -uint SoundTouch::receiveSamples(uint maxSamples) -{ - uint ret = FIFOProcessor::receiveSamples(maxSamples); - samplesOutput += (long)ret; - return ret; -} - - -/// Get ratio between input and output audio durations, useful for calculating -/// processed output duration: if you'll process a stream of N samples, then -/// you can expect to get out N * getInputOutputSampleRatio() samples. -double SoundTouch::getInputOutputSampleRatio() -{ - return 1.0 / (tempo * rate); -} +////////////////////////////////////////////////////////////////////////////// +/// +/// SoundTouch - main class for tempo/pitch/rate adjusting routines. +/// +/// Notes: +/// - Initialize the SoundTouch object instance by setting up the sound stream +/// parameters with functions 'setSampleRate' and 'setChannels', then set +/// desired tempo/pitch/rate settings with the corresponding functions. +/// +/// - The SoundTouch class behaves like a first-in-first-out pipeline: The +/// samples that are to be processed are fed into one of the pipe by calling +/// function 'putSamples', while the ready processed samples can be read +/// from the other end of the pipeline with function 'receiveSamples'. +/// +/// - The SoundTouch processing classes require certain sized 'batches' of +/// samples in order to process the sound. For this reason the classes buffer +/// incoming samples until there are enough of samples available for +/// processing, then they carry out the processing step and consequently +/// make the processed samples available for outputting. +/// +/// - For the above reason, the processing routines introduce a certain +/// 'latency' between the input and output, so that the samples input to +/// SoundTouch may not be immediately available in the output, and neither +/// the amount of outputtable samples may not immediately be in direct +/// relationship with the amount of previously input samples. +/// +/// - The tempo/pitch/rate control parameters can be altered during processing. +/// Please notice though that they aren't currently protected by semaphores, +/// so in multi-thread application external semaphore protection may be +/// required. +/// +/// - This class utilizes classes 'TDStretch' for tempo change (without modifying +/// pitch) and 'RateTransposer' for changing the playback rate (that is, both +/// tempo and pitch in the same ratio) of the sound. The third available control +/// 'pitch' (change pitch but maintain tempo) is produced by a combination of +/// combining the two other controls. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#include "ADM_default.h" +#include +#include +#include +#include + +#include "SoundTouch.h" +#include "TDStretch.h" +#include "RateTransposer.h" + +using namespace soundtouch; + +/// test if two floating point numbers are equal +#define TEST_FLOAT_EQUAL(a, b) (fabs(a - b) < 1e-10) + + +/// Print library version string for autoconf +extern "C" void soundtouch_ac_test() +{ + printf("SoundTouch Version: %s\n",SOUNDTOUCH_VERSION); +} + + +SoundTouch::SoundTouch() +{ + // Initialize rate transposer and tempo changer instances + + pRateTransposer = new RateTransposer(); + pTDStretch = TDStretch::newInstance(); + + setOutPipe(pTDStretch); + + rate = tempo = 0; + + virtualPitch = + virtualRate = + virtualTempo = 1.0; + + calcEffectiveRateAndTempo(); + + samplesExpectedOut = 0; + samplesOutput = 0; + + channels = 0; + bSrateSet = false; +} + + +SoundTouch::~SoundTouch() +{ + delete pRateTransposer; + delete pTDStretch; +} + + +/// Get SoundTouch library version string +const char *SoundTouch::getVersionString() +{ + static const char *_version = SOUNDTOUCH_VERSION; + + return _version; +} + + +/// Get SoundTouch library version Id +uint SoundTouch::getVersionId() +{ + return SOUNDTOUCH_VERSION_ID; +} + + +// Sets the number of channels, 1 = mono, 2 = stereo +void SoundTouch::setChannels(uint numChannels) +{ + if (!verifyNumberOfChannels(numChannels)) return; + + channels = numChannels; + pRateTransposer->setChannels((int)numChannels); + pTDStretch->setChannels((int)numChannels); +} + + +// Sets new rate control value. Normal rate = 1.0, smaller values +// represent slower rate, larger faster rates. +void SoundTouch::setRate(double newRate) +{ + virtualRate = newRate; + calcEffectiveRateAndTempo(); +} + + +// Sets new rate control value as a difference in percents compared +// to the original rate (-50 .. +100 %) +void SoundTouch::setRateChange(double newRate) +{ + virtualRate = 1.0 + 0.01 * newRate; + calcEffectiveRateAndTempo(); +} + + +// Sets new tempo control value. Normal tempo = 1.0, smaller values +// represent slower tempo, larger faster tempo. +void SoundTouch::setTempo(double newTempo) +{ + virtualTempo = newTempo; + calcEffectiveRateAndTempo(); +} + + +// Sets new tempo control value as a difference in percents compared +// to the original tempo (-50 .. +100 %) +void SoundTouch::setTempoChange(double newTempo) +{ + virtualTempo = 1.0 + 0.01 * newTempo; + calcEffectiveRateAndTempo(); +} + + +// Sets new pitch control value. Original pitch = 1.0, smaller values +// represent lower pitches, larger values higher pitch. +void SoundTouch::setPitch(double newPitch) +{ + virtualPitch = newPitch; + calcEffectiveRateAndTempo(); +} + + +// Sets pitch change in octaves compared to the original pitch +// (-1.00 .. +1.00) +void SoundTouch::setPitchOctaves(double newPitch) +{ + virtualPitch = exp(0.69314718056 * newPitch); + calcEffectiveRateAndTempo(); +} + + +// Sets pitch change in semi-tones compared to the original pitch +// (-12 .. +12) +void SoundTouch::setPitchSemiTones(int newPitch) +{ + setPitchOctaves((double)newPitch / 12.0); +} + + +void SoundTouch::setPitchSemiTones(double newPitch) +{ + setPitchOctaves(newPitch / 12.0); +} + + +// Calculates 'effective' rate and tempo values from the +// nominal control values. +void SoundTouch::calcEffectiveRateAndTempo() +{ + double oldTempo = tempo; + double oldRate = rate; + + tempo = virtualTempo / virtualPitch; + rate = virtualPitch * virtualRate; + + if (!TEST_FLOAT_EQUAL(rate,oldRate)) pRateTransposer->setRate(rate); + if (!TEST_FLOAT_EQUAL(tempo, oldTempo)) pTDStretch->setTempo(tempo); + +#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER + if (rate <= 1.0f) + { + if (output != pTDStretch) + { + FIFOSamplePipe *tempoOut; + + ADM_assert(output == pRateTransposer); + // move samples in the current output buffer to the output of pTDStretch + tempoOut = pTDStretch->getOutput(); + tempoOut->moveSamples(*output); + // move samples in pitch transposer's store buffer to tempo changer's input + // deprecated : pTDStretch->moveSamples(*pRateTransposer->getStore()); + + output = pTDStretch; + } + } + else +#endif + { + if (output != pRateTransposer) + { + FIFOSamplePipe *transOut; + + ADM_assert(output == pTDStretch); + // move samples in the current output buffer to the output of pRateTransposer + transOut = pRateTransposer->getOutput(); + transOut->moveSamples(*output); + // move samples in tempo changer's input to pitch transposer's input + pRateTransposer->moveSamples(*pTDStretch->getInput()); + + output = pRateTransposer; + } + } +} + + +// Sets sample rate. +void SoundTouch::setSampleRate(uint srate) +{ + // set sample rate, leave other tempo changer parameters as they are. + pTDStretch->setParameters((int)srate); + bSrateSet = true; +} + + +// Adds 'numSamples' pcs of samples from the 'samples' memory position into +// the input of the object. +void SoundTouch::putSamples(const SAMPLETYPE *samples, uint nSamples) +{ + if (bSrateSet == false) + { + ST_THROW_RT_ERROR("SoundTouch : Sample rate not defined"); + } + else if (channels == 0) + { + ST_THROW_RT_ERROR("SoundTouch : Number of channels not defined"); + } + + // accumulate how many samples are expected out from processing, given the current + // processing setting + samplesExpectedOut += (double)nSamples / ((double)rate * (double)tempo); + +#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER + if (rate <= 1.0f) + { + // transpose the rate down, output the transposed sound to tempo changer buffer + ADM_assert(output == pTDStretch); + pRateTransposer->putSamples(samples, nSamples); + pTDStretch->moveSamples(*pRateTransposer); + } + else +#endif + { + // evaluate the tempo changer, then transpose the rate up, + ADM_assert(output == pRateTransposer); + pTDStretch->putSamples(samples, nSamples); + pRateTransposer->moveSamples(*pTDStretch); + } +} + + +// Flushes the last samples from the processing pipeline to the output. +// Clears also the internal processing buffers. +// +// Note: This function is meant for extracting the last samples of a sound +// stream. This function may introduce additional blank samples in the end +// of the sound stream, and thus it's not recommended to call this function +// in the middle of a sound stream. +void SoundTouch::flush() +{ + int i; + int numStillExpected; + SAMPLETYPE *buff = new SAMPLETYPE[128 * channels]; + + // how many samples are still expected to output + numStillExpected = (int)((long)(samplesExpectedOut + 0.5) - samplesOutput); + if (numStillExpected < 0) numStillExpected = 0; + + memset(buff, 0, 128 * channels * sizeof(SAMPLETYPE)); + // "Push" the last active samples out from the processing pipeline by + // feeding blank samples into the processing pipeline until new, + // processed samples appear in the output (not however, more than + // 24ksamples in any case) + for (i = 0; (numStillExpected > (int)numSamples()) && (i < 200); i ++) + { + putSamples(buff, 128); + } + + adjustAmountOfSamples(numStillExpected); + + delete[] buff; + + // Clear input buffers + pTDStretch->clearInput(); + // yet leave the output intouched as that's where the + // flushed samples are! +} + + +// Changes a setting controlling the processing system behaviour. See the +// 'SETTING_...' defines for available setting ID's. +bool SoundTouch::setSetting(int settingId, int value) +{ + int sampleRate, sequenceMs, seekWindowMs, overlapMs; + + // read current tdstretch routine parameters + pTDStretch->getParameters(&sampleRate, &sequenceMs, &seekWindowMs, &overlapMs); + + switch (settingId) + { + case SETTING_USE_AA_FILTER : + // enables / disabless anti-alias filter + pRateTransposer->enableAAFilter((value != 0) ? true : false); + return true; + + case SETTING_AA_FILTER_LENGTH : + // sets anti-alias filter length + pRateTransposer->getAAFilter()->setLength(value); + return true; + + case SETTING_USE_QUICKSEEK : + // enables / disables tempo routine quick seeking algorithm + pTDStretch->enableQuickSeek((value != 0) ? true : false); + return true; + + case SETTING_SEQUENCE_MS: + // change time-stretch sequence duration parameter + pTDStretch->setParameters(sampleRate, value, seekWindowMs, overlapMs); + return true; + + case SETTING_SEEKWINDOW_MS: + // change time-stretch seek window length parameter + pTDStretch->setParameters(sampleRate, sequenceMs, value, overlapMs); + return true; + + case SETTING_OVERLAP_MS: + // change time-stretch overlap length parameter + pTDStretch->setParameters(sampleRate, sequenceMs, seekWindowMs, value); + return true; + + default : + return false; + } +} + + +// Reads a setting controlling the processing system behaviour. See the +// 'SETTING_...' defines for available setting ID's. +// +// Returns the setting value. +int SoundTouch::getSetting(int settingId) const +{ + int temp; + + switch (settingId) + { + case SETTING_USE_AA_FILTER : + return (uint)pRateTransposer->isAAFilterEnabled(); + + case SETTING_AA_FILTER_LENGTH : + return pRateTransposer->getAAFilter()->getLength(); + + case SETTING_USE_QUICKSEEK : + return (uint)pTDStretch->isQuickSeekEnabled(); + + case SETTING_SEQUENCE_MS: + pTDStretch->getParameters(NULL, &temp, NULL, NULL); + return temp; + + case SETTING_SEEKWINDOW_MS: + pTDStretch->getParameters(NULL, NULL, &temp, NULL); + return temp; + + case SETTING_OVERLAP_MS: + pTDStretch->getParameters(NULL, NULL, NULL, &temp); + return temp; + + case SETTING_NOMINAL_INPUT_SEQUENCE : + { + int size = pTDStretch->getInputSampleReq(); + +#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER + if (rate <= 1.0) + { + // transposing done before timestretch, which impacts latency + return (int)(size * rate + 0.5); + } +#endif + return size; + } + + case SETTING_NOMINAL_OUTPUT_SEQUENCE : + { + int size = pTDStretch->getOutputBatchSize(); + + if (rate > 1.0) + { + // transposing done after timestretch, which impacts latency + return (int)(size / rate + 0.5); + } + return size; + } + + case SETTING_INITIAL_LATENCY: + { + double latency = pTDStretch->getLatency(); + int latency_tr = pRateTransposer->getLatency(); + +#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER + if (rate <= 1.0) + { + // transposing done before timestretch, which impacts latency + latency = (latency + latency_tr) * rate; + } + else +#endif + { + latency += (double)latency_tr / rate; + } + + return (int)(latency + 0.5); + } + + default : + return 0; + } +} + + +// Clears all the samples in the object's output and internal processing +// buffers. +void SoundTouch::clear() +{ + samplesExpectedOut = 0; + samplesOutput = 0; + pRateTransposer->clear(); + pTDStretch->clear(); +} + + +/// Returns number of samples currently unprocessed. +uint SoundTouch::numUnprocessedSamples() const +{ + FIFOSamplePipe * psp; + if (pTDStretch) + { + psp = pTDStretch->getInput(); + if (psp) + { + return psp->numSamples(); + } + } + return 0; +} + + +/// Output samples from beginning of the sample buffer. Copies requested samples to +/// output buffer and removes them from the sample buffer. If there are less than +/// 'numsample' samples in the buffer, returns all that available. +/// +/// \return Number of samples returned. +uint SoundTouch::receiveSamples(SAMPLETYPE *output, uint maxSamples) +{ + uint ret = FIFOProcessor::receiveSamples(output, maxSamples); + samplesOutput += (long)ret; + return ret; +} + + +/// Adjusts book-keeping so that given number of samples are removed from beginning of the +/// sample buffer without copying them anywhere. +/// +/// Used to reduce the number of samples in the buffer when accessing the sample buffer directly +/// with 'ptrBegin' function. +uint SoundTouch::receiveSamples(uint maxSamples) +{ + uint ret = FIFOProcessor::receiveSamples(maxSamples); + samplesOutput += (long)ret; + return ret; +} + + +/// Get ratio between input and output audio durations, useful for calculating +/// processed output duration: if you'll process a stream of N samples, then +/// you can expect to get out N * getInputOutputSampleRatio() samples. +double SoundTouch::getInputOutputSampleRatio() +{ + return 1.0 / (tempo * rate); +} diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/SoundTouch.h b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/SoundTouch.h index 49b03069fe..850b9c7591 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/SoundTouch.h +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/SoundTouch.h @@ -1,348 +1,348 @@ -////////////////////////////////////////////////////////////////////////////// -/// -/// SoundTouch - main class for tempo/pitch/rate adjusting routines. -/// -/// Notes: -/// - Initialize the SoundTouch object instance by setting up the sound stream -/// parameters with functions 'setSampleRate' and 'setChannels', then set -/// desired tempo/pitch/rate settings with the corresponding functions. -/// -/// - The SoundTouch class behaves like a first-in-first-out pipeline: The -/// samples that are to be processed are fed into one of the pipe by calling -/// function 'putSamples', while the ready processed samples can be read -/// from the other end of the pipeline with function 'receiveSamples'. -/// -/// - The SoundTouch processing classes require certain sized 'batches' of -/// samples in order to process the sound. For this reason the classes buffer -/// incoming samples until there are enough of samples available for -/// processing, then they carry out the processing step and consequently -/// make the processed samples available for outputting. -/// -/// - For the above reason, the processing routines introduce a certain -/// 'latency' between the input and output, so that the samples input to -/// SoundTouch may not be immediately available in the output, and neither -/// the amount of outputtable samples may not immediately be in direct -/// relationship with the amount of previously input samples. -/// -/// - The tempo/pitch/rate control parameters can be altered during processing. -/// Please notice though that they aren't currently protected by semaphores, -/// so in multi-thread application external semaphore protection may be -/// required. -/// -/// - This class utilizes classes 'TDStretch' for tempo change (without modifying -/// pitch) and 'RateTransposer' for changing the playback rate (that is, both -/// tempo and pitch in the same ratio) of the sound. The third available control -/// 'pitch' (change pitch but maintain tempo) is produced by a combination of -/// combining the two other controls. -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef SoundTouch_H -#define SoundTouch_H - -#include "FIFOSamplePipe.h" -#include "STTypes.h" - -namespace soundtouch -{ - -/// Soundtouch library version string -#define SOUNDTOUCH_VERSION "2.3.1" - -/// SoundTouch library version id -#define SOUNDTOUCH_VERSION_ID (20301) - -// -// Available setting IDs for the 'setSetting' & 'get_setting' functions: - -/// Enable/disable anti-alias filter in pitch transposer (0 = disable) -#define SETTING_USE_AA_FILTER 0 - -/// Pitch transposer anti-alias filter length (8 .. 128 taps, default = 32) -#define SETTING_AA_FILTER_LENGTH 1 - -/// Enable/disable quick seeking algorithm in tempo changer routine -/// (enabling quick seeking lowers CPU utilization but causes a minor sound -/// quality compromising) -#define SETTING_USE_QUICKSEEK 2 - -/// Time-stretch algorithm single processing sequence length in milliseconds. This determines -/// to how long sequences the original sound is chopped in the time-stretch algorithm. -/// See "STTypes.h" or README for more information. -#define SETTING_SEQUENCE_MS 3 - -/// Time-stretch algorithm seeking window length in milliseconds for algorithm that finds the -/// best possible overlapping location. This determines from how wide window the algorithm -/// may look for an optimal joining location when mixing the sound sequences back together. -/// See "STTypes.h" or README for more information. -#define SETTING_SEEKWINDOW_MS 4 - -/// Time-stretch algorithm overlap length in milliseconds. When the chopped sound sequences -/// are mixed back together, to form a continuous sound stream, this parameter defines over -/// how long period the two consecutive sequences are let to overlap each other. -/// See "STTypes.h" or README for more information. -#define SETTING_OVERLAP_MS 5 - - -/// Call "getSetting" with this ID to query processing sequence size in samples. -/// This value gives approximate value of how many input samples you'll need to -/// feed into SoundTouch after initial buffering to get out a new batch of -/// output samples. -/// -/// This value does not include initial buffering at beginning of a new processing -/// stream, use SETTING_INITIAL_LATENCY to get the initial buffering size. -/// -/// Notices: -/// - This is read-only parameter, i.e. setSetting ignores this parameter -/// - This parameter value is not constant but change depending on -/// tempo/pitch/rate/samplerate settings. -#define SETTING_NOMINAL_INPUT_SEQUENCE 6 - - -/// Call "getSetting" with this ID to query nominal average processing output -/// size in samples. This value tells approcimate value how many output samples -/// SoundTouch outputs once it does DSP processing run for a batch of input samples. -/// -/// Notices: -/// - This is read-only parameter, i.e. setSetting ignores this parameter -/// - This parameter value is not constant but change depending on -/// tempo/pitch/rate/samplerate settings. -#define SETTING_NOMINAL_OUTPUT_SEQUENCE 7 - - -/// Call "getSetting" with this ID to query initial processing latency, i.e. -/// approx. how many samples you'll need to enter to SoundTouch pipeline before -/// you can expect to get first batch of ready output samples out. -/// -/// After the first output batch, you can then expect to get approx. -/// SETTING_NOMINAL_OUTPUT_SEQUENCE ready samples out for every -/// SETTING_NOMINAL_INPUT_SEQUENCE samples that you enter into SoundTouch. -/// -/// Example: -/// processing with parameter -tempo=5 -/// => initial latency = 5509 samples -/// input sequence = 4167 samples -/// output sequence = 3969 samples -/// -/// Accordingly, you can expect to feed in approx. 5509 samples at beginning of -/// the stream, and then you'll get out the first 3969 samples. After that, for -/// every approx. 4167 samples that you'll put in, you'll receive again approx. -/// 3969 samples out. -/// -/// This also means that average latency during stream processing is -/// INITIAL_LATENCY-OUTPUT_SEQUENCE/2, in the above example case 5509-3969/2 -/// = 3524 samples -/// -/// Notices: -/// - This is read-only parameter, i.e. setSetting ignores this parameter -/// - This parameter value is not constant but change depending on -/// tempo/pitch/rate/samplerate settings. -#define SETTING_INITIAL_LATENCY 8 - - -class SoundTouch : public FIFOProcessor -{ -private: - /// Rate transposer class instance - class RateTransposer *pRateTransposer; - - /// Time-stretch class instance - class TDStretch *pTDStretch; - - /// Virtual pitch parameter. Effective rate & tempo are calculated from these parameters. - double virtualRate; - - /// Virtual pitch parameter. Effective rate & tempo are calculated from these parameters. - double virtualTempo; - - /// Virtual pitch parameter. Effective rate & tempo are calculated from these parameters. - double virtualPitch; - - /// Flag: Has sample rate been set? - bool bSrateSet; - - /// Accumulator for how many samples in total will be expected as output vs. samples put in, - /// considering current processing settings. - double samplesExpectedOut; - - /// Accumulator for how many samples in total have been read out from the processing so far - long samplesOutput; - - /// Calculates effective rate & tempo valuescfrom 'virtualRate', 'virtualTempo' and - /// 'virtualPitch' parameters. - void calcEffectiveRateAndTempo(); - -protected : - /// Number of channels - uint channels; - - /// Effective 'rate' value calculated from 'virtualRate', 'virtualTempo' and 'virtualPitch' - double rate; - - /// Effective 'tempo' value calculated from 'virtualRate', 'virtualTempo' and 'virtualPitch' - double tempo; - -public: - SoundTouch(); - virtual ~SoundTouch() override; - - /// Get SoundTouch library version string - static const char *getVersionString(); - - /// Get SoundTouch library version Id - static uint getVersionId(); - - /// Sets new rate control value. Normal rate = 1.0, smaller values - /// represent slower rate, larger faster rates. - void setRate(double newRate); - - /// Sets new tempo control value. Normal tempo = 1.0, smaller values - /// represent slower tempo, larger faster tempo. - void setTempo(double newTempo); - - /// Sets new rate control value as a difference in percents compared - /// to the original rate (-50 .. +100 %) - void setRateChange(double newRate); - - /// Sets new tempo control value as a difference in percents compared - /// to the original tempo (-50 .. +100 %) - void setTempoChange(double newTempo); - - /// Sets new pitch control value. Original pitch = 1.0, smaller values - /// represent lower pitches, larger values higher pitch. - void setPitch(double newPitch); - - /// Sets pitch change in octaves compared to the original pitch - /// (-1.00 .. +1.00) - void setPitchOctaves(double newPitch); - - /// Sets pitch change in semi-tones compared to the original pitch - /// (-12 .. +12) - void setPitchSemiTones(int newPitch); - void setPitchSemiTones(double newPitch); - - /// Sets the number of channels, 1 = mono, 2 = stereo - void setChannels(uint numChannels); - - /// Sets sample rate. - void setSampleRate(uint srate); - - /// Get ratio between input and output audio durations, useful for calculating - /// processed output duration: if you'll process a stream of N samples, then - /// you can expect to get out N * getInputOutputSampleRatio() samples. - /// - /// This ratio will give accurate target duration ratio for a full audio track, - /// given that the the whole track is processed with same processing parameters. - /// - /// If this ratio is applied to calculate intermediate offsets inside a processing - /// stream, then this ratio is approximate and can deviate +- some tens of milliseconds - /// from ideal offset, yet by end of the audio stream the duration ratio will become - /// exact. - /// - /// Example: if processing with parameters "-tempo=15 -pitch=-3", the function - /// will return value 0.8695652... Now, if processing an audio stream whose duration - /// is exactly one million audio samples, then you can expect the processed - /// output duration be 0.869565 * 1000000 = 869565 samples. - double getInputOutputSampleRatio(); - - /// Flushes the last samples from the processing pipeline to the output. - /// Clears also the internal processing buffers. - // - /// Note: This function is meant for extracting the last samples of a sound - /// stream. This function may introduce additional blank samples in the end - /// of the sound stream, and thus it's not recommended to call this function - /// in the middle of a sound stream. - void flush(); - - /// Adds 'numSamples' pcs of samples from the 'samples' memory position into - /// the input of the object. Notice that sample rate _has_to_ be set before - /// calling this function, otherwise throws a runtime_error exception. - virtual void putSamples( - const SAMPLETYPE *samples, ///< Pointer to sample buffer. - uint numSamples ///< Number of samples in buffer. Notice - ///< that in case of stereo-sound a single sample - ///< contains data for both channels. - ) override; - - /// Output samples from beginning of the sample buffer. Copies requested samples to - /// output buffer and removes them from the sample buffer. If there are less than - /// 'numsample' samples in the buffer, returns all that available. - /// - /// \return Number of samples returned. - virtual uint receiveSamples(SAMPLETYPE *output, ///< Buffer where to copy output samples. - uint maxSamples ///< How many samples to receive at max. - ) override; - - /// Adjusts book-keeping so that given number of samples are removed from beginning of the - /// sample buffer without copying them anywhere. - /// - /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly - /// with 'ptrBegin' function. - virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. - ) override; - - /// Clears all the samples in the object's output and internal processing - /// buffers. - virtual void clear() override; - - /// Changes a setting controlling the processing system behaviour. See the - /// 'SETTING_...' defines for available setting ID's. - /// - /// \return 'true' if the setting was successfully changed - bool setSetting(int settingId, ///< Setting ID number. see SETTING_... defines. - int value ///< New setting value. - ); - - /// Reads a setting controlling the processing system behaviour. See the - /// 'SETTING_...' defines for available setting ID's. - /// - /// \return the setting value. - int getSetting(int settingId ///< Setting ID number, see SETTING_... defines. - ) const; - - /// Returns number of samples currently unprocessed. - virtual uint numUnprocessedSamples() const; - - /// Return number of channels - uint numChannels() const - { - return channels; - } - - /// Other handy functions that are implemented in the ancestor classes (see - /// classes 'FIFOProcessor' and 'FIFOSamplePipe') - /// - /// - receiveSamples() : Use this function to receive 'ready' processed samples from SoundTouch. - /// - numSamples() : Get number of 'ready' samples that can be received with - /// function 'receiveSamples()' - /// - isEmpty() : Returns nonzero if there aren't any 'ready' samples. - /// - clear() : Clears all samples from ready/processing buffers. -}; - -} -#endif +////////////////////////////////////////////////////////////////////////////// +/// +/// SoundTouch - main class for tempo/pitch/rate adjusting routines. +/// +/// Notes: +/// - Initialize the SoundTouch object instance by setting up the sound stream +/// parameters with functions 'setSampleRate' and 'setChannels', then set +/// desired tempo/pitch/rate settings with the corresponding functions. +/// +/// - The SoundTouch class behaves like a first-in-first-out pipeline: The +/// samples that are to be processed are fed into one of the pipe by calling +/// function 'putSamples', while the ready processed samples can be read +/// from the other end of the pipeline with function 'receiveSamples'. +/// +/// - The SoundTouch processing classes require certain sized 'batches' of +/// samples in order to process the sound. For this reason the classes buffer +/// incoming samples until there are enough of samples available for +/// processing, then they carry out the processing step and consequently +/// make the processed samples available for outputting. +/// +/// - For the above reason, the processing routines introduce a certain +/// 'latency' between the input and output, so that the samples input to +/// SoundTouch may not be immediately available in the output, and neither +/// the amount of outputtable samples may not immediately be in direct +/// relationship with the amount of previously input samples. +/// +/// - The tempo/pitch/rate control parameters can be altered during processing. +/// Please notice though that they aren't currently protected by semaphores, +/// so in multi-thread application external semaphore protection may be +/// required. +/// +/// - This class utilizes classes 'TDStretch' for tempo change (without modifying +/// pitch) and 'RateTransposer' for changing the playback rate (that is, both +/// tempo and pitch in the same ratio) of the sound. The third available control +/// 'pitch' (change pitch but maintain tempo) is produced by a combination of +/// combining the two other controls. +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef SoundTouch_H +#define SoundTouch_H + +#include "FIFOSamplePipe.h" +#include "STTypes.h" + +namespace soundtouch +{ + +/// Soundtouch library version string +#define SOUNDTOUCH_VERSION "2.3.1" + +/// SoundTouch library version id +#define SOUNDTOUCH_VERSION_ID (20301) + +// +// Available setting IDs for the 'setSetting' & 'get_setting' functions: + +/// Enable/disable anti-alias filter in pitch transposer (0 = disable) +#define SETTING_USE_AA_FILTER 0 + +/// Pitch transposer anti-alias filter length (8 .. 128 taps, default = 32) +#define SETTING_AA_FILTER_LENGTH 1 + +/// Enable/disable quick seeking algorithm in tempo changer routine +/// (enabling quick seeking lowers CPU utilization but causes a minor sound +/// quality compromising) +#define SETTING_USE_QUICKSEEK 2 + +/// Time-stretch algorithm single processing sequence length in milliseconds. This determines +/// to how long sequences the original sound is chopped in the time-stretch algorithm. +/// See "STTypes.h" or README for more information. +#define SETTING_SEQUENCE_MS 3 + +/// Time-stretch algorithm seeking window length in milliseconds for algorithm that finds the +/// best possible overlapping location. This determines from how wide window the algorithm +/// may look for an optimal joining location when mixing the sound sequences back together. +/// See "STTypes.h" or README for more information. +#define SETTING_SEEKWINDOW_MS 4 + +/// Time-stretch algorithm overlap length in milliseconds. When the chopped sound sequences +/// are mixed back together, to form a continuous sound stream, this parameter defines over +/// how long period the two consecutive sequences are let to overlap each other. +/// See "STTypes.h" or README for more information. +#define SETTING_OVERLAP_MS 5 + + +/// Call "getSetting" with this ID to query processing sequence size in samples. +/// This value gives approximate value of how many input samples you'll need to +/// feed into SoundTouch after initial buffering to get out a new batch of +/// output samples. +/// +/// This value does not include initial buffering at beginning of a new processing +/// stream, use SETTING_INITIAL_LATENCY to get the initial buffering size. +/// +/// Notices: +/// - This is read-only parameter, i.e. setSetting ignores this parameter +/// - This parameter value is not constant but change depending on +/// tempo/pitch/rate/samplerate settings. +#define SETTING_NOMINAL_INPUT_SEQUENCE 6 + + +/// Call "getSetting" with this ID to query nominal average processing output +/// size in samples. This value tells approcimate value how many output samples +/// SoundTouch outputs once it does DSP processing run for a batch of input samples. +/// +/// Notices: +/// - This is read-only parameter, i.e. setSetting ignores this parameter +/// - This parameter value is not constant but change depending on +/// tempo/pitch/rate/samplerate settings. +#define SETTING_NOMINAL_OUTPUT_SEQUENCE 7 + + +/// Call "getSetting" with this ID to query initial processing latency, i.e. +/// approx. how many samples you'll need to enter to SoundTouch pipeline before +/// you can expect to get first batch of ready output samples out. +/// +/// After the first output batch, you can then expect to get approx. +/// SETTING_NOMINAL_OUTPUT_SEQUENCE ready samples out for every +/// SETTING_NOMINAL_INPUT_SEQUENCE samples that you enter into SoundTouch. +/// +/// Example: +/// processing with parameter -tempo=5 +/// => initial latency = 5509 samples +/// input sequence = 4167 samples +/// output sequence = 3969 samples +/// +/// Accordingly, you can expect to feed in approx. 5509 samples at beginning of +/// the stream, and then you'll get out the first 3969 samples. After that, for +/// every approx. 4167 samples that you'll put in, you'll receive again approx. +/// 3969 samples out. +/// +/// This also means that average latency during stream processing is +/// INITIAL_LATENCY-OUTPUT_SEQUENCE/2, in the above example case 5509-3969/2 +/// = 3524 samples +/// +/// Notices: +/// - This is read-only parameter, i.e. setSetting ignores this parameter +/// - This parameter value is not constant but change depending on +/// tempo/pitch/rate/samplerate settings. +#define SETTING_INITIAL_LATENCY 8 + + +class SoundTouch : public FIFOProcessor +{ +private: + /// Rate transposer class instance + class RateTransposer *pRateTransposer; + + /// Time-stretch class instance + class TDStretch *pTDStretch; + + /// Virtual pitch parameter. Effective rate & tempo are calculated from these parameters. + double virtualRate; + + /// Virtual pitch parameter. Effective rate & tempo are calculated from these parameters. + double virtualTempo; + + /// Virtual pitch parameter. Effective rate & tempo are calculated from these parameters. + double virtualPitch; + + /// Flag: Has sample rate been set? + bool bSrateSet; + + /// Accumulator for how many samples in total will be expected as output vs. samples put in, + /// considering current processing settings. + double samplesExpectedOut; + + /// Accumulator for how many samples in total have been read out from the processing so far + long samplesOutput; + + /// Calculates effective rate & tempo valuescfrom 'virtualRate', 'virtualTempo' and + /// 'virtualPitch' parameters. + void calcEffectiveRateAndTempo(); + +protected : + /// Number of channels + uint channels; + + /// Effective 'rate' value calculated from 'virtualRate', 'virtualTempo' and 'virtualPitch' + double rate; + + /// Effective 'tempo' value calculated from 'virtualRate', 'virtualTempo' and 'virtualPitch' + double tempo; + +public: + SoundTouch(); + virtual ~SoundTouch() override; + + /// Get SoundTouch library version string + static const char *getVersionString(); + + /// Get SoundTouch library version Id + static uint getVersionId(); + + /// Sets new rate control value. Normal rate = 1.0, smaller values + /// represent slower rate, larger faster rates. + void setRate(double newRate); + + /// Sets new tempo control value. Normal tempo = 1.0, smaller values + /// represent slower tempo, larger faster tempo. + void setTempo(double newTempo); + + /// Sets new rate control value as a difference in percents compared + /// to the original rate (-50 .. +100 %) + void setRateChange(double newRate); + + /// Sets new tempo control value as a difference in percents compared + /// to the original tempo (-50 .. +100 %) + void setTempoChange(double newTempo); + + /// Sets new pitch control value. Original pitch = 1.0, smaller values + /// represent lower pitches, larger values higher pitch. + void setPitch(double newPitch); + + /// Sets pitch change in octaves compared to the original pitch + /// (-1.00 .. +1.00) + void setPitchOctaves(double newPitch); + + /// Sets pitch change in semi-tones compared to the original pitch + /// (-12 .. +12) + void setPitchSemiTones(int newPitch); + void setPitchSemiTones(double newPitch); + + /// Sets the number of channels, 1 = mono, 2 = stereo + void setChannels(uint numChannels); + + /// Sets sample rate. + void setSampleRate(uint srate); + + /// Get ratio between input and output audio durations, useful for calculating + /// processed output duration: if you'll process a stream of N samples, then + /// you can expect to get out N * getInputOutputSampleRatio() samples. + /// + /// This ratio will give accurate target duration ratio for a full audio track, + /// given that the the whole track is processed with same processing parameters. + /// + /// If this ratio is applied to calculate intermediate offsets inside a processing + /// stream, then this ratio is approximate and can deviate +- some tens of milliseconds + /// from ideal offset, yet by end of the audio stream the duration ratio will become + /// exact. + /// + /// Example: if processing with parameters "-tempo=15 -pitch=-3", the function + /// will return value 0.8695652... Now, if processing an audio stream whose duration + /// is exactly one million audio samples, then you can expect the processed + /// output duration be 0.869565 * 1000000 = 869565 samples. + double getInputOutputSampleRatio(); + + /// Flushes the last samples from the processing pipeline to the output. + /// Clears also the internal processing buffers. + // + /// Note: This function is meant for extracting the last samples of a sound + /// stream. This function may introduce additional blank samples in the end + /// of the sound stream, and thus it's not recommended to call this function + /// in the middle of a sound stream. + void flush(); + + /// Adds 'numSamples' pcs of samples from the 'samples' memory position into + /// the input of the object. Notice that sample rate _has_to_ be set before + /// calling this function, otherwise throws a runtime_error exception. + virtual void putSamples( + const SAMPLETYPE *samples, ///< Pointer to sample buffer. + uint numSamples ///< Number of samples in buffer. Notice + ///< that in case of stereo-sound a single sample + ///< contains data for both channels. + ) override; + + /// Output samples from beginning of the sample buffer. Copies requested samples to + /// output buffer and removes them from the sample buffer. If there are less than + /// 'numsample' samples in the buffer, returns all that available. + /// + /// \return Number of samples returned. + virtual uint receiveSamples(SAMPLETYPE *output, ///< Buffer where to copy output samples. + uint maxSamples ///< How many samples to receive at max. + ) override; + + /// Adjusts book-keeping so that given number of samples are removed from beginning of the + /// sample buffer without copying them anywhere. + /// + /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly + /// with 'ptrBegin' function. + virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. + ) override; + + /// Clears all the samples in the object's output and internal processing + /// buffers. + virtual void clear() override; + + /// Changes a setting controlling the processing system behaviour. See the + /// 'SETTING_...' defines for available setting ID's. + /// + /// \return 'true' if the setting was successfully changed + bool setSetting(int settingId, ///< Setting ID number. see SETTING_... defines. + int value ///< New setting value. + ); + + /// Reads a setting controlling the processing system behaviour. See the + /// 'SETTING_...' defines for available setting ID's. + /// + /// \return the setting value. + int getSetting(int settingId ///< Setting ID number, see SETTING_... defines. + ) const; + + /// Returns number of samples currently unprocessed. + virtual uint numUnprocessedSamples() const; + + /// Return number of channels + uint numChannels() const + { + return channels; + } + + /// Other handy functions that are implemented in the ancestor classes (see + /// classes 'FIFOProcessor' and 'FIFOSamplePipe') + /// + /// - receiveSamples() : Use this function to receive 'ready' processed samples from SoundTouch. + /// - numSamples() : Get number of 'ready' samples that can be received with + /// function 'receiveSamples()' + /// - isEmpty() : Returns nonzero if there aren't any 'ready' samples. + /// - clear() : Clears all samples from ready/processing buffers. +}; + +} +#endif diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/TDStretch.cpp b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/TDStretch.cpp index d394b99bfa..fdfff9a527 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/TDStretch.cpp +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/TDStretch.cpp @@ -1,1101 +1,1101 @@ -/////////////////////////////////////////////////////////////////////////////// -/// -/// Sampled sound tempo changer/time stretch algorithm. Changes the sound tempo -/// while maintaining the original pitch by using a time domain WSOLA-like -/// method with several performance-increasing tweaks. -/// -/// Notes : MMX optimized functions reside in a separate, platform-specific -/// file, e.g. 'mmx_win.cpp' or 'mmx_gcc.cpp'. -/// -/// This source file contains OpenMP optimizations that allow speeding up the -/// corss-correlation algorithm by executing it in several threads / CPU cores -/// in parallel. See the following article link for more detailed discussion -/// about SoundTouch OpenMP optimizations: -/// http://www.softwarecoven.com/parallel-computing-in-embedded-mobile-devices -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include -#include - -#include "STTypes.h" -#include "TDStretch.h" - -#include "ADM_default.h" - -using namespace soundtouch; - -#define max(x, y) (((x) > (y)) ? (x) : (y)) - -/***************************************************************************** - * - * Constant definitions - * - *****************************************************************************/ - -// Table for the hierarchical mixing position seeking algorithm -const short _scanOffsets[5][24]={ - { 124, 186, 248, 310, 372, 434, 496, 558, 620, 682, 744, 806, - 868, 930, 992, 1054, 1116, 1178, 1240, 1302, 1364, 1426, 1488, 0}, - {-100, -75, -50, -25, 25, 50, 75, 100, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { -20, -15, -10, -5, 5, 10, 15, 20, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { -4, -3, -2, -1, 1, 2, 3, 4, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 121, 114, 97, 114, 98, 105, 108, 32, 104, 99, 117, 111, - 116, 100, 110, 117, 111, 115, 0, 0, 0, 0, 0, 0}}; - -/***************************************************************************** - * - * Implementation of the class 'TDStretch' - * - *****************************************************************************/ - - -TDStretch::TDStretch() : FIFOProcessor(&outputBuffer) -{ - bQuickSeek = false; - channels = 2; - - pMidBuffer = NULL; - pMidBufferUnaligned = NULL; - overlapLength = 0; - - bAutoSeqSetting = true; - bAutoSeekSetting = true; - - tempo = 1.0f; - setParameters(44100, DEFAULT_SEQUENCE_MS, DEFAULT_SEEKWINDOW_MS, DEFAULT_OVERLAP_MS); - setTempo(1.0f); - - clear(); -} - - - -TDStretch::~TDStretch() -{ - delete[] pMidBufferUnaligned; -} - - - -// Sets routine control parameters. These control are certain time constants -// defining how the sound is stretched to the desired duration. -// -// 'sampleRate' = sample rate of the sound -// 'sequenceMS' = one processing sequence length in milliseconds (default = 82 ms) -// 'seekwindowMS' = seeking window length for scanning the best overlapping -// position (default = 28 ms) -// 'overlapMS' = overlapping length (default = 12 ms) - -void TDStretch::setParameters(int aSampleRate, int aSequenceMS, - int aSeekWindowMS, int aOverlapMS) -{ - // accept only positive parameter values - if zero or negative, use old values instead - if (aSampleRate > 0) - { - if (aSampleRate > 192000) ST_THROW_RT_ERROR("Error: Excessive samplerate"); - this->sampleRate = aSampleRate; - } - - if (aOverlapMS > 0) this->overlapMs = aOverlapMS; - - if (aSequenceMS > 0) - { - this->sequenceMs = aSequenceMS; - bAutoSeqSetting = false; - } - else if (aSequenceMS == 0) - { - // if zero, use automatic setting - bAutoSeqSetting = true; - } - - if (aSeekWindowMS > 0) - { - this->seekWindowMs = aSeekWindowMS; - bAutoSeekSetting = false; - } - else if (aSeekWindowMS == 0) - { - // if zero, use automatic setting - bAutoSeekSetting = true; - } - - calcSeqParameters(); - - calculateOverlapLength(overlapMs); - - // set tempo to recalculate 'sampleReq' - setTempo(tempo); -} - - - -/// Get routine control parameters, see setParameters() function. -/// Any of the parameters to this function can be NULL, in such case corresponding parameter -/// value isn't returned. -void TDStretch::getParameters(int *pSampleRate, int *pSequenceMs, int *pSeekWindowMs, int *pOverlapMs) const -{ - if (pSampleRate) - { - *pSampleRate = sampleRate; - } - - if (pSequenceMs) - { - *pSequenceMs = (bAutoSeqSetting) ? (USE_AUTO_SEQUENCE_LEN) : sequenceMs; - } - - if (pSeekWindowMs) - { - *pSeekWindowMs = (bAutoSeekSetting) ? (USE_AUTO_SEEKWINDOW_LEN) : seekWindowMs; - } - - if (pOverlapMs) - { - *pOverlapMs = overlapMs; - } -} - - -// Overlaps samples in 'midBuffer' with the samples in 'pInput' -void TDStretch::overlapMono(SAMPLETYPE *pOutput, const SAMPLETYPE *pInput) const -{ - int i; - SAMPLETYPE m1, m2; - - m1 = (SAMPLETYPE)0; - m2 = (SAMPLETYPE)overlapLength; - - for (i = 0; i < overlapLength ; i ++) - { - pOutput[i] = (pInput[i] * m1 + pMidBuffer[i] * m2 ) / overlapLength; - m1 += 1; - m2 -= 1; - } -} - - - -void TDStretch::clearMidBuffer() -{ - memset(pMidBuffer, 0, channels * sizeof(SAMPLETYPE) * overlapLength); -} - - -void TDStretch::clearInput() -{ - inputBuffer.clear(); - clearMidBuffer(); - isBeginning = true; - maxnorm = 0; - maxnormf = 1e8; - skipFract = 0; -} - - -// Clears the sample buffers -void TDStretch::clear() -{ - outputBuffer.clear(); - clearInput(); -} - - - -// Enables/disables the quick position seeking algorithm. Zero to disable, nonzero -// to enable -void TDStretch::enableQuickSeek(bool enable) -{ - bQuickSeek = enable; -} - - -// Returns nonzero if the quick seeking algorithm is enabled. -bool TDStretch::isQuickSeekEnabled() const -{ - return bQuickSeek; -} - - -// Seeks for the optimal overlap-mixing position. -int TDStretch::seekBestOverlapPosition(const SAMPLETYPE *refPos) -{ - if (bQuickSeek) - { - return seekBestOverlapPositionQuick(refPos); - } - else - { - return seekBestOverlapPositionFull(refPos); - } -} - - -// Overlaps samples in 'midBuffer' with the samples in 'pInputBuffer' at position -// of 'ovlPos'. -inline void TDStretch::overlap(SAMPLETYPE *pOutput, const SAMPLETYPE *pInput, uint ovlPos) const -{ -#ifndef USE_MULTICH_ALWAYS - if (channels == 1) - { - // mono sound. - overlapMono(pOutput, pInput + ovlPos); - } - else if (channels == 2) - { - // stereo sound - overlapStereo(pOutput, pInput + 2 * ovlPos); - } - else -#endif // USE_MULTICH_ALWAYS - { - ADM_assert(channels > 0); - overlapMulti(pOutput, pInput + channels * ovlPos); - } -} - - -// Seeks for the optimal overlap-mixing position. The 'stereo' version of the -// routine -// -// The best position is determined as the position where the two overlapped -// sample sequences are 'most alike', in terms of the highest cross-correlation -// value over the overlapping period -int TDStretch::seekBestOverlapPositionFull(const SAMPLETYPE *refPos) -{ - int bestOffs; - double bestCorr; - int i; - double norm; - - bestCorr = -FLT_MAX; - bestOffs = 0; - - // Scans for the best correlation value by testing each possible position - // over the permitted range. - bestCorr = calcCrossCorr(refPos, pMidBuffer, norm); - bestCorr = (bestCorr + 0.1) * 0.75; - - #pragma omp parallel for - for (i = 1; i < seekLength; i ++) - { - double corr; - // Calculates correlation value for the mixing position corresponding to 'i' -#if defined(_OPENMP) || defined(ST_SIMD_AVOID_UNALIGNED) - // in parallel OpenMP mode, can't use norm accumulator version as parallel executor won't - // iterate the loop in sequential order - // in SIMD mode, avoid accumulator version to allow avoiding unaligned positions - corr = calcCrossCorr(refPos + channels * i, pMidBuffer, norm); -#else - // In non-parallel version call "calcCrossCorrAccumulate" that is otherwise same - // as "calcCrossCorr", but saves time by reusing & updating previously stored - // "norm" value - corr = calcCrossCorrAccumulate(refPos + channels * i, pMidBuffer, norm); -#endif - // heuristic rule to slightly favour values close to mid of the range - double tmp = (double)(2 * i - seekLength) / (double)seekLength; - corr = ((corr + 0.1) * (1.0 - 0.25 * tmp * tmp)); - - // Checks for the highest correlation value - if (corr > bestCorr) - { - // For optimal performance, enter critical section only in case that best value found. - // in such case repeat 'if' condition as it's possible that parallel execution may have - // updated the bestCorr value in the mean time - #pragma omp critical - if (corr > bestCorr) - { - bestCorr = corr; - bestOffs = i; - } - } - } - -#ifdef SOUNDTOUCH_INTEGER_SAMPLES - adaptNormalizer(); -#endif - - // clear cross correlation routine state if necessary (is so e.g. in MMX routines). - clearCrossCorrState(); - - return bestOffs; -} - - -// Quick seek algorithm for improved runtime-performance: First roughly scans through the -// correlation area, and then scan surroundings of two best preliminary correlation candidates -// with improved precision -// -// Based on testing: -// - This algorithm gives on average 99% as good match as the full algorithm -// - this quick seek algorithm finds the best match on ~90% of cases -// - on those 10% of cases when this algorithm doesn't find best match, -// it still finds on average ~90% match vs. the best possible match -int TDStretch::seekBestOverlapPositionQuick(const SAMPLETYPE *refPos) -{ -#define _MIN(a, b) (((a) < (b)) ? (a) : (b)) -#define SCANSTEP 16 -#define SCANWIND 8 - - int bestOffs; - int i; - int bestOffs2; - float bestCorr, corr; - float bestCorr2; - double norm; - - // note: 'float' types used in this function in case that the platform would need to use software-fp - - bestCorr = - bestCorr2 = -FLT_MAX; - bestOffs = - bestOffs2 = SCANWIND; - - // Scans for the best correlation value by testing each possible position - // over the permitted range. Look for two best matches on the first pass to - // increase possibility of ideal match. - // - // Begin from "SCANSTEP" instead of SCANWIND to make the calculation - // catch the 'middlepoint' of seekLength vector as that's the a-priori - // expected best match position - // - // Roughly: - // - 15% of cases find best result directly on the first round, - // - 75% cases find better match on 2nd round around the best match from 1st round - // - 10% cases find better match on 2nd round around the 2nd-best-match from 1st round - for (i = SCANSTEP; i < seekLength - SCANWIND - 1; i += SCANSTEP) - { - // Calculates correlation value for the mixing position corresponding - // to 'i' - corr = (float)calcCrossCorr(refPos + channels*i, pMidBuffer, norm); - // heuristic rule to slightly favour values close to mid of the seek range - float tmp = (float)(2 * i - seekLength - 1) / (float)seekLength; - corr = ((corr + 0.1f) * (1.0f - 0.25f * tmp * tmp)); - - // Checks for the highest correlation value - if (corr > bestCorr) - { - // found new best match. keep the previous best as 2nd best match - bestCorr2 = bestCorr; - bestOffs2 = bestOffs; - bestCorr = corr; - bestOffs = i; - } - else if (corr > bestCorr2) - { - // not new best, but still new 2nd best match - bestCorr2 = corr; - bestOffs2 = i; - } - } - - // Scans surroundings of the found best match with small stepping - int end = _MIN(bestOffs + SCANWIND + 1, seekLength); - for (i = bestOffs - SCANWIND; i < end; i++) - { - if (i == bestOffs) continue; // this offset already calculated, thus skip - - // Calculates correlation value for the mixing position corresponding - // to 'i' - corr = (float)calcCrossCorr(refPos + channels*i, pMidBuffer, norm); - // heuristic rule to slightly favour values close to mid of the range - float tmp = (float)(2 * i - seekLength - 1) / (float)seekLength; - corr = ((corr + 0.1f) * (1.0f - 0.25f * tmp * tmp)); - - // Checks for the highest correlation value - if (corr > bestCorr) - { - bestCorr = corr; - bestOffs = i; - } - } - - // Scans surroundings of the 2nd best match with small stepping - end = _MIN(bestOffs2 + SCANWIND + 1, seekLength); - for (i = bestOffs2 - SCANWIND; i < end; i++) - { - if (i == bestOffs2) continue; // this offset already calculated, thus skip - - // Calculates correlation value for the mixing position corresponding - // to 'i' - corr = (float)calcCrossCorr(refPos + channels*i, pMidBuffer, norm); - // heuristic rule to slightly favour values close to mid of the range - float tmp = (float)(2 * i - seekLength - 1) / (float)seekLength; - corr = ((corr + 0.1f) * (1.0f - 0.25f * tmp * tmp)); - - // Checks for the highest correlation value - if (corr > bestCorr) - { - bestCorr = corr; - bestOffs = i; - } - } - - // clear cross correlation routine state if necessary (is so e.g. in MMX routines). - clearCrossCorrState(); - -#ifdef SOUNDTOUCH_INTEGER_SAMPLES - adaptNormalizer(); -#endif - - return bestOffs; -} - - - - -/// For integer algorithm: adapt normalization factor divider with music so that -/// it'll not be pessimistically restrictive that can degrade quality on quieter sections -/// yet won't cause integer overflows either -void TDStretch::adaptNormalizer() -{ - // Do not adapt normalizer over too silent sequences to avoid averaging filter depleting to - // too low values during pauses in music - if ((maxnorm > 1000) || (maxnormf > 40000000)) - { - //norm averaging filter - maxnormf = 0.9f * maxnormf + 0.1f * (float)maxnorm; - - if ((maxnorm > 800000000) && (overlapDividerBitsNorm < 16)) - { - // large values, so increase divider - overlapDividerBitsNorm++; - if (maxnorm > 1600000000) overlapDividerBitsNorm++; // extra large value => extra increase - } - else if ((maxnormf < 1000000) && (overlapDividerBitsNorm > 0)) - { - // extra small values, decrease divider - overlapDividerBitsNorm--; - } - } - - maxnorm = 0; -} - - -/// clear cross correlation routine state if necessary -void TDStretch::clearCrossCorrState() -{ - // default implementation is empty. -} - - -/// Calculates processing sequence length according to tempo setting -void TDStretch::calcSeqParameters() -{ - // Adjust tempo param according to tempo, so that variating processing sequence length is used - // at various tempo settings, between the given low...top limits - #define AUTOSEQ_TEMPO_LOW 0.5 // auto setting low tempo range (-50%) - #define AUTOSEQ_TEMPO_TOP 2.0 // auto setting top tempo range (+100%) - - // sequence-ms setting values at above low & top tempo - #define AUTOSEQ_AT_MIN 90.0 - #define AUTOSEQ_AT_MAX 40.0 - #define AUTOSEQ_K ((AUTOSEQ_AT_MAX - AUTOSEQ_AT_MIN) / (AUTOSEQ_TEMPO_TOP - AUTOSEQ_TEMPO_LOW)) - #define AUTOSEQ_C (AUTOSEQ_AT_MIN - (AUTOSEQ_K) * (AUTOSEQ_TEMPO_LOW)) - - // seek-window-ms setting values at above low & top tempoq - #define AUTOSEEK_AT_MIN 20.0 - #define AUTOSEEK_AT_MAX 15.0 - #define AUTOSEEK_K ((AUTOSEEK_AT_MAX - AUTOSEEK_AT_MIN) / (AUTOSEQ_TEMPO_TOP - AUTOSEQ_TEMPO_LOW)) - #define AUTOSEEK_C (AUTOSEEK_AT_MIN - (AUTOSEEK_K) * (AUTOSEQ_TEMPO_LOW)) - - #define CHECK_LIMITS(x, mi, ma) (((x) < (mi)) ? (mi) : (((x) > (ma)) ? (ma) : (x))) - - double seq, seek; - - if (bAutoSeqSetting) - { - seq = AUTOSEQ_C + AUTOSEQ_K * tempo; - seq = CHECK_LIMITS(seq, AUTOSEQ_AT_MAX, AUTOSEQ_AT_MIN); - sequenceMs = (int)(seq + 0.5); - } - - if (bAutoSeekSetting) - { - seek = AUTOSEEK_C + AUTOSEEK_K * tempo; - seek = CHECK_LIMITS(seek, AUTOSEEK_AT_MAX, AUTOSEEK_AT_MIN); - seekWindowMs = (int)(seek + 0.5); - } - - // Update seek window lengths - seekWindowLength = (sampleRate * sequenceMs) / 1000; - if (seekWindowLength < 2 * overlapLength) - { - seekWindowLength = 2 * overlapLength; - } - seekLength = (sampleRate * seekWindowMs) / 1000; -} - - - -// Sets new target tempo. Normal tempo = 'SCALE', smaller values represent slower -// tempo, larger faster tempo. -void TDStretch::setTempo(double newTempo) -{ - int intskip; - - tempo = newTempo; - - // Calculate new sequence duration - calcSeqParameters(); - - // Calculate ideal skip length (according to tempo value) - nominalSkip = tempo * (seekWindowLength - overlapLength); - intskip = (int)(nominalSkip + 0.5); - - // Calculate how many samples are needed in the 'inputBuffer' to - // process another batch of samples - //sampleReq = max(intskip + overlapLength, seekWindowLength) + seekLength / 2; - sampleReq = max(intskip + overlapLength, seekWindowLength) + seekLength; -} - - - -// Sets the number of channels, 1 = mono, 2 = stereo -void TDStretch::setChannels(int numChannels) -{ - if (!verifyNumberOfChannels(numChannels) || - (channels == numChannels)) return; - - channels = numChannels; - inputBuffer.setChannels(channels); - outputBuffer.setChannels(channels); - - // re-init overlap/buffer - overlapLength=0; - setParameters(sampleRate); -} - - -// nominal tempo, no need for processing, just pass the samples through -// to outputBuffer -/* -void TDStretch::processNominalTempo() -{ - ADM_assert(tempo == 1.0f); - - if (bMidBufferDirty) - { - // If there are samples in pMidBuffer waiting for overlapping, - // do a single sliding overlapping with them in order to prevent a - // clicking distortion in the output sound - if (inputBuffer.numSamples() < overlapLength) - { - // wait until we've got overlapLength input samples - return; - } - // Mix the samples in the beginning of 'inputBuffer' with the - // samples in 'midBuffer' using sliding overlapping - overlap(outputBuffer.ptrEnd(overlapLength), inputBuffer.ptrBegin(), 0); - outputBuffer.putSamples(overlapLength); - inputBuffer.receiveSamples(overlapLength); - clearMidBuffer(); - // now we've caught the nominal sample flow and may switch to - // bypass mode - } - - // Simply bypass samples from input to output - outputBuffer.moveSamples(inputBuffer); -} -*/ - - -// Processes as many processing frames of the samples 'inputBuffer', store -// the result into 'outputBuffer' -void TDStretch::processSamples() -{ - int ovlSkip; - int offset = 0; - int temp; - - /* Removed this small optimization - can introduce a click to sound when tempo setting - crosses the nominal value - if (tempo == 1.0f) - { - // tempo not changed from the original, so bypass the processing - processNominalTempo(); - return; - } - */ - - // Process samples as long as there are enough samples in 'inputBuffer' - // to form a processing frame. - while ((int)inputBuffer.numSamples() >= sampleReq) - { - if (isBeginning == false) - { - // apart from the very beginning of the track, - // scan for the best overlapping position & do overlap-add - offset = seekBestOverlapPosition(inputBuffer.ptrBegin()); - - // Mix the samples in the 'inputBuffer' at position of 'offset' with the - // samples in 'midBuffer' using sliding overlapping - // ... first partially overlap with the end of the previous sequence - // (that's in 'midBuffer') - overlap(outputBuffer.ptrEnd((uint)overlapLength), inputBuffer.ptrBegin(), (uint)offset); - outputBuffer.putSamples((uint)overlapLength); - offset += overlapLength; - } - else - { - // Adjust processing offset at beginning of track by not perform initial overlapping - // and compensating that in the 'input buffer skip' calculation - isBeginning = false; - int skip = (int)(tempo * overlapLength + 0.5 * seekLength + 0.5); - - #ifdef ST_SIMD_AVOID_UNALIGNED - // in SIMD mode, round the skip amount to value corresponding to aligned memory address - if (channels == 1) - { - skip &= -4; - } - else if (channels == 2) - { - skip &= -2; - } - #endif - skipFract -= skip; - if (skipFract <= -nominalSkip) - { - skipFract = -nominalSkip; - } - } - - // ... then copy sequence samples from 'inputBuffer' to output: - - // crosscheck that we don't have buffer overflow... - if ((int)inputBuffer.numSamples() < (offset + seekWindowLength - overlapLength)) - { - continue; // just in case, shouldn't really happen - } - - // length of sequence - temp = (seekWindowLength - 2 * overlapLength); - outputBuffer.putSamples(inputBuffer.ptrBegin() + channels * offset, (uint)temp); - - // Copies the end of the current sequence from 'inputBuffer' to - // 'midBuffer' for being mixed with the beginning of the next - // processing sequence and so on - ADM_assert((offset + temp + overlapLength) <= (int)inputBuffer.numSamples()); - memcpy(pMidBuffer, inputBuffer.ptrBegin() + channels * (offset + temp), - channels * sizeof(SAMPLETYPE) * overlapLength); - - // Remove the processed samples from the input buffer. Update - // the difference between integer & nominal skip step to 'skipFract' - // in order to prevent the error from accumulating over time. - skipFract += nominalSkip; // real skip size - ovlSkip = (int)skipFract; // rounded to integer skip - skipFract -= ovlSkip; // maintain the fraction part, i.e. real vs. integer skip - inputBuffer.receiveSamples((uint)ovlSkip); - } -} - - -// Adds 'numsamples' pcs of samples from the 'samples' memory position into -// the input of the object. -void TDStretch::putSamples(const SAMPLETYPE *samples, uint nSamples) -{ - // Add the samples into the input buffer - inputBuffer.putSamples(samples, nSamples); - // Process the samples in input buffer - processSamples(); -} - - - -/// Set new overlap length parameter & reallocate RefMidBuffer if necessary. -void TDStretch::acceptNewOverlapLength(int newOverlapLength) -{ - int prevOvl; - - ADM_assert(newOverlapLength >= 0); - prevOvl = overlapLength; - overlapLength = newOverlapLength; - - if (overlapLength > prevOvl) - { - delete[] pMidBufferUnaligned; - - pMidBufferUnaligned = new SAMPLETYPE[overlapLength * channels + 16 / sizeof(SAMPLETYPE)]; - // ensure that 'pMidBuffer' is aligned to 16 byte boundary for efficiency - pMidBuffer = (SAMPLETYPE *)SOUNDTOUCH_ALIGN_POINTER_16(pMidBufferUnaligned); - - clearMidBuffer(); - } -} - - -// Operator 'new' is overloaded so that it automatically creates a suitable instance -// depending on if we've a MMX/SSE/etc-capable CPU available or not. -void * TDStretch::operator new(size_t s) -{ - // Notice! don't use "new TDStretch" directly, use "newInstance" to create a new instance instead! - ST_THROW_RT_ERROR("Error in TDStretch::new: Don't use 'new TDStretch' directly, use 'newInstance' member instead!"); - return newInstance(); -} - - -TDStretch * TDStretch::newInstance() -{ - // Check if MMX/SSE instruction set extensions supported by CPU - -#ifdef SOUNDTOUCH_ALLOW_MMX - // MMX routines available only with integer sample types - if (CpuCaps::hasMMX()) - { - return ::new TDStretchMMX; - } - else -#endif // SOUNDTOUCH_ALLOW_MMX - -#ifdef SOUNDTOUCH_ALLOW_SSE - if (CpuCaps::hasSSE()) - { - // SSE support - return ::new TDStretchSSE; - } - else -#endif // SOUNDTOUCH_ALLOW_SSE - - { - // ISA optimizations not supported, use plain C version - return ::new TDStretch; - } -} - - -////////////////////////////////////////////////////////////////////////////// -// -// Integer arithmetic specific algorithm implementations. -// -////////////////////////////////////////////////////////////////////////////// - -#ifdef SOUNDTOUCH_INTEGER_SAMPLES - -// Overlaps samples in 'midBuffer' with the samples in 'input'. The 'Stereo' -// version of the routine. -void TDStretch::overlapStereo(short *poutput, const short *input) const -{ - int i; - short temp; - int cnt2; - - for (i = 0; i < overlapLength ; i ++) - { - temp = (short)(overlapLength - i); - cnt2 = 2 * i; - poutput[cnt2] = (input[cnt2] * i + pMidBuffer[cnt2] * temp ) / overlapLength; - poutput[cnt2 + 1] = (input[cnt2 + 1] * i + pMidBuffer[cnt2 + 1] * temp ) / overlapLength; - } -} - - -// Overlaps samples in 'midBuffer' with the samples in 'input'. The 'Multi' -// version of the routine. -void TDStretch::overlapMulti(short *poutput, const short *input) const -{ - short m1; - int i = 0; - - for (m1 = 0; m1 < overlapLength; m1 ++) - { - short m2 = (short)(overlapLength - m1); - for (int c = 0; c < channels; c ++) - { - poutput[i] = (input[i] * m1 + pMidBuffer[i] * m2) / overlapLength; - i++; - } - } -} - -// Calculates the x having the closest 2^x value for the given value -static int _getClosest2Power(double value) -{ - return (int)(log(value) / log(2.0) + 0.5); -} - - -/// Calculates overlap period length in samples. -/// Integer version rounds overlap length to closest power of 2 -/// for a divide scaling operation. -void TDStretch::calculateOverlapLength(int aoverlapMs) -{ - int newOvl; - - ADM_assert(aoverlapMs >= 0); - - // calculate overlap length so that it's power of 2 - thus it's easy to do - // integer division by right-shifting. Term "-1" at end is to account for - // the extra most significatnt bit left unused in result by signed multiplication - overlapDividerBitsPure = _getClosest2Power((sampleRate * aoverlapMs) / 1000.0) - 1; - if (overlapDividerBitsPure > 9) overlapDividerBitsPure = 9; - if (overlapDividerBitsPure < 3) overlapDividerBitsPure = 3; - newOvl = (int)pow(2.0, (int)overlapDividerBitsPure + 1); // +1 => account for -1 above - - acceptNewOverlapLength(newOvl); - - overlapDividerBitsNorm = overlapDividerBitsPure; - - // calculate sloping divider so that crosscorrelation operation won't - // overflow 32-bit register. Max. sum of the crosscorrelation sum without - // divider would be 2^30*(N^3-N)/3, where N = overlap length - slopingDivider = (newOvl * newOvl - 1) / 3; -} - - -double TDStretch::calcCrossCorr(const short *mixingPos, const short *compare, double &norm) -{ - long corr; - unsigned long lnorm; - int i; - - #ifdef ST_SIMD_AVOID_UNALIGNED - // in SIMD mode skip 'mixingPos' positions that aren't aligned to 16-byte boundary - if (((ulongptr)mixingPos) & 15) return -1e50; - #endif - - // hint compiler autovectorization that loop length is divisible by 8 - int ilength = (channels * overlapLength) & -8; - - corr = lnorm = 0; - // Same routine for stereo and mono - for (i = 0; i < ilength; i += 2) - { - corr += (mixingPos[i] * compare[i] + - mixingPos[i + 1] * compare[i + 1]) >> overlapDividerBitsNorm; - lnorm += (mixingPos[i] * mixingPos[i] + - mixingPos[i + 1] * mixingPos[i + 1]) >> overlapDividerBitsNorm; - // do intermediate scalings to avoid integer overflow - } - - if (lnorm > maxnorm) - { - // modify 'maxnorm' inside critical section to avoid multi-access conflict if in OpenMP mode - #pragma omp critical - if (lnorm > maxnorm) - { - maxnorm = lnorm; - } - } - // Normalize result by dividing by sqrt(norm) - this step is easiest - // done using floating point operation - norm = (double)lnorm; - return (double)corr / sqrt((norm < 1e-9) ? 1.0 : norm); -} - - -/// Update cross-correlation by accumulating "norm" coefficient by previously calculated value -double TDStretch::calcCrossCorrAccumulate(const short *mixingPos, const short *compare, double &norm) -{ - long corr; - long lnorm; - int i; - - // hint compiler autovectorization that loop length is divisible by 8 - int ilength = (channels * overlapLength) & -8; - - // cancel first normalizer tap from previous round - lnorm = 0; - for (i = 1; i <= channels; i ++) - { - lnorm -= (mixingPos[-i] * mixingPos[-i]) >> overlapDividerBitsNorm; - } - - corr = 0; - // Same routine for stereo and mono. - for (i = 0; i < ilength; i += 2) - { - corr += (mixingPos[i] * compare[i] + - mixingPos[i + 1] * compare[i + 1]) >> overlapDividerBitsNorm; - } - - // update normalizer with last samples of this round - for (int j = 0; j < channels; j ++) - { - i --; - lnorm += (mixingPos[i] * mixingPos[i]) >> overlapDividerBitsNorm; - } - - norm += (double)lnorm; - if (norm > maxnorm) - { - maxnorm = (unsigned long)norm; - } - - // Normalize result by dividing by sqrt(norm) - this step is easiest - // done using floating point operation - return (double)corr / sqrt((norm < 1e-9) ? 1.0 : norm); -} - -#endif // SOUNDTOUCH_INTEGER_SAMPLES - -////////////////////////////////////////////////////////////////////////////// -// -// Floating point arithmetic specific algorithm implementations. -// - -#ifdef SOUNDTOUCH_FLOAT_SAMPLES - -// Overlaps samples in 'midBuffer' with the samples in 'pInput' -void TDStretch::overlapStereo(float *pOutput, const float *pInput) const -{ - int i; - float fScale; - float f1; - float f2; - - fScale = 1.0f / (float)overlapLength; - - f1 = 0; - f2 = 1.0f; - - for (i = 0; i < 2 * (int)overlapLength ; i += 2) - { - pOutput[i + 0] = pInput[i + 0] * f1 + pMidBuffer[i + 0] * f2; - pOutput[i + 1] = pInput[i + 1] * f1 + pMidBuffer[i + 1] * f2; - - f1 += fScale; - f2 -= fScale; - } -} - - -// Overlaps samples in 'midBuffer' with the samples in 'input'. -void TDStretch::overlapMulti(float *pOutput, const float *pInput) const -{ - int i; - float fScale; - float f1; - float f2; - - fScale = 1.0f / (float)overlapLength; - - f1 = 0; - f2 = 1.0f; - - i=0; - for (int i2 = 0; i2 < overlapLength; i2 ++) - { - // note: Could optimize this slightly by taking into account that always channels > 2 - for (int c = 0; c < channels; c ++) - { - pOutput[i] = pInput[i] * f1 + pMidBuffer[i] * f2; - i++; - } - f1 += fScale; - f2 -= fScale; - } -} - - -/// Calculates overlapInMsec period length in samples. -void TDStretch::calculateOverlapLength(int overlapInMsec) -{ - int newOvl; - - ADM_assert(overlapInMsec >= 0); - newOvl = (sampleRate * overlapInMsec) / 1000; - if (newOvl < 16) newOvl = 16; - - // must be divisible by 8 - newOvl -= newOvl % 8; - - acceptNewOverlapLength(newOvl); -} - - -/// Calculate cross-correlation -double TDStretch::calcCrossCorr(const float *mixingPos, const float *compare, double &anorm) -{ - float corr; - float norm; - int i; - - #ifdef ST_SIMD_AVOID_UNALIGNED - // in SIMD mode skip 'mixingPos' positions that aren't aligned to 16-byte boundary - if (((ulongptr)mixingPos) & 15) return -1e50; - #endif - - // hint compiler autovectorization that loop length is divisible by 8 - int ilength = (channels * overlapLength) & -8; - - corr = norm = 0; - // Same routine for stereo and mono - for (i = 0; i < ilength; i ++) - { - corr += mixingPos[i] * compare[i]; - norm += mixingPos[i] * mixingPos[i]; - } - - anorm = norm; - return corr / sqrt((norm < 1e-9 ? 1.0 : norm)); -} - - -/// Update cross-correlation by accumulating "norm" coefficient by previously calculated value -double TDStretch::calcCrossCorrAccumulate(const float *mixingPos, const float *compare, double &norm) -{ - float corr; - int i; - - corr = 0; - - // cancel first normalizer tap from previous round - for (i = 1; i <= channels; i ++) - { - norm -= mixingPos[-i] * mixingPos[-i]; - } - - // hint compiler autovectorization that loop length is divisible by 8 - int ilength = (channels * overlapLength) & -8; - - // Same routine for stereo and mono - for (i = 0; i < ilength; i ++) - { - corr += mixingPos[i] * compare[i]; - } - - // update normalizer with last samples of this round - for (int j = 0; j < channels; j ++) - { - i --; - norm += mixingPos[i] * mixingPos[i]; - } - - return corr / sqrt((norm < 1e-9 ? 1.0 : norm)); -} - - -#endif // SOUNDTOUCH_FLOAT_SAMPLES +/////////////////////////////////////////////////////////////////////////////// +/// +/// Sampled sound tempo changer/time stretch algorithm. Changes the sound tempo +/// while maintaining the original pitch by using a time domain WSOLA-like +/// method with several performance-increasing tweaks. +/// +/// Notes : MMX optimized functions reside in a separate, platform-specific +/// file, e.g. 'mmx_win.cpp' or 'mmx_gcc.cpp'. +/// +/// This source file contains OpenMP optimizations that allow speeding up the +/// corss-correlation algorithm by executing it in several threads / CPU cores +/// in parallel. See the following article link for more detailed discussion +/// about SoundTouch OpenMP optimizations: +/// http://www.softwarecoven.com/parallel-computing-in-embedded-mobile-devices +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include + +#include "STTypes.h" +#include "TDStretch.h" + +#include "ADM_default.h" + +using namespace soundtouch; + +#define max(x, y) (((x) > (y)) ? (x) : (y)) + +/***************************************************************************** + * + * Constant definitions + * + *****************************************************************************/ + +// Table for the hierarchical mixing position seeking algorithm +const short _scanOffsets[5][24]={ + { 124, 186, 248, 310, 372, 434, 496, 558, 620, 682, 744, 806, + 868, 930, 992, 1054, 1116, 1178, 1240, 1302, 1364, 1426, 1488, 0}, + {-100, -75, -50, -25, 25, 50, 75, 100, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { -20, -15, -10, -5, 5, 10, 15, 20, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { -4, -3, -2, -1, 1, 2, 3, 4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 121, 114, 97, 114, 98, 105, 108, 32, 104, 99, 117, 111, + 116, 100, 110, 117, 111, 115, 0, 0, 0, 0, 0, 0}}; + +/***************************************************************************** + * + * Implementation of the class 'TDStretch' + * + *****************************************************************************/ + + +TDStretch::TDStretch() : FIFOProcessor(&outputBuffer) +{ + bQuickSeek = false; + channels = 2; + + pMidBuffer = NULL; + pMidBufferUnaligned = NULL; + overlapLength = 0; + + bAutoSeqSetting = true; + bAutoSeekSetting = true; + + tempo = 1.0f; + setParameters(44100, DEFAULT_SEQUENCE_MS, DEFAULT_SEEKWINDOW_MS, DEFAULT_OVERLAP_MS); + setTempo(1.0f); + + clear(); +} + + + +TDStretch::~TDStretch() +{ + delete[] pMidBufferUnaligned; +} + + + +// Sets routine control parameters. These control are certain time constants +// defining how the sound is stretched to the desired duration. +// +// 'sampleRate' = sample rate of the sound +// 'sequenceMS' = one processing sequence length in milliseconds (default = 82 ms) +// 'seekwindowMS' = seeking window length for scanning the best overlapping +// position (default = 28 ms) +// 'overlapMS' = overlapping length (default = 12 ms) + +void TDStretch::setParameters(int aSampleRate, int aSequenceMS, + int aSeekWindowMS, int aOverlapMS) +{ + // accept only positive parameter values - if zero or negative, use old values instead + if (aSampleRate > 0) + { + if (aSampleRate > 192000) ST_THROW_RT_ERROR("Error: Excessive samplerate"); + this->sampleRate = aSampleRate; + } + + if (aOverlapMS > 0) this->overlapMs = aOverlapMS; + + if (aSequenceMS > 0) + { + this->sequenceMs = aSequenceMS; + bAutoSeqSetting = false; + } + else if (aSequenceMS == 0) + { + // if zero, use automatic setting + bAutoSeqSetting = true; + } + + if (aSeekWindowMS > 0) + { + this->seekWindowMs = aSeekWindowMS; + bAutoSeekSetting = false; + } + else if (aSeekWindowMS == 0) + { + // if zero, use automatic setting + bAutoSeekSetting = true; + } + + calcSeqParameters(); + + calculateOverlapLength(overlapMs); + + // set tempo to recalculate 'sampleReq' + setTempo(tempo); +} + + + +/// Get routine control parameters, see setParameters() function. +/// Any of the parameters to this function can be NULL, in such case corresponding parameter +/// value isn't returned. +void TDStretch::getParameters(int *pSampleRate, int *pSequenceMs, int *pSeekWindowMs, int *pOverlapMs) const +{ + if (pSampleRate) + { + *pSampleRate = sampleRate; + } + + if (pSequenceMs) + { + *pSequenceMs = (bAutoSeqSetting) ? (USE_AUTO_SEQUENCE_LEN) : sequenceMs; + } + + if (pSeekWindowMs) + { + *pSeekWindowMs = (bAutoSeekSetting) ? (USE_AUTO_SEEKWINDOW_LEN) : seekWindowMs; + } + + if (pOverlapMs) + { + *pOverlapMs = overlapMs; + } +} + + +// Overlaps samples in 'midBuffer' with the samples in 'pInput' +void TDStretch::overlapMono(SAMPLETYPE *pOutput, const SAMPLETYPE *pInput) const +{ + int i; + SAMPLETYPE m1, m2; + + m1 = (SAMPLETYPE)0; + m2 = (SAMPLETYPE)overlapLength; + + for (i = 0; i < overlapLength ; i ++) + { + pOutput[i] = (pInput[i] * m1 + pMidBuffer[i] * m2 ) / overlapLength; + m1 += 1; + m2 -= 1; + } +} + + + +void TDStretch::clearMidBuffer() +{ + memset(pMidBuffer, 0, channels * sizeof(SAMPLETYPE) * overlapLength); +} + + +void TDStretch::clearInput() +{ + inputBuffer.clear(); + clearMidBuffer(); + isBeginning = true; + maxnorm = 0; + maxnormf = 1e8; + skipFract = 0; +} + + +// Clears the sample buffers +void TDStretch::clear() +{ + outputBuffer.clear(); + clearInput(); +} + + + +// Enables/disables the quick position seeking algorithm. Zero to disable, nonzero +// to enable +void TDStretch::enableQuickSeek(bool enable) +{ + bQuickSeek = enable; +} + + +// Returns nonzero if the quick seeking algorithm is enabled. +bool TDStretch::isQuickSeekEnabled() const +{ + return bQuickSeek; +} + + +// Seeks for the optimal overlap-mixing position. +int TDStretch::seekBestOverlapPosition(const SAMPLETYPE *refPos) +{ + if (bQuickSeek) + { + return seekBestOverlapPositionQuick(refPos); + } + else + { + return seekBestOverlapPositionFull(refPos); + } +} + + +// Overlaps samples in 'midBuffer' with the samples in 'pInputBuffer' at position +// of 'ovlPos'. +inline void TDStretch::overlap(SAMPLETYPE *pOutput, const SAMPLETYPE *pInput, uint ovlPos) const +{ +#ifndef USE_MULTICH_ALWAYS + if (channels == 1) + { + // mono sound. + overlapMono(pOutput, pInput + ovlPos); + } + else if (channels == 2) + { + // stereo sound + overlapStereo(pOutput, pInput + 2 * ovlPos); + } + else +#endif // USE_MULTICH_ALWAYS + { + ADM_assert(channels > 0); + overlapMulti(pOutput, pInput + channels * ovlPos); + } +} + + +// Seeks for the optimal overlap-mixing position. The 'stereo' version of the +// routine +// +// The best position is determined as the position where the two overlapped +// sample sequences are 'most alike', in terms of the highest cross-correlation +// value over the overlapping period +int TDStretch::seekBestOverlapPositionFull(const SAMPLETYPE *refPos) +{ + int bestOffs; + double bestCorr; + int i; + double norm; + + bestCorr = -FLT_MAX; + bestOffs = 0; + + // Scans for the best correlation value by testing each possible position + // over the permitted range. + bestCorr = calcCrossCorr(refPos, pMidBuffer, norm); + bestCorr = (bestCorr + 0.1) * 0.75; + + #pragma omp parallel for + for (i = 1; i < seekLength; i ++) + { + double corr; + // Calculates correlation value for the mixing position corresponding to 'i' +#if defined(_OPENMP) || defined(ST_SIMD_AVOID_UNALIGNED) + // in parallel OpenMP mode, can't use norm accumulator version as parallel executor won't + // iterate the loop in sequential order + // in SIMD mode, avoid accumulator version to allow avoiding unaligned positions + corr = calcCrossCorr(refPos + channels * i, pMidBuffer, norm); +#else + // In non-parallel version call "calcCrossCorrAccumulate" that is otherwise same + // as "calcCrossCorr", but saves time by reusing & updating previously stored + // "norm" value + corr = calcCrossCorrAccumulate(refPos + channels * i, pMidBuffer, norm); +#endif + // heuristic rule to slightly favour values close to mid of the range + double tmp = (double)(2 * i - seekLength) / (double)seekLength; + corr = ((corr + 0.1) * (1.0 - 0.25 * tmp * tmp)); + + // Checks for the highest correlation value + if (corr > bestCorr) + { + // For optimal performance, enter critical section only in case that best value found. + // in such case repeat 'if' condition as it's possible that parallel execution may have + // updated the bestCorr value in the mean time + #pragma omp critical + if (corr > bestCorr) + { + bestCorr = corr; + bestOffs = i; + } + } + } + +#ifdef SOUNDTOUCH_INTEGER_SAMPLES + adaptNormalizer(); +#endif + + // clear cross correlation routine state if necessary (is so e.g. in MMX routines). + clearCrossCorrState(); + + return bestOffs; +} + + +// Quick seek algorithm for improved runtime-performance: First roughly scans through the +// correlation area, and then scan surroundings of two best preliminary correlation candidates +// with improved precision +// +// Based on testing: +// - This algorithm gives on average 99% as good match as the full algorithm +// - this quick seek algorithm finds the best match on ~90% of cases +// - on those 10% of cases when this algorithm doesn't find best match, +// it still finds on average ~90% match vs. the best possible match +int TDStretch::seekBestOverlapPositionQuick(const SAMPLETYPE *refPos) +{ +#define _MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define SCANSTEP 16 +#define SCANWIND 8 + + int bestOffs; + int i; + int bestOffs2; + float bestCorr, corr; + float bestCorr2; + double norm; + + // note: 'float' types used in this function in case that the platform would need to use software-fp + + bestCorr = + bestCorr2 = -FLT_MAX; + bestOffs = + bestOffs2 = SCANWIND; + + // Scans for the best correlation value by testing each possible position + // over the permitted range. Look for two best matches on the first pass to + // increase possibility of ideal match. + // + // Begin from "SCANSTEP" instead of SCANWIND to make the calculation + // catch the 'middlepoint' of seekLength vector as that's the a-priori + // expected best match position + // + // Roughly: + // - 15% of cases find best result directly on the first round, + // - 75% cases find better match on 2nd round around the best match from 1st round + // - 10% cases find better match on 2nd round around the 2nd-best-match from 1st round + for (i = SCANSTEP; i < seekLength - SCANWIND - 1; i += SCANSTEP) + { + // Calculates correlation value for the mixing position corresponding + // to 'i' + corr = (float)calcCrossCorr(refPos + channels*i, pMidBuffer, norm); + // heuristic rule to slightly favour values close to mid of the seek range + float tmp = (float)(2 * i - seekLength - 1) / (float)seekLength; + corr = ((corr + 0.1f) * (1.0f - 0.25f * tmp * tmp)); + + // Checks for the highest correlation value + if (corr > bestCorr) + { + // found new best match. keep the previous best as 2nd best match + bestCorr2 = bestCorr; + bestOffs2 = bestOffs; + bestCorr = corr; + bestOffs = i; + } + else if (corr > bestCorr2) + { + // not new best, but still new 2nd best match + bestCorr2 = corr; + bestOffs2 = i; + } + } + + // Scans surroundings of the found best match with small stepping + int end = _MIN(bestOffs + SCANWIND + 1, seekLength); + for (i = bestOffs - SCANWIND; i < end; i++) + { + if (i == bestOffs) continue; // this offset already calculated, thus skip + + // Calculates correlation value for the mixing position corresponding + // to 'i' + corr = (float)calcCrossCorr(refPos + channels*i, pMidBuffer, norm); + // heuristic rule to slightly favour values close to mid of the range + float tmp = (float)(2 * i - seekLength - 1) / (float)seekLength; + corr = ((corr + 0.1f) * (1.0f - 0.25f * tmp * tmp)); + + // Checks for the highest correlation value + if (corr > bestCorr) + { + bestCorr = corr; + bestOffs = i; + } + } + + // Scans surroundings of the 2nd best match with small stepping + end = _MIN(bestOffs2 + SCANWIND + 1, seekLength); + for (i = bestOffs2 - SCANWIND; i < end; i++) + { + if (i == bestOffs2) continue; // this offset already calculated, thus skip + + // Calculates correlation value for the mixing position corresponding + // to 'i' + corr = (float)calcCrossCorr(refPos + channels*i, pMidBuffer, norm); + // heuristic rule to slightly favour values close to mid of the range + float tmp = (float)(2 * i - seekLength - 1) / (float)seekLength; + corr = ((corr + 0.1f) * (1.0f - 0.25f * tmp * tmp)); + + // Checks for the highest correlation value + if (corr > bestCorr) + { + bestCorr = corr; + bestOffs = i; + } + } + + // clear cross correlation routine state if necessary (is so e.g. in MMX routines). + clearCrossCorrState(); + +#ifdef SOUNDTOUCH_INTEGER_SAMPLES + adaptNormalizer(); +#endif + + return bestOffs; +} + + + + +/// For integer algorithm: adapt normalization factor divider with music so that +/// it'll not be pessimistically restrictive that can degrade quality on quieter sections +/// yet won't cause integer overflows either +void TDStretch::adaptNormalizer() +{ + // Do not adapt normalizer over too silent sequences to avoid averaging filter depleting to + // too low values during pauses in music + if ((maxnorm > 1000) || (maxnormf > 40000000)) + { + //norm averaging filter + maxnormf = 0.9f * maxnormf + 0.1f * (float)maxnorm; + + if ((maxnorm > 800000000) && (overlapDividerBitsNorm < 16)) + { + // large values, so increase divider + overlapDividerBitsNorm++; + if (maxnorm > 1600000000) overlapDividerBitsNorm++; // extra large value => extra increase + } + else if ((maxnormf < 1000000) && (overlapDividerBitsNorm > 0)) + { + // extra small values, decrease divider + overlapDividerBitsNorm--; + } + } + + maxnorm = 0; +} + + +/// clear cross correlation routine state if necessary +void TDStretch::clearCrossCorrState() +{ + // default implementation is empty. +} + + +/// Calculates processing sequence length according to tempo setting +void TDStretch::calcSeqParameters() +{ + // Adjust tempo param according to tempo, so that variating processing sequence length is used + // at various tempo settings, between the given low...top limits + #define AUTOSEQ_TEMPO_LOW 0.5 // auto setting low tempo range (-50%) + #define AUTOSEQ_TEMPO_TOP 2.0 // auto setting top tempo range (+100%) + + // sequence-ms setting values at above low & top tempo + #define AUTOSEQ_AT_MIN 90.0 + #define AUTOSEQ_AT_MAX 40.0 + #define AUTOSEQ_K ((AUTOSEQ_AT_MAX - AUTOSEQ_AT_MIN) / (AUTOSEQ_TEMPO_TOP - AUTOSEQ_TEMPO_LOW)) + #define AUTOSEQ_C (AUTOSEQ_AT_MIN - (AUTOSEQ_K) * (AUTOSEQ_TEMPO_LOW)) + + // seek-window-ms setting values at above low & top tempoq + #define AUTOSEEK_AT_MIN 20.0 + #define AUTOSEEK_AT_MAX 15.0 + #define AUTOSEEK_K ((AUTOSEEK_AT_MAX - AUTOSEEK_AT_MIN) / (AUTOSEQ_TEMPO_TOP - AUTOSEQ_TEMPO_LOW)) + #define AUTOSEEK_C (AUTOSEEK_AT_MIN - (AUTOSEEK_K) * (AUTOSEQ_TEMPO_LOW)) + + #define CHECK_LIMITS(x, mi, ma) (((x) < (mi)) ? (mi) : (((x) > (ma)) ? (ma) : (x))) + + double seq, seek; + + if (bAutoSeqSetting) + { + seq = AUTOSEQ_C + AUTOSEQ_K * tempo; + seq = CHECK_LIMITS(seq, AUTOSEQ_AT_MAX, AUTOSEQ_AT_MIN); + sequenceMs = (int)(seq + 0.5); + } + + if (bAutoSeekSetting) + { + seek = AUTOSEEK_C + AUTOSEEK_K * tempo; + seek = CHECK_LIMITS(seek, AUTOSEEK_AT_MAX, AUTOSEEK_AT_MIN); + seekWindowMs = (int)(seek + 0.5); + } + + // Update seek window lengths + seekWindowLength = (sampleRate * sequenceMs) / 1000; + if (seekWindowLength < 2 * overlapLength) + { + seekWindowLength = 2 * overlapLength; + } + seekLength = (sampleRate * seekWindowMs) / 1000; +} + + + +// Sets new target tempo. Normal tempo = 'SCALE', smaller values represent slower +// tempo, larger faster tempo. +void TDStretch::setTempo(double newTempo) +{ + int intskip; + + tempo = newTempo; + + // Calculate new sequence duration + calcSeqParameters(); + + // Calculate ideal skip length (according to tempo value) + nominalSkip = tempo * (seekWindowLength - overlapLength); + intskip = (int)(nominalSkip + 0.5); + + // Calculate how many samples are needed in the 'inputBuffer' to + // process another batch of samples + //sampleReq = max(intskip + overlapLength, seekWindowLength) + seekLength / 2; + sampleReq = max(intskip + overlapLength, seekWindowLength) + seekLength; +} + + + +// Sets the number of channels, 1 = mono, 2 = stereo +void TDStretch::setChannels(int numChannels) +{ + if (!verifyNumberOfChannels(numChannels) || + (channels == numChannels)) return; + + channels = numChannels; + inputBuffer.setChannels(channels); + outputBuffer.setChannels(channels); + + // re-init overlap/buffer + overlapLength=0; + setParameters(sampleRate); +} + + +// nominal tempo, no need for processing, just pass the samples through +// to outputBuffer +/* +void TDStretch::processNominalTempo() +{ + ADM_assert(tempo == 1.0f); + + if (bMidBufferDirty) + { + // If there are samples in pMidBuffer waiting for overlapping, + // do a single sliding overlapping with them in order to prevent a + // clicking distortion in the output sound + if (inputBuffer.numSamples() < overlapLength) + { + // wait until we've got overlapLength input samples + return; + } + // Mix the samples in the beginning of 'inputBuffer' with the + // samples in 'midBuffer' using sliding overlapping + overlap(outputBuffer.ptrEnd(overlapLength), inputBuffer.ptrBegin(), 0); + outputBuffer.putSamples(overlapLength); + inputBuffer.receiveSamples(overlapLength); + clearMidBuffer(); + // now we've caught the nominal sample flow and may switch to + // bypass mode + } + + // Simply bypass samples from input to output + outputBuffer.moveSamples(inputBuffer); +} +*/ + + +// Processes as many processing frames of the samples 'inputBuffer', store +// the result into 'outputBuffer' +void TDStretch::processSamples() +{ + int ovlSkip; + int offset = 0; + int temp; + + /* Removed this small optimization - can introduce a click to sound when tempo setting + crosses the nominal value + if (tempo == 1.0f) + { + // tempo not changed from the original, so bypass the processing + processNominalTempo(); + return; + } + */ + + // Process samples as long as there are enough samples in 'inputBuffer' + // to form a processing frame. + while ((int)inputBuffer.numSamples() >= sampleReq) + { + if (isBeginning == false) + { + // apart from the very beginning of the track, + // scan for the best overlapping position & do overlap-add + offset = seekBestOverlapPosition(inputBuffer.ptrBegin()); + + // Mix the samples in the 'inputBuffer' at position of 'offset' with the + // samples in 'midBuffer' using sliding overlapping + // ... first partially overlap with the end of the previous sequence + // (that's in 'midBuffer') + overlap(outputBuffer.ptrEnd((uint)overlapLength), inputBuffer.ptrBegin(), (uint)offset); + outputBuffer.putSamples((uint)overlapLength); + offset += overlapLength; + } + else + { + // Adjust processing offset at beginning of track by not perform initial overlapping + // and compensating that in the 'input buffer skip' calculation + isBeginning = false; + int skip = (int)(tempo * overlapLength + 0.5 * seekLength + 0.5); + + #ifdef ST_SIMD_AVOID_UNALIGNED + // in SIMD mode, round the skip amount to value corresponding to aligned memory address + if (channels == 1) + { + skip &= -4; + } + else if (channels == 2) + { + skip &= -2; + } + #endif + skipFract -= skip; + if (skipFract <= -nominalSkip) + { + skipFract = -nominalSkip; + } + } + + // ... then copy sequence samples from 'inputBuffer' to output: + + // crosscheck that we don't have buffer overflow... + if ((int)inputBuffer.numSamples() < (offset + seekWindowLength - overlapLength)) + { + continue; // just in case, shouldn't really happen + } + + // length of sequence + temp = (seekWindowLength - 2 * overlapLength); + outputBuffer.putSamples(inputBuffer.ptrBegin() + channels * offset, (uint)temp); + + // Copies the end of the current sequence from 'inputBuffer' to + // 'midBuffer' for being mixed with the beginning of the next + // processing sequence and so on + ADM_assert((offset + temp + overlapLength) <= (int)inputBuffer.numSamples()); + memcpy(pMidBuffer, inputBuffer.ptrBegin() + channels * (offset + temp), + channels * sizeof(SAMPLETYPE) * overlapLength); + + // Remove the processed samples from the input buffer. Update + // the difference between integer & nominal skip step to 'skipFract' + // in order to prevent the error from accumulating over time. + skipFract += nominalSkip; // real skip size + ovlSkip = (int)skipFract; // rounded to integer skip + skipFract -= ovlSkip; // maintain the fraction part, i.e. real vs. integer skip + inputBuffer.receiveSamples((uint)ovlSkip); + } +} + + +// Adds 'numsamples' pcs of samples from the 'samples' memory position into +// the input of the object. +void TDStretch::putSamples(const SAMPLETYPE *samples, uint nSamples) +{ + // Add the samples into the input buffer + inputBuffer.putSamples(samples, nSamples); + // Process the samples in input buffer + processSamples(); +} + + + +/// Set new overlap length parameter & reallocate RefMidBuffer if necessary. +void TDStretch::acceptNewOverlapLength(int newOverlapLength) +{ + int prevOvl; + + ADM_assert(newOverlapLength >= 0); + prevOvl = overlapLength; + overlapLength = newOverlapLength; + + if (overlapLength > prevOvl) + { + delete[] pMidBufferUnaligned; + + pMidBufferUnaligned = new SAMPLETYPE[overlapLength * channels + 16 / sizeof(SAMPLETYPE)]; + // ensure that 'pMidBuffer' is aligned to 16 byte boundary for efficiency + pMidBuffer = (SAMPLETYPE *)SOUNDTOUCH_ALIGN_POINTER_16(pMidBufferUnaligned); + + clearMidBuffer(); + } +} + + +// Operator 'new' is overloaded so that it automatically creates a suitable instance +// depending on if we've a MMX/SSE/etc-capable CPU available or not. +void * TDStretch::operator new(size_t s) +{ + // Notice! don't use "new TDStretch" directly, use "newInstance" to create a new instance instead! + ST_THROW_RT_ERROR("Error in TDStretch::new: Don't use 'new TDStretch' directly, use 'newInstance' member instead!"); + return newInstance(); +} + + +TDStretch * TDStretch::newInstance() +{ + // Check if MMX/SSE instruction set extensions supported by CPU + +#ifdef SOUNDTOUCH_ALLOW_MMX + // MMX routines available only with integer sample types + if (CpuCaps::hasMMX()) + { + return ::new TDStretchMMX; + } + else +#endif // SOUNDTOUCH_ALLOW_MMX + +#ifdef SOUNDTOUCH_ALLOW_SSE + if (CpuCaps::hasSSE()) + { + // SSE support + return ::new TDStretchSSE; + } + else +#endif // SOUNDTOUCH_ALLOW_SSE + + { + // ISA optimizations not supported, use plain C version + return ::new TDStretch; + } +} + + +////////////////////////////////////////////////////////////////////////////// +// +// Integer arithmetic specific algorithm implementations. +// +////////////////////////////////////////////////////////////////////////////// + +#ifdef SOUNDTOUCH_INTEGER_SAMPLES + +// Overlaps samples in 'midBuffer' with the samples in 'input'. The 'Stereo' +// version of the routine. +void TDStretch::overlapStereo(short *poutput, const short *input) const +{ + int i; + short temp; + int cnt2; + + for (i = 0; i < overlapLength ; i ++) + { + temp = (short)(overlapLength - i); + cnt2 = 2 * i; + poutput[cnt2] = (input[cnt2] * i + pMidBuffer[cnt2] * temp ) / overlapLength; + poutput[cnt2 + 1] = (input[cnt2 + 1] * i + pMidBuffer[cnt2 + 1] * temp ) / overlapLength; + } +} + + +// Overlaps samples in 'midBuffer' with the samples in 'input'. The 'Multi' +// version of the routine. +void TDStretch::overlapMulti(short *poutput, const short *input) const +{ + short m1; + int i = 0; + + for (m1 = 0; m1 < overlapLength; m1 ++) + { + short m2 = (short)(overlapLength - m1); + for (int c = 0; c < channels; c ++) + { + poutput[i] = (input[i] * m1 + pMidBuffer[i] * m2) / overlapLength; + i++; + } + } +} + +// Calculates the x having the closest 2^x value for the given value +static int _getClosest2Power(double value) +{ + return (int)(log(value) / log(2.0) + 0.5); +} + + +/// Calculates overlap period length in samples. +/// Integer version rounds overlap length to closest power of 2 +/// for a divide scaling operation. +void TDStretch::calculateOverlapLength(int aoverlapMs) +{ + int newOvl; + + ADM_assert(aoverlapMs >= 0); + + // calculate overlap length so that it's power of 2 - thus it's easy to do + // integer division by right-shifting. Term "-1" at end is to account for + // the extra most significatnt bit left unused in result by signed multiplication + overlapDividerBitsPure = _getClosest2Power((sampleRate * aoverlapMs) / 1000.0) - 1; + if (overlapDividerBitsPure > 9) overlapDividerBitsPure = 9; + if (overlapDividerBitsPure < 3) overlapDividerBitsPure = 3; + newOvl = (int)pow(2.0, (int)overlapDividerBitsPure + 1); // +1 => account for -1 above + + acceptNewOverlapLength(newOvl); + + overlapDividerBitsNorm = overlapDividerBitsPure; + + // calculate sloping divider so that crosscorrelation operation won't + // overflow 32-bit register. Max. sum of the crosscorrelation sum without + // divider would be 2^30*(N^3-N)/3, where N = overlap length + slopingDivider = (newOvl * newOvl - 1) / 3; +} + + +double TDStretch::calcCrossCorr(const short *mixingPos, const short *compare, double &norm) +{ + long corr; + unsigned long lnorm; + int i; + + #ifdef ST_SIMD_AVOID_UNALIGNED + // in SIMD mode skip 'mixingPos' positions that aren't aligned to 16-byte boundary + if (((ulongptr)mixingPos) & 15) return -1e50; + #endif + + // hint compiler autovectorization that loop length is divisible by 8 + int ilength = (channels * overlapLength) & -8; + + corr = lnorm = 0; + // Same routine for stereo and mono + for (i = 0; i < ilength; i += 2) + { + corr += (mixingPos[i] * compare[i] + + mixingPos[i + 1] * compare[i + 1]) >> overlapDividerBitsNorm; + lnorm += (mixingPos[i] * mixingPos[i] + + mixingPos[i + 1] * mixingPos[i + 1]) >> overlapDividerBitsNorm; + // do intermediate scalings to avoid integer overflow + } + + if (lnorm > maxnorm) + { + // modify 'maxnorm' inside critical section to avoid multi-access conflict if in OpenMP mode + #pragma omp critical + if (lnorm > maxnorm) + { + maxnorm = lnorm; + } + } + // Normalize result by dividing by sqrt(norm) - this step is easiest + // done using floating point operation + norm = (double)lnorm; + return (double)corr / sqrt((norm < 1e-9) ? 1.0 : norm); +} + + +/// Update cross-correlation by accumulating "norm" coefficient by previously calculated value +double TDStretch::calcCrossCorrAccumulate(const short *mixingPos, const short *compare, double &norm) +{ + long corr; + long lnorm; + int i; + + // hint compiler autovectorization that loop length is divisible by 8 + int ilength = (channels * overlapLength) & -8; + + // cancel first normalizer tap from previous round + lnorm = 0; + for (i = 1; i <= channels; i ++) + { + lnorm -= (mixingPos[-i] * mixingPos[-i]) >> overlapDividerBitsNorm; + } + + corr = 0; + // Same routine for stereo and mono. + for (i = 0; i < ilength; i += 2) + { + corr += (mixingPos[i] * compare[i] + + mixingPos[i + 1] * compare[i + 1]) >> overlapDividerBitsNorm; + } + + // update normalizer with last samples of this round + for (int j = 0; j < channels; j ++) + { + i --; + lnorm += (mixingPos[i] * mixingPos[i]) >> overlapDividerBitsNorm; + } + + norm += (double)lnorm; + if (norm > maxnorm) + { + maxnorm = (unsigned long)norm; + } + + // Normalize result by dividing by sqrt(norm) - this step is easiest + // done using floating point operation + return (double)corr / sqrt((norm < 1e-9) ? 1.0 : norm); +} + +#endif // SOUNDTOUCH_INTEGER_SAMPLES + +////////////////////////////////////////////////////////////////////////////// +// +// Floating point arithmetic specific algorithm implementations. +// + +#ifdef SOUNDTOUCH_FLOAT_SAMPLES + +// Overlaps samples in 'midBuffer' with the samples in 'pInput' +void TDStretch::overlapStereo(float *pOutput, const float *pInput) const +{ + int i; + float fScale; + float f1; + float f2; + + fScale = 1.0f / (float)overlapLength; + + f1 = 0; + f2 = 1.0f; + + for (i = 0; i < 2 * (int)overlapLength ; i += 2) + { + pOutput[i + 0] = pInput[i + 0] * f1 + pMidBuffer[i + 0] * f2; + pOutput[i + 1] = pInput[i + 1] * f1 + pMidBuffer[i + 1] * f2; + + f1 += fScale; + f2 -= fScale; + } +} + + +// Overlaps samples in 'midBuffer' with the samples in 'input'. +void TDStretch::overlapMulti(float *pOutput, const float *pInput) const +{ + int i; + float fScale; + float f1; + float f2; + + fScale = 1.0f / (float)overlapLength; + + f1 = 0; + f2 = 1.0f; + + i=0; + for (int i2 = 0; i2 < overlapLength; i2 ++) + { + // note: Could optimize this slightly by taking into account that always channels > 2 + for (int c = 0; c < channels; c ++) + { + pOutput[i] = pInput[i] * f1 + pMidBuffer[i] * f2; + i++; + } + f1 += fScale; + f2 -= fScale; + } +} + + +/// Calculates overlapInMsec period length in samples. +void TDStretch::calculateOverlapLength(int overlapInMsec) +{ + int newOvl; + + ADM_assert(overlapInMsec >= 0); + newOvl = (sampleRate * overlapInMsec) / 1000; + if (newOvl < 16) newOvl = 16; + + // must be divisible by 8 + newOvl -= newOvl % 8; + + acceptNewOverlapLength(newOvl); +} + + +/// Calculate cross-correlation +double TDStretch::calcCrossCorr(const float *mixingPos, const float *compare, double &anorm) +{ + float corr; + float norm; + int i; + + #ifdef ST_SIMD_AVOID_UNALIGNED + // in SIMD mode skip 'mixingPos' positions that aren't aligned to 16-byte boundary + if (((ulongptr)mixingPos) & 15) return -1e50; + #endif + + // hint compiler autovectorization that loop length is divisible by 8 + int ilength = (channels * overlapLength) & -8; + + corr = norm = 0; + // Same routine for stereo and mono + for (i = 0; i < ilength; i ++) + { + corr += mixingPos[i] * compare[i]; + norm += mixingPos[i] * mixingPos[i]; + } + + anorm = norm; + return corr / sqrt((norm < 1e-9 ? 1.0 : norm)); +} + + +/// Update cross-correlation by accumulating "norm" coefficient by previously calculated value +double TDStretch::calcCrossCorrAccumulate(const float *mixingPos, const float *compare, double &norm) +{ + float corr; + int i; + + corr = 0; + + // cancel first normalizer tap from previous round + for (i = 1; i <= channels; i ++) + { + norm -= mixingPos[-i] * mixingPos[-i]; + } + + // hint compiler autovectorization that loop length is divisible by 8 + int ilength = (channels * overlapLength) & -8; + + // Same routine for stereo and mono + for (i = 0; i < ilength; i ++) + { + corr += mixingPos[i] * compare[i]; + } + + // update normalizer with last samples of this round + for (int j = 0; j < channels; j ++) + { + i --; + norm += mixingPos[i] * mixingPos[i]; + } + + return corr / sqrt((norm < 1e-9 ? 1.0 : norm)); +} + + +#endif // SOUNDTOUCH_FLOAT_SAMPLES diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/TDStretch.h b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/TDStretch.h index 71c0853ffd..9062d3deb3 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/TDStretch.h +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/TDStretch.h @@ -1,279 +1,279 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// Sampled sound tempo changer/time stretch algorithm. Changes the sound tempo -/// while maintaining the original pitch by using a time domain WSOLA-like method -/// with several performance-increasing tweaks. -/// -/// Note : MMX/SSE optimized functions reside in separate, platform-specific files -/// 'mmx_optimized.cpp' and 'sse_optimized.cpp' -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef TDStretch_H -#define TDStretch_H - -#include -#include "STTypes.h" -#include "RateTransposer.h" -#include "FIFOSamplePipe.h" - -namespace soundtouch -{ - -/// Default values for sound processing parameters: -/// Notice that the default parameters are tuned for contemporary popular music -/// processing. For speech processing applications these parameters suit better: -/// #define DEFAULT_SEQUENCE_MS 40 -/// #define DEFAULT_SEEKWINDOW_MS 15 -/// #define DEFAULT_OVERLAP_MS 8 -/// - -/// Default length of a single processing sequence, in milliseconds. This determines to how -/// long sequences the original sound is chopped in the time-stretch algorithm. -/// -/// The larger this value is, the lesser sequences are used in processing. In principle -/// a bigger value sounds better when slowing down tempo, but worse when increasing tempo -/// and vice versa. -/// -/// Increasing this value reduces computational burden & vice versa. -//#define DEFAULT_SEQUENCE_MS 40 -#define DEFAULT_SEQUENCE_MS USE_AUTO_SEQUENCE_LEN - -/// Giving this value for the sequence length sets automatic parameter value -/// according to tempo setting (recommended) -#define USE_AUTO_SEQUENCE_LEN 0 - -/// Seeking window default length in milliseconds for algorithm that finds the best possible -/// overlapping location. This determines from how wide window the algorithm may look for an -/// optimal joining location when mixing the sound sequences back together. -/// -/// The bigger this window setting is, the higher the possibility to find a better mixing -/// position will become, but at the same time large values may cause a "drifting" artifact -/// because consequent sequences will be taken at more uneven intervals. -/// -/// If there's a disturbing artifact that sounds as if a constant frequency was drifting -/// around, try reducing this setting. -/// -/// Increasing this value increases computational burden & vice versa. -//#define DEFAULT_SEEKWINDOW_MS 15 -#define DEFAULT_SEEKWINDOW_MS USE_AUTO_SEEKWINDOW_LEN - -/// Giving this value for the seek window length sets automatic parameter value -/// according to tempo setting (recommended) -#define USE_AUTO_SEEKWINDOW_LEN 0 - -/// Overlap length in milliseconds. When the chopped sound sequences are mixed back together, -/// to form a continuous sound stream, this parameter defines over how long period the two -/// consecutive sequences are let to overlap each other. -/// -/// This shouldn't be that critical parameter. If you reduce the DEFAULT_SEQUENCE_MS setting -/// by a large amount, you might wish to try a smaller value on this. -/// -/// Increasing this value increases computational burden & vice versa. -#define DEFAULT_OVERLAP_MS 8 - - -/// Class that does the time-stretch (tempo change) effect for the processed -/// sound. -class TDStretch : public FIFOProcessor -{ -protected: - int channels; - int sampleReq; - - int overlapLength; - int seekLength; - int seekWindowLength; - int overlapDividerBitsNorm; - int overlapDividerBitsPure; - int slopingDivider; - int sampleRate; - int sequenceMs; - int seekWindowMs; - int overlapMs; - - unsigned long maxnorm; - float maxnormf; - - double tempo; - double nominalSkip; - double skipFract; - - bool bQuickSeek; - bool bAutoSeqSetting; - bool bAutoSeekSetting; - bool isBeginning; - - SAMPLETYPE *pMidBuffer; - SAMPLETYPE *pMidBufferUnaligned; - - FIFOSampleBuffer outputBuffer; - FIFOSampleBuffer inputBuffer; - - void acceptNewOverlapLength(int newOverlapLength); - - virtual void clearCrossCorrState(); - void calculateOverlapLength(int overlapMs); - - virtual double calcCrossCorr(const SAMPLETYPE *mixingPos, const SAMPLETYPE *compare, double &norm); - virtual double calcCrossCorrAccumulate(const SAMPLETYPE *mixingPos, const SAMPLETYPE *compare, double &norm); - - virtual int seekBestOverlapPositionFull(const SAMPLETYPE *refPos); - virtual int seekBestOverlapPositionQuick(const SAMPLETYPE *refPos); - virtual int seekBestOverlapPosition(const SAMPLETYPE *refPos); - - virtual void overlapStereo(SAMPLETYPE *output, const SAMPLETYPE *input) const; - virtual void overlapMono(SAMPLETYPE *output, const SAMPLETYPE *input) const; - virtual void overlapMulti(SAMPLETYPE *output, const SAMPLETYPE *input) const; - - void clearMidBuffer(); - void overlap(SAMPLETYPE *output, const SAMPLETYPE *input, uint ovlPos) const; - - void calcSeqParameters(); - void adaptNormalizer(); - - /// Changes the tempo of the given sound samples. - /// Returns amount of samples returned in the "output" buffer. - /// The maximum amount of samples that can be returned at a time is set by - /// the 'set_returnBuffer_size' function. - void processSamples(); - -public: - TDStretch(); - virtual ~TDStretch() override; - - /// Operator 'new' is overloaded so that it automatically creates a suitable instance - /// depending on if we've a MMX/SSE/etc-capable CPU available or not. - static void *operator new(size_t s); - - /// Use this function instead of "new" operator to create a new instance of this class. - /// This function automatically chooses a correct feature set depending on if the CPU - /// supports MMX/SSE/etc extensions. - static TDStretch *newInstance(); - - /// Returns the output buffer object - FIFOSamplePipe *getOutput() { return &outputBuffer; }; - - /// Returns the input buffer object - FIFOSamplePipe *getInput() { return &inputBuffer; }; - - /// Sets new target tempo. Normal tempo = 'SCALE', smaller values represent slower - /// tempo, larger faster tempo. - void setTempo(double newTempo); - - /// Returns nonzero if there aren't any samples available for outputting. - virtual void clear() override; - - /// Clears the input buffer - void clearInput(); - - /// Sets the number of channels, 1 = mono, 2 = stereo - void setChannels(int numChannels); - - /// Enables/disables the quick position seeking algorithm. Zero to disable, - /// nonzero to enable - void enableQuickSeek(bool enable); - - /// Returns nonzero if the quick seeking algorithm is enabled. - bool isQuickSeekEnabled() const; - - /// Sets routine control parameters. These control are certain time constants - /// defining how the sound is stretched to the desired duration. - // - /// 'sampleRate' = sample rate of the sound - /// 'sequenceMS' = one processing sequence length in milliseconds - /// 'seekwindowMS' = seeking window length for scanning the best overlapping - /// position - /// 'overlapMS' = overlapping length - void setParameters(int sampleRate, ///< Samplerate of sound being processed (Hz) - int sequenceMS = -1, ///< Single processing sequence length (ms) - int seekwindowMS = -1, ///< Offset seeking window length (ms) - int overlapMS = -1 ///< Sequence overlapping length (ms) - ); - - /// Get routine control parameters, see setParameters() function. - /// Any of the parameters to this function can be NULL, in such case corresponding parameter - /// value isn't returned. - void getParameters(int *pSampleRate, int *pSequenceMs, int *pSeekWindowMs, int *pOverlapMs) const; - - /// Adds 'numsamples' pcs of samples from the 'samples' memory position into - /// the input of the object. - virtual void putSamples( - const SAMPLETYPE *samples, ///< Input sample data - uint numSamples ///< Number of samples in 'samples' so that one sample - ///< contains both channels if stereo - ) override; - - /// return nominal input sample requirement for triggering a processing batch - int getInputSampleReq() const - { - return (int)(nominalSkip + 0.5); - } - - /// return nominal output sample amount when running a processing batch - int getOutputBatchSize() const - { - return seekWindowLength - overlapLength; - } - - /// return approximate initial input-output latency - int getLatency() const - { - return sampleReq; - } -}; - - -// Implementation-specific class declarations: - -#ifdef SOUNDTOUCH_ALLOW_MMX - /// Class that implements MMX optimized routines for 16bit integer samples type. - class TDStretchMMX : public TDStretch - { - protected: - double calcCrossCorr(const short *mixingPos, const short *compare, double &norm) override; - double calcCrossCorrAccumulate(const short *mixingPos, const short *compare, double &norm) override; - virtual void overlapStereo(short *output, const short *input) const override; - virtual void clearCrossCorrState() override; - }; -#endif /// SOUNDTOUCH_ALLOW_MMX - - -#ifdef SOUNDTOUCH_ALLOW_SSE - /// Class that implements SSE optimized routines for floating point samples type. - class TDStretchSSE : public TDStretch - { - protected: - double calcCrossCorr(const float *mixingPos, const float *compare, double &norm) override; - double calcCrossCorrAccumulate(const float *mixingPos, const float *compare, double &norm) override; - }; - -#endif /// SOUNDTOUCH_ALLOW_SSE - -} -#endif /// TDStretch_H +//////////////////////////////////////////////////////////////////////////////// +/// +/// Sampled sound tempo changer/time stretch algorithm. Changes the sound tempo +/// while maintaining the original pitch by using a time domain WSOLA-like method +/// with several performance-increasing tweaks. +/// +/// Note : MMX/SSE optimized functions reside in separate, platform-specific files +/// 'mmx_optimized.cpp' and 'sse_optimized.cpp' +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef TDStretch_H +#define TDStretch_H + +#include +#include "STTypes.h" +#include "RateTransposer.h" +#include "FIFOSamplePipe.h" + +namespace soundtouch +{ + +/// Default values for sound processing parameters: +/// Notice that the default parameters are tuned for contemporary popular music +/// processing. For speech processing applications these parameters suit better: +/// #define DEFAULT_SEQUENCE_MS 40 +/// #define DEFAULT_SEEKWINDOW_MS 15 +/// #define DEFAULT_OVERLAP_MS 8 +/// + +/// Default length of a single processing sequence, in milliseconds. This determines to how +/// long sequences the original sound is chopped in the time-stretch algorithm. +/// +/// The larger this value is, the lesser sequences are used in processing. In principle +/// a bigger value sounds better when slowing down tempo, but worse when increasing tempo +/// and vice versa. +/// +/// Increasing this value reduces computational burden & vice versa. +//#define DEFAULT_SEQUENCE_MS 40 +#define DEFAULT_SEQUENCE_MS USE_AUTO_SEQUENCE_LEN + +/// Giving this value for the sequence length sets automatic parameter value +/// according to tempo setting (recommended) +#define USE_AUTO_SEQUENCE_LEN 0 + +/// Seeking window default length in milliseconds for algorithm that finds the best possible +/// overlapping location. This determines from how wide window the algorithm may look for an +/// optimal joining location when mixing the sound sequences back together. +/// +/// The bigger this window setting is, the higher the possibility to find a better mixing +/// position will become, but at the same time large values may cause a "drifting" artifact +/// because consequent sequences will be taken at more uneven intervals. +/// +/// If there's a disturbing artifact that sounds as if a constant frequency was drifting +/// around, try reducing this setting. +/// +/// Increasing this value increases computational burden & vice versa. +//#define DEFAULT_SEEKWINDOW_MS 15 +#define DEFAULT_SEEKWINDOW_MS USE_AUTO_SEEKWINDOW_LEN + +/// Giving this value for the seek window length sets automatic parameter value +/// according to tempo setting (recommended) +#define USE_AUTO_SEEKWINDOW_LEN 0 + +/// Overlap length in milliseconds. When the chopped sound sequences are mixed back together, +/// to form a continuous sound stream, this parameter defines over how long period the two +/// consecutive sequences are let to overlap each other. +/// +/// This shouldn't be that critical parameter. If you reduce the DEFAULT_SEQUENCE_MS setting +/// by a large amount, you might wish to try a smaller value on this. +/// +/// Increasing this value increases computational burden & vice versa. +#define DEFAULT_OVERLAP_MS 8 + + +/// Class that does the time-stretch (tempo change) effect for the processed +/// sound. +class TDStretch : public FIFOProcessor +{ +protected: + int channels; + int sampleReq; + + int overlapLength; + int seekLength; + int seekWindowLength; + int overlapDividerBitsNorm; + int overlapDividerBitsPure; + int slopingDivider; + int sampleRate; + int sequenceMs; + int seekWindowMs; + int overlapMs; + + unsigned long maxnorm; + float maxnormf; + + double tempo; + double nominalSkip; + double skipFract; + + bool bQuickSeek; + bool bAutoSeqSetting; + bool bAutoSeekSetting; + bool isBeginning; + + SAMPLETYPE *pMidBuffer; + SAMPLETYPE *pMidBufferUnaligned; + + FIFOSampleBuffer outputBuffer; + FIFOSampleBuffer inputBuffer; + + void acceptNewOverlapLength(int newOverlapLength); + + virtual void clearCrossCorrState(); + void calculateOverlapLength(int overlapMs); + + virtual double calcCrossCorr(const SAMPLETYPE *mixingPos, const SAMPLETYPE *compare, double &norm); + virtual double calcCrossCorrAccumulate(const SAMPLETYPE *mixingPos, const SAMPLETYPE *compare, double &norm); + + virtual int seekBestOverlapPositionFull(const SAMPLETYPE *refPos); + virtual int seekBestOverlapPositionQuick(const SAMPLETYPE *refPos); + virtual int seekBestOverlapPosition(const SAMPLETYPE *refPos); + + virtual void overlapStereo(SAMPLETYPE *output, const SAMPLETYPE *input) const; + virtual void overlapMono(SAMPLETYPE *output, const SAMPLETYPE *input) const; + virtual void overlapMulti(SAMPLETYPE *output, const SAMPLETYPE *input) const; + + void clearMidBuffer(); + void overlap(SAMPLETYPE *output, const SAMPLETYPE *input, uint ovlPos) const; + + void calcSeqParameters(); + void adaptNormalizer(); + + /// Changes the tempo of the given sound samples. + /// Returns amount of samples returned in the "output" buffer. + /// The maximum amount of samples that can be returned at a time is set by + /// the 'set_returnBuffer_size' function. + void processSamples(); + +public: + TDStretch(); + virtual ~TDStretch() override; + + /// Operator 'new' is overloaded so that it automatically creates a suitable instance + /// depending on if we've a MMX/SSE/etc-capable CPU available or not. + static void *operator new(size_t s); + + /// Use this function instead of "new" operator to create a new instance of this class. + /// This function automatically chooses a correct feature set depending on if the CPU + /// supports MMX/SSE/etc extensions. + static TDStretch *newInstance(); + + /// Returns the output buffer object + FIFOSamplePipe *getOutput() { return &outputBuffer; }; + + /// Returns the input buffer object + FIFOSamplePipe *getInput() { return &inputBuffer; }; + + /// Sets new target tempo. Normal tempo = 'SCALE', smaller values represent slower + /// tempo, larger faster tempo. + void setTempo(double newTempo); + + /// Returns nonzero if there aren't any samples available for outputting. + virtual void clear() override; + + /// Clears the input buffer + void clearInput(); + + /// Sets the number of channels, 1 = mono, 2 = stereo + void setChannels(int numChannels); + + /// Enables/disables the quick position seeking algorithm. Zero to disable, + /// nonzero to enable + void enableQuickSeek(bool enable); + + /// Returns nonzero if the quick seeking algorithm is enabled. + bool isQuickSeekEnabled() const; + + /// Sets routine control parameters. These control are certain time constants + /// defining how the sound is stretched to the desired duration. + // + /// 'sampleRate' = sample rate of the sound + /// 'sequenceMS' = one processing sequence length in milliseconds + /// 'seekwindowMS' = seeking window length for scanning the best overlapping + /// position + /// 'overlapMS' = overlapping length + void setParameters(int sampleRate, ///< Samplerate of sound being processed (Hz) + int sequenceMS = -1, ///< Single processing sequence length (ms) + int seekwindowMS = -1, ///< Offset seeking window length (ms) + int overlapMS = -1 ///< Sequence overlapping length (ms) + ); + + /// Get routine control parameters, see setParameters() function. + /// Any of the parameters to this function can be NULL, in such case corresponding parameter + /// value isn't returned. + void getParameters(int *pSampleRate, int *pSequenceMs, int *pSeekWindowMs, int *pOverlapMs) const; + + /// Adds 'numsamples' pcs of samples from the 'samples' memory position into + /// the input of the object. + virtual void putSamples( + const SAMPLETYPE *samples, ///< Input sample data + uint numSamples ///< Number of samples in 'samples' so that one sample + ///< contains both channels if stereo + ) override; + + /// return nominal input sample requirement for triggering a processing batch + int getInputSampleReq() const + { + return (int)(nominalSkip + 0.5); + } + + /// return nominal output sample amount when running a processing batch + int getOutputBatchSize() const + { + return seekWindowLength - overlapLength; + } + + /// return approximate initial input-output latency + int getLatency() const + { + return sampleReq; + } +}; + + +// Implementation-specific class declarations: + +#ifdef SOUNDTOUCH_ALLOW_MMX + /// Class that implements MMX optimized routines for 16bit integer samples type. + class TDStretchMMX : public TDStretch + { + protected: + double calcCrossCorr(const short *mixingPos, const short *compare, double &norm) override; + double calcCrossCorrAccumulate(const short *mixingPos, const short *compare, double &norm) override; + virtual void overlapStereo(short *output, const short *input) const override; + virtual void clearCrossCorrState() override; + }; +#endif /// SOUNDTOUCH_ALLOW_MMX + + +#ifdef SOUNDTOUCH_ALLOW_SSE + /// Class that implements SSE optimized routines for floating point samples type. + class TDStretchSSE : public TDStretch + { + protected: + double calcCrossCorr(const float *mixingPos, const float *compare, double &norm) override; + double calcCrossCorrAccumulate(const float *mixingPos, const float *compare, double &norm) override; + }; + +#endif /// SOUNDTOUCH_ALLOW_SSE + +} +#endif /// TDStretch_H diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/mmx_optimized.cpp b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/mmx_optimized.cpp index 741ba4f22e..0bc7fe86f7 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/mmx_optimized.cpp +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/mmx_optimized.cpp @@ -1,396 +1,396 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// MMX optimized routines. All MMX optimized functions have been gathered into -/// this single source code file, regardless to their class or original source -/// code file, in order to ease porting the library to other compiler and -/// processor platforms. -/// -/// The MMX-optimizations are programmed using MMX compiler intrinsics that -/// are supported both by Microsoft Visual C++ and GCC compilers, so this file -/// should compile with both toolsets. -/// -/// NOTICE: If using Visual Studio 6.0, you'll need to install the "Visual C++ -/// 6.0 processor pack" update to support compiler intrinsic syntax. The update -/// is available for download at Microsoft Developers Network, see here: -/// http://msdn.microsoft.com/en-us/vstudio/aa718349.aspx -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#include "STTypes.h" - -#ifdef SOUNDTOUCH_ALLOW_MMX -// MMX routines available only with integer sample type - -using namespace soundtouch; - -////////////////////////////////////////////////////////////////////////////// -// -// implementation of MMX optimized functions of class 'TDStretchMMX' -// -////////////////////////////////////////////////////////////////////////////// - -#include "TDStretch.h" -#include -#include -#include - - -// Calculates cross correlation of two buffers -double TDStretchMMX::calcCrossCorr(const short *pV1, const short *pV2, double &dnorm) -{ - const __m64 *pVec1, *pVec2; - __m64 shifter; - __m64 accu, normaccu; - long corr, norm; - int i; - - pVec1 = (__m64*)pV1; - pVec2 = (__m64*)pV2; - - shifter = _m_from_int(overlapDividerBitsNorm); - normaccu = accu = _mm_setzero_si64(); - - // Process 4 parallel sets of 2 * stereo samples or 4 * mono samples - // during each round for improved CPU-level parallellization. - for (i = 0; i < channels * overlapLength / 16; i ++) - { - __m64 temp, temp2; - - // dictionary of instructions: - // _m_pmaddwd : 4*16bit multiply-add, resulting two 32bits = [a0*b0+a1*b1 ; a2*b2+a3*b3] - // _mm_add_pi32 : 2*32bit add - // _m_psrad : 32bit right-shift - - temp = _mm_add_pi32(_mm_sra_pi32(_mm_madd_pi16(pVec1[0], pVec2[0]), shifter), - _mm_sra_pi32(_mm_madd_pi16(pVec1[1], pVec2[1]), shifter)); - temp2 = _mm_add_pi32(_mm_sra_pi32(_mm_madd_pi16(pVec1[0], pVec1[0]), shifter), - _mm_sra_pi32(_mm_madd_pi16(pVec1[1], pVec1[1]), shifter)); - accu = _mm_add_pi32(accu, temp); - normaccu = _mm_add_pi32(normaccu, temp2); - - temp = _mm_add_pi32(_mm_sra_pi32(_mm_madd_pi16(pVec1[2], pVec2[2]), shifter), - _mm_sra_pi32(_mm_madd_pi16(pVec1[3], pVec2[3]), shifter)); - temp2 = _mm_add_pi32(_mm_sra_pi32(_mm_madd_pi16(pVec1[2], pVec1[2]), shifter), - _mm_sra_pi32(_mm_madd_pi16(pVec1[3], pVec1[3]), shifter)); - accu = _mm_add_pi32(accu, temp); - normaccu = _mm_add_pi32(normaccu, temp2); - - pVec1 += 4; - pVec2 += 4; - } - - // copy hi-dword of mm0 to lo-dword of mm1, then sum mmo+mm1 - // and finally store the result into the variable "corr" - - accu = _mm_add_pi32(accu, _mm_srli_si64(accu, 32)); - corr = _m_to_int(accu); - - normaccu = _mm_add_pi32(normaccu, _mm_srli_si64(normaccu, 32)); - norm = _m_to_int(normaccu); - - // Clear MMS state - _m_empty(); - - if (norm > (long)maxnorm) - { - // modify 'maxnorm' inside critical section to avoid multi-access conflict if in OpenMP mode - #pragma omp critical - if (norm > (long)maxnorm) - { - maxnorm = norm; - } - } - - // Normalize result by dividing by sqrt(norm) - this step is easiest - // done using floating point operation - dnorm = (double)norm; - - return (double)corr / sqrt(dnorm < 1e-9 ? 1.0 : dnorm); - // Note: Warning about the missing EMMS instruction is harmless - // as it'll be called elsewhere. -} - - -/// Update cross-correlation by accumulating "norm" coefficient by previously calculated value -double TDStretchMMX::calcCrossCorrAccumulate(const short *pV1, const short *pV2, double &dnorm) -{ - const __m64 *pVec1, *pVec2; - __m64 shifter; - __m64 accu; - long corr, lnorm; - int i; - - // cancel first normalizer tap from previous round - lnorm = 0; - for (i = 1; i <= channels; i ++) - { - lnorm -= (pV1[-i] * pV1[-i]) >> overlapDividerBitsNorm; - } - - pVec1 = (__m64*)pV1; - pVec2 = (__m64*)pV2; - - shifter = _m_from_int(overlapDividerBitsNorm); - accu = _mm_setzero_si64(); - - // Process 4 parallel sets of 2 * stereo samples or 4 * mono samples - // during each round for improved CPU-level parallellization. - for (i = 0; i < channels * overlapLength / 16; i ++) - { - __m64 temp; - - // dictionary of instructions: - // _m_pmaddwd : 4*16bit multiply-add, resulting two 32bits = [a0*b0+a1*b1 ; a2*b2+a3*b3] - // _mm_add_pi32 : 2*32bit add - // _m_psrad : 32bit right-shift - - temp = _mm_add_pi32(_mm_sra_pi32(_mm_madd_pi16(pVec1[0], pVec2[0]), shifter), - _mm_sra_pi32(_mm_madd_pi16(pVec1[1], pVec2[1]), shifter)); - accu = _mm_add_pi32(accu, temp); - - temp = _mm_add_pi32(_mm_sra_pi32(_mm_madd_pi16(pVec1[2], pVec2[2]), shifter), - _mm_sra_pi32(_mm_madd_pi16(pVec1[3], pVec2[3]), shifter)); - accu = _mm_add_pi32(accu, temp); - - pVec1 += 4; - pVec2 += 4; - } - - // copy hi-dword of mm0 to lo-dword of mm1, then sum mmo+mm1 - // and finally store the result into the variable "corr" - - accu = _mm_add_pi32(accu, _mm_srli_si64(accu, 32)); - corr = _m_to_int(accu); - - // Clear MMS state - _m_empty(); - - // update normalizer with last samples of this round - pV1 = (short *)pVec1; - for (int j = 1; j <= channels; j ++) - { - lnorm += (pV1[-j] * pV1[-j]) >> overlapDividerBitsNorm; - } - dnorm += (double)lnorm; - - if (lnorm > (long)maxnorm) - { - maxnorm = lnorm; - } - - // Normalize result by dividing by sqrt(norm) - this step is easiest - // done using floating point operation - return (double)corr / sqrt((dnorm < 1e-9) ? 1.0 : dnorm); -} - - -void TDStretchMMX::clearCrossCorrState() -{ - // Clear MMS state - _m_empty(); - //_asm EMMS; -} - - -// MMX-optimized version of the function overlapStereo -void TDStretchMMX::overlapStereo(short *output, const short *input) const -{ - const __m64 *pVinput, *pVMidBuf; - __m64 *pVdest; - __m64 mix1, mix2, adder, shifter; - int i; - - pVinput = (const __m64*)input; - pVMidBuf = (const __m64*)pMidBuffer; - pVdest = (__m64*)output; - - // mix1 = mixer values for 1st stereo sample - // mix1 = mixer values for 2nd stereo sample - // adder = adder for updating mixer values after each round - - mix1 = _mm_set_pi16(0, overlapLength, 0, overlapLength); - adder = _mm_set_pi16(1, -1, 1, -1); - mix2 = _mm_add_pi16(mix1, adder); - adder = _mm_add_pi16(adder, adder); - - // Overlaplength-division by shifter. "+1" is to account for "-1" deduced in - // overlapDividerBits calculation earlier. - shifter = _m_from_int(overlapDividerBitsPure + 1); - - for (i = 0; i < overlapLength / 4; i ++) - { - __m64 temp1, temp2; - - // load & shuffle data so that input & mixbuffer data samples are paired - temp1 = _mm_unpacklo_pi16(pVMidBuf[0], pVinput[0]); // = i0l m0l i0r m0r - temp2 = _mm_unpackhi_pi16(pVMidBuf[0], pVinput[0]); // = i1l m1l i1r m1r - - // temp = (temp .* mix) >> shifter - temp1 = _mm_sra_pi32(_mm_madd_pi16(temp1, mix1), shifter); - temp2 = _mm_sra_pi32(_mm_madd_pi16(temp2, mix2), shifter); - pVdest[0] = _mm_packs_pi32(temp1, temp2); // pack 2*2*32bit => 4*16bit - - // update mix += adder - mix1 = _mm_add_pi16(mix1, adder); - mix2 = _mm_add_pi16(mix2, adder); - - // --- second round begins here --- - - // load & shuffle data so that input & mixbuffer data samples are paired - temp1 = _mm_unpacklo_pi16(pVMidBuf[1], pVinput[1]); // = i2l m2l i2r m2r - temp2 = _mm_unpackhi_pi16(pVMidBuf[1], pVinput[1]); // = i3l m3l i3r m3r - - // temp = (temp .* mix) >> shifter - temp1 = _mm_sra_pi32(_mm_madd_pi16(temp1, mix1), shifter); - temp2 = _mm_sra_pi32(_mm_madd_pi16(temp2, mix2), shifter); - pVdest[1] = _mm_packs_pi32(temp1, temp2); // pack 2*2*32bit => 4*16bit - - // update mix += adder - mix1 = _mm_add_pi16(mix1, adder); - mix2 = _mm_add_pi16(mix2, adder); - - pVinput += 2; - pVMidBuf += 2; - pVdest += 2; - } - - _m_empty(); // clear MMS state -} - - -////////////////////////////////////////////////////////////////////////////// -// -// implementation of MMX optimized functions of class 'FIRFilter' -// -////////////////////////////////////////////////////////////////////////////// - -#include "FIRFilter.h" - - -FIRFilterMMX::FIRFilterMMX() : FIRFilter() -{ - filterCoeffsAlign = NULL; - filterCoeffsUnalign = NULL; -} - - -FIRFilterMMX::~FIRFilterMMX() -{ - delete[] filterCoeffsUnalign; -} - - -// (overloaded) Calculates filter coefficients for MMX routine -void FIRFilterMMX::setCoefficients(const short *coeffs, uint newLength, uint uResultDivFactor) -{ - uint i; - FIRFilter::setCoefficients(coeffs, newLength, uResultDivFactor); - - // Ensure that filter coeffs array is aligned to 16-byte boundary - delete[] filterCoeffsUnalign; - filterCoeffsUnalign = new short[2 * newLength + 8]; - filterCoeffsAlign = (short *)SOUNDTOUCH_ALIGN_POINTER_16(filterCoeffsUnalign); - - // rearrange the filter coefficients for mmx routines - for (i = 0;i < length; i += 4) - { - filterCoeffsAlign[2 * i + 0] = coeffs[i + 0]; - filterCoeffsAlign[2 * i + 1] = coeffs[i + 2]; - filterCoeffsAlign[2 * i + 2] = coeffs[i + 0]; - filterCoeffsAlign[2 * i + 3] = coeffs[i + 2]; - - filterCoeffsAlign[2 * i + 4] = coeffs[i + 1]; - filterCoeffsAlign[2 * i + 5] = coeffs[i + 3]; - filterCoeffsAlign[2 * i + 6] = coeffs[i + 1]; - filterCoeffsAlign[2 * i + 7] = coeffs[i + 3]; - } -} - - -// mmx-optimized version of the filter routine for stereo sound -uint FIRFilterMMX::evaluateFilterStereo(short *dest, const short *src, uint numSamples) const -{ - // Create stack copies of the needed member variables for asm routines : - uint i, j; - __m64 *pVdest = (__m64*)dest; - - if (length < 2) return 0; - - for (i = 0; i < (numSamples - length) / 2; i ++) - { - __m64 accu1; - __m64 accu2; - const __m64 *pVsrc = (const __m64*)src; - const __m64 *pVfilter = (const __m64*)filterCoeffsAlign; - - accu1 = accu2 = _mm_setzero_si64(); - for (j = 0; j < lengthDiv8 * 2; j ++) - { - __m64 temp1, temp2; - - temp1 = _mm_unpacklo_pi16(pVsrc[0], pVsrc[1]); // = l2 l0 r2 r0 - temp2 = _mm_unpackhi_pi16(pVsrc[0], pVsrc[1]); // = l3 l1 r3 r1 - - accu1 = _mm_add_pi32(accu1, _mm_madd_pi16(temp1, pVfilter[0])); // += l2*f2+l0*f0 r2*f2+r0*f0 - accu1 = _mm_add_pi32(accu1, _mm_madd_pi16(temp2, pVfilter[1])); // += l3*f3+l1*f1 r3*f3+r1*f1 - - temp1 = _mm_unpacklo_pi16(pVsrc[1], pVsrc[2]); // = l4 l2 r4 r2 - - accu2 = _mm_add_pi32(accu2, _mm_madd_pi16(temp2, pVfilter[0])); // += l3*f2+l1*f0 r3*f2+r1*f0 - accu2 = _mm_add_pi32(accu2, _mm_madd_pi16(temp1, pVfilter[1])); // += l4*f3+l2*f1 r4*f3+r2*f1 - - // accu1 += l2*f2+l0*f0 r2*f2+r0*f0 - // += l3*f3+l1*f1 r3*f3+r1*f1 - - // accu2 += l3*f2+l1*f0 r3*f2+r1*f0 - // l4*f3+l2*f1 r4*f3+r2*f1 - - pVfilter += 2; - pVsrc += 2; - } - // accu >>= resultDivFactor - accu1 = _mm_srai_pi32(accu1, resultDivFactor); - accu2 = _mm_srai_pi32(accu2, resultDivFactor); - - // pack 2*2*32bits => 4*16 bits - pVdest[0] = _mm_packs_pi32(accu1, accu2); - src += 4; - pVdest ++; - } - - _m_empty(); // clear emms state - - return (numSamples & 0xfffffffe) - length; -} - -#else - -// workaround to not complain about empty module -bool _dontcomplain_mmx_empty; - -#endif // SOUNDTOUCH_ALLOW_MMX +//////////////////////////////////////////////////////////////////////////////// +/// +/// MMX optimized routines. All MMX optimized functions have been gathered into +/// this single source code file, regardless to their class or original source +/// code file, in order to ease porting the library to other compiler and +/// processor platforms. +/// +/// The MMX-optimizations are programmed using MMX compiler intrinsics that +/// are supported both by Microsoft Visual C++ and GCC compilers, so this file +/// should compile with both toolsets. +/// +/// NOTICE: If using Visual Studio 6.0, you'll need to install the "Visual C++ +/// 6.0 processor pack" update to support compiler intrinsic syntax. The update +/// is available for download at Microsoft Developers Network, see here: +/// http://msdn.microsoft.com/en-us/vstudio/aa718349.aspx +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#include "STTypes.h" + +#ifdef SOUNDTOUCH_ALLOW_MMX +// MMX routines available only with integer sample type + +using namespace soundtouch; + +////////////////////////////////////////////////////////////////////////////// +// +// implementation of MMX optimized functions of class 'TDStretchMMX' +// +////////////////////////////////////////////////////////////////////////////// + +#include "TDStretch.h" +#include +#include +#include + + +// Calculates cross correlation of two buffers +double TDStretchMMX::calcCrossCorr(const short *pV1, const short *pV2, double &dnorm) +{ + const __m64 *pVec1, *pVec2; + __m64 shifter; + __m64 accu, normaccu; + long corr, norm; + int i; + + pVec1 = (__m64*)pV1; + pVec2 = (__m64*)pV2; + + shifter = _m_from_int(overlapDividerBitsNorm); + normaccu = accu = _mm_setzero_si64(); + + // Process 4 parallel sets of 2 * stereo samples or 4 * mono samples + // during each round for improved CPU-level parallellization. + for (i = 0; i < channels * overlapLength / 16; i ++) + { + __m64 temp, temp2; + + // dictionary of instructions: + // _m_pmaddwd : 4*16bit multiply-add, resulting two 32bits = [a0*b0+a1*b1 ; a2*b2+a3*b3] + // _mm_add_pi32 : 2*32bit add + // _m_psrad : 32bit right-shift + + temp = _mm_add_pi32(_mm_sra_pi32(_mm_madd_pi16(pVec1[0], pVec2[0]), shifter), + _mm_sra_pi32(_mm_madd_pi16(pVec1[1], pVec2[1]), shifter)); + temp2 = _mm_add_pi32(_mm_sra_pi32(_mm_madd_pi16(pVec1[0], pVec1[0]), shifter), + _mm_sra_pi32(_mm_madd_pi16(pVec1[1], pVec1[1]), shifter)); + accu = _mm_add_pi32(accu, temp); + normaccu = _mm_add_pi32(normaccu, temp2); + + temp = _mm_add_pi32(_mm_sra_pi32(_mm_madd_pi16(pVec1[2], pVec2[2]), shifter), + _mm_sra_pi32(_mm_madd_pi16(pVec1[3], pVec2[3]), shifter)); + temp2 = _mm_add_pi32(_mm_sra_pi32(_mm_madd_pi16(pVec1[2], pVec1[2]), shifter), + _mm_sra_pi32(_mm_madd_pi16(pVec1[3], pVec1[3]), shifter)); + accu = _mm_add_pi32(accu, temp); + normaccu = _mm_add_pi32(normaccu, temp2); + + pVec1 += 4; + pVec2 += 4; + } + + // copy hi-dword of mm0 to lo-dword of mm1, then sum mmo+mm1 + // and finally store the result into the variable "corr" + + accu = _mm_add_pi32(accu, _mm_srli_si64(accu, 32)); + corr = _m_to_int(accu); + + normaccu = _mm_add_pi32(normaccu, _mm_srli_si64(normaccu, 32)); + norm = _m_to_int(normaccu); + + // Clear MMS state + _m_empty(); + + if (norm > (long)maxnorm) + { + // modify 'maxnorm' inside critical section to avoid multi-access conflict if in OpenMP mode + #pragma omp critical + if (norm > (long)maxnorm) + { + maxnorm = norm; + } + } + + // Normalize result by dividing by sqrt(norm) - this step is easiest + // done using floating point operation + dnorm = (double)norm; + + return (double)corr / sqrt(dnorm < 1e-9 ? 1.0 : dnorm); + // Note: Warning about the missing EMMS instruction is harmless + // as it'll be called elsewhere. +} + + +/// Update cross-correlation by accumulating "norm" coefficient by previously calculated value +double TDStretchMMX::calcCrossCorrAccumulate(const short *pV1, const short *pV2, double &dnorm) +{ + const __m64 *pVec1, *pVec2; + __m64 shifter; + __m64 accu; + long corr, lnorm; + int i; + + // cancel first normalizer tap from previous round + lnorm = 0; + for (i = 1; i <= channels; i ++) + { + lnorm -= (pV1[-i] * pV1[-i]) >> overlapDividerBitsNorm; + } + + pVec1 = (__m64*)pV1; + pVec2 = (__m64*)pV2; + + shifter = _m_from_int(overlapDividerBitsNorm); + accu = _mm_setzero_si64(); + + // Process 4 parallel sets of 2 * stereo samples or 4 * mono samples + // during each round for improved CPU-level parallellization. + for (i = 0; i < channels * overlapLength / 16; i ++) + { + __m64 temp; + + // dictionary of instructions: + // _m_pmaddwd : 4*16bit multiply-add, resulting two 32bits = [a0*b0+a1*b1 ; a2*b2+a3*b3] + // _mm_add_pi32 : 2*32bit add + // _m_psrad : 32bit right-shift + + temp = _mm_add_pi32(_mm_sra_pi32(_mm_madd_pi16(pVec1[0], pVec2[0]), shifter), + _mm_sra_pi32(_mm_madd_pi16(pVec1[1], pVec2[1]), shifter)); + accu = _mm_add_pi32(accu, temp); + + temp = _mm_add_pi32(_mm_sra_pi32(_mm_madd_pi16(pVec1[2], pVec2[2]), shifter), + _mm_sra_pi32(_mm_madd_pi16(pVec1[3], pVec2[3]), shifter)); + accu = _mm_add_pi32(accu, temp); + + pVec1 += 4; + pVec2 += 4; + } + + // copy hi-dword of mm0 to lo-dword of mm1, then sum mmo+mm1 + // and finally store the result into the variable "corr" + + accu = _mm_add_pi32(accu, _mm_srli_si64(accu, 32)); + corr = _m_to_int(accu); + + // Clear MMS state + _m_empty(); + + // update normalizer with last samples of this round + pV1 = (short *)pVec1; + for (int j = 1; j <= channels; j ++) + { + lnorm += (pV1[-j] * pV1[-j]) >> overlapDividerBitsNorm; + } + dnorm += (double)lnorm; + + if (lnorm > (long)maxnorm) + { + maxnorm = lnorm; + } + + // Normalize result by dividing by sqrt(norm) - this step is easiest + // done using floating point operation + return (double)corr / sqrt((dnorm < 1e-9) ? 1.0 : dnorm); +} + + +void TDStretchMMX::clearCrossCorrState() +{ + // Clear MMS state + _m_empty(); + //_asm EMMS; +} + + +// MMX-optimized version of the function overlapStereo +void TDStretchMMX::overlapStereo(short *output, const short *input) const +{ + const __m64 *pVinput, *pVMidBuf; + __m64 *pVdest; + __m64 mix1, mix2, adder, shifter; + int i; + + pVinput = (const __m64*)input; + pVMidBuf = (const __m64*)pMidBuffer; + pVdest = (__m64*)output; + + // mix1 = mixer values for 1st stereo sample + // mix1 = mixer values for 2nd stereo sample + // adder = adder for updating mixer values after each round + + mix1 = _mm_set_pi16(0, overlapLength, 0, overlapLength); + adder = _mm_set_pi16(1, -1, 1, -1); + mix2 = _mm_add_pi16(mix1, adder); + adder = _mm_add_pi16(adder, adder); + + // Overlaplength-division by shifter. "+1" is to account for "-1" deduced in + // overlapDividerBits calculation earlier. + shifter = _m_from_int(overlapDividerBitsPure + 1); + + for (i = 0; i < overlapLength / 4; i ++) + { + __m64 temp1, temp2; + + // load & shuffle data so that input & mixbuffer data samples are paired + temp1 = _mm_unpacklo_pi16(pVMidBuf[0], pVinput[0]); // = i0l m0l i0r m0r + temp2 = _mm_unpackhi_pi16(pVMidBuf[0], pVinput[0]); // = i1l m1l i1r m1r + + // temp = (temp .* mix) >> shifter + temp1 = _mm_sra_pi32(_mm_madd_pi16(temp1, mix1), shifter); + temp2 = _mm_sra_pi32(_mm_madd_pi16(temp2, mix2), shifter); + pVdest[0] = _mm_packs_pi32(temp1, temp2); // pack 2*2*32bit => 4*16bit + + // update mix += adder + mix1 = _mm_add_pi16(mix1, adder); + mix2 = _mm_add_pi16(mix2, adder); + + // --- second round begins here --- + + // load & shuffle data so that input & mixbuffer data samples are paired + temp1 = _mm_unpacklo_pi16(pVMidBuf[1], pVinput[1]); // = i2l m2l i2r m2r + temp2 = _mm_unpackhi_pi16(pVMidBuf[1], pVinput[1]); // = i3l m3l i3r m3r + + // temp = (temp .* mix) >> shifter + temp1 = _mm_sra_pi32(_mm_madd_pi16(temp1, mix1), shifter); + temp2 = _mm_sra_pi32(_mm_madd_pi16(temp2, mix2), shifter); + pVdest[1] = _mm_packs_pi32(temp1, temp2); // pack 2*2*32bit => 4*16bit + + // update mix += adder + mix1 = _mm_add_pi16(mix1, adder); + mix2 = _mm_add_pi16(mix2, adder); + + pVinput += 2; + pVMidBuf += 2; + pVdest += 2; + } + + _m_empty(); // clear MMS state +} + + +////////////////////////////////////////////////////////////////////////////// +// +// implementation of MMX optimized functions of class 'FIRFilter' +// +////////////////////////////////////////////////////////////////////////////// + +#include "FIRFilter.h" + + +FIRFilterMMX::FIRFilterMMX() : FIRFilter() +{ + filterCoeffsAlign = NULL; + filterCoeffsUnalign = NULL; +} + + +FIRFilterMMX::~FIRFilterMMX() +{ + delete[] filterCoeffsUnalign; +} + + +// (overloaded) Calculates filter coefficients for MMX routine +void FIRFilterMMX::setCoefficients(const short *coeffs, uint newLength, uint uResultDivFactor) +{ + uint i; + FIRFilter::setCoefficients(coeffs, newLength, uResultDivFactor); + + // Ensure that filter coeffs array is aligned to 16-byte boundary + delete[] filterCoeffsUnalign; + filterCoeffsUnalign = new short[2 * newLength + 8]; + filterCoeffsAlign = (short *)SOUNDTOUCH_ALIGN_POINTER_16(filterCoeffsUnalign); + + // rearrange the filter coefficients for mmx routines + for (i = 0;i < length; i += 4) + { + filterCoeffsAlign[2 * i + 0] = coeffs[i + 0]; + filterCoeffsAlign[2 * i + 1] = coeffs[i + 2]; + filterCoeffsAlign[2 * i + 2] = coeffs[i + 0]; + filterCoeffsAlign[2 * i + 3] = coeffs[i + 2]; + + filterCoeffsAlign[2 * i + 4] = coeffs[i + 1]; + filterCoeffsAlign[2 * i + 5] = coeffs[i + 3]; + filterCoeffsAlign[2 * i + 6] = coeffs[i + 1]; + filterCoeffsAlign[2 * i + 7] = coeffs[i + 3]; + } +} + + +// mmx-optimized version of the filter routine for stereo sound +uint FIRFilterMMX::evaluateFilterStereo(short *dest, const short *src, uint numSamples) const +{ + // Create stack copies of the needed member variables for asm routines : + uint i, j; + __m64 *pVdest = (__m64*)dest; + + if (length < 2) return 0; + + for (i = 0; i < (numSamples - length) / 2; i ++) + { + __m64 accu1; + __m64 accu2; + const __m64 *pVsrc = (const __m64*)src; + const __m64 *pVfilter = (const __m64*)filterCoeffsAlign; + + accu1 = accu2 = _mm_setzero_si64(); + for (j = 0; j < lengthDiv8 * 2; j ++) + { + __m64 temp1, temp2; + + temp1 = _mm_unpacklo_pi16(pVsrc[0], pVsrc[1]); // = l2 l0 r2 r0 + temp2 = _mm_unpackhi_pi16(pVsrc[0], pVsrc[1]); // = l3 l1 r3 r1 + + accu1 = _mm_add_pi32(accu1, _mm_madd_pi16(temp1, pVfilter[0])); // += l2*f2+l0*f0 r2*f2+r0*f0 + accu1 = _mm_add_pi32(accu1, _mm_madd_pi16(temp2, pVfilter[1])); // += l3*f3+l1*f1 r3*f3+r1*f1 + + temp1 = _mm_unpacklo_pi16(pVsrc[1], pVsrc[2]); // = l4 l2 r4 r2 + + accu2 = _mm_add_pi32(accu2, _mm_madd_pi16(temp2, pVfilter[0])); // += l3*f2+l1*f0 r3*f2+r1*f0 + accu2 = _mm_add_pi32(accu2, _mm_madd_pi16(temp1, pVfilter[1])); // += l4*f3+l2*f1 r4*f3+r2*f1 + + // accu1 += l2*f2+l0*f0 r2*f2+r0*f0 + // += l3*f3+l1*f1 r3*f3+r1*f1 + + // accu2 += l3*f2+l1*f0 r3*f2+r1*f0 + // l4*f3+l2*f1 r4*f3+r2*f1 + + pVfilter += 2; + pVsrc += 2; + } + // accu >>= resultDivFactor + accu1 = _mm_srai_pi32(accu1, resultDivFactor); + accu2 = _mm_srai_pi32(accu2, resultDivFactor); + + // pack 2*2*32bits => 4*16 bits + pVdest[0] = _mm_packs_pi32(accu1, accu2); + src += 4; + pVdest ++; + } + + _m_empty(); // clear emms state + + return (numSamples & 0xfffffffe) - length; +} + +#else + +// workaround to not complain about empty module +bool _dontcomplain_mmx_empty; + +#endif // SOUNDTOUCH_ALLOW_MMX diff --git a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/sse_optimized.cpp b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/sse_optimized.cpp index cbfa96c55e..b130c52007 100644 --- a/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/sse_optimized.cpp +++ b/avidemux/common/ADM_audioFilter/src/ADM_soundtouch/sse_optimized.cpp @@ -1,365 +1,365 @@ -//////////////////////////////////////////////////////////////////////////////// -/// -/// SSE optimized routines for Pentium-III, Athlon-XP and later CPUs. All SSE -/// optimized functions have been gathered into this single source -/// code file, regardless to their class or original source code file, in order -/// to ease porting the library to other compiler and processor platforms. -/// -/// The SSE-optimizations are programmed using SSE compiler intrinsics that -/// are supported both by Microsoft Visual C++ and GCC compilers, so this file -/// should compile with both toolsets. -/// -/// NOTICE: If using Visual Studio 6.0, you'll need to install the "Visual C++ -/// 6.0 processor pack" update to support SSE instruction set. The update is -/// available for download at Microsoft Developers Network, see here: -/// http://msdn.microsoft.com/en-us/vstudio/aa718349.aspx -/// -/// If the above URL is expired or removed, go to "http://msdn.microsoft.com" and -/// perform a search with keywords "processor pack". -/// -/// Author : Copyright (c) Olli Parviainen -/// Author e-mail : oparviai 'at' iki.fi -/// SoundTouch WWW: http://www.surina.net/soundtouch -/// -//////////////////////////////////////////////////////////////////////////////// -// -// License : -// -// SoundTouch audio processing library -// Copyright (c) Olli Parviainen -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -//////////////////////////////////////////////////////////////////////////////// - -#include "STTypes.h" -#include "ADM_default.h" - -using namespace soundtouch; - -#ifdef SOUNDTOUCH_ALLOW_SSE - -// SSE routines available only with float sample type - -////////////////////////////////////////////////////////////////////////////// -// -// implementation of SSE optimized functions of class 'TDStretchSSE' -// -////////////////////////////////////////////////////////////////////////////// - -#include "TDStretch.h" -#include -#include - -// Calculates cross correlation of two buffers -double TDStretchSSE::calcCrossCorr(const float *pV1, const float *pV2, double &anorm) -{ - int i; - const float *pVec1; - const __m128 *pVec2; - __m128 vSum, vNorm; - - // Note. It means a major slow-down if the routine needs to tolerate - // unaligned __m128 memory accesses. It's way faster if we can skip - // unaligned slots and use _mm_load_ps instruction instead of _mm_loadu_ps. - // This can mean up to ~ 10-fold difference (incl. part of which is - // due to skipping every second round for stereo sound though). - // - // Compile-time define SOUNDTOUCH_ALLOW_NONEXACT_SIMD_OPTIMIZATION is provided - // for choosing if this little cheating is allowed. - -#ifdef ST_SIMD_AVOID_UNALIGNED - // Little cheating allowed, return valid correlation only for - // aligned locations, meaning every second round for stereo sound. - - #define _MM_LOAD _mm_load_ps - - if (((ulongptr)pV1) & 15) return -1e50; // skip unaligned locations - -#else - // No cheating allowed, use unaligned load & take the resulting - // performance hit. - #define _MM_LOAD _mm_loadu_ps -#endif - - // ensure overlapLength is divisible by 8 - ADM_assert((overlapLength % 8) == 0); - - // Calculates the cross-correlation value between 'pV1' and 'pV2' vectors - // Note: pV2 _must_ be aligned to 16-bit boundary, pV1 need not. - pVec1 = (const float*)pV1; - pVec2 = (const __m128*)pV2; - vSum = vNorm = _mm_setzero_ps(); - - // Unroll the loop by factor of 4 * 4 operations. Use same routine for - // stereo & mono, for mono it just means twice the amount of unrolling. - for (i = 0; i < channels * overlapLength / 16; i ++) - { - __m128 vTemp; - // vSum += pV1[0..3] * pV2[0..3] - vTemp = _MM_LOAD(pVec1); - vSum = _mm_add_ps(vSum, _mm_mul_ps(vTemp ,pVec2[0])); - vNorm = _mm_add_ps(vNorm, _mm_mul_ps(vTemp ,vTemp)); - - // vSum += pV1[4..7] * pV2[4..7] - vTemp = _MM_LOAD(pVec1 + 4); - vSum = _mm_add_ps(vSum, _mm_mul_ps(vTemp, pVec2[1])); - vNorm = _mm_add_ps(vNorm, _mm_mul_ps(vTemp ,vTemp)); - - // vSum += pV1[8..11] * pV2[8..11] - vTemp = _MM_LOAD(pVec1 + 8); - vSum = _mm_add_ps(vSum, _mm_mul_ps(vTemp, pVec2[2])); - vNorm = _mm_add_ps(vNorm, _mm_mul_ps(vTemp ,vTemp)); - - // vSum += pV1[12..15] * pV2[12..15] - vTemp = _MM_LOAD(pVec1 + 12); - vSum = _mm_add_ps(vSum, _mm_mul_ps(vTemp, pVec2[3])); - vNorm = _mm_add_ps(vNorm, _mm_mul_ps(vTemp ,vTemp)); - - pVec1 += 16; - pVec2 += 4; - } - - // return value = vSum[0] + vSum[1] + vSum[2] + vSum[3] - float *pvNorm = (float*)&vNorm; - float norm = (pvNorm[0] + pvNorm[1] + pvNorm[2] + pvNorm[3]); - anorm = norm; - - float *pvSum = (float*)&vSum; - return (double)(pvSum[0] + pvSum[1] + pvSum[2] + pvSum[3]) / sqrt(norm < 1e-9 ? 1.0 : norm); - - /* This is approximately corresponding routine in C-language yet without normalization: - double corr, norm; - uint i; - - // Calculates the cross-correlation value between 'pV1' and 'pV2' vectors - corr = norm = 0.0; - for (i = 0; i < channels * overlapLength / 16; i ++) - { - corr += pV1[0] * pV2[0] + - pV1[1] * pV2[1] + - pV1[2] * pV2[2] + - pV1[3] * pV2[3] + - pV1[4] * pV2[4] + - pV1[5] * pV2[5] + - pV1[6] * pV2[6] + - pV1[7] * pV2[7] + - pV1[8] * pV2[8] + - pV1[9] * pV2[9] + - pV1[10] * pV2[10] + - pV1[11] * pV2[11] + - pV1[12] * pV2[12] + - pV1[13] * pV2[13] + - pV1[14] * pV2[14] + - pV1[15] * pV2[15]; - - for (j = 0; j < 15; j ++) norm += pV1[j] * pV1[j]; - - pV1 += 16; - pV2 += 16; - } - return corr / sqrt(norm); - */ -} - - - -double TDStretchSSE::calcCrossCorrAccumulate(const float *pV1, const float *pV2, double &norm) -{ - // call usual calcCrossCorr function because SSE does not show big benefit of - // accumulating "norm" value, and also the "norm" rolling algorithm would get - // complicated due to SSE-specific alignment-vs-nonexact correlation rules. - return calcCrossCorr(pV1, pV2, norm); -} - - -////////////////////////////////////////////////////////////////////////////// -// -// implementation of SSE optimized functions of class 'FIRFilter' -// -////////////////////////////////////////////////////////////////////////////// - -#include "FIRFilter.h" - -FIRFilterSSE::FIRFilterSSE() : FIRFilter() -{ - filterCoeffsAlign = NULL; - filterCoeffsUnalign = NULL; -} - - -FIRFilterSSE::~FIRFilterSSE() -{ - delete[] filterCoeffsUnalign; - filterCoeffsAlign = NULL; - filterCoeffsUnalign = NULL; -} - - -// (overloaded) Calculates filter coefficients for SSE routine -void FIRFilterSSE::setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor) -{ - uint i; - float fDivider; - - FIRFilter::setCoefficients(coeffs, newLength, uResultDivFactor); - - // Scale the filter coefficients so that it won't be necessary to scale the filtering result - // also rearrange coefficients suitably for SSE - // Ensure that filter coeffs array is aligned to 16-byte boundary - delete[] filterCoeffsUnalign; - filterCoeffsUnalign = new float[2 * newLength + 4]; - filterCoeffsAlign = (float *)SOUNDTOUCH_ALIGN_POINTER_16(filterCoeffsUnalign); - - fDivider = (float)resultDivider; - - // rearrange the filter coefficients for mmx routines - for (i = 0; i < newLength; i ++) - { - filterCoeffsAlign[2 * i + 0] = - filterCoeffsAlign[2 * i + 1] = coeffs[i + 0] / fDivider; - } -} - - - -// SSE-optimized version of the filter routine for stereo sound -uint FIRFilterSSE::evaluateFilterStereo(float *dest, const float *source, uint numSamples) const -{ - int count = (int)((numSamples - length) & (uint)-2); - int j; - - ADM_assert(count % 2 == 0); - - if (count < 2) return 0; - - ADM_assert(source != NULL); - ADM_assert(dest != NULL); - ADM_assert((length % 8) == 0); - ADM_assert(filterCoeffsAlign != NULL); - ADM_assert(((ulongptr)filterCoeffsAlign) % 16 == 0); - - // filter is evaluated for two stereo samples with each iteration, thus use of 'j += 2' - #pragma omp parallel for - for (j = 0; j < count; j += 2) - { - const float *pSrc; - float *pDest; - const __m128 *pFil; - __m128 sum1, sum2; - uint i; - - pSrc = (const float*)source + j * 2; // source audio data - pDest = dest + j * 2; // destination audio data - pFil = (const __m128*)filterCoeffsAlign; // filter coefficients. NOTE: Assumes coefficients - // are aligned to 16-byte boundary - sum1 = sum2 = _mm_setzero_ps(); - - for (i = 0; i < length / 8; i ++) - { - // Unroll loop for efficiency & calculate filter for 2*2 stereo samples - // at each pass - - // sum1 is accu for 2*2 filtered stereo sound data at the primary sound data offset - // sum2 is accu for 2*2 filtered stereo sound data for the next sound sample offset. - - sum1 = _mm_add_ps(sum1, _mm_mul_ps(_mm_loadu_ps(pSrc) , pFil[0])); - sum2 = _mm_add_ps(sum2, _mm_mul_ps(_mm_loadu_ps(pSrc + 2), pFil[0])); - - sum1 = _mm_add_ps(sum1, _mm_mul_ps(_mm_loadu_ps(pSrc + 4), pFil[1])); - sum2 = _mm_add_ps(sum2, _mm_mul_ps(_mm_loadu_ps(pSrc + 6), pFil[1])); - - sum1 = _mm_add_ps(sum1, _mm_mul_ps(_mm_loadu_ps(pSrc + 8) , pFil[2])); - sum2 = _mm_add_ps(sum2, _mm_mul_ps(_mm_loadu_ps(pSrc + 10), pFil[2])); - - sum1 = _mm_add_ps(sum1, _mm_mul_ps(_mm_loadu_ps(pSrc + 12), pFil[3])); - sum2 = _mm_add_ps(sum2, _mm_mul_ps(_mm_loadu_ps(pSrc + 14), pFil[3])); - - pSrc += 16; - pFil += 4; - } - - // Now sum1 and sum2 both have a filtered 2-channel sample each, but we still need - // to sum the two hi- and lo-floats of these registers together. - - // post-shuffle & add the filtered values and store to dest. - _mm_storeu_ps(pDest, _mm_add_ps( - _mm_shuffle_ps(sum1, sum2, _MM_SHUFFLE(1,0,3,2)), // s2_1 s2_0 s1_3 s1_2 - _mm_shuffle_ps(sum1, sum2, _MM_SHUFFLE(3,2,1,0)) // s2_3 s2_2 s1_1 s1_0 - )); - } - - // Ideas for further improvement: - // 1. If it could be guaranteed that 'source' were always aligned to 16-byte - // boundary, a faster aligned '_mm_load_ps' instruction could be used. - // 2. If it could be guaranteed that 'dest' were always aligned to 16-byte - // boundary, a faster '_mm_store_ps' instruction could be used. - - return (uint)count; - - /* original routine in C-language. please notice the C-version has differently - organized coefficients though. - double suml1, suml2; - double sumr1, sumr2; - uint i, j; - - for (j = 0; j < count; j += 2) - { - const float *ptr; - const float *pFil; - - suml1 = sumr1 = 0.0; - suml2 = sumr2 = 0.0; - ptr = src; - pFil = filterCoeffs; - for (i = 0; i < lengthLocal; i ++) - { - // unroll loop for efficiency. - - suml1 += ptr[0] * pFil[0] + - ptr[2] * pFil[2] + - ptr[4] * pFil[4] + - ptr[6] * pFil[6]; - - sumr1 += ptr[1] * pFil[1] + - ptr[3] * pFil[3] + - ptr[5] * pFil[5] + - ptr[7] * pFil[7]; - - suml2 += ptr[8] * pFil[0] + - ptr[10] * pFil[2] + - ptr[12] * pFil[4] + - ptr[14] * pFil[6]; - - sumr2 += ptr[9] * pFil[1] + - ptr[11] * pFil[3] + - ptr[13] * pFil[5] + - ptr[15] * pFil[7]; - - ptr += 16; - pFil += 8; - } - dest[0] = (float)suml1; - dest[1] = (float)sumr1; - dest[2] = (float)suml2; - dest[3] = (float)sumr2; - - src += 4; - dest += 4; - } - */ -} - -#endif // SOUNDTOUCH_ALLOW_SSE +//////////////////////////////////////////////////////////////////////////////// +/// +/// SSE optimized routines for Pentium-III, Athlon-XP and later CPUs. All SSE +/// optimized functions have been gathered into this single source +/// code file, regardless to their class or original source code file, in order +/// to ease porting the library to other compiler and processor platforms. +/// +/// The SSE-optimizations are programmed using SSE compiler intrinsics that +/// are supported both by Microsoft Visual C++ and GCC compilers, so this file +/// should compile with both toolsets. +/// +/// NOTICE: If using Visual Studio 6.0, you'll need to install the "Visual C++ +/// 6.0 processor pack" update to support SSE instruction set. The update is +/// available for download at Microsoft Developers Network, see here: +/// http://msdn.microsoft.com/en-us/vstudio/aa718349.aspx +/// +/// If the above URL is expired or removed, go to "http://msdn.microsoft.com" and +/// perform a search with keywords "processor pack". +/// +/// Author : Copyright (c) Olli Parviainen +/// Author e-mail : oparviai 'at' iki.fi +/// SoundTouch WWW: http://www.surina.net/soundtouch +/// +//////////////////////////////////////////////////////////////////////////////// +// +// License : +// +// SoundTouch audio processing library +// Copyright (c) Olli Parviainen +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//////////////////////////////////////////////////////////////////////////////// + +#include "STTypes.h" +#include "ADM_default.h" + +using namespace soundtouch; + +#ifdef SOUNDTOUCH_ALLOW_SSE + +// SSE routines available only with float sample type + +////////////////////////////////////////////////////////////////////////////// +// +// implementation of SSE optimized functions of class 'TDStretchSSE' +// +////////////////////////////////////////////////////////////////////////////// + +#include "TDStretch.h" +#include +#include + +// Calculates cross correlation of two buffers +double TDStretchSSE::calcCrossCorr(const float *pV1, const float *pV2, double &anorm) +{ + int i; + const float *pVec1; + const __m128 *pVec2; + __m128 vSum, vNorm; + + // Note. It means a major slow-down if the routine needs to tolerate + // unaligned __m128 memory accesses. It's way faster if we can skip + // unaligned slots and use _mm_load_ps instruction instead of _mm_loadu_ps. + // This can mean up to ~ 10-fold difference (incl. part of which is + // due to skipping every second round for stereo sound though). + // + // Compile-time define SOUNDTOUCH_ALLOW_NONEXACT_SIMD_OPTIMIZATION is provided + // for choosing if this little cheating is allowed. + +#ifdef ST_SIMD_AVOID_UNALIGNED + // Little cheating allowed, return valid correlation only for + // aligned locations, meaning every second round for stereo sound. + + #define _MM_LOAD _mm_load_ps + + if (((ulongptr)pV1) & 15) return -1e50; // skip unaligned locations + +#else + // No cheating allowed, use unaligned load & take the resulting + // performance hit. + #define _MM_LOAD _mm_loadu_ps +#endif + + // ensure overlapLength is divisible by 8 + ADM_assert((overlapLength % 8) == 0); + + // Calculates the cross-correlation value between 'pV1' and 'pV2' vectors + // Note: pV2 _must_ be aligned to 16-bit boundary, pV1 need not. + pVec1 = (const float*)pV1; + pVec2 = (const __m128*)pV2; + vSum = vNorm = _mm_setzero_ps(); + + // Unroll the loop by factor of 4 * 4 operations. Use same routine for + // stereo & mono, for mono it just means twice the amount of unrolling. + for (i = 0; i < channels * overlapLength / 16; i ++) + { + __m128 vTemp; + // vSum += pV1[0..3] * pV2[0..3] + vTemp = _MM_LOAD(pVec1); + vSum = _mm_add_ps(vSum, _mm_mul_ps(vTemp ,pVec2[0])); + vNorm = _mm_add_ps(vNorm, _mm_mul_ps(vTemp ,vTemp)); + + // vSum += pV1[4..7] * pV2[4..7] + vTemp = _MM_LOAD(pVec1 + 4); + vSum = _mm_add_ps(vSum, _mm_mul_ps(vTemp, pVec2[1])); + vNorm = _mm_add_ps(vNorm, _mm_mul_ps(vTemp ,vTemp)); + + // vSum += pV1[8..11] * pV2[8..11] + vTemp = _MM_LOAD(pVec1 + 8); + vSum = _mm_add_ps(vSum, _mm_mul_ps(vTemp, pVec2[2])); + vNorm = _mm_add_ps(vNorm, _mm_mul_ps(vTemp ,vTemp)); + + // vSum += pV1[12..15] * pV2[12..15] + vTemp = _MM_LOAD(pVec1 + 12); + vSum = _mm_add_ps(vSum, _mm_mul_ps(vTemp, pVec2[3])); + vNorm = _mm_add_ps(vNorm, _mm_mul_ps(vTemp ,vTemp)); + + pVec1 += 16; + pVec2 += 4; + } + + // return value = vSum[0] + vSum[1] + vSum[2] + vSum[3] + float *pvNorm = (float*)&vNorm; + float norm = (pvNorm[0] + pvNorm[1] + pvNorm[2] + pvNorm[3]); + anorm = norm; + + float *pvSum = (float*)&vSum; + return (double)(pvSum[0] + pvSum[1] + pvSum[2] + pvSum[3]) / sqrt(norm < 1e-9 ? 1.0 : norm); + + /* This is approximately corresponding routine in C-language yet without normalization: + double corr, norm; + uint i; + + // Calculates the cross-correlation value between 'pV1' and 'pV2' vectors + corr = norm = 0.0; + for (i = 0; i < channels * overlapLength / 16; i ++) + { + corr += pV1[0] * pV2[0] + + pV1[1] * pV2[1] + + pV1[2] * pV2[2] + + pV1[3] * pV2[3] + + pV1[4] * pV2[4] + + pV1[5] * pV2[5] + + pV1[6] * pV2[6] + + pV1[7] * pV2[7] + + pV1[8] * pV2[8] + + pV1[9] * pV2[9] + + pV1[10] * pV2[10] + + pV1[11] * pV2[11] + + pV1[12] * pV2[12] + + pV1[13] * pV2[13] + + pV1[14] * pV2[14] + + pV1[15] * pV2[15]; + + for (j = 0; j < 15; j ++) norm += pV1[j] * pV1[j]; + + pV1 += 16; + pV2 += 16; + } + return corr / sqrt(norm); + */ +} + + + +double TDStretchSSE::calcCrossCorrAccumulate(const float *pV1, const float *pV2, double &norm) +{ + // call usual calcCrossCorr function because SSE does not show big benefit of + // accumulating "norm" value, and also the "norm" rolling algorithm would get + // complicated due to SSE-specific alignment-vs-nonexact correlation rules. + return calcCrossCorr(pV1, pV2, norm); +} + + +////////////////////////////////////////////////////////////////////////////// +// +// implementation of SSE optimized functions of class 'FIRFilter' +// +////////////////////////////////////////////////////////////////////////////// + +#include "FIRFilter.h" + +FIRFilterSSE::FIRFilterSSE() : FIRFilter() +{ + filterCoeffsAlign = NULL; + filterCoeffsUnalign = NULL; +} + + +FIRFilterSSE::~FIRFilterSSE() +{ + delete[] filterCoeffsUnalign; + filterCoeffsAlign = NULL; + filterCoeffsUnalign = NULL; +} + + +// (overloaded) Calculates filter coefficients for SSE routine +void FIRFilterSSE::setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor) +{ + uint i; + float fDivider; + + FIRFilter::setCoefficients(coeffs, newLength, uResultDivFactor); + + // Scale the filter coefficients so that it won't be necessary to scale the filtering result + // also rearrange coefficients suitably for SSE + // Ensure that filter coeffs array is aligned to 16-byte boundary + delete[] filterCoeffsUnalign; + filterCoeffsUnalign = new float[2 * newLength + 4]; + filterCoeffsAlign = (float *)SOUNDTOUCH_ALIGN_POINTER_16(filterCoeffsUnalign); + + fDivider = (float)resultDivider; + + // rearrange the filter coefficients for mmx routines + for (i = 0; i < newLength; i ++) + { + filterCoeffsAlign[2 * i + 0] = + filterCoeffsAlign[2 * i + 1] = coeffs[i + 0] / fDivider; + } +} + + + +// SSE-optimized version of the filter routine for stereo sound +uint FIRFilterSSE::evaluateFilterStereo(float *dest, const float *source, uint numSamples) const +{ + int count = (int)((numSamples - length) & (uint)-2); + int j; + + ADM_assert(count % 2 == 0); + + if (count < 2) return 0; + + ADM_assert(source != NULL); + ADM_assert(dest != NULL); + ADM_assert((length % 8) == 0); + ADM_assert(filterCoeffsAlign != NULL); + ADM_assert(((ulongptr)filterCoeffsAlign) % 16 == 0); + + // filter is evaluated for two stereo samples with each iteration, thus use of 'j += 2' + #pragma omp parallel for + for (j = 0; j < count; j += 2) + { + const float *pSrc; + float *pDest; + const __m128 *pFil; + __m128 sum1, sum2; + uint i; + + pSrc = (const float*)source + j * 2; // source audio data + pDest = dest + j * 2; // destination audio data + pFil = (const __m128*)filterCoeffsAlign; // filter coefficients. NOTE: Assumes coefficients + // are aligned to 16-byte boundary + sum1 = sum2 = _mm_setzero_ps(); + + for (i = 0; i < length / 8; i ++) + { + // Unroll loop for efficiency & calculate filter for 2*2 stereo samples + // at each pass + + // sum1 is accu for 2*2 filtered stereo sound data at the primary sound data offset + // sum2 is accu for 2*2 filtered stereo sound data for the next sound sample offset. + + sum1 = _mm_add_ps(sum1, _mm_mul_ps(_mm_loadu_ps(pSrc) , pFil[0])); + sum2 = _mm_add_ps(sum2, _mm_mul_ps(_mm_loadu_ps(pSrc + 2), pFil[0])); + + sum1 = _mm_add_ps(sum1, _mm_mul_ps(_mm_loadu_ps(pSrc + 4), pFil[1])); + sum2 = _mm_add_ps(sum2, _mm_mul_ps(_mm_loadu_ps(pSrc + 6), pFil[1])); + + sum1 = _mm_add_ps(sum1, _mm_mul_ps(_mm_loadu_ps(pSrc + 8) , pFil[2])); + sum2 = _mm_add_ps(sum2, _mm_mul_ps(_mm_loadu_ps(pSrc + 10), pFil[2])); + + sum1 = _mm_add_ps(sum1, _mm_mul_ps(_mm_loadu_ps(pSrc + 12), pFil[3])); + sum2 = _mm_add_ps(sum2, _mm_mul_ps(_mm_loadu_ps(pSrc + 14), pFil[3])); + + pSrc += 16; + pFil += 4; + } + + // Now sum1 and sum2 both have a filtered 2-channel sample each, but we still need + // to sum the two hi- and lo-floats of these registers together. + + // post-shuffle & add the filtered values and store to dest. + _mm_storeu_ps(pDest, _mm_add_ps( + _mm_shuffle_ps(sum1, sum2, _MM_SHUFFLE(1,0,3,2)), // s2_1 s2_0 s1_3 s1_2 + _mm_shuffle_ps(sum1, sum2, _MM_SHUFFLE(3,2,1,0)) // s2_3 s2_2 s1_1 s1_0 + )); + } + + // Ideas for further improvement: + // 1. If it could be guaranteed that 'source' were always aligned to 16-byte + // boundary, a faster aligned '_mm_load_ps' instruction could be used. + // 2. If it could be guaranteed that 'dest' were always aligned to 16-byte + // boundary, a faster '_mm_store_ps' instruction could be used. + + return (uint)count; + + /* original routine in C-language. please notice the C-version has differently + organized coefficients though. + double suml1, suml2; + double sumr1, sumr2; + uint i, j; + + for (j = 0; j < count; j += 2) + { + const float *ptr; + const float *pFil; + + suml1 = sumr1 = 0.0; + suml2 = sumr2 = 0.0; + ptr = src; + pFil = filterCoeffs; + for (i = 0; i < lengthLocal; i ++) + { + // unroll loop for efficiency. + + suml1 += ptr[0] * pFil[0] + + ptr[2] * pFil[2] + + ptr[4] * pFil[4] + + ptr[6] * pFil[6]; + + sumr1 += ptr[1] * pFil[1] + + ptr[3] * pFil[3] + + ptr[5] * pFil[5] + + ptr[7] * pFil[7]; + + suml2 += ptr[8] * pFil[0] + + ptr[10] * pFil[2] + + ptr[12] * pFil[4] + + ptr[14] * pFil[6]; + + sumr2 += ptr[9] * pFil[1] + + ptr[11] * pFil[3] + + ptr[13] * pFil[5] + + ptr[15] * pFil[7]; + + ptr += 16; + pFil += 8; + } + dest[0] = (float)suml1; + dest[1] = (float)sumr1; + dest[2] = (float)suml2; + dest[3] = (float)sumr2; + + src += 4; + dest += 4; + } + */ +} + +#endif // SOUNDTOUCH_ALLOW_SSE diff --git a/avidemux/common/ADM_icons/tray/film1.xpm b/avidemux/common/ADM_icons/tray/film1.xpm index 5fd26a9b27..aa26e6ebf9 100644 --- a/avidemux/common/ADM_icons/tray/film1.xpm +++ b/avidemux/common/ADM_icons/tray/film1.xpm @@ -1,284 +1,284 @@ -/* XPM */ -static const char *xpm_film1[] = { -"24 24 256 3", -"000 c black", -"001 c transparent", -"002 c #000008", -"003 c #070A18", -"004 c #202432", -"005 c #202434", -"006 c #242837", -"007 c #262837", -"008 c #262A39", -"009 c #2A2E3B", -"010 c #2E323F", -"011 c #2E3240", -"012 c #313544", -"013 c #3C3F4E", -"014 c #3E414F", -"015 c #404251", -"016 c #484C57", -"017 c #4A4959", -"018 c #4A4C5B", -"019 c #50535B", -"020 c #4C5161", -"021 c #5A5E66", -"022 c #5B5F67", -"023 c #5A5E6B", -"024 c #5E6271", -"025 c #757987", -"026 c #767989", -"027 c #7A7E85", -"028 c #B9954A", -"029 c #C5B434", -"030 c #E69400", -"031 c #FFA500", -"032 c #EABA56", -"033 c #FFC600", -"034 c #FFCE00", -"035 c #FDCA15", -"036 c #FFD900", -"037 c #FFD422", -"038 c #FFE100", -"039 c #FFE601", -"040 c #FFE608", -"041 c #FFF200", -"042 c #FFF600", -"043 c #FFFB00", -"044 c #FFFE00", -"045 c #FFF237", -"046 c #FFF63A", -"047 c #EEC143", -"048 c #F2C743", -"049 c #FFDB48", -"050 c #FFDC61", -"051 c #FFE17A", -"052 c #FFFB6B", -"053 c #82858D", -"054 c #818292", -"055 c #828695", -"056 c #87809C", -"057 c #878B99", -"058 c #878B9A", -"059 c #8A8D95", -"060 c #9397A6", -"061 c #9495A5", -"062 c #9599A1", -"063 c #969AA9", -"064 c #9B9FAF", -"065 c #9C9FAE", -"066 c #9FA2B0", -"067 c #A1A2AD", -"068 c #A6A5B4", -"069 c #A5A8B7", -"070 c #A9ADBB", -"071 c #B5AFB3", -"072 c #AEB2C0", -"073 c #B0B4C2", -"074 c #B3B6C4", -"075 c #B6BACA", -"076 c #B9BCCB", -"077 c #BDBFCA", -"078 c #E6C18B", -"079 c #ECD09C", -"080 c #F6CC82", -"081 c #F6CE8B", -"082 c #FAD08F", -"083 c #FBD391", -"084 c #FDD39D", -"085 c #C0C4D2", -"086 c #C3C5D5", -"087 c #C3C8D7", -"088 c #C5C8D6", -"089 c #C7CCDB", -"090 c #CDCCD5", -"091 c #CCCFD7", -"092 c #D7D8E3", -"093 c #D7DBE9", -"094 c #D9DCEE", -"095 c #DFE1F2", -"096 c #DFE5F2", -"097 c #E7D9CF", -"098 c #E6E6EA", -"099 c #E0E4F3", -"100 c #E1E5F2", -"101 c #E2E6F4", -"102 c #E5E9F9", -"103 c #E7EBF8", -"104 c #E9EDFC", -"105 c #EAEFFF", -"106 c #EDEAFF", -"107 c #ECEFFD", -"108 c #EDEFFE", -"109 c #EDF0FF", -"110 c #EDF2FF", -"111 c #F7F2E5", -"112 c #FFF4E3", -"113 c #F0F1FF", -"114 c #F0F5FF", -"115 c #F2F5FF", -"116 c #F3F6FF", -"117 c #F4F7FF", -"118 c #F5F8FF", -"119 c #F6F9FF", -"120 c #F6FAFF", -"121 c #FFFFF4", -"122 c #F9FCFF", -"123 c #FBFFFF", -"124 c #FCFFFF", -"125 c #FDFFFF", -"126 c Gray100", -"127 c black", -"128 c black", -"129 c black", -"130 c black", -"131 c black", -"132 c black", -"133 c black", -"134 c black", -"135 c black", -"136 c black", -"137 c black", -"138 c black", -"139 c black", -"140 c black", -"141 c black", -"142 c black", -"143 c black", -"144 c black", -"145 c black", -"146 c black", -"147 c black", -"148 c black", -"149 c black", -"150 c black", -"151 c black", -"152 c black", -"153 c black", -"154 c black", -"155 c black", -"156 c black", -"157 c black", -"158 c black", -"159 c black", -"160 c black", -"161 c black", -"162 c black", -"163 c black", -"164 c black", -"165 c black", -"166 c black", -"167 c black", -"168 c black", -"169 c black", -"170 c black", -"171 c black", -"172 c black", -"173 c black", -"174 c black", -"175 c black", -"176 c black", -"177 c black", -"178 c black", -"179 c black", -"180 c black", -"181 c black", -"182 c black", -"183 c black", -"184 c black", -"185 c black", -"186 c black", -"187 c black", -"188 c black", -"189 c black", -"190 c black", -"191 c black", -"192 c black", -"193 c black", -"194 c black", -"195 c black", -"196 c black", -"197 c black", -"198 c black", -"199 c black", -"200 c black", -"201 c black", -"202 c black", -"203 c black", -"204 c black", -"205 c black", -"206 c black", -"207 c black", -"208 c black", -"209 c black", -"210 c black", -"211 c black", -"212 c black", -"213 c black", -"214 c black", -"215 c black", -"216 c black", -"217 c black", -"218 c black", -"219 c black", -"220 c black", -"221 c black", -"222 c black", -"223 c black", -"224 c black", -"225 c black", -"226 c black", -"227 c black", -"228 c black", -"229 c black", -"230 c black", -"231 c black", -"232 c black", -"233 c black", -"234 c black", -"235 c black", -"236 c black", -"237 c black", -"238 c black", -"239 c black", -"240 c black", -"241 c black", -"242 c black", -"243 c black", -"244 c black", -"245 c black", -"246 c black", -"247 c black", -"248 c black", -"249 c black", -"250 c black", -"251 c black", -"252 c black", -"253 c black", -"254 c black", -"255 c black", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000126126000000000000126126000000000000126126000000000000126126000000", -"000000126126000000000000126126000000000000126126000000000000126126000000", -"000000126126000000000000126126000000000000126126000000000000126126000000", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000126126126126126126067027059053022019021091126126126126126126000000", -"000000126126126126126068024060057008012004005009099126126126126126000000", -"000000126126126126113006069118063015055010001001013126126126126126000000", -"000000126126126126061000072064016062076025014000000086126126126126000000", -"000000126126126126018000007089029048077070003000000023126126126126000000", -"000000126126126102002000065126039030071115085000000000075126126126000000", -"000000126126126020000026126126050028126126123074000000058126126126000000", -"000000126126119056017108126126111098126124116104011000073126126126000000", -"000000126126126126106126126126126126125118107101066054126126126126000000", -"000000126126126126126117120122122120115104100093088114126126126126000000", -"000000126126126126126117105110109107103096092090087126126126126126000000", -"000000126126126126126112082081097095094079083080084126126126126126000000", -"000000126126126126126033040052049078047045046036031121126126126126000000", -"000000126126126126126037041043034032035042044038051126126126126126000000", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000126126000000000000126126000000000000126126000000000000126126000000", -"000000126126000000000000126126000000000000126126000000000000126126000000", -"000000126126000000000000126126000000000000126126000000000000126126000000", -"000000000000000000000000000000000000000000000000000000000000000000000000" -}; +/* XPM */ +static const char *xpm_film1[] = { +"24 24 256 3", +"000 c black", +"001 c transparent", +"002 c #000008", +"003 c #070A18", +"004 c #202432", +"005 c #202434", +"006 c #242837", +"007 c #262837", +"008 c #262A39", +"009 c #2A2E3B", +"010 c #2E323F", +"011 c #2E3240", +"012 c #313544", +"013 c #3C3F4E", +"014 c #3E414F", +"015 c #404251", +"016 c #484C57", +"017 c #4A4959", +"018 c #4A4C5B", +"019 c #50535B", +"020 c #4C5161", +"021 c #5A5E66", +"022 c #5B5F67", +"023 c #5A5E6B", +"024 c #5E6271", +"025 c #757987", +"026 c #767989", +"027 c #7A7E85", +"028 c #B9954A", +"029 c #C5B434", +"030 c #E69400", +"031 c #FFA500", +"032 c #EABA56", +"033 c #FFC600", +"034 c #FFCE00", +"035 c #FDCA15", +"036 c #FFD900", +"037 c #FFD422", +"038 c #FFE100", +"039 c #FFE601", +"040 c #FFE608", +"041 c #FFF200", +"042 c #FFF600", +"043 c #FFFB00", +"044 c #FFFE00", +"045 c #FFF237", +"046 c #FFF63A", +"047 c #EEC143", +"048 c #F2C743", +"049 c #FFDB48", +"050 c #FFDC61", +"051 c #FFE17A", +"052 c #FFFB6B", +"053 c #82858D", +"054 c #818292", +"055 c #828695", +"056 c #87809C", +"057 c #878B99", +"058 c #878B9A", +"059 c #8A8D95", +"060 c #9397A6", +"061 c #9495A5", +"062 c #9599A1", +"063 c #969AA9", +"064 c #9B9FAF", +"065 c #9C9FAE", +"066 c #9FA2B0", +"067 c #A1A2AD", +"068 c #A6A5B4", +"069 c #A5A8B7", +"070 c #A9ADBB", +"071 c #B5AFB3", +"072 c #AEB2C0", +"073 c #B0B4C2", +"074 c #B3B6C4", +"075 c #B6BACA", +"076 c #B9BCCB", +"077 c #BDBFCA", +"078 c #E6C18B", +"079 c #ECD09C", +"080 c #F6CC82", +"081 c #F6CE8B", +"082 c #FAD08F", +"083 c #FBD391", +"084 c #FDD39D", +"085 c #C0C4D2", +"086 c #C3C5D5", +"087 c #C3C8D7", +"088 c #C5C8D6", +"089 c #C7CCDB", +"090 c #CDCCD5", +"091 c #CCCFD7", +"092 c #D7D8E3", +"093 c #D7DBE9", +"094 c #D9DCEE", +"095 c #DFE1F2", +"096 c #DFE5F2", +"097 c #E7D9CF", +"098 c #E6E6EA", +"099 c #E0E4F3", +"100 c #E1E5F2", +"101 c #E2E6F4", +"102 c #E5E9F9", +"103 c #E7EBF8", +"104 c #E9EDFC", +"105 c #EAEFFF", +"106 c #EDEAFF", +"107 c #ECEFFD", +"108 c #EDEFFE", +"109 c #EDF0FF", +"110 c #EDF2FF", +"111 c #F7F2E5", +"112 c #FFF4E3", +"113 c #F0F1FF", +"114 c #F0F5FF", +"115 c #F2F5FF", +"116 c #F3F6FF", +"117 c #F4F7FF", +"118 c #F5F8FF", +"119 c #F6F9FF", +"120 c #F6FAFF", +"121 c #FFFFF4", +"122 c #F9FCFF", +"123 c #FBFFFF", +"124 c #FCFFFF", +"125 c #FDFFFF", +"126 c Gray100", +"127 c black", +"128 c black", +"129 c black", +"130 c black", +"131 c black", +"132 c black", +"133 c black", +"134 c black", +"135 c black", +"136 c black", +"137 c black", +"138 c black", +"139 c black", +"140 c black", +"141 c black", +"142 c black", +"143 c black", +"144 c black", +"145 c black", +"146 c black", +"147 c black", +"148 c black", +"149 c black", +"150 c black", +"151 c black", +"152 c black", +"153 c black", +"154 c black", +"155 c black", +"156 c black", +"157 c black", +"158 c black", +"159 c black", +"160 c black", +"161 c black", +"162 c black", +"163 c black", +"164 c black", +"165 c black", +"166 c black", +"167 c black", +"168 c black", +"169 c black", +"170 c black", +"171 c black", +"172 c black", +"173 c black", +"174 c black", +"175 c black", +"176 c black", +"177 c black", +"178 c black", +"179 c black", +"180 c black", +"181 c black", +"182 c black", +"183 c black", +"184 c black", +"185 c black", +"186 c black", +"187 c black", +"188 c black", +"189 c black", +"190 c black", +"191 c black", +"192 c black", +"193 c black", +"194 c black", +"195 c black", +"196 c black", +"197 c black", +"198 c black", +"199 c black", +"200 c black", +"201 c black", +"202 c black", +"203 c black", +"204 c black", +"205 c black", +"206 c black", +"207 c black", +"208 c black", +"209 c black", +"210 c black", +"211 c black", +"212 c black", +"213 c black", +"214 c black", +"215 c black", +"216 c black", +"217 c black", +"218 c black", +"219 c black", +"220 c black", +"221 c black", +"222 c black", +"223 c black", +"224 c black", +"225 c black", +"226 c black", +"227 c black", +"228 c black", +"229 c black", +"230 c black", +"231 c black", +"232 c black", +"233 c black", +"234 c black", +"235 c black", +"236 c black", +"237 c black", +"238 c black", +"239 c black", +"240 c black", +"241 c black", +"242 c black", +"243 c black", +"244 c black", +"245 c black", +"246 c black", +"247 c black", +"248 c black", +"249 c black", +"250 c black", +"251 c black", +"252 c black", +"253 c black", +"254 c black", +"255 c black", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000126126000000000000126126000000000000126126000000000000126126000000", +"000000126126000000000000126126000000000000126126000000000000126126000000", +"000000126126000000000000126126000000000000126126000000000000126126000000", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000126126126126126126067027059053022019021091126126126126126126000000", +"000000126126126126126068024060057008012004005009099126126126126126000000", +"000000126126126126113006069118063015055010001001013126126126126126000000", +"000000126126126126061000072064016062076025014000000086126126126126000000", +"000000126126126126018000007089029048077070003000000023126126126126000000", +"000000126126126102002000065126039030071115085000000000075126126126000000", +"000000126126126020000026126126050028126126123074000000058126126126000000", +"000000126126119056017108126126111098126124116104011000073126126126000000", +"000000126126126126106126126126126126125118107101066054126126126126000000", +"000000126126126126126117120122122120115104100093088114126126126126000000", +"000000126126126126126117105110109107103096092090087126126126126126000000", +"000000126126126126126112082081097095094079083080084126126126126126000000", +"000000126126126126126033040052049078047045046036031121126126126126000000", +"000000126126126126126037041043034032035042044038051126126126126126000000", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000126126000000000000126126000000000000126126000000000000126126000000", +"000000126126000000000000126126000000000000126126000000000000126126000000", +"000000126126000000000000126126000000000000126126000000000000126126000000", +"000000000000000000000000000000000000000000000000000000000000000000000000" +}; diff --git a/avidemux/common/ADM_icons/tray/film11.xpm b/avidemux/common/ADM_icons/tray/film11.xpm index 2da9ea2ea6..d3ce803802 100644 --- a/avidemux/common/ADM_icons/tray/film11.xpm +++ b/avidemux/common/ADM_icons/tray/film11.xpm @@ -1,284 +1,284 @@ -/* XPM */ -static const char *xpm_film11[] = { -"24 24 256 3", -"000 c black", -"001 c #010000", -"002 c #020100", -"003 c #030200", -"004 c #070601", -"005 c #070801", -"006 c #0B0A05", -"007 c #0D0C06", -"008 c #0E0D07", -"009 c #0F0D08", -"010 c #0F0E08", -"011 c #100F0A", -"012 c #11100B", -"013 c #12110B", -"014 c #13120C", -"015 c #14120D", -"016 c #14130D", -"017 c #15130F", -"018 c #151410", -"019 c #161710", -"020 c #181711", -"021 c #191812", -"022 c #1A1914", -"023 c #1B1A15", -"024 c #1C1B16", -"025 c #1D1C16", -"026 c #1E1D17", -"027 c #1F1E19", -"028 c #201E19", -"029 c #201F1A", -"030 c #20201A", -"031 c #23221C", -"032 c #23231C", -"033 c #23231D", -"034 c #24221C", -"035 c #24231D", -"036 c #24231F", -"037 c #25231F", -"038 c #25241E", -"039 c #25251F", -"040 c #282722", -"041 c #2A2925", -"042 c #2B2925", -"043 c #2E2D27", -"044 c #322F2B", -"045 c #32312B", -"046 c #33312C", -"047 c #32322E", -"048 c #37332F", -"049 c #383731", -"050 c #3A3934", -"051 c #3C3C35", -"052 c #483F3C", -"053 c #43423C", -"054 c #474640", -"055 c #4C4B46", -"056 c #4D4C48", -"057 c #4F4E49", -"058 c #53524E", -"059 c #53534F", -"060 c #555450", -"061 c #575650", -"062 c #585752", -"063 c #5D5353", -"064 c #5A5954", -"065 c #625E5D", -"066 c #63625D", -"067 c #64625E", -"068 c #676660", -"069 c #6B6A64", -"070 c #6E6E6C", -"071 c #71706C", -"072 c #72726F", -"073 c #757573", -"074 c #777776", -"075 c #7C7C78", -"076 c #807D7D", -"077 c #81817A", -"078 c #82817F", -"079 c #878784", -"080 c #8D8C89", -"081 c #949391", -"082 c #969593", -"083 c #9B9B98", -"084 c #A2A39D", -"085 c #A6A3A2", -"086 c #A7A8A5", -"087 c #A9A9A5", -"088 c #AAA9A7", -"089 c #ABAAA5", -"090 c #B4B3B1", -"091 c #B6B5B0", -"092 c Gray71", -"093 c #B5B4B6", -"094 c #BAB9BA", -"095 c #BBBAB9", -"096 c #BCBBBB", -"097 c #BCBDBD", -"098 c #BDBCBF", -"099 c #BFBFC1", -"100 c #C3C3C3", -"101 c Gray78", -"102 c Gray81", -"103 c #D4D3CE", -"104 c #D4D3D1", -"105 c #D8D5D0", -"106 c #DAD8D4", -"107 c #DADAD8", -"108 c #E2E2DE", -"109 c #E4E4E3", -"110 c #E7E7E8", -"111 c #EBE9E3", -"112 c #EAE9EA", -"113 c #EEEDEB", -"114 c #F8F7F3", -"115 c #FEFFFF", -"116 c Gray100", -"117 c black", -"118 c black", -"119 c black", -"120 c black", -"121 c black", -"122 c black", -"123 c black", -"124 c black", -"125 c black", -"126 c black", -"127 c black", -"128 c black", -"129 c black", -"130 c black", -"131 c black", -"132 c black", -"133 c black", -"134 c black", -"135 c black", -"136 c black", -"137 c black", -"138 c black", -"139 c black", -"140 c black", -"141 c black", -"142 c black", -"143 c black", -"144 c black", -"145 c black", -"146 c black", -"147 c black", -"148 c black", -"149 c black", -"150 c black", -"151 c black", -"152 c black", -"153 c black", -"154 c black", -"155 c black", -"156 c black", -"157 c black", -"158 c black", -"159 c black", -"160 c black", -"161 c black", -"162 c black", -"163 c black", -"164 c black", -"165 c black", -"166 c black", -"167 c black", -"168 c black", -"169 c black", -"170 c black", -"171 c black", -"172 c black", -"173 c black", -"174 c black", -"175 c black", -"176 c black", -"177 c black", -"178 c black", -"179 c black", -"180 c black", -"181 c black", -"182 c black", -"183 c black", -"184 c black", -"185 c black", -"186 c black", -"187 c black", -"188 c black", -"189 c black", -"190 c black", -"191 c black", -"192 c black", -"193 c black", -"194 c black", -"195 c black", -"196 c black", -"197 c black", -"198 c black", -"199 c black", -"200 c black", -"201 c black", -"202 c black", -"203 c black", -"204 c black", -"205 c black", -"206 c black", -"207 c black", -"208 c black", -"209 c black", -"210 c black", -"211 c black", -"212 c black", -"213 c black", -"214 c black", -"215 c black", -"216 c black", -"217 c black", -"218 c black", -"219 c black", -"220 c black", -"221 c black", -"222 c black", -"223 c black", -"224 c black", -"225 c black", -"226 c black", -"227 c black", -"228 c black", -"229 c black", -"230 c black", -"231 c black", -"232 c black", -"233 c black", -"234 c black", -"235 c black", -"236 c black", -"237 c black", -"238 c black", -"239 c black", -"240 c black", -"241 c black", -"242 c black", -"243 c black", -"244 c black", -"245 c black", -"246 c black", -"247 c black", -"248 c black", -"249 c black", -"250 c black", -"251 c black", -"252 c black", -"253 c black", -"254 c black", -"255 c black", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"116116000000000000116116000000000000116116000000000000116116000000000000", -"116116000000000000116116000000000000116116000000000000116116000000000000", -"116116000000000000116116000000000000116116000000000000116116000000000000", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"116116000000000000116116116116116116116116116116083024022034090116116116", -"116116000000000000116116116116116116116116107060116111055038079116116116", -"116116000000000000116116116116116116116096084049028057033016059116116116", -"116116000000000000116116116116116092041054089056033030072112116116116116", -"116116000000000000116116116116082110113029025021075115116116116116116116", -"116116000000000000116116116116109018027008073116116116116116116116116116", -"116116000000000000116116116116102047068071074088078076085080104116116116", -"116116000000000000116116116116101087108061105114077103106043053081116116", -"116116000000000000116116116116116065019046069066067091058045062086116116", -"116116000000000000116116116116116063023032043051050044040036042093116116", -"116116000000000000116116116116116052015020026035039031037023012097116116", -"116116000000000000116116116116116048005010014019016020017009003099116116", -"116116000000000000116116116116116095064007003007007006011002000098116116", -"116116000000000000116116116116116116116116100070013001004000000094116116", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"116116000000000000116116000000000000116116000000000000116116000000000000", -"116116000000000000116116000000000000116116000000000000116116000000000000", -"116116000000000000116116000000000000116116000000000000116116000000000000", -"000000000000000000000000000000000000000000000000000000000000000000000000" -}; +/* XPM */ +static const char *xpm_film11[] = { +"24 24 256 3", +"000 c black", +"001 c #010000", +"002 c #020100", +"003 c #030200", +"004 c #070601", +"005 c #070801", +"006 c #0B0A05", +"007 c #0D0C06", +"008 c #0E0D07", +"009 c #0F0D08", +"010 c #0F0E08", +"011 c #100F0A", +"012 c #11100B", +"013 c #12110B", +"014 c #13120C", +"015 c #14120D", +"016 c #14130D", +"017 c #15130F", +"018 c #151410", +"019 c #161710", +"020 c #181711", +"021 c #191812", +"022 c #1A1914", +"023 c #1B1A15", +"024 c #1C1B16", +"025 c #1D1C16", +"026 c #1E1D17", +"027 c #1F1E19", +"028 c #201E19", +"029 c #201F1A", +"030 c #20201A", +"031 c #23221C", +"032 c #23231C", +"033 c #23231D", +"034 c #24221C", +"035 c #24231D", +"036 c #24231F", +"037 c #25231F", +"038 c #25241E", +"039 c #25251F", +"040 c #282722", +"041 c #2A2925", +"042 c #2B2925", +"043 c #2E2D27", +"044 c #322F2B", +"045 c #32312B", +"046 c #33312C", +"047 c #32322E", +"048 c #37332F", +"049 c #383731", +"050 c #3A3934", +"051 c #3C3C35", +"052 c #483F3C", +"053 c #43423C", +"054 c #474640", +"055 c #4C4B46", +"056 c #4D4C48", +"057 c #4F4E49", +"058 c #53524E", +"059 c #53534F", +"060 c #555450", +"061 c #575650", +"062 c #585752", +"063 c #5D5353", +"064 c #5A5954", +"065 c #625E5D", +"066 c #63625D", +"067 c #64625E", +"068 c #676660", +"069 c #6B6A64", +"070 c #6E6E6C", +"071 c #71706C", +"072 c #72726F", +"073 c #757573", +"074 c #777776", +"075 c #7C7C78", +"076 c #807D7D", +"077 c #81817A", +"078 c #82817F", +"079 c #878784", +"080 c #8D8C89", +"081 c #949391", +"082 c #969593", +"083 c #9B9B98", +"084 c #A2A39D", +"085 c #A6A3A2", +"086 c #A7A8A5", +"087 c #A9A9A5", +"088 c #AAA9A7", +"089 c #ABAAA5", +"090 c #B4B3B1", +"091 c #B6B5B0", +"092 c Gray71", +"093 c #B5B4B6", +"094 c #BAB9BA", +"095 c #BBBAB9", +"096 c #BCBBBB", +"097 c #BCBDBD", +"098 c #BDBCBF", +"099 c #BFBFC1", +"100 c #C3C3C3", +"101 c Gray78", +"102 c Gray81", +"103 c #D4D3CE", +"104 c #D4D3D1", +"105 c #D8D5D0", +"106 c #DAD8D4", +"107 c #DADAD8", +"108 c #E2E2DE", +"109 c #E4E4E3", +"110 c #E7E7E8", +"111 c #EBE9E3", +"112 c #EAE9EA", +"113 c #EEEDEB", +"114 c #F8F7F3", +"115 c #FEFFFF", +"116 c Gray100", +"117 c black", +"118 c black", +"119 c black", +"120 c black", +"121 c black", +"122 c black", +"123 c black", +"124 c black", +"125 c black", +"126 c black", +"127 c black", +"128 c black", +"129 c black", +"130 c black", +"131 c black", +"132 c black", +"133 c black", +"134 c black", +"135 c black", +"136 c black", +"137 c black", +"138 c black", +"139 c black", +"140 c black", +"141 c black", +"142 c black", +"143 c black", +"144 c black", +"145 c black", +"146 c black", +"147 c black", +"148 c black", +"149 c black", +"150 c black", +"151 c black", +"152 c black", +"153 c black", +"154 c black", +"155 c black", +"156 c black", +"157 c black", +"158 c black", +"159 c black", +"160 c black", +"161 c black", +"162 c black", +"163 c black", +"164 c black", +"165 c black", +"166 c black", +"167 c black", +"168 c black", +"169 c black", +"170 c black", +"171 c black", +"172 c black", +"173 c black", +"174 c black", +"175 c black", +"176 c black", +"177 c black", +"178 c black", +"179 c black", +"180 c black", +"181 c black", +"182 c black", +"183 c black", +"184 c black", +"185 c black", +"186 c black", +"187 c black", +"188 c black", +"189 c black", +"190 c black", +"191 c black", +"192 c black", +"193 c black", +"194 c black", +"195 c black", +"196 c black", +"197 c black", +"198 c black", +"199 c black", +"200 c black", +"201 c black", +"202 c black", +"203 c black", +"204 c black", +"205 c black", +"206 c black", +"207 c black", +"208 c black", +"209 c black", +"210 c black", +"211 c black", +"212 c black", +"213 c black", +"214 c black", +"215 c black", +"216 c black", +"217 c black", +"218 c black", +"219 c black", +"220 c black", +"221 c black", +"222 c black", +"223 c black", +"224 c black", +"225 c black", +"226 c black", +"227 c black", +"228 c black", +"229 c black", +"230 c black", +"231 c black", +"232 c black", +"233 c black", +"234 c black", +"235 c black", +"236 c black", +"237 c black", +"238 c black", +"239 c black", +"240 c black", +"241 c black", +"242 c black", +"243 c black", +"244 c black", +"245 c black", +"246 c black", +"247 c black", +"248 c black", +"249 c black", +"250 c black", +"251 c black", +"252 c black", +"253 c black", +"254 c black", +"255 c black", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"116116000000000000116116000000000000116116000000000000116116000000000000", +"116116000000000000116116000000000000116116000000000000116116000000000000", +"116116000000000000116116000000000000116116000000000000116116000000000000", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"116116000000000000116116116116116116116116116116083024022034090116116116", +"116116000000000000116116116116116116116116107060116111055038079116116116", +"116116000000000000116116116116116116116096084049028057033016059116116116", +"116116000000000000116116116116116092041054089056033030072112116116116116", +"116116000000000000116116116116082110113029025021075115116116116116116116", +"116116000000000000116116116116109018027008073116116116116116116116116116", +"116116000000000000116116116116102047068071074088078076085080104116116116", +"116116000000000000116116116116101087108061105114077103106043053081116116", +"116116000000000000116116116116116065019046069066067091058045062086116116", +"116116000000000000116116116116116063023032043051050044040036042093116116", +"116116000000000000116116116116116052015020026035039031037023012097116116", +"116116000000000000116116116116116048005010014019016020017009003099116116", +"116116000000000000116116116116116095064007003007007006011002000098116116", +"116116000000000000116116116116116116116116100070013001004000000094116116", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"116116000000000000116116000000000000116116000000000000116116000000000000", +"116116000000000000116116000000000000116116000000000000116116000000000000", +"116116000000000000116116000000000000116116000000000000116116000000000000", +"000000000000000000000000000000000000000000000000000000000000000000000000" +}; diff --git a/avidemux/common/ADM_icons/tray/film13.xpm b/avidemux/common/ADM_icons/tray/film13.xpm index 5c9b0fff05..ec79f50158 100644 --- a/avidemux/common/ADM_icons/tray/film13.xpm +++ b/avidemux/common/ADM_icons/tray/film13.xpm @@ -1,284 +1,284 @@ -/* XPM */ -static const char *xpm_film13[] = { -"24 24 256 3", -"000 c black", -"001 c #010000", -"002 c #020100", -"003 c #030200", -"004 c #070601", -"005 c #070801", -"006 c #0B0A05", -"007 c #0D0C06", -"008 c #0E0D07", -"009 c #0F0D08", -"010 c #0F0E08", -"011 c #100F0A", -"012 c #11100B", -"013 c #12110B", -"014 c #13120C", -"015 c #14120D", -"016 c #14130D", -"017 c #15130F", -"018 c #151410", -"019 c #161710", -"020 c #181711", -"021 c #191812", -"022 c #1A1914", -"023 c #1B1A15", -"024 c #1C1B16", -"025 c #1D1C16", -"026 c #1E1D17", -"027 c #1F1E19", -"028 c #201E19", -"029 c #201F1A", -"030 c #20201A", -"031 c #23221C", -"032 c #23231C", -"033 c #23231D", -"034 c #24221C", -"035 c #24231D", -"036 c #24231F", -"037 c #25231F", -"038 c #25241E", -"039 c #25251F", -"040 c #282722", -"041 c #2A2925", -"042 c #2B2925", -"043 c #2E2D27", -"044 c #322F2B", -"045 c #32312B", -"046 c #33312C", -"047 c #32322E", -"048 c #37332F", -"049 c #383731", -"050 c #3A3934", -"051 c #3C3C35", -"052 c #483F3C", -"053 c #43423C", -"054 c #474640", -"055 c #4C4B46", -"056 c #4D4C48", -"057 c #4F4E49", -"058 c #53524E", -"059 c #53534F", -"060 c #555450", -"061 c #575650", -"062 c #585752", -"063 c #5D5353", -"064 c #5A5954", -"065 c #625E5D", -"066 c #63625D", -"067 c #64625E", -"068 c #676660", -"069 c #6B6A64", -"070 c #6E6E6C", -"071 c #71706C", -"072 c #72726F", -"073 c #757573", -"074 c #777776", -"075 c #7C7C78", -"076 c #807D7D", -"077 c #81817A", -"078 c #82817F", -"079 c #878784", -"080 c #8D8C89", -"081 c #949391", -"082 c #969593", -"083 c #9B9B98", -"084 c #A2A39D", -"085 c #A6A3A2", -"086 c #A7A8A5", -"087 c #A9A9A5", -"088 c #AAA9A7", -"089 c #ABAAA5", -"090 c #B4B3B1", -"091 c #B6B5B0", -"092 c Gray71", -"093 c #B5B4B6", -"094 c #BAB9BA", -"095 c #BBBAB9", -"096 c #BCBBBB", -"097 c #BCBDBD", -"098 c #BDBCBF", -"099 c #BFBFC1", -"100 c #C3C3C3", -"101 c Gray78", -"102 c Gray81", -"103 c #D4D3CE", -"104 c #D4D3D1", -"105 c #D8D5D0", -"106 c #DAD8D4", -"107 c #DADAD8", -"108 c #E2E2DE", -"109 c #E4E4E3", -"110 c #E7E7E8", -"111 c #EBE9E3", -"112 c #EAE9EA", -"113 c #EEEDEB", -"114 c #F8F7F3", -"115 c #FEFFFF", -"116 c Gray100", -"117 c black", -"118 c black", -"119 c black", -"120 c black", -"121 c black", -"122 c black", -"123 c black", -"124 c black", -"125 c black", -"126 c black", -"127 c black", -"128 c black", -"129 c black", -"130 c black", -"131 c black", -"132 c black", -"133 c black", -"134 c black", -"135 c black", -"136 c black", -"137 c black", -"138 c black", -"139 c black", -"140 c black", -"141 c black", -"142 c black", -"143 c black", -"144 c black", -"145 c black", -"146 c black", -"147 c black", -"148 c black", -"149 c black", -"150 c black", -"151 c black", -"152 c black", -"153 c black", -"154 c black", -"155 c black", -"156 c black", -"157 c black", -"158 c black", -"159 c black", -"160 c black", -"161 c black", -"162 c black", -"163 c black", -"164 c black", -"165 c black", -"166 c black", -"167 c black", -"168 c black", -"169 c black", -"170 c black", -"171 c black", -"172 c black", -"173 c black", -"174 c black", -"175 c black", -"176 c black", -"177 c black", -"178 c black", -"179 c black", -"180 c black", -"181 c black", -"182 c black", -"183 c black", -"184 c black", -"185 c black", -"186 c black", -"187 c black", -"188 c black", -"189 c black", -"190 c black", -"191 c black", -"192 c black", -"193 c black", -"194 c black", -"195 c black", -"196 c black", -"197 c black", -"198 c black", -"199 c black", -"200 c black", -"201 c black", -"202 c black", -"203 c black", -"204 c black", -"205 c black", -"206 c black", -"207 c black", -"208 c black", -"209 c black", -"210 c black", -"211 c black", -"212 c black", -"213 c black", -"214 c black", -"215 c black", -"216 c black", -"217 c black", -"218 c black", -"219 c black", -"220 c black", -"221 c black", -"222 c black", -"223 c black", -"224 c black", -"225 c black", -"226 c black", -"227 c black", -"228 c black", -"229 c black", -"230 c black", -"231 c black", -"232 c black", -"233 c black", -"234 c black", -"235 c black", -"236 c black", -"237 c black", -"238 c black", -"239 c black", -"240 c black", -"241 c black", -"242 c black", -"243 c black", -"244 c black", -"245 c black", -"246 c black", -"247 c black", -"248 c black", -"249 c black", -"250 c black", -"251 c black", -"252 c black", -"253 c black", -"254 c black", -"255 c black", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000116116000000000000116116000000000000116116000000000000116116000000", -"000000116116000000000000116116000000000000116116000000000000116116000000", -"000000116116000000000000116116000000000000116116000000000000116116000000", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000116116116116116116116116116116083024022034090116116116116116000000", -"000000116116116116116116116116107060116111055038079116116116116116000000", -"000000116116116116116116116096084049028057033016059116116116116116000000", -"000000116116116116116092041054089056033030072112116116116116116116000000", -"000000116116116116082110113029025021075115116116116116116116116116000000", -"000000116116116116109018027008073116116116116116116116116116116116000000", -"000000116116116116102047068071074088078076085080104116116116116116000000", -"000000116116116116101087108061105114077103106043053081116116116116000000", -"000000116116116116116065019046069066067091058045062086116116116116000000", -"000000116116116116116063023032043051050044040036042093116116116116000000", -"000000116116116116116052015020026035039031037023012097116116116116000000", -"000000116116116116116048005010014019016020017009003099116116116116000000", -"000000116116116116116095064007003007007006011002000098116116116116000000", -"000000116116116116116116116116100070013001004000000094116116116116000000", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000116116000000000000116116000000000000116116000000000000116116000000", -"000000116116000000000000116116000000000000116116000000000000116116000000", -"000000116116000000000000116116000000000000116116000000000000116116000000", -"000000000000000000000000000000000000000000000000000000000000000000000000" -}; +/* XPM */ +static const char *xpm_film13[] = { +"24 24 256 3", +"000 c black", +"001 c #010000", +"002 c #020100", +"003 c #030200", +"004 c #070601", +"005 c #070801", +"006 c #0B0A05", +"007 c #0D0C06", +"008 c #0E0D07", +"009 c #0F0D08", +"010 c #0F0E08", +"011 c #100F0A", +"012 c #11100B", +"013 c #12110B", +"014 c #13120C", +"015 c #14120D", +"016 c #14130D", +"017 c #15130F", +"018 c #151410", +"019 c #161710", +"020 c #181711", +"021 c #191812", +"022 c #1A1914", +"023 c #1B1A15", +"024 c #1C1B16", +"025 c #1D1C16", +"026 c #1E1D17", +"027 c #1F1E19", +"028 c #201E19", +"029 c #201F1A", +"030 c #20201A", +"031 c #23221C", +"032 c #23231C", +"033 c #23231D", +"034 c #24221C", +"035 c #24231D", +"036 c #24231F", +"037 c #25231F", +"038 c #25241E", +"039 c #25251F", +"040 c #282722", +"041 c #2A2925", +"042 c #2B2925", +"043 c #2E2D27", +"044 c #322F2B", +"045 c #32312B", +"046 c #33312C", +"047 c #32322E", +"048 c #37332F", +"049 c #383731", +"050 c #3A3934", +"051 c #3C3C35", +"052 c #483F3C", +"053 c #43423C", +"054 c #474640", +"055 c #4C4B46", +"056 c #4D4C48", +"057 c #4F4E49", +"058 c #53524E", +"059 c #53534F", +"060 c #555450", +"061 c #575650", +"062 c #585752", +"063 c #5D5353", +"064 c #5A5954", +"065 c #625E5D", +"066 c #63625D", +"067 c #64625E", +"068 c #676660", +"069 c #6B6A64", +"070 c #6E6E6C", +"071 c #71706C", +"072 c #72726F", +"073 c #757573", +"074 c #777776", +"075 c #7C7C78", +"076 c #807D7D", +"077 c #81817A", +"078 c #82817F", +"079 c #878784", +"080 c #8D8C89", +"081 c #949391", +"082 c #969593", +"083 c #9B9B98", +"084 c #A2A39D", +"085 c #A6A3A2", +"086 c #A7A8A5", +"087 c #A9A9A5", +"088 c #AAA9A7", +"089 c #ABAAA5", +"090 c #B4B3B1", +"091 c #B6B5B0", +"092 c Gray71", +"093 c #B5B4B6", +"094 c #BAB9BA", +"095 c #BBBAB9", +"096 c #BCBBBB", +"097 c #BCBDBD", +"098 c #BDBCBF", +"099 c #BFBFC1", +"100 c #C3C3C3", +"101 c Gray78", +"102 c Gray81", +"103 c #D4D3CE", +"104 c #D4D3D1", +"105 c #D8D5D0", +"106 c #DAD8D4", +"107 c #DADAD8", +"108 c #E2E2DE", +"109 c #E4E4E3", +"110 c #E7E7E8", +"111 c #EBE9E3", +"112 c #EAE9EA", +"113 c #EEEDEB", +"114 c #F8F7F3", +"115 c #FEFFFF", +"116 c Gray100", +"117 c black", +"118 c black", +"119 c black", +"120 c black", +"121 c black", +"122 c black", +"123 c black", +"124 c black", +"125 c black", +"126 c black", +"127 c black", +"128 c black", +"129 c black", +"130 c black", +"131 c black", +"132 c black", +"133 c black", +"134 c black", +"135 c black", +"136 c black", +"137 c black", +"138 c black", +"139 c black", +"140 c black", +"141 c black", +"142 c black", +"143 c black", +"144 c black", +"145 c black", +"146 c black", +"147 c black", +"148 c black", +"149 c black", +"150 c black", +"151 c black", +"152 c black", +"153 c black", +"154 c black", +"155 c black", +"156 c black", +"157 c black", +"158 c black", +"159 c black", +"160 c black", +"161 c black", +"162 c black", +"163 c black", +"164 c black", +"165 c black", +"166 c black", +"167 c black", +"168 c black", +"169 c black", +"170 c black", +"171 c black", +"172 c black", +"173 c black", +"174 c black", +"175 c black", +"176 c black", +"177 c black", +"178 c black", +"179 c black", +"180 c black", +"181 c black", +"182 c black", +"183 c black", +"184 c black", +"185 c black", +"186 c black", +"187 c black", +"188 c black", +"189 c black", +"190 c black", +"191 c black", +"192 c black", +"193 c black", +"194 c black", +"195 c black", +"196 c black", +"197 c black", +"198 c black", +"199 c black", +"200 c black", +"201 c black", +"202 c black", +"203 c black", +"204 c black", +"205 c black", +"206 c black", +"207 c black", +"208 c black", +"209 c black", +"210 c black", +"211 c black", +"212 c black", +"213 c black", +"214 c black", +"215 c black", +"216 c black", +"217 c black", +"218 c black", +"219 c black", +"220 c black", +"221 c black", +"222 c black", +"223 c black", +"224 c black", +"225 c black", +"226 c black", +"227 c black", +"228 c black", +"229 c black", +"230 c black", +"231 c black", +"232 c black", +"233 c black", +"234 c black", +"235 c black", +"236 c black", +"237 c black", +"238 c black", +"239 c black", +"240 c black", +"241 c black", +"242 c black", +"243 c black", +"244 c black", +"245 c black", +"246 c black", +"247 c black", +"248 c black", +"249 c black", +"250 c black", +"251 c black", +"252 c black", +"253 c black", +"254 c black", +"255 c black", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000116116000000000000116116000000000000116116000000000000116116000000", +"000000116116000000000000116116000000000000116116000000000000116116000000", +"000000116116000000000000116116000000000000116116000000000000116116000000", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000116116116116116116116116116116083024022034090116116116116116000000", +"000000116116116116116116116116107060116111055038079116116116116116000000", +"000000116116116116116116116096084049028057033016059116116116116116000000", +"000000116116116116116092041054089056033030072112116116116116116116000000", +"000000116116116116082110113029025021075115116116116116116116116116000000", +"000000116116116116109018027008073116116116116116116116116116116116000000", +"000000116116116116102047068071074088078076085080104116116116116116000000", +"000000116116116116101087108061105114077103106043053081116116116116000000", +"000000116116116116116065019046069066067091058045062086116116116116000000", +"000000116116116116116063023032043051050044040036042093116116116116000000", +"000000116116116116116052015020026035039031037023012097116116116116000000", +"000000116116116116116048005010014019016020017009003099116116116116000000", +"000000116116116116116095064007003007007006011002000098116116116116000000", +"000000116116116116116116116116100070013001004000000094116116116116000000", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000116116000000000000116116000000000000116116000000000000116116000000", +"000000116116000000000000116116000000000000116116000000000000116116000000", +"000000116116000000000000116116000000000000116116000000000000116116000000", +"000000000000000000000000000000000000000000000000000000000000000000000000" +}; diff --git a/avidemux/common/ADM_icons/tray/film15.xpm b/avidemux/common/ADM_icons/tray/film15.xpm index 03c039b6cb..a1b7668be2 100644 --- a/avidemux/common/ADM_icons/tray/film15.xpm +++ b/avidemux/common/ADM_icons/tray/film15.xpm @@ -1,284 +1,284 @@ -/* XPM */ -static const char *xpm_film15[] = { -"24 24 256 3", -"000 c black", -"001 c #010000", -"002 c #020100", -"003 c #030200", -"004 c #070601", -"005 c #070801", -"006 c #0B0A05", -"007 c #0D0C06", -"008 c #0E0D07", -"009 c #0F0D08", -"010 c #0F0E08", -"011 c #100F0A", -"012 c #11100B", -"013 c #12110B", -"014 c #13120C", -"015 c #14120D", -"016 c #14130D", -"017 c #15130F", -"018 c #151410", -"019 c #161710", -"020 c #181711", -"021 c #191812", -"022 c #1A1914", -"023 c #1B1A15", -"024 c #1C1B16", -"025 c #1D1C16", -"026 c #1E1D17", -"027 c #1F1E19", -"028 c #201E19", -"029 c #201F1A", -"030 c #20201A", -"031 c #23221C", -"032 c #23231C", -"033 c #23231D", -"034 c #24221C", -"035 c #24231D", -"036 c #24231F", -"037 c #25231F", -"038 c #25241E", -"039 c #25251F", -"040 c #282722", -"041 c #2A2925", -"042 c #2B2925", -"043 c #2E2D27", -"044 c #322F2B", -"045 c #32312B", -"046 c #33312C", -"047 c #32322E", -"048 c #37332F", -"049 c #383731", -"050 c #3A3934", -"051 c #3C3C35", -"052 c #483F3C", -"053 c #43423C", -"054 c #474640", -"055 c #4C4B46", -"056 c #4D4C48", -"057 c #4F4E49", -"058 c #53524E", -"059 c #53534F", -"060 c #555450", -"061 c #575650", -"062 c #585752", -"063 c #5D5353", -"064 c #5A5954", -"065 c #625E5D", -"066 c #63625D", -"067 c #64625E", -"068 c #676660", -"069 c #6B6A64", -"070 c #6E6E6C", -"071 c #71706C", -"072 c #72726F", -"073 c #757573", -"074 c #777776", -"075 c #7C7C78", -"076 c #807D7D", -"077 c #81817A", -"078 c #82817F", -"079 c #878784", -"080 c #8D8C89", -"081 c #949391", -"082 c #969593", -"083 c #9B9B98", -"084 c #A2A39D", -"085 c #A6A3A2", -"086 c #A7A8A5", -"087 c #A9A9A5", -"088 c #AAA9A7", -"089 c #ABAAA5", -"090 c #B4B3B1", -"091 c #B6B5B0", -"092 c Gray71", -"093 c #B5B4B6", -"094 c #BAB9BA", -"095 c #BBBAB9", -"096 c #BCBBBB", -"097 c #BCBDBD", -"098 c #BDBCBF", -"099 c #BFBFC1", -"100 c #C3C3C3", -"101 c Gray78", -"102 c Gray81", -"103 c #D4D3CE", -"104 c #D4D3D1", -"105 c #D8D5D0", -"106 c #DAD8D4", -"107 c #DADAD8", -"108 c #E2E2DE", -"109 c #E4E4E3", -"110 c #E7E7E8", -"111 c #EBE9E3", -"112 c #EAE9EA", -"113 c #EEEDEB", -"114 c #F8F7F3", -"115 c #FEFFFF", -"116 c Gray100", -"117 c black", -"118 c black", -"119 c black", -"120 c black", -"121 c black", -"122 c black", -"123 c black", -"124 c black", -"125 c black", -"126 c black", -"127 c black", -"128 c black", -"129 c black", -"130 c black", -"131 c black", -"132 c black", -"133 c black", -"134 c black", -"135 c black", -"136 c black", -"137 c black", -"138 c black", -"139 c black", -"140 c black", -"141 c black", -"142 c black", -"143 c black", -"144 c black", -"145 c black", -"146 c black", -"147 c black", -"148 c black", -"149 c black", -"150 c black", -"151 c black", -"152 c black", -"153 c black", -"154 c black", -"155 c black", -"156 c black", -"157 c black", -"158 c black", -"159 c black", -"160 c black", -"161 c black", -"162 c black", -"163 c black", -"164 c black", -"165 c black", -"166 c black", -"167 c black", -"168 c black", -"169 c black", -"170 c black", -"171 c black", -"172 c black", -"173 c black", -"174 c black", -"175 c black", -"176 c black", -"177 c black", -"178 c black", -"179 c black", -"180 c black", -"181 c black", -"182 c black", -"183 c black", -"184 c black", -"185 c black", -"186 c black", -"187 c black", -"188 c black", -"189 c black", -"190 c black", -"191 c black", -"192 c black", -"193 c black", -"194 c black", -"195 c black", -"196 c black", -"197 c black", -"198 c black", -"199 c black", -"200 c black", -"201 c black", -"202 c black", -"203 c black", -"204 c black", -"205 c black", -"206 c black", -"207 c black", -"208 c black", -"209 c black", -"210 c black", -"211 c black", -"212 c black", -"213 c black", -"214 c black", -"215 c black", -"216 c black", -"217 c black", -"218 c black", -"219 c black", -"220 c black", -"221 c black", -"222 c black", -"223 c black", -"224 c black", -"225 c black", -"226 c black", -"227 c black", -"228 c black", -"229 c black", -"230 c black", -"231 c black", -"232 c black", -"233 c black", -"234 c black", -"235 c black", -"236 c black", -"237 c black", -"238 c black", -"239 c black", -"240 c black", -"241 c black", -"242 c black", -"243 c black", -"244 c black", -"245 c black", -"246 c black", -"247 c black", -"248 c black", -"249 c black", -"250 c black", -"251 c black", -"252 c black", -"253 c black", -"254 c black", -"255 c black", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000000000116116000000000000116116000000000000116116000000000000116116", -"000000000000116116000000000000116116000000000000116116000000000000116116", -"000000000000116116000000000000116116000000000000116116000000000000116116", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"116116116116116116116116083024022034090116116116116116000000000000116116", -"116116116116116116107060116111055038079116116116116116000000000000116116", -"116116116116116096084049028057033016059116116116116116000000000000116116", -"116116116092041054089056033030072112116116116116116116000000000000116116", -"116116082110113029025021075115116116116116116116116116000000000000116116", -"116116109018027008073116116116116116116116116116116116000000000000116116", -"116116102047068071074088078076085080104116116116116116000000000000116116", -"116116101087108061105114077103106043053081116116116116000000000000116116", -"116116116065019046069066067091058045062086116116116116000000000000116116", -"116116116063023032043051050044040036042093116116116116000000000000116116", -"116116116052015020026035039031037023012097116116116116000000000000116116", -"116116116048005010014019016020017009003099116116116116000000000000116116", -"116116116095064007003007007006011002000098116116116116000000000000116116", -"116116116116116116100070013001004000000094116116116116000000000000116116", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000000000116116000000000000116116000000000000116116000000000000116116", -"000000000000116116000000000000116116000000000000116116000000000000116116", -"000000000000116116000000000000116116000000000000116116000000000000116116", -"000000000000000000000000000000000000000000000000000000000000000000000000" -}; +/* XPM */ +static const char *xpm_film15[] = { +"24 24 256 3", +"000 c black", +"001 c #010000", +"002 c #020100", +"003 c #030200", +"004 c #070601", +"005 c #070801", +"006 c #0B0A05", +"007 c #0D0C06", +"008 c #0E0D07", +"009 c #0F0D08", +"010 c #0F0E08", +"011 c #100F0A", +"012 c #11100B", +"013 c #12110B", +"014 c #13120C", +"015 c #14120D", +"016 c #14130D", +"017 c #15130F", +"018 c #151410", +"019 c #161710", +"020 c #181711", +"021 c #191812", +"022 c #1A1914", +"023 c #1B1A15", +"024 c #1C1B16", +"025 c #1D1C16", +"026 c #1E1D17", +"027 c #1F1E19", +"028 c #201E19", +"029 c #201F1A", +"030 c #20201A", +"031 c #23221C", +"032 c #23231C", +"033 c #23231D", +"034 c #24221C", +"035 c #24231D", +"036 c #24231F", +"037 c #25231F", +"038 c #25241E", +"039 c #25251F", +"040 c #282722", +"041 c #2A2925", +"042 c #2B2925", +"043 c #2E2D27", +"044 c #322F2B", +"045 c #32312B", +"046 c #33312C", +"047 c #32322E", +"048 c #37332F", +"049 c #383731", +"050 c #3A3934", +"051 c #3C3C35", +"052 c #483F3C", +"053 c #43423C", +"054 c #474640", +"055 c #4C4B46", +"056 c #4D4C48", +"057 c #4F4E49", +"058 c #53524E", +"059 c #53534F", +"060 c #555450", +"061 c #575650", +"062 c #585752", +"063 c #5D5353", +"064 c #5A5954", +"065 c #625E5D", +"066 c #63625D", +"067 c #64625E", +"068 c #676660", +"069 c #6B6A64", +"070 c #6E6E6C", +"071 c #71706C", +"072 c #72726F", +"073 c #757573", +"074 c #777776", +"075 c #7C7C78", +"076 c #807D7D", +"077 c #81817A", +"078 c #82817F", +"079 c #878784", +"080 c #8D8C89", +"081 c #949391", +"082 c #969593", +"083 c #9B9B98", +"084 c #A2A39D", +"085 c #A6A3A2", +"086 c #A7A8A5", +"087 c #A9A9A5", +"088 c #AAA9A7", +"089 c #ABAAA5", +"090 c #B4B3B1", +"091 c #B6B5B0", +"092 c Gray71", +"093 c #B5B4B6", +"094 c #BAB9BA", +"095 c #BBBAB9", +"096 c #BCBBBB", +"097 c #BCBDBD", +"098 c #BDBCBF", +"099 c #BFBFC1", +"100 c #C3C3C3", +"101 c Gray78", +"102 c Gray81", +"103 c #D4D3CE", +"104 c #D4D3D1", +"105 c #D8D5D0", +"106 c #DAD8D4", +"107 c #DADAD8", +"108 c #E2E2DE", +"109 c #E4E4E3", +"110 c #E7E7E8", +"111 c #EBE9E3", +"112 c #EAE9EA", +"113 c #EEEDEB", +"114 c #F8F7F3", +"115 c #FEFFFF", +"116 c Gray100", +"117 c black", +"118 c black", +"119 c black", +"120 c black", +"121 c black", +"122 c black", +"123 c black", +"124 c black", +"125 c black", +"126 c black", +"127 c black", +"128 c black", +"129 c black", +"130 c black", +"131 c black", +"132 c black", +"133 c black", +"134 c black", +"135 c black", +"136 c black", +"137 c black", +"138 c black", +"139 c black", +"140 c black", +"141 c black", +"142 c black", +"143 c black", +"144 c black", +"145 c black", +"146 c black", +"147 c black", +"148 c black", +"149 c black", +"150 c black", +"151 c black", +"152 c black", +"153 c black", +"154 c black", +"155 c black", +"156 c black", +"157 c black", +"158 c black", +"159 c black", +"160 c black", +"161 c black", +"162 c black", +"163 c black", +"164 c black", +"165 c black", +"166 c black", +"167 c black", +"168 c black", +"169 c black", +"170 c black", +"171 c black", +"172 c black", +"173 c black", +"174 c black", +"175 c black", +"176 c black", +"177 c black", +"178 c black", +"179 c black", +"180 c black", +"181 c black", +"182 c black", +"183 c black", +"184 c black", +"185 c black", +"186 c black", +"187 c black", +"188 c black", +"189 c black", +"190 c black", +"191 c black", +"192 c black", +"193 c black", +"194 c black", +"195 c black", +"196 c black", +"197 c black", +"198 c black", +"199 c black", +"200 c black", +"201 c black", +"202 c black", +"203 c black", +"204 c black", +"205 c black", +"206 c black", +"207 c black", +"208 c black", +"209 c black", +"210 c black", +"211 c black", +"212 c black", +"213 c black", +"214 c black", +"215 c black", +"216 c black", +"217 c black", +"218 c black", +"219 c black", +"220 c black", +"221 c black", +"222 c black", +"223 c black", +"224 c black", +"225 c black", +"226 c black", +"227 c black", +"228 c black", +"229 c black", +"230 c black", +"231 c black", +"232 c black", +"233 c black", +"234 c black", +"235 c black", +"236 c black", +"237 c black", +"238 c black", +"239 c black", +"240 c black", +"241 c black", +"242 c black", +"243 c black", +"244 c black", +"245 c black", +"246 c black", +"247 c black", +"248 c black", +"249 c black", +"250 c black", +"251 c black", +"252 c black", +"253 c black", +"254 c black", +"255 c black", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000000000116116000000000000116116000000000000116116000000000000116116", +"000000000000116116000000000000116116000000000000116116000000000000116116", +"000000000000116116000000000000116116000000000000116116000000000000116116", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"116116116116116116116116083024022034090116116116116116000000000000116116", +"116116116116116116107060116111055038079116116116116116000000000000116116", +"116116116116116096084049028057033016059116116116116116000000000000116116", +"116116116092041054089056033030072112116116116116116116000000000000116116", +"116116082110113029025021075115116116116116116116116116000000000000116116", +"116116109018027008073116116116116116116116116116116116000000000000116116", +"116116102047068071074088078076085080104116116116116116000000000000116116", +"116116101087108061105114077103106043053081116116116116000000000000116116", +"116116116065019046069066067091058045062086116116116116000000000000116116", +"116116116063023032043051050044040036042093116116116116000000000000116116", +"116116116052015020026035039031037023012097116116116116000000000000116116", +"116116116048005010014019016020017009003099116116116116000000000000116116", +"116116116095064007003007007006011002000098116116116116000000000000116116", +"116116116116116116100070013001004000000094116116116116000000000000116116", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000000000116116000000000000116116000000000000116116000000000000116116", +"000000000000116116000000000000116116000000000000116116000000000000116116", +"000000000000116116000000000000116116000000000000116116000000000000116116", +"000000000000000000000000000000000000000000000000000000000000000000000000" +}; diff --git a/avidemux/common/ADM_icons/tray/film17.xpm b/avidemux/common/ADM_icons/tray/film17.xpm index 129ae54770..048af6e14f 100644 --- a/avidemux/common/ADM_icons/tray/film17.xpm +++ b/avidemux/common/ADM_icons/tray/film17.xpm @@ -1,284 +1,284 @@ -/* XPM */ -static const char *xpm_film17[] = { -"24 24 256 3", -"000 c black", -"001 c #010000", -"002 c #020100", -"003 c #030200", -"004 c #070601", -"005 c #000008", -"006 c #070801", -"007 c #0B0A05", -"008 c #0D0C06", -"009 c #0E0D07", -"010 c #0F0D08", -"011 c #0F0E08", -"012 c #100F0A", -"013 c #11100B", -"014 c #12110B", -"015 c #13120C", -"016 c #14120D", -"017 c #14130D", -"018 c #15130F", -"019 c #161710", -"020 c #181711", -"021 c #191812", -"022 c #1A1914", -"023 c #1B1A15", -"024 c #1C1B16", -"025 c #1D1C16", -"026 c #1E1D17", -"027 c #1F1E19", -"028 c #201E19", -"029 c #201F1A", -"030 c #20201A", -"031 c #23221C", -"032 c #23231C", -"033 c #23231D", -"034 c #24221C", -"035 c #24231D", -"036 c #24231F", -"037 c #25231F", -"038 c #25241E", -"039 c #25251F", -"040 c #282722", -"041 c #2A2925", -"042 c #2B2925", -"043 c #2E2D27", -"044 c #242837", -"045 c #322F2B", -"046 c #32312B", -"047 c #33312C", -"048 c #383731", -"049 c #3A3934", -"050 c #3C3C35", -"051 c #43423C", -"052 c #474640", -"053 c #4C4B46", -"054 c #4D4C48", -"055 c #4F4E49", -"056 c #4A4959", -"057 c #4A4C5B", -"058 c #53524E", -"059 c #53534F", -"060 c #555450", -"061 c #575650", -"062 c #585752", -"063 c #5A5954", -"064 c #4C5161", -"065 c #63625D", -"066 c #64625E", -"067 c #676660", -"068 c #6B6A64", -"069 c #6E6E6C", -"070 c #71706C", -"071 c #72726F", -"072 c #757573", -"073 c #777776", -"074 c #7C7C78", -"075 c #767989", -"076 c #807D7D", -"077 c #81817A", -"078 c #82817F", -"079 c #FFC600", -"080 c #FFD422", -"081 c #878784", -"082 c #8D8C89", -"083 c #87809C", -"084 c #949391", -"085 c #9B9B98", -"086 c #9495A5", -"087 c #A2A39D", -"088 c #A6A3A2", -"089 c #A7A8A5", -"090 c #AAA9A7", -"091 c #ABAAA5", -"092 c #A6A5B4", -"093 c #B4B3B1", -"094 c #B6B5B0", -"095 c #B5B4B6", -"096 c #BAB9BA", -"097 c #BCBBBB", -"098 c #BCBDBD", -"099 c #BDBCBF", -"100 c #BFBFC1", -"101 c #C3C3C3", -"102 c #D4D3CE", -"103 c #D4D3D1", -"104 c #D8D5D0", -"105 c #DAD8D4", -"106 c #DADAD8", -"107 c #E2E2DE", -"108 c #EBE9E3", -"109 c #EAE9EA", -"110 c #EEEDEB", -"111 c #E5E9F9", -"112 c #EDEAFF", -"113 c #EDEFFE", -"114 c #FFF4E3", -"115 c #F0F1FF", -"116 c #F4F7FF", -"117 c #F6F9FF", -"118 c #F8F7F3", -"119 c #FEFFFF", -"120 c Gray100", -"121 c black", -"122 c black", -"123 c black", -"124 c black", -"125 c black", -"126 c black", -"127 c black", -"128 c black", -"129 c black", -"130 c black", -"131 c black", -"132 c black", -"133 c black", -"134 c black", -"135 c black", -"136 c black", -"137 c black", -"138 c black", -"139 c black", -"140 c black", -"141 c black", -"142 c black", -"143 c black", -"144 c black", -"145 c black", -"146 c black", -"147 c black", -"148 c black", -"149 c black", -"150 c black", -"151 c black", -"152 c black", -"153 c black", -"154 c black", -"155 c black", -"156 c black", -"157 c black", -"158 c black", -"159 c black", -"160 c black", -"161 c black", -"162 c black", -"163 c black", -"164 c black", -"165 c black", -"166 c black", -"167 c black", -"168 c black", -"169 c black", -"170 c black", -"171 c black", -"172 c black", -"173 c black", -"174 c black", -"175 c black", -"176 c black", -"177 c black", -"178 c black", -"179 c black", -"180 c black", -"181 c black", -"182 c black", -"183 c black", -"184 c black", -"185 c black", -"186 c black", -"187 c black", -"188 c black", -"189 c black", -"190 c black", -"191 c black", -"192 c black", -"193 c black", -"194 c black", -"195 c black", -"196 c black", -"197 c black", -"198 c black", -"199 c black", -"200 c black", -"201 c black", -"202 c black", -"203 c black", -"204 c black", -"205 c black", -"206 c black", -"207 c black", -"208 c black", -"209 c black", -"210 c black", -"211 c black", -"212 c black", -"213 c black", -"214 c black", -"215 c black", -"216 c black", -"217 c black", -"218 c black", -"219 c black", -"220 c black", -"221 c black", -"222 c black", -"223 c black", -"224 c black", -"225 c black", -"226 c black", -"227 c black", -"228 c black", -"229 c black", -"230 c black", -"231 c black", -"232 c black", -"233 c black", -"234 c black", -"235 c black", -"236 c black", -"237 c black", -"238 c black", -"239 c black", -"240 c black", -"241 c black", -"242 c black", -"243 c black", -"244 c black", -"245 c black", -"246 c black", -"247 c black", -"248 c black", -"249 c black", -"250 c black", -"251 c black", -"252 c black", -"253 c black", -"254 c black", -"255 c black", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"120120000000000000120120000000000000120120000000000000120120000000000000", -"120120000000000000120120000000000000120120000000000000120120000000000000", -"120120000000000000120120000000000000120120000000000000120120000000000000", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"120120120120085024022034093120120120120120000000000000120120120120120120", -"120120106060120108053038081120120120120120000000000000120120120120120092", -"120097087048028055033017059120120120120120000000000000120120120120115044", -"041052091054033030071109120120120120120120000000000000120120120120086000", -"110029025021074119120120120120120120120120000000000000120120120120057000", -"027009072120120120120120120120120120120120000000000000120120120111005000", -"067070073090078076088082103120120120120120000000000000120120120064000075", -"107061104118077102105043051084120120120120000000000000120120117083056113", -"019047068065066094058046062089120120120120000000000000120120120120112120", -"023032043050049045040036042095120120120120000000000000120120120120120116", -"016020026035039031037023013098120120120120000000000000120120120120120116", -"006011015019017020018010003100120120120120000000000000120120120120120114", -"063008003008008007012002000099120120120120000000000000120120120120120079", -"120120101069014001004000000096120120120120000000000000120120120120120080", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"120120000000000000120120000000000000120120000000000000120120000000000000", -"120120000000000000120120000000000000120120000000000000120120000000000000", -"120120000000000000120120000000000000120120000000000000120120000000000000", -"000000000000000000000000000000000000000000000000000000000000000000000000" -}; +/* XPM */ +static const char *xpm_film17[] = { +"24 24 256 3", +"000 c black", +"001 c #010000", +"002 c #020100", +"003 c #030200", +"004 c #070601", +"005 c #000008", +"006 c #070801", +"007 c #0B0A05", +"008 c #0D0C06", +"009 c #0E0D07", +"010 c #0F0D08", +"011 c #0F0E08", +"012 c #100F0A", +"013 c #11100B", +"014 c #12110B", +"015 c #13120C", +"016 c #14120D", +"017 c #14130D", +"018 c #15130F", +"019 c #161710", +"020 c #181711", +"021 c #191812", +"022 c #1A1914", +"023 c #1B1A15", +"024 c #1C1B16", +"025 c #1D1C16", +"026 c #1E1D17", +"027 c #1F1E19", +"028 c #201E19", +"029 c #201F1A", +"030 c #20201A", +"031 c #23221C", +"032 c #23231C", +"033 c #23231D", +"034 c #24221C", +"035 c #24231D", +"036 c #24231F", +"037 c #25231F", +"038 c #25241E", +"039 c #25251F", +"040 c #282722", +"041 c #2A2925", +"042 c #2B2925", +"043 c #2E2D27", +"044 c #242837", +"045 c #322F2B", +"046 c #32312B", +"047 c #33312C", +"048 c #383731", +"049 c #3A3934", +"050 c #3C3C35", +"051 c #43423C", +"052 c #474640", +"053 c #4C4B46", +"054 c #4D4C48", +"055 c #4F4E49", +"056 c #4A4959", +"057 c #4A4C5B", +"058 c #53524E", +"059 c #53534F", +"060 c #555450", +"061 c #575650", +"062 c #585752", +"063 c #5A5954", +"064 c #4C5161", +"065 c #63625D", +"066 c #64625E", +"067 c #676660", +"068 c #6B6A64", +"069 c #6E6E6C", +"070 c #71706C", +"071 c #72726F", +"072 c #757573", +"073 c #777776", +"074 c #7C7C78", +"075 c #767989", +"076 c #807D7D", +"077 c #81817A", +"078 c #82817F", +"079 c #FFC600", +"080 c #FFD422", +"081 c #878784", +"082 c #8D8C89", +"083 c #87809C", +"084 c #949391", +"085 c #9B9B98", +"086 c #9495A5", +"087 c #A2A39D", +"088 c #A6A3A2", +"089 c #A7A8A5", +"090 c #AAA9A7", +"091 c #ABAAA5", +"092 c #A6A5B4", +"093 c #B4B3B1", +"094 c #B6B5B0", +"095 c #B5B4B6", +"096 c #BAB9BA", +"097 c #BCBBBB", +"098 c #BCBDBD", +"099 c #BDBCBF", +"100 c #BFBFC1", +"101 c #C3C3C3", +"102 c #D4D3CE", +"103 c #D4D3D1", +"104 c #D8D5D0", +"105 c #DAD8D4", +"106 c #DADAD8", +"107 c #E2E2DE", +"108 c #EBE9E3", +"109 c #EAE9EA", +"110 c #EEEDEB", +"111 c #E5E9F9", +"112 c #EDEAFF", +"113 c #EDEFFE", +"114 c #FFF4E3", +"115 c #F0F1FF", +"116 c #F4F7FF", +"117 c #F6F9FF", +"118 c #F8F7F3", +"119 c #FEFFFF", +"120 c Gray100", +"121 c black", +"122 c black", +"123 c black", +"124 c black", +"125 c black", +"126 c black", +"127 c black", +"128 c black", +"129 c black", +"130 c black", +"131 c black", +"132 c black", +"133 c black", +"134 c black", +"135 c black", +"136 c black", +"137 c black", +"138 c black", +"139 c black", +"140 c black", +"141 c black", +"142 c black", +"143 c black", +"144 c black", +"145 c black", +"146 c black", +"147 c black", +"148 c black", +"149 c black", +"150 c black", +"151 c black", +"152 c black", +"153 c black", +"154 c black", +"155 c black", +"156 c black", +"157 c black", +"158 c black", +"159 c black", +"160 c black", +"161 c black", +"162 c black", +"163 c black", +"164 c black", +"165 c black", +"166 c black", +"167 c black", +"168 c black", +"169 c black", +"170 c black", +"171 c black", +"172 c black", +"173 c black", +"174 c black", +"175 c black", +"176 c black", +"177 c black", +"178 c black", +"179 c black", +"180 c black", +"181 c black", +"182 c black", +"183 c black", +"184 c black", +"185 c black", +"186 c black", +"187 c black", +"188 c black", +"189 c black", +"190 c black", +"191 c black", +"192 c black", +"193 c black", +"194 c black", +"195 c black", +"196 c black", +"197 c black", +"198 c black", +"199 c black", +"200 c black", +"201 c black", +"202 c black", +"203 c black", +"204 c black", +"205 c black", +"206 c black", +"207 c black", +"208 c black", +"209 c black", +"210 c black", +"211 c black", +"212 c black", +"213 c black", +"214 c black", +"215 c black", +"216 c black", +"217 c black", +"218 c black", +"219 c black", +"220 c black", +"221 c black", +"222 c black", +"223 c black", +"224 c black", +"225 c black", +"226 c black", +"227 c black", +"228 c black", +"229 c black", +"230 c black", +"231 c black", +"232 c black", +"233 c black", +"234 c black", +"235 c black", +"236 c black", +"237 c black", +"238 c black", +"239 c black", +"240 c black", +"241 c black", +"242 c black", +"243 c black", +"244 c black", +"245 c black", +"246 c black", +"247 c black", +"248 c black", +"249 c black", +"250 c black", +"251 c black", +"252 c black", +"253 c black", +"254 c black", +"255 c black", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"120120000000000000120120000000000000120120000000000000120120000000000000", +"120120000000000000120120000000000000120120000000000000120120000000000000", +"120120000000000000120120000000000000120120000000000000120120000000000000", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"120120120120085024022034093120120120120120000000000000120120120120120120", +"120120106060120108053038081120120120120120000000000000120120120120120092", +"120097087048028055033017059120120120120120000000000000120120120120115044", +"041052091054033030071109120120120120120120000000000000120120120120086000", +"110029025021074119120120120120120120120120000000000000120120120120057000", +"027009072120120120120120120120120120120120000000000000120120120111005000", +"067070073090078076088082103120120120120120000000000000120120120064000075", +"107061104118077102105043051084120120120120000000000000120120117083056113", +"019047068065066094058046062089120120120120000000000000120120120120112120", +"023032043050049045040036042095120120120120000000000000120120120120120116", +"016020026035039031037023013098120120120120000000000000120120120120120116", +"006011015019017020018010003100120120120120000000000000120120120120120114", +"063008003008008007012002000099120120120120000000000000120120120120120079", +"120120101069014001004000000096120120120120000000000000120120120120120080", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"120120000000000000120120000000000000120120000000000000120120000000000000", +"120120000000000000120120000000000000120120000000000000120120000000000000", +"120120000000000000120120000000000000120120000000000000120120000000000000", +"000000000000000000000000000000000000000000000000000000000000000000000000" +}; diff --git a/avidemux/common/ADM_icons/tray/film19.xpm b/avidemux/common/ADM_icons/tray/film19.xpm index ff3f5f2336..3b58432756 100644 --- a/avidemux/common/ADM_icons/tray/film19.xpm +++ b/avidemux/common/ADM_icons/tray/film19.xpm @@ -1,284 +1,284 @@ -/* XPM */ -static const char *xpm_film19[] = { -"24 24 256 3", -"000 c black", -"001 c #010000", -"002 c #020100", -"003 c #030200", -"004 c #070601", -"005 c #000008", -"006 c #0B0A05", -"007 c #0D0C06", -"008 c #0F0D08", -"009 c #100F0A", -"010 c #11100B", -"011 c #12110B", -"012 c #14130D", -"013 c #15130F", -"014 c #181711", -"015 c #1A1914", -"016 c #1B1A15", -"017 c #1C1B16", -"018 c #201E19", -"019 c #20201A", -"020 c #23221C", -"021 c #23231D", -"022 c #24221C", -"023 c #24231F", -"024 c #25231F", -"025 c #25241E", -"026 c #25251F", -"027 c #282722", -"028 c #2B2925", -"029 c #2E2D27", -"030 c #242837", -"031 c #262837", -"032 c #262A39", -"033 c #322F2B", -"034 c #32312B", -"035 c #3A3934", -"036 c #43423C", -"037 c #4C4B46", -"038 c #4F4E49", -"039 c #404251", -"040 c #484C57", -"041 c #4A4959", -"042 c #4A4C5B", -"043 c #53524E", -"044 c #53534F", -"045 c #585752", -"046 c #4C5161", -"047 c #5E6271", -"048 c #64625E", -"049 c #72726F", -"050 c #7C7C78", -"051 c #767989", -"052 c #7A7E85", -"053 c #807D7D", -"054 c #81817A", -"055 c #82817F", -"056 c #B9954A", -"057 c #C5B434", -"058 c #E69400", -"059 c #EABA56", -"060 c #FFC600", -"061 c #FFCE00", -"062 c #FFD422", -"063 c #FFE601", -"064 c #FFE608", -"065 c #FFF200", -"066 c #FFFB00", -"067 c #F2C743", -"068 c #FFDB48", -"069 c #FFDC61", -"070 c #FFFB6B", -"071 c #878784", -"072 c #82858D", -"073 c #8D8C89", -"074 c #87809C", -"075 c #878B99", -"076 c #8A8D95", -"077 c #949391", -"078 c #9B9B98", -"079 c #9397A6", -"080 c #9495A5", -"081 c #9599A1", -"082 c #969AA9", -"083 c #9B9FAF", -"084 c #9C9FAE", -"085 c #A6A3A2", -"086 c #A1A2AD", -"087 c #A7A8A5", -"088 c #A6A5B4", -"089 c #A5A8B7", -"090 c #B4B3B1", -"091 c #B6B5B0", -"092 c #B5B4B6", -"093 c #BAB9BA", -"094 c #BCBDBD", -"095 c #BDBCBF", -"096 c #AEB2C0", -"097 c #BFBFC1", -"098 c #E6C18B", -"099 c #F6CE8B", -"100 c #FAD08F", -"101 c #C7CCDB", -"102 c #D4D3CE", -"103 c #D4D3D1", -"104 c #DAD8D4", -"105 c #DFE1F2", -"106 c #E7D9CF", -"107 c #E6E6EA", -"108 c #EBE9E3", -"109 c #EAE9EA", -"110 c #E5E9F9", -"111 c #EAEFFF", -"112 c #EDEAFF", -"113 c #ECEFFD", -"114 c #EDEFFE", -"115 c #EDF0FF", -"116 c #EDF2FF", -"117 c #F7F2E5", -"118 c #FFF4E3", -"119 c #F0F1FF", -"120 c #F4F7FF", -"121 c #F5F8FF", -"122 c #F6F9FF", -"123 c #F6FAFF", -"124 c #F9FCFF", -"125 c #FEFFFF", -"126 c Gray100", -"127 c black", -"128 c black", -"129 c black", -"130 c black", -"131 c black", -"132 c black", -"133 c black", -"134 c black", -"135 c black", -"136 c black", -"137 c black", -"138 c black", -"139 c black", -"140 c black", -"141 c black", -"142 c black", -"143 c black", -"144 c black", -"145 c black", -"146 c black", -"147 c black", -"148 c black", -"149 c black", -"150 c black", -"151 c black", -"152 c black", -"153 c black", -"154 c black", -"155 c black", -"156 c black", -"157 c black", -"158 c black", -"159 c black", -"160 c black", -"161 c black", -"162 c black", -"163 c black", -"164 c black", -"165 c black", -"166 c black", -"167 c black", -"168 c black", -"169 c black", -"170 c black", -"171 c black", -"172 c black", -"173 c black", -"174 c black", -"175 c black", -"176 c black", -"177 c black", -"178 c black", -"179 c black", -"180 c black", -"181 c black", -"182 c black", -"183 c black", -"184 c black", -"185 c black", -"186 c black", -"187 c black", -"188 c black", -"189 c black", -"190 c black", -"191 c black", -"192 c black", -"193 c black", -"194 c black", -"195 c black", -"196 c black", -"197 c black", -"198 c black", -"199 c black", -"200 c black", -"201 c black", -"202 c black", -"203 c black", -"204 c black", -"205 c black", -"206 c black", -"207 c black", -"208 c black", -"209 c black", -"210 c black", -"211 c black", -"212 c black", -"213 c black", -"214 c black", -"215 c black", -"216 c black", -"217 c black", -"218 c black", -"219 c black", -"220 c black", -"221 c black", -"222 c black", -"223 c black", -"224 c black", -"225 c black", -"226 c black", -"227 c black", -"228 c black", -"229 c black", -"230 c black", -"231 c black", -"232 c black", -"233 c black", -"234 c black", -"235 c black", -"236 c black", -"237 c black", -"238 c black", -"239 c black", -"240 c black", -"241 c black", -"242 c black", -"243 c black", -"244 c black", -"245 c black", -"246 c black", -"247 c black", -"248 c black", -"249 c black", -"250 c black", -"251 c black", -"252 c black", -"253 c black", -"254 c black", -"255 c black", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000126126000000000000126126000000000000126126000000000000126126000000", -"000000126126000000000000126126000000000000126126000000000000126126000000", -"000000126126000000000000126126000000000000126126000000000000126126000000", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"078017015022090126126126126126000000000000126126126126126126086052076072", -"126108037025071126126126126126000000000000126126126126126088047079075032", -"018038021012044126126126126126000000000000126126126126119030089121082039", -"021019049109126126126126126126000000000000126126126126080000096083040081", -"050125126126126126126126126126000000000000126126126126042000031101057067", -"126126126126126126126126126126000000000000126126126110005000084126063058", -"055053085073103126126126126126000000000000126126126046000051126126069056", -"054102104029036077126126126126000000000000126126122074041114126126117107", -"048091043034045087126126126126000000000000126126126126112126126126126126", -"035033027023028092126126126126000000000000126126126126126120123124124123", -"026020024016010094126126126126000000000000126126126126126120111116115113", -"012014013008003097126126126126000000000000126126126126126118100099106105", -"007006009002000095126126126126000000000000126126126126126060064070068098", -"011001004000000093126126126126000000000000126126126126126062065066061059", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000126126000000000000126126000000000000126126000000000000126126000000", -"000000126126000000000000126126000000000000126126000000000000126126000000", -"000000126126000000000000126126000000000000126126000000000000126126000000", -"000000000000000000000000000000000000000000000000000000000000000000000000" -}; +/* XPM */ +static const char *xpm_film19[] = { +"24 24 256 3", +"000 c black", +"001 c #010000", +"002 c #020100", +"003 c #030200", +"004 c #070601", +"005 c #000008", +"006 c #0B0A05", +"007 c #0D0C06", +"008 c #0F0D08", +"009 c #100F0A", +"010 c #11100B", +"011 c #12110B", +"012 c #14130D", +"013 c #15130F", +"014 c #181711", +"015 c #1A1914", +"016 c #1B1A15", +"017 c #1C1B16", +"018 c #201E19", +"019 c #20201A", +"020 c #23221C", +"021 c #23231D", +"022 c #24221C", +"023 c #24231F", +"024 c #25231F", +"025 c #25241E", +"026 c #25251F", +"027 c #282722", +"028 c #2B2925", +"029 c #2E2D27", +"030 c #242837", +"031 c #262837", +"032 c #262A39", +"033 c #322F2B", +"034 c #32312B", +"035 c #3A3934", +"036 c #43423C", +"037 c #4C4B46", +"038 c #4F4E49", +"039 c #404251", +"040 c #484C57", +"041 c #4A4959", +"042 c #4A4C5B", +"043 c #53524E", +"044 c #53534F", +"045 c #585752", +"046 c #4C5161", +"047 c #5E6271", +"048 c #64625E", +"049 c #72726F", +"050 c #7C7C78", +"051 c #767989", +"052 c #7A7E85", +"053 c #807D7D", +"054 c #81817A", +"055 c #82817F", +"056 c #B9954A", +"057 c #C5B434", +"058 c #E69400", +"059 c #EABA56", +"060 c #FFC600", +"061 c #FFCE00", +"062 c #FFD422", +"063 c #FFE601", +"064 c #FFE608", +"065 c #FFF200", +"066 c #FFFB00", +"067 c #F2C743", +"068 c #FFDB48", +"069 c #FFDC61", +"070 c #FFFB6B", +"071 c #878784", +"072 c #82858D", +"073 c #8D8C89", +"074 c #87809C", +"075 c #878B99", +"076 c #8A8D95", +"077 c #949391", +"078 c #9B9B98", +"079 c #9397A6", +"080 c #9495A5", +"081 c #9599A1", +"082 c #969AA9", +"083 c #9B9FAF", +"084 c #9C9FAE", +"085 c #A6A3A2", +"086 c #A1A2AD", +"087 c #A7A8A5", +"088 c #A6A5B4", +"089 c #A5A8B7", +"090 c #B4B3B1", +"091 c #B6B5B0", +"092 c #B5B4B6", +"093 c #BAB9BA", +"094 c #BCBDBD", +"095 c #BDBCBF", +"096 c #AEB2C0", +"097 c #BFBFC1", +"098 c #E6C18B", +"099 c #F6CE8B", +"100 c #FAD08F", +"101 c #C7CCDB", +"102 c #D4D3CE", +"103 c #D4D3D1", +"104 c #DAD8D4", +"105 c #DFE1F2", +"106 c #E7D9CF", +"107 c #E6E6EA", +"108 c #EBE9E3", +"109 c #EAE9EA", +"110 c #E5E9F9", +"111 c #EAEFFF", +"112 c #EDEAFF", +"113 c #ECEFFD", +"114 c #EDEFFE", +"115 c #EDF0FF", +"116 c #EDF2FF", +"117 c #F7F2E5", +"118 c #FFF4E3", +"119 c #F0F1FF", +"120 c #F4F7FF", +"121 c #F5F8FF", +"122 c #F6F9FF", +"123 c #F6FAFF", +"124 c #F9FCFF", +"125 c #FEFFFF", +"126 c Gray100", +"127 c black", +"128 c black", +"129 c black", +"130 c black", +"131 c black", +"132 c black", +"133 c black", +"134 c black", +"135 c black", +"136 c black", +"137 c black", +"138 c black", +"139 c black", +"140 c black", +"141 c black", +"142 c black", +"143 c black", +"144 c black", +"145 c black", +"146 c black", +"147 c black", +"148 c black", +"149 c black", +"150 c black", +"151 c black", +"152 c black", +"153 c black", +"154 c black", +"155 c black", +"156 c black", +"157 c black", +"158 c black", +"159 c black", +"160 c black", +"161 c black", +"162 c black", +"163 c black", +"164 c black", +"165 c black", +"166 c black", +"167 c black", +"168 c black", +"169 c black", +"170 c black", +"171 c black", +"172 c black", +"173 c black", +"174 c black", +"175 c black", +"176 c black", +"177 c black", +"178 c black", +"179 c black", +"180 c black", +"181 c black", +"182 c black", +"183 c black", +"184 c black", +"185 c black", +"186 c black", +"187 c black", +"188 c black", +"189 c black", +"190 c black", +"191 c black", +"192 c black", +"193 c black", +"194 c black", +"195 c black", +"196 c black", +"197 c black", +"198 c black", +"199 c black", +"200 c black", +"201 c black", +"202 c black", +"203 c black", +"204 c black", +"205 c black", +"206 c black", +"207 c black", +"208 c black", +"209 c black", +"210 c black", +"211 c black", +"212 c black", +"213 c black", +"214 c black", +"215 c black", +"216 c black", +"217 c black", +"218 c black", +"219 c black", +"220 c black", +"221 c black", +"222 c black", +"223 c black", +"224 c black", +"225 c black", +"226 c black", +"227 c black", +"228 c black", +"229 c black", +"230 c black", +"231 c black", +"232 c black", +"233 c black", +"234 c black", +"235 c black", +"236 c black", +"237 c black", +"238 c black", +"239 c black", +"240 c black", +"241 c black", +"242 c black", +"243 c black", +"244 c black", +"245 c black", +"246 c black", +"247 c black", +"248 c black", +"249 c black", +"250 c black", +"251 c black", +"252 c black", +"253 c black", +"254 c black", +"255 c black", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000126126000000000000126126000000000000126126000000000000126126000000", +"000000126126000000000000126126000000000000126126000000000000126126000000", +"000000126126000000000000126126000000000000126126000000000000126126000000", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"078017015022090126126126126126000000000000126126126126126126086052076072", +"126108037025071126126126126126000000000000126126126126126088047079075032", +"018038021012044126126126126126000000000000126126126126119030089121082039", +"021019049109126126126126126126000000000000126126126126080000096083040081", +"050125126126126126126126126126000000000000126126126126042000031101057067", +"126126126126126126126126126126000000000000126126126110005000084126063058", +"055053085073103126126126126126000000000000126126126046000051126126069056", +"054102104029036077126126126126000000000000126126122074041114126126117107", +"048091043034045087126126126126000000000000126126126126112126126126126126", +"035033027023028092126126126126000000000000126126126126126120123124124123", +"026020024016010094126126126126000000000000126126126126126120111116115113", +"012014013008003097126126126126000000000000126126126126126118100099106105", +"007006009002000095126126126126000000000000126126126126126060064070068098", +"011001004000000093126126126126000000000000126126126126126062065066061059", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000126126000000000000126126000000000000126126000000000000126126000000", +"000000126126000000000000126126000000000000126126000000000000126126000000", +"000000126126000000000000126126000000000000126126000000000000126126000000", +"000000000000000000000000000000000000000000000000000000000000000000000000" +}; diff --git a/avidemux/common/ADM_icons/tray/film21.xpm b/avidemux/common/ADM_icons/tray/film21.xpm index 2990cea975..901ff1d608 100644 --- a/avidemux/common/ADM_icons/tray/film21.xpm +++ b/avidemux/common/ADM_icons/tray/film21.xpm @@ -1,284 +1,284 @@ -/* XPM */ -static const char *xpm_film21[] = { -"24 24 256 3", -"000 c black", -"001 c transparent", -"002 c #030200", -"003 c #000008", -"004 c #070A18", -"005 c #11100B", -"006 c #2B2925", -"007 c #202432", -"008 c #202434", -"009 c #242837", -"010 c #262837", -"011 c #262A39", -"012 c #2A2E3B", -"013 c #2E323F", -"014 c #313544", -"015 c #3E414F", -"016 c #43423C", -"017 c #404251", -"018 c #484C57", -"019 c #4A4959", -"020 c #4A4C5B", -"021 c #53534F", -"022 c #50535B", -"023 c #585752", -"024 c #4C5161", -"025 c #5A5E66", -"026 c #5B5F67", -"027 c #5E6271", -"028 c #757987", -"029 c #767989", -"030 c #7A7E85", -"031 c #B9954A", -"032 c #C5B434", -"033 c #E69400", -"034 c #EABA56", -"035 c #FFC600", -"036 c #FFCE00", -"037 c #FDCA15", -"038 c #FFD900", -"039 c #FFD422", -"040 c #FFE100", -"041 c #FFE601", -"042 c #FFE608", -"043 c #FFF200", -"044 c #FFF600", -"045 c #FFFB00", -"046 c #FFFE00", -"047 c #FFF237", -"048 c #FFF63A", -"049 c #EEC143", -"050 c #F2C743", -"051 c #FFDB48", -"052 c #FFDC61", -"053 c #FFFB6B", -"054 c #878784", -"055 c #82858D", -"056 c #828695", -"057 c #87809C", -"058 c #878B99", -"059 c #8A8D95", -"060 c #949391", -"061 c #9397A6", -"062 c #9495A5", -"063 c #9599A1", -"064 c #969AA9", -"065 c #9B9FAF", -"066 c #9C9FAE", -"067 c #A1A2AD", -"068 c #A7A8A5", -"069 c #A6A5B4", -"070 c #A5A8B7", -"071 c #A9ADBB", -"072 c #B5AFB3", -"073 c #B4B3B1", -"074 c #B5B4B6", -"075 c #BAB9BA", -"076 c #BCBDBD", -"077 c #BDBCBF", -"078 c #AEB2C0", -"079 c #B3B6C4", -"080 c #BFBFC1", -"081 c #B9BCCB", -"082 c #BDBFCA", -"083 c #E6C18B", -"084 c #ECD09C", -"085 c #F6CC82", -"086 c #F6CE8B", -"087 c #FAD08F", -"088 c #FBD391", -"089 c #C0C4D2", -"090 c #C7CCDB", -"091 c #CDCCD5", -"092 c #CCCFD7", -"093 c #D4D3D1", -"094 c #D7D8E3", -"095 c #D7DBE9", -"096 c #D9DCEE", -"097 c #DFE1F2", -"098 c #DFE5F2", -"099 c #E7D9CF", -"100 c #E6E6EA", -"101 c #E1E5F2", -"102 c #E2E6F4", -"103 c #E5E9F9", -"104 c #E7EBF8", -"105 c #E9EDFC", -"106 c #EAEFFF", -"107 c #EDEAFF", -"108 c #ECEFFD", -"109 c #EDEFFE", -"110 c #EDF0FF", -"111 c #EDF2FF", -"112 c #F7F2E5", -"113 c #FFF4E3", -"114 c #F0F1FF", -"115 c #F2F5FF", -"116 c #F3F6FF", -"117 c #F4F7FF", -"118 c #F5F8FF", -"119 c #F6F9FF", -"120 c #F6FAFF", -"121 c #F9FCFF", -"122 c #FBFFFF", -"123 c #FCFFFF", -"124 c #FDFFFF", -"125 c Gray100", -"126 c black", -"127 c black", -"128 c black", -"129 c black", -"130 c black", -"131 c black", -"132 c black", -"133 c black", -"134 c black", -"135 c black", -"136 c black", -"137 c black", -"138 c black", -"139 c black", -"140 c black", -"141 c black", -"142 c black", -"143 c black", -"144 c black", -"145 c black", -"146 c black", -"147 c black", -"148 c black", -"149 c black", -"150 c black", -"151 c black", -"152 c black", -"153 c black", -"154 c black", -"155 c black", -"156 c black", -"157 c black", -"158 c black", -"159 c black", -"160 c black", -"161 c black", -"162 c black", -"163 c black", -"164 c black", -"165 c black", -"166 c black", -"167 c black", -"168 c black", -"169 c black", -"170 c black", -"171 c black", -"172 c black", -"173 c black", -"174 c black", -"175 c black", -"176 c black", -"177 c black", -"178 c black", -"179 c black", -"180 c black", -"181 c black", -"182 c black", -"183 c black", -"184 c black", -"185 c black", -"186 c black", -"187 c black", -"188 c black", -"189 c black", -"190 c black", -"191 c black", -"192 c black", -"193 c black", -"194 c black", -"195 c black", -"196 c black", -"197 c black", -"198 c black", -"199 c black", -"200 c black", -"201 c black", -"202 c black", -"203 c black", -"204 c black", -"205 c black", -"206 c black", -"207 c black", -"208 c black", -"209 c black", -"210 c black", -"211 c black", -"212 c black", -"213 c black", -"214 c black", -"215 c black", -"216 c black", -"217 c black", -"218 c black", -"219 c black", -"220 c black", -"221 c black", -"222 c black", -"223 c black", -"224 c black", -"225 c black", -"226 c black", -"227 c black", -"228 c black", -"229 c black", -"230 c black", -"231 c black", -"232 c black", -"233 c black", -"234 c black", -"235 c black", -"236 c black", -"237 c black", -"238 c black", -"239 c black", -"240 c black", -"241 c black", -"242 c black", -"243 c black", -"244 c black", -"245 c black", -"246 c black", -"247 c black", -"248 c black", -"249 c black", -"250 c black", -"251 c black", -"252 c black", -"253 c black", -"254 c black", -"255 c black", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000000000125125000000000000125125000000000000125125000000000000125125", -"000000000000125125000000000000125125000000000000125125000000000000125125", -"000000000000125125000000000000125125000000000000125125000000000000125125", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"073125125125125125000000000000125125125125125125067030059055026022025092", -"054125125125125125000000000000125125125125125069027061058011014007008012", -"021125125125125125000000000000125125125125114009070118064017056013001001", -"125125125125125125000000000000125125125125062000078065018063081028015000", -"125125125125125125000000000000125125125125020000010090032050082071004000", -"125125125125125125000000000000125125125103003000066125041033072115089000", -"093125125125125125000000000000125125125024000029125125052031125125122079", -"016060125125125125000000000000125125119057019109125125112100125123116105", -"023068125125125125000000000000125125125125107125125125125125124118108102", -"006074125125125125000000000000125125125125125117120121121120115105101095", -"005076125125125125000000000000125125125125125117106111110108104098094091", -"002080125125125125000000000000125125125125125113087086099097096084088085", -"000077125125125125000000000000125125125125125035042053051083049047048038", -"000075125125125125000000000000125125125125125039043045036034037044046040", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000000000125125000000000000125125000000000000125125000000000000125125", -"000000000000125125000000000000125125000000000000125125000000000000125125", -"000000000000125125000000000000125125000000000000125125000000000000125125", -"000000000000000000000000000000000000000000000000000000000000000000000000" -}; +/* XPM */ +static const char *xpm_film21[] = { +"24 24 256 3", +"000 c black", +"001 c transparent", +"002 c #030200", +"003 c #000008", +"004 c #070A18", +"005 c #11100B", +"006 c #2B2925", +"007 c #202432", +"008 c #202434", +"009 c #242837", +"010 c #262837", +"011 c #262A39", +"012 c #2A2E3B", +"013 c #2E323F", +"014 c #313544", +"015 c #3E414F", +"016 c #43423C", +"017 c #404251", +"018 c #484C57", +"019 c #4A4959", +"020 c #4A4C5B", +"021 c #53534F", +"022 c #50535B", +"023 c #585752", +"024 c #4C5161", +"025 c #5A5E66", +"026 c #5B5F67", +"027 c #5E6271", +"028 c #757987", +"029 c #767989", +"030 c #7A7E85", +"031 c #B9954A", +"032 c #C5B434", +"033 c #E69400", +"034 c #EABA56", +"035 c #FFC600", +"036 c #FFCE00", +"037 c #FDCA15", +"038 c #FFD900", +"039 c #FFD422", +"040 c #FFE100", +"041 c #FFE601", +"042 c #FFE608", +"043 c #FFF200", +"044 c #FFF600", +"045 c #FFFB00", +"046 c #FFFE00", +"047 c #FFF237", +"048 c #FFF63A", +"049 c #EEC143", +"050 c #F2C743", +"051 c #FFDB48", +"052 c #FFDC61", +"053 c #FFFB6B", +"054 c #878784", +"055 c #82858D", +"056 c #828695", +"057 c #87809C", +"058 c #878B99", +"059 c #8A8D95", +"060 c #949391", +"061 c #9397A6", +"062 c #9495A5", +"063 c #9599A1", +"064 c #969AA9", +"065 c #9B9FAF", +"066 c #9C9FAE", +"067 c #A1A2AD", +"068 c #A7A8A5", +"069 c #A6A5B4", +"070 c #A5A8B7", +"071 c #A9ADBB", +"072 c #B5AFB3", +"073 c #B4B3B1", +"074 c #B5B4B6", +"075 c #BAB9BA", +"076 c #BCBDBD", +"077 c #BDBCBF", +"078 c #AEB2C0", +"079 c #B3B6C4", +"080 c #BFBFC1", +"081 c #B9BCCB", +"082 c #BDBFCA", +"083 c #E6C18B", +"084 c #ECD09C", +"085 c #F6CC82", +"086 c #F6CE8B", +"087 c #FAD08F", +"088 c #FBD391", +"089 c #C0C4D2", +"090 c #C7CCDB", +"091 c #CDCCD5", +"092 c #CCCFD7", +"093 c #D4D3D1", +"094 c #D7D8E3", +"095 c #D7DBE9", +"096 c #D9DCEE", +"097 c #DFE1F2", +"098 c #DFE5F2", +"099 c #E7D9CF", +"100 c #E6E6EA", +"101 c #E1E5F2", +"102 c #E2E6F4", +"103 c #E5E9F9", +"104 c #E7EBF8", +"105 c #E9EDFC", +"106 c #EAEFFF", +"107 c #EDEAFF", +"108 c #ECEFFD", +"109 c #EDEFFE", +"110 c #EDF0FF", +"111 c #EDF2FF", +"112 c #F7F2E5", +"113 c #FFF4E3", +"114 c #F0F1FF", +"115 c #F2F5FF", +"116 c #F3F6FF", +"117 c #F4F7FF", +"118 c #F5F8FF", +"119 c #F6F9FF", +"120 c #F6FAFF", +"121 c #F9FCFF", +"122 c #FBFFFF", +"123 c #FCFFFF", +"124 c #FDFFFF", +"125 c Gray100", +"126 c black", +"127 c black", +"128 c black", +"129 c black", +"130 c black", +"131 c black", +"132 c black", +"133 c black", +"134 c black", +"135 c black", +"136 c black", +"137 c black", +"138 c black", +"139 c black", +"140 c black", +"141 c black", +"142 c black", +"143 c black", +"144 c black", +"145 c black", +"146 c black", +"147 c black", +"148 c black", +"149 c black", +"150 c black", +"151 c black", +"152 c black", +"153 c black", +"154 c black", +"155 c black", +"156 c black", +"157 c black", +"158 c black", +"159 c black", +"160 c black", +"161 c black", +"162 c black", +"163 c black", +"164 c black", +"165 c black", +"166 c black", +"167 c black", +"168 c black", +"169 c black", +"170 c black", +"171 c black", +"172 c black", +"173 c black", +"174 c black", +"175 c black", +"176 c black", +"177 c black", +"178 c black", +"179 c black", +"180 c black", +"181 c black", +"182 c black", +"183 c black", +"184 c black", +"185 c black", +"186 c black", +"187 c black", +"188 c black", +"189 c black", +"190 c black", +"191 c black", +"192 c black", +"193 c black", +"194 c black", +"195 c black", +"196 c black", +"197 c black", +"198 c black", +"199 c black", +"200 c black", +"201 c black", +"202 c black", +"203 c black", +"204 c black", +"205 c black", +"206 c black", +"207 c black", +"208 c black", +"209 c black", +"210 c black", +"211 c black", +"212 c black", +"213 c black", +"214 c black", +"215 c black", +"216 c black", +"217 c black", +"218 c black", +"219 c black", +"220 c black", +"221 c black", +"222 c black", +"223 c black", +"224 c black", +"225 c black", +"226 c black", +"227 c black", +"228 c black", +"229 c black", +"230 c black", +"231 c black", +"232 c black", +"233 c black", +"234 c black", +"235 c black", +"236 c black", +"237 c black", +"238 c black", +"239 c black", +"240 c black", +"241 c black", +"242 c black", +"243 c black", +"244 c black", +"245 c black", +"246 c black", +"247 c black", +"248 c black", +"249 c black", +"250 c black", +"251 c black", +"252 c black", +"253 c black", +"254 c black", +"255 c black", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000000000125125000000000000125125000000000000125125000000000000125125", +"000000000000125125000000000000125125000000000000125125000000000000125125", +"000000000000125125000000000000125125000000000000125125000000000000125125", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"073125125125125125000000000000125125125125125125067030059055026022025092", +"054125125125125125000000000000125125125125125069027061058011014007008012", +"021125125125125125000000000000125125125125114009070118064017056013001001", +"125125125125125125000000000000125125125125062000078065018063081028015000", +"125125125125125125000000000000125125125125020000010090032050082071004000", +"125125125125125125000000000000125125125103003000066125041033072115089000", +"093125125125125125000000000000125125125024000029125125052031125125122079", +"016060125125125125000000000000125125119057019109125125112100125123116105", +"023068125125125125000000000000125125125125107125125125125125124118108102", +"006074125125125125000000000000125125125125125117120121121120115105101095", +"005076125125125125000000000000125125125125125117106111110108104098094091", +"002080125125125125000000000000125125125125125113087086099097096084088085", +"000077125125125125000000000000125125125125125035042053051083049047048038", +"000075125125125125000000000000125125125125125039043045036034037044046040", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000000000125125000000000000125125000000000000125125000000000000125125", +"000000000000125125000000000000125125000000000000125125000000000000125125", +"000000000000125125000000000000125125000000000000125125000000000000125125", +"000000000000000000000000000000000000000000000000000000000000000000000000" +}; diff --git a/avidemux/common/ADM_icons/tray/film23.xpm b/avidemux/common/ADM_icons/tray/film23.xpm index 4f31ebceb8..e22206ce24 100644 --- a/avidemux/common/ADM_icons/tray/film23.xpm +++ b/avidemux/common/ADM_icons/tray/film23.xpm @@ -1,284 +1,284 @@ -/* XPM */ -static const char *xpm_film23[] = { -"24 24 256 3", -"000 c black", -"001 c transparent", -"002 c #000008", -"003 c #070A18", -"004 c #202432", -"005 c #202434", -"006 c #242837", -"007 c #262837", -"008 c #262A39", -"009 c #2A2E3B", -"010 c #2E323F", -"011 c #2E3240", -"012 c #313544", -"013 c #3C3F4E", -"014 c #3E414F", -"015 c #404251", -"016 c #484C57", -"017 c #4A4959", -"018 c #4A4C5B", -"019 c #50535B", -"020 c #4C5161", -"021 c #5A5E66", -"022 c #5B5F67", -"023 c #5A5E6B", -"024 c #5E6271", -"025 c #757987", -"026 c #767989", -"027 c #7A7E85", -"028 c #B9954A", -"029 c #C5B434", -"030 c #E69400", -"031 c #FFA500", -"032 c #EABA56", -"033 c #FFC600", -"034 c #FFCE00", -"035 c #FDCA15", -"036 c #FFD900", -"037 c #FFD422", -"038 c #FFE100", -"039 c #FFE601", -"040 c #FFE608", -"041 c #FFF200", -"042 c #FFF600", -"043 c #FFFB00", -"044 c #FFFE00", -"045 c #FFF237", -"046 c #FFF63A", -"047 c #EEC143", -"048 c #F2C743", -"049 c #FFDB48", -"050 c #FFDC61", -"051 c #FFE17A", -"052 c #FFFB6B", -"053 c #82858D", -"054 c #818292", -"055 c #828695", -"056 c #87809C", -"057 c #878B99", -"058 c #878B9A", -"059 c #8A8D95", -"060 c #9397A6", -"061 c #9495A5", -"062 c #9599A1", -"063 c #969AA9", -"064 c #9B9FAF", -"065 c #9C9FAE", -"066 c #9FA2B0", -"067 c #A1A2AD", -"068 c #A6A5B4", -"069 c #A5A8B7", -"070 c #A9ADBB", -"071 c #B5AFB3", -"072 c #AEB2C0", -"073 c #B0B4C2", -"074 c #B3B6C4", -"075 c #B6BACA", -"076 c #B9BCCB", -"077 c #BDBFCA", -"078 c #E6C18B", -"079 c #ECD09C", -"080 c #F6CC82", -"081 c #F6CE8B", -"082 c #FAD08F", -"083 c #FBD391", -"084 c #FDD39D", -"085 c #C0C4D2", -"086 c #C3C5D5", -"087 c #C3C8D7", -"088 c #C5C8D6", -"089 c #C7CCDB", -"090 c #CDCCD5", -"091 c #CCCFD7", -"092 c #D7D8E3", -"093 c #D7DBE9", -"094 c #D9DCEE", -"095 c #DFE1F2", -"096 c #DFE5F2", -"097 c #E7D9CF", -"098 c #E6E6EA", -"099 c #E0E4F3", -"100 c #E1E5F2", -"101 c #E2E6F4", -"102 c #E5E9F9", -"103 c #E7EBF8", -"104 c #E9EDFC", -"105 c #EAEFFF", -"106 c #EDEAFF", -"107 c #ECEFFD", -"108 c #EDEFFE", -"109 c #EDF0FF", -"110 c #EDF2FF", -"111 c #F7F2E5", -"112 c #FFF4E3", -"113 c #F0F1FF", -"114 c #F0F5FF", -"115 c #F2F5FF", -"116 c #F3F6FF", -"117 c #F4F7FF", -"118 c #F5F8FF", -"119 c #F6F9FF", -"120 c #F6FAFF", -"121 c #FFFFF4", -"122 c #F9FCFF", -"123 c #FBFFFF", -"124 c #FCFFFF", -"125 c #FDFFFF", -"126 c Gray100", -"127 c black", -"128 c black", -"129 c black", -"130 c black", -"131 c black", -"132 c black", -"133 c black", -"134 c black", -"135 c black", -"136 c black", -"137 c black", -"138 c black", -"139 c black", -"140 c black", -"141 c black", -"142 c black", -"143 c black", -"144 c black", -"145 c black", -"146 c black", -"147 c black", -"148 c black", -"149 c black", -"150 c black", -"151 c black", -"152 c black", -"153 c black", -"154 c black", -"155 c black", -"156 c black", -"157 c black", -"158 c black", -"159 c black", -"160 c black", -"161 c black", -"162 c black", -"163 c black", -"164 c black", -"165 c black", -"166 c black", -"167 c black", -"168 c black", -"169 c black", -"170 c black", -"171 c black", -"172 c black", -"173 c black", -"174 c black", -"175 c black", -"176 c black", -"177 c black", -"178 c black", -"179 c black", -"180 c black", -"181 c black", -"182 c black", -"183 c black", -"184 c black", -"185 c black", -"186 c black", -"187 c black", -"188 c black", -"189 c black", -"190 c black", -"191 c black", -"192 c black", -"193 c black", -"194 c black", -"195 c black", -"196 c black", -"197 c black", -"198 c black", -"199 c black", -"200 c black", -"201 c black", -"202 c black", -"203 c black", -"204 c black", -"205 c black", -"206 c black", -"207 c black", -"208 c black", -"209 c black", -"210 c black", -"211 c black", -"212 c black", -"213 c black", -"214 c black", -"215 c black", -"216 c black", -"217 c black", -"218 c black", -"219 c black", -"220 c black", -"221 c black", -"222 c black", -"223 c black", -"224 c black", -"225 c black", -"226 c black", -"227 c black", -"228 c black", -"229 c black", -"230 c black", -"231 c black", -"232 c black", -"233 c black", -"234 c black", -"235 c black", -"236 c black", -"237 c black", -"238 c black", -"239 c black", -"240 c black", -"241 c black", -"242 c black", -"243 c black", -"244 c black", -"245 c black", -"246 c black", -"247 c black", -"248 c black", -"249 c black", -"250 c black", -"251 c black", -"252 c black", -"253 c black", -"254 c black", -"255 c black", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"126126000000000000126126000000000000126126000000000000126126000000000000", -"126126000000000000126126000000000000126126000000000000126126000000000000", -"126126000000000000126126000000000000126126000000000000126126000000000000", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"126126000000000000126126126126126126067027059053022019021091126126126126", -"126126000000000000126126126126126068024060057008012004005009099126126126", -"126126000000000000126126126126113006069118063015055010001001013126126126", -"126126000000000000126126126126061000072064016062076025014000000086126126", -"126126000000000000126126126126018000007089029048077070003000000023126126", -"126126000000000000126126126102002000065126039030071115085000000000075126", -"126126000000000000126126126020000026126126050028126126123074000000058126", -"126126000000000000126126119056017108126126111098126124116104011000073126", -"126126000000000000126126126126106126126126126126125118107101066054126126", -"126126000000000000126126126126126117120122122120115104100093088114126126", -"126126000000000000126126126126126117105110109107103096092090087126126126", -"126126000000000000126126126126126112082081097095094079083080084126126126", -"126126000000000000126126126126126033040052049078047045046036031121126126", -"126126000000000000126126126126126037041043034032035042044038051126126126", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"126126000000000000126126000000000000126126000000000000126126000000000000", -"126126000000000000126126000000000000126126000000000000126126000000000000", -"126126000000000000126126000000000000126126000000000000126126000000000000", -"000000000000000000000000000000000000000000000000000000000000000000000000" -}; +/* XPM */ +static const char *xpm_film23[] = { +"24 24 256 3", +"000 c black", +"001 c transparent", +"002 c #000008", +"003 c #070A18", +"004 c #202432", +"005 c #202434", +"006 c #242837", +"007 c #262837", +"008 c #262A39", +"009 c #2A2E3B", +"010 c #2E323F", +"011 c #2E3240", +"012 c #313544", +"013 c #3C3F4E", +"014 c #3E414F", +"015 c #404251", +"016 c #484C57", +"017 c #4A4959", +"018 c #4A4C5B", +"019 c #50535B", +"020 c #4C5161", +"021 c #5A5E66", +"022 c #5B5F67", +"023 c #5A5E6B", +"024 c #5E6271", +"025 c #757987", +"026 c #767989", +"027 c #7A7E85", +"028 c #B9954A", +"029 c #C5B434", +"030 c #E69400", +"031 c #FFA500", +"032 c #EABA56", +"033 c #FFC600", +"034 c #FFCE00", +"035 c #FDCA15", +"036 c #FFD900", +"037 c #FFD422", +"038 c #FFE100", +"039 c #FFE601", +"040 c #FFE608", +"041 c #FFF200", +"042 c #FFF600", +"043 c #FFFB00", +"044 c #FFFE00", +"045 c #FFF237", +"046 c #FFF63A", +"047 c #EEC143", +"048 c #F2C743", +"049 c #FFDB48", +"050 c #FFDC61", +"051 c #FFE17A", +"052 c #FFFB6B", +"053 c #82858D", +"054 c #818292", +"055 c #828695", +"056 c #87809C", +"057 c #878B99", +"058 c #878B9A", +"059 c #8A8D95", +"060 c #9397A6", +"061 c #9495A5", +"062 c #9599A1", +"063 c #969AA9", +"064 c #9B9FAF", +"065 c #9C9FAE", +"066 c #9FA2B0", +"067 c #A1A2AD", +"068 c #A6A5B4", +"069 c #A5A8B7", +"070 c #A9ADBB", +"071 c #B5AFB3", +"072 c #AEB2C0", +"073 c #B0B4C2", +"074 c #B3B6C4", +"075 c #B6BACA", +"076 c #B9BCCB", +"077 c #BDBFCA", +"078 c #E6C18B", +"079 c #ECD09C", +"080 c #F6CC82", +"081 c #F6CE8B", +"082 c #FAD08F", +"083 c #FBD391", +"084 c #FDD39D", +"085 c #C0C4D2", +"086 c #C3C5D5", +"087 c #C3C8D7", +"088 c #C5C8D6", +"089 c #C7CCDB", +"090 c #CDCCD5", +"091 c #CCCFD7", +"092 c #D7D8E3", +"093 c #D7DBE9", +"094 c #D9DCEE", +"095 c #DFE1F2", +"096 c #DFE5F2", +"097 c #E7D9CF", +"098 c #E6E6EA", +"099 c #E0E4F3", +"100 c #E1E5F2", +"101 c #E2E6F4", +"102 c #E5E9F9", +"103 c #E7EBF8", +"104 c #E9EDFC", +"105 c #EAEFFF", +"106 c #EDEAFF", +"107 c #ECEFFD", +"108 c #EDEFFE", +"109 c #EDF0FF", +"110 c #EDF2FF", +"111 c #F7F2E5", +"112 c #FFF4E3", +"113 c #F0F1FF", +"114 c #F0F5FF", +"115 c #F2F5FF", +"116 c #F3F6FF", +"117 c #F4F7FF", +"118 c #F5F8FF", +"119 c #F6F9FF", +"120 c #F6FAFF", +"121 c #FFFFF4", +"122 c #F9FCFF", +"123 c #FBFFFF", +"124 c #FCFFFF", +"125 c #FDFFFF", +"126 c Gray100", +"127 c black", +"128 c black", +"129 c black", +"130 c black", +"131 c black", +"132 c black", +"133 c black", +"134 c black", +"135 c black", +"136 c black", +"137 c black", +"138 c black", +"139 c black", +"140 c black", +"141 c black", +"142 c black", +"143 c black", +"144 c black", +"145 c black", +"146 c black", +"147 c black", +"148 c black", +"149 c black", +"150 c black", +"151 c black", +"152 c black", +"153 c black", +"154 c black", +"155 c black", +"156 c black", +"157 c black", +"158 c black", +"159 c black", +"160 c black", +"161 c black", +"162 c black", +"163 c black", +"164 c black", +"165 c black", +"166 c black", +"167 c black", +"168 c black", +"169 c black", +"170 c black", +"171 c black", +"172 c black", +"173 c black", +"174 c black", +"175 c black", +"176 c black", +"177 c black", +"178 c black", +"179 c black", +"180 c black", +"181 c black", +"182 c black", +"183 c black", +"184 c black", +"185 c black", +"186 c black", +"187 c black", +"188 c black", +"189 c black", +"190 c black", +"191 c black", +"192 c black", +"193 c black", +"194 c black", +"195 c black", +"196 c black", +"197 c black", +"198 c black", +"199 c black", +"200 c black", +"201 c black", +"202 c black", +"203 c black", +"204 c black", +"205 c black", +"206 c black", +"207 c black", +"208 c black", +"209 c black", +"210 c black", +"211 c black", +"212 c black", +"213 c black", +"214 c black", +"215 c black", +"216 c black", +"217 c black", +"218 c black", +"219 c black", +"220 c black", +"221 c black", +"222 c black", +"223 c black", +"224 c black", +"225 c black", +"226 c black", +"227 c black", +"228 c black", +"229 c black", +"230 c black", +"231 c black", +"232 c black", +"233 c black", +"234 c black", +"235 c black", +"236 c black", +"237 c black", +"238 c black", +"239 c black", +"240 c black", +"241 c black", +"242 c black", +"243 c black", +"244 c black", +"245 c black", +"246 c black", +"247 c black", +"248 c black", +"249 c black", +"250 c black", +"251 c black", +"252 c black", +"253 c black", +"254 c black", +"255 c black", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"126126000000000000126126000000000000126126000000000000126126000000000000", +"126126000000000000126126000000000000126126000000000000126126000000000000", +"126126000000000000126126000000000000126126000000000000126126000000000000", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"126126000000000000126126126126126126067027059053022019021091126126126126", +"126126000000000000126126126126126068024060057008012004005009099126126126", +"126126000000000000126126126126113006069118063015055010001001013126126126", +"126126000000000000126126126126061000072064016062076025014000000086126126", +"126126000000000000126126126126018000007089029048077070003000000023126126", +"126126000000000000126126126102002000065126039030071115085000000000075126", +"126126000000000000126126126020000026126126050028126126123074000000058126", +"126126000000000000126126119056017108126126111098126124116104011000073126", +"126126000000000000126126126126106126126126126126125118107101066054126126", +"126126000000000000126126126126126117120122122120115104100093088114126126", +"126126000000000000126126126126126117105110109107103096092090087126126126", +"126126000000000000126126126126126112082081097095094079083080084126126126", +"126126000000000000126126126126126033040052049078047045046036031121126126", +"126126000000000000126126126126126037041043034032035042044038051126126126", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"126126000000000000126126000000000000126126000000000000126126000000000000", +"126126000000000000126126000000000000126126000000000000126126000000000000", +"126126000000000000126126000000000000126126000000000000126126000000000000", +"000000000000000000000000000000000000000000000000000000000000000000000000" +}; diff --git a/avidemux/common/ADM_icons/tray/film3.xpm b/avidemux/common/ADM_icons/tray/film3.xpm index 24f68b7e9f..acf85253c3 100644 --- a/avidemux/common/ADM_icons/tray/film3.xpm +++ b/avidemux/common/ADM_icons/tray/film3.xpm @@ -1,284 +1,284 @@ -/* XPM */ -static const char *xpm_film3[] = { -"24 24 256 3", -"000 c black", -"001 c transparent", -"002 c #000008", -"003 c #070A18", -"004 c #202432", -"005 c #202434", -"006 c #242837", -"007 c #262837", -"008 c #262A39", -"009 c #2A2E3B", -"010 c #2E323F", -"011 c #2E3240", -"012 c #313544", -"013 c #3C3F4E", -"014 c #3E414F", -"015 c #404251", -"016 c #484C57", -"017 c #4A4959", -"018 c #4A4C5B", -"019 c #50535B", -"020 c #4C5161", -"021 c #5A5E66", -"022 c #5B5F67", -"023 c #5A5E6B", -"024 c #5E6271", -"025 c #757987", -"026 c #767989", -"027 c #7A7E85", -"028 c #B9954A", -"029 c #C5B434", -"030 c #E69400", -"031 c #FFA500", -"032 c #EABA56", -"033 c #FFC600", -"034 c #FFCE00", -"035 c #FDCA15", -"036 c #FFD900", -"037 c #FFD422", -"038 c #FFE100", -"039 c #FFE601", -"040 c #FFE608", -"041 c #FFF200", -"042 c #FFF600", -"043 c #FFFB00", -"044 c #FFFE00", -"045 c #FFF237", -"046 c #FFF63A", -"047 c #EEC143", -"048 c #F2C743", -"049 c #FFDB48", -"050 c #FFDC61", -"051 c #FFE17A", -"052 c #FFFB6B", -"053 c #82858D", -"054 c #818292", -"055 c #828695", -"056 c #87809C", -"057 c #878B99", -"058 c #878B9A", -"059 c #8A8D95", -"060 c #9397A6", -"061 c #9495A5", -"062 c #9599A1", -"063 c #969AA9", -"064 c #9B9FAF", -"065 c #9C9FAE", -"066 c #9FA2B0", -"067 c #A1A2AD", -"068 c #A6A5B4", -"069 c #A5A8B7", -"070 c #A9ADBB", -"071 c #B5AFB3", -"072 c #AEB2C0", -"073 c #B0B4C2", -"074 c #B3B6C4", -"075 c #B6BACA", -"076 c #B9BCCB", -"077 c #BDBFCA", -"078 c #E6C18B", -"079 c #ECD09C", -"080 c #F6CC82", -"081 c #F6CE8B", -"082 c #FAD08F", -"083 c #FBD391", -"084 c #FDD39D", -"085 c #C0C4D2", -"086 c #C3C5D5", -"087 c #C3C8D7", -"088 c #C5C8D6", -"089 c #C7CCDB", -"090 c #CDCCD5", -"091 c #CCCFD7", -"092 c #D7D8E3", -"093 c #D7DBE9", -"094 c #D9DCEE", -"095 c #DFE1F2", -"096 c #DFE5F2", -"097 c #E7D9CF", -"098 c #E6E6EA", -"099 c #E0E4F3", -"100 c #E1E5F2", -"101 c #E2E6F4", -"102 c #E5E9F9", -"103 c #E7EBF8", -"104 c #E9EDFC", -"105 c #EAEFFF", -"106 c #EDEAFF", -"107 c #ECEFFD", -"108 c #EDEFFE", -"109 c #EDF0FF", -"110 c #EDF2FF", -"111 c #F7F2E5", -"112 c #FFF4E3", -"113 c #F0F1FF", -"114 c #F0F5FF", -"115 c #F2F5FF", -"116 c #F3F6FF", -"117 c #F4F7FF", -"118 c #F5F8FF", -"119 c #F6F9FF", -"120 c #F6FAFF", -"121 c #FFFFF4", -"122 c #F9FCFF", -"123 c #FBFFFF", -"124 c #FCFFFF", -"125 c #FDFFFF", -"126 c Gray100", -"127 c black", -"128 c black", -"129 c black", -"130 c black", -"131 c black", -"132 c black", -"133 c black", -"134 c black", -"135 c black", -"136 c black", -"137 c black", -"138 c black", -"139 c black", -"140 c black", -"141 c black", -"142 c black", -"143 c black", -"144 c black", -"145 c black", -"146 c black", -"147 c black", -"148 c black", -"149 c black", -"150 c black", -"151 c black", -"152 c black", -"153 c black", -"154 c black", -"155 c black", -"156 c black", -"157 c black", -"158 c black", -"159 c black", -"160 c black", -"161 c black", -"162 c black", -"163 c black", -"164 c black", -"165 c black", -"166 c black", -"167 c black", -"168 c black", -"169 c black", -"170 c black", -"171 c black", -"172 c black", -"173 c black", -"174 c black", -"175 c black", -"176 c black", -"177 c black", -"178 c black", -"179 c black", -"180 c black", -"181 c black", -"182 c black", -"183 c black", -"184 c black", -"185 c black", -"186 c black", -"187 c black", -"188 c black", -"189 c black", -"190 c black", -"191 c black", -"192 c black", -"193 c black", -"194 c black", -"195 c black", -"196 c black", -"197 c black", -"198 c black", -"199 c black", -"200 c black", -"201 c black", -"202 c black", -"203 c black", -"204 c black", -"205 c black", -"206 c black", -"207 c black", -"208 c black", -"209 c black", -"210 c black", -"211 c black", -"212 c black", -"213 c black", -"214 c black", -"215 c black", -"216 c black", -"217 c black", -"218 c black", -"219 c black", -"220 c black", -"221 c black", -"222 c black", -"223 c black", -"224 c black", -"225 c black", -"226 c black", -"227 c black", -"228 c black", -"229 c black", -"230 c black", -"231 c black", -"232 c black", -"233 c black", -"234 c black", -"235 c black", -"236 c black", -"237 c black", -"238 c black", -"239 c black", -"240 c black", -"241 c black", -"242 c black", -"243 c black", -"244 c black", -"245 c black", -"246 c black", -"247 c black", -"248 c black", -"249 c black", -"250 c black", -"251 c black", -"252 c black", -"253 c black", -"254 c black", -"255 c black", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000000000126126000000000000126126000000000000126126000000000000126126", -"000000000000126126000000000000126126000000000000126126000000000000126126", -"000000000000126126000000000000126126000000000000126126000000000000126126", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"126126126126067027059053022019021091126126126126126126000000000000126126", -"126126126068024060057008012004005009099126126126126126000000000000126126", -"126126113006069118063015055010001001013126126126126126000000000000126126", -"126126061000072064016062076025014000000086126126126126000000000000126126", -"126126018000007089029048077070003000000023126126126126000000000000126126", -"126102002000065126039030071115085000000000075126126126000000000000126126", -"126020000026126126050028126126123074000000058126126126000000000000126126", -"119056017108126126111098126124116104011000073126126126000000000000126126", -"126126106126126126126126125118107101066054126126126126000000000000126126", -"126126126117120122122120115104100093088114126126126126000000000000126126", -"126126126117105110109107103096092090087126126126126126000000000000126126", -"126126126112082081097095094079083080084126126126126126000000000000126126", -"126126126033040052049078047045046036031121126126126126000000000000126126", -"126126126037041043034032035042044038051126126126126126000000000000126126", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000000000126126000000000000126126000000000000126126000000000000126126", -"000000000000126126000000000000126126000000000000126126000000000000126126", -"000000000000126126000000000000126126000000000000126126000000000000126126", -"000000000000000000000000000000000000000000000000000000000000000000000000" -}; +/* XPM */ +static const char *xpm_film3[] = { +"24 24 256 3", +"000 c black", +"001 c transparent", +"002 c #000008", +"003 c #070A18", +"004 c #202432", +"005 c #202434", +"006 c #242837", +"007 c #262837", +"008 c #262A39", +"009 c #2A2E3B", +"010 c #2E323F", +"011 c #2E3240", +"012 c #313544", +"013 c #3C3F4E", +"014 c #3E414F", +"015 c #404251", +"016 c #484C57", +"017 c #4A4959", +"018 c #4A4C5B", +"019 c #50535B", +"020 c #4C5161", +"021 c #5A5E66", +"022 c #5B5F67", +"023 c #5A5E6B", +"024 c #5E6271", +"025 c #757987", +"026 c #767989", +"027 c #7A7E85", +"028 c #B9954A", +"029 c #C5B434", +"030 c #E69400", +"031 c #FFA500", +"032 c #EABA56", +"033 c #FFC600", +"034 c #FFCE00", +"035 c #FDCA15", +"036 c #FFD900", +"037 c #FFD422", +"038 c #FFE100", +"039 c #FFE601", +"040 c #FFE608", +"041 c #FFF200", +"042 c #FFF600", +"043 c #FFFB00", +"044 c #FFFE00", +"045 c #FFF237", +"046 c #FFF63A", +"047 c #EEC143", +"048 c #F2C743", +"049 c #FFDB48", +"050 c #FFDC61", +"051 c #FFE17A", +"052 c #FFFB6B", +"053 c #82858D", +"054 c #818292", +"055 c #828695", +"056 c #87809C", +"057 c #878B99", +"058 c #878B9A", +"059 c #8A8D95", +"060 c #9397A6", +"061 c #9495A5", +"062 c #9599A1", +"063 c #969AA9", +"064 c #9B9FAF", +"065 c #9C9FAE", +"066 c #9FA2B0", +"067 c #A1A2AD", +"068 c #A6A5B4", +"069 c #A5A8B7", +"070 c #A9ADBB", +"071 c #B5AFB3", +"072 c #AEB2C0", +"073 c #B0B4C2", +"074 c #B3B6C4", +"075 c #B6BACA", +"076 c #B9BCCB", +"077 c #BDBFCA", +"078 c #E6C18B", +"079 c #ECD09C", +"080 c #F6CC82", +"081 c #F6CE8B", +"082 c #FAD08F", +"083 c #FBD391", +"084 c #FDD39D", +"085 c #C0C4D2", +"086 c #C3C5D5", +"087 c #C3C8D7", +"088 c #C5C8D6", +"089 c #C7CCDB", +"090 c #CDCCD5", +"091 c #CCCFD7", +"092 c #D7D8E3", +"093 c #D7DBE9", +"094 c #D9DCEE", +"095 c #DFE1F2", +"096 c #DFE5F2", +"097 c #E7D9CF", +"098 c #E6E6EA", +"099 c #E0E4F3", +"100 c #E1E5F2", +"101 c #E2E6F4", +"102 c #E5E9F9", +"103 c #E7EBF8", +"104 c #E9EDFC", +"105 c #EAEFFF", +"106 c #EDEAFF", +"107 c #ECEFFD", +"108 c #EDEFFE", +"109 c #EDF0FF", +"110 c #EDF2FF", +"111 c #F7F2E5", +"112 c #FFF4E3", +"113 c #F0F1FF", +"114 c #F0F5FF", +"115 c #F2F5FF", +"116 c #F3F6FF", +"117 c #F4F7FF", +"118 c #F5F8FF", +"119 c #F6F9FF", +"120 c #F6FAFF", +"121 c #FFFFF4", +"122 c #F9FCFF", +"123 c #FBFFFF", +"124 c #FCFFFF", +"125 c #FDFFFF", +"126 c Gray100", +"127 c black", +"128 c black", +"129 c black", +"130 c black", +"131 c black", +"132 c black", +"133 c black", +"134 c black", +"135 c black", +"136 c black", +"137 c black", +"138 c black", +"139 c black", +"140 c black", +"141 c black", +"142 c black", +"143 c black", +"144 c black", +"145 c black", +"146 c black", +"147 c black", +"148 c black", +"149 c black", +"150 c black", +"151 c black", +"152 c black", +"153 c black", +"154 c black", +"155 c black", +"156 c black", +"157 c black", +"158 c black", +"159 c black", +"160 c black", +"161 c black", +"162 c black", +"163 c black", +"164 c black", +"165 c black", +"166 c black", +"167 c black", +"168 c black", +"169 c black", +"170 c black", +"171 c black", +"172 c black", +"173 c black", +"174 c black", +"175 c black", +"176 c black", +"177 c black", +"178 c black", +"179 c black", +"180 c black", +"181 c black", +"182 c black", +"183 c black", +"184 c black", +"185 c black", +"186 c black", +"187 c black", +"188 c black", +"189 c black", +"190 c black", +"191 c black", +"192 c black", +"193 c black", +"194 c black", +"195 c black", +"196 c black", +"197 c black", +"198 c black", +"199 c black", +"200 c black", +"201 c black", +"202 c black", +"203 c black", +"204 c black", +"205 c black", +"206 c black", +"207 c black", +"208 c black", +"209 c black", +"210 c black", +"211 c black", +"212 c black", +"213 c black", +"214 c black", +"215 c black", +"216 c black", +"217 c black", +"218 c black", +"219 c black", +"220 c black", +"221 c black", +"222 c black", +"223 c black", +"224 c black", +"225 c black", +"226 c black", +"227 c black", +"228 c black", +"229 c black", +"230 c black", +"231 c black", +"232 c black", +"233 c black", +"234 c black", +"235 c black", +"236 c black", +"237 c black", +"238 c black", +"239 c black", +"240 c black", +"241 c black", +"242 c black", +"243 c black", +"244 c black", +"245 c black", +"246 c black", +"247 c black", +"248 c black", +"249 c black", +"250 c black", +"251 c black", +"252 c black", +"253 c black", +"254 c black", +"255 c black", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000000000126126000000000000126126000000000000126126000000000000126126", +"000000000000126126000000000000126126000000000000126126000000000000126126", +"000000000000126126000000000000126126000000000000126126000000000000126126", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"126126126126067027059053022019021091126126126126126126000000000000126126", +"126126126068024060057008012004005009099126126126126126000000000000126126", +"126126113006069118063015055010001001013126126126126126000000000000126126", +"126126061000072064016062076025014000000086126126126126000000000000126126", +"126126018000007089029048077070003000000023126126126126000000000000126126", +"126102002000065126039030071115085000000000075126126126000000000000126126", +"126020000026126126050028126126123074000000058126126126000000000000126126", +"119056017108126126111098126124116104011000073126126126000000000000126126", +"126126106126126126126126125118107101066054126126126126000000000000126126", +"126126126117120122122120115104100093088114126126126126000000000000126126", +"126126126117105110109107103096092090087126126126126126000000000000126126", +"126126126112082081097095094079083080084126126126126126000000000000126126", +"126126126033040052049078047045046036031121126126126126000000000000126126", +"126126126037041043034032035042044038051126126126126126000000000000126126", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000000000126126000000000000126126000000000000126126000000000000126126", +"000000000000126126000000000000126126000000000000126126000000000000126126", +"000000000000126126000000000000126126000000000000126126000000000000126126", +"000000000000000000000000000000000000000000000000000000000000000000000000" +}; diff --git a/avidemux/common/ADM_icons/tray/film5.xpm b/avidemux/common/ADM_icons/tray/film5.xpm index 5ba230c114..bba1375109 100644 --- a/avidemux/common/ADM_icons/tray/film5.xpm +++ b/avidemux/common/ADM_icons/tray/film5.xpm @@ -1,284 +1,284 @@ -/* XPM */ -static const char *xpm_film5[] = { -"24 24 256 3", -"000 c black", -"001 c transparent", -"002 c #070A18", -"003 c #151410", -"004 c #202432", -"005 c #202434", -"006 c #262837", -"007 c #262A39", -"008 c #2A2E3B", -"009 c #2E323F", -"010 c #32322E", -"011 c #37332F", -"012 c #2E3240", -"013 c #313544", -"014 c #3C3F4E", -"015 c #3E414F", -"016 c #483F3C", -"017 c #404251", -"018 c #484C57", -"019 c #50535B", -"020 c #5D5353", -"021 c #5A5E66", -"022 c #5B5F67", -"023 c #5A5E6B", -"024 c #5E6271", -"025 c #625E5D", -"026 c #757987", -"027 c #7A7E85", -"028 c #B9954A", -"029 c #C5B434", -"030 c #E69400", -"031 c #FFA500", -"032 c #EABA56", -"033 c #FFCE00", -"034 c #FDCA15", -"035 c #FFD900", -"036 c #FFE100", -"037 c #FFE601", -"038 c #FFE608", -"039 c #FFF200", -"040 c #FFF600", -"041 c #FFFB00", -"042 c #FFFE00", -"043 c #FFF237", -"044 c #FFF63A", -"045 c #EEC143", -"046 c #F2C743", -"047 c #FFDB48", -"048 c #FFDC61", -"049 c #FFE17A", -"050 c #FFFB6B", -"051 c #82858D", -"052 c #818292", -"053 c #828695", -"054 c #878B99", -"055 c #878B9A", -"056 c #8A8D95", -"057 c #969593", -"058 c #9397A6", -"059 c #9599A1", -"060 c #969AA9", -"061 c #9B9FAF", -"062 c #9C9FAE", -"063 c #9FA2B0", -"064 c #A1A2AD", -"065 c #A9A9A5", -"066 c #A5A8B7", -"067 c #A9ADBB", -"068 c #B5AFB3", -"069 c Gray71", -"070 c #BBBAB9", -"071 c #AEB2C0", -"072 c #B0B4C2", -"073 c #B3B6C4", -"074 c #B6BACA", -"075 c #B9BCCB", -"076 c #BDBFCA", -"077 c #E6C18B", -"078 c #ECD09C", -"079 c #F6CC82", -"080 c #F6CE8B", -"081 c #FAD08F", -"082 c #FBD391", -"083 c #FDD39D", -"084 c Gray78", -"085 c Gray81", -"086 c #C0C4D2", -"087 c #C3C5D5", -"088 c #C3C8D7", -"089 c #C5C8D6", -"090 c #C7CCDB", -"091 c #CDCCD5", -"092 c #CCCFD7", -"093 c #D7D8E3", -"094 c #D7DBE9", -"095 c #D9DCEE", -"096 c #DFE1F2", -"097 c #DFE5F2", -"098 c #E7D9CF", -"099 c #E4E4E3", -"100 c #E7E7E8", -"101 c #E6E6EA", -"102 c #E0E4F3", -"103 c #E1E5F2", -"104 c #E2E6F4", -"105 c #E7EBF8", -"106 c #E9EDFC", -"107 c #EAEFFF", -"108 c #ECEFFD", -"109 c #EDF0FF", -"110 c #EDF2FF", -"111 c #F7F2E5", -"112 c #F0F5FF", -"113 c #F2F5FF", -"114 c #F3F6FF", -"115 c #F5F8FF", -"116 c #F6FAFF", -"117 c #FFFFF4", -"118 c #F9FCFF", -"119 c #FBFFFF", -"120 c #FCFFFF", -"121 c #FDFFFF", -"122 c Gray100", -"123 c black", -"124 c black", -"125 c black", -"126 c black", -"127 c black", -"128 c black", -"129 c black", -"130 c black", -"131 c black", -"132 c black", -"133 c black", -"134 c black", -"135 c black", -"136 c black", -"137 c black", -"138 c black", -"139 c black", -"140 c black", -"141 c black", -"142 c black", -"143 c black", -"144 c black", -"145 c black", -"146 c black", -"147 c black", -"148 c black", -"149 c black", -"150 c black", -"151 c black", -"152 c black", -"153 c black", -"154 c black", -"155 c black", -"156 c black", -"157 c black", -"158 c black", -"159 c black", -"160 c black", -"161 c black", -"162 c black", -"163 c black", -"164 c black", -"165 c black", -"166 c black", -"167 c black", -"168 c black", -"169 c black", -"170 c black", -"171 c black", -"172 c black", -"173 c black", -"174 c black", -"175 c black", -"176 c black", -"177 c black", -"178 c black", -"179 c black", -"180 c black", -"181 c black", -"182 c black", -"183 c black", -"184 c black", -"185 c black", -"186 c black", -"187 c black", -"188 c black", -"189 c black", -"190 c black", -"191 c black", -"192 c black", -"193 c black", -"194 c black", -"195 c black", -"196 c black", -"197 c black", -"198 c black", -"199 c black", -"200 c black", -"201 c black", -"202 c black", -"203 c black", -"204 c black", -"205 c black", -"206 c black", -"207 c black", -"208 c black", -"209 c black", -"210 c black", -"211 c black", -"212 c black", -"213 c black", -"214 c black", -"215 c black", -"216 c black", -"217 c black", -"218 c black", -"219 c black", -"220 c black", -"221 c black", -"222 c black", -"223 c black", -"224 c black", -"225 c black", -"226 c black", -"227 c black", -"228 c black", -"229 c black", -"230 c black", -"231 c black", -"232 c black", -"233 c black", -"234 c black", -"235 c black", -"236 c black", -"237 c black", -"238 c black", -"239 c black", -"240 c black", -"241 c black", -"242 c black", -"243 c black", -"244 c black", -"245 c black", -"246 c black", -"247 c black", -"248 c black", -"249 c black", -"250 c black", -"251 c black", -"252 c black", -"253 c black", -"254 c black", -"255 c black", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"122122000000000000122122000000000000122122000000000000122122000000000000", -"122122000000000000122122000000000000122122000000000000122122000000000000", -"122122000000000000122122000000000000122122000000000000122122000000000000", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"064027056051022019021092122122122122122122000000000000122122122122122122", -"024058054007013004005008102122122122122122000000000000122122122122122122", -"066115060017053009001001014122122122122122000000000000122122122122122122", -"071061018059075026015000000087122122122122000000000000122122122122122069", -"006090029046076067002000000023122122122122000000000000122122122122057100", -"062122037030068113086000000000074122122122000000000000122122122122099003", -"122122048028122122119073000000055122122122000000000000122122122122085010", -"122122111101122120114106012000072122122122000000000000122122122122084065", -"122122122122121115108104063052122122122122000000000000122122122122122025", -"116118118116113106103094089112122122122122000000000000122122122122122020", -"107110109108105097093091088122122122122122000000000000122122122122122016", -"081080098096095078082079083122122122122122000000000000122122122122122011", -"038050047077045043044035031117122122122122000000000000122122122122122070", -"039041033032034040042036049122122122122122000000000000122122122122122122", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"122122000000000000122122000000000000122122000000000000122122000000000000", -"122122000000000000122122000000000000122122000000000000122122000000000000", -"122122000000000000122122000000000000122122000000000000122122000000000000", -"000000000000000000000000000000000000000000000000000000000000000000000000" -}; +/* XPM */ +static const char *xpm_film5[] = { +"24 24 256 3", +"000 c black", +"001 c transparent", +"002 c #070A18", +"003 c #151410", +"004 c #202432", +"005 c #202434", +"006 c #262837", +"007 c #262A39", +"008 c #2A2E3B", +"009 c #2E323F", +"010 c #32322E", +"011 c #37332F", +"012 c #2E3240", +"013 c #313544", +"014 c #3C3F4E", +"015 c #3E414F", +"016 c #483F3C", +"017 c #404251", +"018 c #484C57", +"019 c #50535B", +"020 c #5D5353", +"021 c #5A5E66", +"022 c #5B5F67", +"023 c #5A5E6B", +"024 c #5E6271", +"025 c #625E5D", +"026 c #757987", +"027 c #7A7E85", +"028 c #B9954A", +"029 c #C5B434", +"030 c #E69400", +"031 c #FFA500", +"032 c #EABA56", +"033 c #FFCE00", +"034 c #FDCA15", +"035 c #FFD900", +"036 c #FFE100", +"037 c #FFE601", +"038 c #FFE608", +"039 c #FFF200", +"040 c #FFF600", +"041 c #FFFB00", +"042 c #FFFE00", +"043 c #FFF237", +"044 c #FFF63A", +"045 c #EEC143", +"046 c #F2C743", +"047 c #FFDB48", +"048 c #FFDC61", +"049 c #FFE17A", +"050 c #FFFB6B", +"051 c #82858D", +"052 c #818292", +"053 c #828695", +"054 c #878B99", +"055 c #878B9A", +"056 c #8A8D95", +"057 c #969593", +"058 c #9397A6", +"059 c #9599A1", +"060 c #969AA9", +"061 c #9B9FAF", +"062 c #9C9FAE", +"063 c #9FA2B0", +"064 c #A1A2AD", +"065 c #A9A9A5", +"066 c #A5A8B7", +"067 c #A9ADBB", +"068 c #B5AFB3", +"069 c Gray71", +"070 c #BBBAB9", +"071 c #AEB2C0", +"072 c #B0B4C2", +"073 c #B3B6C4", +"074 c #B6BACA", +"075 c #B9BCCB", +"076 c #BDBFCA", +"077 c #E6C18B", +"078 c #ECD09C", +"079 c #F6CC82", +"080 c #F6CE8B", +"081 c #FAD08F", +"082 c #FBD391", +"083 c #FDD39D", +"084 c Gray78", +"085 c Gray81", +"086 c #C0C4D2", +"087 c #C3C5D5", +"088 c #C3C8D7", +"089 c #C5C8D6", +"090 c #C7CCDB", +"091 c #CDCCD5", +"092 c #CCCFD7", +"093 c #D7D8E3", +"094 c #D7DBE9", +"095 c #D9DCEE", +"096 c #DFE1F2", +"097 c #DFE5F2", +"098 c #E7D9CF", +"099 c #E4E4E3", +"100 c #E7E7E8", +"101 c #E6E6EA", +"102 c #E0E4F3", +"103 c #E1E5F2", +"104 c #E2E6F4", +"105 c #E7EBF8", +"106 c #E9EDFC", +"107 c #EAEFFF", +"108 c #ECEFFD", +"109 c #EDF0FF", +"110 c #EDF2FF", +"111 c #F7F2E5", +"112 c #F0F5FF", +"113 c #F2F5FF", +"114 c #F3F6FF", +"115 c #F5F8FF", +"116 c #F6FAFF", +"117 c #FFFFF4", +"118 c #F9FCFF", +"119 c #FBFFFF", +"120 c #FCFFFF", +"121 c #FDFFFF", +"122 c Gray100", +"123 c black", +"124 c black", +"125 c black", +"126 c black", +"127 c black", +"128 c black", +"129 c black", +"130 c black", +"131 c black", +"132 c black", +"133 c black", +"134 c black", +"135 c black", +"136 c black", +"137 c black", +"138 c black", +"139 c black", +"140 c black", +"141 c black", +"142 c black", +"143 c black", +"144 c black", +"145 c black", +"146 c black", +"147 c black", +"148 c black", +"149 c black", +"150 c black", +"151 c black", +"152 c black", +"153 c black", +"154 c black", +"155 c black", +"156 c black", +"157 c black", +"158 c black", +"159 c black", +"160 c black", +"161 c black", +"162 c black", +"163 c black", +"164 c black", +"165 c black", +"166 c black", +"167 c black", +"168 c black", +"169 c black", +"170 c black", +"171 c black", +"172 c black", +"173 c black", +"174 c black", +"175 c black", +"176 c black", +"177 c black", +"178 c black", +"179 c black", +"180 c black", +"181 c black", +"182 c black", +"183 c black", +"184 c black", +"185 c black", +"186 c black", +"187 c black", +"188 c black", +"189 c black", +"190 c black", +"191 c black", +"192 c black", +"193 c black", +"194 c black", +"195 c black", +"196 c black", +"197 c black", +"198 c black", +"199 c black", +"200 c black", +"201 c black", +"202 c black", +"203 c black", +"204 c black", +"205 c black", +"206 c black", +"207 c black", +"208 c black", +"209 c black", +"210 c black", +"211 c black", +"212 c black", +"213 c black", +"214 c black", +"215 c black", +"216 c black", +"217 c black", +"218 c black", +"219 c black", +"220 c black", +"221 c black", +"222 c black", +"223 c black", +"224 c black", +"225 c black", +"226 c black", +"227 c black", +"228 c black", +"229 c black", +"230 c black", +"231 c black", +"232 c black", +"233 c black", +"234 c black", +"235 c black", +"236 c black", +"237 c black", +"238 c black", +"239 c black", +"240 c black", +"241 c black", +"242 c black", +"243 c black", +"244 c black", +"245 c black", +"246 c black", +"247 c black", +"248 c black", +"249 c black", +"250 c black", +"251 c black", +"252 c black", +"253 c black", +"254 c black", +"255 c black", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"122122000000000000122122000000000000122122000000000000122122000000000000", +"122122000000000000122122000000000000122122000000000000122122000000000000", +"122122000000000000122122000000000000122122000000000000122122000000000000", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"064027056051022019021092122122122122122122000000000000122122122122122122", +"024058054007013004005008102122122122122122000000000000122122122122122122", +"066115060017053009001001014122122122122122000000000000122122122122122122", +"071061018059075026015000000087122122122122000000000000122122122122122069", +"006090029046076067002000000023122122122122000000000000122122122122057100", +"062122037030068113086000000000074122122122000000000000122122122122099003", +"122122048028122122119073000000055122122122000000000000122122122122085010", +"122122111101122120114106012000072122122122000000000000122122122122084065", +"122122122122121115108104063052122122122122000000000000122122122122122025", +"116118118116113106103094089112122122122122000000000000122122122122122020", +"107110109108105097093091088122122122122122000000000000122122122122122016", +"081080098096095078082079083122122122122122000000000000122122122122122011", +"038050047077045043044035031117122122122122000000000000122122122122122070", +"039041033032034040042036049122122122122122000000000000122122122122122122", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"122122000000000000122122000000000000122122000000000000122122000000000000", +"122122000000000000122122000000000000122122000000000000122122000000000000", +"122122000000000000122122000000000000122122000000000000122122000000000000", +"000000000000000000000000000000000000000000000000000000000000000000000000" +}; diff --git a/avidemux/common/ADM_icons/tray/film7.xpm b/avidemux/common/ADM_icons/tray/film7.xpm index 38aafac734..77ef1ae392 100644 --- a/avidemux/common/ADM_icons/tray/film7.xpm +++ b/avidemux/common/ADM_icons/tray/film7.xpm @@ -1,284 +1,284 @@ -/* XPM */ -static const char *xpm_film7[] = { -"24 24 256 3", -"000 c black", -"001 c transparent", -"002 c #030200", -"003 c #070801", -"004 c #0D0C06", -"005 c #0E0D07", -"006 c #0F0E08", -"007 c #070A18", -"008 c #13120C", -"009 c #14120D", -"010 c #151410", -"011 c #161710", -"012 c #181711", -"013 c #191812", -"014 c #1B1A15", -"015 c #1D1C16", -"016 c #1E1D17", -"017 c #1F1E19", -"018 c #201F1A", -"019 c #23231C", -"020 c #24231D", -"021 c #2A2925", -"022 c #2E2D27", -"023 c #202432", -"024 c #202434", -"025 c #2A2E3B", -"026 c #2E323F", -"027 c #33312C", -"028 c #32322E", -"029 c #37332F", -"030 c #383731", -"031 c #3C3C35", -"032 c #2E3240", -"033 c #313544", -"034 c #3C3F4E", -"035 c #3E414F", -"036 c #483F3C", -"037 c #474640", -"038 c #4D4C48", -"039 c #555450", -"040 c #575650", -"041 c #50535B", -"042 c #5D5353", -"043 c #5A5954", -"044 c #5A5E66", -"045 c #5B5F67", -"046 c #5A5E6B", -"047 c #625E5D", -"048 c #63625D", -"049 c #676660", -"050 c #6B6A64", -"051 c #6E6E6C", -"052 c #71706C", -"053 c #757573", -"054 c #777776", -"055 c #757987", -"056 c #FFA500", -"057 c #FDCA15", -"058 c #FFD900", -"059 c #FFE100", -"060 c #FFF600", -"061 c #FFFE00", -"062 c #FFF237", -"063 c #FFF63A", -"064 c #EEC143", -"065 c #FFE17A", -"066 c #818292", -"067 c #828695", -"068 c #878B9A", -"069 c #969593", -"070 c #9FA2B0", -"071 c #A2A39D", -"072 c #A9A9A5", -"073 c #AAA9A7", -"074 c #ABAAA5", -"075 c #A9ADBB", -"076 c #B5AFB3", -"077 c Gray71", -"078 c #BBBAB9", -"079 c #BCBBBB", -"080 c #B0B4C2", -"081 c #B3B6C4", -"082 c #B6BACA", -"083 c #B9BCCB", -"084 c #BDBFCA", -"085 c #ECD09C", -"086 c #F6CC82", -"087 c #FBD391", -"088 c #FDD39D", -"089 c #C3C3C3", -"090 c Gray78", -"091 c Gray81", -"092 c #C0C4D2", -"093 c #C3C5D5", -"094 c #C3C8D7", -"095 c #C5C8D6", -"096 c #CDCCD5", -"097 c #CCCFD7", -"098 c #D8D5D0", -"099 c #DADAD8", -"100 c #D7D8E3", -"101 c #D7DBE9", -"102 c #D9DCEE", -"103 c #DFE5F2", -"104 c #E2E2DE", -"105 c #E4E4E3", -"106 c #E7E7E8", -"107 c #EEEDEB", -"108 c #E0E4F3", -"109 c #E1E5F2", -"110 c #E2E6F4", -"111 c #E7EBF8", -"112 c #E9EDFC", -"113 c #ECEFFD", -"114 c #F0F5FF", -"115 c #F2F5FF", -"116 c #F3F6FF", -"117 c #F5F8FF", -"118 c #F8F7F3", -"119 c #FFFFF4", -"120 c #FBFFFF", -"121 c #FCFFFF", -"122 c #FDFFFF", -"123 c Gray100", -"124 c black", -"125 c black", -"126 c black", -"127 c black", -"128 c black", -"129 c black", -"130 c black", -"131 c black", -"132 c black", -"133 c black", -"134 c black", -"135 c black", -"136 c black", -"137 c black", -"138 c black", -"139 c black", -"140 c black", -"141 c black", -"142 c black", -"143 c black", -"144 c black", -"145 c black", -"146 c black", -"147 c black", -"148 c black", -"149 c black", -"150 c black", -"151 c black", -"152 c black", -"153 c black", -"154 c black", -"155 c black", -"156 c black", -"157 c black", -"158 c black", -"159 c black", -"160 c black", -"161 c black", -"162 c black", -"163 c black", -"164 c black", -"165 c black", -"166 c black", -"167 c black", -"168 c black", -"169 c black", -"170 c black", -"171 c black", -"172 c black", -"173 c black", -"174 c black", -"175 c black", -"176 c black", -"177 c black", -"178 c black", -"179 c black", -"180 c black", -"181 c black", -"182 c black", -"183 c black", -"184 c black", -"185 c black", -"186 c black", -"187 c black", -"188 c black", -"189 c black", -"190 c black", -"191 c black", -"192 c black", -"193 c black", -"194 c black", -"195 c black", -"196 c black", -"197 c black", -"198 c black", -"199 c black", -"200 c black", -"201 c black", -"202 c black", -"203 c black", -"204 c black", -"205 c black", -"206 c black", -"207 c black", -"208 c black", -"209 c black", -"210 c black", -"211 c black", -"212 c black", -"213 c black", -"214 c black", -"215 c black", -"216 c black", -"217 c black", -"218 c black", -"219 c black", -"220 c black", -"221 c black", -"222 c black", -"223 c black", -"224 c black", -"225 c black", -"226 c black", -"227 c black", -"228 c black", -"229 c black", -"230 c black", -"231 c black", -"232 c black", -"233 c black", -"234 c black", -"235 c black", -"236 c black", -"237 c black", -"238 c black", -"239 c black", -"240 c black", -"241 c black", -"242 c black", -"243 c black", -"244 c black", -"245 c black", -"246 c black", -"247 c black", -"248 c black", -"249 c black", -"250 c black", -"251 c black", -"252 c black", -"253 c black", -"254 c black", -"255 c black", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000123123000000000000123123000000000000123123000000000000123123000000", -"000000123123000000000000123123000000000000123123000000000000123123000000", -"000000123123000000000000123123000000000000123123000000000000123123000000", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"045041044097123123123123123123000000000000123123123123123123123123123123", -"033023024025108123123123123123000000000000123123123123123123123123099039", -"067026001001034123123123123123000000000000123123123123123123123079071030", -"083055035000000093123123123123000000000000123123123123123077021037074038", -"084075007000000046123123123123000000000000123123123123069106107018015013", -"076115092000000000082123123123000000000000123123123123105010017005053123", -"123123120081000000068123123123000000000000123123123123091028049052054073", -"123121116112032000080123123123000000000000123123123123090072104040098118", -"122117113110070066123123123123000000000000123123123123123047011027050048", -"115112109101095114123123123123000000000000123123123123123042014019022031", -"111103100096094123123123123123000000000000123123123123123036009012016020", -"102085087086088123123123123123000000000000123123123123123029003006008011", -"064062063058056119123123123123000000000000123123123123123078043004002004", -"057060061059065123123123123123000000000000123123123123123123123123089051", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000123123000000000000123123000000000000123123000000000000123123000000", -"000000123123000000000000123123000000000000123123000000000000123123000000", -"000000123123000000000000123123000000000000123123000000000000123123000000", -"000000000000000000000000000000000000000000000000000000000000000000000000" -}; +/* XPM */ +static const char *xpm_film7[] = { +"24 24 256 3", +"000 c black", +"001 c transparent", +"002 c #030200", +"003 c #070801", +"004 c #0D0C06", +"005 c #0E0D07", +"006 c #0F0E08", +"007 c #070A18", +"008 c #13120C", +"009 c #14120D", +"010 c #151410", +"011 c #161710", +"012 c #181711", +"013 c #191812", +"014 c #1B1A15", +"015 c #1D1C16", +"016 c #1E1D17", +"017 c #1F1E19", +"018 c #201F1A", +"019 c #23231C", +"020 c #24231D", +"021 c #2A2925", +"022 c #2E2D27", +"023 c #202432", +"024 c #202434", +"025 c #2A2E3B", +"026 c #2E323F", +"027 c #33312C", +"028 c #32322E", +"029 c #37332F", +"030 c #383731", +"031 c #3C3C35", +"032 c #2E3240", +"033 c #313544", +"034 c #3C3F4E", +"035 c #3E414F", +"036 c #483F3C", +"037 c #474640", +"038 c #4D4C48", +"039 c #555450", +"040 c #575650", +"041 c #50535B", +"042 c #5D5353", +"043 c #5A5954", +"044 c #5A5E66", +"045 c #5B5F67", +"046 c #5A5E6B", +"047 c #625E5D", +"048 c #63625D", +"049 c #676660", +"050 c #6B6A64", +"051 c #6E6E6C", +"052 c #71706C", +"053 c #757573", +"054 c #777776", +"055 c #757987", +"056 c #FFA500", +"057 c #FDCA15", +"058 c #FFD900", +"059 c #FFE100", +"060 c #FFF600", +"061 c #FFFE00", +"062 c #FFF237", +"063 c #FFF63A", +"064 c #EEC143", +"065 c #FFE17A", +"066 c #818292", +"067 c #828695", +"068 c #878B9A", +"069 c #969593", +"070 c #9FA2B0", +"071 c #A2A39D", +"072 c #A9A9A5", +"073 c #AAA9A7", +"074 c #ABAAA5", +"075 c #A9ADBB", +"076 c #B5AFB3", +"077 c Gray71", +"078 c #BBBAB9", +"079 c #BCBBBB", +"080 c #B0B4C2", +"081 c #B3B6C4", +"082 c #B6BACA", +"083 c #B9BCCB", +"084 c #BDBFCA", +"085 c #ECD09C", +"086 c #F6CC82", +"087 c #FBD391", +"088 c #FDD39D", +"089 c #C3C3C3", +"090 c Gray78", +"091 c Gray81", +"092 c #C0C4D2", +"093 c #C3C5D5", +"094 c #C3C8D7", +"095 c #C5C8D6", +"096 c #CDCCD5", +"097 c #CCCFD7", +"098 c #D8D5D0", +"099 c #DADAD8", +"100 c #D7D8E3", +"101 c #D7DBE9", +"102 c #D9DCEE", +"103 c #DFE5F2", +"104 c #E2E2DE", +"105 c #E4E4E3", +"106 c #E7E7E8", +"107 c #EEEDEB", +"108 c #E0E4F3", +"109 c #E1E5F2", +"110 c #E2E6F4", +"111 c #E7EBF8", +"112 c #E9EDFC", +"113 c #ECEFFD", +"114 c #F0F5FF", +"115 c #F2F5FF", +"116 c #F3F6FF", +"117 c #F5F8FF", +"118 c #F8F7F3", +"119 c #FFFFF4", +"120 c #FBFFFF", +"121 c #FCFFFF", +"122 c #FDFFFF", +"123 c Gray100", +"124 c black", +"125 c black", +"126 c black", +"127 c black", +"128 c black", +"129 c black", +"130 c black", +"131 c black", +"132 c black", +"133 c black", +"134 c black", +"135 c black", +"136 c black", +"137 c black", +"138 c black", +"139 c black", +"140 c black", +"141 c black", +"142 c black", +"143 c black", +"144 c black", +"145 c black", +"146 c black", +"147 c black", +"148 c black", +"149 c black", +"150 c black", +"151 c black", +"152 c black", +"153 c black", +"154 c black", +"155 c black", +"156 c black", +"157 c black", +"158 c black", +"159 c black", +"160 c black", +"161 c black", +"162 c black", +"163 c black", +"164 c black", +"165 c black", +"166 c black", +"167 c black", +"168 c black", +"169 c black", +"170 c black", +"171 c black", +"172 c black", +"173 c black", +"174 c black", +"175 c black", +"176 c black", +"177 c black", +"178 c black", +"179 c black", +"180 c black", +"181 c black", +"182 c black", +"183 c black", +"184 c black", +"185 c black", +"186 c black", +"187 c black", +"188 c black", +"189 c black", +"190 c black", +"191 c black", +"192 c black", +"193 c black", +"194 c black", +"195 c black", +"196 c black", +"197 c black", +"198 c black", +"199 c black", +"200 c black", +"201 c black", +"202 c black", +"203 c black", +"204 c black", +"205 c black", +"206 c black", +"207 c black", +"208 c black", +"209 c black", +"210 c black", +"211 c black", +"212 c black", +"213 c black", +"214 c black", +"215 c black", +"216 c black", +"217 c black", +"218 c black", +"219 c black", +"220 c black", +"221 c black", +"222 c black", +"223 c black", +"224 c black", +"225 c black", +"226 c black", +"227 c black", +"228 c black", +"229 c black", +"230 c black", +"231 c black", +"232 c black", +"233 c black", +"234 c black", +"235 c black", +"236 c black", +"237 c black", +"238 c black", +"239 c black", +"240 c black", +"241 c black", +"242 c black", +"243 c black", +"244 c black", +"245 c black", +"246 c black", +"247 c black", +"248 c black", +"249 c black", +"250 c black", +"251 c black", +"252 c black", +"253 c black", +"254 c black", +"255 c black", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000123123000000000000123123000000000000123123000000000000123123000000", +"000000123123000000000000123123000000000000123123000000000000123123000000", +"000000123123000000000000123123000000000000123123000000000000123123000000", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"045041044097123123123123123123000000000000123123123123123123123123123123", +"033023024025108123123123123123000000000000123123123123123123123123099039", +"067026001001034123123123123123000000000000123123123123123123123079071030", +"083055035000000093123123123123000000000000123123123123123077021037074038", +"084075007000000046123123123123000000000000123123123123069106107018015013", +"076115092000000000082123123123000000000000123123123123105010017005053123", +"123123120081000000068123123123000000000000123123123123091028049052054073", +"123121116112032000080123123123000000000000123123123123090072104040098118", +"122117113110070066123123123123000000000000123123123123123047011027050048", +"115112109101095114123123123123000000000000123123123123123042014019022031", +"111103100096094123123123123123000000000000123123123123123036009012016020", +"102085087086088123123123123123000000000000123123123123123029003006008011", +"064062063058056119123123123123000000000000123123123123123078043004002004", +"057060061059065123123123123123000000000000123123123123123123123123089051", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000123123000000000000123123000000000000123123000000000000123123000000", +"000000123123000000000000123123000000000000123123000000000000123123000000", +"000000123123000000000000123123000000000000123123000000000000123123000000", +"000000000000000000000000000000000000000000000000000000000000000000000000" +}; diff --git a/avidemux/common/ADM_icons/tray/film9.xpm b/avidemux/common/ADM_icons/tray/film9.xpm index fb12cb20e7..4f175dff1a 100644 --- a/avidemux/common/ADM_icons/tray/film9.xpm +++ b/avidemux/common/ADM_icons/tray/film9.xpm @@ -1,284 +1,284 @@ -/* XPM */ -static const char *xpm_film9[] = { -"24 24 256 3", -"000 c black", -"001 c #010000", -"002 c #020100", -"003 c #030200", -"004 c #070601", -"005 c #070801", -"006 c #0B0A05", -"007 c #0D0C06", -"008 c #0E0D07", -"009 c #0F0D08", -"010 c #0F0E08", -"011 c #100F0A", -"012 c #12110B", -"013 c #13120C", -"014 c #14120D", -"015 c #14130D", -"016 c #15130F", -"017 c #151410", -"018 c #161710", -"019 c #181711", -"020 c #191812", -"021 c #1A1914", -"022 c #1B1A15", -"023 c #1C1B16", -"024 c #1D1C16", -"025 c #1E1D17", -"026 c #1F1E19", -"027 c #201E19", -"028 c #201F1A", -"029 c #20201A", -"030 c #23221C", -"031 c #23231C", -"032 c #23231D", -"033 c #24221C", -"034 c #24231D", -"035 c #24231F", -"036 c #25231F", -"037 c #25241E", -"038 c #25251F", -"039 c #282722", -"040 c #2A2925", -"041 c #2E2D27", -"042 c #322F2B", -"043 c #32312B", -"044 c #33312C", -"045 c #32322E", -"046 c #37332F", -"047 c #383731", -"048 c #3A3934", -"049 c #3C3C35", -"050 c #2E3240", -"051 c #3C3F4E", -"052 c #483F3C", -"053 c #474640", -"054 c #4C4B46", -"055 c #4D4C48", -"056 c #4F4E49", -"057 c #53524E", -"058 c #555450", -"059 c #575650", -"060 c #5D5353", -"061 c #5A5954", -"062 c #5A5E6B", -"063 c #625E5D", -"064 c #63625D", -"065 c #64625E", -"066 c #676660", -"067 c #6B6A64", -"068 c #6E6E6C", -"069 c #71706C", -"070 c #72726F", -"071 c #757573", -"072 c #777776", -"073 c #7C7C78", -"074 c #807D7D", -"075 c #81817A", -"076 c #82817F", -"077 c #FFA500", -"078 c #FFE17A", -"079 c #8D8C89", -"080 c #818292", -"081 c #878B9A", -"082 c #969593", -"083 c #9B9B98", -"084 c #9FA2B0", -"085 c #A2A39D", -"086 c #A6A3A2", -"087 c #A9A9A5", -"088 c #AAA9A7", -"089 c #ABAAA5", -"090 c #B6B5B0", -"091 c Gray71", -"092 c #BBBAB9", -"093 c #BCBBBB", -"094 c #B0B4C2", -"095 c #B6BACA", -"096 c #FDD39D", -"097 c #C3C3C3", -"098 c Gray78", -"099 c Gray81", -"100 c #C3C5D5", -"101 c #C3C8D7", -"102 c #C5C8D6", -"103 c #D4D3CE", -"104 c #D8D5D0", -"105 c #DAD8D4", -"106 c #DADAD8", -"107 c #E2E2DE", -"108 c #E4E4E3", -"109 c #E7E7E8", -"110 c #EBE9E3", -"111 c #EAE9EA", -"112 c #EEEDEB", -"113 c #E0E4F3", -"114 c #F0F5FF", -"115 c #F8F7F3", -"116 c #FFFFF4", -"117 c #FEFFFF", -"118 c Gray100", -"119 c black", -"120 c black", -"121 c black", -"122 c black", -"123 c black", -"124 c black", -"125 c black", -"126 c black", -"127 c black", -"128 c black", -"129 c black", -"130 c black", -"131 c black", -"132 c black", -"133 c black", -"134 c black", -"135 c black", -"136 c black", -"137 c black", -"138 c black", -"139 c black", -"140 c black", -"141 c black", -"142 c black", -"143 c black", -"144 c black", -"145 c black", -"146 c black", -"147 c black", -"148 c black", -"149 c black", -"150 c black", -"151 c black", -"152 c black", -"153 c black", -"154 c black", -"155 c black", -"156 c black", -"157 c black", -"158 c black", -"159 c black", -"160 c black", -"161 c black", -"162 c black", -"163 c black", -"164 c black", -"165 c black", -"166 c black", -"167 c black", -"168 c black", -"169 c black", -"170 c black", -"171 c black", -"172 c black", -"173 c black", -"174 c black", -"175 c black", -"176 c black", -"177 c black", -"178 c black", -"179 c black", -"180 c black", -"181 c black", -"182 c black", -"183 c black", -"184 c black", -"185 c black", -"186 c black", -"187 c black", -"188 c black", -"189 c black", -"190 c black", -"191 c black", -"192 c black", -"193 c black", -"194 c black", -"195 c black", -"196 c black", -"197 c black", -"198 c black", -"199 c black", -"200 c black", -"201 c black", -"202 c black", -"203 c black", -"204 c black", -"205 c black", -"206 c black", -"207 c black", -"208 c black", -"209 c black", -"210 c black", -"211 c black", -"212 c black", -"213 c black", -"214 c black", -"215 c black", -"216 c black", -"217 c black", -"218 c black", -"219 c black", -"220 c black", -"221 c black", -"222 c black", -"223 c black", -"224 c black", -"225 c black", -"226 c black", -"227 c black", -"228 c black", -"229 c black", -"230 c black", -"231 c black", -"232 c black", -"233 c black", -"234 c black", -"235 c black", -"236 c black", -"237 c black", -"238 c black", -"239 c black", -"240 c black", -"241 c black", -"242 c black", -"243 c black", -"244 c black", -"245 c black", -"246 c black", -"247 c black", -"248 c black", -"249 c black", -"250 c black", -"251 c black", -"252 c black", -"253 c black", -"254 c black", -"255 c black", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000000000118118000000000000118118000000000000118118000000000000118118", -"000000000000118118000000000000118118000000000000118118000000000000118118", -"000000000000118118000000000000118118000000000000118118000000000000118118", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"118118118118118118000000000000118118118118118118118118118118083023021033", -"113118118118118118000000000000118118118118118118118118106058118110054037", -"051118118118118118000000000000118118118118118118118093085047027056032015", -"000100118118118118000000000000118118118118118091040053089055032029070111", -"000062118118118118000000000000118118118118082109112028024020073117118118", -"000000095118118118000000000000118118118118108017026008071118118118118118", -"000000081118118118000000000000118118118118099045066069072088076074086079", -"050000094118118118000000000000118118118118098087107059104115075103105041", -"084080118118118118000000000000118118118118118063018044067064065090057043", -"102114118118118118000000000000118118118118118060022031041049048042039035", -"101118118118118118000000000000118118118118118052014019025034038030036022", -"096118118118118118000000000000118118118118118046005010013018015019016009", -"077116118118118118000000000000118118118118118092061007003007007006011002", -"078118118118118118000000000000118118118118118118118118097068012001004000", -"000000000000000000000000000000000000000000000000000000000000000000000000", -"000000000000118118000000000000118118000000000000118118000000000000118118", -"000000000000118118000000000000118118000000000000118118000000000000118118", -"000000000000118118000000000000118118000000000000118118000000000000118118", -"000000000000000000000000000000000000000000000000000000000000000000000000" -}; +/* XPM */ +static const char *xpm_film9[] = { +"24 24 256 3", +"000 c black", +"001 c #010000", +"002 c #020100", +"003 c #030200", +"004 c #070601", +"005 c #070801", +"006 c #0B0A05", +"007 c #0D0C06", +"008 c #0E0D07", +"009 c #0F0D08", +"010 c #0F0E08", +"011 c #100F0A", +"012 c #12110B", +"013 c #13120C", +"014 c #14120D", +"015 c #14130D", +"016 c #15130F", +"017 c #151410", +"018 c #161710", +"019 c #181711", +"020 c #191812", +"021 c #1A1914", +"022 c #1B1A15", +"023 c #1C1B16", +"024 c #1D1C16", +"025 c #1E1D17", +"026 c #1F1E19", +"027 c #201E19", +"028 c #201F1A", +"029 c #20201A", +"030 c #23221C", +"031 c #23231C", +"032 c #23231D", +"033 c #24221C", +"034 c #24231D", +"035 c #24231F", +"036 c #25231F", +"037 c #25241E", +"038 c #25251F", +"039 c #282722", +"040 c #2A2925", +"041 c #2E2D27", +"042 c #322F2B", +"043 c #32312B", +"044 c #33312C", +"045 c #32322E", +"046 c #37332F", +"047 c #383731", +"048 c #3A3934", +"049 c #3C3C35", +"050 c #2E3240", +"051 c #3C3F4E", +"052 c #483F3C", +"053 c #474640", +"054 c #4C4B46", +"055 c #4D4C48", +"056 c #4F4E49", +"057 c #53524E", +"058 c #555450", +"059 c #575650", +"060 c #5D5353", +"061 c #5A5954", +"062 c #5A5E6B", +"063 c #625E5D", +"064 c #63625D", +"065 c #64625E", +"066 c #676660", +"067 c #6B6A64", +"068 c #6E6E6C", +"069 c #71706C", +"070 c #72726F", +"071 c #757573", +"072 c #777776", +"073 c #7C7C78", +"074 c #807D7D", +"075 c #81817A", +"076 c #82817F", +"077 c #FFA500", +"078 c #FFE17A", +"079 c #8D8C89", +"080 c #818292", +"081 c #878B9A", +"082 c #969593", +"083 c #9B9B98", +"084 c #9FA2B0", +"085 c #A2A39D", +"086 c #A6A3A2", +"087 c #A9A9A5", +"088 c #AAA9A7", +"089 c #ABAAA5", +"090 c #B6B5B0", +"091 c Gray71", +"092 c #BBBAB9", +"093 c #BCBBBB", +"094 c #B0B4C2", +"095 c #B6BACA", +"096 c #FDD39D", +"097 c #C3C3C3", +"098 c Gray78", +"099 c Gray81", +"100 c #C3C5D5", +"101 c #C3C8D7", +"102 c #C5C8D6", +"103 c #D4D3CE", +"104 c #D8D5D0", +"105 c #DAD8D4", +"106 c #DADAD8", +"107 c #E2E2DE", +"108 c #E4E4E3", +"109 c #E7E7E8", +"110 c #EBE9E3", +"111 c #EAE9EA", +"112 c #EEEDEB", +"113 c #E0E4F3", +"114 c #F0F5FF", +"115 c #F8F7F3", +"116 c #FFFFF4", +"117 c #FEFFFF", +"118 c Gray100", +"119 c black", +"120 c black", +"121 c black", +"122 c black", +"123 c black", +"124 c black", +"125 c black", +"126 c black", +"127 c black", +"128 c black", +"129 c black", +"130 c black", +"131 c black", +"132 c black", +"133 c black", +"134 c black", +"135 c black", +"136 c black", +"137 c black", +"138 c black", +"139 c black", +"140 c black", +"141 c black", +"142 c black", +"143 c black", +"144 c black", +"145 c black", +"146 c black", +"147 c black", +"148 c black", +"149 c black", +"150 c black", +"151 c black", +"152 c black", +"153 c black", +"154 c black", +"155 c black", +"156 c black", +"157 c black", +"158 c black", +"159 c black", +"160 c black", +"161 c black", +"162 c black", +"163 c black", +"164 c black", +"165 c black", +"166 c black", +"167 c black", +"168 c black", +"169 c black", +"170 c black", +"171 c black", +"172 c black", +"173 c black", +"174 c black", +"175 c black", +"176 c black", +"177 c black", +"178 c black", +"179 c black", +"180 c black", +"181 c black", +"182 c black", +"183 c black", +"184 c black", +"185 c black", +"186 c black", +"187 c black", +"188 c black", +"189 c black", +"190 c black", +"191 c black", +"192 c black", +"193 c black", +"194 c black", +"195 c black", +"196 c black", +"197 c black", +"198 c black", +"199 c black", +"200 c black", +"201 c black", +"202 c black", +"203 c black", +"204 c black", +"205 c black", +"206 c black", +"207 c black", +"208 c black", +"209 c black", +"210 c black", +"211 c black", +"212 c black", +"213 c black", +"214 c black", +"215 c black", +"216 c black", +"217 c black", +"218 c black", +"219 c black", +"220 c black", +"221 c black", +"222 c black", +"223 c black", +"224 c black", +"225 c black", +"226 c black", +"227 c black", +"228 c black", +"229 c black", +"230 c black", +"231 c black", +"232 c black", +"233 c black", +"234 c black", +"235 c black", +"236 c black", +"237 c black", +"238 c black", +"239 c black", +"240 c black", +"241 c black", +"242 c black", +"243 c black", +"244 c black", +"245 c black", +"246 c black", +"247 c black", +"248 c black", +"249 c black", +"250 c black", +"251 c black", +"252 c black", +"253 c black", +"254 c black", +"255 c black", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000000000118118000000000000118118000000000000118118000000000000118118", +"000000000000118118000000000000118118000000000000118118000000000000118118", +"000000000000118118000000000000118118000000000000118118000000000000118118", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"118118118118118118000000000000118118118118118118118118118118083023021033", +"113118118118118118000000000000118118118118118118118118106058118110054037", +"051118118118118118000000000000118118118118118118118093085047027056032015", +"000100118118118118000000000000118118118118118091040053089055032029070111", +"000062118118118118000000000000118118118118082109112028024020073117118118", +"000000095118118118000000000000118118118118108017026008071118118118118118", +"000000081118118118000000000000118118118118099045066069072088076074086079", +"050000094118118118000000000000118118118118098087107059104115075103105041", +"084080118118118118000000000000118118118118118063018044067064065090057043", +"102114118118118118000000000000118118118118118060022031041049048042039035", +"101118118118118118000000000000118118118118118052014019025034038030036022", +"096118118118118118000000000000118118118118118046005010013018015019016009", +"077116118118118118000000000000118118118118118092061007003007007006011002", +"078118118118118118000000000000118118118118118118118118097068012001004000", +"000000000000000000000000000000000000000000000000000000000000000000000000", +"000000000000118118000000000000118118000000000000118118000000000000118118", +"000000000000118118000000000000118118000000000000118118000000000000118118", +"000000000000118118000000000000118118000000000000118118000000000000118118", +"000000000000000000000000000000000000000000000000000000000000000000000000" +}; diff --git a/avidemux/common/ADM_libraries/ADM_libsdl/CMakeLists.txt b/avidemux/common/ADM_libraries/ADM_libsdl/CMakeLists.txt index b777afaba7..39cefa0b77 100644 --- a/avidemux/common/ADM_libraries/ADM_libsdl/CMakeLists.txt +++ b/avidemux/common/ADM_libraries/ADM_libsdl/CMakeLists.txt @@ -1,6 +1,6 @@ -SET(ADM_LIB ADM_libsdl) -SET(${ADM_LIB}_SRCS SDLmain.m) - -SDLify(SDLmain.m) - -ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) +SET(ADM_LIB ADM_libsdl) +SET(${ADM_LIB}_SRCS SDLmain.m) + +SDLify(SDLmain.m) + +ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) diff --git a/avidemux/common/ADM_libraries/CMakeLists.txt b/avidemux/common/ADM_libraries/CMakeLists.txt index 4a71d008f7..542a9c8c44 100644 --- a/avidemux/common/ADM_libraries/CMakeLists.txt +++ b/avidemux/common/ADM_libraries/CMakeLists.txt @@ -1,3 +1,3 @@ -if (APPLE AND USE_SDL) - subdirs (PREORDER ADM_libsdl) -endif (APPLE AND USE_SDL) +if (APPLE AND USE_SDL) + subdirs (PREORDER ADM_libsdl) +endif (APPLE AND USE_SDL) diff --git a/avidemux/common/ADM_render/CMakeLists.txt b/avidemux/common/ADM_render/CMakeLists.txt index f525130305..ec52f5f689 100644 --- a/avidemux/common/ADM_render/CMakeLists.txt +++ b/avidemux/common/ADM_render/CMakeLists.txt @@ -1,84 +1,84 @@ -include(admOpenGl) - -IF(QT_LIBRARY_EXTENSION) - SET(ADM_LIB ADM_render6_${QT_LIBRARY_EXTENSION}) - SET(SIMPLE_RENDER GUI_simpleRender.cpp) -ELSE(QT_LIBRARY_EXTENSION) - SET(ADM_LIB ADM_render6_${UI_SUFFIX}) - SET(SIMPLE_RENDER GUI_simpleRenderStub.cpp) -ENDIF(QT_LIBRARY_EXTENSION) - -SET(${ADM_LIB}_SRCS -GUI_render.cpp -${SIMPLE_RENDER} -) -IF(USE_DXVA2)# AND NOT MSVC) -# TEMPORARY - ADD_SUBDIRECTORY(ADM_coreDxva2) - INCLUDE_DIRECTORIES(ADM_coreDxva2/include) -ENDIF(USE_DXVA2)# AND NOT MSVC) - - -IF(NOT ${UI_SUFFIX} STREQUAL "cli") - IF (USE_OPENGL) - INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ADM_openGL/include/) - SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_qtGlRender.cpp) - ENDIF (USE_OPENGL) - - IF (APPLE) - IF(USE_SDL) - SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_sdlRenderHelper.m) - ENDIF(USE_SDL) - ENDIF (APPLE) - IF (USE_XV) - SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_xvRender.cpp) - ENDIF (USE_XV) - IF (USE_SDL) - SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_sdlRender.cpp) - ENDIF (USE_SDL) - IF (USE_VDPAU) - ADD_CORE_INCLUDE(ADM_coreVdpau) - SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_vdpauRender.cpp) - ENDIF (USE_VDPAU) - IF (USE_DXVA2) - ADD_CORE_INCLUDE(ADM_coreDxva2) - SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_dxva2Render.cpp) - ENDIF (USE_DXVA2) - IF (USE_LIBVA) - ADD_CORE_INCLUDE(ADM_coreLibVA) - SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_libvaRender.cpp) - ENDIF (USE_LIBVA) -ENDIF() # Not cli - -ADD_LIBRARY(${ADM_LIB} SHARED ${${ADM_LIB}_SRCS}) -TARGET_LINK_LIBRARIES( ${ADM_LIB} ADM_core6 ADM_coreUI6 ADM_coreImage6) - -ADM_OPEN_GL(${ADM_LIB}) - -SDLify(GUI_sdlRender.cpp) - -IF (GETTEXT_FOUND) - TARGET_LINK_LIBRARIES(${ADM_LIB} ${GETTEXT_LIBRARY_DIR}) -ENDIF (GETTEXT_FOUND) - -IF (USE_SDL) - TARGET_LINK_LIBRARIES(${ADM_LIB} ${SDL2_LIBRARY}) -ENDIF (USE_SDL) - -IF (USE_VDPAU) - TARGET_LINK_LIBRARIES(${ADM_LIB} ADM_coreVDPAU6) -ENDIF (USE_VDPAU) -IF (USE_DXVA2) - TARGET_LINK_LIBRARIES(${ADM_LIB} ADM_coreDxva26) -ENDIF (USE_DXVA2) - -IF (USE_XV) - TARGET_LINK_LIBRARIES(${ADM_LIB} ${XVIDEO_LIBRARY_DIR} ${XEXT_LIBRARY_DIR}) -ENDIF (USE_XV) -TARGET_LINK_LIBRARIES(${ADM_LIB} ADM_coreUtils6) - -IF(QT_LIBRARY_EXTENSION) - TARGET_LINK_LIBRARIES(${ADM_LIB} ${QT_QTGUI_LIBRARY}) -ENDIF(QT_LIBRARY_EXTENSION) - -ADM_INSTALL_LIB(${ADM_LIB}) +include(admOpenGl) + +IF(QT_LIBRARY_EXTENSION) + SET(ADM_LIB ADM_render6_${QT_LIBRARY_EXTENSION}) + SET(SIMPLE_RENDER GUI_simpleRender.cpp) +ELSE(QT_LIBRARY_EXTENSION) + SET(ADM_LIB ADM_render6_${UI_SUFFIX}) + SET(SIMPLE_RENDER GUI_simpleRenderStub.cpp) +ENDIF(QT_LIBRARY_EXTENSION) + +SET(${ADM_LIB}_SRCS +GUI_render.cpp +${SIMPLE_RENDER} +) +IF(USE_DXVA2)# AND NOT MSVC) +# TEMPORARY + ADD_SUBDIRECTORY(ADM_coreDxva2) + INCLUDE_DIRECTORIES(ADM_coreDxva2/include) +ENDIF(USE_DXVA2)# AND NOT MSVC) + + +IF(NOT ${UI_SUFFIX} STREQUAL "cli") + IF (USE_OPENGL) + INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ADM_openGL/include/) + SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_qtGlRender.cpp) + ENDIF (USE_OPENGL) + + IF (APPLE) + IF(USE_SDL) + SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_sdlRenderHelper.m) + ENDIF(USE_SDL) + ENDIF (APPLE) + IF (USE_XV) + SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_xvRender.cpp) + ENDIF (USE_XV) + IF (USE_SDL) + SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_sdlRender.cpp) + ENDIF (USE_SDL) + IF (USE_VDPAU) + ADD_CORE_INCLUDE(ADM_coreVdpau) + SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_vdpauRender.cpp) + ENDIF (USE_VDPAU) + IF (USE_DXVA2) + ADD_CORE_INCLUDE(ADM_coreDxva2) + SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_dxva2Render.cpp) + ENDIF (USE_DXVA2) + IF (USE_LIBVA) + ADD_CORE_INCLUDE(ADM_coreLibVA) + SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_libvaRender.cpp) + ENDIF (USE_LIBVA) +ENDIF() # Not cli + +ADD_LIBRARY(${ADM_LIB} SHARED ${${ADM_LIB}_SRCS}) +TARGET_LINK_LIBRARIES( ${ADM_LIB} ADM_core6 ADM_coreUI6 ADM_coreImage6) + +ADM_OPEN_GL(${ADM_LIB}) + +SDLify(GUI_sdlRender.cpp) + +IF (GETTEXT_FOUND) + TARGET_LINK_LIBRARIES(${ADM_LIB} ${GETTEXT_LIBRARY_DIR}) +ENDIF (GETTEXT_FOUND) + +IF (USE_SDL) + TARGET_LINK_LIBRARIES(${ADM_LIB} ${SDL2_LIBRARY}) +ENDIF (USE_SDL) + +IF (USE_VDPAU) + TARGET_LINK_LIBRARIES(${ADM_LIB} ADM_coreVDPAU6) +ENDIF (USE_VDPAU) +IF (USE_DXVA2) + TARGET_LINK_LIBRARIES(${ADM_LIB} ADM_coreDxva26) +ENDIF (USE_DXVA2) + +IF (USE_XV) + TARGET_LINK_LIBRARIES(${ADM_LIB} ${XVIDEO_LIBRARY_DIR} ${XEXT_LIBRARY_DIR}) +ENDIF (USE_XV) +TARGET_LINK_LIBRARIES(${ADM_LIB} ADM_coreUtils6) + +IF(QT_LIBRARY_EXTENSION) + TARGET_LINK_LIBRARIES(${ADM_LIB} ${QT_QTGUI_LIBRARY}) +ENDIF(QT_LIBRARY_EXTENSION) + +ADM_INSTALL_LIB(${ADM_LIB}) diff --git a/avidemux/common/ADM_render/GUI_sdlRenderHelper.m b/avidemux/common/ADM_render/GUI_sdlRenderHelper.m index 9da4d97505..375079bed0 100644 --- a/avidemux/common/ADM_render/GUI_sdlRenderHelper.m +++ b/avidemux/common/ADM_render/GUI_sdlRenderHelper.m @@ -1,139 +1,139 @@ -#import -#import - -static NSWindow* nsParentWindow = nil; -static NSWindow* nsWindow = nil; -static NSView* nsView = nil; -static bool cocoaApplication = false; -static id oldDelegate = nil; -static int widgetX = 0, widgetY = 0; - -@interface SdlCocoaWindow : NSWindow -- (void)windowDidMove:(id)notification; -- (void)windowWillMiniaturize:(NSNotification *)notification; -- (void)windowDidDeminiaturize:(NSNotification *)notification; -@end - -@implementation SdlCocoaWindow -- (void)windowDidMove:(id)notification -{ - NSRect parentFrame = [nsParentWindow frame]; - NSPoint point = NSMakePoint(parentFrame.origin.x + widgetX, parentFrame.origin.y + widgetY); - - [self setFrameOrigin:point]; -} - -- (void)windowWillMiniaturize:(NSNotification *)notification -{ - [self setIsVisible:NO]; -} - -- (void)windowDidDeminiaturize:(NSNotification *)notification -{ - [self setIsVisible:YES]; -} -@end - -void initSdlCocoaView(void* parent, int x, int y, int width, int height, bool carbonParent) -{ - printf("[SDL] Creating Cocoa view x: %d, y: %d, width: %d, height %d, carbon %d\n", x, y, width, height, carbonParent); - - NSRect contentRect; - - if (carbonParent) - { - contentRect = NSMakeRect(x, y, width, height); - - if (!nsWindow) - { - // initWithWindowRef always returns the same result for the same WindowRef - nsWindow = [[NSWindow alloc] initWithWindowRef:(WindowRef)parent]; - - [nsWindow setContentView:[[[NSView alloc] initWithFrame:contentRect] autorelease]]; - } - } - else - { - contentRect = NSMakeRect(0, 0, width, height); - - if (!nsWindow) - { - nsWindow = [[SdlCocoaWindow alloc] initWithContentRect:contentRect styleMask:NSDocModalWindowMask backing:NSBackingStoreBuffered defer:NO]; - - nsParentWindow = (NSWindow*)parent; - widgetX = x; - widgetY = y; - oldDelegate = [nsParentWindow delegate]; - cocoaApplication = true; - - [nsWindow setLevel:NSFloatingWindowLevel]; - [nsWindow setHasShadow:NO]; - - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - - [nc addObserver:nsWindow selector:@selector(windowDidMove:) name:NSWindowDidMoveNotification object:nsParentWindow]; - [nc addObserver:nsWindow selector:@selector(windowWillMiniaturize:) name:NSWindowWillMiniaturizeNotification object:nsParentWindow]; - [nc addObserver:nsWindow selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:nsParentWindow]; - } - } - - if (!nsView) - { - nsView = [[NSView alloc] initWithFrame:contentRect]; - - [[nsWindow contentView] addSubview:nsView]; - [nsView release]; - - if (carbonParent) - [nsWindow orderOut:nil]; // very important, otherwise window won't be placed correctly on repeat showings - else - { - NSRect parentFrame = [nsParentWindow frame]; - NSPoint point = NSMakePoint(parentFrame.origin.x + x, parentFrame.origin.y + y); - - [nsWindow setFrameOrigin:point]; - } - - [nsWindow orderFront:nil]; - } - else - { - [nsView setFrame:contentRect]; - [[nsWindow contentView] setFrame:contentRect]; - } - - // finally, set SDL environment variables with all this nonsense - char SDL_windowhack[50]; - - sprintf(SDL_windowhack,"SDL_NSWindowPointer=%ld",(int)nsWindow); - putenv(SDL_windowhack); - - sprintf(SDL_windowhack,"SDL_NSViewPointer=%ld",(int)nsView); - putenv(SDL_windowhack); -} - -void destroyCocoaView(void) -{ - if (cocoaApplication) - { - [nsParentWindow setDelegate:oldDelegate]; - - // we're using a floating panel so it doesn't automatically get destroyed - [nsWindow release]; - - nsWindow = nil; - nsView = nil; - oldDelegate = nil; - } - else if (nsWindow) - { - // Reference count cannot fall below 2 because SDL releases the window when closing - // and again when reinitialising (even though this is our own window...). - if ([nsWindow retainCount] > 2) - [nsWindow release]; - - // SDL takes care of all the destroying...a little too much, so make sure our Carbon - // window is still displayed (via its Cocoa wrapper) - [nsWindow makeKeyAndOrderFront:nil]; - } -} +#import +#import + +static NSWindow* nsParentWindow = nil; +static NSWindow* nsWindow = nil; +static NSView* nsView = nil; +static bool cocoaApplication = false; +static id oldDelegate = nil; +static int widgetX = 0, widgetY = 0; + +@interface SdlCocoaWindow : NSWindow +- (void)windowDidMove:(id)notification; +- (void)windowWillMiniaturize:(NSNotification *)notification; +- (void)windowDidDeminiaturize:(NSNotification *)notification; +@end + +@implementation SdlCocoaWindow +- (void)windowDidMove:(id)notification +{ + NSRect parentFrame = [nsParentWindow frame]; + NSPoint point = NSMakePoint(parentFrame.origin.x + widgetX, parentFrame.origin.y + widgetY); + + [self setFrameOrigin:point]; +} + +- (void)windowWillMiniaturize:(NSNotification *)notification +{ + [self setIsVisible:NO]; +} + +- (void)windowDidDeminiaturize:(NSNotification *)notification +{ + [self setIsVisible:YES]; +} +@end + +void initSdlCocoaView(void* parent, int x, int y, int width, int height, bool carbonParent) +{ + printf("[SDL] Creating Cocoa view x: %d, y: %d, width: %d, height %d, carbon %d\n", x, y, width, height, carbonParent); + + NSRect contentRect; + + if (carbonParent) + { + contentRect = NSMakeRect(x, y, width, height); + + if (!nsWindow) + { + // initWithWindowRef always returns the same result for the same WindowRef + nsWindow = [[NSWindow alloc] initWithWindowRef:(WindowRef)parent]; + + [nsWindow setContentView:[[[NSView alloc] initWithFrame:contentRect] autorelease]]; + } + } + else + { + contentRect = NSMakeRect(0, 0, width, height); + + if (!nsWindow) + { + nsWindow = [[SdlCocoaWindow alloc] initWithContentRect:contentRect styleMask:NSDocModalWindowMask backing:NSBackingStoreBuffered defer:NO]; + + nsParentWindow = (NSWindow*)parent; + widgetX = x; + widgetY = y; + oldDelegate = [nsParentWindow delegate]; + cocoaApplication = true; + + [nsWindow setLevel:NSFloatingWindowLevel]; + [nsWindow setHasShadow:NO]; + + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; + + [nc addObserver:nsWindow selector:@selector(windowDidMove:) name:NSWindowDidMoveNotification object:nsParentWindow]; + [nc addObserver:nsWindow selector:@selector(windowWillMiniaturize:) name:NSWindowWillMiniaturizeNotification object:nsParentWindow]; + [nc addObserver:nsWindow selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:nsParentWindow]; + } + } + + if (!nsView) + { + nsView = [[NSView alloc] initWithFrame:contentRect]; + + [[nsWindow contentView] addSubview:nsView]; + [nsView release]; + + if (carbonParent) + [nsWindow orderOut:nil]; // very important, otherwise window won't be placed correctly on repeat showings + else + { + NSRect parentFrame = [nsParentWindow frame]; + NSPoint point = NSMakePoint(parentFrame.origin.x + x, parentFrame.origin.y + y); + + [nsWindow setFrameOrigin:point]; + } + + [nsWindow orderFront:nil]; + } + else + { + [nsView setFrame:contentRect]; + [[nsWindow contentView] setFrame:contentRect]; + } + + // finally, set SDL environment variables with all this nonsense + char SDL_windowhack[50]; + + sprintf(SDL_windowhack,"SDL_NSWindowPointer=%ld",(int)nsWindow); + putenv(SDL_windowhack); + + sprintf(SDL_windowhack,"SDL_NSViewPointer=%ld",(int)nsView); + putenv(SDL_windowhack); +} + +void destroyCocoaView(void) +{ + if (cocoaApplication) + { + [nsParentWindow setDelegate:oldDelegate]; + + // we're using a floating panel so it doesn't automatically get destroyed + [nsWindow release]; + + nsWindow = nil; + nsView = nil; + oldDelegate = nil; + } + else if (nsWindow) + { + // Reference count cannot fall below 2 because SDL releases the window when closing + // and again when reinitialising (even though this is our own window...). + if ([nsWindow retainCount] > 2) + [nsWindow release]; + + // SDL takes care of all the destroying...a little too much, so make sure our Carbon + // window is still displayed (via its Cocoa wrapper) + [nsWindow makeKeyAndOrderFront:nil]; + } +} diff --git a/avidemux/common/ADM_script2/CMakeLists.txt b/avidemux/common/ADM_script2/CMakeLists.txt index d614970a86..83c1106ec3 100644 --- a/avidemux/common/ADM_script2/CMakeLists.txt +++ b/avidemux/common/ADM_script2/CMakeLists.txt @@ -1 +1 @@ -subdirs (src) +subdirs (src) diff --git a/avidemux/common/ADM_videoCodec/CMakeLists.txt b/avidemux/common/ADM_videoCodec/CMakeLists.txt index d614970a86..83c1106ec3 100644 --- a/avidemux/common/ADM_videoCodec/CMakeLists.txt +++ b/avidemux/common/ADM_videoCodec/CMakeLists.txt @@ -1 +1 @@ -subdirs (src) +subdirs (src) diff --git a/avidemux/gtk/ADM_UIs/src/CMakeLists.txt b/avidemux/gtk/ADM_UIs/src/CMakeLists.txt index 9f2b57e31e..6e1932fd8e 100644 --- a/avidemux/gtk/ADM_UIs/src/CMakeLists.txt +++ b/avidemux/gtk/ADM_UIs/src/CMakeLists.txt @@ -1,31 +1,31 @@ -SET(ADM_LIB ADM_UIGtk6) - -SET(${ADM_LIB}_SRCS - DIA_color.cpp - DIA_filesel.cpp - DIA_dialogFactory.cpp - FAC_bitrate.cpp - FAC_float.cpp - FAC_hex.cpp - FAC_menu.cpp - FAC_readOnlyText.cpp - FAC_bar.cpp - FAC_button.cpp - FAC_frame.cpp - FAC_integer.cpp - FAC_notch.cpp - FAC_toggle.cpp - FAC_threadCount.cpp - FAC_slider.cpp - FAC_matrix.cpp - FAC_timeStamp.cpp - choice.cpp - toolkit_dialog.cpp - toolkit.cpp - DIA_flyDialogGtk.cpp -) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include) -ADD_LIBRARY(${ADM_LIB} SHARED ${${ADM_LIB}_SRCS}) -TARGET_LINK_LIBRARIES(${ADM_LIB} ${GTK_LDFLAGS} ADM_core6 ADM_coreUI6 ADM_render6_gtk ADM_coreVideoFilter6) -ADD_TARGET_CFLAGS(${ADM_LIB} ${GTK_CFLAGS}) -ADM_INSTALL_LIB( ${ADM_LIB} ) +SET(ADM_LIB ADM_UIGtk6) + +SET(${ADM_LIB}_SRCS + DIA_color.cpp + DIA_filesel.cpp + DIA_dialogFactory.cpp + FAC_bitrate.cpp + FAC_float.cpp + FAC_hex.cpp + FAC_menu.cpp + FAC_readOnlyText.cpp + FAC_bar.cpp + FAC_button.cpp + FAC_frame.cpp + FAC_integer.cpp + FAC_notch.cpp + FAC_toggle.cpp + FAC_threadCount.cpp + FAC_slider.cpp + FAC_matrix.cpp + FAC_timeStamp.cpp + choice.cpp + toolkit_dialog.cpp + toolkit.cpp + DIA_flyDialogGtk.cpp +) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include) +ADD_LIBRARY(${ADM_LIB} SHARED ${${ADM_LIB}_SRCS}) +TARGET_LINK_LIBRARIES(${ADM_LIB} ${GTK_LDFLAGS} ADM_core6 ADM_coreUI6 ADM_render6_gtk ADM_coreVideoFilter6) +ADD_TARGET_CFLAGS(${ADM_LIB} ${GTK_CFLAGS}) +ADM_INSTALL_LIB( ${ADM_LIB} ) diff --git a/avidemux/gtk/ADM_userInterfaces/ADM_dialog/CMakeLists.txt b/avidemux/gtk/ADM_userInterfaces/ADM_dialog/CMakeLists.txt index 3dbd22640b..195bae1035 100644 --- a/avidemux/gtk/ADM_userInterfaces/ADM_dialog/CMakeLists.txt +++ b/avidemux/gtk/ADM_userInterfaces/ADM_dialog/CMakeLists.txt @@ -1,41 +1,41 @@ -SET(ADM_LIB ADM_dialogGtk) - -SET(${ADM_LIB}_SRCS -DIA_about.cpp - DIA_calculator.cpp - DIA_preview.cpp - DIA_xvid4.cpp - DIA_encoding.cpp - DIA_ocr.cpp - DIA_properties.cpp - DIA_xvid.cpp - DIA_idx_pg.cpp - #DIA_partial.cpp - DIA_quota.cpp - DIA_vobsub.cpp - DIA_jobs.cpp - DIA_working.cpp - DIA_busy.cpp - toolkit_dialog.cpp - TLK_filesel.cpp - DIA_audioTracks.cpp -) -SET(OBSOLETE_SRCS - DIA_exLame.cpp - DIA_pipe.cpp - DIA_threshold.cpp - DIA_SwissArmyKnife.cpp - DIA_particle.cpp - DIA_eraser.cpp - - DIA_hue.cpp - DIA_srt.cpp - DIA_crop.cpp -DIA_eq2.cpp -DIA_asharp.cpp - DIA_contrast.cpp - - -) -ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) -ADD_DEFINITIONS( -DADM_SUBVERSION=\"${ADM_SUBVERSION}\") +SET(ADM_LIB ADM_dialogGtk) + +SET(${ADM_LIB}_SRCS +DIA_about.cpp + DIA_calculator.cpp + DIA_preview.cpp + DIA_xvid4.cpp + DIA_encoding.cpp + DIA_ocr.cpp + DIA_properties.cpp + DIA_xvid.cpp + DIA_idx_pg.cpp + #DIA_partial.cpp + DIA_quota.cpp + DIA_vobsub.cpp + DIA_jobs.cpp + DIA_working.cpp + DIA_busy.cpp + toolkit_dialog.cpp + TLK_filesel.cpp + DIA_audioTracks.cpp +) +SET(OBSOLETE_SRCS + DIA_exLame.cpp + DIA_pipe.cpp + DIA_threshold.cpp + DIA_SwissArmyKnife.cpp + DIA_particle.cpp + DIA_eraser.cpp + + DIA_hue.cpp + DIA_srt.cpp + DIA_crop.cpp +DIA_eq2.cpp +DIA_asharp.cpp + DIA_contrast.cpp + + +) +ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) +ADD_DEFINITIONS( -DADM_SUBVERSION=\"${ADM_SUBVERSION}\") diff --git a/avidemux/gtk/ADM_userInterfaces/ADM_filters/CMakeLists.txt b/avidemux/gtk/ADM_userInterfaces/ADM_filters/CMakeLists.txt index 6dceafcee8..c9bfa31433 100644 --- a/avidemux/gtk/ADM_userInterfaces/ADM_filters/CMakeLists.txt +++ b/avidemux/gtk/ADM_userInterfaces/ADM_filters/CMakeLists.txt @@ -1,9 +1,9 @@ -SET(ADM_LIB ADM_filtersGtk) - -SET(${ADM_LIB}_SRCS - gui_filtermanager.cpp -) - -ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) -FILE(GLOB ADM_filterIcons ${AVIDEMUX_TOP_SOURCE_DIR}/avidemux/common/ADM_icons/videoFilter/*.png) -INSTALL(FILES videoFilter.gtkBuilder ${ADM_filterIcons} DESTINATION "${AVIDEMUX_LIB_DIR}/ADM_glade/videoFilter") +SET(ADM_LIB ADM_filtersGtk) + +SET(${ADM_LIB}_SRCS + gui_filtermanager.cpp +) + +ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) +FILE(GLOB ADM_filterIcons ${AVIDEMUX_TOP_SOURCE_DIR}/avidemux/common/ADM_icons/videoFilter/*.png) +INSTALL(FILES videoFilter.gtkBuilder ${ADM_filterIcons} DESTINATION "${AVIDEMUX_LIB_DIR}/ADM_glade/videoFilter") diff --git a/avidemux/gtk/ADM_userInterfaces/ADM_gui2/CMakeLists.txt b/avidemux/gtk/ADM_userInterfaces/ADM_gui2/CMakeLists.txt index 1c9734739e..b3f25ef7fb 100644 --- a/avidemux/gtk/ADM_userInterfaces/ADM_gui2/CMakeLists.txt +++ b/avidemux/gtk/ADM_userInterfaces/ADM_gui2/CMakeLists.txt @@ -1,10 +1,10 @@ -SET(ADM_LIB ADM_gui2Gtk) - -SET(${ADM_LIB}_SRCS - GUI_bindings.cpp GUI_gtkRender.cpp GUI_keymap.cpp ) - -IF (APPLE) - SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_gtkRenderHelper.m) -ENDIF (APPLE) - -ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) +SET(ADM_LIB ADM_gui2Gtk) + +SET(${ADM_LIB}_SRCS + GUI_bindings.cpp GUI_gtkRender.cpp GUI_keymap.cpp ) + +IF (APPLE) + SET(${ADM_LIB}_SRCS ${${ADM_LIB}_SRCS} GUI_gtkRenderHelper.m) +ENDIF (APPLE) + +ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) diff --git a/avidemux/gtk/ADM_userInterfaces/ADM_gui2/GUI_gtkRenderHelper.m b/avidemux/gtk/ADM_userInterfaces/ADM_gui2/GUI_gtkRenderHelper.m index 2152fc1fba..cf548a1820 100644 --- a/avidemux/gtk/ADM_userInterfaces/ADM_gui2/GUI_gtkRenderHelper.m +++ b/avidemux/gtk/ADM_userInterfaces/ADM_gui2/GUI_gtkRenderHelper.m @@ -1,19 +1,19 @@ -#import - -int getMainNSWindow(void) -{ - NSEnumerator *enumerator = [[NSApp windows] objectEnumerator]; - id nsWindow; - id mainWindow = 0; - - while ((nsWindow = [enumerator nextObject])) - { - if ([[nsWindow title] hasSuffix:@"Avidemux"]) - { - mainWindow = nsWindow; - break; - } - } - - return (int)mainWindow; +#import + +int getMainNSWindow(void) +{ + NSEnumerator *enumerator = [[NSApp windows] objectEnumerator]; + id nsWindow; + id mainWindow = 0; + + while ((nsWindow = [enumerator nextObject])) + { + if ([[nsWindow title] hasSuffix:@"Avidemux"]) + { + mainWindow = nsWindow; + break; + } + } + + return (int)mainWindow; } \ No newline at end of file diff --git a/avidemux/gtk/ADM_userInterfaces/ADM_ocr/CMakeLists.txt b/avidemux/gtk/ADM_userInterfaces/ADM_ocr/CMakeLists.txt index d14f4c81d9..04a61d7078 100644 --- a/avidemux/gtk/ADM_userInterfaces/ADM_ocr/CMakeLists.txt +++ b/avidemux/gtk/ADM_userInterfaces/ADM_ocr/CMakeLists.txt @@ -1,7 +1,7 @@ -SET(ADM_LIB ADM_ocrGtk) - -SET(${ADM_LIB}_SRCS - adm_ocr.cpp - adm_editglyph.cpp) - -ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) +SET(ADM_LIB ADM_ocrGtk) + +SET(${ADM_LIB}_SRCS + adm_ocr.cpp + adm_editglyph.cpp) + +ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) diff --git a/avidemux/gtk/ADM_userInterfaces/ADM_toolkit_gtk/CMakeLists.txt b/avidemux/gtk/ADM_userInterfaces/ADM_toolkit_gtk/CMakeLists.txt index 0db180b252..df5ff47642 100644 --- a/avidemux/gtk/ADM_userInterfaces/ADM_toolkit_gtk/CMakeLists.txt +++ b/avidemux/gtk/ADM_userInterfaces/ADM_toolkit_gtk/CMakeLists.txt @@ -1,13 +1,13 @@ -SET(ADM_LIB ADM_toolkitGtk) - -SET(${ADM_LIB}_SRCS - ADM_tray_gtk.cpp - gtkmarkscale.c jogshuttle.c ADM_jogshuttle.cpp mediactrl.c - GUI_glade.cpp -) - -ADD_DEFINITIONS(-DTARGET_DIR="${AVIDEMUX_LIB_DIR}/ADM_glade/" -DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}") -ADD_LIBRARY(${ADM_LIB} SHARED ${${ADM_LIB}_SRCS}) -TARGET_LINK_LIBRARIES(${ADM_LIB} ${GTK_LDFLAGS} ADM_toolkitGtk) -ADD_TARGET_CFLAGS(${ADM_LIB} ${GTK_CFLAGS}) +SET(ADM_LIB ADM_toolkitGtk) + +SET(${ADM_LIB}_SRCS + ADM_tray_gtk.cpp + gtkmarkscale.c jogshuttle.c ADM_jogshuttle.cpp mediactrl.c + GUI_glade.cpp +) + +ADD_DEFINITIONS(-DTARGET_DIR="${AVIDEMUX_LIB_DIR}/ADM_glade/" -DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}") +ADD_LIBRARY(${ADM_LIB} SHARED ${${ADM_LIB}_SRCS}) +TARGET_LINK_LIBRARIES(${ADM_LIB} ${GTK_LDFLAGS} ADM_toolkitGtk) +ADD_TARGET_CFLAGS(${ADM_LIB} ${GTK_CFLAGS}) ADM_INSTALL_LIB(${ADM_LIB}) \ No newline at end of file diff --git a/avidemux/gtk/ADM_userInterfaces/glade/CMakeLists.txt b/avidemux/gtk/ADM_userInterfaces/glade/CMakeLists.txt index 79606dad9b..5f59db6666 100644 --- a/avidemux/gtk/ADM_userInterfaces/glade/CMakeLists.txt +++ b/avidemux/gtk/ADM_userInterfaces/glade/CMakeLists.txt @@ -1,11 +1,11 @@ -ADD_SUBDIRECTORY(main) -# Install glade file into FOO/lib/ADM_glade/ -set(ADM_glade -about.gtkBuilder -calculator.gtkBuilder -DIA_alternate.gtkBuilder -encoding.gtkBuilder -properties.gtkBuilder -${AVIDEMUX_TOP_SOURCE_DIR}/avidemux_icon.png -) -INSTALL(FILES ${ADM_glade} DESTINATION "${AVIDEMUX_LIB_DIR}/ADM_glade/") +ADD_SUBDIRECTORY(main) +# Install glade file into FOO/lib/ADM_glade/ +set(ADM_glade +about.gtkBuilder +calculator.gtkBuilder +DIA_alternate.gtkBuilder +encoding.gtkBuilder +properties.gtkBuilder +${AVIDEMUX_TOP_SOURCE_DIR}/avidemux_icon.png +) +INSTALL(FILES ${ADM_glade} DESTINATION "${AVIDEMUX_LIB_DIR}/ADM_glade/") diff --git a/avidemux/gtk/ADM_userInterfaces/glade/main/CMakeLists.txt b/avidemux/gtk/ADM_userInterfaces/glade/main/CMakeLists.txt index 87aba05a4a..c08d2ece38 100644 --- a/avidemux/gtk/ADM_userInterfaces/glade/main/CMakeLists.txt +++ b/avidemux/gtk/ADM_userInterfaces/glade/main/CMakeLists.txt @@ -1,8 +1,8 @@ -# Install glade file into FOO/lib/ADM_glade/ -set(ADM_glade -gtk2_build.gtkBuilder -avidemux_icon_small.png -) - -FILE(GLOB ADM_icons ${AVIDEMUX_TOP_SOURCE_DIR}/avidemux/common/ADM_icons/*.png) -INSTALL(FILES ${ADM_glade} ${ADM_icons} DESTINATION "${AVIDEMUX_LIB_DIR}/ADM_glade/main") +# Install glade file into FOO/lib/ADM_glade/ +set(ADM_glade +gtk2_build.gtkBuilder +avidemux_icon_small.png +) + +FILE(GLOB ADM_icons ${AVIDEMUX_TOP_SOURCE_DIR}/avidemux/common/ADM_icons/*.png) +INSTALL(FILES ${ADM_glade} ${ADM_icons} DESTINATION "${AVIDEMUX_LIB_DIR}/ADM_glade/main") diff --git a/avidemux/gtk/ADM_userInterfaces/glade/old/project_newencoding.glade b/avidemux/gtk/ADM_userInterfaces/glade/old/project_newencoding.glade index 017ed175dc..725469bf67 100644 --- a/avidemux/gtk/ADM_userInterfaces/glade/old/project_newencoding.glade +++ b/avidemux/gtk/ADM_userInterfaces/glade/old/project_newencoding.glade @@ -1,1275 +1,1275 @@ - - - - - - - 12 - 500 - True - Encoding... - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER_ON_PARENT - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - True - 2 - 2 - False - 12 - 12 - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 10 - 10 - 12 - 12 - - - - True - 4 - 2 - False - 8 - 14 - - - - True - <b>Phase:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - None - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - <b>Video Codec:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - None - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - <b>Audio Codec:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - None - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - <b>Container:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - Unknown - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 3 - 4 - fill - - - - - - - - - - 0 - 1 - 0 - 1 - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 10 - 10 - 12 - 12 - - - - True - 4 - 2 - False - 8 - 14 - - - - True - <b>Processed Frames:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - <b>Total Frames:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - <b>Quantiser:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - <b>Average Bitrate:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - 0 kB/s - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 3 - 4 - fill - - - - - - - True - 0 - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - 0 - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - 0 - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - - - - 1 - 2 - 0 - 1 - fill - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 10 - 10 - 12 - 12 - - - - True - 3 - 2 - False - 8 - 14 - - - - True - <b>Video Size:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - <b>Audio Size:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - <b>Total Size:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - 0 MB - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - 10 - False - 0 - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - 0 MB - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - 10 - False - 0 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - 0 MB - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - 10 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - - - - 0 - 1 - 1 - 2 - fill - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 10 - 10 - 12 - 12 - - - - True - 3 - 2 - False - 8 - 14 - - - - True - <b>Elapsed:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - <b>Time Remaining:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - <b>Frames/sec:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - 0 - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - Unknown - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - 00:00:00 - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - 0 - True - False - - - - - - True - 0.5 - 0.5 - 1 - 1 - 10 - 15 - 0 - 0 - - - - True - False - 0 - - - - True - GTK_PROGRESS_LEFT_TO_RIGHT - 0 - 0.10000000149 - PANGO_ELLIPSIZE_NONE - - - 4 - False - False - - - - - - - 0 - False - False - - - - - - True - False - 0 - - - - True - True - Shut down computer when finished - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - False - - - - - - True - Priority: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 6 - False - False - - - - - - True - True - High -Above Normal -Normal -Below Normal -Low - False - True - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - 0.5 - 0.5 - 1 - 1 - 6 - 30 - 0 - 0 - - - - True - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - 1 - 1 - False - 5 - 0 - - - 0 - True - True - - - - - - True - True - True - True - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-cancel - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Pause / Abort - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - 0 - False - True - - - - - - - + + + + + + + 12 + 500 + True + Encoding... + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + True + 2 + 2 + False + 12 + 12 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 10 + 10 + 12 + 12 + + + + True + 4 + 2 + False + 8 + 14 + + + + True + <b>Phase:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + None + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + <b>Video Codec:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + None + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + <b>Audio Codec:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + None + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + <b>Container:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + Unknown + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 3 + 4 + fill + + + + + + + + + + 0 + 1 + 0 + 1 + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 10 + 10 + 12 + 12 + + + + True + 4 + 2 + False + 8 + 14 + + + + True + <b>Processed Frames:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + <b>Total Frames:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + <b>Quantiser:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + <b>Average Bitrate:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + 0 kB/s + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 3 + 4 + fill + + + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + + + + 1 + 2 + 0 + 1 + fill + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 10 + 10 + 12 + 12 + + + + True + 3 + 2 + False + 8 + 14 + + + + True + <b>Video Size:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + <b>Audio Size:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + <b>Total Size:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + 0 MB + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 10 + False + 0 + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + 0 MB + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 10 + False + 0 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + 0 MB + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 10 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + + + + 0 + 1 + 1 + 2 + fill + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 10 + 10 + 12 + 12 + + + + True + 3 + 2 + False + 8 + 14 + + + + True + <b>Elapsed:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + <b>Time Remaining:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + <b>Frames/sec:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + Unknown + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + 00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + 0 + True + False + + + + + + True + 0.5 + 0.5 + 1 + 1 + 10 + 15 + 0 + 0 + + + + True + False + 0 + + + + True + GTK_PROGRESS_LEFT_TO_RIGHT + 0 + 0.10000000149 + PANGO_ELLIPSIZE_NONE + + + 4 + False + False + + + + + + + 0 + False + False + + + + + + True + False + 0 + + + + True + True + Shut down computer when finished + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + False + + + + + + True + Priority: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 6 + False + False + + + + + + True + True + High +Above Normal +Normal +Below Normal +Low + False + True + + + 0 + False + False + + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 30 + 0 + 0 + + + + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + 1 + 1 + False + 5 + 0 + + + 0 + True + True + + + + + + True + True + True + True + True + GTK_RELIEF_NORMAL + True + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-cancel + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Pause / Abort + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + 0 + False + True + + + + + + + diff --git a/avidemux/gtk/ADM_userInterfaces/glade/old/project_properties.glade b/avidemux/gtk/ADM_userInterfaces/glade/old/project_properties.glade index 0aa306a14a..81d395df4d 100644 --- a/avidemux/gtk/ADM_userInterfaces/glade/old/project_properties.glade +++ b/avidemux/gtk/ADM_userInterfaces/glade/old/project_properties.glade @@ -1,1165 +1,1165 @@ - - - - - - - True - Properties - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - 0.5 - 0.5 - 1 - 1 - 2 - 10 - 6 - 6 - - - - True - False - 2 - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 3 - 6 - 12 - 12 - - - - True - 6 - 2 - False - 0 - 12 - - - - True - Frame Rate: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - Frame Count: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 4 - 5 - fill - - - - - - - True - Total Duration: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 5 - 6 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 3 - 4 - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 1 - 2 - - - - - - - True - Image Size: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 4 - 5 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 5 - 6 - fill - - - - - - - True - Codec 4CC: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - Aspect Ratio: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 2 - 3 - fill - - - - - - - - - - - True - <b>Video</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 3 - 6 - 12 - 12 - - - - True - 3 - 2 - False - 0 - 12 - - - - True - Global Motion Compensation: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - Packed Bitstream: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - Quarter Pixel: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 2 - 3 - fill - - - - - - - - - - - True - <b>Extra Video Properties</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 2 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 3 - 6 - 12 - 12 - - - - True - 7 - 2 - False - 0 - 12 - - - - True - Codec: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Channels: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Bitrate: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - Frequency: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 4 - 5 - fill - - - - - - - True - Total Duration: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 5 - 6 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 1 - 2 - expand - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 4 - 5 - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 5 - 6 - fill - - - - - - - True - File Size: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 6 - 7 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 6 - 7 - fill - - - - - - - True - Variable Bitrate: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 3 - 4 - fill - - - - - - - - - - - True - <b>Audio</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - - 0 - True - True - - - - - - - + + + + + + + True + Properties + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + 0.5 + 0.5 + 1 + 1 + 2 + 10 + 6 + 6 + + + + True + False + 2 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 3 + 6 + 12 + 12 + + + + True + 6 + 2 + False + 0 + 12 + + + + True + Frame Rate: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + Frame Count: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + Total Duration: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 5 + 6 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 3 + 4 + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + + + + + + + True + Image Size: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 4 + 5 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 5 + 6 + fill + + + + + + + True + Codec 4CC: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + Aspect Ratio: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + fill + + + + + + + + + + + True + <b>Video</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 3 + 6 + 12 + 12 + + + + True + 3 + 2 + False + 0 + 12 + + + + True + Global Motion Compensation: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + Packed Bitstream: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Quarter Pixel: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + fill + + + + + + + + + + + True + <b>Extra Video Properties</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 2 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 3 + 6 + 12 + 12 + + + + True + 7 + 2 + False + 0 + 12 + + + + True + Codec: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Channels: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Bitrate: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + Frequency: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + Total Duration: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 5 + 6 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + expand + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 4 + 5 + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 5 + 6 + fill + + + + + + + True + File Size: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 6 + 7 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 6 + 7 + fill + + + + + + + True + Variable Bitrate: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 3 + 4 + fill + + + + + + + + + + + True + <b>Audio</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + + 0 + True + True + + + + + + + diff --git a/avidemux/gtk/ADM_userInterfaces/glade/old/project_x264.glade b/avidemux/gtk/ADM_userInterfaces/glade/old/project_x264.glade index f268909ced..695b50c7ad 100644 --- a/avidemux/gtk/ADM_userInterfaces/glade/old/project_x264.glade +++ b/avidemux/gtk/ADM_userInterfaces/glade/old/project_x264.glade @@ -1,3609 +1,3609 @@ - - - - - - - True - x264 Configuration - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - _Defaults - True - GTK_RELIEF_NORMAL - True - 0 - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - True - True - True - GTK_POS_TOP - False - False - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - 3 - 2 - False - 3 - 10 - - - - True - Encoding Mode - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Quantizer - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - Target Size - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Constant Quantizer - Each frame will have the same compression. Low numbers equal higher quality while high numbers equal lower quality. - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 4 0 51 1 10 10 - - - 1 - 2 - 2 - 3 - shrink|fill - - - - - - - True - Target bitrate or file size - True - True - True - 0 - - True - * - False - 4 - - - 1 - 2 - 1 - 2 - shrink|fill - - - - - - - True - Single Pass - Quality Quantizer (Average) -Single Pass - Quality Quantizer (Constant) -Single Pass - Bitrate (Average) -Two Pass - Video Size -Two Pass - Average Bitrate - False - True - - - 1 - 2 - 0 - 1 - shrink|fill - fill - - - - - - - False - True - - - - - - True - Bitrate - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - False - 3 - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 4 - 7 - 7 - - - - True - False - 3 - - - - True - 2 - 3 - False - 3 - 10 - - - - True - Partition Decision - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Method - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - 1 - Extremely Low (Fastest) -2 - Very Low -3 - Low -4 - Medium -5 - High (Default) -6 - Very High -6B - Very High (RDO on B-frames) -7 - Ultra High -7B - Ultra High (RDO on B-frames) - - False - True - - - 1 - 3 - 0 - 1 - fill - fill - - - - - - True - Diamond Search -Hexagonal Search -Uneven Multi-hexagon -Exhaustive Search - False - True - - - 1 - 3 - 1 - 2 - fill - fill - - - - - 0 - False - True - - - - - - True - 2 - 3 - False - 3 - 10 - - - - True - Max. Ref. Frames - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Range - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Define how many pixels are analysed for motion estimation. The higher the range the more accurate the analysis but the slower the encoding time. - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 17 0 64 1 10 10 - - - 1 - 2 - 0 - 1 - shrink|fill - - - - - - - True - Set how many previous frames can be referenced by a P/B-frame. Numbers above 5 do not seem to improve quality greatly. Numbers 3 to 5 are recommended. - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 1 0 16 1 10 10 - - - 1 - 2 - 1 - 2 - shrink|fill - - - - - - - True - Use color information for detecting motion to improve quality - True - Chroma ME - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 2 - 3 - 0 - 1 - 30 - fill - - - - - - - True - Calculate referencing individually based on each partition - True - Mixed Refs - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 2 - 3 - 1 - 2 - 30 - fill - - - - - - 0 - True - False - - - - - - True - True - 0 - - - - True - Early skip detection on P-frames to speedup encoding. Quality will be slightly reduced. - True - Fast P-Skip - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - True - True - DCT Decimate - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - True - Input video is interlaced - True - Interlaced - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - 0 - True - True - - - - - - - - - - True - <b>Motion Estimation</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - 3 - 2 - False - 3 - 10 - - - - True - False - 0 - - - - True - Enforce the size of a decoded pixel decoded to a certain value. Set this to 1:1 for non-anamorphic video. - True - True - True - 0 - 1 - True - * - False - 4 - - - 0 - True - True - - - - - - True - : - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 3 - False - False - - - - - - True - Enforce the size of a decoded pixel decoded to a certain value. Set this to 1:1 for non-anamorphic video. - True - True - True - 0 - 1 - True - * - False - 4 - - - 0 - True - True - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - - True - Set a custom aspect ratio. The default 1:1 is recommended for most video. - True - Custom - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Set a common predefined aspect ratio - True - Predefined Aspect Ratio - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobuttonCustomAR - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - True - As Input - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobuttonCustomAR - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - 1:1 (1:1) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 2 - 3 - - - - - - - - True - False - True - - - 1 - 2 - 0 - 1 - fill - fill - - - - - - - - - - True - <b>Sample Aspect Ratio</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - False - 3 - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 3 - 0 - 0 - - - - True - False - 17 - - - - True - Lossless compression technique that reduces bitrate by approximately 10%. Increases encoding and decoding time. - True - CABAC - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - True - False - 10 - - - - True - Trellis - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - Use Trellis Rate Distortion Optimisation to find optimal encoding for each block. Level 0 equals disabled, level 1 equals normal and level 2 equals high. - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 0 0 2 1 10 10 - - - 0 - False - False - - - - - 0 - False - False - - - - - - True - False - 10 - - - - True - Noise Reduction - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - Set the amount of noise reduction - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 0 0 1000000000 1 10 10 - - - 0 - False - False - - - - - 2 - False - False - - - - - - - 0 - True - True - - - - - - True - False - 10 - - - - True - Enable in-loop deblocking to filter the video - True - Deblocking Filter - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - True - 2 - 2 - False - 3 - 10 - - - - True - Threshold - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Strength - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Threshold for block detection. Positive values will detect more blocks, negative values will detect less. - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 0 -6 6 1 10 10 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - Positive values will soften the video, negative values will sharpen - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 0 -6 6 1 10 10 - - - 1 - 2 - 0 - 1 - fill - - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - - - True - <b>Misc. Options</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - - False - True - - - - - - True - Motion & Misc - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - False - 3 - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - False - 3 - - - - True - General block breakdown transformation - True - 8x8 Transform - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - True - Improve the P-frame quality - True - 8x8, 8x16 and 16x8 P-frame search - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - True - Improve the B-frame quality - True - 8x8, 8x16 and 16x8 B-frame search - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - True - Further improve the P-frame quality - True - 4x4, 4x8 and 8x4 P-frame search - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - Enable DCT Intra block search to improve quality - True - 8x8 Intra search - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - True - Further enable DCT Intra block search to improve quality - True - 4x4 Intra search - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - - - - - True - <b>Partition Macroblocks</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - False - 3 - - - - True - 2 - 2 - False - 3 - 10 - - - - True - Bias - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Max Consecutive - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Increase / decrease probability for how often B-frames are used. It will not violate the maximum consecutive frame limit. - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 0 -100 100 1 10 10 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - Set the maximum number of consecutive B-frames. This defines how many duplicate frames can be dropped. Numbers 2 to 5 are recommended. This greatly improves the use of bitrate and quality. - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 3 0 15 1 10 10 - - - 1 - 2 - 0 - 1 - fill - - - - - - 0 - True - True - - - - - - True - 0.5 - 0.5 - 1 - 1 - 3 - 3 - 0 - 0 - - - - True - 2 - 2 - False - 3 - 10 - - - - True - Optimise both motion vectors in B-frames. This will improve quality but take more time for encoding. - True - Bidirectional ME - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - Enables weighting of B-frames to help fades - True - Weighted Biprediction - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - Use fewer B-frames if needed. This is always recommended. If not enabled, the codec will always use the maximum number of consecutive B-frames. - True - Adaptative DCT - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Allow B-frames to make references non-linearly to another B-frame (instead of creating a duplicate copy) - True - Use as Reference - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - 1 - 0 - 1 - fill - - - - - - - - 0 - True - True - - - - - - True - False - 10 - - - - True - B-Frame Direct Mode - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - True - - - - - - True - True - None -Spatial -Temporal -Auto - False - True - - - 0 - False - True - - - - - 0 - True - True - - - - - - - - - - True - <b>B-Frames</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - - False - True - - - - - - True - Partitions & Frames - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - False - 3 - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - 3 - 2 - False - 3 - 10 - - - - 115 - True - Set how much "bitrate bonus" a keyframe can get - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 40 0 100 1 10 10 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - Set how much bitrate is deducted from a B-frame as compared to the previous P-frame - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 30 0 100 1 10 10 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - Define how much the bitrate can fluctuate over the entire video. 0% results in a constant bitrate stream, while 100% results in a pure quality based bitrate stream. - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 60 0 100 1 10 10 - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - Keyframe Boost (%) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - B-frame Reduction (%) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Bitrate Variability (%) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - - - - - True - <b>Bitrate</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 1 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - 3 - 2 - False - 3 - 20 - - - - True - Min QP - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Max QP - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Max QP Step - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - 54 - True - Enforce a minimum quantizer level - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 10 10 51 1 10 10 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - Enforce a maximum quantizer level - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 51 10 51 1 10 10 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - Define how much the quantizer rate can change between two consecutive frames - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 4 0 10 1 10 10 - - - 1 - 2 - 2 - 3 - fill - - - - - - - - - - - True - <b>Quantization Limits</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 1 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - 3 - 2 - False - 3 - 10 - - - - 115 - True - Increase / decrease sensitivity for detecting scene changes. Improves I-frame usage and quality. - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 40 0 100 1 10 10 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - Scene Cut Threshold - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Min IDR Frame Interval - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Set minimum frame interval between IDR frames. Defines the minimum amount a frame can be reused and referenced by other frames before a new IDR frame is established. - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 25 0 100 1 10 10 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - Set maximum frame interval between IDR frames. Defines the maximum amount a frame can be reused and referenced by other frames before a new IDR frame is established. - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 250 1 1000 1 10 10 - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - Max IDR Frame Interval - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - - - - - True - <b>More Rate Settings</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 1 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - 3 - 2 - False - 3 - 10 - - - - True - VBV Buffer Size - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Initial VBV Buffer (%) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - Maximum Local Bitrate - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 0 0 99999 1 10 10 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 0 0 99999 1 10 10 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 90 0 100 1 10 10 - - - 1 - 2 - 2 - 3 - fill - - - - - - - - - - - True - <b>Video Buffer Verifier</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - - False - True - - - - - - True - Rate Control - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - False - 3 - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - 4 - 2 - False - 3 - 10 - - - - True - Bitrate Variance - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Allowed variance of average bitrate. Lower values mean less variance. Higher values mean more variance. - True - 0.10000000149 - 1 - True - GTK_UPDATE_ALWAYS - False - False - 1 0 1 0.10000000149 10 10 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - Allowed variance of average quantizer or quality. Lower values mean less variance. Higher values mean more variance. Note that 0 means constant quality while 1 means constant fluctuation. Recommended 0.6. - True - 0.10000000149 - 1 - True - GTK_UPDATE_ALWAYS - False - False - 0.600000023842 0 1 0.10000000149 10 10 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - Reduced fluctuations in Quantizer (before curve compression) - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 20 0 999 1 10 10 - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - True - 0.5 - 1 - True - GTK_UPDATE_ALWAYS - False - False - 0.5 0 1 0.5 10 10 - - - 1 - 2 - 3 - 4 - fill - - - - - - - True - Quantizer Compression - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Temp. Blur of Est. Frame Complexity - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - Temp. Blur of Quant. after CC - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - - - - - True - <b>Misc</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - 3 - 2 - False - 3 - 10 - - - - True - Quantization factors used between I and P-frames - True - 0.10000000149 - 1 - True - GTK_UPDATE_ALWAYS - False - False - 1.39999997616 1 10 0.10000000149 10 10 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - Quantization used between P and B-frames - True - 0.10000000149 - 1 - True - GTK_UPDATE_ALWAYS - False - False - 1.29999995232 1 10 0.10000000149 10 10 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - Quantization difference between chroma (color) and luma (brightness) - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 0 -12 12 1 10 10 - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - Factor between I and P-frame Quants - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Factor between P and B-frame Quants - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Chroma QP Offset - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - - - - - True - <b>Quantizers</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 7 - 7 - 7 - 7 - - - - True - False - 3 - - - - True - True - Flat Matrix - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - True - True - JVT Matrix - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobuttonFlatmatrix - - - 0 - False - False - - - - - - True - False - 10 - - - - True - True - Custom Matrix - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobuttonFlatmatrix - - - 0 - True - True - - - - - - True - False - 0 - - - - True - Open CQM file - GTK_FILE_CHOOSER_ACTION_OPEN - True - False - -1 - - - 0 - True - True - - - - - - True - - - 0 - True - True - - - - - - True - Edit loaded custom quantization matrix file - True - Edit Custom Matrix - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - - - - - True - <b>Quantization Matrices</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - - False - True - - - - - - True - More - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - True - True - - - - - - - + + + + + + + True + x264 Configuration + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + _Defaults + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + 3 + 2 + False + 3 + 10 + + + + True + Encoding Mode + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Quantizer + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + Target Size + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Constant Quantizer - Each frame will have the same compression. Low numbers equal higher quality while high numbers equal lower quality. + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 4 0 51 1 10 10 + + + 1 + 2 + 2 + 3 + shrink|fill + + + + + + + True + Target bitrate or file size + True + True + True + 0 + + True + * + False + 4 + + + 1 + 2 + 1 + 2 + shrink|fill + + + + + + + True + Single Pass - Quality Quantizer (Average) +Single Pass - Quality Quantizer (Constant) +Single Pass - Bitrate (Average) +Two Pass - Video Size +Two Pass - Average Bitrate + False + True + + + 1 + 2 + 0 + 1 + shrink|fill + fill + + + + + + + False + True + + + + + + True + Bitrate + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + False + 3 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 4 + 7 + 7 + + + + True + False + 3 + + + + True + 2 + 3 + False + 3 + 10 + + + + True + Partition Decision + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Method + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + 1 - Extremely Low (Fastest) +2 - Very Low +3 - Low +4 - Medium +5 - High (Default) +6 - Very High +6B - Very High (RDO on B-frames) +7 - Ultra High +7B - Ultra High (RDO on B-frames) + + False + True + + + 1 + 3 + 0 + 1 + fill + fill + + + + + + True + Diamond Search +Hexagonal Search +Uneven Multi-hexagon +Exhaustive Search + False + True + + + 1 + 3 + 1 + 2 + fill + fill + + + + + 0 + False + True + + + + + + True + 2 + 3 + False + 3 + 10 + + + + True + Max. Ref. Frames + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Range + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Define how many pixels are analysed for motion estimation. The higher the range the more accurate the analysis but the slower the encoding time. + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 17 0 64 1 10 10 + + + 1 + 2 + 0 + 1 + shrink|fill + + + + + + + True + Set how many previous frames can be referenced by a P/B-frame. Numbers above 5 do not seem to improve quality greatly. Numbers 3 to 5 are recommended. + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 1 0 16 1 10 10 + + + 1 + 2 + 1 + 2 + shrink|fill + + + + + + + True + Use color information for detecting motion to improve quality + True + Chroma ME + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 2 + 3 + 0 + 1 + 30 + fill + + + + + + + True + Calculate referencing individually based on each partition + True + Mixed Refs + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 2 + 3 + 1 + 2 + 30 + fill + + + + + + 0 + True + False + + + + + + True + True + 0 + + + + True + Early skip detection on P-frames to speedup encoding. Quality will be slightly reduced. + True + Fast P-Skip + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + + True + True + DCT Decimate + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + + True + Input video is interlaced + True + Interlaced + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + 0 + True + True + + + + + + + + + + True + <b>Motion Estimation</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + 3 + 2 + False + 3 + 10 + + + + True + False + 0 + + + + True + Enforce the size of a decoded pixel decoded to a certain value. Set this to 1:1 for non-anamorphic video. + True + True + True + 0 + 1 + True + * + False + 4 + + + 0 + True + True + + + + + + True + : + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 3 + False + False + + + + + + True + Enforce the size of a decoded pixel decoded to a certain value. Set this to 1:1 for non-anamorphic video. + True + True + True + 0 + 1 + True + * + False + 4 + + + 0 + True + True + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + Set a custom aspect ratio. The default 1:1 is recommended for most video. + True + Custom + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Set a common predefined aspect ratio + True + Predefined Aspect Ratio + True + GTK_RELIEF_NORMAL + True + False + False + True + radiobuttonCustomAR + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + True + As Input + True + GTK_RELIEF_NORMAL + True + False + False + True + radiobuttonCustomAR + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + 1:1 (1:1) + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + + + + + + + + True + False + True + + + 1 + 2 + 0 + 1 + fill + fill + + + + + + + + + + True + <b>Sample Aspect Ratio</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + False + 3 + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 3 + 0 + 0 + + + + True + False + 17 + + + + True + Lossless compression technique that reduces bitrate by approximately 10%. Increases encoding and decoding time. + True + CABAC + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + + True + False + 10 + + + + True + Trellis + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + Use Trellis Rate Distortion Optimisation to find optimal encoding for each block. Level 0 equals disabled, level 1 equals normal and level 2 equals high. + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 0 0 2 1 10 10 + + + 0 + False + False + + + + + 0 + False + False + + + + + + True + False + 10 + + + + True + Noise Reduction + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + Set the amount of noise reduction + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 0 0 1000000000 1 10 10 + + + 0 + False + False + + + + + 2 + False + False + + + + + + + 0 + True + True + + + + + + True + False + 10 + + + + True + Enable in-loop deblocking to filter the video + True + Deblocking Filter + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + + True + 2 + 2 + False + 3 + 10 + + + + True + Threshold + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Strength + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Threshold for block detection. Positive values will detect more blocks, negative values will detect less. + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 0 -6 6 1 10 10 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Positive values will soften the video, negative values will sharpen + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 0 -6 6 1 10 10 + + + 1 + 2 + 0 + 1 + fill + + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + + + True + <b>Misc. Options</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + + False + True + + + + + + True + Motion & Misc + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + False + 3 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + False + 3 + + + + True + General block breakdown transformation + True + 8x8 Transform + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + + True + Improve the P-frame quality + True + 8x8, 8x16 and 16x8 P-frame search + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + + True + Improve the B-frame quality + True + 8x8, 8x16 and 16x8 B-frame search + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + + True + Further improve the P-frame quality + True + 4x4, 4x8 and 8x4 P-frame search + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + Enable DCT Intra block search to improve quality + True + 8x8 Intra search + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + + True + Further enable DCT Intra block search to improve quality + True + 4x4 Intra search + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + + + + + + True + <b>Partition Macroblocks</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + False + 3 + + + + True + 2 + 2 + False + 3 + 10 + + + + True + Bias + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Max Consecutive + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Increase / decrease probability for how often B-frames are used. It will not violate the maximum consecutive frame limit. + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 0 -100 100 1 10 10 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Set the maximum number of consecutive B-frames. This defines how many duplicate frames can be dropped. Numbers 2 to 5 are recommended. This greatly improves the use of bitrate and quality. + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 3 0 15 1 10 10 + + + 1 + 2 + 0 + 1 + fill + + + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 1 + 1 + 3 + 3 + 0 + 0 + + + + True + 2 + 2 + False + 3 + 10 + + + + True + Optimise both motion vectors in B-frames. This will improve quality but take more time for encoding. + True + Bidirectional ME + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + Enables weighting of B-frames to help fades + True + Weighted Biprediction + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Use fewer B-frames if needed. This is always recommended. If not enabled, the codec will always use the maximum number of consecutive B-frames. + True + Adaptative DCT + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Allow B-frames to make references non-linearly to another B-frame (instead of creating a duplicate copy) + True + Use as Reference + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 1 + 0 + 1 + fill + + + + + + + + 0 + True + True + + + + + + True + False + 10 + + + + True + B-Frame Direct Mode + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + + + + + True + True + None +Spatial +Temporal +Auto + False + True + + + 0 + False + True + + + + + 0 + True + True + + + + + + + + + + True + <b>B-Frames</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + + False + True + + + + + + True + Partitions & Frames + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + False + 3 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + 3 + 2 + False + 3 + 10 + + + + 115 + True + Set how much "bitrate bonus" a keyframe can get + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 40 0 100 1 10 10 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + Set how much bitrate is deducted from a B-frame as compared to the previous P-frame + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 30 0 100 1 10 10 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Define how much the bitrate can fluctuate over the entire video. 0% results in a constant bitrate stream, while 100% results in a pure quality based bitrate stream. + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 60 0 100 1 10 10 + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + Keyframe Boost (%) + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + B-frame Reduction (%) + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Bitrate Variability (%) + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + + + + + True + <b>Bitrate</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 1 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + 3 + 2 + False + 3 + 20 + + + + True + Min QP + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Max QP + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Max QP Step + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + 54 + True + Enforce a minimum quantizer level + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 10 10 51 1 10 10 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + Enforce a maximum quantizer level + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 51 10 51 1 10 10 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Define how much the quantizer rate can change between two consecutive frames + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 4 0 10 1 10 10 + + + 1 + 2 + 2 + 3 + fill + + + + + + + + + + + True + <b>Quantization Limits</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 1 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + 3 + 2 + False + 3 + 10 + + + + 115 + True + Increase / decrease sensitivity for detecting scene changes. Improves I-frame usage and quality. + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 40 0 100 1 10 10 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + Scene Cut Threshold + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Min IDR Frame Interval + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Set minimum frame interval between IDR frames. Defines the minimum amount a frame can be reused and referenced by other frames before a new IDR frame is established. + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 25 0 100 1 10 10 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Set maximum frame interval between IDR frames. Defines the maximum amount a frame can be reused and referenced by other frames before a new IDR frame is established. + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 250 1 1000 1 10 10 + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + Max IDR Frame Interval + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + + + + + True + <b>More Rate Settings</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 1 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + 3 + 2 + False + 3 + 10 + + + + True + VBV Buffer Size + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Initial VBV Buffer (%) + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + Maximum Local Bitrate + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 0 0 99999 1 10 10 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 0 0 99999 1 10 10 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 90 0 100 1 10 10 + + + 1 + 2 + 2 + 3 + fill + + + + + + + + + + + True + <b>Video Buffer Verifier</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + + False + True + + + + + + True + Rate Control + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + False + 3 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + 4 + 2 + False + 3 + 10 + + + + True + Bitrate Variance + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Allowed variance of average bitrate. Lower values mean less variance. Higher values mean more variance. + True + 0.10000000149 + 1 + True + GTK_UPDATE_ALWAYS + False + False + 1 0 1 0.10000000149 10 10 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + Allowed variance of average quantizer or quality. Lower values mean less variance. Higher values mean more variance. Note that 0 means constant quality while 1 means constant fluctuation. Recommended 0.6. + True + 0.10000000149 + 1 + True + GTK_UPDATE_ALWAYS + False + False + 0.600000023842 0 1 0.10000000149 10 10 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Reduced fluctuations in Quantizer (before curve compression) + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 20 0 999 1 10 10 + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + True + 0.5 + 1 + True + GTK_UPDATE_ALWAYS + False + False + 0.5 0 1 0.5 10 10 + + + 1 + 2 + 3 + 4 + fill + + + + + + + True + Quantizer Compression + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Temp. Blur of Est. Frame Complexity + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + Temp. Blur of Quant. after CC + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + + + + + True + <b>Misc</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + 3 + 2 + False + 3 + 10 + + + + True + Quantization factors used between I and P-frames + True + 0.10000000149 + 1 + True + GTK_UPDATE_ALWAYS + False + False + 1.39999997616 1 10 0.10000000149 10 10 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + Quantization used between P and B-frames + True + 0.10000000149 + 1 + True + GTK_UPDATE_ALWAYS + False + False + 1.29999995232 1 10 0.10000000149 10 10 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Quantization difference between chroma (color) and luma (brightness) + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 0 -12 12 1 10 10 + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + Factor between I and P-frame Quants + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Factor between P and B-frame Quants + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Chroma QP Offset + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + + + + + True + <b>Quantizers</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 7 + 7 + 7 + 7 + + + + True + False + 3 + + + + True + True + Flat Matrix + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + + True + True + JVT Matrix + True + GTK_RELIEF_NORMAL + True + False + False + True + radiobuttonFlatmatrix + + + 0 + False + False + + + + + + True + False + 10 + + + + True + True + Custom Matrix + True + GTK_RELIEF_NORMAL + True + False + False + True + radiobuttonFlatmatrix + + + 0 + True + True + + + + + + True + False + 0 + + + + True + Open CQM file + GTK_FILE_CHOOSER_ACTION_OPEN + True + False + -1 + + + 0 + True + True + + + + + + True + + + 0 + True + True + + + + + + True + Edit loaded custom quantization matrix file + True + Edit Custom Matrix + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + + + + + True + <b>Quantization Matrices</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + + False + True + + + + + + True + More + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + + + diff --git a/avidemux/gtk/CMakeLists.txt b/avidemux/gtk/CMakeLists.txt index 6d98d053f0..d27b4225ec 100644 --- a/avidemux/gtk/CMakeLists.txt +++ b/avidemux/gtk/CMakeLists.txt @@ -1,147 +1,147 @@ -cmake_minimum_required(VERSION 3.7) - -SET(ADM_PROJECT Avidemux_gtk) - -MESSAGE("") -MESSAGE("#########################################") -MESSAGE("Configure for avidemux Gtk Started") -MESSAGE("#########################################") -MESSAGE("") - -include(../commonCmakeApplication.cmake) -include(admCheckGtk) - -checkGtk() - -# ######################################### -# Config -# ######################################### -ADD_DEFINITIONS(-DADM_UI_TYPE_BUILD=ADM_UI_GTK) -SET(CONFIG_HEADER_TYPE ADM_BUILD_GTK) -SET(UI_SUFFIX gtk) - -CONFIGURE_FILE("${AVIDEMUX_TOP_SOURCE_DIR}/cmake/config.h.cmake" "${CMAKE_BINARY_DIR}/config/gtk/config.h") -MESSAGE(STATUS "GTK config.h generated") - -INCLUDE_DIRECTORIES(BEFORE "${CMAKE_BINARY_DIR}/config/gtk/") - -# ####################################### -# Add subdirectories -# ####################################### -ADD_SUBDIRECTORY(../common ./common) -ADD_SUBDIRECTORY(ADM_UIs ./ADM_UIsGtk) -ADD_SUBDIRECTORY(ADM_userInterfaces ./ADM_userInterfacesGtk) - -SDLify(../common/main.cpp) -ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_SUBVERSION='\"${ADM_SUBVERSION}\"'") -ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_VERSION='\"${AVIDEMUX_VERSION}\"'") - -# ########################################## -# Version Info -# ########################################## -if (WIN32) - # add icon and version info - SET(FILEVERSION_STRING "${AVIDEMUX_VERSION}") - SET(PRODUCTVERSION_STRING "${AVIDEMUX_VERSION}") - STRING(REPLACE "." "," FILEVERSION ${FILEVERSION_STRING}) - STRING(REPLACE "." "," PRODUCTVERSION ${PRODUCTVERSION_STRING}) - SET(PRODUCTVERSION "${PRODUCTVERSION},0") - - IF (ADM_CPU_X86_64) - SET(WIN_RES_TARGET "pe-x86-64") - ELSE (ADM_CPU_X86_64) - SET(WIN_RES_TARGET "pe-i386") - ENDIF (ADM_CPU_X86_64) - - SET(AVIDEMUX_ICON "adm.ico") - SET(ADM_WIN_RES "adm.obj") - SET(ADM_EXE_SRCS ${ADM_EXE_SRCS} ${ADM_WIN_RES}) - CONFIGURE_FILE("${AVIDEMUX_TOP_SOURCE_DIR}/cmake/admWin32.rc.in" ${CMAKE_CURRENT_BINARY_DIR}/admWin.rc IMMEDIATE) - include(admWindRes) - ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ADM_WIN_RES} COMMAND ${WINDRES}.exe -F ${WIN_RES_TARGET} -i ${CMAKE_CURRENT_BINARY_DIR}/admWin.rc -o ${CMAKE_CURRENT_BINARY_DIR}/${ADM_WIN_RES} -O coff --define VS_VERSION_INFO=1) -endif (WIN32) - -# ########################################## -# Executable -# ########################################## -ADD_EXECUTABLE(avidemux3_gtk ${ADM_EXE_SRCS}) - -# ########################################## -# Construct common libraries -# ########################################## -FOREACH (_libName ${commonLibs1}) - TARGET_LINK_LIBRARIES(avidemux3_gtk ${_libName}) -ENDFOREACH (_libName ${commonLibs1}) - -TARGET_LINK_LIBRARIES(avidemux3_gtk ADM_filtersGtk) - -FOREACH (_libName ${commonLibs2}) - TARGET_LINK_LIBRARIES(avidemux3_gtk ${_libName}) -ENDFOREACH (_libName ${commonLibs2}) - -FOREACH (_libName ${coreLibs}) - TARGET_LINK_LIBRARIES(avidemux3_gtk ${_libName}) -ENDFOREACH (_libName ${coreLibs}) - -# ############################################ -# Add gtk specific libs -# ############################################ -TARGET_LINK_LIBRARIES(avidemux3_gtk - ADM_UI_GTK - ADM_dialogGtk - #ADM_filtersGtk - ADM_gui2Gtk - ADM_toolkit6 - ADM_coreAudio6 - ADM_coreUtils6 - #ADM_ocrGtk - ADM_toolkitGtk - ADM_shellGtk - ADM_UIGtk6 - ADM_coreAudioDevice6 - ADM_osSupport6 -) - -# ########################################## -# External libs -# ########################################## -# gettext -IF (GETTEXT_FOUND) - TARGET_LINK_LIBRARIES(avidemux3_gtk ${GETTEXT_LIBRARY_DIR}) -ENDIF (GETTEXT_FOUND) - - -# SDL -IF (USE_SDL) - TARGET_LINK_LIBRARIES(avidemux3_gtk ${SDL2_LIBRARY}) -ENDIF (USE_SDL) - - -# ########################################## -# UI Specific -# ########################################## -TARGET_LINK_LIBRARIES(avidemux3_gtk ${GTK_LDFLAGS} ${GTHREAD_LDFLAGS}) - -# ########################################## -# OS Specific -# ########################################## -if (WIN32 OR APPLE) - set_property(TARGET avidemux3_gtk PROPERTY OUTPUT_NAME avidemux_gtk) -endif (WIN32 OR APPLE) - -IF (WIN32) - target_link_libraries(avidemux3_gtk winmm -mwindows -Wl,--export-all-symbols) -ENDIF (WIN32) - -# ########################################## -# Install -# ########################################## -ADM_LINK_THREAD(avidemux3_gtk) -ADM_INSTALL_BIN(avidemux3_gtk) - -DISPLAY_SUMMARY_LIST() - -include(admPackager) -admPackager(gtkPackage) -INSTALL(FILES ${CMAKE_BINARY_DIR}/config/gtk/config.h DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_API_VERSION}/gtk" COMPONENT dev) -MESSAGE("") +cmake_minimum_required(VERSION 3.7) + +SET(ADM_PROJECT Avidemux_gtk) + +MESSAGE("") +MESSAGE("#########################################") +MESSAGE("Configure for avidemux Gtk Started") +MESSAGE("#########################################") +MESSAGE("") + +include(../commonCmakeApplication.cmake) +include(admCheckGtk) + +checkGtk() + +# ######################################### +# Config +# ######################################### +ADD_DEFINITIONS(-DADM_UI_TYPE_BUILD=ADM_UI_GTK) +SET(CONFIG_HEADER_TYPE ADM_BUILD_GTK) +SET(UI_SUFFIX gtk) + +CONFIGURE_FILE("${AVIDEMUX_TOP_SOURCE_DIR}/cmake/config.h.cmake" "${CMAKE_BINARY_DIR}/config/gtk/config.h") +MESSAGE(STATUS "GTK config.h generated") + +INCLUDE_DIRECTORIES(BEFORE "${CMAKE_BINARY_DIR}/config/gtk/") + +# ####################################### +# Add subdirectories +# ####################################### +ADD_SUBDIRECTORY(../common ./common) +ADD_SUBDIRECTORY(ADM_UIs ./ADM_UIsGtk) +ADD_SUBDIRECTORY(ADM_userInterfaces ./ADM_userInterfacesGtk) + +SDLify(../common/main.cpp) +ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_SUBVERSION='\"${ADM_SUBVERSION}\"'") +ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_VERSION='\"${AVIDEMUX_VERSION}\"'") + +# ########################################## +# Version Info +# ########################################## +if (WIN32) + # add icon and version info + SET(FILEVERSION_STRING "${AVIDEMUX_VERSION}") + SET(PRODUCTVERSION_STRING "${AVIDEMUX_VERSION}") + STRING(REPLACE "." "," FILEVERSION ${FILEVERSION_STRING}) + STRING(REPLACE "." "," PRODUCTVERSION ${PRODUCTVERSION_STRING}) + SET(PRODUCTVERSION "${PRODUCTVERSION},0") + + IF (ADM_CPU_X86_64) + SET(WIN_RES_TARGET "pe-x86-64") + ELSE (ADM_CPU_X86_64) + SET(WIN_RES_TARGET "pe-i386") + ENDIF (ADM_CPU_X86_64) + + SET(AVIDEMUX_ICON "adm.ico") + SET(ADM_WIN_RES "adm.obj") + SET(ADM_EXE_SRCS ${ADM_EXE_SRCS} ${ADM_WIN_RES}) + CONFIGURE_FILE("${AVIDEMUX_TOP_SOURCE_DIR}/cmake/admWin32.rc.in" ${CMAKE_CURRENT_BINARY_DIR}/admWin.rc IMMEDIATE) + include(admWindRes) + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ADM_WIN_RES} COMMAND ${WINDRES}.exe -F ${WIN_RES_TARGET} -i ${CMAKE_CURRENT_BINARY_DIR}/admWin.rc -o ${CMAKE_CURRENT_BINARY_DIR}/${ADM_WIN_RES} -O coff --define VS_VERSION_INFO=1) +endif (WIN32) + +# ########################################## +# Executable +# ########################################## +ADD_EXECUTABLE(avidemux3_gtk ${ADM_EXE_SRCS}) + +# ########################################## +# Construct common libraries +# ########################################## +FOREACH (_libName ${commonLibs1}) + TARGET_LINK_LIBRARIES(avidemux3_gtk ${_libName}) +ENDFOREACH (_libName ${commonLibs1}) + +TARGET_LINK_LIBRARIES(avidemux3_gtk ADM_filtersGtk) + +FOREACH (_libName ${commonLibs2}) + TARGET_LINK_LIBRARIES(avidemux3_gtk ${_libName}) +ENDFOREACH (_libName ${commonLibs2}) + +FOREACH (_libName ${coreLibs}) + TARGET_LINK_LIBRARIES(avidemux3_gtk ${_libName}) +ENDFOREACH (_libName ${coreLibs}) + +# ############################################ +# Add gtk specific libs +# ############################################ +TARGET_LINK_LIBRARIES(avidemux3_gtk + ADM_UI_GTK + ADM_dialogGtk + #ADM_filtersGtk + ADM_gui2Gtk + ADM_toolkit6 + ADM_coreAudio6 + ADM_coreUtils6 + #ADM_ocrGtk + ADM_toolkitGtk + ADM_shellGtk + ADM_UIGtk6 + ADM_coreAudioDevice6 + ADM_osSupport6 +) + +# ########################################## +# External libs +# ########################################## +# gettext +IF (GETTEXT_FOUND) + TARGET_LINK_LIBRARIES(avidemux3_gtk ${GETTEXT_LIBRARY_DIR}) +ENDIF (GETTEXT_FOUND) + + +# SDL +IF (USE_SDL) + TARGET_LINK_LIBRARIES(avidemux3_gtk ${SDL2_LIBRARY}) +ENDIF (USE_SDL) + + +# ########################################## +# UI Specific +# ########################################## +TARGET_LINK_LIBRARIES(avidemux3_gtk ${GTK_LDFLAGS} ${GTHREAD_LDFLAGS}) + +# ########################################## +# OS Specific +# ########################################## +if (WIN32 OR APPLE) + set_property(TARGET avidemux3_gtk PROPERTY OUTPUT_NAME avidemux_gtk) +endif (WIN32 OR APPLE) + +IF (WIN32) + target_link_libraries(avidemux3_gtk winmm -mwindows -Wl,--export-all-symbols) +ENDIF (WIN32) + +# ########################################## +# Install +# ########################################## +ADM_LINK_THREAD(avidemux3_gtk) +ADM_INSTALL_BIN(avidemux3_gtk) + +DISPLAY_SUMMARY_LIST() + +include(admPackager) +admPackager(gtkPackage) +INSTALL(FILES ${CMAKE_BINARY_DIR}/config/gtk/config.h DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_API_VERSION}/gtk" COMPONENT dev) +MESSAGE("") diff --git a/avidemux/qt4/ADM_UIs/CMakeLists.txt b/avidemux/qt4/ADM_UIs/CMakeLists.txt index 596a5be901..4681770f61 100644 --- a/avidemux/qt4/ADM_UIs/CMakeLists.txt +++ b/avidemux/qt4/ADM_UIs/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_SUBDIRECTORY(src) - +ADD_SUBDIRECTORY(src) + diff --git a/avidemux/qt4/ADM_jobs/CMakeLists.txt b/avidemux/qt4/ADM_jobs/CMakeLists.txt index f6fc76ea88..4b7537b554 100644 --- a/avidemux/qt4/ADM_jobs/CMakeLists.txt +++ b/avidemux/qt4/ADM_jobs/CMakeLists.txt @@ -1 +1 @@ -ADD_SUBDIRECTORY(src) +ADD_SUBDIRECTORY(src) diff --git a/avidemux/qt4/ADM_jobs/src/CMakeLists.txt b/avidemux/qt4/ADM_jobs/src/CMakeLists.txt index c79c1537c3..21b8ada1a8 100644 --- a/avidemux/qt4/ADM_jobs/src/CMakeLists.txt +++ b/avidemux/qt4/ADM_jobs/src/CMakeLists.txt @@ -1,108 +1,108 @@ -########################################## -# Config -########################################## -ADD_DEFINITIONS(-DADM_UI_TYPE_BUILD=ADM_UI_QT4) - -IF(MSVC) -ADD_DEFINITIONS(-D_WINSOCKAPI_) -ENDIF(MSVC) - -SET(CONFIG_HEADER_TYPE ADM_BUILD_QT4) -SET(UI_SUFFIX qt4) -include_directories(../include ${QT_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE(admWindRes) -########################################### -# Executable -########################################### -# -SET(UI uiJobs.ui uiProgress.ui) -SET(headers ../include/T_jobs.h ../include/T_progress.h) -IF(APPLE OR WIN32) - ADM_QT_ADD_RESOURCES(resource jobs.qrc) -ELSE(APPLE OR WIN32) - ADM_QT_ADD_RESOURCES(resource jobs_linux.qrc) -ENDIF(APPLE OR WIN32) -ADM_QT_WRAP_UI(ADM_JOBS_headers ${UI}) -ADM_QT_WRAP_CPP(ADM_JOBS_source ${headers}) -SET(ADM_JOB_SRCS - ADM_jobs.cpp - ADM_jobControl.cpp - ADM_runOneJob.cpp - ADM_jobProgress.cpp - ../../ADM_userInterfaces/translator.cpp - ${ADM_JOBS_headers} - ${ADM_JOBS_source} - ${resource} - ) - -########################################### -# Version Info -########################################### -if (WIN32) - WINDRESIFY(mainJobs "${CMAKE_CURRENT_SOURCE_DIR}/../../../common/xpm/adm.ico" src "avidemux_jobs" "Avidemux Jobs") - SET(ADM_JOB_SRCS ${ADM_JOB_SRCS} ${src}) -endif (WIN32) - -########################################### -# Executable -########################################### -include(admCoreIncludes) -include_directories("${PTHREAD_INCLUDE_DIR}") - -IF(WIN32) - ADD_EXECUTABLE(avidemux3_jobs_${QT_EXTENSION} WIN32 ${ADM_JOB_SRCS}) - IF(MSVC) - set_target_properties(avidemux3_jobs_${QT_EXTENSION} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS") - set_target_properties(avidemux3_jobs_${QT_EXTENSION} PROPERTIES WIN32_EXECUTABLE True) - ELSE(MSVC) - target_link_libraries(avidemux3_jobs_${QT_EXTENSION} winmm -mwindows) - ENDIF(MSVC) -ELSE(WIN32) - ADD_EXECUTABLE(avidemux3_jobs_${QT_EXTENSION} ${ADM_JOB_SRCS}) -ENDIF(WIN32) - - -ADD_SOURCE_CFLAGS(ADM_jobs.cpp "-DADM_VERSION=\"${AVIDEMUX_VERSION}\"") -if (ADM_SUBVERSION) - ADD_SOURCE_CFLAGS(ADM_jobs.cpp "-DADM_SUBVERSION=\"${ADM_SUBVERSION}\"") -endif (ADM_SUBVERSION) - -########################################### -TARGET_LINK_LIBRARIES(avidemux3_jobs_${QT_EXTENSION} ADM_coreSocket6) -TARGET_LINK_LIBRARIES(avidemux3_jobs_${QT_EXTENSION} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY}) -TARGET_LINK_LIBRARIES(avidemux3_jobs_${QT_EXTENSION} ${PTHREAD_LIBRARIES}) -########################################### -# OS Specific -########################################### -if (WIN32 OR APPLE) - set_property(TARGET avidemux3_jobs_${QT_EXTENSION} PROPERTY OUTPUT_NAME avidemux_jobs) -endif (WIN32 OR APPLE) - - -IF (APPLE) - add_source_cflags(ADM_runOneJob.cpp "-DAVIDEMUX_MAJOR_MINOR=\"${AVIDEMUX_MAJOR_MINOR}\"") - target_link_libraries(avidemux3_jobs_${QT_EXTENSION} "-framework CoreServices -framework CoreAudio -framework AudioUnit -framework Carbon") - - # for Leopard but it doesn't hurt Tiger - target_link_libraries(avidemux3_jobs_${QT_EXTENSION} "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib") -ENDIF (APPLE) - -TARGET_LINK_LIBRARIES(avidemux3_jobs_${QT_EXTENSION} ADM_coreJobs) -TARGET_LINK_LIBRARIES(avidemux3_jobs_${QT_EXTENSION} ADM_coreUtils6) -TARGET_LINK_LIBRARIES(avidemux3_jobs_${QT_EXTENSION} ADM_core6) -# -target_link_libraries(avidemux3_jobs_${QT_EXTENSION} "-lm -lstdc++") -# -# - - -########################################### -# Install -########################################### -ADM_LINK_THREAD(avidemux3_jobs_${QT_EXTENSION}) -ADM_INSTALL_BIN(avidemux3_jobs_${QT_EXTENSION}) -# -# Packaging -# -#include(admPackager) -#admPackager(qt4Package) +########################################## +# Config +########################################## +ADD_DEFINITIONS(-DADM_UI_TYPE_BUILD=ADM_UI_QT4) + +IF(MSVC) +ADD_DEFINITIONS(-D_WINSOCKAPI_) +ENDIF(MSVC) + +SET(CONFIG_HEADER_TYPE ADM_BUILD_QT4) +SET(UI_SUFFIX qt4) +include_directories(../include ${QT_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) +INCLUDE(admWindRes) +########################################### +# Executable +########################################### +# +SET(UI uiJobs.ui uiProgress.ui) +SET(headers ../include/T_jobs.h ../include/T_progress.h) +IF(APPLE OR WIN32) + ADM_QT_ADD_RESOURCES(resource jobs.qrc) +ELSE(APPLE OR WIN32) + ADM_QT_ADD_RESOURCES(resource jobs_linux.qrc) +ENDIF(APPLE OR WIN32) +ADM_QT_WRAP_UI(ADM_JOBS_headers ${UI}) +ADM_QT_WRAP_CPP(ADM_JOBS_source ${headers}) +SET(ADM_JOB_SRCS + ADM_jobs.cpp + ADM_jobControl.cpp + ADM_runOneJob.cpp + ADM_jobProgress.cpp + ../../ADM_userInterfaces/translator.cpp + ${ADM_JOBS_headers} + ${ADM_JOBS_source} + ${resource} + ) + +########################################### +# Version Info +########################################### +if (WIN32) + WINDRESIFY(mainJobs "${CMAKE_CURRENT_SOURCE_DIR}/../../../common/xpm/adm.ico" src "avidemux_jobs" "Avidemux Jobs") + SET(ADM_JOB_SRCS ${ADM_JOB_SRCS} ${src}) +endif (WIN32) + +########################################### +# Executable +########################################### +include(admCoreIncludes) +include_directories("${PTHREAD_INCLUDE_DIR}") + +IF(WIN32) + ADD_EXECUTABLE(avidemux3_jobs_${QT_EXTENSION} WIN32 ${ADM_JOB_SRCS}) + IF(MSVC) + set_target_properties(avidemux3_jobs_${QT_EXTENSION} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS") + set_target_properties(avidemux3_jobs_${QT_EXTENSION} PROPERTIES WIN32_EXECUTABLE True) + ELSE(MSVC) + target_link_libraries(avidemux3_jobs_${QT_EXTENSION} winmm -mwindows) + ENDIF(MSVC) +ELSE(WIN32) + ADD_EXECUTABLE(avidemux3_jobs_${QT_EXTENSION} ${ADM_JOB_SRCS}) +ENDIF(WIN32) + + +ADD_SOURCE_CFLAGS(ADM_jobs.cpp "-DADM_VERSION=\"${AVIDEMUX_VERSION}\"") +if (ADM_SUBVERSION) + ADD_SOURCE_CFLAGS(ADM_jobs.cpp "-DADM_SUBVERSION=\"${ADM_SUBVERSION}\"") +endif (ADM_SUBVERSION) + +########################################### +TARGET_LINK_LIBRARIES(avidemux3_jobs_${QT_EXTENSION} ADM_coreSocket6) +TARGET_LINK_LIBRARIES(avidemux3_jobs_${QT_EXTENSION} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY}) +TARGET_LINK_LIBRARIES(avidemux3_jobs_${QT_EXTENSION} ${PTHREAD_LIBRARIES}) +########################################### +# OS Specific +########################################### +if (WIN32 OR APPLE) + set_property(TARGET avidemux3_jobs_${QT_EXTENSION} PROPERTY OUTPUT_NAME avidemux_jobs) +endif (WIN32 OR APPLE) + + +IF (APPLE) + add_source_cflags(ADM_runOneJob.cpp "-DAVIDEMUX_MAJOR_MINOR=\"${AVIDEMUX_MAJOR_MINOR}\"") + target_link_libraries(avidemux3_jobs_${QT_EXTENSION} "-framework CoreServices -framework CoreAudio -framework AudioUnit -framework Carbon") + + # for Leopard but it doesn't hurt Tiger + target_link_libraries(avidemux3_jobs_${QT_EXTENSION} "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib") +ENDIF (APPLE) + +TARGET_LINK_LIBRARIES(avidemux3_jobs_${QT_EXTENSION} ADM_coreJobs) +TARGET_LINK_LIBRARIES(avidemux3_jobs_${QT_EXTENSION} ADM_coreUtils6) +TARGET_LINK_LIBRARIES(avidemux3_jobs_${QT_EXTENSION} ADM_core6) +# +target_link_libraries(avidemux3_jobs_${QT_EXTENSION} "-lm -lstdc++") +# +# + + +########################################### +# Install +########################################### +ADM_LINK_THREAD(avidemux3_jobs_${QT_EXTENSION}) +ADM_INSTALL_BIN(avidemux3_jobs_${QT_EXTENSION}) +# +# Packaging +# +#include(admPackager) +#admPackager(qt4Package) diff --git a/avidemux/qt4/ADM_openGL/CMakeLists.txt b/avidemux/qt4/ADM_openGL/CMakeLists.txt index f6fc76ea88..4b7537b554 100644 --- a/avidemux/qt4/ADM_openGL/CMakeLists.txt +++ b/avidemux/qt4/ADM_openGL/CMakeLists.txt @@ -1 +1 @@ -ADD_SUBDIRECTORY(src) +ADD_SUBDIRECTORY(src) diff --git a/avidemux/qt4/ADM_openGL/src/CMakeLists.txt b/avidemux/qt4/ADM_openGL/src/CMakeLists.txt index fa37774154..12fefda315 100644 --- a/avidemux/qt4/ADM_openGL/src/CMakeLists.txt +++ b/avidemux/qt4/ADM_openGL/src/CMakeLists.txt @@ -1,12 +1,12 @@ -IF(USE_OPENGL) - INCLUDE_DIRECTORIES(../include) - SET(ADM_OPENGL ADM_openGL${QT_LIBRARY_EXTENSION}6) - INCLUDE_DIRECTORIES(${QT_HEADERS_DIR}) - INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) - INCLUDE_DIRECTORIES(${QT_QTOPENGL_INCLUDE_DIR}) - YASMIFY(azm ADM_openGlDownload_asm) - ADD_LIBRARY( ${ADM_OPENGL} SHARED ADM_openGl.cpp ADM_openGlDownloadTexture.cpp ${azm}) - TARGET_LINK_LIBRARIES(${ADM_OPENGL} ${OPENGL_LIBRARIES} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ADM_coreUI6 ADM_core6 ADM_coreUtils6 ADM_coreImage6) - ADM_INSTALL_LIB(${ADM_OPENGL}) -ENDIF(USE_OPENGL) - +IF(USE_OPENGL) + INCLUDE_DIRECTORIES(../include) + SET(ADM_OPENGL ADM_openGL${QT_LIBRARY_EXTENSION}6) + INCLUDE_DIRECTORIES(${QT_HEADERS_DIR}) + INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(${QT_QTOPENGL_INCLUDE_DIR}) + YASMIFY(azm ADM_openGlDownload_asm) + ADD_LIBRARY( ${ADM_OPENGL} SHARED ADM_openGl.cpp ADM_openGlDownloadTexture.cpp ${azm}) + TARGET_LINK_LIBRARIES(${ADM_OPENGL} ${OPENGL_LIBRARIES} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ADM_coreUI6 ADM_core6 ADM_coreUtils6 ADM_coreImage6) + ADM_INSTALL_LIB(${ADM_OPENGL}) +ENDIF(USE_OPENGL) + diff --git a/avidemux/qt4/ADM_update/CMakeLists.txt b/avidemux/qt4/ADM_update/CMakeLists.txt index f6fc76ea88..4b7537b554 100644 --- a/avidemux/qt4/ADM_update/CMakeLists.txt +++ b/avidemux/qt4/ADM_update/CMakeLists.txt @@ -1 +1 @@ -ADD_SUBDIRECTORY(src) +ADD_SUBDIRECTORY(src) diff --git a/avidemux/qt4/ADM_update/src/CMakeLists.txt b/avidemux/qt4/ADM_update/src/CMakeLists.txt index 863e1aa47a..0ef8539cdc 100644 --- a/avidemux/qt4/ADM_update/src/CMakeLists.txt +++ b/avidemux/qt4/ADM_update/src/CMakeLists.txt @@ -1,14 +1,14 @@ -SET(ADM_update "ADM_update${QT_LIBRARY_EXTENSION}6") -#ADD_DEFINITIONS( ${QT_DEFINITIONS}) -INCLUDE_DIRECTORIES(../include) -INCLUDE_DIRECTORIES(../private_inc) -INCLUDE_DIRECTORIES(${QT_HEADERS_DIR}) - -math(EXPR currentVersion "${CPACK_PACKAGE_VERSION_MAJOR}*10000+${CPACK_PACKAGE_VERSION_MINOR}*100+${CPACK_PACKAGE_VERSION_P}") - -ADM_QT_WRAP_CPP(${ADM_update}_source ../private_inc/ADM_updateImpl.h) -ADD_DEFINITIONS("-DADM_CURRENT_VERSION=${currentVersion}") - - -ADD_LIBRARY( ${ADM_update} STATIC ADM_update.cpp ${${ADM_update}_source}) - +SET(ADM_update "ADM_update${QT_LIBRARY_EXTENSION}6") +#ADD_DEFINITIONS( ${QT_DEFINITIONS}) +INCLUDE_DIRECTORIES(../include) +INCLUDE_DIRECTORIES(../private_inc) +INCLUDE_DIRECTORIES(${QT_HEADERS_DIR}) + +math(EXPR currentVersion "${CPACK_PACKAGE_VERSION_MAJOR}*10000+${CPACK_PACKAGE_VERSION_MINOR}*100+${CPACK_PACKAGE_VERSION_P}") + +ADM_QT_WRAP_CPP(${ADM_update}_source ../private_inc/ADM_updateImpl.h) +ADD_DEFINITIONS("-DADM_CURRENT_VERSION=${currentVersion}") + + +ADD_LIBRARY( ${ADM_update} STATIC ADM_update.cpp ${${ADM_update}_source}) + diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_filters/CMakeLists.txt b/avidemux/qt4/ADM_userInterfaces/ADM_filters/CMakeLists.txt index c9c7f37853..5d035f82e7 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_filters/CMakeLists.txt +++ b/avidemux/qt4/ADM_userInterfaces/ADM_filters/CMakeLists.txt @@ -1,15 +1,15 @@ -SET(ADM_LIB ADM_filters${QT_LIBRARY_EXTENSION}) - -ADM_QT_WRAP_UI(${ADM_LIB}_header mainfilter.ui seekablePreview.ui quickfilter.ui) -ADM_QT_WRAP_CPP(${ADM_LIB}_source Q_mainfilter.h Q_seekablePreview.h) -ADM_QT_ADD_RESOURCES(${ADM_LIB}_resource filter.qrc) - -SET(${ADM_LIB}_SRCS - filter_none.cpp - Q_mainfilter.cpp -# Q_partialize.cpp - Q_seekablePreview.cpp - ${${ADM_LIB}_header} ${${ADM_LIB}_source} ${${ADM_LIB}_resource}) - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) +SET(ADM_LIB ADM_filters${QT_LIBRARY_EXTENSION}) + +ADM_QT_WRAP_UI(${ADM_LIB}_header mainfilter.ui seekablePreview.ui quickfilter.ui) +ADM_QT_WRAP_CPP(${ADM_LIB}_source Q_mainfilter.h Q_seekablePreview.h) +ADM_QT_ADD_RESOURCES(${ADM_LIB}_resource filter.qrc) + +SET(${ADM_LIB}_SRCS + filter_none.cpp + Q_mainfilter.cpp +# Q_partialize.cpp + Q_seekablePreview.cpp + ${${ADM_LIB}_header} ${${ADM_LIB}_source} ${${ADM_LIB}_resource}) + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/CMakeLists.txt b/avidemux/qt4/ADM_userInterfaces/ADM_gui/CMakeLists.txt index 838e31edbc..d4fd98e428 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/CMakeLists.txt +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/CMakeLists.txt @@ -1,48 +1,48 @@ -SET(ADM_LIB ADM_gui${QT_LIBRARY_EXTENSION}) -INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/../common/ADM_icons/") -ADM_QT_WRAP_UI(${ADM_LIB}_header gui2.ui ) -ADM_QT_WRAP_CPP(${ADM_LIB}_source Q_gui2.h ADM_mwNavSlider.h T_preview.h T_vumeter.h T_thumbSlider.h ADM_qtray.h FileAction.h) -IF(APPLE) - ADM_QT_ADD_RESOURCES(${ADM_LIB}_resource avidemux_osx.qrc) -ELSEIF(WIN32) - IF(USE_CUSTOM_TIME_DISPLAY_FONT) - ADM_QT_ADD_RESOURCES(${ADM_LIB}_resource avidemux_win32_custom_font.qrc) - ELSE(USE_CUSTOM_TIME_DISPLAY_FONT) - ADM_QT_ADD_RESOURCES(${ADM_LIB}_resource avidemux_win32.qrc) - ENDIF(USE_CUSTOM_TIME_DISPLAY_FONT) -ELSE(APPLE) - ADM_QT_ADD_RESOURCES(${ADM_LIB}_resource avidemux.qrc) -ENDIF(APPLE) - -IF(USE_CUSTOM_TIME_DISPLAY_FONT) - ADD_DEFINITIONS("-DUSE_CUSTOM_TIME_DISPLAY_FONT") -ENDIF(USE_CUSTOM_TIME_DISPLAY_FONT) - -IF(USE_OPENGL) - INCLUDE_DIRECTORIES(../../ADM_openGL/include/) -ENDIF(USE_OPENGL) - -IF(WIN32) - SET(TRAYPROGRESS ADM_systemTrayProgress_win32.cpp) -ELSE(WIN32) - SET(TRAYPROGRESS ADM_systemTrayProgress_default.cpp) -ENDIF(WIN32) - -SET(${ADM_LIB}_SRCS - Q_gui2.cpp Q_gui2GL.cpp - Q_gui2_menu.cpp - T_preview.cpp - T_vumeter.cpp - #stubs.cpp - T_thumbSlider.cpp - file_qt4.cpp gui_none.cpp ADM_mwNavSlider.cpp - ADM_qtray.cpp - Q_dummyWidget.cpp - FileAction.cpp - ${TRAYPROGRESS} - ${${ADM_LIB}_header} ${${ADM_LIB}_source} ${${ADM_LIB}_resource}) - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../ADM_filters ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../ADM_filters ) -ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) +SET(ADM_LIB ADM_gui${QT_LIBRARY_EXTENSION}) +INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/../common/ADM_icons/") +ADM_QT_WRAP_UI(${ADM_LIB}_header gui2.ui ) +ADM_QT_WRAP_CPP(${ADM_LIB}_source Q_gui2.h ADM_mwNavSlider.h T_preview.h T_vumeter.h T_thumbSlider.h ADM_qtray.h FileAction.h) +IF(APPLE) + ADM_QT_ADD_RESOURCES(${ADM_LIB}_resource avidemux_osx.qrc) +ELSEIF(WIN32) + IF(USE_CUSTOM_TIME_DISPLAY_FONT) + ADM_QT_ADD_RESOURCES(${ADM_LIB}_resource avidemux_win32_custom_font.qrc) + ELSE(USE_CUSTOM_TIME_DISPLAY_FONT) + ADM_QT_ADD_RESOURCES(${ADM_LIB}_resource avidemux_win32.qrc) + ENDIF(USE_CUSTOM_TIME_DISPLAY_FONT) +ELSE(APPLE) + ADM_QT_ADD_RESOURCES(${ADM_LIB}_resource avidemux.qrc) +ENDIF(APPLE) + +IF(USE_CUSTOM_TIME_DISPLAY_FONT) + ADD_DEFINITIONS("-DUSE_CUSTOM_TIME_DISPLAY_FONT") +ENDIF(USE_CUSTOM_TIME_DISPLAY_FONT) + +IF(USE_OPENGL) + INCLUDE_DIRECTORIES(../../ADM_openGL/include/) +ENDIF(USE_OPENGL) + +IF(WIN32) + SET(TRAYPROGRESS ADM_systemTrayProgress_win32.cpp) +ELSE(WIN32) + SET(TRAYPROGRESS ADM_systemTrayProgress_default.cpp) +ENDIF(WIN32) + +SET(${ADM_LIB}_SRCS + Q_gui2.cpp Q_gui2GL.cpp + Q_gui2_menu.cpp + T_preview.cpp + T_vumeter.cpp + #stubs.cpp + T_thumbSlider.cpp + file_qt4.cpp gui_none.cpp ADM_mwNavSlider.cpp + ADM_qtray.cpp + Q_dummyWidget.cpp + FileAction.cpp + ${TRAYPROGRESS} + ${${ADM_LIB}_header} ${${ADM_LIB}_source} ${${ADM_LIB}_resource}) + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../ADM_filters ) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../ADM_filters ) +ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/fonts/DSEG-LICENSE.txt b/avidemux/qt4/ADM_userInterfaces/ADM_gui/fonts/DSEG-LICENSE.txt index ad4c0bf52a..a6c8ffd307 100755 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/fonts/DSEG-LICENSE.txt +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/fonts/DSEG-LICENSE.txt @@ -1,95 +1,95 @@ -Copyright (c) 2017, keshikan (http://www.keshikan.net), -with Reserved Font Name "DSEG". - - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. +Copyright (c) 2017, keshikan (http://www.keshikan.net), +with Reserved Font Name "DSEG". + + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_ocr/CMakeLists.txt b/avidemux/qt4/ADM_userInterfaces/ADM_ocr/CMakeLists.txt index f2493d5730..86a6e31757 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_ocr/CMakeLists.txt +++ b/avidemux/qt4/ADM_userInterfaces/ADM_ocr/CMakeLists.txt @@ -1,12 +1,12 @@ -SET(ADM_LIB ADM_ocrQt4) - -ADM_QT_WRAP_UI(${ADM_LIB}_header ocr.ui) -ADM_QT_WRAP_CPP(${ADM_LIB}_source Q_ocr.h) - -SET(${ADM_LIB}_SRCS - Q_ocr.cpp ${${ADM_LIB}_header} ${${ADM_LIB}_source}) - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/avidemux/ADM_UIs/ADM_QT4/include") -ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) +SET(ADM_LIB ADM_ocrQt4) + +ADM_QT_WRAP_UI(${ADM_LIB}_header ocr.ui) +ADM_QT_WRAP_CPP(${ADM_LIB}_source Q_ocr.h) + +SET(${ADM_LIB}_SRCS + Q_ocr.cpp ${${ADM_LIB}_header} ${${ADM_LIB}_source}) + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/avidemux/ADM_UIs/ADM_QT4/include") +ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) diff --git a/avidemux/qt4/CMakeLists.txt b/avidemux/qt4/CMakeLists.txt index 39a8ce25a4..d06aaa7845 100755 --- a/avidemux/qt4/CMakeLists.txt +++ b/avidemux/qt4/CMakeLists.txt @@ -1,255 +1,255 @@ -cmake_minimum_required(VERSION 3.7) - -PROJECT(Avidemux_Qt) - -set(ORIGINAL_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}") -set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake" "${CMAKE_MODULE_PATH}") -include(avidemuxVersion) - -MESSAGE("") -MESSAGE("#########################################") -MESSAGE("Configure for Avidemux Qt Started") -MESSAGE("#########################################") -MESSAGE("") -MESSAGE(STATUS "Checking for avidemux development files ..") - -IF(NOT FAKEROOT) - SET(AVIDEMUX_FAKEROOT "") -else(NOT FAKEROOT) - SET(AVIDEMUX_FAKEROOT "${FAKEROOT}") -endif(NOT FAKEROOT) - - -IF(WIN32) - IF(MSVC) - include(adm_win32_vs.cmake) - ELSE(MSVC) - include(adm_win32_mingw.cmake) - ENDIF(MSVC) -ELSE(WIN32) - IF(APPLE) - # Silence missing nullability specifier warnings on macOS - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-nullability-completeness") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nullability-completeness") - include(adm_osx.cmake) - ELSE(APPLE) - include(adm_default.cmake) - ENDIF(APPLE) -ENDIF(WIN32) -#----------------------------------- -# Set extra libs, system dependant -#----------------------------------- -ADM_PREBUILD() - -# Locate commonCmakeApplication.cmake -SET(ADM_HEADER_DIR ${AVIDEMUX_FAKEROOT}${CMAKE_INSTALL_PREFIX}/include/avidemux/${AVIDEMUX_API_VERSION}) -SET(ADM_CMAKE_DIR ${ADM_HEADER_DIR}/cmake) -SET(CMAKE_MODULE_PATH "${ADM_CMAKE_DIR}" "${ORIGINAL_CMAKE_MODULE_PATH}") -MESSAGE(STATUS "Checking for avidemux include folder (i.e. CMAKE_INSTALL_PREFIX/include/avidemux/${AVIDEMUX_API_VERSION}, looking in ${ADM_HEADER_DIR}") -if(NOT EXISTS "${ADM_HEADER_DIR}") - MESSAGE(STATUS "Make sure you installed all the files.\n i cannot find avidemux include folder.cmake .\nSet CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") - MESSAGE(FATAL_ERROR "Aborting") -endif(NOT EXISTS "${ADM_HEADER_DIR}") - -MESSAGE(STATUS "Found avidemux include folder. good.") -MESSAGE(STATUS "Checking for cmake subfolder") - -if(NOT EXISTS "${ADM_CMAKE_DIR}/commonCmakeApplication.cmake") - MESSAGE(STATUS "Make sure you installed all the files.\n I cannot find content of the cmake subfolder .\n") - MESSAGE(STATUS "Set CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") - MESSAGE(STATUS "I was looking for commonCmakeApplication.cmake in ${ADM_CMAKE_DIR}") - MESSAGE(FATAL_ERROR "Aborting") -endif(NOT EXISTS "${ADM_CMAKE_DIR}/commonCmakeApplication.cmake") -MESSAGE(STATUS "Found cmake subfolder.good.") - -include(commonCmakeApplication) -include(../admAppSettings.cmake) -INCLUDE(admCheckQt) -INCLUDE(admWindRes) - -MESSAGE(STATUS "Checking Qt") -checkQt() - -IF (NOT QT_FOUND) - MESSAGE(FATAL_ERROR "Qt NOT FOUND") -ENDIF (NOT QT_FOUND) - -# Qt4 openGL -include(admCheckOpenGl) -# -#-- -MESSAGE(STATUS "Adding Qt inc paths : <${QT_INCLUDES}> and definitions <${QT_DEFINITIONS}>") -INCLUDE_DIRECTORIES(${QT_INCLUDES}) -ADD_DEFINITIONS(${QT_DEFINITIONS}) -#-- - -# -# ######################################### -# Config -# ######################################### -ADD_DEFINITIONS(-DADM_UI_TYPE_BUILD=ADM_UI_QT4) -SET(CONFIG_HEADER_TYPE ADM_BUILD_QT4) -SET(UI_SUFFIX ${QT_EXTENSION}) -IF (${QT_EXTENSION} STREQUAL "qt6") - SET(CMAKE_CXX_STANDARD 17) - SET(CMAKE_CXX_STANDARD_REQUIRED ON) - SET(CMAKE_CXX_EXTENSIONS OFF) -ENDIF (${QT_EXTENSION} STREQUAL "qt6") - - -CONFIGURE_FILE("${ADM_CMAKE_DIR}/config.h.cmake" "${CMAKE_BINARY_DIR}/config/${QT_EXTENSION}/config.h") -MESSAGE(STATUS "${QT_EXTENSION} config.h generated") - -INCLUDE_DIRECTORIES(BEFORE "${CMAKE_BINARY_DIR}/config/${QT_EXTENSION}/") - - -# ########################################## -# Add job control -# ########################################## -ADD_SUBDIRECTORY(ADM_jobs) -ADD_SUBDIRECTORY(ADM_update) -IF(USE_OPENGL) - ADD_SUBDIRECTORY(ADM_openGL) -ENDIF(USE_OPENGL) - -# ########################################## -# Custom fixed width font for time display -# ########################################## -if (NOT WIN32) - SET(USE_CUSTOM_TIME_DISPLAY_FONT 1) -endif (NOT WIN32) - -# ####################################### -# Add common as a symlink or directly -# ####################################### -INCLUDE_DIRECTORIES(ADM_UIs/include/) - -if (WIN32 AND NOT CROSS) - ADD_SUBDIRECTORY(../common ./commonQt4) -else (WIN32 AND NOT CROSS) - # Make symlink else eclipe and kdev4 are puzzled by the tree structure - # Not needed for plain build - MESSAGE(STATUS "Creating common symlink in ${CMAKE_CURRENT_SOURCE_DIR}") - - execute_process(COMMAND rm -f common - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - execute_process(COMMAND ln -s ../common . - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - - ADD_SUBDIRECTORY(common ./commonQt4) -endif (WIN32 AND NOT CROSS) - -# Add misc subdirs -ADD_SUBDIRECTORY(ADM_UIs ./ADM_UIsQt4) -ADD_SUBDIRECTORY(ADM_userInterfaces ./ADM_userInterfaces${QT_LIBRARY_EXTENSION}) - -SDLify(../common/main.cpp) -if (ADM_SUBVERSION) - ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_SUBVERSION=\"${ADM_SUBVERSION}\"") -endif (ADM_SUBVERSION) -ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_VERSION=\"${AVIDEMUX_VERSION}\"") -ADD_SOURCE_CFLAGS(../common/main.cpp "-DQT_FLAVOR=\"${QT_EXTENSION}\"") - -# ########################################## -# Icon for windows -# ########################################## -if (WIN32 ) - WINDRESIFY(mainQt "${CMAKE_CURRENT_SOURCE_DIR}/../common/xpm/adm.ico" src "avidemux" "Avidemux Video Editor") - SET(ADM_EXE_SRCS ${ADM_EXE_SRCS} ${src}) -endif (WIN32) - -# ########################################## -# Executable -# ########################################## -include_directories("${PTHREAD_INCLUDE_DIR}") - -ADM_MAIN_APP() - -# ########################################## -# Construct common libraries -# ########################################## -FOREACH (_libName ${commonLibs1}) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${_libName}) -ENDFOREACH (_libName ${commonLibs1}) - -FOREACH (_libName ${commonLibs2}) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${_libName}) -ENDFOREACH (_libName ${commonLibs2}) - -FOREACH (_libName ${coreLibs}) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${_libName}) -ENDFOREACH (_libName ${coreLibs}) - - - -# ############################################ -# Add qt specific libs -# ############################################ -TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} - ADM_gui${QT_LIBRARY_EXTENSION} - ADM_filters${QT_LIBRARY_EXTENSION} - ADM_UI${QT_LIBRARY_EXTENSION}6 - ADM_dialogQt4 - ADM_update${QT_LIBRARY_EXTENSION}6 - ADM_internalVideoFilter6 - ADM_UI${QT_LIBRARY_EXTENSION}6 - ADM_gui${QT_LIBRARY_EXTENSION} - ADM_UI_${QT_LIBRARY_EXTENSION}6 - ADM_shell${QT_LIBRARY_EXTENSION} - ADM_toolkit6 - ADM_coreAudio6 - ADM_coreAudioDevice6 - ADM_coreVideoEncoder6 - ADM_osSupport6 -) - -# ########################################## -# External libs -# ########################################## -# gettext -IF (GETTEXT_FOUND) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${GETTEXT_LIBRARY_DIR}) -ENDIF (GETTEXT_FOUND) - - -# SDL -IF (USE_SDL) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${SDL2_LIBRARY} ${SDL2_MAIN}) -ENDIF (USE_SDL) - - -# ########################################## -# UI Specific -# ########################################## -TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${PTHREAD_LIBRARIES}) - -TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${PlatformLibs}) - -# -# i18n -# -ADD_SUBDIRECTORY(i18n) -ADM_LINK_THREAD(avidemux3_${QT_EXTENSION}) -# ########################################## -# Install -# ########################################## - -DISPLAY_SUMMARY_LIST() - -ADM_POSTBUILD() -include(admPackager) -admPackager(qt4Package) -INSTALL(FILES ${CMAKE_BINARY_DIR}/config/${QT_EXTENSION}/config.h DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_API_VERSION}/${QT_EXTENSION}" COMPONENT dev) - - -# install headers -ADM_INSTALL_QT_INCLUDE_FOLDER("${CMAKE_CURRENT_SOURCE_DIR}/ADM_openGL/include/" ADM_openGL) -ADM_INSTALL_QT_INCLUDE_FOLDER("${CMAKE_CURRENT_SOURCE_DIR}/ADM_UIs/include/" ADM_UIs) - -# install XDG metadata -if(UNIX AND NOT APPLE) - add_subdirectory(xdg_data) -endif() - -# -MESSAGE("") +cmake_minimum_required(VERSION 3.7) + +PROJECT(Avidemux_Qt) + +set(ORIGINAL_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}") +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake" "${CMAKE_MODULE_PATH}") +include(avidemuxVersion) + +MESSAGE("") +MESSAGE("#########################################") +MESSAGE("Configure for Avidemux Qt Started") +MESSAGE("#########################################") +MESSAGE("") +MESSAGE(STATUS "Checking for avidemux development files ..") + +IF(NOT FAKEROOT) + SET(AVIDEMUX_FAKEROOT "") +else(NOT FAKEROOT) + SET(AVIDEMUX_FAKEROOT "${FAKEROOT}") +endif(NOT FAKEROOT) + + +IF(WIN32) + IF(MSVC) + include(adm_win32_vs.cmake) + ELSE(MSVC) + include(adm_win32_mingw.cmake) + ENDIF(MSVC) +ELSE(WIN32) + IF(APPLE) + # Silence missing nullability specifier warnings on macOS + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-nullability-completeness") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nullability-completeness") + include(adm_osx.cmake) + ELSE(APPLE) + include(adm_default.cmake) + ENDIF(APPLE) +ENDIF(WIN32) +#----------------------------------- +# Set extra libs, system dependant +#----------------------------------- +ADM_PREBUILD() + +# Locate commonCmakeApplication.cmake +SET(ADM_HEADER_DIR ${AVIDEMUX_FAKEROOT}${CMAKE_INSTALL_PREFIX}/include/avidemux/${AVIDEMUX_API_VERSION}) +SET(ADM_CMAKE_DIR ${ADM_HEADER_DIR}/cmake) +SET(CMAKE_MODULE_PATH "${ADM_CMAKE_DIR}" "${ORIGINAL_CMAKE_MODULE_PATH}") +MESSAGE(STATUS "Checking for avidemux include folder (i.e. CMAKE_INSTALL_PREFIX/include/avidemux/${AVIDEMUX_API_VERSION}, looking in ${ADM_HEADER_DIR}") +if(NOT EXISTS "${ADM_HEADER_DIR}") + MESSAGE(STATUS "Make sure you installed all the files.\n i cannot find avidemux include folder.cmake .\nSet CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") + MESSAGE(FATAL_ERROR "Aborting") +endif(NOT EXISTS "${ADM_HEADER_DIR}") + +MESSAGE(STATUS "Found avidemux include folder. good.") +MESSAGE(STATUS "Checking for cmake subfolder") + +if(NOT EXISTS "${ADM_CMAKE_DIR}/commonCmakeApplication.cmake") + MESSAGE(STATUS "Make sure you installed all the files.\n I cannot find content of the cmake subfolder .\n") + MESSAGE(STATUS "Set CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") + MESSAGE(STATUS "I was looking for commonCmakeApplication.cmake in ${ADM_CMAKE_DIR}") + MESSAGE(FATAL_ERROR "Aborting") +endif(NOT EXISTS "${ADM_CMAKE_DIR}/commonCmakeApplication.cmake") +MESSAGE(STATUS "Found cmake subfolder.good.") + +include(commonCmakeApplication) +include(../admAppSettings.cmake) +INCLUDE(admCheckQt) +INCLUDE(admWindRes) + +MESSAGE(STATUS "Checking Qt") +checkQt() + +IF (NOT QT_FOUND) + MESSAGE(FATAL_ERROR "Qt NOT FOUND") +ENDIF (NOT QT_FOUND) + +# Qt4 openGL +include(admCheckOpenGl) +# +#-- +MESSAGE(STATUS "Adding Qt inc paths : <${QT_INCLUDES}> and definitions <${QT_DEFINITIONS}>") +INCLUDE_DIRECTORIES(${QT_INCLUDES}) +ADD_DEFINITIONS(${QT_DEFINITIONS}) +#-- + +# +# ######################################### +# Config +# ######################################### +ADD_DEFINITIONS(-DADM_UI_TYPE_BUILD=ADM_UI_QT4) +SET(CONFIG_HEADER_TYPE ADM_BUILD_QT4) +SET(UI_SUFFIX ${QT_EXTENSION}) +IF (${QT_EXTENSION} STREQUAL "qt6") + SET(CMAKE_CXX_STANDARD 17) + SET(CMAKE_CXX_STANDARD_REQUIRED ON) + SET(CMAKE_CXX_EXTENSIONS OFF) +ENDIF (${QT_EXTENSION} STREQUAL "qt6") + + +CONFIGURE_FILE("${ADM_CMAKE_DIR}/config.h.cmake" "${CMAKE_BINARY_DIR}/config/${QT_EXTENSION}/config.h") +MESSAGE(STATUS "${QT_EXTENSION} config.h generated") + +INCLUDE_DIRECTORIES(BEFORE "${CMAKE_BINARY_DIR}/config/${QT_EXTENSION}/") + + +# ########################################## +# Add job control +# ########################################## +ADD_SUBDIRECTORY(ADM_jobs) +ADD_SUBDIRECTORY(ADM_update) +IF(USE_OPENGL) + ADD_SUBDIRECTORY(ADM_openGL) +ENDIF(USE_OPENGL) + +# ########################################## +# Custom fixed width font for time display +# ########################################## +if (NOT WIN32) + SET(USE_CUSTOM_TIME_DISPLAY_FONT 1) +endif (NOT WIN32) + +# ####################################### +# Add common as a symlink or directly +# ####################################### +INCLUDE_DIRECTORIES(ADM_UIs/include/) + +if (WIN32 AND NOT CROSS) + ADD_SUBDIRECTORY(../common ./commonQt4) +else (WIN32 AND NOT CROSS) + # Make symlink else eclipe and kdev4 are puzzled by the tree structure + # Not needed for plain build + MESSAGE(STATUS "Creating common symlink in ${CMAKE_CURRENT_SOURCE_DIR}") + + execute_process(COMMAND rm -f common + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + execute_process(COMMAND ln -s ../common . + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + + ADD_SUBDIRECTORY(common ./commonQt4) +endif (WIN32 AND NOT CROSS) + +# Add misc subdirs +ADD_SUBDIRECTORY(ADM_UIs ./ADM_UIsQt4) +ADD_SUBDIRECTORY(ADM_userInterfaces ./ADM_userInterfaces${QT_LIBRARY_EXTENSION}) + +SDLify(../common/main.cpp) +if (ADM_SUBVERSION) + ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_SUBVERSION=\"${ADM_SUBVERSION}\"") +endif (ADM_SUBVERSION) +ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_VERSION=\"${AVIDEMUX_VERSION}\"") +ADD_SOURCE_CFLAGS(../common/main.cpp "-DQT_FLAVOR=\"${QT_EXTENSION}\"") + +# ########################################## +# Icon for windows +# ########################################## +if (WIN32 ) + WINDRESIFY(mainQt "${CMAKE_CURRENT_SOURCE_DIR}/../common/xpm/adm.ico" src "avidemux" "Avidemux Video Editor") + SET(ADM_EXE_SRCS ${ADM_EXE_SRCS} ${src}) +endif (WIN32) + +# ########################################## +# Executable +# ########################################## +include_directories("${PTHREAD_INCLUDE_DIR}") + +ADM_MAIN_APP() + +# ########################################## +# Construct common libraries +# ########################################## +FOREACH (_libName ${commonLibs1}) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${_libName}) +ENDFOREACH (_libName ${commonLibs1}) + +FOREACH (_libName ${commonLibs2}) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${_libName}) +ENDFOREACH (_libName ${commonLibs2}) + +FOREACH (_libName ${coreLibs}) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${_libName}) +ENDFOREACH (_libName ${coreLibs}) + + + +# ############################################ +# Add qt specific libs +# ############################################ +TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} + ADM_gui${QT_LIBRARY_EXTENSION} + ADM_filters${QT_LIBRARY_EXTENSION} + ADM_UI${QT_LIBRARY_EXTENSION}6 + ADM_dialogQt4 + ADM_update${QT_LIBRARY_EXTENSION}6 + ADM_internalVideoFilter6 + ADM_UI${QT_LIBRARY_EXTENSION}6 + ADM_gui${QT_LIBRARY_EXTENSION} + ADM_UI_${QT_LIBRARY_EXTENSION}6 + ADM_shell${QT_LIBRARY_EXTENSION} + ADM_toolkit6 + ADM_coreAudio6 + ADM_coreAudioDevice6 + ADM_coreVideoEncoder6 + ADM_osSupport6 +) + +# ########################################## +# External libs +# ########################################## +# gettext +IF (GETTEXT_FOUND) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${GETTEXT_LIBRARY_DIR}) +ENDIF (GETTEXT_FOUND) + + +# SDL +IF (USE_SDL) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${SDL2_LIBRARY} ${SDL2_MAIN}) +ENDIF (USE_SDL) + + +# ########################################## +# UI Specific +# ########################################## +TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${PTHREAD_LIBRARIES}) + +TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${PlatformLibs}) + +# +# i18n +# +ADD_SUBDIRECTORY(i18n) +ADM_LINK_THREAD(avidemux3_${QT_EXTENSION}) +# ########################################## +# Install +# ########################################## + +DISPLAY_SUMMARY_LIST() + +ADM_POSTBUILD() +include(admPackager) +admPackager(qt4Package) +INSTALL(FILES ${CMAKE_BINARY_DIR}/config/${QT_EXTENSION}/config.h DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_API_VERSION}/${QT_EXTENSION}" COMPONENT dev) + + +# install headers +ADM_INSTALL_QT_INCLUDE_FOLDER("${CMAKE_CURRENT_SOURCE_DIR}/ADM_openGL/include/" ADM_openGL) +ADM_INSTALL_QT_INCLUDE_FOLDER("${CMAKE_CURRENT_SOURCE_DIR}/ADM_UIs/include/" ADM_UIs) + +# install XDG metadata +if(UNIX AND NOT APPLE) + add_subdirectory(xdg_data) +endif() + +# +MESSAGE("") diff --git a/avidemux/qt4/old.cmake b/avidemux/qt4/old.cmake index 5f30016fa2..bb0c115ac9 100755 --- a/avidemux/qt4/old.cmake +++ b/avidemux/qt4/old.cmake @@ -1,304 +1,304 @@ -cmake_minimum_required(VERSION 3.7) -SET(AVIDEMUX_API_VERSION 2.7) -SET(ADM_PROJECT Avidemux_qt4) - -MESSAGE("") -MESSAGE("#########################################") -MESSAGE("Configure for Avidemux Qt Started") -MESSAGE("#########################################") -MESSAGE("") -#fedora -ADD_DEFINITIONS("-std=c++11") -MESSAGE(STATUS "Checking for avidemux development files ..") - -IF(NOT FAKEROOT) - SET(AVIDEMUX_FAKEROOT "") -else(NOT FAKEROOT) - SET(AVIDEMUX_FAKEROOT "${FAKEROOT}/") -endif(NOT FAKEROOT) - - -IF(WIN32) - IF(MSVC) - include(adm_win32_vs.cmake) - ELSEIF(MINGW) - include(adm_win32_mingw.cmake) -ELSE(WIN32) - IF(APPLE) - include(adm_osx.cmake) - ELSE(APPLE) - include(adm_default.cmake) - ENDIF(APPLE) -ENDIF(WIN32) -#----------------------------------- -# Set extra libs, system dependant -#----------------------------------- -# -- Windows -- -IF(WIN32) - IF(MSVC) - LIST(APPEND PlatformLibs Qt5::WinMain) - ENDIF(MSVC) - IF(MINGW) - LIST(APPEND PlatformLibs "-lm -lstdc++") - LIST(APPEND PlatformLibs "winmm -mwindows -Wl,--export-all-symbols") - ENDIF (MINGW) -# -- Windows -- -ELSE(WIN32) # OSx, linux, BSD - LIST(APPEND PlatformLibs "-lm -lstdc++") - IF(APPLE) # OSX - LIST(APPEND PlatformLibs "-framework CoreServices -framework CoreAudio -framework AudioUnit -framework Carbon") - LIST(APPEND PlatformLibs "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib") - ELSE(APPLE) - LIST(APPEND PlatformLibs "X11") # Linux, BSD - ENDIF(APPLE) -ENDIF(WIN32) - -# -# -SET(ADM_HEADER_DIR ${AVIDEMUX_FAKEROOT}${CMAKE_INSTALL_PREFIX}/include/avidemux/${AVIDEMUX_API_VERSION}) -SET(ADM_CMAKE_DIR ${ADM_HEADER_DIR}/cmake) -# Common definitions... -SET(CMAKE_MODULE_PATH "${ADM_CMAKE_DIR}" "${CMAKE_MODULE_PATH}") -MESSAGE(STATUS "Checking for avidemux include folder (i.e. CMAKE_INSTALL_PREFIX/include/avidemux/${AVIDEMUX_API_VERSION}, looking in ${ADM_HEADER_DIR}") -if(NOT EXISTS "${ADM_HEADER_DIR}") - MESSAGE(STATUS "Make sure you installed all the files.\n i cannot find avidemux include folder.cmake .\nSet CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") - MESSAGE(FATAL_ERROR "Aborting") -endif(NOT EXISTS "${ADM_HEADER_DIR}") - -MESSAGE(STATUS "Found avidemux include folder. good.") -MESSAGE(STATUS "Checking for cmake subfolder") - -if(NOT EXISTS "${ADM_CMAKE_DIR}/commonCmakeApplication.cmake") - MESSAGE(STATUS "Make sure you installed all the files.\n I cannot find content of the cmake subfolder .\n") - MESSAGE(STATUS "Set CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") - MESSAGE(STATUS "I was looking for commonCmakeApplication.cmake in ${ADM_CMAKE_DIR}") - MESSAGE(FATAL_ERROR "Aborting") -endif(NOT EXISTS "${ADM_CMAKE_DIR}/commonCmakeApplication.cmake") -MESSAGE(STATUS "Found cmake subfolder.good.") - -include(commonCmakeApplication) -include(../admAppSettings.cmake) -INCLUDE(admCheckQt) -INCLUDE(admWindRes) - -MESSAGE(STATUS "Checking Qt") -checkQt() - -IF (NOT QT_FOUND) - MESSAGE(FATAL_ERROR "Qt NOT FOUND") -ENDIF (NOT QT_FOUND) - -# Qt4 openGL -include(admCheckOpenGl) -# -#-- -MESSAGE(STATUS "Adding Qt inc paths : <${QT_INCLUDES}> and definitions <${QT_DEFINITIONS}>") -INCLUDE_DIRECTORIES(${QT_INCLUDES}) -ADD_DEFINITIONS(${QT_DEFINITIONS}) -#-- - -# -########################################## -# Config -########################################## -ADD_DEFINITIONS(-DADM_UI_TYPE_BUILD=ADM_UI_QT4) -SET(CONFIG_HEADER_TYPE ADM_BUILD_QT4) -SET(UI_SUFFIX ${QT_EXTENSION}) - -CONFIGURE_FILE("${ADM_CMAKE_DIR}/config.h.cmake" "${CMAKE_BINARY_DIR}/config/${QT_EXTENSION}/config.h") -MESSAGE(STATUS "${QT_EXTENSION} config.h generated") - -INCLUDE_DIRECTORIES(BEFORE "${CMAKE_BINARY_DIR}/config/${QT_EXTENSION}/") - - -########################################### -# Add job control -########################################### -IF(NOT MSVC) - ADD_SUBDIRECTORY(ADM_jobs) -ENDIF(NOT MSVC) -ADD_SUBDIRECTORY(ADM_update) -IF(USE_OPENGL) - ADD_SUBDIRECTORY(ADM_openGL) -ENDIF(USE_OPENGL) - -######################################## -# Add common as a symlink or directly -######################################## -INCLUDE_DIRECTORIES(ADM_UIs/include/) - -if (WIN32 AND NOT CROSS) - ADD_SUBDIRECTORY(../common ./commonQt4) -else (WIN32 AND NOT CROSS) - # Make symlink else eclipe and kdev4 are puzzled by the tree structure - # Not needed for plain build - MESSAGE(STATUS "Creating common symlink in ${CMAKE_CURRENT_SOURCE_DIR}") - - execute_process(COMMAND rm -f common - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - execute_process(COMMAND ln -s ../common . - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - - ADD_SUBDIRECTORY(common ./commonQt4) -endif (WIN32 AND NOT CROSS) - -# Add misc subdirs -ADD_SUBDIRECTORY(ADM_UIs ./ADM_UIsQt4) -ADD_SUBDIRECTORY(ADM_userInterfaces ./ADM_userInterfaces${QT_LIBRARY_EXTENSION}) - -SDLify(../common/main.cpp) -if (ADM_SUBVERSION) - ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_SUBVERSION=\"${ADM_SUBVERSION}\"") -endif (ADM_SUBVERSION) -ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_VERSION=\"${AVIDEMUX_VERSION}\"") -ADD_SOURCE_CFLAGS(../common/main.cpp "-DQT_FLAVOR=\"${QT_EXTENSION}\"") - -########################################### -# Icon for windows -########################################### -if (WIN32 ) - WINDRESIFY(src) - SET(ADM_EXE_SRCS ${ADM_EXE_SRCS} ${src}) -endif (WIN32) - -########################################### -# Executable -########################################### -include_directories("${PTHREAD_INCLUDE_DIR}") -IF(MSVC) - SET(EXEC_TYPE "WIN32") -ENDIF(MSVC) -ADD_EXECUTABLE(avidemux3_${QT_EXTENSION} ${EXEC_TYPE} ${ADM_EXE_SRCS}) -IF(MSVC) - set_target_properties(avidemux3_${QT_EXTENSION} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS") - set_target_properties(avidemux3_${QT_EXTENSION} PROPERTIES WIN32_EXECUTABLE True) -ENDIF(MSVC) -########################################### -# Construct common libraries -########################################### -FOREACH (_libName ${commonLibs1}) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${_libName}) -ENDFOREACH (_libName ${commonLibs1}) - -FOREACH (_libName ${commonLibs2}) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${_libName}) -ENDFOREACH (_libName ${commonLibs2}) - -FOREACH (_libName ${coreLibs}) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${_libName}) -ENDFOREACH (_libName ${coreLibs}) - - - -############################################# -# Add qt specific libs -############################################# -TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} - ADM_gui${QT_LIBRARY_EXTENSION} - ADM_filters${QT_LIBRARY_EXTENSION} - ADM_UI${QT_LIBRARY_EXTENSION}6 - ADM_dialogQt4 - ADM_update${QT_LIBRARY_EXTENSION}6 - ADM_internalVideoFilter6 - ADM_UI${QT_LIBRARY_EXTENSION}6 - ADM_gui${QT_LIBRARY_EXTENSION} - ADM_UI_${QT_LIBRARY_EXTENSION}6 - ADM_shell${QT_LIBRARY_EXTENSION} - ADM_toolkit6 - ADM_coreAudio6 - ADM_coreAudioDevice6 - ADM_osSupport6 -) - -########################################### -# External libs -########################################### -# gettext -IF (GETTEXT_FOUND) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${GETTEXT_LIBRARY_DIR}) -ENDIF (GETTEXT_FOUND) - - -# SDL -IF (USE_SDL) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${SDL2_LIBRARY} ${SDL2_MAIN}) -ENDIF (USE_SDL) - - -########################################### -# UI Specific -########################################### -TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${PTHREAD_LIBRARIES}) - -########################################### -# OS Specific -########################################### -if (WIN32 OR APPLE) - set_property(TARGET avidemux3_${QT_EXTENSION} PROPERTY OUTPUT_NAME avidemux) -endif (WIN32 OR APPLE) - - -IF (APPLE) - IF (USE_SDL) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_libsdl) - ENDIF(USE_SDL) -ENDIF (APPLE) -# -# Needed for cross compiling -# -if(CROSS) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_UI_${QT_LIBRARY_EXTENSION}6) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_UI_${QT_LIBRARY_EXTENSION}6) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_render6_${QT_LIBRARY_EXTENSION}) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_coreUtils6) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_core6) - TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_core6) -endif(CROSS) - -TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${PlatformLibs}) - - -IF(QT_QTOPENGL_FOUND) - target_link_libraries(avidemux3_${QT_EXTENSION} ${QT_QTOPENGL_LIBRARIES}) -ENDIF(QT_QTOPENGL_FOUND) -# -# i18n -# -ADD_SUBDIRECTORY(i18n) -########################################### -# Install -########################################### -ADM_LINK_THREAD(avidemux3_${QT_EXTENSION}) -ADM_INSTALL_BIN(avidemux3_${QT_EXTENSION}) - -DISPLAY_SUMMARY_LIST() - -IF(MSVC) - include(./installMsvcRunTime.cmake) -ENDIF(MSVC) -include(admPackager) -admPackager(qt4Package) -INSTALL(FILES ${CMAKE_BINARY_DIR}/config/${QT_EXTENSION}/config.h DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_API_VERSION}/${QT_EXTENSION}" COMPONENT dev) - - -# install headers -ADM_INSTALL_QT_INCLUDE_FOLDER("${CMAKE_CURRENT_SOURCE_DIR}/ADM_openGL/include/" ADM_openGL) -ADM_INSTALL_QT_INCLUDE_FOLDER("${CMAKE_CURRENT_SOURCE_DIR}/ADM_UIs/include/" ADM_UIs) - -# -IF(WIN32) - include(FindBourne) - IF(RELEASE) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/../winInstaller/ChangeLog.release - ${CMAKE_CURRENT_SOURCE_DIR}/../winInstaller/ChangeLog.html - COPYONLY) - ELSE(RELEASE) - execute_process( - COMMAND ${BASH_EXECUTABLE} genlog.sh - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../winInstaller/ - ) - ENDIF(RELEASE) -ENDIF(WIN32) - -MESSAGE("") +cmake_minimum_required(VERSION 3.7) +SET(AVIDEMUX_API_VERSION 2.7) +SET(ADM_PROJECT Avidemux_qt4) + +MESSAGE("") +MESSAGE("#########################################") +MESSAGE("Configure for Avidemux Qt Started") +MESSAGE("#########################################") +MESSAGE("") +#fedora +ADD_DEFINITIONS("-std=c++11") +MESSAGE(STATUS "Checking for avidemux development files ..") + +IF(NOT FAKEROOT) + SET(AVIDEMUX_FAKEROOT "") +else(NOT FAKEROOT) + SET(AVIDEMUX_FAKEROOT "${FAKEROOT}/") +endif(NOT FAKEROOT) + + +IF(WIN32) + IF(MSVC) + include(adm_win32_vs.cmake) + ELSEIF(MINGW) + include(adm_win32_mingw.cmake) +ELSE(WIN32) + IF(APPLE) + include(adm_osx.cmake) + ELSE(APPLE) + include(adm_default.cmake) + ENDIF(APPLE) +ENDIF(WIN32) +#----------------------------------- +# Set extra libs, system dependant +#----------------------------------- +# -- Windows -- +IF(WIN32) + IF(MSVC) + LIST(APPEND PlatformLibs Qt5::WinMain) + ENDIF(MSVC) + IF(MINGW) + LIST(APPEND PlatformLibs "-lm -lstdc++") + LIST(APPEND PlatformLibs "winmm -mwindows -Wl,--export-all-symbols") + ENDIF (MINGW) +# -- Windows -- +ELSE(WIN32) # OSx, linux, BSD + LIST(APPEND PlatformLibs "-lm -lstdc++") + IF(APPLE) # OSX + LIST(APPEND PlatformLibs "-framework CoreServices -framework CoreAudio -framework AudioUnit -framework Carbon") + LIST(APPEND PlatformLibs "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib") + ELSE(APPLE) + LIST(APPEND PlatformLibs "X11") # Linux, BSD + ENDIF(APPLE) +ENDIF(WIN32) + +# +# +SET(ADM_HEADER_DIR ${AVIDEMUX_FAKEROOT}${CMAKE_INSTALL_PREFIX}/include/avidemux/${AVIDEMUX_API_VERSION}) +SET(ADM_CMAKE_DIR ${ADM_HEADER_DIR}/cmake) +# Common definitions... +SET(CMAKE_MODULE_PATH "${ADM_CMAKE_DIR}" "${CMAKE_MODULE_PATH}") +MESSAGE(STATUS "Checking for avidemux include folder (i.e. CMAKE_INSTALL_PREFIX/include/avidemux/${AVIDEMUX_API_VERSION}, looking in ${ADM_HEADER_DIR}") +if(NOT EXISTS "${ADM_HEADER_DIR}") + MESSAGE(STATUS "Make sure you installed all the files.\n i cannot find avidemux include folder.cmake .\nSet CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") + MESSAGE(FATAL_ERROR "Aborting") +endif(NOT EXISTS "${ADM_HEADER_DIR}") + +MESSAGE(STATUS "Found avidemux include folder. good.") +MESSAGE(STATUS "Checking for cmake subfolder") + +if(NOT EXISTS "${ADM_CMAKE_DIR}/commonCmakeApplication.cmake") + MESSAGE(STATUS "Make sure you installed all the files.\n I cannot find content of the cmake subfolder .\n") + MESSAGE(STATUS "Set CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") + MESSAGE(STATUS "I was looking for commonCmakeApplication.cmake in ${ADM_CMAKE_DIR}") + MESSAGE(FATAL_ERROR "Aborting") +endif(NOT EXISTS "${ADM_CMAKE_DIR}/commonCmakeApplication.cmake") +MESSAGE(STATUS "Found cmake subfolder.good.") + +include(commonCmakeApplication) +include(../admAppSettings.cmake) +INCLUDE(admCheckQt) +INCLUDE(admWindRes) + +MESSAGE(STATUS "Checking Qt") +checkQt() + +IF (NOT QT_FOUND) + MESSAGE(FATAL_ERROR "Qt NOT FOUND") +ENDIF (NOT QT_FOUND) + +# Qt4 openGL +include(admCheckOpenGl) +# +#-- +MESSAGE(STATUS "Adding Qt inc paths : <${QT_INCLUDES}> and definitions <${QT_DEFINITIONS}>") +INCLUDE_DIRECTORIES(${QT_INCLUDES}) +ADD_DEFINITIONS(${QT_DEFINITIONS}) +#-- + +# +########################################## +# Config +########################################## +ADD_DEFINITIONS(-DADM_UI_TYPE_BUILD=ADM_UI_QT4) +SET(CONFIG_HEADER_TYPE ADM_BUILD_QT4) +SET(UI_SUFFIX ${QT_EXTENSION}) + +CONFIGURE_FILE("${ADM_CMAKE_DIR}/config.h.cmake" "${CMAKE_BINARY_DIR}/config/${QT_EXTENSION}/config.h") +MESSAGE(STATUS "${QT_EXTENSION} config.h generated") + +INCLUDE_DIRECTORIES(BEFORE "${CMAKE_BINARY_DIR}/config/${QT_EXTENSION}/") + + +########################################### +# Add job control +########################################### +IF(NOT MSVC) + ADD_SUBDIRECTORY(ADM_jobs) +ENDIF(NOT MSVC) +ADD_SUBDIRECTORY(ADM_update) +IF(USE_OPENGL) + ADD_SUBDIRECTORY(ADM_openGL) +ENDIF(USE_OPENGL) + +######################################## +# Add common as a symlink or directly +######################################## +INCLUDE_DIRECTORIES(ADM_UIs/include/) + +if (WIN32 AND NOT CROSS) + ADD_SUBDIRECTORY(../common ./commonQt4) +else (WIN32 AND NOT CROSS) + # Make symlink else eclipe and kdev4 are puzzled by the tree structure + # Not needed for plain build + MESSAGE(STATUS "Creating common symlink in ${CMAKE_CURRENT_SOURCE_DIR}") + + execute_process(COMMAND rm -f common + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + execute_process(COMMAND ln -s ../common . + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + + ADD_SUBDIRECTORY(common ./commonQt4) +endif (WIN32 AND NOT CROSS) + +# Add misc subdirs +ADD_SUBDIRECTORY(ADM_UIs ./ADM_UIsQt4) +ADD_SUBDIRECTORY(ADM_userInterfaces ./ADM_userInterfaces${QT_LIBRARY_EXTENSION}) + +SDLify(../common/main.cpp) +if (ADM_SUBVERSION) + ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_SUBVERSION=\"${ADM_SUBVERSION}\"") +endif (ADM_SUBVERSION) +ADD_SOURCE_CFLAGS(../common/main.cpp "-DADM_VERSION=\"${AVIDEMUX_VERSION}\"") +ADD_SOURCE_CFLAGS(../common/main.cpp "-DQT_FLAVOR=\"${QT_EXTENSION}\"") + +########################################### +# Icon for windows +########################################### +if (WIN32 ) + WINDRESIFY(src) + SET(ADM_EXE_SRCS ${ADM_EXE_SRCS} ${src}) +endif (WIN32) + +########################################### +# Executable +########################################### +include_directories("${PTHREAD_INCLUDE_DIR}") +IF(MSVC) + SET(EXEC_TYPE "WIN32") +ENDIF(MSVC) +ADD_EXECUTABLE(avidemux3_${QT_EXTENSION} ${EXEC_TYPE} ${ADM_EXE_SRCS}) +IF(MSVC) + set_target_properties(avidemux3_${QT_EXTENSION} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS") + set_target_properties(avidemux3_${QT_EXTENSION} PROPERTIES WIN32_EXECUTABLE True) +ENDIF(MSVC) +########################################### +# Construct common libraries +########################################### +FOREACH (_libName ${commonLibs1}) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${_libName}) +ENDFOREACH (_libName ${commonLibs1}) + +FOREACH (_libName ${commonLibs2}) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${_libName}) +ENDFOREACH (_libName ${commonLibs2}) + +FOREACH (_libName ${coreLibs}) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${_libName}) +ENDFOREACH (_libName ${coreLibs}) + + + +############################################# +# Add qt specific libs +############################################# +TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} + ADM_gui${QT_LIBRARY_EXTENSION} + ADM_filters${QT_LIBRARY_EXTENSION} + ADM_UI${QT_LIBRARY_EXTENSION}6 + ADM_dialogQt4 + ADM_update${QT_LIBRARY_EXTENSION}6 + ADM_internalVideoFilter6 + ADM_UI${QT_LIBRARY_EXTENSION}6 + ADM_gui${QT_LIBRARY_EXTENSION} + ADM_UI_${QT_LIBRARY_EXTENSION}6 + ADM_shell${QT_LIBRARY_EXTENSION} + ADM_toolkit6 + ADM_coreAudio6 + ADM_coreAudioDevice6 + ADM_osSupport6 +) + +########################################### +# External libs +########################################### +# gettext +IF (GETTEXT_FOUND) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${GETTEXT_LIBRARY_DIR}) +ENDIF (GETTEXT_FOUND) + + +# SDL +IF (USE_SDL) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${SDL2_LIBRARY} ${SDL2_MAIN}) +ENDIF (USE_SDL) + + +########################################### +# UI Specific +########################################### +TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${PTHREAD_LIBRARIES}) + +########################################### +# OS Specific +########################################### +if (WIN32 OR APPLE) + set_property(TARGET avidemux3_${QT_EXTENSION} PROPERTY OUTPUT_NAME avidemux) +endif (WIN32 OR APPLE) + + +IF (APPLE) + IF (USE_SDL) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_libsdl) + ENDIF(USE_SDL) +ENDIF (APPLE) +# +# Needed for cross compiling +# +if(CROSS) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_UI_${QT_LIBRARY_EXTENSION}6) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_UI_${QT_LIBRARY_EXTENSION}6) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_render6_${QT_LIBRARY_EXTENSION}) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_coreUtils6) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_core6) + TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ADM_core6) +endif(CROSS) + +TARGET_LINK_LIBRARIES(avidemux3_${QT_EXTENSION} ${PlatformLibs}) + + +IF(QT_QTOPENGL_FOUND) + target_link_libraries(avidemux3_${QT_EXTENSION} ${QT_QTOPENGL_LIBRARIES}) +ENDIF(QT_QTOPENGL_FOUND) +# +# i18n +# +ADD_SUBDIRECTORY(i18n) +########################################### +# Install +########################################### +ADM_LINK_THREAD(avidemux3_${QT_EXTENSION}) +ADM_INSTALL_BIN(avidemux3_${QT_EXTENSION}) + +DISPLAY_SUMMARY_LIST() + +IF(MSVC) + include(./installMsvcRunTime.cmake) +ENDIF(MSVC) +include(admPackager) +admPackager(qt4Package) +INSTALL(FILES ${CMAKE_BINARY_DIR}/config/${QT_EXTENSION}/config.h DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_API_VERSION}/${QT_EXTENSION}" COMPONENT dev) + + +# install headers +ADM_INSTALL_QT_INCLUDE_FOLDER("${CMAKE_CURRENT_SOURCE_DIR}/ADM_openGL/include/" ADM_openGL) +ADM_INSTALL_QT_INCLUDE_FOLDER("${CMAKE_CURRENT_SOURCE_DIR}/ADM_UIs/include/" ADM_UIs) + +# +IF(WIN32) + include(FindBourne) + IF(RELEASE) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/../winInstaller/ChangeLog.release + ${CMAKE_CURRENT_SOURCE_DIR}/../winInstaller/ChangeLog.html + COPYONLY) + ELSE(RELEASE) + execute_process( + COMMAND ${BASH_EXECUTABLE} genlog.sh + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../winInstaller/ + ) + ENDIF(RELEASE) +ENDIF(WIN32) + +MESSAGE("") diff --git a/avidemux/winInstaller/Build-Info.txt b/avidemux/winInstaller/Build-Info.txt index b06635afee..ab8f8cd52a 100644 --- a/avidemux/winInstaller/Build-Info.txt +++ b/avidemux/winInstaller/Build-Info.txt @@ -1,27 +1,27 @@ -Avidemux 2.7.7 ------------------------ -Built using GCC 5.5.0 -Packaged with NSIS 3.04 - -Included libraries: -Aften git-89aee3d496bb2a89f046025402626ee12a12969f -libaom 2.0.0 -Expat 2.2.9 -FAAD2 2.8.8 -fontconfig 2.13.1 -freetype 2.10.2 -FriBidi 1.0.8 -LAME 3.100 -libogg 1.3.4 -libvorbis 1.3.6 -libvpx 1.8.2 -opencore-amr 0.1.3 -opus 1.3.1 -Qt 5.15.0 -SDL2 2.0.12 -SQLite 3320200 -TwoLAME 0.3.13 -x264 r2870 -x265 3.4 -xvidcore 1.3.4 -zlib 1.2.11 +Avidemux 2.7.7 +----------------------- +Built using GCC 5.5.0 +Packaged with NSIS 3.04 + +Included libraries: +Aften git-89aee3d496bb2a89f046025402626ee12a12969f +libaom 2.0.0 +Expat 2.2.9 +FAAD2 2.8.8 +fontconfig 2.13.1 +freetype 2.10.2 +FriBidi 1.0.8 +LAME 3.100 +libogg 1.3.4 +libvorbis 1.3.6 +libvpx 1.8.2 +opencore-amr 0.1.3 +opus 1.3.1 +Qt 5.15.0 +SDL2 2.0.12 +SQLite 3320200 +TwoLAME 0.3.13 +x264 r2870 +x265 3.4 +xvidcore 1.3.4 +zlib 1.2.11 diff --git a/avidemux/winInstaller/InstallOptions.ini b/avidemux/winInstaller/InstallOptions.ini index e2869242d3..786c3fa49c 100644 --- a/avidemux/winInstaller/InstallOptions.ini +++ b/avidemux/winInstaller/InstallOptions.ini @@ -1,37 +1,37 @@ -[Settings] -NumFields=4 - -[Field 1] -Type=label -Text=Create icons for Avidemux: -Left=0 -Right=-1 -Top=10 -Bottom=20 - -[Field 2] -Type=checkbox -Text=On my &Desktop -Left=12 -Right=-1 -Top=28 -Bottom=38 -State=1 - -[Field 3] -Type=checkbox -Text=In my &Start Menu Programs folder -Left=12 -Right=-1 -Top=46 -Bottom=56 -State=1 - -[Field 4] -Type=checkbox -Text=In my &Quick Launch bar -Left=12 -Right=-1 -Top=64 -Bottom=74 +[Settings] +NumFields=4 + +[Field 1] +Type=label +Text=Create icons for Avidemux: +Left=0 +Right=-1 +Top=10 +Bottom=20 + +[Field 2] +Type=checkbox +Text=On my &Desktop +Left=12 +Right=-1 +Top=28 +Bottom=38 +State=1 + +[Field 3] +Type=checkbox +Text=In my &Start Menu Programs folder +Left=12 +Right=-1 +Top=46 +Bottom=56 +State=1 + +[Field 4] +Type=checkbox +Text=In my &Quick Launch bar +Left=12 +Right=-1 +Top=64 +Bottom=74 State=1 \ No newline at end of file diff --git a/avidemux/winInstaller/UAC.nsh b/avidemux/winInstaller/UAC.nsh index e2684da48a..08979aba97 100644 --- a/avidemux/winInstaller/UAC.nsh +++ b/avidemux/winInstaller/UAC.nsh @@ -1,299 +1,299 @@ -/*** UAC Plug-in *** - -Interactive User (MediumIL) Admin user (HighIL) -***[Setup.exe]************* ***[Setup.exe]************** -* * * * -* +++[.OnInit]+++++++++++ * * +++[.OnInit]++++++++++++ * -* + UAC_RunElevated >---+-+----> * + + * -* + NSIS.Quit + * * + + * -* +++++++++++++++++++++++ * * ++++++++++++++++++++++++ * -* * * * -* * * * -* +++[Section]+++++++++++ * * +++[Section]++++++++++++ * -* + + * /--+-+- -** -** Get integrity level of current process -** -**/ -!macro UAC_GetIntegrityLevel outvar -UAC::_ 6 -!if "${outvar}" != "s" - Pop ${outvar} -!endif -!macroend - - - -/* UAC_IsAdmin -** -** Is the current process running with administrator privileges? Result in $0 -** -** ${If} ${UAC_IsAdmin} ... -** -**/ -!macro UAC_IsAdmin -UAC::_ 2 -!macroend -!define UAC_IsAdmin `"" UAC_IsAdmin ""` -!macro _UAC_IsAdmin _a _b _t _f -!insertmacro _UAC_MakeLL_Cmp _!= 0 2s -!macroend - - - -/* UAC_IsInnerInstance -** -** Does the current process have a NSIS/UAC parent process that is part of the elevation operation? -** -** ${If} ${UAC_IsInnerInstance} ... -** -**/ -!macro UAC_IsInnerInstance -UAC::_ 3 -!macroend -!define UAC_IsInnerInstance `"" UAC_IsInnerInstance ""` -!macro _UAC_IsInnerInstance _a _b _t _f -!insertmacro _UAC_MakeLL_Cmp _!= 0 3s -!macroend - - - -/* UAC_PageElevation_OnInit, UAC_PageElevation_OnGuiInit, -** -** Helper macros for elevation on a custom elevation page, see the DualMode example for more information. -** -**/ -!macro UAC_Notify_OnGuiInit -UAC::_ 4 -!macroend -!macro UAC_PageElevation_OnGuiInit -!insertmacro UAC_Notify_OnGuiInit -!macroend -!macro UAC_PageElevation_OnInit -UAC::_ 5 -${IfThen} ${Errors} ${|} Quit ${|} -!macroend - - - -/* UAC_AsUser_Call -** -** Calls a function or label in the user process instance. -** All the UAC_AsUser_* macros use this helper macro. -** -**/ -!define UAC_SYNCREGISTERS 0x1 -;define UAC_SYNCSTACK 0x2 -!define UAC_SYNCOUTDIR 0x4 -!define UAC_SYNCINSTDIR 0x8 -;define UAC_CLEARERRFLAG 0x10 -!macro UAC_AsUser_Call type name flags -push $0 -Get${type}Address $0 ${name} -!verbose push -!verbose ${UAC_VERBOSE} -!insertmacro _UAC_ParseDefineFlagsToInt _UAC_AsUser_Call__flags ${flags} -!verbose pop -StrCpy $0 "1$0:${_UAC_AsUser_Call__flags}" -!undef _UAC_AsUser_Call__flags -Exch $0 -UAC::_ -!macroend - - - -/* -** UAC_AsUser_GetSection -*/ -!macro UAC_AsUser_GetSection secprop secidx outvar -!insertmacro _UAC_AsUser_GenOp ${outvar} SectionGet${secprop} ${secidx} "" -!macroend - - - -/* -** UAC_AsUser_GetGlobalVar -** UAC_AsUser_GetGlobal -*/ -!macro UAC_AsUser_GetGlobalVar var -!insertmacro _UAC_AsUser_GenOp ${var} StrCpy "" ${var} -!macroend -!macro UAC_AsUser_GetGlobal outvar srcvar -!insertmacro _UAC_AsUser_GenOp ${outvar} StrCpy "" ${srcvar} -!macroend - - - -/* -** UAC_AsUser_ExecShell -** -** Call ExecShell in the user process instance. -** -*/ -!macro UAC_AsUser_ExecShell verb command params workdir show -!insertmacro _UAC_IncL -goto _UAC_L_E_${__UAC_L} -_UAC_L_F_${__UAC_L}: -ExecShell "${verb}" "${command}" '${params}' ${show} -return -_UAC_L_E_${__UAC_L}: -!if "${workdir}" != "" - push $outdir - SetOutPath "${workdir}" -!endif -!insertmacro UAC_AsUser_Call Label _UAC_L_F_${__UAC_L} ${UAC_SYNCREGISTERS}|${UAC_SYNCOUTDIR}|${UAC_SYNCINSTDIR} #|${UAC_CLEARERRFLAG} -!if "${workdir}" != "" - pop $outdir - SetOutPath $outdir -!endif -!macroend - - - -!macro _UAC_MakeLL_Cmp cmpop cmp pluginparams -!insertmacro _LOGICLIB_TEMP -UAC::_ ${pluginparams} -pop $_LOGICLIB_TEMP -!insertmacro ${cmpop} $_LOGICLIB_TEMP ${cmp} `${_t}` `${_f}` -!macroend -!macro _UAC_definemath def val1 op val2 -!define /math _UAC_definemath "${val1}" ${op} ${val2} -!ifdef ${def} - !undef ${def} -!endif -!define ${def} "${_UAC_definemath}" -!undef _UAC_definemath -!macroend -!macro _UAC_ParseDefineFlags_orin parse outflags -!searchparse /noerrors ${${parse}} "" _UAC_ParseDefineFlags_orin_f1 "|" _UAC_ParseDefineFlags_orin_f2 -!define _UAC_ParseDefineFlags_orin_this ${_UAC_ParseDefineFlags_orin_f1} -!undef ${parse} -!define ${parse} ${_UAC_ParseDefineFlags_orin_f2} -!define _UAC_ParseDefineFlags_orin_saveout ${${outflags}} -!undef ${outflags} -!define /math ${outflags} "${_UAC_ParseDefineFlags_orin_saveout}" | "${_UAC_ParseDefineFlags_orin_this}" -!undef _UAC_ParseDefineFlags_orin_saveout -!undef _UAC_ParseDefineFlags_orin_this -!ifdef _UAC_ParseDefineFlags_orin_f1 - !undef _UAC_ParseDefineFlags_orin_f1 -!endif -!ifdef _UAC_ParseDefineFlags_orin_f2 - !undef _UAC_ParseDefineFlags_orin_f2 -!endif -!macroend -!macro _UAC_ParseDefineFlags_Begin _outdef _in -!define _UAC_PDF${_outdef}_parse "${_in}" -!define _UAC_PDF${_outdef}_flags "" -!define _UAC_PDF${_outdef}_r 0 -!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x1 -!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x2 -!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x4 -!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x8 -!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x10 -!macroend -!macro _UAC_ParseDefineFlags_End _outdef -!define ${_outdef} ${_UAC_PDF${_outdef}_r} -!undef _UAC_PDF${_outdef}_r -!undef _UAC_PDF${_outdef}_flags -!undef _UAC_PDF${_outdef}_parse -!macroend -!macro _UAC_ParseDefineFlags_IncludeFlag _outdef flag -!if ${_UAC_PDF${_outdef}_flags} & ${flag} - !insertmacro _UAC_definemath _UAC_PDF${_outdef}_r ${_UAC_PDF${_outdef}_r} | ${flag} -!endif -!macroend -!macro _UAC_ParseDefineFlagsToInt _outdef _in -!insertmacro _UAC_ParseDefineFlags_Begin _UAC_ParseDefineFlagsToInt_tmp "${_in}" -!define ${_outdef} ${_UAC_PDF_UAC_ParseDefineFlagsToInt_tmp_flags} -!insertmacro _UAC_ParseDefineFlags_End _UAC_ParseDefineFlagsToInt_tmp -!undef _UAC_ParseDefineFlagsToInt_tmp -!macroend -!macro _UAC_IncL -!insertmacro _UAC_definemath __UAC_L "${__UAC_L}" + 1 -!macroend -!macro _UAC_AsUser_GenOp outvar op opparam1 opparam2 -!define _UAC_AUGOGR_ID _UAC_AUGOGR_OP${outvar}${op}${opparam1}${opparam2} -!ifndef ${_UAC_AUGOGR_ID} ;Has this exact action been done before? - !if ${outvar} == $0 - !define ${_UAC_AUGOGR_ID} $1 - !else - !define ${_UAC_AUGOGR_ID} $0 - !endif - !if "${opparam1}" == "" - !define _UAC_AUGOGR_OPP1 ${${_UAC_AUGOGR_ID}} - !define _UAC_AUGOGR_OPP2 ${opparam2} - !else - !define _UAC_AUGOGR_OPP1 ${opparam1} - !define _UAC_AUGOGR_OPP2 ${${_UAC_AUGOGR_ID}} - !endif - goto ${_UAC_AUGOGR_ID}_C - ${_UAC_AUGOGR_ID}_F: - ${op} ${_UAC_AUGOGR_OPP1} ${_UAC_AUGOGR_OPP2} - return - ${_UAC_AUGOGR_ID}_C: - !undef _UAC_AUGOGR_OPP1 - !undef _UAC_AUGOGR_OPP2 -!endif -push ${${_UAC_AUGOGR_ID}} -!insertmacro UAC_AsUser_Call Label ${_UAC_AUGOGR_ID}_F ${UAC_SYNCREGISTERS} -StrCpy ${outvar} ${${_UAC_AUGOGR_ID}} -pop ${${_UAC_AUGOGR_ID}} -!undef _UAC_AUGOGR_ID -!macroend - - - -!verbose pop +/*** UAC Plug-in *** + +Interactive User (MediumIL) Admin user (HighIL) +***[Setup.exe]************* ***[Setup.exe]************** +* * * * +* +++[.OnInit]+++++++++++ * * +++[.OnInit]++++++++++++ * +* + UAC_RunElevated >---+-+----> * + + * +* + NSIS.Quit + * * + + * +* +++++++++++++++++++++++ * * ++++++++++++++++++++++++ * +* * * * +* * * * +* +++[Section]+++++++++++ * * +++[Section]++++++++++++ * +* + + * /--+-+- +** +** Get integrity level of current process +** +**/ +!macro UAC_GetIntegrityLevel outvar +UAC::_ 6 +!if "${outvar}" != "s" + Pop ${outvar} +!endif +!macroend + + + +/* UAC_IsAdmin +** +** Is the current process running with administrator privileges? Result in $0 +** +** ${If} ${UAC_IsAdmin} ... +** +**/ +!macro UAC_IsAdmin +UAC::_ 2 +!macroend +!define UAC_IsAdmin `"" UAC_IsAdmin ""` +!macro _UAC_IsAdmin _a _b _t _f +!insertmacro _UAC_MakeLL_Cmp _!= 0 2s +!macroend + + + +/* UAC_IsInnerInstance +** +** Does the current process have a NSIS/UAC parent process that is part of the elevation operation? +** +** ${If} ${UAC_IsInnerInstance} ... +** +**/ +!macro UAC_IsInnerInstance +UAC::_ 3 +!macroend +!define UAC_IsInnerInstance `"" UAC_IsInnerInstance ""` +!macro _UAC_IsInnerInstance _a _b _t _f +!insertmacro _UAC_MakeLL_Cmp _!= 0 3s +!macroend + + + +/* UAC_PageElevation_OnInit, UAC_PageElevation_OnGuiInit, +** +** Helper macros for elevation on a custom elevation page, see the DualMode example for more information. +** +**/ +!macro UAC_Notify_OnGuiInit +UAC::_ 4 +!macroend +!macro UAC_PageElevation_OnGuiInit +!insertmacro UAC_Notify_OnGuiInit +!macroend +!macro UAC_PageElevation_OnInit +UAC::_ 5 +${IfThen} ${Errors} ${|} Quit ${|} +!macroend + + + +/* UAC_AsUser_Call +** +** Calls a function or label in the user process instance. +** All the UAC_AsUser_* macros use this helper macro. +** +**/ +!define UAC_SYNCREGISTERS 0x1 +;define UAC_SYNCSTACK 0x2 +!define UAC_SYNCOUTDIR 0x4 +!define UAC_SYNCINSTDIR 0x8 +;define UAC_CLEARERRFLAG 0x10 +!macro UAC_AsUser_Call type name flags +push $0 +Get${type}Address $0 ${name} +!verbose push +!verbose ${UAC_VERBOSE} +!insertmacro _UAC_ParseDefineFlagsToInt _UAC_AsUser_Call__flags ${flags} +!verbose pop +StrCpy $0 "1$0:${_UAC_AsUser_Call__flags}" +!undef _UAC_AsUser_Call__flags +Exch $0 +UAC::_ +!macroend + + + +/* +** UAC_AsUser_GetSection +*/ +!macro UAC_AsUser_GetSection secprop secidx outvar +!insertmacro _UAC_AsUser_GenOp ${outvar} SectionGet${secprop} ${secidx} "" +!macroend + + + +/* +** UAC_AsUser_GetGlobalVar +** UAC_AsUser_GetGlobal +*/ +!macro UAC_AsUser_GetGlobalVar var +!insertmacro _UAC_AsUser_GenOp ${var} StrCpy "" ${var} +!macroend +!macro UAC_AsUser_GetGlobal outvar srcvar +!insertmacro _UAC_AsUser_GenOp ${outvar} StrCpy "" ${srcvar} +!macroend + + + +/* +** UAC_AsUser_ExecShell +** +** Call ExecShell in the user process instance. +** +*/ +!macro UAC_AsUser_ExecShell verb command params workdir show +!insertmacro _UAC_IncL +goto _UAC_L_E_${__UAC_L} +_UAC_L_F_${__UAC_L}: +ExecShell "${verb}" "${command}" '${params}' ${show} +return +_UAC_L_E_${__UAC_L}: +!if "${workdir}" != "" + push $outdir + SetOutPath "${workdir}" +!endif +!insertmacro UAC_AsUser_Call Label _UAC_L_F_${__UAC_L} ${UAC_SYNCREGISTERS}|${UAC_SYNCOUTDIR}|${UAC_SYNCINSTDIR} #|${UAC_CLEARERRFLAG} +!if "${workdir}" != "" + pop $outdir + SetOutPath $outdir +!endif +!macroend + + + +!macro _UAC_MakeLL_Cmp cmpop cmp pluginparams +!insertmacro _LOGICLIB_TEMP +UAC::_ ${pluginparams} +pop $_LOGICLIB_TEMP +!insertmacro ${cmpop} $_LOGICLIB_TEMP ${cmp} `${_t}` `${_f}` +!macroend +!macro _UAC_definemath def val1 op val2 +!define /math _UAC_definemath "${val1}" ${op} ${val2} +!ifdef ${def} + !undef ${def} +!endif +!define ${def} "${_UAC_definemath}" +!undef _UAC_definemath +!macroend +!macro _UAC_ParseDefineFlags_orin parse outflags +!searchparse /noerrors ${${parse}} "" _UAC_ParseDefineFlags_orin_f1 "|" _UAC_ParseDefineFlags_orin_f2 +!define _UAC_ParseDefineFlags_orin_this ${_UAC_ParseDefineFlags_orin_f1} +!undef ${parse} +!define ${parse} ${_UAC_ParseDefineFlags_orin_f2} +!define _UAC_ParseDefineFlags_orin_saveout ${${outflags}} +!undef ${outflags} +!define /math ${outflags} "${_UAC_ParseDefineFlags_orin_saveout}" | "${_UAC_ParseDefineFlags_orin_this}" +!undef _UAC_ParseDefineFlags_orin_saveout +!undef _UAC_ParseDefineFlags_orin_this +!ifdef _UAC_ParseDefineFlags_orin_f1 + !undef _UAC_ParseDefineFlags_orin_f1 +!endif +!ifdef _UAC_ParseDefineFlags_orin_f2 + !undef _UAC_ParseDefineFlags_orin_f2 +!endif +!macroend +!macro _UAC_ParseDefineFlags_Begin _outdef _in +!define _UAC_PDF${_outdef}_parse "${_in}" +!define _UAC_PDF${_outdef}_flags "" +!define _UAC_PDF${_outdef}_r 0 +!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x1 +!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x2 +!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x4 +!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x8 +!insertmacro _UAC_ParseDefineFlags_orin _UAC_PDF${_outdef}_parse _UAC_PDF${_outdef}_flags ;0x10 +!macroend +!macro _UAC_ParseDefineFlags_End _outdef +!define ${_outdef} ${_UAC_PDF${_outdef}_r} +!undef _UAC_PDF${_outdef}_r +!undef _UAC_PDF${_outdef}_flags +!undef _UAC_PDF${_outdef}_parse +!macroend +!macro _UAC_ParseDefineFlags_IncludeFlag _outdef flag +!if ${_UAC_PDF${_outdef}_flags} & ${flag} + !insertmacro _UAC_definemath _UAC_PDF${_outdef}_r ${_UAC_PDF${_outdef}_r} | ${flag} +!endif +!macroend +!macro _UAC_ParseDefineFlagsToInt _outdef _in +!insertmacro _UAC_ParseDefineFlags_Begin _UAC_ParseDefineFlagsToInt_tmp "${_in}" +!define ${_outdef} ${_UAC_PDF_UAC_ParseDefineFlagsToInt_tmp_flags} +!insertmacro _UAC_ParseDefineFlags_End _UAC_ParseDefineFlagsToInt_tmp +!undef _UAC_ParseDefineFlagsToInt_tmp +!macroend +!macro _UAC_IncL +!insertmacro _UAC_definemath __UAC_L "${__UAC_L}" + 1 +!macroend +!macro _UAC_AsUser_GenOp outvar op opparam1 opparam2 +!define _UAC_AUGOGR_ID _UAC_AUGOGR_OP${outvar}${op}${opparam1}${opparam2} +!ifndef ${_UAC_AUGOGR_ID} ;Has this exact action been done before? + !if ${outvar} == $0 + !define ${_UAC_AUGOGR_ID} $1 + !else + !define ${_UAC_AUGOGR_ID} $0 + !endif + !if "${opparam1}" == "" + !define _UAC_AUGOGR_OPP1 ${${_UAC_AUGOGR_ID}} + !define _UAC_AUGOGR_OPP2 ${opparam2} + !else + !define _UAC_AUGOGR_OPP1 ${opparam1} + !define _UAC_AUGOGR_OPP2 ${${_UAC_AUGOGR_ID}} + !endif + goto ${_UAC_AUGOGR_ID}_C + ${_UAC_AUGOGR_ID}_F: + ${op} ${_UAC_AUGOGR_OPP1} ${_UAC_AUGOGR_OPP2} + return + ${_UAC_AUGOGR_ID}_C: + !undef _UAC_AUGOGR_OPP1 + !undef _UAC_AUGOGR_OPP2 +!endif +push ${${_UAC_AUGOGR_ID}} +!insertmacro UAC_AsUser_Call Label ${_UAC_AUGOGR_ID}_F ${UAC_SYNCREGISTERS} +StrCpy ${outvar} ${${_UAC_AUGOGR_ID}} +pop ${${_UAC_AUGOGR_ID}} +!undef _UAC_AUGOGR_ID +!macroend + + + +!verbose pop !endif /* UAC_HDR__INC */ \ No newline at end of file diff --git a/avidemux/winInstaller/What's New.html b/avidemux/winInstaller/What's New.html index 822467b686..e563058ece 100644 --- a/avidemux/winInstaller/What's New.html +++ b/avidemux/winInstaller/What's New.html @@ -1,71 +1,71 @@ - - - - - - What's New in Avidemux - - -
-

What's New in Avidemux

-
    -
  • Build : Avidemux can be built with visual c++ 2015 (losing some ASM)
  • -
  • OsX : Initialize fontconfig so that subtitling works
  • -
  • Core : Update ffmpeg to 3.0.5
  • -
  • i18n : Updated fr and ru translations (jean Elchinger/totalcaesar659)
  • -
  • Build : Improved build scripts (euma)
  • -
  • x265 : Enforce complicancy with most devices
  • -
  • vaapi : Add resizer
  • -
  • UI : Redone UI, revamped contrast filter
  • -
  • Qt : Dont use too much CPU on playback when there is no audio track
  • -
  • Qt : Reenabled nvenc + Fixed keyframe detection
  • -
  • Qt : Fixed a crash when encoding starts very slowly (x265)
  • -
  • Build : Allow use of system libass, liba52,libmad (euma)
  • -
-
-
- - + + + + + + What's New in Avidemux + + +
+

What's New in Avidemux

+
    +
  • Build : Avidemux can be built with visual c++ 2015 (losing some ASM)
  • +
  • OsX : Initialize fontconfig so that subtitling works
  • +
  • Core : Update ffmpeg to 3.0.5
  • +
  • i18n : Updated fr and ru translations (jean Elchinger/totalcaesar659)
  • +
  • Build : Improved build scripts (euma)
  • +
  • x265 : Enforce complicancy with most devices
  • +
  • vaapi : Add resizer
  • +
  • UI : Redone UI, revamped contrast filter
  • +
  • Qt : Dont use too much CPU on playback when there is no audio track
  • +
  • Qt : Reenabled nvenc + Fixed keyframe detection
  • +
  • Qt : Fixed a crash when encoding starts very slowly (x265)
  • +
  • Build : Allow use of system libass, liba52,libmad (euma)
  • +
+
+
+ + diff --git a/avidemux/winInstaller/avidemux_cross32Qt5.nsi b/avidemux/winInstaller/avidemux_cross32Qt5.nsi index 039a673850..601b6d344a 100644 --- a/avidemux/winInstaller/avidemux_cross32Qt5.nsi +++ b/avidemux/winInstaller/avidemux_cross32Qt5.nsi @@ -1,110 +1,110 @@ -########################## -# Included files -########################## -!define BUILD_BITS 32 -#!define BINARY_FOLDER /mingw/avidemux_32 -#!define DEV_FOLDER /mingw_dev/mingw/Release/ -!include avidemux_crossQt5.nsi - -Section "Avidemux Core" SecCore - SectionIn 1 2 RO - SetOutPath $INSTDIR - SetOverwrite on - ${File} "./Build-Info.txt" - ${File} "./ChangeLog.html" - ${File} "./change.css" - - ${File} ${BINARY_FOLDER}/libass-5.dll - ${File} ${BINARY_FOLDER}/libcrypto-1_1.dll - ${File} ${BINARY_FOLDER}/libssl-1_1.dll - ${File} ${BINARY_FOLDER}/libpcre2-16-0.dll - - ${File} ${BINARY_FOLDER}/libexpat-1.dll - ${File} ${BINARY_FOLDER}/libffi-*.dll - ${File} ${BINARY_FOLDER}/libglib-2.0-0.dll - ${File} ${BINARY_FOLDER}/libgobject-2.0-0.dll - ${File} ${BINARY_FOLDER}/libharfbuzz-0.dll - ${File} ${BINARY_FOLDER}/libiconv-2.dll # MXE libiconv.dll - ${File} ${BINARY_FOLDER}/libpcre16-0.dll - ${File} ${BINARY_FOLDER}/libpcre-1.dll - #${File} ${BINARY_FOLDER}/libfaad-2.dll - #${File} ${BINARY_FOLDER}/libfaac-0.dll - ${File} ${BINARY_FOLDER}/libtwolame.dll - ${File} ${BINARY_FOLDER}/libbz2.dll - ${File} ${BINARY_FOLDER}/libpng16-16.dll - ${File} ${BINARY_FOLDER}/libsqlite3-0.dll - ${File} ${BINARY_FOLDER}/libstdc++-6.dll - ${File} ${BINARY_FOLDER}/libwinpthread-1.dll - ${File} ${BINARY_FOLDER}/libz-1.dll - ${File} ${BINARY_FOLDER}/zlib1.dll - ${File} ${BINARY_FOLDER}/libfreetype-6.dll - ${File} ${BINARY_FOLDER}/libgcc_s_sjlj-1.dll - ${File} ${BINARY_FOLDER}/SDL2.dll -# Qt - ${File} ${BINARY_FOLDER}/Qt5Core.dll - ${File} ${BINARY_FOLDER}/Qt5Gui.dll - ${File} ${BINARY_FOLDER}/Qt5Widgets.dll - ${File} ${BINARY_FOLDER}/Qt5Network.dll - ${File} ${BINARY_FOLDER}/Qt5WinExtras.dll - #${File} ${BINARY_FOLDER}/icudt56.dll - #${File} ${BINARY_FOLDER}/icuin56.dll - #${File} ${BINARY_FOLDER}/icuio56.dll - #${File} ${BINARY_FOLDER}/icule56.dll - #${File} ${BINARY_FOLDER}/iculx56.dll - #${File} ${BINARY_FOLDER}/icutu56.dll - #${File} ${BINARY_FOLDER}/icuuc56.dll - ${File} ${BINARY_FOLDER}/libintl-8.dll -# SSL still needed ? - ${File} ${BINARY_FOLDER}/libeay32.dll - ${File} ${BINARY_FOLDER}/ssleay32.dll - - SetOutPath $INSTDIR\platforms - ${File} ${BINARY_FOLDER}/platforms/qminimal.dll - ${File} ${BINARY_FOLDER}/platforms/qwindows.dll - SetOutPath $INSTDIR\styles - ${File} ${BINARY_FOLDER}/styles/qwindowsvistastyle.dll - SetOutPath $INSTDIR -# adm - ${File} ${BINARY_FOLDER}/libADM_audioParser6.dll - ${File} ${BINARY_FOLDER}/libADM_core6.dll - ${File} ${BINARY_FOLDER}/libADM_coreAudio6.dll - ${File} ${BINARY_FOLDER}/libADM_coreAudioDevice6.dll - ${File} ${BINARY_FOLDER}/libADM_coreAudioEncoder6.dll - ${File} ${BINARY_FOLDER}/libADM_coreAudioFilterAPI6.dll - ${File} ${BINARY_FOLDER}/libADM_coreDemuxer6.dll - ${File} ${BINARY_FOLDER}/libADM_coreDemuxerMpeg6.dll - ${File} ${BINARY_FOLDER}/libADM_coreImage6.dll - ${File} ${BINARY_FOLDER}/libADM_coreImageLoader6.dll - ${File} ${BINARY_FOLDER}/libADM_coreJobs.dll - ${File} ${BINARY_FOLDER}/libADM_coreMuxer6.dll - ${File} ${BINARY_FOLDER}/libADM_coreScript.dll - ${File} ${BINARY_FOLDER}/libADM_coreSocket6.dll - ${File} ${BINARY_FOLDER}/libADM_coreSqlLight3.dll - ${File} ${BINARY_FOLDER}/libADM_coreUI6.dll - ${File} ${BINARY_FOLDER}/libADM_coreUtils6.dll - ${File} ${BINARY_FOLDER}/libADM_coreVideoCodec6.dll - ${File} ${BINARY_FOLDER}/libADM_coreVideoEncoder6.dll - ${File} ${BINARY_FOLDER}/libADM_coreVideoFilter6.dll - ${File} ${BINARY_FOLDER}/libADM_coreSubtitles6.dll - ${File} ${SOURCE_FOLDER}/AUTHORS. - ${File} ${SOURCE_FOLDER}/COPYING. - ${File} ${SOURCE_FOLDER}/README. - ${File} ${BINARY_FOLDER}/avcodec-*.dll - ${File} ${BINARY_FOLDER}/avformat-*.dll - ${File} ${BINARY_FOLDER}/avutil-*.dll - ${File} ${BINARY_FOLDER}/postproc-*.dll - ${File} ${BINARY_FOLDER}/swscale-*.dll - - ${File} ${BINARY_FOLDER}/libfribidi*.dll - ${File} ${BINARY_FOLDER}/libfontconfig*.dll - ${File} ${BINARY_FOLDER}/libfreetype*.dll - ${File} ${BINARY_FOLDER}/libharfbuzz*.dll - - WriteRegStr HKLM "${REGKEY}" CreateDesktopIcon $CreateDesktopIcon - WriteRegStr HKLM "${REGKEY}" CreateStartMenuGroup $CreateStartMenuGroup - - ${If} ${AtMostWinVista} - WriteRegStr HKLM "${REGKEY}" CreateQuickLaunchIcon $CreateQuickLaunchIcon - ${EndIf} -SectionEnd -!include avidemux_crossQt5Tail.nsi +########################## +# Included files +########################## +!define BUILD_BITS 32 +#!define BINARY_FOLDER /mingw/avidemux_32 +#!define DEV_FOLDER /mingw_dev/mingw/Release/ +!include avidemux_crossQt5.nsi + +Section "Avidemux Core" SecCore + SectionIn 1 2 RO + SetOutPath $INSTDIR + SetOverwrite on + ${File} "./Build-Info.txt" + ${File} "./ChangeLog.html" + ${File} "./change.css" + + ${File} ${BINARY_FOLDER}/libass-5.dll + ${File} ${BINARY_FOLDER}/libcrypto-1_1.dll + ${File} ${BINARY_FOLDER}/libssl-1_1.dll + ${File} ${BINARY_FOLDER}/libpcre2-16-0.dll + + ${File} ${BINARY_FOLDER}/libexpat-1.dll + ${File} ${BINARY_FOLDER}/libffi-*.dll + ${File} ${BINARY_FOLDER}/libglib-2.0-0.dll + ${File} ${BINARY_FOLDER}/libgobject-2.0-0.dll + ${File} ${BINARY_FOLDER}/libharfbuzz-0.dll + ${File} ${BINARY_FOLDER}/libiconv-2.dll # MXE libiconv.dll + ${File} ${BINARY_FOLDER}/libpcre16-0.dll + ${File} ${BINARY_FOLDER}/libpcre-1.dll + #${File} ${BINARY_FOLDER}/libfaad-2.dll + #${File} ${BINARY_FOLDER}/libfaac-0.dll + ${File} ${BINARY_FOLDER}/libtwolame.dll + ${File} ${BINARY_FOLDER}/libbz2.dll + ${File} ${BINARY_FOLDER}/libpng16-16.dll + ${File} ${BINARY_FOLDER}/libsqlite3-0.dll + ${File} ${BINARY_FOLDER}/libstdc++-6.dll + ${File} ${BINARY_FOLDER}/libwinpthread-1.dll + ${File} ${BINARY_FOLDER}/libz-1.dll + ${File} ${BINARY_FOLDER}/zlib1.dll + ${File} ${BINARY_FOLDER}/libfreetype-6.dll + ${File} ${BINARY_FOLDER}/libgcc_s_sjlj-1.dll + ${File} ${BINARY_FOLDER}/SDL2.dll +# Qt + ${File} ${BINARY_FOLDER}/Qt5Core.dll + ${File} ${BINARY_FOLDER}/Qt5Gui.dll + ${File} ${BINARY_FOLDER}/Qt5Widgets.dll + ${File} ${BINARY_FOLDER}/Qt5Network.dll + ${File} ${BINARY_FOLDER}/Qt5WinExtras.dll + #${File} ${BINARY_FOLDER}/icudt56.dll + #${File} ${BINARY_FOLDER}/icuin56.dll + #${File} ${BINARY_FOLDER}/icuio56.dll + #${File} ${BINARY_FOLDER}/icule56.dll + #${File} ${BINARY_FOLDER}/iculx56.dll + #${File} ${BINARY_FOLDER}/icutu56.dll + #${File} ${BINARY_FOLDER}/icuuc56.dll + ${File} ${BINARY_FOLDER}/libintl-8.dll +# SSL still needed ? + ${File} ${BINARY_FOLDER}/libeay32.dll + ${File} ${BINARY_FOLDER}/ssleay32.dll + + SetOutPath $INSTDIR\platforms + ${File} ${BINARY_FOLDER}/platforms/qminimal.dll + ${File} ${BINARY_FOLDER}/platforms/qwindows.dll + SetOutPath $INSTDIR\styles + ${File} ${BINARY_FOLDER}/styles/qwindowsvistastyle.dll + SetOutPath $INSTDIR +# adm + ${File} ${BINARY_FOLDER}/libADM_audioParser6.dll + ${File} ${BINARY_FOLDER}/libADM_core6.dll + ${File} ${BINARY_FOLDER}/libADM_coreAudio6.dll + ${File} ${BINARY_FOLDER}/libADM_coreAudioDevice6.dll + ${File} ${BINARY_FOLDER}/libADM_coreAudioEncoder6.dll + ${File} ${BINARY_FOLDER}/libADM_coreAudioFilterAPI6.dll + ${File} ${BINARY_FOLDER}/libADM_coreDemuxer6.dll + ${File} ${BINARY_FOLDER}/libADM_coreDemuxerMpeg6.dll + ${File} ${BINARY_FOLDER}/libADM_coreImage6.dll + ${File} ${BINARY_FOLDER}/libADM_coreImageLoader6.dll + ${File} ${BINARY_FOLDER}/libADM_coreJobs.dll + ${File} ${BINARY_FOLDER}/libADM_coreMuxer6.dll + ${File} ${BINARY_FOLDER}/libADM_coreScript.dll + ${File} ${BINARY_FOLDER}/libADM_coreSocket6.dll + ${File} ${BINARY_FOLDER}/libADM_coreSqlLight3.dll + ${File} ${BINARY_FOLDER}/libADM_coreUI6.dll + ${File} ${BINARY_FOLDER}/libADM_coreUtils6.dll + ${File} ${BINARY_FOLDER}/libADM_coreVideoCodec6.dll + ${File} ${BINARY_FOLDER}/libADM_coreVideoEncoder6.dll + ${File} ${BINARY_FOLDER}/libADM_coreVideoFilter6.dll + ${File} ${BINARY_FOLDER}/libADM_coreSubtitles6.dll + ${File} ${SOURCE_FOLDER}/AUTHORS. + ${File} ${SOURCE_FOLDER}/COPYING. + ${File} ${SOURCE_FOLDER}/README. + ${File} ${BINARY_FOLDER}/avcodec-*.dll + ${File} ${BINARY_FOLDER}/avformat-*.dll + ${File} ${BINARY_FOLDER}/avutil-*.dll + ${File} ${BINARY_FOLDER}/postproc-*.dll + ${File} ${BINARY_FOLDER}/swscale-*.dll + + ${File} ${BINARY_FOLDER}/libfribidi*.dll + ${File} ${BINARY_FOLDER}/libfontconfig*.dll + ${File} ${BINARY_FOLDER}/libfreetype*.dll + ${File} ${BINARY_FOLDER}/libharfbuzz*.dll + + WriteRegStr HKLM "${REGKEY}" CreateDesktopIcon $CreateDesktopIcon + WriteRegStr HKLM "${REGKEY}" CreateStartMenuGroup $CreateStartMenuGroup + + ${If} ${AtMostWinVista} + WriteRegStr HKLM "${REGKEY}" CreateQuickLaunchIcon $CreateQuickLaunchIcon + ${EndIf} +SectionEnd +!include avidemux_crossQt5Tail.nsi diff --git a/avidemux/winInstaller/avidemux_cross64Qt5.nsi b/avidemux/winInstaller/avidemux_cross64Qt5.nsi index eedea23dd7..aa5fd60b80 100644 --- a/avidemux/winInstaller/avidemux_cross64Qt5.nsi +++ b/avidemux/winInstaller/avidemux_cross64Qt5.nsi @@ -1,98 +1,98 @@ -########################## -# Included files -########################## -!define BUILD_BITS 64 -#!define BINARY_FOLDER /mingw/avidemux_64 -#!define DEV_FOLDER /mingw_dev/mingw/Release/ -!include avidemux_crossQt5.nsi - -Section "Avidemux Core" SecCore - SectionIn 1 2 RO - SetOutPath $INSTDIR - SetOverwrite on - ${File} "./Build-Info.txt" - ${File} "./change.css" - ${File} "./ChangeLog.html" - ${File} ${BINARY_FOLDER}/libass-9.dll - ${File} ${BINARY_FOLDER}/libcrypto-3-x64.dll - ${File} ${BINARY_FOLDER}/libpcre2-8-*.dll - ${File} ${BINARY_FOLDER}/libpcre2-16-*.dll - ${File} ${BINARY_FOLDER}/libssl-3-x64.dll - - ${File} ${BINARY_FOLDER}/libexpat-1.dll - ${File} ${BINARY_FOLDER}/libffi-*.dll - ${File} ${BINARY_FOLDER}/libglib-2.0-0.dll - ${File} ${BINARY_FOLDER}/libgobject-2.0-0.dll - ${File} ${BINARY_FOLDER}/libharfbuzz-0.dll - ${File} ${BINARY_FOLDER}/libiconv-2.dll - ${File} ${BINARY_FOLDER}/libpng16-16.dll - ${File} ${BINARY_FOLDER}/libsqlite3-0.dll - ${File} ${BINARY_FOLDER}/libstdc++-6.dll - ${File} ${BINARY_FOLDER}/libwinpthread-1.dll - ${File} ${BINARY_FOLDER}/zlib1.dll - ${File} ${BINARY_FOLDER}/libgcc_s_seh-1.dll - ${File} ${BINARY_FOLDER}/libintl-8.dll - ${File} ${BINARY_FOLDER}/SDL2.dll - ${File} ${BINARY_FOLDER}/libfdk-aac-*.dll -# Qt - ${File} ${BINARY_FOLDER}/Qt5Core.dll - ${File} ${BINARY_FOLDER}/Qt5Gui.dll - ${File} ${BINARY_FOLDER}/Qt5Widgets.dll - ${File} ${BINARY_FOLDER}/Qt5Network.dll - ${File} ${BINARY_FOLDER}/Qt5WinExtras.dll - SetOutPath $INSTDIR\styles - ${File} ${BINARY_FOLDER}/styles/qwindowsvistastyle.dll - SetOutPath $INSTDIR - ${File} ${BINARY_FOLDER}/icudt*.dll - ${File} ${BINARY_FOLDER}/icuin*.dll - ${File} ${BINARY_FOLDER}/icuuc*.dll - SetOutPath $INSTDIR\platforms - ${File} ${BINARY_FOLDER}/platforms/qminimal.dll - ${File} ${BINARY_FOLDER}/platforms/qwindows.dll - SetOutPath $INSTDIR -# adm - ${File} ${BINARY_FOLDER}/libADM_audioParser6.dll - ${File} ${BINARY_FOLDER}/libADM_core6.dll - ${File} ${BINARY_FOLDER}/libADM_coreAudio6.dll - ${File} ${BINARY_FOLDER}/libADM_coreAudioDevice6.dll - ${File} ${BINARY_FOLDER}/libADM_coreAudioEncoder6.dll - ${File} ${BINARY_FOLDER}/libADM_coreAudioFilterAPI6.dll - ${File} ${BINARY_FOLDER}/libADM_coreDemuxer6.dll - ${File} ${BINARY_FOLDER}/libADM_coreDemuxerMpeg6.dll - ${File} ${BINARY_FOLDER}/libADM_coreImage6.dll - ${File} ${BINARY_FOLDER}/libADM_coreImageLoader6.dll - ${File} ${BINARY_FOLDER}/libADM_coreJobs.dll - ${File} ${BINARY_FOLDER}/libADM_coreMuxer6.dll - ${File} ${BINARY_FOLDER}/libADM_coreScript.dll - ${File} ${BINARY_FOLDER}/libADM_coreSocket6.dll - ${File} ${BINARY_FOLDER}/libADM_coreSqlLight3.dll - ${File} ${BINARY_FOLDER}/libADM_coreUI6.dll - ${File} ${BINARY_FOLDER}/libADM_coreUtils6.dll - ${File} ${BINARY_FOLDER}/libADM_coreVideoCodec6.dll - ${File} ${BINARY_FOLDER}/libADM_coreVideoEncoder6.dll - ${File} ${BINARY_FOLDER}/libADM_coreVideoFilter6.dll - ${File} ${BINARY_FOLDER}/libADM_coreSubtitles6.dll - ${File} ${SOURCE_FOLDER}/AUTHORS. - ${File} ${SOURCE_FOLDER}/COPYING. - ${File} ${SOURCE_FOLDER}/README. - ${File} ${BINARY_FOLDER}/avcodec-*.dll - ${File} ${BINARY_FOLDER}/avformat-*.dll - ${File} ${BINARY_FOLDER}/avutil-*.dll - ${File} ${BINARY_FOLDER}/postproc-*.dll - ${File} ${BINARY_FOLDER}/swscale-*.dll - - ${File} ${BINARY_FOLDER}/libfribidi*.dll - ${File} ${BINARY_FOLDER}/libfontconfig*.dll - ${File} ${BINARY_FOLDER}/libfreetype*.dll - ${File} ${BINARY_FOLDER}/libharfbuzz*.dll - ${File} ${BINARY_FOLDER}/libbrotlicommon.dll - ${File} ${BINARY_FOLDER}/libbrotlidec.dll - - WriteRegStr HKLM "${REGKEY}" CreateDesktopIcon $CreateDesktopIcon - WriteRegStr HKLM "${REGKEY}" CreateStartMenuGroup $CreateStartMenuGroup - - ${If} ${AtMostWinVista} - WriteRegStr HKLM "${REGKEY}" CreateQuickLaunchIcon $CreateQuickLaunchIcon - ${EndIf} -SectionEnd -!include avidemux_crossQt5Tail.nsi +########################## +# Included files +########################## +!define BUILD_BITS 64 +#!define BINARY_FOLDER /mingw/avidemux_64 +#!define DEV_FOLDER /mingw_dev/mingw/Release/ +!include avidemux_crossQt5.nsi + +Section "Avidemux Core" SecCore + SectionIn 1 2 RO + SetOutPath $INSTDIR + SetOverwrite on + ${File} "./Build-Info.txt" + ${File} "./change.css" + ${File} "./ChangeLog.html" + ${File} ${BINARY_FOLDER}/libass-9.dll + ${File} ${BINARY_FOLDER}/libcrypto-3-x64.dll + ${File} ${BINARY_FOLDER}/libpcre2-8-*.dll + ${File} ${BINARY_FOLDER}/libpcre2-16-*.dll + ${File} ${BINARY_FOLDER}/libssl-3-x64.dll + + ${File} ${BINARY_FOLDER}/libexpat-1.dll + ${File} ${BINARY_FOLDER}/libffi-*.dll + ${File} ${BINARY_FOLDER}/libglib-2.0-0.dll + ${File} ${BINARY_FOLDER}/libgobject-2.0-0.dll + ${File} ${BINARY_FOLDER}/libharfbuzz-0.dll + ${File} ${BINARY_FOLDER}/libiconv-2.dll + ${File} ${BINARY_FOLDER}/libpng16-16.dll + ${File} ${BINARY_FOLDER}/libsqlite3-0.dll + ${File} ${BINARY_FOLDER}/libstdc++-6.dll + ${File} ${BINARY_FOLDER}/libwinpthread-1.dll + ${File} ${BINARY_FOLDER}/zlib1.dll + ${File} ${BINARY_FOLDER}/libgcc_s_seh-1.dll + ${File} ${BINARY_FOLDER}/libintl-8.dll + ${File} ${BINARY_FOLDER}/SDL2.dll + ${File} ${BINARY_FOLDER}/libfdk-aac-*.dll +# Qt + ${File} ${BINARY_FOLDER}/Qt5Core.dll + ${File} ${BINARY_FOLDER}/Qt5Gui.dll + ${File} ${BINARY_FOLDER}/Qt5Widgets.dll + ${File} ${BINARY_FOLDER}/Qt5Network.dll + ${File} ${BINARY_FOLDER}/Qt5WinExtras.dll + SetOutPath $INSTDIR\styles + ${File} ${BINARY_FOLDER}/styles/qwindowsvistastyle.dll + SetOutPath $INSTDIR + ${File} ${BINARY_FOLDER}/icudt*.dll + ${File} ${BINARY_FOLDER}/icuin*.dll + ${File} ${BINARY_FOLDER}/icuuc*.dll + SetOutPath $INSTDIR\platforms + ${File} ${BINARY_FOLDER}/platforms/qminimal.dll + ${File} ${BINARY_FOLDER}/platforms/qwindows.dll + SetOutPath $INSTDIR +# adm + ${File} ${BINARY_FOLDER}/libADM_audioParser6.dll + ${File} ${BINARY_FOLDER}/libADM_core6.dll + ${File} ${BINARY_FOLDER}/libADM_coreAudio6.dll + ${File} ${BINARY_FOLDER}/libADM_coreAudioDevice6.dll + ${File} ${BINARY_FOLDER}/libADM_coreAudioEncoder6.dll + ${File} ${BINARY_FOLDER}/libADM_coreAudioFilterAPI6.dll + ${File} ${BINARY_FOLDER}/libADM_coreDemuxer6.dll + ${File} ${BINARY_FOLDER}/libADM_coreDemuxerMpeg6.dll + ${File} ${BINARY_FOLDER}/libADM_coreImage6.dll + ${File} ${BINARY_FOLDER}/libADM_coreImageLoader6.dll + ${File} ${BINARY_FOLDER}/libADM_coreJobs.dll + ${File} ${BINARY_FOLDER}/libADM_coreMuxer6.dll + ${File} ${BINARY_FOLDER}/libADM_coreScript.dll + ${File} ${BINARY_FOLDER}/libADM_coreSocket6.dll + ${File} ${BINARY_FOLDER}/libADM_coreSqlLight3.dll + ${File} ${BINARY_FOLDER}/libADM_coreUI6.dll + ${File} ${BINARY_FOLDER}/libADM_coreUtils6.dll + ${File} ${BINARY_FOLDER}/libADM_coreVideoCodec6.dll + ${File} ${BINARY_FOLDER}/libADM_coreVideoEncoder6.dll + ${File} ${BINARY_FOLDER}/libADM_coreVideoFilter6.dll + ${File} ${BINARY_FOLDER}/libADM_coreSubtitles6.dll + ${File} ${SOURCE_FOLDER}/AUTHORS. + ${File} ${SOURCE_FOLDER}/COPYING. + ${File} ${SOURCE_FOLDER}/README. + ${File} ${BINARY_FOLDER}/avcodec-*.dll + ${File} ${BINARY_FOLDER}/avformat-*.dll + ${File} ${BINARY_FOLDER}/avutil-*.dll + ${File} ${BINARY_FOLDER}/postproc-*.dll + ${File} ${BINARY_FOLDER}/swscale-*.dll + + ${File} ${BINARY_FOLDER}/libfribidi*.dll + ${File} ${BINARY_FOLDER}/libfontconfig*.dll + ${File} ${BINARY_FOLDER}/libfreetype*.dll + ${File} ${BINARY_FOLDER}/libharfbuzz*.dll + ${File} ${BINARY_FOLDER}/libbrotlicommon.dll + ${File} ${BINARY_FOLDER}/libbrotlidec.dll + + WriteRegStr HKLM "${REGKEY}" CreateDesktopIcon $CreateDesktopIcon + WriteRegStr HKLM "${REGKEY}" CreateStartMenuGroup $CreateStartMenuGroup + + ${If} ${AtMostWinVista} + WriteRegStr HKLM "${REGKEY}" CreateQuickLaunchIcon $CreateQuickLaunchIcon + ${EndIf} +SectionEnd +!include avidemux_crossQt5Tail.nsi diff --git a/avidemux/winInstaller/avidemux_crossQt5.nsi b/avidemux/winInstaller/avidemux_crossQt5.nsi index 280f196cf1..13a9834f88 100644 --- a/avidemux/winInstaller/avidemux_crossQt5.nsi +++ b/avidemux/winInstaller/avidemux_crossQt5.nsi @@ -1,401 +1,401 @@ -########################## -# Included files -########################## -!addincludedir ${NSIDIR} -!if ${BUILD_BITS} == 64 - !addplugindir ${NSIDIR}/plugin/amd64-unicode -!else - !addplugindir ${NSIDIR}/plugin/x86-unicode -!endif - -!include Sections.nsh -!include MUI2.nsh -!include nsDialogs.nsh -!include Memento.nsh -!include FileFunc.nsh -!include WinVer.nsh -!include WordFunc.nsh -!include AvidemuxVersion.nsh -SetCompressor /SOLID lzma -SetCompressorDictSize 96 -RequestExecutionLevel admin - -########################## -# Defines -########################## -!define REVISION ${SVN_VERSION} -!define EXEDIR "${NSIDIR}/install" - -!define PRODUCT_VERSION "${CORE_VERSION}.${POINT_RELEASE}.${SVN_VERSION}" -!define PRODUCT_NAME "Avidemux ${CORE_VERSION} - ${BUILD_BITS} bits${EXTRA}" -!define PRODUCT_FULLNAME "Avidemux ${PRODUCT_VERSION} (${BUILD_BITS}-bits${EXTRA} Release)" - -!if ${BUILD_BITS} == 64 - !define SHORTCUT_NAME "${PRODUCT_NAME}" - !define REG_GROUPNAME "${PRODUCT_NAME} (${BUILD_BITS}-bit${EXTRA})" -!else - !define SHORTCUT_NAME "${PRODUCT_NAME} (${BUILD_BITS}-bit${EXTRA})" - !define REG_GROUPNAME "${PRODUCT_NAME}" -!endif - -!define REGKEY "SOFTWARE\${REG_GROUPNAME}" -!define UNINST_REGKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_GROUPNAME}" -!define COMPANY "Free Software Foundation" -!define URL "http://www.avidemux.org" - -OutFile "${BINARY_FOLDER}/avidemux_${CORE_VERSION}.${POINT_RELEASE}${EXTRA} r${REVISION}_win${BUILD_BITS}.exe" -Name "${PRODUCT_FULLNAME}" - -########################## -# Memento defines -########################## -!define MEMENTO_REGISTRY_ROOT HKLM -!define MEMENTO_REGISTRY_KEY "${REGKEY}" - -########################## -# MUI defines -########################## -!define MUI_ICON "${SOURCE_FOLDER}/avidemux/common/xpm/adm.ico" -!define MUI_HEADERIMAGE -!define MUI_HEADERIMAGE_RIGHT -!define MUI_HEADERIMAGE_BITMAP "${NSIDIR}/PageHeader.bmp" -!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM -!define MUI_STARTMENUPAGE_REGISTRY_KEY "${REGKEY}" -!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup -!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Avidemux (${BUILD_BITS} bits${EXTRA})" -!define MUI_STARTMENUPAGE_NODISABLE -!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSIDIR}/WelcomeFinishStrip.bmp" -!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSIDIR}/WelcomeFinishStrip.bmp" -!define MUI_UNICON "${SOURCE_FOLDER}/avidemux/common/xpm/adm.ico" -!define MUI_COMPONENTSPAGE_NODESC - -########################## -# Variables -########################## -Var CreateDesktopIcon -Var CreateStartMenuGroup -Var CreateQuickLaunchIcon -Var StartMenuGroup -Var PreviousVersion -Var PreviousVersionState -Var ReinstallUninstall - -########################## -# Installer pages -########################## -!define MUI_WELCOMEPAGE_TITLE "${PRODUCT_FULLNAME} Setup Wizard" -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "${NSIDIR}/License.rtf" - Page custom ReinstallPage ReinstallPageLeave -!insertmacro MUI_PAGE_COMPONENTS -Page custom InstallOptionsPage -!define MUI_PAGE_CUSTOMFUNCTION_PRE IsStartMenuRequired -!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup -!insertmacro MUI_PAGE_DIRECTORY -!define MUI_PAGE_CUSTOMFUNCTION_PRE ActivateInternalSections -!define MUI_PAGE_CUSTOMFUNCTION_SHOW InstFilesPageShow -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE InstFilesPageLeave -!insertmacro MUI_PAGE_INSTFILES -!define MUI_FINISHPAGE_RUN -!define MUI_FINISHPAGE_RUN_FUNCTION RunAvidemux -!define MUI_FINISHPAGE_RUN_TEXT "Run ${PRODUCT_NAME} now" -!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\ChangeLog.html" -!define MUI_FINISHPAGE_SHOWREADME_TEXT "View Change Log now" -!define MUI_FINISHPAGE_LINK "Visit the Avidemux website" -!define MUI_FINISHPAGE_LINK_LOCATION "http://www.avidemux.org" -!define MUI_PAGE_CUSTOMFUNCTION_PRE ConfigureFinishPage -!insertmacro MUI_PAGE_FINISH - -!define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES -!define MUI_PAGE_CUSTOMFUNCTION_PRE un.FinishPagePre -!insertmacro MUI_UNPAGE_FINISH - -########################## -# Installer languages -########################## -!insertmacro MUI_LANGUAGE English - -########################## -# Installer attributes -########################## -!if ${BUILD_BITS} == 64 - InstallDir "$PROGRAMFILES64\${PRODUCT_NAME}" -!else - InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" -!endif - -CRCCheck on -XPStyle on -ShowInstDetails nevershow -ShowUninstDetails nevershow -VIProductVersion ${PRODUCT_VERSION} -VIAddVersionKey ProductName Avidemux -VIAddVersionKey ProductVersion "${PRODUCT_VERSION}" -VIAddVersionKey FileVersion "" -VIAddVersionKey FileDescription "" -VIAddVersionKey LegalCopyright "" -InstallDirRegKey HKLM "${REGKEY}" Path -BrandingText "Packaged by Mean/Gruntster" -InstType Standard -InstType Full -######################################### -# -######################################### -Function GetAfterChar - Exch $0 ; chop char - Exch - Exch $1 ; input string - Push $2 - Push $3 - StrCpy $2 0 - loop: - IntOp $2 $2 - 1 - StrCpy $3 $1 1 $2 - StrCmp $3 "" 0 +3 - StrCpy $0 "" - Goto exit2 - StrCmp $3 $0 exit1 - Goto loop - exit1: - IntOp $2 $2 + 1 - StrCpy $0 $1 "" $2 - exit2: - Pop $3 - Pop $2 - Pop $1 - Exch $0 ; output -FunctionEnd -#####################################################################© -!define StrReplace '!insertmacro "_Name"' - -########################## -# Uninstaller macros -########################## -!insertmacro un.GetOptions -!insertmacro un.GetParameters - -!define UninstallLogPath "$INSTDIR\uninstall.log" -Var UninstallLogHandle - -; Uninstall log file missing. -LangString UninstallLogMissing ${LANG_ENGLISH} "uninstall.log not found!$\r$\nUninstallation cannot proceed!" -# Regexep Does not work with cross -# Use only one file at a time -!macro InstallFile FILEZ - File "${FILEZ}" - Push "${FILEZ}" - Push "/" - Call GetAfterChar - Pop $R0 - FileWrite $UninstallLogHandle "$OUTDIR\$R0$\r$\n" -!macroend -!define File "!insertmacro InstallFile" - -!macro InstallFolder FILEREGEX - File /r "${FILEREGEX}/*" - Push "$OUTDIR" - Call InstallFolderInternal -!macroend -!define Folder "!insertmacro InstallFolder" - -Function InstallFolderInternal - Pop $9 - !define Index 'Line${__LINE__}' - FindFirst $0 $1 "$9/*" - StrCmp $0 "" "${Index}-End" -"${Index}-Loop:" - StrCmp $1 "" "${Index}-End" - StrCmp $1 "." "${Index}-Next" - StrCmp $1 ".." "${Index}-Next" - IfFileExists "$9\$1\*" 0 "${Index}-Write" - Push $0 - Push $9 - Push "$9\$1" - Call InstallFolderInternal - Pop $9 - Pop $0 - Goto "${Index}-Next" -"${Index}-Write:" - FileWrite $UninstallLogHandle "$9\$1$\r$\n" -"${Index}-Next:" - FindNext $0 $1 - Goto "${Index}-Loop" -"${Index}-End:" - !undef Index -FunctionEnd - -; WriteUninstaller macro -!macro WriteUninstaller Path - WriteUninstaller "${Path}" - FileWrite $UninstallLogHandle "${Path}$\r$\n" -!macroend -!define WriteUninstaller "!insertmacro WriteUninstaller" - -########################## -# Macros -########################## - -!macro InstallQtLanguage LANG_NAME LANG_CODE - SetOverwrite on - - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} installQt${LANG_CODE} endQt${LANG_CODE} - -installQt${LANG_CODE}: - SetOutPath $INSTDIR\qt5\i18n - ${File} qt5/i18n/avidemux_${LANG_CODE}.qm - ${File} qt5/i18n/qt_${LANG_CODE}.qm - -endQt${LANG_CODE}: -!macroend -# -!macro InstallDev xname - SetOutPath $INSTDIR\include\avidemux\${API_VERSION}\${xname} - ${File} ${DEV_FOLDER}/include/avidemux/${API_VERSION}/${xname}/* -!macroend -!macro InstallDevQt5 xname - SetOutPath $INSTDIR\include\avidemux\${API_VERSION}\qt5\${xname} - ${File} ${DEV_FOLDER}/include/avidemux/${API_VERSION}/qt5/${xname}/* -!macroend - - - -########################## -# Installer sections -########################## -Section -OpenLogFile - CreateDirectory "$INSTDIR" - FileOpen $UninstallLogHandle ${UninstallLogPath} a - FileSeek $UninstallLogHandle 0 END -SectionEnd -Section "User interfaces" SecGrpUI - SectionIn 1 2 RO - SetOutPath $INSTDIR - SetOverwrite on - ${File} ${BINARY_FOLDER}/avidemux_cli.exe - ${File} ${BINARY_FOLDER}/avidemux.exe - ${File} ${BINARY_FOLDER}/avidemux_jobs.exe - SetOutPath $INSTDIR\qt5\i18n - ${File} ${BINARY_FOLDER}/qt5/i18n/*.qm -SectionEnd -# !! -Section "Plugins" SecGrpPlugins - SectionIn 1 2 RO - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDevices - ${File} ${BINARY_FOLDER}/plugins/audioDevices/*.dll - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${BINARY_FOLDER}/plugins/audioDecoder/*.dll - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${BINARY_FOLDER}/plugins/audioEncoders/*.dll - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${BINARY_FOLDER}/plugins/demuxers/*.dll - SetOutPath $INSTDIR\plugins\muxers - ${File} ${BINARY_FOLDER}/plugins/muxers/*.dll - SetOutPath $INSTDIR\plugins\scriptEngines - ${File} ${BINARY_FOLDER}/plugins/scriptEngines/libADM_script_tinyPy.dll - SetOutPath $INSTDIR\plugins\autoScripts - ${Folder} ${BINARY_FOLDER}/plugins/autoScripts - # - SetOutPath $INSTDIR\plugins\videoDecoders - ${File} ${BINARY_FOLDER}/plugins/videoDecoders/*.dll - # - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${BINARY_FOLDER}/plugins/videoEncoders/*.dll - # - SetOutPath $INSTDIR\plugins\videoEncoders\qt5 - ${File} ${BINARY_FOLDER}/plugins/videoEncoders/qt5/*.dll - #SetOutPath $INSTDIR\plugins\videoEncoders\cli - #${File} ${BINARY_FOLDER}/plugins/videoEncoders/cli/*.dll - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${BINARY_FOLDER}/plugins/videoFilters/*.dll - SetOutPath $INSTDIR\plugins\videoFilters\qt5 - ${File} ${BINARY_FOLDER}/plugins/videoFilters/qt5/*.dll - SetOutPath $INSTDIR\plugins\videoFilters\cli - ${File} ${BINARY_FOLDER}/plugins/videoFilters/cli/*.dll - # Fonts - SetOutPath $INSTDIR\etc\fonts - ${Folder} ${BINARY_FOLDER}/etc/fonts -SectionEnd -Section "PluginsSettings" SecGrpPluginsSettings - SectionIn 1 2 RO - SetOverwrite on - SetOutPath $INSTDIR\plugins\pluginSettings\x264\3 - ${File} ${BINARY_FOLDER}/plugins/pluginSettings/x264/3/*.json - #SetOutPath $INSTDIR\plugins\pluginSettings\x264\3 - #${File} ${BINARY_FOLDER}/plugins/pluginSettings/x264/3/*.json -SectionEnd -# !! -Section "Avisynth_VapourSynth" SecGrpAvisynth - SectionIn 2 - SetOutPath $INSTDIR - SetOverwrite on - ${File} ${BINARY_FOLDER}/avsproxy32.exe - ${File} ${BINARY_FOLDER}/avsproxy64.exe - #${File} ${BINARY_FOLDER}/avsproxy_gui.exe - # TMP ${File} ${BINARY_FOLDER}/vsProxy.exe - # TMP ${File} ${BINARY_FOLDER}/vsProxy_gui_qt5.exe -SectionEnd -# -Section "ShaderDemo" SecShaderDemo - SectionIn 1 2 RO - SetOutPath $INSTDIR\shaderDemo - SetOverwrite on - ${File} ${BINARY_FOLDER}/plugins/shaderDemo/1/*.shader # FIXME -SectionEnd -# -# -Section "Support libs" SecGrpSupport - SectionIn 1 2 RO - SetOutPath $INSTDIR - SetOverwrite on - ${File} ${BINARY_FOLDER}/*.dll -SectionEnd -# -Section "SDK (to write plugins)" SecGrpDev - SectionIn 2 - SetOverwrite on - SetOutPath $INSTDIR - ${File} ${DEV_FOLDER}/*.dll.a - SetOutPath $INSTDIR\include\avidemux\${API_VERSION} - ${File} ${DEV_FOLDER}/include/avidemux/${API_VERSION}/* - SetOutPath $INSTDIR\include\avidemux\${API_VERSION} - ${File} ${DEV_FOLDER}/include/avidemux/${API_VERSION}/* - !insertmacro InstallDev cmake - !insertmacro InstallDev ADM_core - !insertmacro InstallDev ADM_coreAudio - !insertmacro InstallDev ADM_coreAudioDevice - !insertmacro InstallDev ADM_coreAudioEncoder - !insertmacro InstallDev ADM_coreAudioFilter - !insertmacro InstallDev ADM_coreAudioParser - !insertmacro InstallDev ADM_coreDemuxer - !insertmacro InstallDev ADM_coreDemuxerMpeg - !insertmacro InstallDev ADM_coreImage - !insertmacro InstallDev ADM_coreImageLoader - !insertmacro InstallDev ADM_coreJobs - !insertmacro InstallDev ADM_coreMuxer - !insertmacro InstallDev ADM_coreScript - !insertmacro InstallDev ADM_coreSocket - !insertmacro InstallDev ADM_coreSqlLight3 - !insertmacro InstallDev ADM_coreSubtitles - !insertmacro InstallDev ADM_coreUI - !insertmacro InstallDev ADM_coreUtils - !insertmacro InstallDev ADM_coreVideoCodec - !insertmacro InstallDev ADM_coreVideoEncoder - !insertmacro InstallDev ADM_coreVideoFilter - - !insertmacro InstallDev libavcodec - !insertmacro InstallDev libavformat - !insertmacro InstallDev libavutil - !insertmacro InstallDev libswscale - !insertmacro InstallDev libpostproc - - !insertmacro InstallDev libpostproc - !insertmacro InstallDev qt5 - !insertmacro InstallDevQt5 ADM_openGL - !insertmacro InstallDevQt5 ADM_UIs - -SectionEnd - - +########################## +# Included files +########################## +!addincludedir ${NSIDIR} +!if ${BUILD_BITS} == 64 + !addplugindir ${NSIDIR}/plugin/amd64-unicode +!else + !addplugindir ${NSIDIR}/plugin/x86-unicode +!endif + +!include Sections.nsh +!include MUI2.nsh +!include nsDialogs.nsh +!include Memento.nsh +!include FileFunc.nsh +!include WinVer.nsh +!include WordFunc.nsh +!include AvidemuxVersion.nsh +SetCompressor /SOLID lzma +SetCompressorDictSize 96 +RequestExecutionLevel admin + +########################## +# Defines +########################## +!define REVISION ${SVN_VERSION} +!define EXEDIR "${NSIDIR}/install" + +!define PRODUCT_VERSION "${CORE_VERSION}.${POINT_RELEASE}.${SVN_VERSION}" +!define PRODUCT_NAME "Avidemux ${CORE_VERSION} - ${BUILD_BITS} bits${EXTRA}" +!define PRODUCT_FULLNAME "Avidemux ${PRODUCT_VERSION} (${BUILD_BITS}-bits${EXTRA} Release)" + +!if ${BUILD_BITS} == 64 + !define SHORTCUT_NAME "${PRODUCT_NAME}" + !define REG_GROUPNAME "${PRODUCT_NAME} (${BUILD_BITS}-bit${EXTRA})" +!else + !define SHORTCUT_NAME "${PRODUCT_NAME} (${BUILD_BITS}-bit${EXTRA})" + !define REG_GROUPNAME "${PRODUCT_NAME}" +!endif + +!define REGKEY "SOFTWARE\${REG_GROUPNAME}" +!define UNINST_REGKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_GROUPNAME}" +!define COMPANY "Free Software Foundation" +!define URL "http://www.avidemux.org" + +OutFile "${BINARY_FOLDER}/avidemux_${CORE_VERSION}.${POINT_RELEASE}${EXTRA} r${REVISION}_win${BUILD_BITS}.exe" +Name "${PRODUCT_FULLNAME}" + +########################## +# Memento defines +########################## +!define MEMENTO_REGISTRY_ROOT HKLM +!define MEMENTO_REGISTRY_KEY "${REGKEY}" + +########################## +# MUI defines +########################## +!define MUI_ICON "${SOURCE_FOLDER}/avidemux/common/xpm/adm.ico" +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_RIGHT +!define MUI_HEADERIMAGE_BITMAP "${NSIDIR}/PageHeader.bmp" +!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM +!define MUI_STARTMENUPAGE_REGISTRY_KEY "${REGKEY}" +!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup +!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Avidemux (${BUILD_BITS} bits${EXTRA})" +!define MUI_STARTMENUPAGE_NODISABLE +!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSIDIR}/WelcomeFinishStrip.bmp" +!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSIDIR}/WelcomeFinishStrip.bmp" +!define MUI_UNICON "${SOURCE_FOLDER}/avidemux/common/xpm/adm.ico" +!define MUI_COMPONENTSPAGE_NODESC + +########################## +# Variables +########################## +Var CreateDesktopIcon +Var CreateStartMenuGroup +Var CreateQuickLaunchIcon +Var StartMenuGroup +Var PreviousVersion +Var PreviousVersionState +Var ReinstallUninstall + +########################## +# Installer pages +########################## +!define MUI_WELCOMEPAGE_TITLE "${PRODUCT_FULLNAME} Setup Wizard" +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "${NSIDIR}/License.rtf" + Page custom ReinstallPage ReinstallPageLeave +!insertmacro MUI_PAGE_COMPONENTS +Page custom InstallOptionsPage +!define MUI_PAGE_CUSTOMFUNCTION_PRE IsStartMenuRequired +!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup +!insertmacro MUI_PAGE_DIRECTORY +!define MUI_PAGE_CUSTOMFUNCTION_PRE ActivateInternalSections +!define MUI_PAGE_CUSTOMFUNCTION_SHOW InstFilesPageShow +!define MUI_PAGE_CUSTOMFUNCTION_LEAVE InstFilesPageLeave +!insertmacro MUI_PAGE_INSTFILES +!define MUI_FINISHPAGE_RUN +!define MUI_FINISHPAGE_RUN_FUNCTION RunAvidemux +!define MUI_FINISHPAGE_RUN_TEXT "Run ${PRODUCT_NAME} now" +!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\ChangeLog.html" +!define MUI_FINISHPAGE_SHOWREADME_TEXT "View Change Log now" +!define MUI_FINISHPAGE_LINK "Visit the Avidemux website" +!define MUI_FINISHPAGE_LINK_LOCATION "http://www.avidemux.org" +!define MUI_PAGE_CUSTOMFUNCTION_PRE ConfigureFinishPage +!insertmacro MUI_PAGE_FINISH + +!define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!define MUI_PAGE_CUSTOMFUNCTION_PRE un.FinishPagePre +!insertmacro MUI_UNPAGE_FINISH + +########################## +# Installer languages +########################## +!insertmacro MUI_LANGUAGE English + +########################## +# Installer attributes +########################## +!if ${BUILD_BITS} == 64 + InstallDir "$PROGRAMFILES64\${PRODUCT_NAME}" +!else + InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" +!endif + +CRCCheck on +XPStyle on +ShowInstDetails nevershow +ShowUninstDetails nevershow +VIProductVersion ${PRODUCT_VERSION} +VIAddVersionKey ProductName Avidemux +VIAddVersionKey ProductVersion "${PRODUCT_VERSION}" +VIAddVersionKey FileVersion "" +VIAddVersionKey FileDescription "" +VIAddVersionKey LegalCopyright "" +InstallDirRegKey HKLM "${REGKEY}" Path +BrandingText "Packaged by Mean/Gruntster" +InstType Standard +InstType Full +######################################### +# +######################################### +Function GetAfterChar + Exch $0 ; chop char + Exch + Exch $1 ; input string + Push $2 + Push $3 + StrCpy $2 0 + loop: + IntOp $2 $2 - 1 + StrCpy $3 $1 1 $2 + StrCmp $3 "" 0 +3 + StrCpy $0 "" + Goto exit2 + StrCmp $3 $0 exit1 + Goto loop + exit1: + IntOp $2 $2 + 1 + StrCpy $0 $1 "" $2 + exit2: + Pop $3 + Pop $2 + Pop $1 + Exch $0 ; output +FunctionEnd +#####################################################################© +!define StrReplace '!insertmacro "_Name"' + +########################## +# Uninstaller macros +########################## +!insertmacro un.GetOptions +!insertmacro un.GetParameters + +!define UninstallLogPath "$INSTDIR\uninstall.log" +Var UninstallLogHandle + +; Uninstall log file missing. +LangString UninstallLogMissing ${LANG_ENGLISH} "uninstall.log not found!$\r$\nUninstallation cannot proceed!" +# Regexep Does not work with cross +# Use only one file at a time +!macro InstallFile FILEZ + File "${FILEZ}" + Push "${FILEZ}" + Push "/" + Call GetAfterChar + Pop $R0 + FileWrite $UninstallLogHandle "$OUTDIR\$R0$\r$\n" +!macroend +!define File "!insertmacro InstallFile" + +!macro InstallFolder FILEREGEX + File /r "${FILEREGEX}/*" + Push "$OUTDIR" + Call InstallFolderInternal +!macroend +!define Folder "!insertmacro InstallFolder" + +Function InstallFolderInternal + Pop $9 + !define Index 'Line${__LINE__}' + FindFirst $0 $1 "$9/*" + StrCmp $0 "" "${Index}-End" +"${Index}-Loop:" + StrCmp $1 "" "${Index}-End" + StrCmp $1 "." "${Index}-Next" + StrCmp $1 ".." "${Index}-Next" + IfFileExists "$9\$1\*" 0 "${Index}-Write" + Push $0 + Push $9 + Push "$9\$1" + Call InstallFolderInternal + Pop $9 + Pop $0 + Goto "${Index}-Next" +"${Index}-Write:" + FileWrite $UninstallLogHandle "$9\$1$\r$\n" +"${Index}-Next:" + FindNext $0 $1 + Goto "${Index}-Loop" +"${Index}-End:" + !undef Index +FunctionEnd + +; WriteUninstaller macro +!macro WriteUninstaller Path + WriteUninstaller "${Path}" + FileWrite $UninstallLogHandle "${Path}$\r$\n" +!macroend +!define WriteUninstaller "!insertmacro WriteUninstaller" + +########################## +# Macros +########################## + +!macro InstallQtLanguage LANG_NAME LANG_CODE + SetOverwrite on + + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} installQt${LANG_CODE} endQt${LANG_CODE} + +installQt${LANG_CODE}: + SetOutPath $INSTDIR\qt5\i18n + ${File} qt5/i18n/avidemux_${LANG_CODE}.qm + ${File} qt5/i18n/qt_${LANG_CODE}.qm + +endQt${LANG_CODE}: +!macroend +# +!macro InstallDev xname + SetOutPath $INSTDIR\include\avidemux\${API_VERSION}\${xname} + ${File} ${DEV_FOLDER}/include/avidemux/${API_VERSION}/${xname}/* +!macroend +!macro InstallDevQt5 xname + SetOutPath $INSTDIR\include\avidemux\${API_VERSION}\qt5\${xname} + ${File} ${DEV_FOLDER}/include/avidemux/${API_VERSION}/qt5/${xname}/* +!macroend + + + +########################## +# Installer sections +########################## +Section -OpenLogFile + CreateDirectory "$INSTDIR" + FileOpen $UninstallLogHandle ${UninstallLogPath} a + FileSeek $UninstallLogHandle 0 END +SectionEnd +Section "User interfaces" SecGrpUI + SectionIn 1 2 RO + SetOutPath $INSTDIR + SetOverwrite on + ${File} ${BINARY_FOLDER}/avidemux_cli.exe + ${File} ${BINARY_FOLDER}/avidemux.exe + ${File} ${BINARY_FOLDER}/avidemux_jobs.exe + SetOutPath $INSTDIR\qt5\i18n + ${File} ${BINARY_FOLDER}/qt5/i18n/*.qm +SectionEnd +# !! +Section "Plugins" SecGrpPlugins + SectionIn 1 2 RO + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDevices + ${File} ${BINARY_FOLDER}/plugins/audioDevices/*.dll + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${BINARY_FOLDER}/plugins/audioDecoder/*.dll + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${BINARY_FOLDER}/plugins/audioEncoders/*.dll + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${BINARY_FOLDER}/plugins/demuxers/*.dll + SetOutPath $INSTDIR\plugins\muxers + ${File} ${BINARY_FOLDER}/plugins/muxers/*.dll + SetOutPath $INSTDIR\plugins\scriptEngines + ${File} ${BINARY_FOLDER}/plugins/scriptEngines/libADM_script_tinyPy.dll + SetOutPath $INSTDIR\plugins\autoScripts + ${Folder} ${BINARY_FOLDER}/plugins/autoScripts + # + SetOutPath $INSTDIR\plugins\videoDecoders + ${File} ${BINARY_FOLDER}/plugins/videoDecoders/*.dll + # + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${BINARY_FOLDER}/plugins/videoEncoders/*.dll + # + SetOutPath $INSTDIR\plugins\videoEncoders\qt5 + ${File} ${BINARY_FOLDER}/plugins/videoEncoders/qt5/*.dll + #SetOutPath $INSTDIR\plugins\videoEncoders\cli + #${File} ${BINARY_FOLDER}/plugins/videoEncoders/cli/*.dll + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${BINARY_FOLDER}/plugins/videoFilters/*.dll + SetOutPath $INSTDIR\plugins\videoFilters\qt5 + ${File} ${BINARY_FOLDER}/plugins/videoFilters/qt5/*.dll + SetOutPath $INSTDIR\plugins\videoFilters\cli + ${File} ${BINARY_FOLDER}/plugins/videoFilters/cli/*.dll + # Fonts + SetOutPath $INSTDIR\etc\fonts + ${Folder} ${BINARY_FOLDER}/etc/fonts +SectionEnd +Section "PluginsSettings" SecGrpPluginsSettings + SectionIn 1 2 RO + SetOverwrite on + SetOutPath $INSTDIR\plugins\pluginSettings\x264\3 + ${File} ${BINARY_FOLDER}/plugins/pluginSettings/x264/3/*.json + #SetOutPath $INSTDIR\plugins\pluginSettings\x264\3 + #${File} ${BINARY_FOLDER}/plugins/pluginSettings/x264/3/*.json +SectionEnd +# !! +Section "Avisynth_VapourSynth" SecGrpAvisynth + SectionIn 2 + SetOutPath $INSTDIR + SetOverwrite on + ${File} ${BINARY_FOLDER}/avsproxy32.exe + ${File} ${BINARY_FOLDER}/avsproxy64.exe + #${File} ${BINARY_FOLDER}/avsproxy_gui.exe + # TMP ${File} ${BINARY_FOLDER}/vsProxy.exe + # TMP ${File} ${BINARY_FOLDER}/vsProxy_gui_qt5.exe +SectionEnd +# +Section "ShaderDemo" SecShaderDemo + SectionIn 1 2 RO + SetOutPath $INSTDIR\shaderDemo + SetOverwrite on + ${File} ${BINARY_FOLDER}/plugins/shaderDemo/1/*.shader # FIXME +SectionEnd +# +# +Section "Support libs" SecGrpSupport + SectionIn 1 2 RO + SetOutPath $INSTDIR + SetOverwrite on + ${File} ${BINARY_FOLDER}/*.dll +SectionEnd +# +Section "SDK (to write plugins)" SecGrpDev + SectionIn 2 + SetOverwrite on + SetOutPath $INSTDIR + ${File} ${DEV_FOLDER}/*.dll.a + SetOutPath $INSTDIR\include\avidemux\${API_VERSION} + ${File} ${DEV_FOLDER}/include/avidemux/${API_VERSION}/* + SetOutPath $INSTDIR\include\avidemux\${API_VERSION} + ${File} ${DEV_FOLDER}/include/avidemux/${API_VERSION}/* + !insertmacro InstallDev cmake + !insertmacro InstallDev ADM_core + !insertmacro InstallDev ADM_coreAudio + !insertmacro InstallDev ADM_coreAudioDevice + !insertmacro InstallDev ADM_coreAudioEncoder + !insertmacro InstallDev ADM_coreAudioFilter + !insertmacro InstallDev ADM_coreAudioParser + !insertmacro InstallDev ADM_coreDemuxer + !insertmacro InstallDev ADM_coreDemuxerMpeg + !insertmacro InstallDev ADM_coreImage + !insertmacro InstallDev ADM_coreImageLoader + !insertmacro InstallDev ADM_coreJobs + !insertmacro InstallDev ADM_coreMuxer + !insertmacro InstallDev ADM_coreScript + !insertmacro InstallDev ADM_coreSocket + !insertmacro InstallDev ADM_coreSqlLight3 + !insertmacro InstallDev ADM_coreSubtitles + !insertmacro InstallDev ADM_coreUI + !insertmacro InstallDev ADM_coreUtils + !insertmacro InstallDev ADM_coreVideoCodec + !insertmacro InstallDev ADM_coreVideoEncoder + !insertmacro InstallDev ADM_coreVideoFilter + + !insertmacro InstallDev libavcodec + !insertmacro InstallDev libavformat + !insertmacro InstallDev libavutil + !insertmacro InstallDev libswscale + !insertmacro InstallDev libpostproc + + !insertmacro InstallDev libpostproc + !insertmacro InstallDev qt5 + !insertmacro InstallDevQt5 ADM_openGL + !insertmacro InstallDevQt5 ADM_UIs + +SectionEnd + + diff --git a/avidemux/winInstaller/avidemux_nativeVcQt5.nsi b/avidemux/winInstaller/avidemux_nativeVcQt5.nsi index 5ada7217b9..6863d40f66 100644 --- a/avidemux/winInstaller/avidemux_nativeVcQt5.nsi +++ b/avidemux/winInstaller/avidemux_nativeVcQt5.nsi @@ -1,116 +1,116 @@ -########################## -# Included files -########################## -!define BUILD_BITS 64 -!include "avidemux_nativeQt5Common.nsi" - -Section "Avidemux Core" SecCore - SectionIn 1 2 RO - SetOutPath $INSTDIR - SetOverwrite on - ${File} .\Build-Info.txt - ${File} .\change.css - ${File} .\ChangeLog.html - - - ${File} ${BINARY_FOLDER}\avcodec-58.dll - #${File} ${BINARY_FOLDER}\avdevice-58.dll - ${File} ${BINARY_FOLDER}\avformat-58.dll - ${File} ${BINARY_FOLDER}\avutil-56.dll - ${File} ${BINARY_FOLDER}\libwinpthread-1.dll - ${File} ${BINARY_FOLDER}\libz-1.dll - ${File} ${BINARY_FOLDER}\msvcp140.dll - ${File} ${BINARY_FOLDER}\swscale-5.dll - ${File} ${BINARY_FOLDER}\postproc-55.dll - - ${File} ${BINARY_FOLDER}\Qt5Core.dll - ${File} ${BINARY_FOLDER}\Qt5Gui.dll - ${File} ${BINARY_FOLDER}\Qt5Network.dll - ${File} ${BINARY_FOLDER}\Qt5Widgets.dll - ${File} ${BINARY_FOLDER}\Qt5WinExtras.dll - ${File} ${BINARY_FOLDER}\sqlite3.dll - ${File} ${BINARY_FOLDER}\vcruntime140.dll - - ${File} ${BINARY_FOLDER}\freetype.dll - ${File} ${BINARY_FOLDER}\fribidi.dll - ${File} ${BINARY_FOLDER}\opus.dll - - ${File} ${BINARY_FOLDER}\twolame.dll - - ${File} ${BINARY_FOLDER}\fdk-aac-1.dll - ${File} ${BINARY_FOLDER}\aften.dll - ${File} ${BINARY_FOLDER}\zlibd.dll - ${File} ${BINARY_FOLDER}\zlib.dll - ${File} ${BINARY_FOLDER}\libogg.dll - ${File} ${BINARY_FOLDER}\libvorbis.dll - ${File} ${BINARY_FOLDER}\libvorbisenc-2.dll - ${File} ${BINARY_FOLDER}\libvorbisfile.dll - ${File} ${BINARY_FOLDER}\libx264-146.dll - ${File} ${BINARY_FOLDER}\libx265.dll - ${File} ${BINARY_FOLDER}\xvidcore.dll - -# QT - ${File} ${BINARY_FOLDER}\Qt5Core.dll - ${File} ${BINARY_FOLDER}\Qt5Gui.dll - ${File} ${BINARY_FOLDER}\Qt5Network.dll -# ${File} ${BINARY_FOLDER}\Qt5OpenGL.dll - ${File} ${BINARY_FOLDER}\Qt5Widgets.dll - ${File} ${BINARY_FOLDER}\Qt5WinExtras.dll - SetOutPath $INSTDIR\platforms - ${File} ${BINARY_FOLDER}\platforms\qminimal.dll - ${File} ${BINARY_FOLDER}\platforms\qwindows.dll - SetOutPath $INSTDIR\styles - ${File} ${BINARY_FOLDER}\styles\qwindowsvistastyle.dll - - SetOutPath $INSTDIR -# adm - ${File} ${BINARY_FOLDER}\ADM_audioParser6.dll - ${File} ${BINARY_FOLDER}\ADM_core6.dll - ${File} ${BINARY_FOLDER}\ADM_coreAudio6.dll - ${File} ${BINARY_FOLDER}\ADM_coreAudioDevice6.dll - ${File} ${BINARY_FOLDER}\ADM_coreAudioEncoder6.dll - ${File} ${BINARY_FOLDER}\ADM_coreAudioFilterAPI6.dll - ${File} ${BINARY_FOLDER}\ADM_coreDemuxer6.dll - ${File} ${BINARY_FOLDER}\ADM_coreDemuxerMpeg6.dll - #${File} ${BINARY_FOLDER}\ADM_coreDxva26.dll - ${File} ${BINARY_FOLDER}\ADM_coreImage6.dll - ${File} ${BINARY_FOLDER}\ADM_coreImageLoader6.dll - ${File} ${BINARY_FOLDER}\ADM_coreJobs.dll - ${File} ${BINARY_FOLDER}\ADM_coreMuxer6.dll - ${File} ${BINARY_FOLDER}\ADM_coreScript.dll - ${File} ${BINARY_FOLDER}\ADM_coreSocket6.dll - ${File} ${BINARY_FOLDER}\ADM_coreSqlLight3.dll - ${File} ${BINARY_FOLDER}\ADM_coreSubtitles6.dll - ${File} ${BINARY_FOLDER}\ADM_coreUI6.dll - ${File} ${BINARY_FOLDER}\ADM_coreUtils6.dll - ${File} ${BINARY_FOLDER}\ADM_coreVideoCodec6.dll - ${File} ${BINARY_FOLDER}\ADM_coreVideoEncoder6.dll - ${File} ${BINARY_FOLDER}\ADM_coreVideoFilter6.dll - ${File} ${BINARY_FOLDER}\*ADM_openGLQT56.dll - ${File} ${BINARY_FOLDER}\*ADM_render6_cli.dll - ${File} ${BINARY_FOLDER}\*ADM_render6_QT5.dll - ${File} ${BINARY_FOLDER}\*ADM_UI_Cli6.dll - ${File} ${BINARY_FOLDER}\*ADM_UIQT56.dll - ${File} ${BINARY_FOLDER}\*ADM_coreDxva26.dll - ${File} ${BINARY_FOLDER}\libADM_openGLQT56.dll - ${File} ${BINARY_FOLDER}\libADM_render6_cli.dll - ${File} ${BINARY_FOLDER}\libADM_render6_QT5.dll - ${File} ${BINARY_FOLDER}\libADM_UI_Cli6.dll - ${File} ${BINARY_FOLDER}\libADM_UIQT56.dll - ${File} ${NSIDIR}\..\..\AUTHORS. - ${File} ${NSIDIR}\..\..\COPYING. - ${File} ${NSIDIR}\..\..\README. - # Avs - ${File} d:\avsProxy\avsproxy32.exe - ${File} d:\avsProxy\avsproxy64.exe - - - WriteRegStr HKLM "${REGKEY}" CreateDesktopIcon $CreateDesktopIcon - WriteRegStr HKLM "${REGKEY}" CreateStartMenuGroup $CreateStartMenuGroup - - ${If} ${AtMostWinVista} - WriteRegStr HKLM "${REGKEY}" CreateQuickLaunchIcon $CreateQuickLaunchIcon - ${EndIf} -SectionEnd -!include avidemux_nativeQt5Tail.nsi - +########################## +# Included files +########################## +!define BUILD_BITS 64 +!include "avidemux_nativeQt5Common.nsi" + +Section "Avidemux Core" SecCore + SectionIn 1 2 RO + SetOutPath $INSTDIR + SetOverwrite on + ${File} .\Build-Info.txt + ${File} .\change.css + ${File} .\ChangeLog.html + + + ${File} ${BINARY_FOLDER}\avcodec-58.dll + #${File} ${BINARY_FOLDER}\avdevice-58.dll + ${File} ${BINARY_FOLDER}\avformat-58.dll + ${File} ${BINARY_FOLDER}\avutil-56.dll + ${File} ${BINARY_FOLDER}\libwinpthread-1.dll + ${File} ${BINARY_FOLDER}\libz-1.dll + ${File} ${BINARY_FOLDER}\msvcp140.dll + ${File} ${BINARY_FOLDER}\swscale-5.dll + ${File} ${BINARY_FOLDER}\postproc-55.dll + + ${File} ${BINARY_FOLDER}\Qt5Core.dll + ${File} ${BINARY_FOLDER}\Qt5Gui.dll + ${File} ${BINARY_FOLDER}\Qt5Network.dll + ${File} ${BINARY_FOLDER}\Qt5Widgets.dll + ${File} ${BINARY_FOLDER}\Qt5WinExtras.dll + ${File} ${BINARY_FOLDER}\sqlite3.dll + ${File} ${BINARY_FOLDER}\vcruntime140.dll + + ${File} ${BINARY_FOLDER}\freetype.dll + ${File} ${BINARY_FOLDER}\fribidi.dll + ${File} ${BINARY_FOLDER}\opus.dll + + ${File} ${BINARY_FOLDER}\twolame.dll + + ${File} ${BINARY_FOLDER}\fdk-aac-1.dll + ${File} ${BINARY_FOLDER}\aften.dll + ${File} ${BINARY_FOLDER}\zlibd.dll + ${File} ${BINARY_FOLDER}\zlib.dll + ${File} ${BINARY_FOLDER}\libogg.dll + ${File} ${BINARY_FOLDER}\libvorbis.dll + ${File} ${BINARY_FOLDER}\libvorbisenc-2.dll + ${File} ${BINARY_FOLDER}\libvorbisfile.dll + ${File} ${BINARY_FOLDER}\libx264-146.dll + ${File} ${BINARY_FOLDER}\libx265.dll + ${File} ${BINARY_FOLDER}\xvidcore.dll + +# QT + ${File} ${BINARY_FOLDER}\Qt5Core.dll + ${File} ${BINARY_FOLDER}\Qt5Gui.dll + ${File} ${BINARY_FOLDER}\Qt5Network.dll +# ${File} ${BINARY_FOLDER}\Qt5OpenGL.dll + ${File} ${BINARY_FOLDER}\Qt5Widgets.dll + ${File} ${BINARY_FOLDER}\Qt5WinExtras.dll + SetOutPath $INSTDIR\platforms + ${File} ${BINARY_FOLDER}\platforms\qminimal.dll + ${File} ${BINARY_FOLDER}\platforms\qwindows.dll + SetOutPath $INSTDIR\styles + ${File} ${BINARY_FOLDER}\styles\qwindowsvistastyle.dll + + SetOutPath $INSTDIR +# adm + ${File} ${BINARY_FOLDER}\ADM_audioParser6.dll + ${File} ${BINARY_FOLDER}\ADM_core6.dll + ${File} ${BINARY_FOLDER}\ADM_coreAudio6.dll + ${File} ${BINARY_FOLDER}\ADM_coreAudioDevice6.dll + ${File} ${BINARY_FOLDER}\ADM_coreAudioEncoder6.dll + ${File} ${BINARY_FOLDER}\ADM_coreAudioFilterAPI6.dll + ${File} ${BINARY_FOLDER}\ADM_coreDemuxer6.dll + ${File} ${BINARY_FOLDER}\ADM_coreDemuxerMpeg6.dll + #${File} ${BINARY_FOLDER}\ADM_coreDxva26.dll + ${File} ${BINARY_FOLDER}\ADM_coreImage6.dll + ${File} ${BINARY_FOLDER}\ADM_coreImageLoader6.dll + ${File} ${BINARY_FOLDER}\ADM_coreJobs.dll + ${File} ${BINARY_FOLDER}\ADM_coreMuxer6.dll + ${File} ${BINARY_FOLDER}\ADM_coreScript.dll + ${File} ${BINARY_FOLDER}\ADM_coreSocket6.dll + ${File} ${BINARY_FOLDER}\ADM_coreSqlLight3.dll + ${File} ${BINARY_FOLDER}\ADM_coreSubtitles6.dll + ${File} ${BINARY_FOLDER}\ADM_coreUI6.dll + ${File} ${BINARY_FOLDER}\ADM_coreUtils6.dll + ${File} ${BINARY_FOLDER}\ADM_coreVideoCodec6.dll + ${File} ${BINARY_FOLDER}\ADM_coreVideoEncoder6.dll + ${File} ${BINARY_FOLDER}\ADM_coreVideoFilter6.dll + ${File} ${BINARY_FOLDER}\*ADM_openGLQT56.dll + ${File} ${BINARY_FOLDER}\*ADM_render6_cli.dll + ${File} ${BINARY_FOLDER}\*ADM_render6_QT5.dll + ${File} ${BINARY_FOLDER}\*ADM_UI_Cli6.dll + ${File} ${BINARY_FOLDER}\*ADM_UIQT56.dll + ${File} ${BINARY_FOLDER}\*ADM_coreDxva26.dll + ${File} ${BINARY_FOLDER}\libADM_openGLQT56.dll + ${File} ${BINARY_FOLDER}\libADM_render6_cli.dll + ${File} ${BINARY_FOLDER}\libADM_render6_QT5.dll + ${File} ${BINARY_FOLDER}\libADM_UI_Cli6.dll + ${File} ${BINARY_FOLDER}\libADM_UIQT56.dll + ${File} ${NSIDIR}\..\..\AUTHORS. + ${File} ${NSIDIR}\..\..\COPYING. + ${File} ${NSIDIR}\..\..\README. + # Avs + ${File} d:\avsProxy\avsproxy32.exe + ${File} d:\avsProxy\avsproxy64.exe + + + WriteRegStr HKLM "${REGKEY}" CreateDesktopIcon $CreateDesktopIcon + WriteRegStr HKLM "${REGKEY}" CreateStartMenuGroup $CreateStartMenuGroup + + ${If} ${AtMostWinVista} + WriteRegStr HKLM "${REGKEY}" CreateQuickLaunchIcon $CreateQuickLaunchIcon + ${EndIf} +SectionEnd +!include avidemux_nativeQt5Tail.nsi + diff --git a/avidemux/winInstaller/old/avidemux.nsi b/avidemux/winInstaller/old/avidemux.nsi index 56a9f9419a..baa56b85f4 100644 --- a/avidemux/winInstaller/old/avidemux.nsi +++ b/avidemux/winInstaller/old/avidemux.nsi @@ -1,1816 +1,1816 @@ -########################## -# Included files -########################## -!addincludedir ${NSIDIR} -!addplugindir ${NSIDIR}\plugin - -!include Sections.nsh -!include MUI2.nsh -!include nsDialogs.nsh -!include Memento.nsh -!include FileFunc.nsh -!include UAC.nsh -!include WinVer.nsh -!include WordFunc.nsh -!include revision.nsh - -SetCompressor /SOLID lzma -SetCompressorDictSize 96 -RequestExecutionLevel user - -########################## -# Defines -########################## - -!define CORE_VERSION "2.6" -!define PRODUCT_VERSION "${CORE_VERSION}.1.${REVISION}" -!define PRODUCT_NAME "Avidemux ${CORE_VERSION}" -!define PRODUCT_FULLNAME "Avidemux ${PRODUCT_VERSION} (${BUILD_BITS}-bit beta)" - -!if ${BUILD_BITS} == 64 - !define SHORTCUT_NAME "${PRODUCT_NAME}" - !define REG_GROUPNAME "${PRODUCT_NAME} (${BUILD_BITS}-bit)" -!else - !define SHORTCUT_NAME "${PRODUCT_NAME} (${BUILD_BITS}-bit)" - !define REG_GROUPNAME "${PRODUCT_NAME}" -!endif - -!define REGKEY "SOFTWARE\${REG_GROUPNAME}" -!define UNINST_REGKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_GROUPNAME}" -!define COMPANY "Free Software Foundation" -!define URL "http://www.avidemux.org" - -!ifndef INST_GTK -!ifndef INST_QT -!define INST_GTK -!define INST_QT -!endif -!endif - -!ifdef INST_GTK -!ifdef INST_QT -!define INST_BOTH -!endif -!endif - -!ifdef INST_BOTH -OutFile "${EXEDIR}\avidemux_${CORE_VERSION}_r${REVISION}_full_win${BUILD_BITS}.exe" -Name "${PRODUCT_FULLNAME} Full" -!else ifdef INST_QT -OutFile "${EXEDIR}\avidemux_${CORE_VERSION}_r${REVISION}_win${BUILD_BITS}.exe" -Name "${PRODUCT_FULLNAME}" -!else ifdef INST_GTK -OutFile "${EXEDIR}\avidemux_${CORE_VERSION}_r${REVISION}_gtk_win${BUILD_BITS}.exe" -Name "${PRODUCT_FULLNAME} GTK+" -!endif - -########################## -# Memento defines -########################## -!define MEMENTO_REGISTRY_ROOT HKLM -!define MEMENTO_REGISTRY_KEY "${REGKEY}" - -########################## -# MUI defines -########################## -!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-blue-full.ico" -!define MUI_HEADERIMAGE -!define MUI_HEADERIMAGE_RIGHT -!ifdef INST_GTK -!define MUI_HEADERIMAGE_BITMAP "${NSIDIR}\PageHeaderGtk.bmp" -!else -!define MUI_HEADERIMAGE_BITMAP "${NSIDIR}\PageHeader.bmp" -!endif -!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM -!define MUI_STARTMENUPAGE_REGISTRY_KEY "${REGKEY}" -!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup -!define MUI_STARTMENUPAGE_DEFAULTFOLDER Avidemux -!define MUI_STARTMENUPAGE_NODISABLE -!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSIDIR}\WelcomeFinishStrip.bmp" -!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSIDIR}\WelcomeFinishStrip.bmp" -!define MUI_UNICON "${NSIDIR}\..\common\xpm\adm.ico" -!define MUI_COMPONENTSPAGE_NODESC - -########################## -# Variables -########################## -Var CreateDesktopIcon -Var CreateStartMenuGroup -Var CreateQuickLaunchIcon -Var StartMenuGroup -Var PreviousVersion -Var PreviousVersionState -Var ReinstallUninstall - -########################## -# Installer pages -########################## -!define MUI_WELCOMEPAGE_TITLE "${PRODUCT_FULLNAME} Setup Wizard" -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "${NSIDIR}\License.rtf" - Page custom ReinstallPage ReinstallPageLeave -!ifdef INST_BOTH -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckSelectedUIs -!endif -!insertmacro MUI_PAGE_COMPONENTS -Page custom InstallOptionsPage -!define MUI_PAGE_CUSTOMFUNCTION_PRE IsStartMenuRequired -!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup -!insertmacro MUI_PAGE_DIRECTORY -!define MUI_PAGE_CUSTOMFUNCTION_PRE ActivateInternalSections -!define MUI_PAGE_CUSTOMFUNCTION_SHOW InstFilesPageShow -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE InstFilesPageLeave -!insertmacro MUI_PAGE_INSTFILES -!define MUI_FINISHPAGE_RUN -!define MUI_FINISHPAGE_RUN_FUNCTION RunAvidemux -!define MUI_FINISHPAGE_RUN_TEXT "Run ${PRODUCT_NAME} now" -!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Change Log.html" -!define MUI_FINISHPAGE_SHOWREADME_TEXT "View Change Log now" -!define MUI_FINISHPAGE_LINK "Visit the Avidemux Builds for Windows website" -!define MUI_FINISHPAGE_LINK_LOCATION "http://avidemux.razorbyte.com.au/" -!define MUI_PAGE_CUSTOMFUNCTION_PRE ConfigureFinishPage -!insertmacro MUI_PAGE_FINISH - -!define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES -!define MUI_PAGE_CUSTOMFUNCTION_PRE un.FinishPagePre -!insertmacro MUI_UNPAGE_FINISH - -########################## -# Installer languages -########################## -!insertmacro MUI_LANGUAGE English - -########################## -# Installer attributes -########################## -!if ${BUILD_BITS} == 64 - InstallDir "$PROGRAMFILES64\${PRODUCT_NAME}" -!else - InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" -!endif - -CRCCheck on -XPStyle on -ShowInstDetails nevershow -ShowUninstDetails nevershow -VIProductVersion ${PRODUCT_VERSION} -VIAddVersionKey ProductName Avidemux -VIAddVersionKey ProductVersion "${PRODUCT_VERSION}" -VIAddVersionKey FileVersion "" -VIAddVersionKey FileDescription "" -VIAddVersionKey LegalCopyright "" -InstallDirRegKey HKLM "${REGKEY}" Path -BrandingText "Packaged by Gruntster" -InstType Standard -InstType Full - -########################## -# Uninstaller macros -########################## -!insertmacro un.GetOptions -!insertmacro un.GetParameters - -!define UninstallLogPath "$INSTDIR\uninstall.log" -Var UninstallLogHandle - -; Uninstall log file missing. -LangString UninstallLogMissing ${LANG_ENGLISH} "uninstall.log not found!$\r$\nUninstallation cannot proceed!" - -!macro InstallFile FILEREGEX - File "${FILEREGEX}" - !define Index 'Line${__LINE__}' - ${GetFileName} "${FILEREGEX}" $R0 - FindFirst $0 $1 "$OUTDIR\$R0" - StrCmp $0 "" "${Index}-End" -"${Index}-Loop:" - StrCmp $1 "" "${Index}-End" - FileWrite $UninstallLogHandle "$OUTDIR\$1$\r$\n" - FindNext $0 $1 - Goto "${Index}-Loop" -"${Index}-End:" - !undef Index -!macroend -!define File "!insertmacro InstallFile" - -!macro InstallFolder FILEREGEX - File /r "${FILEREGEX}\*" - Push "$OUTDIR" - Call InstallFolderInternal -!macroend -!define Folder "!insertmacro InstallFolder" - -Function InstallFolderInternal - Pop $9 - !define Index 'Line${__LINE__}' - FindFirst $0 $1 "$9\*" - StrCmp $0 "" "${Index}-End" -"${Index}-Loop:" - StrCmp $1 "" "${Index}-End" - StrCmp $1 "." "${Index}-Next" - StrCmp $1 ".." "${Index}-Next" - IfFileExists "$9\$1\*" 0 "${Index}-Write" - Push $0 - Push $9 - Push "$9\$1" - Call InstallFolderInternal - Pop $9 - Pop $0 - Goto "${Index}-Next" -"${Index}-Write:" - FileWrite $UninstallLogHandle "$9\$1$\r$\n" -"${Index}-Next:" - FindNext $0 $1 - Goto "${Index}-Loop" -"${Index}-End:" - !undef Index -FunctionEnd - -; WriteUninstaller macro -!macro WriteUninstaller Path - WriteUninstaller "${Path}" - FileWrite $UninstallLogHandle "${Path}$\r$\n" -!macroend -!define WriteUninstaller "!insertmacro WriteUninstaller" - -########################## -# Macros -########################## -!macro InstallGtkLanguage LANG_NAME LANG_CODE -!ifdef INST_GTK - SetOverwrite on - - !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} installGtk${LANG_CODE} endGtk${LANG_CODE} - -installGtk${LANG_CODE}: - SetOutPath $INSTDIR\share\locale\${LANG_CODE}\LC_MESSAGES - ${File} share\locale\${LANG_CODE}\LC_MESSAGES\avidemux.mo - ${File} share\locale\${LANG_CODE}\LC_MESSAGES\gtk20.mo - -endGtk${LANG_CODE}: -!endif -!macroend - -!macro InstallQtLanguage LANG_NAME LANG_CODE -!ifdef INST_QT - SetOverwrite on - - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} installQt${LANG_CODE} endQt${LANG_CODE} - -installQt${LANG_CODE}: - SetOutPath $INSTDIR\i18n - ${File} i18n\avidemux_${LANG_CODE}.qm - ${File} i18n\qt_${LANG_CODE}.qm - -endQt${LANG_CODE}: -!endif -!macroend - -########################## -# Installer sections -########################## -Section -OpenLogFile - CreateDirectory "$INSTDIR" - FileOpen $UninstallLogHandle ${UninstallLogPath} a - FileSeek $UninstallLogHandle 0 END -SectionEnd - -Section "Avidemux Core" SecCore - SectionIn 1 2 RO - SetOutPath $INSTDIR - SetOverwrite on - ${File} "Build Info.txt" - ${File} "Change Log.html" - ${File} libexpat-1.dll - ${File} libfreetype-6.dll - ${File} libgcc_s_sjlj-1.dll - ${File} libsqlite3-0.dll - ${File} libstdc++-6.dll - ${File} libwinpthread-1.dll - ${File} zlib1.dll - ${File} libADM_audioParser6.dll - ${File} libADM_core6.dll - ${File} libADM_coreAudio6.dll - ${File} libADM_coreAudioDevice6.dll - ${File} libADM_coreAudioEncoder6.dll - ${File} libADM_coreAudioFilterAPI6.dll - ${File} libADM_coreDemuxer6.dll - ${File} libADM_coreDemuxerMpeg6.dll - ${File} libADM_coreImage6.dll - ${File} libADM_coreImageLoader6.dll - ${File} libADM_coreJobs.dll - ${File} libADM_coreMuxer6.dll - ${File} libADM_coreScript.dll - ${File} libADM_coreSocket6.dll - ${File} libADM_coreSqlLight3.dll - ${File} libADM_coreUI6.dll - ${File} libADM_coreUtils6.dll - ${File} libADM_coreVideoCodec6.dll - ${File} libADM_coreVideoEncoder6.dll - ${File} libADM_coreVideoFilter6.dll - ${File} QtCore4.dll - ${File} QtGui4.dll - ${File} AUTHORS. - ${File} COPYING. - ${File} README. - ${File} avcodec-*.dll - ${File} avformat-*.dll - ${File} avutil-*.dll - ${File} postproc-*.dll - ${File} swscale-*.dll - - WriteRegStr HKLM "${REGKEY}" CreateDesktopIcon $CreateDesktopIcon - WriteRegStr HKLM "${REGKEY}" CreateStartMenuGroup $CreateStartMenuGroup - - ${If} ${AtMostWinVista} - WriteRegStr HKLM "${REGKEY}" CreateQuickLaunchIcon $CreateQuickLaunchIcon - ${EndIf} -SectionEnd - -SectionGroup /e "User interfaces" SecGrpUI - ${MementoUnselectedSection} "Command Line" SecUiCli - SectionIn 2 - SetOutPath $INSTDIR - SetOverwrite on - ${File} avidemux_cli.exe - ${File} libADM_render6_cli.dll - ${File} libADM_UI_Cli6.dll - ${MementoSectionEnd} - -!ifdef INST_BOTH - ${MementoUnselectedSection} GTK+ SecUiGtk - SectionIn 2 -!else ifdef INST_GTK - ${MementoSection} GTK+ SecUiGtk - SectionIn 1 2 RO -!endif -!ifdef INST_BOTH | INST_GTK - SetOverwrite on - SetOutPath $INSTDIR\etc\gtk-2.0 - ${Folder} etc\gtk-2.0 - SetOutPath $INSTDIR\etc\pango - ${Folder} etc\pango - SetOutPath $INSTDIR\lib\gtk-2.0 - ${Folder} lib\gtk-2.0 - SetOutPath $INSTDIR\share\themes - ${Folder} share\themes - SetOutPath $INSTDIR - ${File} avidemux_gtk.exe - ${File} gtk2_prefs.exe - ${File} intl.dll - ${File} libADM_render_gtk.dll - ${File} libADM_UIGtk.dll - ${File} libatk-1.0-0.dll - ${File} libcairo-2.dll - ${File} libgdk_pixbuf-2.0-0.dll - ${File} libgdk-win32-2.0-0.dll - ${File} libgio-2.0-0.dll - ${File} libglib-2.0-0.dll - ${File} libgmodule-2.0-0.dll - ${File} libgobject-2.0-0.dll - ${File} libgthread-2.0-0.dll - ${File} libgtk-win32-2.0-0.dll - ${File} libpango-1.0-0.dll - ${File} libpangocairo-1.0-0.dll - ${File} libpangoft2-1.0-0.dll - ${File} libpangowin32-1.0-0.dll - ${File} libpng14-14.dll - ${File} SDL.dll - ${MementoSectionEnd} -!endif - -!ifdef INST_QT - ${MementoSection} Qt SecUiQt -!ifdef INST_BOTH - SectionIn 1 2 -!else - SectionIn 1 2 RO -!endif - SetOutPath $INSTDIR - SetOverwrite on - ${File} avidemux.exe - ${File} avidemux_jobs.exe - ${File} libADM_render6_qt4.dll - ${File} libADM_UIQT46.dll - ${File} QtOpenGL4.dll - ${MementoSectionEnd} -!endif -SectionGroupEnd - -SectionGroup "Audio Decoders" SecGrpAudioDecoder - ${MementoSection} "µ-law" SecAudDecUlaw - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} plugins\audioDecoder\libADM_ad_ulaw.dll - ${MementoSectionEnd} - ${MementoSection} "AAC (FAAD)" SecAudDecFaad - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} plugins\audioDecoder\libADM_ad_faad.dll - SetOutPath $INSTDIR - ${File} libfaad2.dll - ${MementoSectionEnd} - ${MementoSection} "AAC, AC-3, ADPCM IMA AMV, DTS, E-AC-3, MP2, MP3, Nellymoser, QDesign, WMA (libavcodec)" SecAudDecAvcodec - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} plugins\audioDecoder\libADM_ad_lav.dll - ${MementoSectionEnd} - ${MementoSection} "AC-3 (liba52)" SecAudDecA52 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} plugins\audioDecoder\libADM_ad_a52.dll - ${MementoSectionEnd} - ${MementoSection} "ADPCM IMA" SecAudDecImaAdpcm - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} plugins\audioDecoder\libADM_ad_ima_adpcm.dll - ${MementoSectionEnd} - ${MementoSection} "ADPCM Microsoft" SecAudDecMsAdpcm - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} plugins\audioDecoder\libADM_ad_ms_adpcm.dll - ${MementoSectionEnd} - ${MementoSection} "AMR-NB" SecAudDecOpencoreAmrNb - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} plugins\audioDecoder\libADM_ad_opencore_amrnb.dll - SetOutPath $INSTDIR - ${File} libopencore-amrnb-*.dll - ${MementoSectionEnd} - ${MementoSection} "AMR-WB" SecAudDecOpencoreAmrWb - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} plugins\audioDecoder\libADM_ad_opencore_amrwb.dll - SetOutPath $INSTDIR - ${File} libopencore-amrwb-*.dll - ${MementoSectionEnd} - ${MementoSection} "MP2, MP3 (MAD)" SecAudDecMad - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} plugins\audioDecoder\libADM_ad_Mad.dll - ${MementoSectionEnd} - ${MementoSection} "Vorbis" SecAudDecVorbis - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} plugins\audioDecoder\libADM_ad_vorbis.dll - SetOutPath $INSTDIR - ${File} libogg-0.dll - ${File} libvorbis-0.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Audio Devices" SecGrpAudioDevice - ${MementoSection} "Waveform" SecAudDevWaveform - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDevices - ${File} plugins\audioDevices\libADM_av_win32.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Audio Encoders" SecGrpAudioEncoder - ${MementoSection} "AAC (FAAC)" SecAudEncFaac - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} plugins\audioEncoders\libADM_ae_faac.dll - SetOutPath $INSTDIR - ${File} libfaac.dll - ${MementoSectionEnd} - ${MementoSection} "AAC (libavcodec)" SecAudEncLavAac - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} plugins\audioEncoders\libADM_ae_lav_aac.dll - ${MementoSectionEnd} - ${MementoSection} "AC-3 (Aften)" SecAudDecAften - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} plugins\audioEncoders\libADM_ae_aften.dll - SetOutPath $INSTDIR - ${File} aften.dll - ${MementoSectionEnd} - ${MementoSection} "AC-3 (libavcodec)" SecAudEncLavAc3 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} plugins\audioEncoders\libADM_ae_lav_ac3.dll - ${MementoSectionEnd} - #${MementoSection} "DTS (dcaenc)" SecAudDecDcaEnc - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\audioEncoders - #${File} plugins\audioEncoders\libADM_ae_dcaenc.dll - #SetOutPath $INSTDIR - #${File} libdcaenc-0.dll - #${MementoSectionEnd} - ${MementoSection} "MP2 (libavcodec)" SecAudEncLavMp2 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} plugins\audioEncoders\libADM_ae_lav_mp2.dll - SetOutPath $INSTDIR - ${File} libtwolame-*.dll - ${MementoSectionEnd} - ${MementoSection} "MP2 (TwoLAME)" SecAudEncTwoLame - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} plugins\audioEncoders\libADM_ae_twolame.dll - ${MementoSectionEnd} - ${MementoSection} "MP3" SecAudEncLame - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} plugins\audioEncoders\libADM_ae_lame.dll - SetOutPath $INSTDIR - ${File} libmp3lame-0.dll - ${MementoSectionEnd} - ${MementoSection} "PCM" SecAudEncPcm - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} plugins\audioEncoders\libADM_ae_pcm.dll - ${MementoSectionEnd} - ${MementoSection} "Vorbis" SecAudEncVorbis - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} plugins\audioEncoders\libADM_ae_vorbis.dll - SetOutPath $INSTDIR - ${File} libogg-0.dll - ${File} libvorbis-0.dll - ${File} libvorbisenc-2.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Avisynth" SecGrpAvisynth - ${MementoUnselectedSection} "Avisynth Proxy" SecAvsProxy - SectionIn 2 - SetOutPath $INSTDIR - SetOverwrite on - ${File} avsproxy.exe - ${File} avsproxy_gui.exe - ${MementoSectionEnd} - ${MementoUnselectedSection} "Avisynth Proxy Demuxer" SecDemuxAvisynth - SectionIn 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} plugins\demuxers\libADM_dm_avsproxy.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Demuxers" SecGrpDemuxers - ${MementoSection} "ASF" SecDemuxAsf - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} plugins\demuxers\libADM_dm_asf.dll - ${MementoSectionEnd} - ${MementoSection} "BMP, JPEG, PNG Images" SecDemuxImage - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} plugins\demuxers\libADM_dm_pic.dll - ${MementoSectionEnd} - ${MementoSection} "Flash Video" SecDemuxFlv - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} plugins\demuxers\libADM_dm_flv.dll - ${MementoSectionEnd} - ${MementoSection} "Matroska" SecDemuxMatroska - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} plugins\demuxers\libADM_dm_matroska.dll - ${MementoSectionEnd} - ${MementoSection} "MP4" SecDemuxMp4 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} plugins\demuxers\libADM_dm_mp4.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-PS" SecDemuxMpegPs - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} plugins\demuxers\libADM_dm_ps.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-TS" SecDemuxMpegTs - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} plugins\demuxers\libADM_dm_ts.dll - ${MementoSectionEnd} - ${MementoSection} "MXF" SecDemuxMxf - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} plugins\demuxers\libADM_dm_mxf.dll - ${MementoSectionEnd} - ${MementoSection} "OpenDML AVI" SecDemuxOpenDml - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} plugins\demuxers\libADM_dm_opendml.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Muxers" SecGrpMuxers - ${MementoSection} "Dummy [Raw Audio/Video]" SecMuxDummy - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} plugins\muxers\libADM_mx_dummy.dll - ${MementoSectionEnd} - ${MementoSection} "Flash Video" SecMuxLavFlv - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} plugins\muxers\libADM_mx_flv.dll - ${MementoSectionEnd} - ${MementoSection} "Matroska" SecMuxLavMatroska - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} plugins\muxers\libADM_mx_Mkv.dll - ${MementoSectionEnd} - ${MementoSection} "MP4 (libavcodec)" SecMuxLavMp4 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} plugins\muxers\libADM_mx_mp4.dll - ${MementoSectionEnd} - ${MementoSection} "MP4 (MP4v2)" SecMuxMp4v2 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} plugins\muxers\libADM_mx_mp4v2.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-PS" SecMuxLavMpegPs - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} plugins\muxers\libADM_mx_ffPS.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-TS" SecMuxLavMpegTs - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} plugins\muxers\libADM_mx_ffTS.dll - ${MementoSectionEnd} - ${MementoSection} "OpenDML AVI" SecMuxOpenDml - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} plugins\muxers\libADM_mx_avi.dll - ${MementoSectionEnd} - ${MementoSection} "Raw Video" SecMuxRaw - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} plugins\muxers\libADM_mx_raw.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Script Engines" SecGrpScriptEngine - ${MementoSection} "QtScript" SecScriptQt - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR - ${File} QtScript4.dll - ${File} QtScriptTools4.dll - SetOutPath $INSTDIR\plugins\scriptEngines - ${File} plugins\scriptEngines\libADM_script_qt.dll - SetOutPath $INSTDIR\help\QtScript - ${Folder} help\QtScript - ${MementoSectionEnd} - ${MementoSection} "SpiderMonkey" SecScriptSpiderMonkey - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR - ${File} nspr4.dll - ${File} libjs.dll - SetOutPath $INSTDIR\plugins\scriptEngines - ${File} plugins\scriptEngines\libADM_script_spiderMonkey.dll - ${MementoSectionEnd} - ${MementoSection} "Tinypy" SecScriptTinypy - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\scriptEngines - ${File} plugins\scriptEngines\libADM_script_tinyPy.dll - SetOutPath $INSTDIR\plugins\autoScripts - ${Folder} plugins\autoScripts - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Video Decoders" SecGrpVideoDecoder - ${MementoSection} "VP8" SecVidDecVpx - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoDecoders - ${File} plugins\videoDecoders\libADM_vd_vpx.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Video Encoders" SecGrpVideoEncoder - ${MementoSection} "[Null]" SecVidEncNull - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} plugins\videoEncoders\libADM_ve_null.dll - ${MementoSectionEnd} - ${MementoSection} "Huffyuv, FFVHuff" SecVidEncLavHuffyuv - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} plugins\videoEncoders\libADM_ve_huff.dll - ${MementoSectionEnd} - ${MementoSection} "JPEG" SecVidEncLavJpeg - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} plugins\videoEncoders\libADM_ve_jpeg.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-2" SecVidEncLavMpeg2 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} plugins\videoEncoders\libADM_ve_ffMpeg2.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-4 ASP (libavcodec)" SecVidEncLavMpeg4asp - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} plugins\videoEncoders\libADM_ve_ffMpeg4.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-4 ASP (Xvid)" SecVidEncXvid - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} plugins\videoEncoders\libADM_ve_xvid4.dll - SetOutPath $INSTDIR - ${File} xvidcore.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-4 AVC" SecVidEncX264 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - - !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk -InstallCli: - ${File} plugins\videoEncoders\libADM_ve_x264_other.dll -CheckGtk: -!ifdef INST_GTK - !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt -InstallGtk: - ${File} plugins\videoEncoders\libADM_vidEnc_x264_Gtk.dll -CheckQt: -!endif -!ifdef INST_QT - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End -InstallQt: - ${File} plugins\videoEncoders\libADM_ve_x264_qt4.dll -End: -!endif - SetOutPath $INSTDIR\plugins\pluginSettings\x264 - ${Folder} plugins\pluginSettings\x264 - SetOutPath $INSTDIR - ${File} libx264-*.dll - ${MementoSectionEnd} - ${MementoSection} "PNG" SecVidEncLavPng - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} plugins\videoEncoders\libADM_ve_png.dll - ${MementoSectionEnd} - ${MementoSection} "Sorenson Spark" SecVidEncSorenson - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} plugins\videoEncoders\libADM_ve_ffFlv1.dll - ${MementoSectionEnd} - ${MementoSection} "YV12" SecVidEncYv12 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} plugins\videoEncoders\libADM_ve_yv12.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Video Filters" SecGrpVideoFilter - SectionGroup "Transform Filters" SecGrpVideoFilterTransform - ${MementoSection} "Add Black Borders" SecVidFltBlackBorders - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_addBorders.dll - ${MementoSectionEnd} - ${MementoSection} "Add Logo" SecVidFltLogo - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_logo.dll - ${MementoSectionEnd} - ${MementoSection} "Blacken Borders" SecVidFltBlackenBorders - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_blackenBorders.dll - ${MementoSectionEnd} - ${MementoSection} "Change FPS" SecVidFltChangeFps - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_changeFps.dll - ${MementoSectionEnd} - ${MementoSection} "Crop" SecVidFltCrop - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk -InstallCli: - ${File} plugins\videoFilters\libADM_vf_CropCli.dll -CheckGtk: -!ifdef INST_GTK - !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt -InstallGtk: - ${File} plugins\videoFilters\libADM_vf_CropGtk.dll -CheckQt: -!endif -!ifdef INST_QT - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End -InstallQt: - ${File} plugins\videoFilters\libADM_vf_cropQt4.dll -End: -!endif - ${MementoSectionEnd} - ${MementoSection} "Fade" SecVidFltFade - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_fadeToBlack.dll - ${MementoSectionEnd} - ${MementoSection} "Greyscale" SecVidFltLumaOnly - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_lumaOnly.dll - ${MementoSectionEnd} - ${MementoSection} "Horizontal Flip" SecVidFltHorizontalFlip - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_hf_hflip.dll - ${MementoSectionEnd} - ${MementoSection} "libswscale Resize" SecVidFltSwscaleResize - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk -InstallCli: - ${File} plugins\videoFilters\libADM_vf_swscaleResize_cli.dll -CheckGtk: -!ifdef INST_GTK - !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt -InstallGtk: - ${File} plugins\videoFilters\libADM_vf_swscaleResize_gtk.dll -CheckQt: -!endif -!ifdef INST_QT - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End -InstallQt: - ${File} plugins\videoFilters\libADM_vf_swscaleResize_qt4.dll -End: -!endif - ${MementoSectionEnd} - ${MementoSection} "Resample FPS" SecVidFltResampleFps - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_resampleFps.dll - ${MementoSectionEnd} - ${MementoSection} "Rotate" SecVidFltRotate - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_rotate.dll - ${MementoSectionEnd} - ${MementoSection} "Vertical Flip" SecVidFltVerticalFlip - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_vflip.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Interlacing Filters" SecGrpVideoFilterInterlacing - ${MementoSection} "Decomb Decimate" SecVidFltDecombDecimate - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_decimate.dll - ${MementoSectionEnd} - ${MementoSection} "Decomb Telecide" SecVidFltDecombTelecide - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_telecide.dll - ${MementoSectionEnd} - ${MementoSection} "DGBob" SecVidFltDgbob - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_DgBob.dll - ${MementoSectionEnd} - ${MementoSection} "Horizontal Stack Fields" SecVidFltHzStackFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_hzstackField.dll - ${MementoSectionEnd} - ${MementoSection} "Kernel Deint" SecVidFltKernelDeint - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_kernelDeint.dll - ${MementoSectionEnd} - ${MementoSection} "libavcodec Deinterlacers" SecVidFltLavDeinterlacers - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_lavDeint.dll - ${MementoSectionEnd} - ${MementoSection} "Merge Fields" SecVidFltMergeFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_mergeField.dll - ${MementoSectionEnd} - ${MementoSection} "Separate Fields" SecVidFltSeparateFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_separateField.dll - ${MementoSectionEnd} - ${MementoSection} "Stack Fields" SecVidFltStackFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_stackField.dll - ${MementoSectionEnd} - ${MementoSection} "Unstack Fields" SecVidFltUnstackFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_unstackField.dll - ${MementoSectionEnd} - ${MementoSection} "Yadif" SecVidFltYadif - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_yadif.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Colour Filters" SecGrpVideoFilterColour - ${MementoSection} "Avisynth Colour YUV" SecVidFltAvisynthColourYuv - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_colorYuv.dll - ${MementoSectionEnd} - ${MementoSection} "ChromaShift" SecVidFltChromaShift - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk -InstallCli: - ${File} plugins\videoFilters\libADM_vf_chromaShiftCli.dll -CheckGtk: -!ifdef INST_GTK - !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt -InstallGtk: - ${File} plugins\videoFilters\libADM_vf_chromaShiftGtk.dll -CheckQt: -!endif -!ifdef INST_QT - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End -InstallQt: - ${File} plugins\videoFilters\libADM_vf_chromaShiftQt4.dll -End: -!endif - ${MementoSectionEnd} - ${MementoSection} "Contrast" SecVidFltContrast - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk -InstallCli: - ${File} plugins\videoFilters\libADM_vf_contrastCli.dll -CheckGtk: -!ifdef INST_GTK - !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt -InstallGtk: - ${File} plugins\videoFilters\libADM_vf_contrastGtk.dll -CheckQt: -!endif -!ifdef INST_QT - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End -InstallQt: - ${File} plugins\videoFilters\libADM_vf_contrastQt4.dll -End: -!endif - ${MementoSectionEnd} - ${MementoSection} "MPlater Eq2" SecVidFltMplayerEq2 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk -InstallCli: - ${File} plugins\videoFilters\libADM_vf_eq2Cli.dll -CheckGtk: -!ifdef INST_GTK - !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt -InstallGtk: - ${File} plugins\videoFilters\libADM_vf_eq2Gtk.dll -CheckQt: -!endif -!ifdef INST_QT - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End -InstallQt: - ${File} plugins\videoFilters\libADM_vf_eq2Qt4.dll -End: -!endif - ${MementoSectionEnd} - ${MementoSection} "MPlater Hue" SecVidFltMplayerHue - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk -InstallCli: - ${File} plugins\videoFilters\libADM_vf_HueCli.dll -CheckGtk: -!ifdef INST_GTK - !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt -InstallGtk: - ${File} plugins\videoFilters\libADM_vf_HueGtk.dll -CheckQt: -!endif -!ifdef INST_QT - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End -InstallQt: - ${File} plugins\videoFilters\libADM_vf_HueQt4.dll -End: -!endif - ${MementoSectionEnd} - ${MementoSection} "Remove Plane" SecVidFltRemovePlane - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_removePlane.dll - ${MementoSectionEnd} - ${MementoSection} "Swap U and V" SecVidFltSwapUandV - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_swapUV.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Noise Filters" SecGrpVideoFilterNoise - ${MementoSection} "FluxSmooth" SecVidFltFluxSmooth - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_FluxSmooth.dll - ${MementoSectionEnd} - ${MementoSection} "Gaussian Convolution" SecVidFltGauss - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_gauss.dll - ${MementoSectionEnd} - ${MementoSection} "Large Median (5x5)" SecVidFltMediam5x5 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_largeMedian.dll - ${MementoSectionEnd} - ${MementoSection} "Mean Convolution" SecVidFltMean - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_mean.dll - ${MementoSectionEnd} - ${MementoSection} "Median Convolution" SecVidFltMedian - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_median.dll - ${MementoSectionEnd} - ${MementoSection} "MPlayer Denoise 3D" SecVidFltMPlayerDenoise3d - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_denoise3d.dll - ${MementoSectionEnd} - ${MementoSection} "MPlayer Denoise 3D HQ" SecVidFltMPlayerDenoise3dHq - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_denoise3dhq.dll - ${MementoSectionEnd} - ${MementoSection} "MSharpen" SecVidFltMSharpen - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_msharpen.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Sharpness Filters" SecGrpVideoFilterSharpness - ${MementoSection} "asharp" SecVidFltAsharp - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_asharpQt4.dll - ${MementoSectionEnd} - ${MementoSection} "MPlayer Delogo" SecVidFltMPlayerDelogo - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_mpdelogoQt4.dll - ${MementoSectionEnd} - ${MementoSection} "Sharpen" SecVidFltSharpen - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_sharpen.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Subtitle Filters" SecGrpVideoFilterSubtitle - ${MementoSection} "ASS, SSA" SecVidFltAssSsa - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_ssa.dll - SetOutPath $INSTDIR - ${File} libfribidi-0.dll - ${File} libfontconfig-1.dll - SetOutPath $INSTDIR\etc\fonts - ${Folder} etc\fonts - ${MementoSectionEnd} - SectionGroupEnd - #SectionGroup "OpenGL Filters" SecGrpVideoFilterOpenGl - #${MementoSection} "Fragment Shader" SecVidFltOpenGlFragmentShader - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} plugins\videoFilters\libADM_vf_sampleGlFrag2.dll - #${MementoSectionEnd} - #${MementoSection} "Read Back Benchmark" SecVidFltOpenGlReadBack - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} plugins\videoFilters\libADM_vf_glBenchmark.dll - #${MementoSectionEnd} - #${MementoSection} "Resize" SecVidFltOpenGlResize - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} plugins\videoFilters\libADM_vf_glResize.dll - #${MementoSectionEnd} - #${MementoSection} "Rotate" SecVidFltOpenGlRotate - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} plugins\videoFilters\libADM_vf_rotateGlFrag2.dll - #${MementoSectionEnd} - #${MementoSection} "Wave" SecVidFltOpenGlWave - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} plugins\videoFilters\libADM_vf_sampleGlVertex.dll - #${MementoSectionEnd} - #SectionGroupEnd - SectionGroup "Miscellaneous Filters" SecGrpVideoFilterMiscellaneous - ${MementoSection} "Print Information" SecVidFltPrintInfo - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} plugins\videoFilters\libADM_vf_printInfo.dll - ${MementoSectionEnd} - SectionGroupEnd -SectionGroupEnd - -${MementoSection} "-Start menu Change Log" SecStartMenuChangeLog - CreateDirectory $SMPROGRAMS\$StartMenuGroup - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - SetOutPath $INSTDIR - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Change Log ${CORE_VERSION}.lnk" "$INSTDIR\Change Log.html" - !insertmacro MUI_STARTMENU_WRITE_END -${MementoSectionEnd} - -${MementoSection} "-Start menu GTK+" SecStartMenuGtk -!ifdef INST_GTK - CreateDirectory $SMPROGRAMS\$StartMenuGroup - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - SetOutPath $INSTDIR - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME} GTK+.lnk" $INSTDIR\avidemux_gtk.exe - !insertmacro MUI_STARTMENU_WRITE_END -!endif -${MementoSectionEnd} - -${MementoSection} "-Start menu Qt" SecStartMenuQt -!ifdef INST_QT - CreateDirectory $SMPROGRAMS\$StartMenuGroup - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - SetOutPath $INSTDIR - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe - !insertmacro MUI_STARTMENU_WRITE_END -!endif -${MementoSectionEnd} - -${MementoSection} "-Start menu AVS Proxy GUI" SecStartMenuAvsProxyGui - CreateDirectory $SMPROGRAMS\$StartMenuGroup - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - SetOutPath $INSTDIR - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\AVS Proxy GUI ${CORE_VERSION}.lnk" "$INSTDIR\avsproxy_gui.exe" - !insertmacro MUI_STARTMENU_WRITE_END -${MementoSectionEnd} - -${MementoSection} "-Quick Launch GTK+" SecQuickLaunchGtk -!ifdef INST_GTK - SetOutPath $INSTDIR - CreateShortcut "$QUICKLAUNCH\${SHORTCUT_NAME} GTK+.lnk" $INSTDIR\avidemux_gtk.exe -!endif -${MementoSectionEnd} - -${MementoSection} "-Quick Launch Qt" SecQuickLaunchQt -!ifdef INST_QT - SetOutPath $INSTDIR - CreateShortcut "$QUICKLAUNCH\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe -!endif -${MementoSectionEnd} - -${MementoSection} "-Desktop GTK+" SecDesktopGtk -!ifdef INST_GTK - SetOutPath $INSTDIR - CreateShortcut "$DESKTOP\${SHORTCUT_NAME} GTK+.lnk" $INSTDIR\avidemux_gtk.exe -!endif -${MementoSectionEnd} - -${MementoSection} "-Desktop Qt" SecDesktopQt -!ifdef INST_QT - SetOutPath $INSTDIR - CreateShortcut "$DESKTOP\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe -!endif -${MementoSectionEnd} - -${MementoSectionDone} - -Section -post SecUninstaller - SectionIn 1 2 - WriteRegStr HKLM "${REGKEY}" Path $INSTDIR - WriteRegStr HKLM "${REGKEY}" Version ${PRODUCT_VERSION} - SetOutPath $INSTDIR - WriteUninstaller $INSTDIR\uninstall.exe - WriteRegStr HKLM "${UNINST_REGKEY}" DisplayName "${SHORTCUT_NAME}" - WriteRegStr HKLM "${UNINST_REGKEY}" DisplayVersion "${PRODUCT_VERSION}" - WriteRegStr HKLM "${UNINST_REGKEY}" DisplayIcon $INSTDIR\uninstall.exe - WriteRegStr HKLM "${UNINST_REGKEY}" UninstallString $INSTDIR\uninstall.exe - WriteRegDWORD HKLM "${UNINST_REGKEY}" NoModify 1 - WriteRegDWORD HKLM "${UNINST_REGKEY}" NoRepair 1 -SectionEnd - -Section -CloseLogFile - FileClose $UninstallLogHandle - SetFileAttributes ${UninstallLogPath} HIDDEN -SectionEnd - -Section Uninstall - !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup - -!ifdef INST_GTK - Delete /REBOOTOK "$QUICKLAUNCH\${SHORTCUT_NAME} GTK+.lnk" - Delete /REBOOTOK "$DESKTOP\${SHORTCUT_NAME} GTK+.lnk" - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME} GTK+.lnk" -!endif - -!ifdef INST_QT - Delete /REBOOTOK "$QUICKLAUNCH\${SHORTCUT_NAME}.lnk" - Delete /REBOOTOK "$DESKTOP\${SHORTCUT_NAME}.lnk" - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME}.lnk" -!endif - - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Change Log ${CORE_VERSION}.lnk" - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\AVS Proxy GUI ${CORE_VERSION}.lnk" - RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup - DeleteRegValue HKLM "${REGKEY}" StartMenuGroup - - DeleteRegKey HKLM "${UNINST_REGKEY}" - DeleteRegValue HKLM "${REGKEY}" Path - DeleteRegValue HKLM "${REGKEY}" CreateDesktopIcon - DeleteRegValue HKLM "${REGKEY}" CreateStartMenuGroup - DeleteRegValue HKLM "${REGKEY}" CreateQuickLaunchIcon - DeleteRegKey /IfEmpty HKLM "${REGKEY}" - - FileOpen $UninstallLogHandle "${UninstallLogPath}" r -UninstallLoop: - ClearErrors - FileRead $UninstallLogHandle $R0 - IfErrors UninstallEnd - Push $R0 - Call un.TrimNewLines - Pop $R0 - Delete "$R0" - Goto UninstallLoop -UninstallEnd: - FileClose $UninstallLogHandle - Delete "${UninstallLogPath}" - Delete "$INSTDIR\uninstall.exe" - Push "\" - Call un.RemoveEmptyDirs - RMDir "$INSTDIR" -SectionEnd - -########################## -# Installer functions -########################## -Function .onInit -UAC_Elevate: - !insertmacro UAC_RunElevated - StrCmp 1223 $0 UAC_ElevationAborted - StrCmp 0 $0 0 UAC_Err - StrCmp 1 $1 0 UAC_Success - Quit - -UAC_Err: - MessageBox MB_ICONSTOP "Unable to elevate, error $0" - Abort - -UAC_ElevationAborted: - Abort - -UAC_Success: - StrCmp 1 $3 +4 - StrCmp 3 $1 0 UAC_ElevationAborted - MessageBox MB_ICONSTOP "This installer requires admin access." - Goto UAC_Elevate - - Call LoadPreviousSettings - ReadRegStr $PreviousVersion HKLM "${REGKEY}" Version - - ${If} $PreviousVersion != "" - ${VersionCompare} ${PRODUCT_VERSION} $PreviousVersion $PreviousVersionState - ${EndIf} - - InitPluginsDir - SetShellVarContext all -FunctionEnd - -Function .onInstSuccess - ${MementoSectionSave} -FunctionEnd - -Function LoadPreviousSettings - ${MementoSectionRestore} - !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup - -#checkStartMenuGtk: - !insertmacro SectionFlagIsSet ${SecStartMenuGtk} ${SF_SELECTED} enableStartMenu checkStartMenuQt -checkStartMenuQt: - !insertmacro SectionFlagIsSet ${SecStartMenuQt} ${SF_SELECTED} enableStartMenu checkDesktopGtk - -enableStartMenu: - ReadRegStr $CreateStartMenuGroup HKLM "${REGKEY}" CreateStartMenuGroup - - ${If} $CreateStartMenuGroup == "" - StrCpy $CreateStartMenuGroup 1 - ${EndIf} - -checkDesktopGtk: - !insertmacro SectionFlagIsSet ${SecDesktopGtk} ${SF_SELECTED} enableDesktop checkDesktopQt -checkDesktopQt: - !insertmacro SectionFlagIsSet ${SecDesktopQt} ${SF_SELECTED} enableDesktop checkQuickLaunchGtk - -enableDesktop: - ReadRegStr $CreateDesktopIcon HKLM "${REGKEY}" CreateDesktopIcon - - ${If} $CreateDesktopIcon == "" - StrCpy $CreateDesktopIcon 1 - ${EndIf} - -checkQuickLaunchGtk: - !insertmacro SectionFlagIsSet ${SecQuickLaunchGtk} ${SF_SELECTED} enableQuickLaunch checkQuickLaunchQt -checkQuickLaunchQt: - !insertmacro SectionFlagIsSet ${SecQuickLaunchQt} ${SF_SELECTED} enableQuickLaunch end - -enableQuickLaunch: - ${If} ${AtMostWinVista} - ReadRegStr $CreateQuickLaunchIcon HKLM "${REGKEY}" CreateQuickLaunchIcon - - ${If} $CreateQuickLaunchIcon == "" - StrCpy $CreateQuickLaunchIcon 1 - ${EndIf} - ${EndIf} - -end: -FunctionEnd - -Function RunUninstaller - ReadRegStr $R1 HKLM "${UNINST_REGKEY}" "UninstallString" - - ${If} $R1 == "" - Return - ${EndIf} - - ;Run uninstaller - HideWindow - ClearErrors - - ${If} $PreviousVersionState == 0 - ${AndIf} $ReinstallUninstall == 1 - ExecWait '$R1 _?=$INSTDIR' - ${Else} - ExecWait '$R1 /frominstall _?=$INSTDIR' - ${EndIf} - - IfErrors NoRemoveUninstaller - IfFileExists "$INSTDIR\uninstall.exe" 0 NoRemoveUninstaller - Delete "$R1" - RMDir $INSTDIR - -NoRemoveUninstaller: -FunctionEnd - -!ifdef INST_BOTH -Function CheckSelectedUIs - !insertmacro SectionFlagIsSet ${SecGrpUI} ${SF_SELECTED} end checkPartial -checkPartial: - !insertmacro SectionFlagIsSet ${SecGrpUI} ${SF_PSELECTED} end displayError -displayError: - MessageBox MB_OK|MB_ICONSTOP "At least one User Interface must be selected." - Abort -end: -FunctionEnd -!endif - -LangString INSTALL_OPTS_PAGE_TITLE ${LANG_ENGLISH} "Choose Install Options" -LangString INSTALL_OPTS_PAGE_SUBTITLE ${LANG_ENGLISH} "Choose where to install Avidemux icons." -Var dlgInstallOptions -Var lblCreateIcons -Var chkDesktop -Var chkStartMenu -Var chkQuickLaunch - -Function InstallOptionsPage - Call IsInstallOptionsRequired - !insertmacro MUI_HEADER_TEXT "$(INSTALL_OPTS_PAGE_TITLE)" "$(INSTALL_OPTS_PAGE_SUBTITLE)" - - nsDialogs::Create 1018 - Pop $dlgInstallOptions - - ${If} $dlgInstallOptions == error - Abort - ${EndIf} - - ${NSD_CreateLabel} 0 0u 100% 12u "Create icons for Avidemux:" - Pop $lblCreateIcons - - ${NSD_CreateCheckBox} 0 18u 100% 12u "On my &Desktop" - Pop $chkDesktop - ${NSD_SetState} $chkDesktop $CreateDesktopIcon - ${NSD_OnClick} $chkDesktop UpdateInstallOptions - - ${NSD_CreateCheckBox} 0 36u 100% 12u "In my &Start Menu Programs folder" - Pop $chkStartMenu - ${NSD_SetState} $chkStartMenu $CreateStartMenuGroup - ${NSD_OnClick} $chkStartMenu UpdateInstallOptions - - ${If} ${AtMostWinVista} - ${NSD_CreateCheckBox} 0 54u 100% 12u "In my &Quick Launch bar" - Pop $chkQuickLaunch - ${NSD_SetState} $chkQuickLaunch $CreateQuickLaunchIcon - ${NSD_OnClick} $chkQuickLaunch UpdateInstallOptions - ${EndIf} - - nsDialogs::Show -FunctionEnd - -Function UpdateInstallOptions - ${NSD_GetState} $chkDesktop $CreateDesktopIcon - ${NSD_GetState} $chkStartMenu $CreateStartMenuGroup - ${NSD_GetState} $chkQuickLaunch $CreateQuickLaunchIcon -FunctionEnd - -Function IsInstallOptionsRequired -!ifdef INST_GTK - !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} end checkQt -checkQt: -!ifndef INST_BOTH -Goto end -!endif -!endif -!ifdef INST_QT - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} end resetOptions -resetOptions: -!endif - - StrCpy $CreateDesktopIcon 0 - StrCpy $CreateStartMenuGroup 0 - StrCpy $CreateQuickLaunchIcon 0 - Abort - -end: -FunctionEnd - -Function IsStartMenuRequired - StrCmp $CreateStartMenuGroup 1 +2 - Abort -FunctionEnd - -Function ActivateInternalSections - #AVS Proxy GUI shortcut: - SectionGetFlags ${SecAvsProxy} $0 - IntOp $0 $0 & ${SF_SELECTED} - IntOp $0 $0 & $CreateStartMenuGroup - SectionSetFlags ${SecStartMenuAvsProxyGui} $0 - - #Change Log shortcut: - SectionSetFlags ${SecStartMenuChangeLog} $CreateStartMenuGroup - -!ifdef INST_GTK - #GTK shortcuts: - SectionGetFlags ${SecUiGtk} $0 - IntOp $0 $0 & ${SF_SELECTED} - - IntOp $1 $0 & $CreateDesktopIcon - SectionSetFlags ${SecDesktopGtk} $1 - - IntOp $1 $0 & $CreateQuickLaunchIcon - SectionSetFlags ${SecQuickLaunchGtk} $1 - - IntOp $1 $0 & $CreateStartMenuGroup - SectionSetFlags ${SecStartMenuGtk} $1 -!endif - -!ifdef INST_QT - #Qt shortcuts: - SectionGetFlags ${SecUiQt} $0 - IntOp $0 $0 & ${SF_SELECTED} - - IntOp $1 $0 & $CreateDesktopIcon - SectionSetFlags ${SecDesktopQt} $1 - - IntOp $1 $0 & $CreateQuickLaunchIcon - SectionSetFlags ${SecQuickLaunchQt} $1 - - IntOp $1 $0 & $CreateStartMenuGroup - SectionSetFlags ${SecStartMenuQt} $1 -!endif -FunctionEnd - -Function InstFilesPageShow - ${If} $ReinstallUninstall != "" - Call RunUninstaller - BringToFront - ${EndIf} -FunctionEnd - -Function InstFilesPageLeave - ; Don't advance automatically if details expanded - FindWindow $R0 "#32770" "" $HWNDPARENT - GetDlgItem $R0 $R0 1016 - System::Call user32::IsWindowVisible(i$R0)i.s - Pop $R0 - - StrCmp $R0 0 +2 - SetAutoClose false -FunctionEnd - -Function ConfigureFinishPage -!ifdef INST_GTK - SectionGetFlags ${SecUiGtk} $0 - IntOp $0 $0 & ${SF_SELECTED} - StrCmp $0 ${SF_SELECTED} end -!endif - -!ifdef INST_QT - SectionGetFlags ${SecUiQt} $0 - IntOp $0 $0 & ${SF_SELECTED} - StrCmp $0 ${SF_SELECTED} end -!endif - - DeleteINISec "$PLUGINSDIR\ioSpecial.ini" "Field 4" - -end: -FunctionEnd - -Function RunAvidemux - SetOutPath $INSTDIR - -!ifdef INST_QT -#Qt: - SectionGetFlags ${SecUiQt} $0 - IntOp $0 $0 & ${SF_SELECTED} - - StrCmp $0 ${SF_SELECTED} 0 GTK - !insertmacro UAC_AsUser_ExecShell "" "$INSTDIR\avidemux.exe" "" "" "" - - Goto end -GTK: -!endif - -!ifdef INST_GTK - SectionGetFlags ${SecUiGtk} $0 - IntOp $0 $0 & ${SF_SELECTED} - - StrCmp $0 ${SF_SELECTED} 0 End - !insertmacro UAC_AsUser_ExecShell "" "$INSTDIR\avidemux_gtk.exe" "" "" "" -!endif - -end: -FunctionEnd - -Var ReinstallUninstallButton - -Function ReinstallPage - ${If} $PreviousVersion == "" - Abort - ${EndIf} - - nsDialogs::Create /NOUNLOAD 1018 - Pop $0 - - ${If} $PreviousVersionState == 1 - !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_FULLNAME}." - nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "An older version of Avidemux is installed on your system. Select the operation you want to perform and click Next to continue." - Pop $R0 - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Upgrade Avidemux using previous settings (recommended)" - Pop $ReinstallUninstallButton - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Change settings (advanced)" - Pop $R0 - - ${If} $ReinstallUninstall == "" - StrCpy $ReinstallUninstall 1 - ${EndIf} - ${ElseIf} $PreviousVersionState == 2 - !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_FULLNAME}." - nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "A newer version of Avidemux is already installed! It is not recommended that you downgrade to an older version. Select the operation you want to perform and click Next to continue." - Pop $R0 - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Downgrade Avidemux using previous settings (recommended)" - Pop $ReinstallUninstallButton - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Change settings (advanced)" - Pop $R0 - - ${If} $ReinstallUninstall == "" - StrCpy $ReinstallUninstall 1 - ${EndIf} - ${ElseIf} $PreviousVersionState == 0 - !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform." - nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "${PRODUCT_FULLNAME} is already installed. Select the operation you want to perform and click Next to continue." - Pop $R0 - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Add/Remove/Reinstall components" - Pop $R0 - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Uninstall Avidemux" - Pop $ReinstallUninstallButton - - ${If} $ReinstallUninstall == "" - StrCpy $ReinstallUninstall 2 - ${EndIf} - ${Else} - MessageBox MB_ICONSTOP "Unknown value of PreviousVersionState, aborting" /SD IDOK - Abort - ${EndIf} - - ${If} $ReinstallUninstall == "1" - SendMessage $ReinstallUninstallButton ${BM_SETCHECK} 1 0 - ${Else} - SendMessage $R0 ${BM_SETCHECK} 1 0 - ${EndIf} - - nsDialogs::Show -FunctionEnd - -Function ReinstallPageLeave - SendMessage $ReinstallUninstallButton ${BM_GETCHECK} 0 0 $R0 - - ${If} $R0 == 1 - ; Option to uninstall old version selected - StrCpy $ReinstallUninstall 1 - ${Else} - ; Custom up/downgrade or add/remove/reinstall - StrCpy $ReinstallUninstall 2 - ${EndIf} - - ${If} $ReinstallUninstall == 1 - ${If} $PreviousVersionState == 0 - Call RunUninstaller - Quit - ${Else} - ; Need to reload defaults. User could have - ; chosen custom, change something, went back and selected - ; the express option. - Call LoadPreviousSettings - ${EndIf} - ${EndIf} -FunctionEnd - - -########################## -# Uninstaller functions -########################## -Function un.onInit - SetShellVarContext all - -UAC_Elevate: - !insertmacro UAC_RunElevated - StrCmp 1223 $0 UAC_ElevationAborted - StrCmp 0 $0 0 UAC_Err - StrCmp 1 $1 0 UAC_Success - Quit - -UAC_Err: - MessageBox MB_ICONSTOP "Unable to elevate, error $0" - Abort - -UAC_ElevationAborted: - Abort - -UAC_Success: - StrCmp 1 $3 +4 - StrCmp 3 $1 0 UAC_ElevationAborted - MessageBox MB_ICONSTOP "This installer requires admin access." - Goto UAC_Elevate -FunctionEnd - -; TrimNewlines (copied from NSIS documentation) -; input, top of stack (e.g. whatever$\r$\n) -; output, top of stack (replaces, with e.g. whatever) -; modifies no other variables. -Function un.TrimNewlines - Exch $R0 - Push $R1 - Push $R2 - StrCpy $R1 0 - -loop: - IntOp $R1 $R1 - 1 - StrCpy $R2 $R0 1 $R1 - StrCmp $R2 "$\r" loop - StrCmp $R2 "$\n" loop - IntOp $R1 $R1 + 1 - IntCmp $R1 0 no_trim_needed - StrCpy $R0 $R0 $R1 - -no_trim_needed: - Pop $R2 - Pop $R1 - Exch $R0 -FunctionEnd - -Function un.RemoveEmptyDirs - Pop $9 - !define Index 'Line${__LINE__}' - FindFirst $0 $1 "$INSTDIR$9*" - StrCmp $0 "" "${Index}-End" -"${Index}-Loop:" - StrCmp $1 "" "${Index}-End" - StrCmp $1 "." "${Index}-Next" - StrCmp $1 ".." "${Index}-Next" - Push $0 - Push $1 - Push $9 - Push "$9$1\" - Call un.RemoveEmptyDirs - Pop $9 - Pop $1 - Pop $0 -;"${Index}-Remove:" - RMDir "$INSTDIR$9$1" -"${Index}-Next:" - FindNext $0 $1 - Goto "${Index}-Loop" -"${Index}-End:" - FindClose $0 - !undef Index -FunctionEnd - -Function un.ConfirmPagePre - ${un.GetParameters} $R0 - ${un.GetOptions} $R0 "/frominstall" $R1 - ${Unless} ${Errors} - Abort - ${EndUnless} -FunctionEnd - -Function un.FinishPagePre - ${un.GetParameters} $R0 - ${un.GetOptions} $R0 "/frominstall" $R1 - ${Unless} ${Errors} - SetRebootFlag false - Abort - ${EndUnless} -FunctionEnd +########################## +# Included files +########################## +!addincludedir ${NSIDIR} +!addplugindir ${NSIDIR}\plugin + +!include Sections.nsh +!include MUI2.nsh +!include nsDialogs.nsh +!include Memento.nsh +!include FileFunc.nsh +!include UAC.nsh +!include WinVer.nsh +!include WordFunc.nsh +!include revision.nsh + +SetCompressor /SOLID lzma +SetCompressorDictSize 96 +RequestExecutionLevel user + +########################## +# Defines +########################## + +!define CORE_VERSION "2.6" +!define PRODUCT_VERSION "${CORE_VERSION}.1.${REVISION}" +!define PRODUCT_NAME "Avidemux ${CORE_VERSION}" +!define PRODUCT_FULLNAME "Avidemux ${PRODUCT_VERSION} (${BUILD_BITS}-bit beta)" + +!if ${BUILD_BITS} == 64 + !define SHORTCUT_NAME "${PRODUCT_NAME}" + !define REG_GROUPNAME "${PRODUCT_NAME} (${BUILD_BITS}-bit)" +!else + !define SHORTCUT_NAME "${PRODUCT_NAME} (${BUILD_BITS}-bit)" + !define REG_GROUPNAME "${PRODUCT_NAME}" +!endif + +!define REGKEY "SOFTWARE\${REG_GROUPNAME}" +!define UNINST_REGKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_GROUPNAME}" +!define COMPANY "Free Software Foundation" +!define URL "http://www.avidemux.org" + +!ifndef INST_GTK +!ifndef INST_QT +!define INST_GTK +!define INST_QT +!endif +!endif + +!ifdef INST_GTK +!ifdef INST_QT +!define INST_BOTH +!endif +!endif + +!ifdef INST_BOTH +OutFile "${EXEDIR}\avidemux_${CORE_VERSION}_r${REVISION}_full_win${BUILD_BITS}.exe" +Name "${PRODUCT_FULLNAME} Full" +!else ifdef INST_QT +OutFile "${EXEDIR}\avidemux_${CORE_VERSION}_r${REVISION}_win${BUILD_BITS}.exe" +Name "${PRODUCT_FULLNAME}" +!else ifdef INST_GTK +OutFile "${EXEDIR}\avidemux_${CORE_VERSION}_r${REVISION}_gtk_win${BUILD_BITS}.exe" +Name "${PRODUCT_FULLNAME} GTK+" +!endif + +########################## +# Memento defines +########################## +!define MEMENTO_REGISTRY_ROOT HKLM +!define MEMENTO_REGISTRY_KEY "${REGKEY}" + +########################## +# MUI defines +########################## +!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-blue-full.ico" +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_RIGHT +!ifdef INST_GTK +!define MUI_HEADERIMAGE_BITMAP "${NSIDIR}\PageHeaderGtk.bmp" +!else +!define MUI_HEADERIMAGE_BITMAP "${NSIDIR}\PageHeader.bmp" +!endif +!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM +!define MUI_STARTMENUPAGE_REGISTRY_KEY "${REGKEY}" +!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup +!define MUI_STARTMENUPAGE_DEFAULTFOLDER Avidemux +!define MUI_STARTMENUPAGE_NODISABLE +!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSIDIR}\WelcomeFinishStrip.bmp" +!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSIDIR}\WelcomeFinishStrip.bmp" +!define MUI_UNICON "${NSIDIR}\..\common\xpm\adm.ico" +!define MUI_COMPONENTSPAGE_NODESC + +########################## +# Variables +########################## +Var CreateDesktopIcon +Var CreateStartMenuGroup +Var CreateQuickLaunchIcon +Var StartMenuGroup +Var PreviousVersion +Var PreviousVersionState +Var ReinstallUninstall + +########################## +# Installer pages +########################## +!define MUI_WELCOMEPAGE_TITLE "${PRODUCT_FULLNAME} Setup Wizard" +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "${NSIDIR}\License.rtf" + Page custom ReinstallPage ReinstallPageLeave +!ifdef INST_BOTH +!define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckSelectedUIs +!endif +!insertmacro MUI_PAGE_COMPONENTS +Page custom InstallOptionsPage +!define MUI_PAGE_CUSTOMFUNCTION_PRE IsStartMenuRequired +!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup +!insertmacro MUI_PAGE_DIRECTORY +!define MUI_PAGE_CUSTOMFUNCTION_PRE ActivateInternalSections +!define MUI_PAGE_CUSTOMFUNCTION_SHOW InstFilesPageShow +!define MUI_PAGE_CUSTOMFUNCTION_LEAVE InstFilesPageLeave +!insertmacro MUI_PAGE_INSTFILES +!define MUI_FINISHPAGE_RUN +!define MUI_FINISHPAGE_RUN_FUNCTION RunAvidemux +!define MUI_FINISHPAGE_RUN_TEXT "Run ${PRODUCT_NAME} now" +!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Change Log.html" +!define MUI_FINISHPAGE_SHOWREADME_TEXT "View Change Log now" +!define MUI_FINISHPAGE_LINK "Visit the Avidemux Builds for Windows website" +!define MUI_FINISHPAGE_LINK_LOCATION "http://avidemux.razorbyte.com.au/" +!define MUI_PAGE_CUSTOMFUNCTION_PRE ConfigureFinishPage +!insertmacro MUI_PAGE_FINISH + +!define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!define MUI_PAGE_CUSTOMFUNCTION_PRE un.FinishPagePre +!insertmacro MUI_UNPAGE_FINISH + +########################## +# Installer languages +########################## +!insertmacro MUI_LANGUAGE English + +########################## +# Installer attributes +########################## +!if ${BUILD_BITS} == 64 + InstallDir "$PROGRAMFILES64\${PRODUCT_NAME}" +!else + InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" +!endif + +CRCCheck on +XPStyle on +ShowInstDetails nevershow +ShowUninstDetails nevershow +VIProductVersion ${PRODUCT_VERSION} +VIAddVersionKey ProductName Avidemux +VIAddVersionKey ProductVersion "${PRODUCT_VERSION}" +VIAddVersionKey FileVersion "" +VIAddVersionKey FileDescription "" +VIAddVersionKey LegalCopyright "" +InstallDirRegKey HKLM "${REGKEY}" Path +BrandingText "Packaged by Gruntster" +InstType Standard +InstType Full + +########################## +# Uninstaller macros +########################## +!insertmacro un.GetOptions +!insertmacro un.GetParameters + +!define UninstallLogPath "$INSTDIR\uninstall.log" +Var UninstallLogHandle + +; Uninstall log file missing. +LangString UninstallLogMissing ${LANG_ENGLISH} "uninstall.log not found!$\r$\nUninstallation cannot proceed!" + +!macro InstallFile FILEREGEX + File "${FILEREGEX}" + !define Index 'Line${__LINE__}' + ${GetFileName} "${FILEREGEX}" $R0 + FindFirst $0 $1 "$OUTDIR\$R0" + StrCmp $0 "" "${Index}-End" +"${Index}-Loop:" + StrCmp $1 "" "${Index}-End" + FileWrite $UninstallLogHandle "$OUTDIR\$1$\r$\n" + FindNext $0 $1 + Goto "${Index}-Loop" +"${Index}-End:" + !undef Index +!macroend +!define File "!insertmacro InstallFile" + +!macro InstallFolder FILEREGEX + File /r "${FILEREGEX}\*" + Push "$OUTDIR" + Call InstallFolderInternal +!macroend +!define Folder "!insertmacro InstallFolder" + +Function InstallFolderInternal + Pop $9 + !define Index 'Line${__LINE__}' + FindFirst $0 $1 "$9\*" + StrCmp $0 "" "${Index}-End" +"${Index}-Loop:" + StrCmp $1 "" "${Index}-End" + StrCmp $1 "." "${Index}-Next" + StrCmp $1 ".." "${Index}-Next" + IfFileExists "$9\$1\*" 0 "${Index}-Write" + Push $0 + Push $9 + Push "$9\$1" + Call InstallFolderInternal + Pop $9 + Pop $0 + Goto "${Index}-Next" +"${Index}-Write:" + FileWrite $UninstallLogHandle "$9\$1$\r$\n" +"${Index}-Next:" + FindNext $0 $1 + Goto "${Index}-Loop" +"${Index}-End:" + !undef Index +FunctionEnd + +; WriteUninstaller macro +!macro WriteUninstaller Path + WriteUninstaller "${Path}" + FileWrite $UninstallLogHandle "${Path}$\r$\n" +!macroend +!define WriteUninstaller "!insertmacro WriteUninstaller" + +########################## +# Macros +########################## +!macro InstallGtkLanguage LANG_NAME LANG_CODE +!ifdef INST_GTK + SetOverwrite on + + !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} installGtk${LANG_CODE} endGtk${LANG_CODE} + +installGtk${LANG_CODE}: + SetOutPath $INSTDIR\share\locale\${LANG_CODE}\LC_MESSAGES + ${File} share\locale\${LANG_CODE}\LC_MESSAGES\avidemux.mo + ${File} share\locale\${LANG_CODE}\LC_MESSAGES\gtk20.mo + +endGtk${LANG_CODE}: +!endif +!macroend + +!macro InstallQtLanguage LANG_NAME LANG_CODE +!ifdef INST_QT + SetOverwrite on + + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} installQt${LANG_CODE} endQt${LANG_CODE} + +installQt${LANG_CODE}: + SetOutPath $INSTDIR\i18n + ${File} i18n\avidemux_${LANG_CODE}.qm + ${File} i18n\qt_${LANG_CODE}.qm + +endQt${LANG_CODE}: +!endif +!macroend + +########################## +# Installer sections +########################## +Section -OpenLogFile + CreateDirectory "$INSTDIR" + FileOpen $UninstallLogHandle ${UninstallLogPath} a + FileSeek $UninstallLogHandle 0 END +SectionEnd + +Section "Avidemux Core" SecCore + SectionIn 1 2 RO + SetOutPath $INSTDIR + SetOverwrite on + ${File} "Build Info.txt" + ${File} "Change Log.html" + ${File} libexpat-1.dll + ${File} libfreetype-6.dll + ${File} libgcc_s_sjlj-1.dll + ${File} libsqlite3-0.dll + ${File} libstdc++-6.dll + ${File} libwinpthread-1.dll + ${File} zlib1.dll + ${File} libADM_audioParser6.dll + ${File} libADM_core6.dll + ${File} libADM_coreAudio6.dll + ${File} libADM_coreAudioDevice6.dll + ${File} libADM_coreAudioEncoder6.dll + ${File} libADM_coreAudioFilterAPI6.dll + ${File} libADM_coreDemuxer6.dll + ${File} libADM_coreDemuxerMpeg6.dll + ${File} libADM_coreImage6.dll + ${File} libADM_coreImageLoader6.dll + ${File} libADM_coreJobs.dll + ${File} libADM_coreMuxer6.dll + ${File} libADM_coreScript.dll + ${File} libADM_coreSocket6.dll + ${File} libADM_coreSqlLight3.dll + ${File} libADM_coreUI6.dll + ${File} libADM_coreUtils6.dll + ${File} libADM_coreVideoCodec6.dll + ${File} libADM_coreVideoEncoder6.dll + ${File} libADM_coreVideoFilter6.dll + ${File} QtCore4.dll + ${File} QtGui4.dll + ${File} AUTHORS. + ${File} COPYING. + ${File} README. + ${File} avcodec-*.dll + ${File} avformat-*.dll + ${File} avutil-*.dll + ${File} postproc-*.dll + ${File} swscale-*.dll + + WriteRegStr HKLM "${REGKEY}" CreateDesktopIcon $CreateDesktopIcon + WriteRegStr HKLM "${REGKEY}" CreateStartMenuGroup $CreateStartMenuGroup + + ${If} ${AtMostWinVista} + WriteRegStr HKLM "${REGKEY}" CreateQuickLaunchIcon $CreateQuickLaunchIcon + ${EndIf} +SectionEnd + +SectionGroup /e "User interfaces" SecGrpUI + ${MementoUnselectedSection} "Command Line" SecUiCli + SectionIn 2 + SetOutPath $INSTDIR + SetOverwrite on + ${File} avidemux_cli.exe + ${File} libADM_render6_cli.dll + ${File} libADM_UI_Cli6.dll + ${MementoSectionEnd} + +!ifdef INST_BOTH + ${MementoUnselectedSection} GTK+ SecUiGtk + SectionIn 2 +!else ifdef INST_GTK + ${MementoSection} GTK+ SecUiGtk + SectionIn 1 2 RO +!endif +!ifdef INST_BOTH | INST_GTK + SetOverwrite on + SetOutPath $INSTDIR\etc\gtk-2.0 + ${Folder} etc\gtk-2.0 + SetOutPath $INSTDIR\etc\pango + ${Folder} etc\pango + SetOutPath $INSTDIR\lib\gtk-2.0 + ${Folder} lib\gtk-2.0 + SetOutPath $INSTDIR\share\themes + ${Folder} share\themes + SetOutPath $INSTDIR + ${File} avidemux_gtk.exe + ${File} gtk2_prefs.exe + ${File} intl.dll + ${File} libADM_render_gtk.dll + ${File} libADM_UIGtk.dll + ${File} libatk-1.0-0.dll + ${File} libcairo-2.dll + ${File} libgdk_pixbuf-2.0-0.dll + ${File} libgdk-win32-2.0-0.dll + ${File} libgio-2.0-0.dll + ${File} libglib-2.0-0.dll + ${File} libgmodule-2.0-0.dll + ${File} libgobject-2.0-0.dll + ${File} libgthread-2.0-0.dll + ${File} libgtk-win32-2.0-0.dll + ${File} libpango-1.0-0.dll + ${File} libpangocairo-1.0-0.dll + ${File} libpangoft2-1.0-0.dll + ${File} libpangowin32-1.0-0.dll + ${File} libpng14-14.dll + ${File} SDL.dll + ${MementoSectionEnd} +!endif + +!ifdef INST_QT + ${MementoSection} Qt SecUiQt +!ifdef INST_BOTH + SectionIn 1 2 +!else + SectionIn 1 2 RO +!endif + SetOutPath $INSTDIR + SetOverwrite on + ${File} avidemux.exe + ${File} avidemux_jobs.exe + ${File} libADM_render6_qt4.dll + ${File} libADM_UIQT46.dll + ${File} QtOpenGL4.dll + ${MementoSectionEnd} +!endif +SectionGroupEnd + +SectionGroup "Audio Decoders" SecGrpAudioDecoder + ${MementoSection} "µ-law" SecAudDecUlaw + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} plugins\audioDecoder\libADM_ad_ulaw.dll + ${MementoSectionEnd} + ${MementoSection} "AAC (FAAD)" SecAudDecFaad + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} plugins\audioDecoder\libADM_ad_faad.dll + SetOutPath $INSTDIR + ${File} libfaad2.dll + ${MementoSectionEnd} + ${MementoSection} "AAC, AC-3, ADPCM IMA AMV, DTS, E-AC-3, MP2, MP3, Nellymoser, QDesign, WMA (libavcodec)" SecAudDecAvcodec + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} plugins\audioDecoder\libADM_ad_lav.dll + ${MementoSectionEnd} + ${MementoSection} "AC-3 (liba52)" SecAudDecA52 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} plugins\audioDecoder\libADM_ad_a52.dll + ${MementoSectionEnd} + ${MementoSection} "ADPCM IMA" SecAudDecImaAdpcm + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} plugins\audioDecoder\libADM_ad_ima_adpcm.dll + ${MementoSectionEnd} + ${MementoSection} "ADPCM Microsoft" SecAudDecMsAdpcm + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} plugins\audioDecoder\libADM_ad_ms_adpcm.dll + ${MementoSectionEnd} + ${MementoSection} "AMR-NB" SecAudDecOpencoreAmrNb + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} plugins\audioDecoder\libADM_ad_opencore_amrnb.dll + SetOutPath $INSTDIR + ${File} libopencore-amrnb-*.dll + ${MementoSectionEnd} + ${MementoSection} "AMR-WB" SecAudDecOpencoreAmrWb + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} plugins\audioDecoder\libADM_ad_opencore_amrwb.dll + SetOutPath $INSTDIR + ${File} libopencore-amrwb-*.dll + ${MementoSectionEnd} + ${MementoSection} "MP2, MP3 (MAD)" SecAudDecMad + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} plugins\audioDecoder\libADM_ad_Mad.dll + ${MementoSectionEnd} + ${MementoSection} "Vorbis" SecAudDecVorbis + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} plugins\audioDecoder\libADM_ad_vorbis.dll + SetOutPath $INSTDIR + ${File} libogg-0.dll + ${File} libvorbis-0.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Audio Devices" SecGrpAudioDevice + ${MementoSection} "Waveform" SecAudDevWaveform + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDevices + ${File} plugins\audioDevices\libADM_av_win32.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Audio Encoders" SecGrpAudioEncoder + ${MementoSection} "AAC (FAAC)" SecAudEncFaac + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} plugins\audioEncoders\libADM_ae_faac.dll + SetOutPath $INSTDIR + ${File} libfaac.dll + ${MementoSectionEnd} + ${MementoSection} "AAC (libavcodec)" SecAudEncLavAac + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} plugins\audioEncoders\libADM_ae_lav_aac.dll + ${MementoSectionEnd} + ${MementoSection} "AC-3 (Aften)" SecAudDecAften + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} plugins\audioEncoders\libADM_ae_aften.dll + SetOutPath $INSTDIR + ${File} aften.dll + ${MementoSectionEnd} + ${MementoSection} "AC-3 (libavcodec)" SecAudEncLavAc3 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} plugins\audioEncoders\libADM_ae_lav_ac3.dll + ${MementoSectionEnd} + #${MementoSection} "DTS (dcaenc)" SecAudDecDcaEnc + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\audioEncoders + #${File} plugins\audioEncoders\libADM_ae_dcaenc.dll + #SetOutPath $INSTDIR + #${File} libdcaenc-0.dll + #${MementoSectionEnd} + ${MementoSection} "MP2 (libavcodec)" SecAudEncLavMp2 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} plugins\audioEncoders\libADM_ae_lav_mp2.dll + SetOutPath $INSTDIR + ${File} libtwolame-*.dll + ${MementoSectionEnd} + ${MementoSection} "MP2 (TwoLAME)" SecAudEncTwoLame + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} plugins\audioEncoders\libADM_ae_twolame.dll + ${MementoSectionEnd} + ${MementoSection} "MP3" SecAudEncLame + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} plugins\audioEncoders\libADM_ae_lame.dll + SetOutPath $INSTDIR + ${File} libmp3lame-0.dll + ${MementoSectionEnd} + ${MementoSection} "PCM" SecAudEncPcm + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} plugins\audioEncoders\libADM_ae_pcm.dll + ${MementoSectionEnd} + ${MementoSection} "Vorbis" SecAudEncVorbis + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} plugins\audioEncoders\libADM_ae_vorbis.dll + SetOutPath $INSTDIR + ${File} libogg-0.dll + ${File} libvorbis-0.dll + ${File} libvorbisenc-2.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Avisynth" SecGrpAvisynth + ${MementoUnselectedSection} "Avisynth Proxy" SecAvsProxy + SectionIn 2 + SetOutPath $INSTDIR + SetOverwrite on + ${File} avsproxy.exe + ${File} avsproxy_gui.exe + ${MementoSectionEnd} + ${MementoUnselectedSection} "Avisynth Proxy Demuxer" SecDemuxAvisynth + SectionIn 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} plugins\demuxers\libADM_dm_avsproxy.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Demuxers" SecGrpDemuxers + ${MementoSection} "ASF" SecDemuxAsf + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} plugins\demuxers\libADM_dm_asf.dll + ${MementoSectionEnd} + ${MementoSection} "BMP, JPEG, PNG Images" SecDemuxImage + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} plugins\demuxers\libADM_dm_pic.dll + ${MementoSectionEnd} + ${MementoSection} "Flash Video" SecDemuxFlv + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} plugins\demuxers\libADM_dm_flv.dll + ${MementoSectionEnd} + ${MementoSection} "Matroska" SecDemuxMatroska + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} plugins\demuxers\libADM_dm_matroska.dll + ${MementoSectionEnd} + ${MementoSection} "MP4" SecDemuxMp4 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} plugins\demuxers\libADM_dm_mp4.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-PS" SecDemuxMpegPs + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} plugins\demuxers\libADM_dm_ps.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-TS" SecDemuxMpegTs + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} plugins\demuxers\libADM_dm_ts.dll + ${MementoSectionEnd} + ${MementoSection} "MXF" SecDemuxMxf + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} plugins\demuxers\libADM_dm_mxf.dll + ${MementoSectionEnd} + ${MementoSection} "OpenDML AVI" SecDemuxOpenDml + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} plugins\demuxers\libADM_dm_opendml.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Muxers" SecGrpMuxers + ${MementoSection} "Dummy [Raw Audio/Video]" SecMuxDummy + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} plugins\muxers\libADM_mx_dummy.dll + ${MementoSectionEnd} + ${MementoSection} "Flash Video" SecMuxLavFlv + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} plugins\muxers\libADM_mx_flv.dll + ${MementoSectionEnd} + ${MementoSection} "Matroska" SecMuxLavMatroska + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} plugins\muxers\libADM_mx_Mkv.dll + ${MementoSectionEnd} + ${MementoSection} "MP4 (libavcodec)" SecMuxLavMp4 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} plugins\muxers\libADM_mx_mp4.dll + ${MementoSectionEnd} + ${MementoSection} "MP4 (MP4v2)" SecMuxMp4v2 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} plugins\muxers\libADM_mx_mp4v2.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-PS" SecMuxLavMpegPs + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} plugins\muxers\libADM_mx_ffPS.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-TS" SecMuxLavMpegTs + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} plugins\muxers\libADM_mx_ffTS.dll + ${MementoSectionEnd} + ${MementoSection} "OpenDML AVI" SecMuxOpenDml + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} plugins\muxers\libADM_mx_avi.dll + ${MementoSectionEnd} + ${MementoSection} "Raw Video" SecMuxRaw + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} plugins\muxers\libADM_mx_raw.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Script Engines" SecGrpScriptEngine + ${MementoSection} "QtScript" SecScriptQt + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR + ${File} QtScript4.dll + ${File} QtScriptTools4.dll + SetOutPath $INSTDIR\plugins\scriptEngines + ${File} plugins\scriptEngines\libADM_script_qt.dll + SetOutPath $INSTDIR\help\QtScript + ${Folder} help\QtScript + ${MementoSectionEnd} + ${MementoSection} "SpiderMonkey" SecScriptSpiderMonkey + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR + ${File} nspr4.dll + ${File} libjs.dll + SetOutPath $INSTDIR\plugins\scriptEngines + ${File} plugins\scriptEngines\libADM_script_spiderMonkey.dll + ${MementoSectionEnd} + ${MementoSection} "Tinypy" SecScriptTinypy + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\scriptEngines + ${File} plugins\scriptEngines\libADM_script_tinyPy.dll + SetOutPath $INSTDIR\plugins\autoScripts + ${Folder} plugins\autoScripts + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Video Decoders" SecGrpVideoDecoder + ${MementoSection} "VP8" SecVidDecVpx + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoDecoders + ${File} plugins\videoDecoders\libADM_vd_vpx.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Video Encoders" SecGrpVideoEncoder + ${MementoSection} "[Null]" SecVidEncNull + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} plugins\videoEncoders\libADM_ve_null.dll + ${MementoSectionEnd} + ${MementoSection} "Huffyuv, FFVHuff" SecVidEncLavHuffyuv + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} plugins\videoEncoders\libADM_ve_huff.dll + ${MementoSectionEnd} + ${MementoSection} "JPEG" SecVidEncLavJpeg + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} plugins\videoEncoders\libADM_ve_jpeg.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-2" SecVidEncLavMpeg2 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} plugins\videoEncoders\libADM_ve_ffMpeg2.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-4 ASP (libavcodec)" SecVidEncLavMpeg4asp + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} plugins\videoEncoders\libADM_ve_ffMpeg4.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-4 ASP (Xvid)" SecVidEncXvid + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} plugins\videoEncoders\libADM_ve_xvid4.dll + SetOutPath $INSTDIR + ${File} xvidcore.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-4 AVC" SecVidEncX264 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + + !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk +InstallCli: + ${File} plugins\videoEncoders\libADM_ve_x264_other.dll +CheckGtk: +!ifdef INST_GTK + !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt +InstallGtk: + ${File} plugins\videoEncoders\libADM_vidEnc_x264_Gtk.dll +CheckQt: +!endif +!ifdef INST_QT + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End +InstallQt: + ${File} plugins\videoEncoders\libADM_ve_x264_qt4.dll +End: +!endif + SetOutPath $INSTDIR\plugins\pluginSettings\x264 + ${Folder} plugins\pluginSettings\x264 + SetOutPath $INSTDIR + ${File} libx264-*.dll + ${MementoSectionEnd} + ${MementoSection} "PNG" SecVidEncLavPng + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} plugins\videoEncoders\libADM_ve_png.dll + ${MementoSectionEnd} + ${MementoSection} "Sorenson Spark" SecVidEncSorenson + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} plugins\videoEncoders\libADM_ve_ffFlv1.dll + ${MementoSectionEnd} + ${MementoSection} "YV12" SecVidEncYv12 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} plugins\videoEncoders\libADM_ve_yv12.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Video Filters" SecGrpVideoFilter + SectionGroup "Transform Filters" SecGrpVideoFilterTransform + ${MementoSection} "Add Black Borders" SecVidFltBlackBorders + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_addBorders.dll + ${MementoSectionEnd} + ${MementoSection} "Add Logo" SecVidFltLogo + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_logo.dll + ${MementoSectionEnd} + ${MementoSection} "Blacken Borders" SecVidFltBlackenBorders + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_blackenBorders.dll + ${MementoSectionEnd} + ${MementoSection} "Change FPS" SecVidFltChangeFps + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_changeFps.dll + ${MementoSectionEnd} + ${MementoSection} "Crop" SecVidFltCrop + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk +InstallCli: + ${File} plugins\videoFilters\libADM_vf_CropCli.dll +CheckGtk: +!ifdef INST_GTK + !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt +InstallGtk: + ${File} plugins\videoFilters\libADM_vf_CropGtk.dll +CheckQt: +!endif +!ifdef INST_QT + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End +InstallQt: + ${File} plugins\videoFilters\libADM_vf_cropQt4.dll +End: +!endif + ${MementoSectionEnd} + ${MementoSection} "Fade" SecVidFltFade + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_fadeToBlack.dll + ${MementoSectionEnd} + ${MementoSection} "Greyscale" SecVidFltLumaOnly + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_lumaOnly.dll + ${MementoSectionEnd} + ${MementoSection} "Horizontal Flip" SecVidFltHorizontalFlip + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_hf_hflip.dll + ${MementoSectionEnd} + ${MementoSection} "libswscale Resize" SecVidFltSwscaleResize + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk +InstallCli: + ${File} plugins\videoFilters\libADM_vf_swscaleResize_cli.dll +CheckGtk: +!ifdef INST_GTK + !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt +InstallGtk: + ${File} plugins\videoFilters\libADM_vf_swscaleResize_gtk.dll +CheckQt: +!endif +!ifdef INST_QT + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End +InstallQt: + ${File} plugins\videoFilters\libADM_vf_swscaleResize_qt4.dll +End: +!endif + ${MementoSectionEnd} + ${MementoSection} "Resample FPS" SecVidFltResampleFps + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_resampleFps.dll + ${MementoSectionEnd} + ${MementoSection} "Rotate" SecVidFltRotate + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_rotate.dll + ${MementoSectionEnd} + ${MementoSection} "Vertical Flip" SecVidFltVerticalFlip + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_vflip.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Interlacing Filters" SecGrpVideoFilterInterlacing + ${MementoSection} "Decomb Decimate" SecVidFltDecombDecimate + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_decimate.dll + ${MementoSectionEnd} + ${MementoSection} "Decomb Telecide" SecVidFltDecombTelecide + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_telecide.dll + ${MementoSectionEnd} + ${MementoSection} "DGBob" SecVidFltDgbob + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_DgBob.dll + ${MementoSectionEnd} + ${MementoSection} "Horizontal Stack Fields" SecVidFltHzStackFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_hzstackField.dll + ${MementoSectionEnd} + ${MementoSection} "Kernel Deint" SecVidFltKernelDeint + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_kernelDeint.dll + ${MementoSectionEnd} + ${MementoSection} "libavcodec Deinterlacers" SecVidFltLavDeinterlacers + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_lavDeint.dll + ${MementoSectionEnd} + ${MementoSection} "Merge Fields" SecVidFltMergeFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_mergeField.dll + ${MementoSectionEnd} + ${MementoSection} "Separate Fields" SecVidFltSeparateFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_separateField.dll + ${MementoSectionEnd} + ${MementoSection} "Stack Fields" SecVidFltStackFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_stackField.dll + ${MementoSectionEnd} + ${MementoSection} "Unstack Fields" SecVidFltUnstackFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_unstackField.dll + ${MementoSectionEnd} + ${MementoSection} "Yadif" SecVidFltYadif + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_yadif.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Colour Filters" SecGrpVideoFilterColour + ${MementoSection} "Avisynth Colour YUV" SecVidFltAvisynthColourYuv + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_colorYuv.dll + ${MementoSectionEnd} + ${MementoSection} "ChromaShift" SecVidFltChromaShift + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk +InstallCli: + ${File} plugins\videoFilters\libADM_vf_chromaShiftCli.dll +CheckGtk: +!ifdef INST_GTK + !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt +InstallGtk: + ${File} plugins\videoFilters\libADM_vf_chromaShiftGtk.dll +CheckQt: +!endif +!ifdef INST_QT + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End +InstallQt: + ${File} plugins\videoFilters\libADM_vf_chromaShiftQt4.dll +End: +!endif + ${MementoSectionEnd} + ${MementoSection} "Contrast" SecVidFltContrast + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk +InstallCli: + ${File} plugins\videoFilters\libADM_vf_contrastCli.dll +CheckGtk: +!ifdef INST_GTK + !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt +InstallGtk: + ${File} plugins\videoFilters\libADM_vf_contrastGtk.dll +CheckQt: +!endif +!ifdef INST_QT + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End +InstallQt: + ${File} plugins\videoFilters\libADM_vf_contrastQt4.dll +End: +!endif + ${MementoSectionEnd} + ${MementoSection} "MPlater Eq2" SecVidFltMplayerEq2 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk +InstallCli: + ${File} plugins\videoFilters\libADM_vf_eq2Cli.dll +CheckGtk: +!ifdef INST_GTK + !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt +InstallGtk: + ${File} plugins\videoFilters\libADM_vf_eq2Gtk.dll +CheckQt: +!endif +!ifdef INST_QT + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End +InstallQt: + ${File} plugins\videoFilters\libADM_vf_eq2Qt4.dll +End: +!endif + ${MementoSectionEnd} + ${MementoSection} "MPlater Hue" SecVidFltMplayerHue + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + !insertmacro SectionFlagIsSet ${SecUiCli} ${SF_SELECTED} InstallCli CheckGtk +InstallCli: + ${File} plugins\videoFilters\libADM_vf_HueCli.dll +CheckGtk: +!ifdef INST_GTK + !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} InstallGtk CheckQt +InstallGtk: + ${File} plugins\videoFilters\libADM_vf_HueGtk.dll +CheckQt: +!endif +!ifdef INST_QT + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} InstallQt End +InstallQt: + ${File} plugins\videoFilters\libADM_vf_HueQt4.dll +End: +!endif + ${MementoSectionEnd} + ${MementoSection} "Remove Plane" SecVidFltRemovePlane + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_removePlane.dll + ${MementoSectionEnd} + ${MementoSection} "Swap U and V" SecVidFltSwapUandV + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_swapUV.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Noise Filters" SecGrpVideoFilterNoise + ${MementoSection} "FluxSmooth" SecVidFltFluxSmooth + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_FluxSmooth.dll + ${MementoSectionEnd} + ${MementoSection} "Gaussian Convolution" SecVidFltGauss + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_gauss.dll + ${MementoSectionEnd} + ${MementoSection} "Large Median (5x5)" SecVidFltMediam5x5 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_largeMedian.dll + ${MementoSectionEnd} + ${MementoSection} "Mean Convolution" SecVidFltMean + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_mean.dll + ${MementoSectionEnd} + ${MementoSection} "Median Convolution" SecVidFltMedian + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_median.dll + ${MementoSectionEnd} + ${MementoSection} "MPlayer Denoise 3D" SecVidFltMPlayerDenoise3d + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_denoise3d.dll + ${MementoSectionEnd} + ${MementoSection} "MPlayer Denoise 3D HQ" SecVidFltMPlayerDenoise3dHq + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_denoise3dhq.dll + ${MementoSectionEnd} + ${MementoSection} "MSharpen" SecVidFltMSharpen + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_msharpen.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Sharpness Filters" SecGrpVideoFilterSharpness + ${MementoSection} "asharp" SecVidFltAsharp + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_asharpQt4.dll + ${MementoSectionEnd} + ${MementoSection} "MPlayer Delogo" SecVidFltMPlayerDelogo + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_mpdelogoQt4.dll + ${MementoSectionEnd} + ${MementoSection} "Sharpen" SecVidFltSharpen + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_sharpen.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Subtitle Filters" SecGrpVideoFilterSubtitle + ${MementoSection} "ASS, SSA" SecVidFltAssSsa + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_ssa.dll + SetOutPath $INSTDIR + ${File} libfribidi-0.dll + ${File} libfontconfig-1.dll + SetOutPath $INSTDIR\etc\fonts + ${Folder} etc\fonts + ${MementoSectionEnd} + SectionGroupEnd + #SectionGroup "OpenGL Filters" SecGrpVideoFilterOpenGl + #${MementoSection} "Fragment Shader" SecVidFltOpenGlFragmentShader + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} plugins\videoFilters\libADM_vf_sampleGlFrag2.dll + #${MementoSectionEnd} + #${MementoSection} "Read Back Benchmark" SecVidFltOpenGlReadBack + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} plugins\videoFilters\libADM_vf_glBenchmark.dll + #${MementoSectionEnd} + #${MementoSection} "Resize" SecVidFltOpenGlResize + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} plugins\videoFilters\libADM_vf_glResize.dll + #${MementoSectionEnd} + #${MementoSection} "Rotate" SecVidFltOpenGlRotate + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} plugins\videoFilters\libADM_vf_rotateGlFrag2.dll + #${MementoSectionEnd} + #${MementoSection} "Wave" SecVidFltOpenGlWave + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} plugins\videoFilters\libADM_vf_sampleGlVertex.dll + #${MementoSectionEnd} + #SectionGroupEnd + SectionGroup "Miscellaneous Filters" SecGrpVideoFilterMiscellaneous + ${MementoSection} "Print Information" SecVidFltPrintInfo + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} plugins\videoFilters\libADM_vf_printInfo.dll + ${MementoSectionEnd} + SectionGroupEnd +SectionGroupEnd + +${MementoSection} "-Start menu Change Log" SecStartMenuChangeLog + CreateDirectory $SMPROGRAMS\$StartMenuGroup + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + SetOutPath $INSTDIR + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Change Log ${CORE_VERSION}.lnk" "$INSTDIR\Change Log.html" + !insertmacro MUI_STARTMENU_WRITE_END +${MementoSectionEnd} + +${MementoSection} "-Start menu GTK+" SecStartMenuGtk +!ifdef INST_GTK + CreateDirectory $SMPROGRAMS\$StartMenuGroup + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + SetOutPath $INSTDIR + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME} GTK+.lnk" $INSTDIR\avidemux_gtk.exe + !insertmacro MUI_STARTMENU_WRITE_END +!endif +${MementoSectionEnd} + +${MementoSection} "-Start menu Qt" SecStartMenuQt +!ifdef INST_QT + CreateDirectory $SMPROGRAMS\$StartMenuGroup + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + SetOutPath $INSTDIR + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe + !insertmacro MUI_STARTMENU_WRITE_END +!endif +${MementoSectionEnd} + +${MementoSection} "-Start menu AVS Proxy GUI" SecStartMenuAvsProxyGui + CreateDirectory $SMPROGRAMS\$StartMenuGroup + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + SetOutPath $INSTDIR + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\AVS Proxy GUI ${CORE_VERSION}.lnk" "$INSTDIR\avsproxy_gui.exe" + !insertmacro MUI_STARTMENU_WRITE_END +${MementoSectionEnd} + +${MementoSection} "-Quick Launch GTK+" SecQuickLaunchGtk +!ifdef INST_GTK + SetOutPath $INSTDIR + CreateShortcut "$QUICKLAUNCH\${SHORTCUT_NAME} GTK+.lnk" $INSTDIR\avidemux_gtk.exe +!endif +${MementoSectionEnd} + +${MementoSection} "-Quick Launch Qt" SecQuickLaunchQt +!ifdef INST_QT + SetOutPath $INSTDIR + CreateShortcut "$QUICKLAUNCH\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe +!endif +${MementoSectionEnd} + +${MementoSection} "-Desktop GTK+" SecDesktopGtk +!ifdef INST_GTK + SetOutPath $INSTDIR + CreateShortcut "$DESKTOP\${SHORTCUT_NAME} GTK+.lnk" $INSTDIR\avidemux_gtk.exe +!endif +${MementoSectionEnd} + +${MementoSection} "-Desktop Qt" SecDesktopQt +!ifdef INST_QT + SetOutPath $INSTDIR + CreateShortcut "$DESKTOP\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe +!endif +${MementoSectionEnd} + +${MementoSectionDone} + +Section -post SecUninstaller + SectionIn 1 2 + WriteRegStr HKLM "${REGKEY}" Path $INSTDIR + WriteRegStr HKLM "${REGKEY}" Version ${PRODUCT_VERSION} + SetOutPath $INSTDIR + WriteUninstaller $INSTDIR\uninstall.exe + WriteRegStr HKLM "${UNINST_REGKEY}" DisplayName "${SHORTCUT_NAME}" + WriteRegStr HKLM "${UNINST_REGKEY}" DisplayVersion "${PRODUCT_VERSION}" + WriteRegStr HKLM "${UNINST_REGKEY}" DisplayIcon $INSTDIR\uninstall.exe + WriteRegStr HKLM "${UNINST_REGKEY}" UninstallString $INSTDIR\uninstall.exe + WriteRegDWORD HKLM "${UNINST_REGKEY}" NoModify 1 + WriteRegDWORD HKLM "${UNINST_REGKEY}" NoRepair 1 +SectionEnd + +Section -CloseLogFile + FileClose $UninstallLogHandle + SetFileAttributes ${UninstallLogPath} HIDDEN +SectionEnd + +Section Uninstall + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup + +!ifdef INST_GTK + Delete /REBOOTOK "$QUICKLAUNCH\${SHORTCUT_NAME} GTK+.lnk" + Delete /REBOOTOK "$DESKTOP\${SHORTCUT_NAME} GTK+.lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME} GTK+.lnk" +!endif + +!ifdef INST_QT + Delete /REBOOTOK "$QUICKLAUNCH\${SHORTCUT_NAME}.lnk" + Delete /REBOOTOK "$DESKTOP\${SHORTCUT_NAME}.lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME}.lnk" +!endif + + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Change Log ${CORE_VERSION}.lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\AVS Proxy GUI ${CORE_VERSION}.lnk" + RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup + DeleteRegValue HKLM "${REGKEY}" StartMenuGroup + + DeleteRegKey HKLM "${UNINST_REGKEY}" + DeleteRegValue HKLM "${REGKEY}" Path + DeleteRegValue HKLM "${REGKEY}" CreateDesktopIcon + DeleteRegValue HKLM "${REGKEY}" CreateStartMenuGroup + DeleteRegValue HKLM "${REGKEY}" CreateQuickLaunchIcon + DeleteRegKey /IfEmpty HKLM "${REGKEY}" + + FileOpen $UninstallLogHandle "${UninstallLogPath}" r +UninstallLoop: + ClearErrors + FileRead $UninstallLogHandle $R0 + IfErrors UninstallEnd + Push $R0 + Call un.TrimNewLines + Pop $R0 + Delete "$R0" + Goto UninstallLoop +UninstallEnd: + FileClose $UninstallLogHandle + Delete "${UninstallLogPath}" + Delete "$INSTDIR\uninstall.exe" + Push "\" + Call un.RemoveEmptyDirs + RMDir "$INSTDIR" +SectionEnd + +########################## +# Installer functions +########################## +Function .onInit +UAC_Elevate: + !insertmacro UAC_RunElevated + StrCmp 1223 $0 UAC_ElevationAborted + StrCmp 0 $0 0 UAC_Err + StrCmp 1 $1 0 UAC_Success + Quit + +UAC_Err: + MessageBox MB_ICONSTOP "Unable to elevate, error $0" + Abort + +UAC_ElevationAborted: + Abort + +UAC_Success: + StrCmp 1 $3 +4 + StrCmp 3 $1 0 UAC_ElevationAborted + MessageBox MB_ICONSTOP "This installer requires admin access." + Goto UAC_Elevate + + Call LoadPreviousSettings + ReadRegStr $PreviousVersion HKLM "${REGKEY}" Version + + ${If} $PreviousVersion != "" + ${VersionCompare} ${PRODUCT_VERSION} $PreviousVersion $PreviousVersionState + ${EndIf} + + InitPluginsDir + SetShellVarContext all +FunctionEnd + +Function .onInstSuccess + ${MementoSectionSave} +FunctionEnd + +Function LoadPreviousSettings + ${MementoSectionRestore} + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup + +#checkStartMenuGtk: + !insertmacro SectionFlagIsSet ${SecStartMenuGtk} ${SF_SELECTED} enableStartMenu checkStartMenuQt +checkStartMenuQt: + !insertmacro SectionFlagIsSet ${SecStartMenuQt} ${SF_SELECTED} enableStartMenu checkDesktopGtk + +enableStartMenu: + ReadRegStr $CreateStartMenuGroup HKLM "${REGKEY}" CreateStartMenuGroup + + ${If} $CreateStartMenuGroup == "" + StrCpy $CreateStartMenuGroup 1 + ${EndIf} + +checkDesktopGtk: + !insertmacro SectionFlagIsSet ${SecDesktopGtk} ${SF_SELECTED} enableDesktop checkDesktopQt +checkDesktopQt: + !insertmacro SectionFlagIsSet ${SecDesktopQt} ${SF_SELECTED} enableDesktop checkQuickLaunchGtk + +enableDesktop: + ReadRegStr $CreateDesktopIcon HKLM "${REGKEY}" CreateDesktopIcon + + ${If} $CreateDesktopIcon == "" + StrCpy $CreateDesktopIcon 1 + ${EndIf} + +checkQuickLaunchGtk: + !insertmacro SectionFlagIsSet ${SecQuickLaunchGtk} ${SF_SELECTED} enableQuickLaunch checkQuickLaunchQt +checkQuickLaunchQt: + !insertmacro SectionFlagIsSet ${SecQuickLaunchQt} ${SF_SELECTED} enableQuickLaunch end + +enableQuickLaunch: + ${If} ${AtMostWinVista} + ReadRegStr $CreateQuickLaunchIcon HKLM "${REGKEY}" CreateQuickLaunchIcon + + ${If} $CreateQuickLaunchIcon == "" + StrCpy $CreateQuickLaunchIcon 1 + ${EndIf} + ${EndIf} + +end: +FunctionEnd + +Function RunUninstaller + ReadRegStr $R1 HKLM "${UNINST_REGKEY}" "UninstallString" + + ${If} $R1 == "" + Return + ${EndIf} + + ;Run uninstaller + HideWindow + ClearErrors + + ${If} $PreviousVersionState == 0 + ${AndIf} $ReinstallUninstall == 1 + ExecWait '$R1 _?=$INSTDIR' + ${Else} + ExecWait '$R1 /frominstall _?=$INSTDIR' + ${EndIf} + + IfErrors NoRemoveUninstaller + IfFileExists "$INSTDIR\uninstall.exe" 0 NoRemoveUninstaller + Delete "$R1" + RMDir $INSTDIR + +NoRemoveUninstaller: +FunctionEnd + +!ifdef INST_BOTH +Function CheckSelectedUIs + !insertmacro SectionFlagIsSet ${SecGrpUI} ${SF_SELECTED} end checkPartial +checkPartial: + !insertmacro SectionFlagIsSet ${SecGrpUI} ${SF_PSELECTED} end displayError +displayError: + MessageBox MB_OK|MB_ICONSTOP "At least one User Interface must be selected." + Abort +end: +FunctionEnd +!endif + +LangString INSTALL_OPTS_PAGE_TITLE ${LANG_ENGLISH} "Choose Install Options" +LangString INSTALL_OPTS_PAGE_SUBTITLE ${LANG_ENGLISH} "Choose where to install Avidemux icons." +Var dlgInstallOptions +Var lblCreateIcons +Var chkDesktop +Var chkStartMenu +Var chkQuickLaunch + +Function InstallOptionsPage + Call IsInstallOptionsRequired + !insertmacro MUI_HEADER_TEXT "$(INSTALL_OPTS_PAGE_TITLE)" "$(INSTALL_OPTS_PAGE_SUBTITLE)" + + nsDialogs::Create 1018 + Pop $dlgInstallOptions + + ${If} $dlgInstallOptions == error + Abort + ${EndIf} + + ${NSD_CreateLabel} 0 0u 100% 12u "Create icons for Avidemux:" + Pop $lblCreateIcons + + ${NSD_CreateCheckBox} 0 18u 100% 12u "On my &Desktop" + Pop $chkDesktop + ${NSD_SetState} $chkDesktop $CreateDesktopIcon + ${NSD_OnClick} $chkDesktop UpdateInstallOptions + + ${NSD_CreateCheckBox} 0 36u 100% 12u "In my &Start Menu Programs folder" + Pop $chkStartMenu + ${NSD_SetState} $chkStartMenu $CreateStartMenuGroup + ${NSD_OnClick} $chkStartMenu UpdateInstallOptions + + ${If} ${AtMostWinVista} + ${NSD_CreateCheckBox} 0 54u 100% 12u "In my &Quick Launch bar" + Pop $chkQuickLaunch + ${NSD_SetState} $chkQuickLaunch $CreateQuickLaunchIcon + ${NSD_OnClick} $chkQuickLaunch UpdateInstallOptions + ${EndIf} + + nsDialogs::Show +FunctionEnd + +Function UpdateInstallOptions + ${NSD_GetState} $chkDesktop $CreateDesktopIcon + ${NSD_GetState} $chkStartMenu $CreateStartMenuGroup + ${NSD_GetState} $chkQuickLaunch $CreateQuickLaunchIcon +FunctionEnd + +Function IsInstallOptionsRequired +!ifdef INST_GTK + !insertmacro SectionFlagIsSet ${SecUiGtk} ${SF_SELECTED} end checkQt +checkQt: +!ifndef INST_BOTH +Goto end +!endif +!endif +!ifdef INST_QT + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} end resetOptions +resetOptions: +!endif + + StrCpy $CreateDesktopIcon 0 + StrCpy $CreateStartMenuGroup 0 + StrCpy $CreateQuickLaunchIcon 0 + Abort + +end: +FunctionEnd + +Function IsStartMenuRequired + StrCmp $CreateStartMenuGroup 1 +2 + Abort +FunctionEnd + +Function ActivateInternalSections + #AVS Proxy GUI shortcut: + SectionGetFlags ${SecAvsProxy} $0 + IntOp $0 $0 & ${SF_SELECTED} + IntOp $0 $0 & $CreateStartMenuGroup + SectionSetFlags ${SecStartMenuAvsProxyGui} $0 + + #Change Log shortcut: + SectionSetFlags ${SecStartMenuChangeLog} $CreateStartMenuGroup + +!ifdef INST_GTK + #GTK shortcuts: + SectionGetFlags ${SecUiGtk} $0 + IntOp $0 $0 & ${SF_SELECTED} + + IntOp $1 $0 & $CreateDesktopIcon + SectionSetFlags ${SecDesktopGtk} $1 + + IntOp $1 $0 & $CreateQuickLaunchIcon + SectionSetFlags ${SecQuickLaunchGtk} $1 + + IntOp $1 $0 & $CreateStartMenuGroup + SectionSetFlags ${SecStartMenuGtk} $1 +!endif + +!ifdef INST_QT + #Qt shortcuts: + SectionGetFlags ${SecUiQt} $0 + IntOp $0 $0 & ${SF_SELECTED} + + IntOp $1 $0 & $CreateDesktopIcon + SectionSetFlags ${SecDesktopQt} $1 + + IntOp $1 $0 & $CreateQuickLaunchIcon + SectionSetFlags ${SecQuickLaunchQt} $1 + + IntOp $1 $0 & $CreateStartMenuGroup + SectionSetFlags ${SecStartMenuQt} $1 +!endif +FunctionEnd + +Function InstFilesPageShow + ${If} $ReinstallUninstall != "" + Call RunUninstaller + BringToFront + ${EndIf} +FunctionEnd + +Function InstFilesPageLeave + ; Don't advance automatically if details expanded + FindWindow $R0 "#32770" "" $HWNDPARENT + GetDlgItem $R0 $R0 1016 + System::Call user32::IsWindowVisible(i$R0)i.s + Pop $R0 + + StrCmp $R0 0 +2 + SetAutoClose false +FunctionEnd + +Function ConfigureFinishPage +!ifdef INST_GTK + SectionGetFlags ${SecUiGtk} $0 + IntOp $0 $0 & ${SF_SELECTED} + StrCmp $0 ${SF_SELECTED} end +!endif + +!ifdef INST_QT + SectionGetFlags ${SecUiQt} $0 + IntOp $0 $0 & ${SF_SELECTED} + StrCmp $0 ${SF_SELECTED} end +!endif + + DeleteINISec "$PLUGINSDIR\ioSpecial.ini" "Field 4" + +end: +FunctionEnd + +Function RunAvidemux + SetOutPath $INSTDIR + +!ifdef INST_QT +#Qt: + SectionGetFlags ${SecUiQt} $0 + IntOp $0 $0 & ${SF_SELECTED} + + StrCmp $0 ${SF_SELECTED} 0 GTK + !insertmacro UAC_AsUser_ExecShell "" "$INSTDIR\avidemux.exe" "" "" "" + + Goto end +GTK: +!endif + +!ifdef INST_GTK + SectionGetFlags ${SecUiGtk} $0 + IntOp $0 $0 & ${SF_SELECTED} + + StrCmp $0 ${SF_SELECTED} 0 End + !insertmacro UAC_AsUser_ExecShell "" "$INSTDIR\avidemux_gtk.exe" "" "" "" +!endif + +end: +FunctionEnd + +Var ReinstallUninstallButton + +Function ReinstallPage + ${If} $PreviousVersion == "" + Abort + ${EndIf} + + nsDialogs::Create /NOUNLOAD 1018 + Pop $0 + + ${If} $PreviousVersionState == 1 + !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_FULLNAME}." + nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "An older version of Avidemux is installed on your system. Select the operation you want to perform and click Next to continue." + Pop $R0 + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Upgrade Avidemux using previous settings (recommended)" + Pop $ReinstallUninstallButton + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Change settings (advanced)" + Pop $R0 + + ${If} $ReinstallUninstall == "" + StrCpy $ReinstallUninstall 1 + ${EndIf} + ${ElseIf} $PreviousVersionState == 2 + !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_FULLNAME}." + nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "A newer version of Avidemux is already installed! It is not recommended that you downgrade to an older version. Select the operation you want to perform and click Next to continue." + Pop $R0 + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Downgrade Avidemux using previous settings (recommended)" + Pop $ReinstallUninstallButton + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Change settings (advanced)" + Pop $R0 + + ${If} $ReinstallUninstall == "" + StrCpy $ReinstallUninstall 1 + ${EndIf} + ${ElseIf} $PreviousVersionState == 0 + !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform." + nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "${PRODUCT_FULLNAME} is already installed. Select the operation you want to perform and click Next to continue." + Pop $R0 + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Add/Remove/Reinstall components" + Pop $R0 + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Uninstall Avidemux" + Pop $ReinstallUninstallButton + + ${If} $ReinstallUninstall == "" + StrCpy $ReinstallUninstall 2 + ${EndIf} + ${Else} + MessageBox MB_ICONSTOP "Unknown value of PreviousVersionState, aborting" /SD IDOK + Abort + ${EndIf} + + ${If} $ReinstallUninstall == "1" + SendMessage $ReinstallUninstallButton ${BM_SETCHECK} 1 0 + ${Else} + SendMessage $R0 ${BM_SETCHECK} 1 0 + ${EndIf} + + nsDialogs::Show +FunctionEnd + +Function ReinstallPageLeave + SendMessage $ReinstallUninstallButton ${BM_GETCHECK} 0 0 $R0 + + ${If} $R0 == 1 + ; Option to uninstall old version selected + StrCpy $ReinstallUninstall 1 + ${Else} + ; Custom up/downgrade or add/remove/reinstall + StrCpy $ReinstallUninstall 2 + ${EndIf} + + ${If} $ReinstallUninstall == 1 + ${If} $PreviousVersionState == 0 + Call RunUninstaller + Quit + ${Else} + ; Need to reload defaults. User could have + ; chosen custom, change something, went back and selected + ; the express option. + Call LoadPreviousSettings + ${EndIf} + ${EndIf} +FunctionEnd + + +########################## +# Uninstaller functions +########################## +Function un.onInit + SetShellVarContext all + +UAC_Elevate: + !insertmacro UAC_RunElevated + StrCmp 1223 $0 UAC_ElevationAborted + StrCmp 0 $0 0 UAC_Err + StrCmp 1 $1 0 UAC_Success + Quit + +UAC_Err: + MessageBox MB_ICONSTOP "Unable to elevate, error $0" + Abort + +UAC_ElevationAborted: + Abort + +UAC_Success: + StrCmp 1 $3 +4 + StrCmp 3 $1 0 UAC_ElevationAborted + MessageBox MB_ICONSTOP "This installer requires admin access." + Goto UAC_Elevate +FunctionEnd + +; TrimNewlines (copied from NSIS documentation) +; input, top of stack (e.g. whatever$\r$\n) +; output, top of stack (replaces, with e.g. whatever) +; modifies no other variables. +Function un.TrimNewlines + Exch $R0 + Push $R1 + Push $R2 + StrCpy $R1 0 + +loop: + IntOp $R1 $R1 - 1 + StrCpy $R2 $R0 1 $R1 + StrCmp $R2 "$\r" loop + StrCmp $R2 "$\n" loop + IntOp $R1 $R1 + 1 + IntCmp $R1 0 no_trim_needed + StrCpy $R0 $R0 $R1 + +no_trim_needed: + Pop $R2 + Pop $R1 + Exch $R0 +FunctionEnd + +Function un.RemoveEmptyDirs + Pop $9 + !define Index 'Line${__LINE__}' + FindFirst $0 $1 "$INSTDIR$9*" + StrCmp $0 "" "${Index}-End" +"${Index}-Loop:" + StrCmp $1 "" "${Index}-End" + StrCmp $1 "." "${Index}-Next" + StrCmp $1 ".." "${Index}-Next" + Push $0 + Push $1 + Push $9 + Push "$9$1\" + Call un.RemoveEmptyDirs + Pop $9 + Pop $1 + Pop $0 +;"${Index}-Remove:" + RMDir "$INSTDIR$9$1" +"${Index}-Next:" + FindNext $0 $1 + Goto "${Index}-Loop" +"${Index}-End:" + FindClose $0 + !undef Index +FunctionEnd + +Function un.ConfirmPagePre + ${un.GetParameters} $R0 + ${un.GetOptions} $R0 "/frominstall" $R1 + ${Unless} ${Errors} + Abort + ${EndUnless} +FunctionEnd + +Function un.FinishPagePre + ${un.GetParameters} $R0 + ${un.GetOptions} $R0 "/frominstall" $R1 + ${Unless} ${Errors} + SetRebootFlag false + Abort + ${EndUnless} +FunctionEnd diff --git a/avidemux/winInstaller/old/avidemux_cross.nsi b/avidemux/winInstaller/old/avidemux_cross.nsi index d70f170a8f..73bf61eea0 100644 --- a/avidemux/winInstaller/old/avidemux_cross.nsi +++ b/avidemux/winInstaller/old/avidemux_cross.nsi @@ -1,1588 +1,1588 @@ -########################## -# Included files -########################## -!addincludedir ${NSIDIR} -!addplugindir ${NSIDIR}/plugin - -!include Sections.nsh -!include MUI2.nsh -!include nsDialogs.nsh -!include Memento.nsh -!include FileFunc.nsh -!include UAC.nsh -!include WinVer.nsh -!include WordFunc.nsh -#!include revision.nsh - -SetCompressor /SOLID lzma -SetCompressorDictSize 96 -RequestExecutionLevel user - -########################## -# Defines -########################## -!define BUILD_BITS 32 -!define QT_DIR /mingw/Qt/current/bin/ -!define ADM_SYSDIR /mingw/bin -!define ADM_DIR /mingw/Release -!define TOOLCHAIN_DIR /home/fx/mxe-octave/usr/lib/gcc/i686-pc-mingw32/4.7.2/ -#/home/fx/rub/mingw32/ -#!define NSIDIR "/home/fx/hudson/workspace/mingw_2.6.2_nsis/avidemux/winInstaller" -#!define SVN_VERSION 6 -!define REVISION ${SVN_VERSION} -!define EXEDIR "${NSIDIR}/install" - -!define CORE_VERSION "2.6" -!define POINT_RELEASE "8" -!define PRODUCT_VERSION "${CORE_VERSION}.${POINT_RELEASE}.${SVN_VERSION}" -!define PRODUCT_NAME "Avidemux ${CORE_VERSION}" -!define PRODUCT_FULLNAME "Avidemux ${PRODUCT_VERSION} (${BUILD_BITS}-bit Release)" - -!if ${BUILD_BITS} == 64 - !define SHORTCUT_NAME "${PRODUCT_NAME}" - !define REG_GROUPNAME "${PRODUCT_NAME} (${BUILD_BITS}-bit)" -!else - !define SHORTCUT_NAME "${PRODUCT_NAME} (${BUILD_BITS}-bit)" - !define REG_GROUPNAME "${PRODUCT_NAME}" -!endif - -!define REGKEY "SOFTWARE\${REG_GROUPNAME}" -!define UNINST_REGKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_GROUPNAME}" -!define COMPANY "Free Software Foundation" -!define URL "http://www.avidemux.org" - -OutFile "${EXEDIR}/avidemux_${CORE_VERSION}.${POINT_RELEASE}_r${REVISION}_win${BUILD_BITS}.exe" -Name "${PRODUCT_FULLNAME}" - -########################## -# Memento defines -########################## -!define MEMENTO_REGISTRY_ROOT HKLM -!define MEMENTO_REGISTRY_KEY "${REGKEY}" - -########################## -# MUI defines -########################## -!define MUI_ICON "${NSIDIR}/../common/xpm/adm.ico" -!define MUI_HEADERIMAGE -!define MUI_HEADERIMAGE_RIGHT -!define MUI_HEADERIMAGE_BITMAP "${NSIDIR}/PageHeader.bmp" -!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM -!define MUI_STARTMENUPAGE_REGISTRY_KEY "${REGKEY}" -!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup -!define MUI_STARTMENUPAGE_DEFAULTFOLDER Avidemux -!define MUI_STARTMENUPAGE_NODISABLE -!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSIDIR}/WelcomeFinishStrip.bmp" -!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSIDIR}/WelcomeFinishStrip.bmp" -!define MUI_UNICON "${NSIDIR}/../common/xpm/adm.ico" -!define MUI_COMPONENTSPAGE_NODESC - -########################## -# Variables -########################## -Var CreateDesktopIcon -Var CreateStartMenuGroup -Var CreateQuickLaunchIcon -Var StartMenuGroup -Var PreviousVersion -Var PreviousVersionState -Var ReinstallUninstall - -########################## -# Installer pages -########################## -!define MUI_WELCOMEPAGE_TITLE "${PRODUCT_FULLNAME} Setup Wizard" -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "${NSIDIR}/License.rtf" - Page custom ReinstallPage ReinstallPageLeave -!insertmacro MUI_PAGE_COMPONENTS -Page custom InstallOptionsPage -!define MUI_PAGE_CUSTOMFUNCTION_PRE IsStartMenuRequired -!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup -!insertmacro MUI_PAGE_DIRECTORY -!define MUI_PAGE_CUSTOMFUNCTION_PRE ActivateInternalSections -!define MUI_PAGE_CUSTOMFUNCTION_SHOW InstFilesPageShow -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE InstFilesPageLeave -!insertmacro MUI_PAGE_INSTFILES -!define MUI_FINISHPAGE_RUN -!define MUI_FINISHPAGE_RUN_FUNCTION RunAvidemux -!define MUI_FINISHPAGE_RUN_TEXT "Run ${PRODUCT_NAME} now" -!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR/Change Log.html" -!define MUI_FINISHPAGE_SHOWREADME_TEXT "View Change Log now" -!define MUI_FINISHPAGE_LINK "Visit the Avidemux website" -!define MUI_FINISHPAGE_LINK_LOCATION "http://avidemux.org/" -!define MUI_PAGE_CUSTOMFUNCTION_PRE ConfigureFinishPage -!insertmacro MUI_PAGE_FINISH - -!define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES -!define MUI_PAGE_CUSTOMFUNCTION_PRE un.FinishPagePre -!insertmacro MUI_UNPAGE_FINISH - -########################## -# Installer languages -########################## -!insertmacro MUI_LANGUAGE English - -########################## -# Installer attributes -########################## -!if ${BUILD_BITS} == 64 - InstallDir "$PROGRAMFILES64\${PRODUCT_NAME}" -!else - InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" -!endif - -CRCCheck on -XPStyle on -ShowInstDetails nevershow -ShowUninstDetails nevershow -VIProductVersion ${PRODUCT_VERSION} -VIAddVersionKey ProductName Avidemux -VIAddVersionKey ProductVersion "${PRODUCT_VERSION}" -VIAddVersionKey FileVersion "" -VIAddVersionKey FileDescription "" -VIAddVersionKey LegalCopyright "" -InstallDirRegKey HKLM "${REGKEY}" Path -BrandingText "Packaged by Gruntster" -InstType Standard -InstType Full -######################################### -# -######################################### -Function GetAfterChar - Exch $0 ; chop char - Exch - Exch $1 ; input string - Push $2 - Push $3 - StrCpy $2 0 - loop: - IntOp $2 $2 - 1 - StrCpy $3 $1 1 $2 - StrCmp $3 "" 0 +3 - StrCpy $0 "" - Goto exit2 - StrCmp $3 $0 exit1 - Goto loop - exit1: - IntOp $2 $2 + 1 - StrCpy $0 $1 "" $2 - exit2: - Pop $3 - Pop $2 - Pop $1 - Exch $0 ; output -FunctionEnd -#####################################################################  -!define StrReplace '!insertmacro "_Name"' - -########################## -# Uninstaller macros -########################## -!insertmacro un.GetOptions -!insertmacro un.GetParameters - -!define UninstallLogPath "$INSTDIR\uninstall.log" -Var UninstallLogHandle - -; Uninstall log file missing. -LangString UninstallLogMissing ${LANG_ENGLISH} "uninstall.log not found!$\r$\nUninstallation cannot proceed!" -# Regexep Does not work with cross -# Use only one file at a time -!macro InstallFile FILEZ - File "${FILEZ}" - Push "${FILEZ}" - Push "/" - Call GetAfterChar - Pop $R0 - FileWrite $UninstallLogHandle "$OUTDIR\$R0$\r$\n" -!macroend -!define File "!insertmacro InstallFile" - -!macro InstallFolder FILEREGEX - File /r "${FILEREGEX}/*" - Push "$OUTDIR" - Call InstallFolderInternal -!macroend -!define Folder "!insertmacro InstallFolder" - -Function InstallFolderInternal - Pop $9 - !define Index 'Line${__LINE__}' - FindFirst $0 $1 "$9/*" - StrCmp $0 "" "${Index}-End" -"${Index}-Loop:" - StrCmp $1 "" "${Index}-End" - StrCmp $1 "." "${Index}-Next" - StrCmp $1 ".." "${Index}-Next" - IfFileExists "$9\$1\*" 0 "${Index}-Write" - Push $0 - Push $9 - Push "$9\$1" - Call InstallFolderInternal - Pop $9 - Pop $0 - Goto "${Index}-Next" -"${Index}-Write:" - FileWrite $UninstallLogHandle "$9\$1$\r$\n" -"${Index}-Next:" - FindNext $0 $1 - Goto "${Index}-Loop" -"${Index}-End:" - !undef Index -FunctionEnd - -; WriteUninstaller macro -!macro WriteUninstaller Path - WriteUninstaller "${Path}" - FileWrite $UninstallLogHandle "${Path}$\r$\n" -!macroend -!define WriteUninstaller "!insertmacro WriteUninstaller" - -########################## -# Macros -########################## - -!macro InstallQtLanguage LANG_NAME LANG_CODE - SetOverwrite on - - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} installQt${LANG_CODE} endQt${LANG_CODE} - -installQt${LANG_CODE}: - SetOutPath $INSTDIR\i18n - ${File} i18n/avidemux_${LANG_CODE}.qm - ${File} i18n/qt_${LANG_CODE}.qm - -endQt${LANG_CODE}: -!macroend - -########################## -# Installer sections -########################## -Section -OpenLogFile - CreateDirectory "$INSTDIR" - FileOpen $UninstallLogHandle ${UninstallLogPath} a - FileSeek $UninstallLogHandle 0 END -SectionEnd - -Section "Avidemux Core" SecCore - SectionIn 1 2 RO - SetOutPath $INSTDIR - SetOverwrite on - ${File} "./Build Info.txt" - ${File} "./last_changes.txt" - ${File} "./Change Log.html" -# -# - ${File} ${TOOLCHAIN_DIR}/libstdc++-6.dll - ${File} ${TOOLCHAIN_DIR}/../libgcc_s_dw2-1.dll -# -# - ${File} ${ADM_SYSDIR}/libsqlite3-0.dll - ${File} ${ADM_SYSDIR}/libz.dll - ${File} ${ADM_SYSDIR}/libpng15-15.dll - ${File} ${ADM_SYSDIR}/libpthread.dll -# -# - ${File} ${ADM_DIR}/libADM_audioParser6.dll - ${File} ${ADM_DIR}/libADM_core6.dll - ${File} ${ADM_DIR}/libADM_coreAudio6.dll - ${File} ${ADM_DIR}/libADM_coreAudioDevice6.dll - ${File} ${ADM_DIR}/libADM_coreAudioEncoder6.dll - ${File} ${ADM_DIR}/libADM_coreAudioFilterAPI6.dll - ${File} ${ADM_DIR}/libADM_coreDemuxer6.dll - ${File} ${ADM_DIR}/libADM_coreDemuxerMpeg6.dll - ${File} ${ADM_DIR}/libADM_coreImage6.dll - ${File} ${ADM_DIR}/libADM_coreImageLoader6.dll - ${File} ${ADM_DIR}/libADM_coreJobs.dll - ${File} ${ADM_DIR}/libADM_coreMuxer6.dll - ${File} ${ADM_DIR}/libADM_coreScript.dll - ${File} ${ADM_DIR}/libADM_coreSocket6.dll - ${File} ${ADM_DIR}/libADM_coreSqlLight3.dll - ${File} ${ADM_DIR}/libADM_coreUI6.dll - ${File} ${ADM_DIR}/libADM_coreUtils6.dll - ${File} ${ADM_DIR}/libADM_coreVideoCodec6.dll - ${File} ${ADM_DIR}/libADM_coreVideoEncoder6.dll - ${File} ${ADM_DIR}/libADM_coreVideoFilter6.dll - ${File} ${ADM_DIR}/libADM_coreSubtitle.dll - ${File} ${QT_DIR}/QtCore4.dll - ${File} ${QT_DIR}/QtGui4.dll - ${File} ${NSIDIR}/../../AUTHORS. - ${File} ${NSIDIR}/../../COPYING. - ${File} ${NSIDIR}/../../README. - ${File} ${ADM_DIR}/avcodec-*.dll - ${File} ${ADM_DIR}/avformat-*.dll - ${File} ${ADM_DIR}/avutil-*.dll - ${File} ${ADM_DIR}/postproc-*.dll - ${File} ${ADM_DIR}/swscale-*.dll - - WriteRegStr HKLM "${REGKEY}" CreateDesktopIcon $CreateDesktopIcon - WriteRegStr HKLM "${REGKEY}" CreateStartMenuGroup $CreateStartMenuGroup - - ${If} ${AtMostWinVista} - WriteRegStr HKLM "${REGKEY}" CreateQuickLaunchIcon $CreateQuickLaunchIcon - ${EndIf} -SectionEnd - -SectionGroup /e "User interfaces" SecGrpUI - ${MementoUnselectedSection} "Command Line" SecUiCli - SectionIn 2 - SetOutPath $INSTDIR - SetOverwrite on - ${File} ${ADM_DIR}/avidemux_cli.exe - ${File} ${ADM_DIR}/libADM_render6_cli.dll - ${File} ${ADM_DIR}/libADM_UI_Cli6.dll - ${MementoSectionEnd} - - ${MementoSection} Qt SecUiQt - SectionIn 1 2 RO - SetOutPath $INSTDIR - SetOverwrite on - ${File} ${ADM_DIR}/avidemux.exe - ${File} ${ADM_DIR}/avidemux_jobs.exe - ${File} ${ADM_DIR}/libADM_render6_QT4.dll - ${File} ${ADM_DIR}/libADM_UIQT46.dll - ${File} ${QT_DIR}/QtOpenGL4.dll - ${MementoSectionEnd} -SectionGroupEnd - -SectionGroup "Audio Decoders" SecGrpAudioDecoder - ${MementoSection} "µ-law" SecAudDecUlaw - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_ulaw.dll - ${MementoSectionEnd} - ${MementoSection} "AAC (FAAD)" SecAudDecFaad - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_faad.dll - #SetOutPath $INSTDIR - ${MementoSectionEnd} - ${MementoSection} "AAC, AC-3, ADPCM IMA AMV, DTS, E-AC-3, MP2, MP3, Nellymoser, QDesign, WMA (libavcodec)" SecAudDecAvcodec - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_lav.dll - ${MementoSectionEnd} - ${MementoSection} "AC-3 (liba52)" SecAudDecA52 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_a52.dll - ${MementoSectionEnd} - ${MementoSection} "ADPCM IMA" SecAudDecImaAdpcm - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_ima_adpcm.dll - ${MementoSectionEnd} - ${MementoSection} "ADPCM Microsoft" SecAudDecMsAdpcm - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_ms_adpcm.dll - ${MementoSectionEnd} - ${MementoSection} "AMR-NB" SecAudDecOpencoreAmrNb - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_opencore_amrnb.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libopencore-amrnb-*.dll - ${MementoSectionEnd} - ${MementoSection} "AMR-WB" SecAudDecOpencoreAmrWb - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_opencore_amrwb.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libopencore-amrwb-*.dll - ${MementoSectionEnd} - ${MementoSection} "MP2, MP3 (MAD)" SecAudDecMad - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_Mad.dll - ${MementoSectionEnd} - ${MementoSection} "Vorbis" SecAudDecVorbis - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_vorbis.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libogg-0.dll - ${File} ${ADM_SYSDIR}/libvorbis-0.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Audio Devices" SecGrpAudioDevice - ${MementoSection} "Waveform" SecAudDevWaveform - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDevices - ${File} ${ADM_DIR}/plugins/audioDevices/libADM_av_win32.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Audio Encoders" SecGrpAudioEncoder - ${MementoSection} "AAC (FAAC)" SecAudEncFaac - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_faac.dll - #SetOutPath $INSTDIR - ${MementoSectionEnd} - ${MementoSection} "AAC (libavcodec)" SecAudEncLavAac - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lav_aac.dll - ${MementoSectionEnd} - ${MementoSection} "AC-3 (Aften)" SecAudDecAften - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_aften.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libaften.dll - ${MementoSectionEnd} - ${MementoSection} "AC-3 (libavcodec)" SecAudEncLavAc3 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lav_ac3.dll - ${MementoSectionEnd} - #${MementoSection} "DTS (dcaenc)" SecAudDecDcaEnc - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\audioEncoders - #${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_dcaenc.dll - #SetOutPath $INSTDIR - #${File} libdcaenc-0.dll - #${MementoSectionEnd} - ${MementoSection} "MP2 (libavcodec)" SecAudEncLavMp2 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lav_mp2.dll - SetOutPath $INSTDIR - ${MementoSectionEnd} - #${MementoSection} "MP2 (TwoLAME)" SecAudEncTwoLame - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\audioEncoders - #${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_twolame.dll - #${MementoSectionEnd} - ${MementoSection} "MP3" SecAudEncLame - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lame.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libmp3lame-0.dll - ${MementoSectionEnd} - ${MementoSection} "PCM" SecAudEncPcm - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_pcm.dll - ${MementoSectionEnd} - ${MementoSection} "Vorbis" SecAudEncVorbis - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_vorbis.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libogg-0.dll - ${File} ${ADM_SYSDIR}/libvorbis-0.dll - ${File} ${ADM_SYSDIR}/libvorbisenc-2.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Avisynth" SecGrpAvisynth - ${MementoUnselectedSection} "Avisynth Proxy" SecAvsProxy - SectionIn 2 - SetOutPath $INSTDIR - SetOverwrite on - ${File} ${ADM_SYSDIR}/avsproxy.exe - ${File} ${ADM_SYSDIR}/avsproxy_gui.exe - ${MementoSectionEnd} - ${MementoUnselectedSection} "Avisynth Proxy Demuxer" SecDemuxAvisynth - SectionIn 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_avsproxy.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Demuxers" SecGrpDemuxers - ${MementoSection} "ASF" SecDemuxAsf - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_asf.dll - ${MementoSectionEnd} - ${MementoSection} "BMP, JPEG, PNG Images" SecDemuxImage - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_pic.dll - ${MementoSectionEnd} - ${MementoSection} "Flash Video" SecDemuxFlv - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_flv.dll - ${MementoSectionEnd} - ${MementoSection} "Matroska" SecDemuxMatroska - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_matroska.dll - ${MementoSectionEnd} - ${MementoSection} "MP4" SecDemuxMp4 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_mp4.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-PS" SecDemuxMpegPs - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_ps.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-TS" SecDemuxMpegTs - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_ts.dll - ${MementoSectionEnd} - ${MementoSection} "MXF" SecDemuxMxf - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_mxf.dll - ${MementoSectionEnd} - ${MementoSection} "OpenDML AVI" SecDemuxOpenDml - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_opendml.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Muxers" SecGrpMuxers - ${MementoSection} "Dummy [Raw Audio/Video]" SecMuxDummy - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_dummy.dll - ${MementoSectionEnd} - ${MementoSection} "Flash Video" SecMuxLavFlv - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_flv.dll - ${MementoSectionEnd} - ${MementoSection} "Matroska" SecMuxLavMatroska - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_Mkv.dll - ${MementoSectionEnd} - ${MementoSection} "MP4 (libavcodec)" SecMuxLavMp4 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_mp4.dll - ${MementoSectionEnd} - ${MementoSection} "MP4 (MP4v2)" SecMuxMp4v2 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_mp4v2.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-PS" SecMuxLavMpegPs - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_ffPS.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-TS" SecMuxLavMpegTs - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_ffTS.dll - ${MementoSectionEnd} - ${MementoSection} "OpenDML AVI" SecMuxOpenDml - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_avi.dll - ${MementoSectionEnd} - ${MementoSection} "Raw Video" SecMuxRaw - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_raw.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Script Engines" SecGrpScriptEngine - #${MementoSection} "QtScript" SecScriptQt - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR - #${File} ${QT_DIR}/QtScript4.dll - #${File} ${QT_DIR}/QtScriptTools4.dll - #SetOutPath $INSTDIR\plugins\scriptEngines - #${File} ${ADM_DIR}/plugins/scriptEngines/libADM_script_qt.dll - #SetOutPath $INSTDIR\help\QtScript - #${Folder} help/QtScript - #${MementoSectionEnd} - ${MementoSection} "Tinypy" SecScriptTinypy - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\scriptEngines - ${File} ${ADM_DIR}/plugins/scriptEngines/libADM_script_tinyPy.dll - SetOutPath $INSTDIR\plugins\autoScripts - ${Folder} ${ADM_DIR}/plugins/autoScripts - ${MementoSectionEnd} -SectionGroupEnd -#SectionGroup "Video Decoders" SecGrpVideoDecoder - #${MementoSection} "VP8" SecVidDecVpx - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoDecoders - #${File} ${ADM_DIR}/plugins/videoDecoders/libADM_vd_vpx.dll - #${MementoSectionEnd} -#SectionGroupEnd -SectionGroup "Video Encoders" SecGrpVideoEncoder - ${MementoSection} "[Null]" SecVidEncNull - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_null.dll - ${MementoSectionEnd} - ${MementoSection} "Huffyuv, FFVHuff" SecVidEncLavHuffyuv - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_huff.dll - ${MementoSectionEnd} - ${MementoSection} "JPEG" SecVidEncLavJpeg - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_jpeg.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-2" SecVidEncLavMpeg2 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_ffMpeg2.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-4 ASP (libavcodec)" SecVidEncLavMpeg4asp - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_ffMpeg4.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-4 ASP (Xvid)" SecVidEncXvid - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_xvid4.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/xvidcore.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-4 AVC" SecVidEncX264 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_x264_other.dll - - SetOutPath $INSTDIR\plugins\videoEncoders\qt4 - ${File} ${ADM_DIR}/plugins/videoEncoders/qt4/libADM_ve_x264_QT4.dll - - SetOutPath $INSTDIR\plugins\pluginSettings\x264 - ${Folder} ${ADM_DIR}/plugins/pluginSettings/x264 - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libx264-*.dll - #${File} ${ADM_SYSDIR}/pthreadGC2.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-4 HEVC" SecVidEncX265 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_x265_other.dll - - SetOutPath $INSTDIR\plugins\videoEncoders\qt4 - ${File} ${ADM_DIR}/plugins/videoEncoders/qt4/libADM_ve_x265_QT4.dll - - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libx265*.dll - #${File} ${ADM_SYSDIR}/pthreadGC2.dll - ${MementoSectionEnd} -${MementoSection} "PNG" SecVidEncLavPng - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_png.dll - ${MementoSectionEnd} - ${MementoSection} "Sorenson Spark" SecVidEncSorenson - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_ffFlv1.dll - ${MementoSectionEnd} - ${MementoSection} "YV12" SecVidEncYv12 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_yv12.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Video Filters" SecGrpVideoFilter - SectionGroup "Transform Filters" SecGrpVideoFilterTransform - ${MementoSection} "Add Black Borders" SecVidFltBlackBorders - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_addBorders.dll - ${MementoSectionEnd} - ${MementoSection} "Add Logo" SecVidFltLogo - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_logo.dll - ${MementoSectionEnd} - ${MementoSection} "Blacken Borders" SecVidFltBlackenBorders - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_blackenBorders.dll - ${MementoSectionEnd} - ${MementoSection} "Change FPS" SecVidFltChangeFps - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_changeFps.dll - ${MementoSectionEnd} - ${MementoSection} "Crop" SecVidFltCrop - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_CropCli.dll - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_cropQt4.dll - ${MementoSectionEnd} - ${MementoSection} "Fade" SecVidFltFade - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_fadeToBlack.dll - ${MementoSectionEnd} - ${MementoSection} "Greyscale" SecVidFltLumaOnly - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_lumaOnly.dll - ${MementoSectionEnd} - ${MementoSection} "Horizontal Flip" SecVidFltHorizontalFlip - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_hf_hflip.dll - ${MementoSectionEnd} - ${MementoSection} "libswscale Resize" SecVidFltSwscaleResize - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_swscaleResize_cli.dll - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_swscaleResizeQT4.dll - ${MementoSectionEnd} - ${MementoSection} "Resample FPS" SecVidFltResampleFps - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_resampleFps.dll - ${MementoSectionEnd} - ${MementoSection} "Rotate" SecVidFltRotate - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_rotate.dll - ${MementoSectionEnd} - ${MementoSection} "Vertical Flip" SecVidFltVerticalFlip - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_vflip.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Interlacing Filters" SecGrpVideoFilterInterlacing - ${MementoSection} "Decomb Decimate" SecVidFltDecombDecimate - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_decimate.dll - ${MementoSectionEnd} - ${MementoSection} "Decomb Telecide" SecVidFltDecombTelecide - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_telecide.dll - ${MementoSectionEnd} - ${MementoSection} "DGBob" SecVidFltDgbob - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_DgBob.dll - ${MementoSectionEnd} - ${MementoSection} "Horizontal Stack Fields" SecVidFltHzStackFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_hzstackField.dll - ${MementoSectionEnd} - ${MementoSection} "Kernel Deint" SecVidFltKernelDeint - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_kernelDeint.dll - ${MementoSectionEnd} - ${MementoSection} "libavcodec Deinterlacers" SecVidFltLavDeinterlacers - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_lavDeint.dll - ${MementoSectionEnd} - ${MementoSection} "Merge Fields" SecVidFltMergeFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_mergeField.dll - ${MementoSectionEnd} - ${MementoSection} "Separate Fields" SecVidFltSeparateFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_separateField.dll - ${MementoSectionEnd} - ${MementoSection} "Stack Fields" SecVidFltStackFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_stackField.dll - ${MementoSectionEnd} - ${MementoSection} "Unstack Fields" SecVidFltUnstackFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_unstackField.dll - ${MementoSectionEnd} - ${MementoSection} "Yadif" SecVidFltYadif - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_yadif.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Colour Filters" SecGrpVideoFilterColour - ${MementoSection} "Avisynth Colour YUV" SecVidFltAvisynthColourYuv - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_colorYuv.dll - ${MementoSectionEnd} - ${MementoSection} "ChromaShift" SecVidFltChromaShift - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_chromaShiftCli.dll - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_chromaShiftQt4.dll - ${MementoSectionEnd} - ${MementoSection} "Contrast" SecVidFltContrast - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_contrastCli.dll - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_contrastQt4.dll - ${MementoSectionEnd} - ${MementoSection} "MPlater Eq2" SecVidFltMplayerEq2 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_eq2Cli.dll - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_eq2Qt4.dll - ${MementoSectionEnd} - ${MementoSection} "MPlater Hue" SecVidFltMplayerHue - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_HueCli.dll - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_HueQt4.dll - ${MementoSectionEnd} - ${MementoSection} "Remove Plane" SecVidFltRemovePlane - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_removePlane.dll - ${MementoSectionEnd} - ${MementoSection} "Swap U and V" SecVidFltSwapUandV - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_swapUV.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Noise Filters" SecGrpVideoFilterNoise - ${MementoSection} "FluxSmooth" SecVidFltFluxSmooth - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_FluxSmooth.dll - ${MementoSectionEnd} - ${MementoSection} "Gaussian Convolution" SecVidFltGauss - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_gauss.dll - ${MementoSectionEnd} - ${MementoSection} "Large Median (5x5)" SecVidFltMediam5x5 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_largeMedian.dll - ${MementoSectionEnd} - ${MementoSection} "Mean Convolution" SecVidFltMean - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_mean.dll - ${MementoSectionEnd} - ${MementoSection} "Median Convolution" SecVidFltMedian - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_median.dll - ${MementoSectionEnd} - ${MementoSection} "MPlayer Denoise 3D" SecVidFltMPlayerDenoise3d - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_denoise3d.dll - ${MementoSectionEnd} - ${MementoSection} "MPlayer Denoise 3D HQ" SecVidFltMPlayerDenoise3dHq - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_denoise3dhq.dll - ${MementoSectionEnd} - ${MementoSection} "MSharpen" SecVidFltMSharpen - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_msharpen.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Sharpness Filters" SecGrpVideoFilterSharpness - ${MementoSection} "asharp" SecVidFltAsharp - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_asharpQt4.dll - ${MementoSectionEnd} - ${MementoSection} "MPlayer Delogo" SecVidFltMPlayerDelogo - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_mpdelogoQt4.dll - ${MementoSectionEnd} - ${MementoSection} "Sharpen" SecVidFltSharpen - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_sharpen.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Subtitle Filters" SecGrpVideoFilterSubtitle - ${MementoSection} "ASS, SSA" SecVidFltAssSsa - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_ssa.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libfribidi-0.dll - ${File} ${ADM_SYSDIR}/libiconv-2.dll - ${File} ${ADM_SYSDIR}/libfreetype-6.dll - ${File} ${ADM_SYSDIR}/libfontconfig-1.dll - ${File} ${ADM_SYSDIR}/libexpat-1.dll - SetOutPath $INSTDIR\etc\fonts - ${Folder} ${ADM_DIR}/etc/fonts - ${MementoSectionEnd} - SectionGroupEnd - #SectionGroup "OpenGL Filters" SecGrpVideoFilterOpenGl - #${MementoSection} "Fragment Shader" SecVidFltOpenGlFragmentShader - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_sampleGlFrag2.dll - #${MementoSectionEnd} - #${MementoSection} "Read Back Benchmark" SecVidFltOpenGlReadBack - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_glBenchmark.dll - #${MementoSectionEnd} - #${MementoSection} "Resize" SecVidFltOpenGlResize - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_glResize.dll - #${MementoSectionEnd} - #${MementoSection} "Rotate" SecVidFltOpenGlRotate - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_rotateGlFrag2.dll - #${MementoSectionEnd} - #${MementoSection} "Wave" SecVidFltOpenGlWave - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_sampleGlVertex.dll - #${MementoSectionEnd} - #SectionGroupEnd - SectionGroup "Miscellaneous Filters" SecGrpVideoFilterMiscellaneous - ${MementoSection} "Print Information" SecVidFltPrintInfo - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_printInfo.dll - ${MementoSectionEnd} - SectionGroupEnd -SectionGroupEnd - -${MementoSection} "-Start menu Change Log" SecStartMenuChangeLog - CreateDirectory $SMPROGRAMS\$StartMenuGroup - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - SetOutPath $INSTDIR - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Change Log ${CORE_VERSION}.lnk" "$INSTDIR\Change Log.html" - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Avidemux job control.lnk" $INSTDIR\avidemux_jobs.exe - !insertmacro MUI_STARTMENU_WRITE_END -${MementoSectionEnd} - - -${MementoSection} "-Start menu Qt" SecStartMenuQt - CreateDirectory $SMPROGRAMS\$StartMenuGroup - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - SetOutPath $INSTDIR - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe - !insertmacro MUI_STARTMENU_WRITE_END -${MementoSectionEnd} - -${MementoSection} "-Start menu AVS Proxy GUI" SecStartMenuAvsProxyGui - CreateDirectory $SMPROGRAMS\$StartMenuGroup - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - SetOutPath $INSTDIR - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\AVS Proxy GUI ${CORE_VERSION}.lnk" "$INSTDIR\avsproxy_gui.exe" - !insertmacro MUI_STARTMENU_WRITE_END -${MementoSectionEnd} - - -${MementoSection} "-Quick Launch Qt" SecQuickLaunchQt - SetOutPath $INSTDIR - CreateShortcut "$QUICKLAUNCH\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe -${MementoSectionEnd} - - -${MementoSection} "-Desktop Qt" SecDesktopQt - SetOutPath $INSTDIR - CreateShortcut "$DESKTOP\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe -${MementoSectionEnd} - -${MementoSectionDone} - -Section -post SecUninstaller - SectionIn 1 2 - WriteRegStr HKLM "${REGKEY}" Path $INSTDIR - WriteRegStr HKLM "${REGKEY}" Version ${PRODUCT_VERSION} - SetOutPath $INSTDIR - WriteUninstaller $INSTDIR\uninstall.exe - WriteRegStr HKLM "${UNINST_REGKEY}" DisplayName "${SHORTCUT_NAME}" - WriteRegStr HKLM "${UNINST_REGKEY}" DisplayVersion "${PRODUCT_VERSION}" - WriteRegStr HKLM "${UNINST_REGKEY}" DisplayIcon $INSTDIR\uninstall.exe - WriteRegStr HKLM "${UNINST_REGKEY}" UninstallString $INSTDIR\uninstall.exe - WriteRegDWORD HKLM "${UNINST_REGKEY}" NoModify 1 - WriteRegDWORD HKLM "${UNINST_REGKEY}" NoRepair 1 -SectionEnd - -Section -CloseLogFile - FileClose $UninstallLogHandle - SetFileAttributes ${UninstallLogPath} HIDDEN -SectionEnd - -Section Uninstall - !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup - - - Delete /REBOOTOK "$QUICKLAUNCH\${SHORTCUT_NAME}.lnk" - Delete /REBOOTOK "$DESKTOP\${SHORTCUT_NAME}.lnk" - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME}.lnk" - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Avidemux job control.lnk" - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Change Log ${CORE_VERSION}.lnk" - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\AVS Proxy GUI ${CORE_VERSION}.lnk" - RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup - DeleteRegValue HKLM "${REGKEY}" StartMenuGroup - - DeleteRegKey HKLM "${UNINST_REGKEY}" - DeleteRegValue HKLM "${REGKEY}" Path - DeleteRegValue HKLM "${REGKEY}" CreateDesktopIcon - DeleteRegValue HKLM "${REGKEY}" CreateStartMenuGroup - DeleteRegValue HKLM "${REGKEY}" CreateQuickLaunchIcon - DeleteRegKey /IfEmpty HKLM "${REGKEY}" - - FileOpen $UninstallLogHandle "${UninstallLogPath}" r -UninstallLoop: - ClearErrors - FileRead $UninstallLogHandle $R0 - IfErrors UninstallEnd - Push $R0 - Call un.TrimNewLines - Pop $R0 - Delete "$R0" - Goto UninstallLoop -UninstallEnd: - FileClose $UninstallLogHandle - Delete "${UninstallLogPath}" - Delete "$INSTDIR\uninstall.exe" - Push "\" - Call un.RemoveEmptyDirs - RMDir "$INSTDIR" -SectionEnd - -########################## -# Installer functions -########################## -Function .onInit -UAC_Elevate: - !insertmacro UAC_RunElevated - StrCmp 1223 $0 UAC_ElevationAborted - StrCmp 0 $0 0 UAC_Err - StrCmp 1 $1 0 UAC_Success - Quit - -UAC_Err: - MessageBox MB_ICONSTOP "Unable to elevate, error $0" - Abort - -UAC_ElevationAborted: - Abort - -UAC_Success: - StrCmp 1 $3 +4 - StrCmp 3 $1 0 UAC_ElevationAborted - MessageBox MB_ICONSTOP "This installer requires admin access." - Goto UAC_Elevate - - Call LoadPreviousSettings - ReadRegStr $PreviousVersion HKLM "${REGKEY}" Version - - ${If} $PreviousVersion != "" - ${VersionCompare} ${PRODUCT_VERSION} $PreviousVersion $PreviousVersionState - ${EndIf} - - InitPluginsDir - SetShellVarContext all -FunctionEnd - -Function .onInstSuccess - ${MementoSectionSave} -FunctionEnd - -Function LoadPreviousSettings - ${MementoSectionRestore} - !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup - - ReadRegStr $CreateStartMenuGroup HKLM "${REGKEY}" CreateStartMenuGroup - - ${If} $CreateStartMenuGroup == "" - StrCpy $CreateStartMenuGroup 1 - ${EndIf} - - ReadRegStr $CreateDesktopIcon HKLM "${REGKEY}" CreateDesktopIcon - - ${If} $CreateDesktopIcon == "" - StrCpy $CreateDesktopIcon 1 - ${EndIf} - - ${If} ${AtMostWinVista} - ReadRegStr $CreateQuickLaunchIcon HKLM "${REGKEY}" CreateQuickLaunchIcon - - ${If} $CreateQuickLaunchIcon == "" - StrCpy $CreateQuickLaunchIcon 1 - ${EndIf} - ${EndIf} - -FunctionEnd - -Function RunUninstaller - ReadRegStr $R1 HKLM "${UNINST_REGKEY}" "UninstallString" - - ${If} $R1 == "" - Return - ${EndIf} - - ;Run uninstaller - HideWindow - ClearErrors - - ${If} $PreviousVersionState == 0 - ${AndIf} $ReinstallUninstall == 1 - ExecWait '$R1 _?=$INSTDIR' - ${Else} - ExecWait '$R1 /frominstall _?=$INSTDIR' - ${EndIf} - - IfErrors NoRemoveUninstaller - IfFileExists "$INSTDIR\uninstall.exe" 0 NoRemoveUninstaller - Delete "$R1" - RMDir $INSTDIR - -NoRemoveUninstaller: -FunctionEnd - -Function CheckSelectedUIs - !insertmacro SectionFlagIsSet ${SecGrpUI} ${SF_SELECTED} end checkPartial -checkPartial: - !insertmacro SectionFlagIsSet ${SecGrpUI} ${SF_PSELECTED} end displayError -displayError: - MessageBox MB_OK|MB_ICONSTOP "At least one User Interface must be selected." - Abort -end: -FunctionEnd - -LangString INSTALL_OPTS_PAGE_TITLE ${LANG_ENGLISH} "Choose Install Options" -LangString INSTALL_OPTS_PAGE_SUBTITLE ${LANG_ENGLISH} "Choose where to install Avidemux icons." -Var dlgInstallOptions -Var lblCreateIcons -Var chkDesktop -Var chkStartMenu -Var chkQuickLaunch - -Function InstallOptionsPage - Call IsInstallOptionsRequired - !insertmacro MUI_HEADER_TEXT "$(INSTALL_OPTS_PAGE_TITLE)" "$(INSTALL_OPTS_PAGE_SUBTITLE)" - - nsDialogs::Create 1018 - Pop $dlgInstallOptions - - ${If} $dlgInstallOptions == error - Abort - ${EndIf} - - ${NSD_CreateLabel} 0 0u 100% 12u "Create icons for Avidemux:" - Pop $lblCreateIcons - - ${NSD_CreateCheckBox} 0 18u 100% 12u "On my &Desktop" - Pop $chkDesktop - ${NSD_SetState} $chkDesktop $CreateDesktopIcon - ${NSD_OnClick} $chkDesktop UpdateInstallOptions - - ${NSD_CreateCheckBox} 0 36u 100% 12u "In my &Start Menu Programs folder" - Pop $chkStartMenu - ${NSD_SetState} $chkStartMenu $CreateStartMenuGroup - ${NSD_OnClick} $chkStartMenu UpdateInstallOptions - - ${If} ${AtMostWinVista} - ${NSD_CreateCheckBox} 0 54u 100% 12u "In my &Quick Launch bar" - Pop $chkQuickLaunch - ${NSD_SetState} $chkQuickLaunch $CreateQuickLaunchIcon - ${NSD_OnClick} $chkQuickLaunch UpdateInstallOptions - ${EndIf} - #${If} ${IsWin2003} - #WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\avidemux.exe" "WIN2000" - #${EndIf} - #${If} ${IsWinXp} - #WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\avidemux.exe" "WIN2000" - #${EndIf} - nsDialogs::Show -FunctionEnd - -Function UpdateInstallOptions - ${NSD_GetState} $chkDesktop $CreateDesktopIcon - ${NSD_GetState} $chkStartMenu $CreateStartMenuGroup - ${NSD_GetState} $chkQuickLaunch $CreateQuickLaunchIcon -FunctionEnd - -Function IsInstallOptionsRequired -Goto end - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} end resetOptions -resetOptions: - - StrCpy $CreateDesktopIcon 0 - StrCpy $CreateStartMenuGroup 0 - StrCpy $CreateQuickLaunchIcon 0 - Abort - -end: -FunctionEnd - -Function IsStartMenuRequired - StrCmp $CreateStartMenuGroup 1 +2 - Abort -FunctionEnd - -Function ActivateInternalSections - #AVS Proxy GUI shortcut: - SectionGetFlags ${SecAvsProxy} $0 - IntOp $0 $0 & ${SF_SELECTED} - IntOp $0 $0 & $CreateStartMenuGroup - SectionSetFlags ${SecStartMenuAvsProxyGui} $0 - - #Change Log shortcut: - SectionSetFlags ${SecStartMenuChangeLog} $CreateStartMenuGroup - - #Qt shortcuts: - SectionGetFlags ${SecUiQt} $0 - IntOp $0 $0 & ${SF_SELECTED} - - IntOp $1 $0 & $CreateDesktopIcon - SectionSetFlags ${SecDesktopQt} $1 - - IntOp $1 $0 & $CreateQuickLaunchIcon - SectionSetFlags ${SecQuickLaunchQt} $1 - - IntOp $1 $0 & $CreateStartMenuGroup - SectionSetFlags ${SecStartMenuQt} $1 -FunctionEnd - -Function InstFilesPageShow - ${If} $ReinstallUninstall != "" - Call RunUninstaller - BringToFront - ${EndIf} -FunctionEnd - -Function InstFilesPageLeave - ; Don't advance automatically if details expanded - FindWindow $R0 "#32770" "" $HWNDPARENT - GetDlgItem $R0 $R0 1016 - System::Call user32::IsWindowVisible(i$R0)i.s - Pop $R0 - - StrCmp $R0 0 +2 - SetAutoClose false -FunctionEnd - -Function ConfigureFinishPage - - SectionGetFlags ${SecUiQt} $0 - IntOp $0 $0 & ${SF_SELECTED} - StrCmp $0 ${SF_SELECTED} end - - DeleteINISec "$PLUGINSDIR\ioSpecial.ini" "Field 4" - -end: -FunctionEnd - -Function RunAvidemux - SetOutPath $INSTDIR - - SectionGetFlags ${SecUiQt} $0 - IntOp $0 $0 & ${SF_SELECTED} - - !insertmacro UAC_AsUser_ExecShell "" "$INSTDIR\avidemux.exe" "" "" "" - - Goto end - - -end: -FunctionEnd - -Var ReinstallUninstallButton - -Function ReinstallPage - ${If} $PreviousVersion == "" - Abort - ${EndIf} - - nsDialogs::Create /NOUNLOAD 1018 - Pop $0 - - ${If} $PreviousVersionState == 1 - !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_FULLNAME}." - nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "An older version of Avidemux is installed on your system. Select the operation you want to perform and click Next to continue." - Pop $R0 - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Upgrade Avidemux using previous settings (recommended)" - Pop $ReinstallUninstallButton - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Change settings (advanced)" - Pop $R0 - - ${If} $ReinstallUninstall == "" - StrCpy $ReinstallUninstall 1 - ${EndIf} - ${ElseIf} $PreviousVersionState == 2 - !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_FULLNAME}." - nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "A newer version of Avidemux is already installed! It is not recommended that you downgrade to an older version. Select the operation you want to perform and click Next to continue." - Pop $R0 - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Downgrade Avidemux using previous settings (recommended)" - Pop $ReinstallUninstallButton - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Change settings (advanced)" - Pop $R0 - - ${If} $ReinstallUninstall == "" - StrCpy $ReinstallUninstall 1 - ${EndIf} - ${ElseIf} $PreviousVersionState == 0 - !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform." - nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "${PRODUCT_FULLNAME} is already installed. Select the operation you want to perform and click Next to continue." - Pop $R0 - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Add/Remove/Reinstall components" - Pop $R0 - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Uninstall Avidemux" - Pop $ReinstallUninstallButton - - ${If} $ReinstallUninstall == "" - StrCpy $ReinstallUninstall 2 - ${EndIf} - ${Else} - MessageBox MB_ICONSTOP "Unknown value of PreviousVersionState, aborting" /SD IDOK - Abort - ${EndIf} - - ${If} $ReinstallUninstall == "1" - SendMessage $ReinstallUninstallButton ${BM_SETCHECK} 1 0 - ${Else} - SendMessage $R0 ${BM_SETCHECK} 1 0 - ${EndIf} - - nsDialogs::Show -FunctionEnd - -Function ReinstallPageLeave - SendMessage $ReinstallUninstallButton ${BM_GETCHECK} 0 0 $R0 - - ${If} $R0 == 1 - ; Option to uninstall old version selected - StrCpy $ReinstallUninstall 1 - ${Else} - ; Custom up/downgrade or add/remove/reinstall - StrCpy $ReinstallUninstall 2 - ${EndIf} - - ${If} $ReinstallUninstall == 1 - ${If} $PreviousVersionState == 0 - Call RunUninstaller - Quit - ${Else} - ; Need to reload defaults. User could have - ; chosen custom, change something, went back and selected - ; the express option. - Call LoadPreviousSettings - ${EndIf} - ${EndIf} -FunctionEnd - - -########################## -# Uninstaller functions -########################## -Function un.onInit - SetShellVarContext all - -UAC_Elevate: - !insertmacro UAC_RunElevated - StrCmp 1223 $0 UAC_ElevationAborted - StrCmp 0 $0 0 UAC_Err - StrCmp 1 $1 0 UAC_Success - Quit - -UAC_Err: - MessageBox MB_ICONSTOP "Unable to elevate, error $0" - Abort - -UAC_ElevationAborted: - Abort - -UAC_Success: - StrCmp 1 $3 +4 - StrCmp 3 $1 0 UAC_ElevationAborted - MessageBox MB_ICONSTOP "This installer requires admin access." - Goto UAC_Elevate -FunctionEnd - -; TrimNewlines (copied from NSIS documentation) -; input, top of stack (e.g. whatever$/r$/n) -; output, top of stack (replaces, with e.g. whatever) -; modifies no other variables. -Function un.TrimNewlines - Exch $R0 - Push $R1 - Push $R2 - StrCpy $R1 0 - -loop: - IntOp $R1 $R1 - 1 - StrCpy $R2 $R0 1 $R1 - StrCmp $R2 "$\r" loop - StrCmp $R2 "$\n" loop - IntOp $R1 $R1 + 1 - IntCmp $R1 0 no_trim_needed - StrCpy $R0 $R0 $R1 - -no_trim_needed: - Pop $R2 - Pop $R1 - Exch $R0 -FunctionEnd - -Function un.RemoveEmptyDirs - Pop $9 - !define Index 'Line${__LINE__}' - FindFirst $0 $1 "$INSTDIR$9*" - StrCmp $0 "" "${Index}-End" -"${Index}-Loop:" - StrCmp $1 "" "${Index}-End" - StrCmp $1 "." "${Index}-Next" - StrCmp $1 ".." "${Index}-Next" - Push $0 - Push $1 - Push $9 - Push "$9$1\" - Call un.RemoveEmptyDirs - Pop $9 - Pop $1 - Pop $0 -;"${Index}-Remove:" - RMDir "$INSTDIR$9$1" -"${Index}-Next:" - FindNext $0 $1 - Goto "${Index}-Loop" -"${Index}-End:" - FindClose $0 - !undef Index -FunctionEnd - -Function un.ConfirmPagePre - ${un.GetParameters} $R0 - ${un.GetOptions} $R0 "/frominstall" $R1 - ${Unless} ${Errors} - Abort - ${EndUnless} -FunctionEnd - -Function un.FinishPagePre - ${un.GetParameters} $R0 - ${un.GetOptions} $R0 "/frominstall" $R1 - ${Unless} ${Errors} - SetRebootFlag false - Abort - ${EndUnless} -FunctionEnd +########################## +# Included files +########################## +!addincludedir ${NSIDIR} +!addplugindir ${NSIDIR}/plugin + +!include Sections.nsh +!include MUI2.nsh +!include nsDialogs.nsh +!include Memento.nsh +!include FileFunc.nsh +!include UAC.nsh +!include WinVer.nsh +!include WordFunc.nsh +#!include revision.nsh + +SetCompressor /SOLID lzma +SetCompressorDictSize 96 +RequestExecutionLevel user + +########################## +# Defines +########################## +!define BUILD_BITS 32 +!define QT_DIR /mingw/Qt/current/bin/ +!define ADM_SYSDIR /mingw/bin +!define ADM_DIR /mingw/Release +!define TOOLCHAIN_DIR /home/fx/mxe-octave/usr/lib/gcc/i686-pc-mingw32/4.7.2/ +#/home/fx/rub/mingw32/ +#!define NSIDIR "/home/fx/hudson/workspace/mingw_2.6.2_nsis/avidemux/winInstaller" +#!define SVN_VERSION 6 +!define REVISION ${SVN_VERSION} +!define EXEDIR "${NSIDIR}/install" + +!define CORE_VERSION "2.6" +!define POINT_RELEASE "8" +!define PRODUCT_VERSION "${CORE_VERSION}.${POINT_RELEASE}.${SVN_VERSION}" +!define PRODUCT_NAME "Avidemux ${CORE_VERSION}" +!define PRODUCT_FULLNAME "Avidemux ${PRODUCT_VERSION} (${BUILD_BITS}-bit Release)" + +!if ${BUILD_BITS} == 64 + !define SHORTCUT_NAME "${PRODUCT_NAME}" + !define REG_GROUPNAME "${PRODUCT_NAME} (${BUILD_BITS}-bit)" +!else + !define SHORTCUT_NAME "${PRODUCT_NAME} (${BUILD_BITS}-bit)" + !define REG_GROUPNAME "${PRODUCT_NAME}" +!endif + +!define REGKEY "SOFTWARE\${REG_GROUPNAME}" +!define UNINST_REGKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_GROUPNAME}" +!define COMPANY "Free Software Foundation" +!define URL "http://www.avidemux.org" + +OutFile "${EXEDIR}/avidemux_${CORE_VERSION}.${POINT_RELEASE}_r${REVISION}_win${BUILD_BITS}.exe" +Name "${PRODUCT_FULLNAME}" + +########################## +# Memento defines +########################## +!define MEMENTO_REGISTRY_ROOT HKLM +!define MEMENTO_REGISTRY_KEY "${REGKEY}" + +########################## +# MUI defines +########################## +!define MUI_ICON "${NSIDIR}/../common/xpm/adm.ico" +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_RIGHT +!define MUI_HEADERIMAGE_BITMAP "${NSIDIR}/PageHeader.bmp" +!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM +!define MUI_STARTMENUPAGE_REGISTRY_KEY "${REGKEY}" +!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup +!define MUI_STARTMENUPAGE_DEFAULTFOLDER Avidemux +!define MUI_STARTMENUPAGE_NODISABLE +!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSIDIR}/WelcomeFinishStrip.bmp" +!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSIDIR}/WelcomeFinishStrip.bmp" +!define MUI_UNICON "${NSIDIR}/../common/xpm/adm.ico" +!define MUI_COMPONENTSPAGE_NODESC + +########################## +# Variables +########################## +Var CreateDesktopIcon +Var CreateStartMenuGroup +Var CreateQuickLaunchIcon +Var StartMenuGroup +Var PreviousVersion +Var PreviousVersionState +Var ReinstallUninstall + +########################## +# Installer pages +########################## +!define MUI_WELCOMEPAGE_TITLE "${PRODUCT_FULLNAME} Setup Wizard" +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "${NSIDIR}/License.rtf" + Page custom ReinstallPage ReinstallPageLeave +!insertmacro MUI_PAGE_COMPONENTS +Page custom InstallOptionsPage +!define MUI_PAGE_CUSTOMFUNCTION_PRE IsStartMenuRequired +!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup +!insertmacro MUI_PAGE_DIRECTORY +!define MUI_PAGE_CUSTOMFUNCTION_PRE ActivateInternalSections +!define MUI_PAGE_CUSTOMFUNCTION_SHOW InstFilesPageShow +!define MUI_PAGE_CUSTOMFUNCTION_LEAVE InstFilesPageLeave +!insertmacro MUI_PAGE_INSTFILES +!define MUI_FINISHPAGE_RUN +!define MUI_FINISHPAGE_RUN_FUNCTION RunAvidemux +!define MUI_FINISHPAGE_RUN_TEXT "Run ${PRODUCT_NAME} now" +!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR/Change Log.html" +!define MUI_FINISHPAGE_SHOWREADME_TEXT "View Change Log now" +!define MUI_FINISHPAGE_LINK "Visit the Avidemux website" +!define MUI_FINISHPAGE_LINK_LOCATION "http://avidemux.org/" +!define MUI_PAGE_CUSTOMFUNCTION_PRE ConfigureFinishPage +!insertmacro MUI_PAGE_FINISH + +!define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!define MUI_PAGE_CUSTOMFUNCTION_PRE un.FinishPagePre +!insertmacro MUI_UNPAGE_FINISH + +########################## +# Installer languages +########################## +!insertmacro MUI_LANGUAGE English + +########################## +# Installer attributes +########################## +!if ${BUILD_BITS} == 64 + InstallDir "$PROGRAMFILES64\${PRODUCT_NAME}" +!else + InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" +!endif + +CRCCheck on +XPStyle on +ShowInstDetails nevershow +ShowUninstDetails nevershow +VIProductVersion ${PRODUCT_VERSION} +VIAddVersionKey ProductName Avidemux +VIAddVersionKey ProductVersion "${PRODUCT_VERSION}" +VIAddVersionKey FileVersion "" +VIAddVersionKey FileDescription "" +VIAddVersionKey LegalCopyright "" +InstallDirRegKey HKLM "${REGKEY}" Path +BrandingText "Packaged by Gruntster" +InstType Standard +InstType Full +######################################### +# +######################################### +Function GetAfterChar + Exch $0 ; chop char + Exch + Exch $1 ; input string + Push $2 + Push $3 + StrCpy $2 0 + loop: + IntOp $2 $2 - 1 + StrCpy $3 $1 1 $2 + StrCmp $3 "" 0 +3 + StrCpy $0 "" + Goto exit2 + StrCmp $3 $0 exit1 + Goto loop + exit1: + IntOp $2 $2 + 1 + StrCpy $0 $1 "" $2 + exit2: + Pop $3 + Pop $2 + Pop $1 + Exch $0 ; output +FunctionEnd +#####################################################################  +!define StrReplace '!insertmacro "_Name"' + +########################## +# Uninstaller macros +########################## +!insertmacro un.GetOptions +!insertmacro un.GetParameters + +!define UninstallLogPath "$INSTDIR\uninstall.log" +Var UninstallLogHandle + +; Uninstall log file missing. +LangString UninstallLogMissing ${LANG_ENGLISH} "uninstall.log not found!$\r$\nUninstallation cannot proceed!" +# Regexep Does not work with cross +# Use only one file at a time +!macro InstallFile FILEZ + File "${FILEZ}" + Push "${FILEZ}" + Push "/" + Call GetAfterChar + Pop $R0 + FileWrite $UninstallLogHandle "$OUTDIR\$R0$\r$\n" +!macroend +!define File "!insertmacro InstallFile" + +!macro InstallFolder FILEREGEX + File /r "${FILEREGEX}/*" + Push "$OUTDIR" + Call InstallFolderInternal +!macroend +!define Folder "!insertmacro InstallFolder" + +Function InstallFolderInternal + Pop $9 + !define Index 'Line${__LINE__}' + FindFirst $0 $1 "$9/*" + StrCmp $0 "" "${Index}-End" +"${Index}-Loop:" + StrCmp $1 "" "${Index}-End" + StrCmp $1 "." "${Index}-Next" + StrCmp $1 ".." "${Index}-Next" + IfFileExists "$9\$1\*" 0 "${Index}-Write" + Push $0 + Push $9 + Push "$9\$1" + Call InstallFolderInternal + Pop $9 + Pop $0 + Goto "${Index}-Next" +"${Index}-Write:" + FileWrite $UninstallLogHandle "$9\$1$\r$\n" +"${Index}-Next:" + FindNext $0 $1 + Goto "${Index}-Loop" +"${Index}-End:" + !undef Index +FunctionEnd + +; WriteUninstaller macro +!macro WriteUninstaller Path + WriteUninstaller "${Path}" + FileWrite $UninstallLogHandle "${Path}$\r$\n" +!macroend +!define WriteUninstaller "!insertmacro WriteUninstaller" + +########################## +# Macros +########################## + +!macro InstallQtLanguage LANG_NAME LANG_CODE + SetOverwrite on + + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} installQt${LANG_CODE} endQt${LANG_CODE} + +installQt${LANG_CODE}: + SetOutPath $INSTDIR\i18n + ${File} i18n/avidemux_${LANG_CODE}.qm + ${File} i18n/qt_${LANG_CODE}.qm + +endQt${LANG_CODE}: +!macroend + +########################## +# Installer sections +########################## +Section -OpenLogFile + CreateDirectory "$INSTDIR" + FileOpen $UninstallLogHandle ${UninstallLogPath} a + FileSeek $UninstallLogHandle 0 END +SectionEnd + +Section "Avidemux Core" SecCore + SectionIn 1 2 RO + SetOutPath $INSTDIR + SetOverwrite on + ${File} "./Build Info.txt" + ${File} "./last_changes.txt" + ${File} "./Change Log.html" +# +# + ${File} ${TOOLCHAIN_DIR}/libstdc++-6.dll + ${File} ${TOOLCHAIN_DIR}/../libgcc_s_dw2-1.dll +# +# + ${File} ${ADM_SYSDIR}/libsqlite3-0.dll + ${File} ${ADM_SYSDIR}/libz.dll + ${File} ${ADM_SYSDIR}/libpng15-15.dll + ${File} ${ADM_SYSDIR}/libpthread.dll +# +# + ${File} ${ADM_DIR}/libADM_audioParser6.dll + ${File} ${ADM_DIR}/libADM_core6.dll + ${File} ${ADM_DIR}/libADM_coreAudio6.dll + ${File} ${ADM_DIR}/libADM_coreAudioDevice6.dll + ${File} ${ADM_DIR}/libADM_coreAudioEncoder6.dll + ${File} ${ADM_DIR}/libADM_coreAudioFilterAPI6.dll + ${File} ${ADM_DIR}/libADM_coreDemuxer6.dll + ${File} ${ADM_DIR}/libADM_coreDemuxerMpeg6.dll + ${File} ${ADM_DIR}/libADM_coreImage6.dll + ${File} ${ADM_DIR}/libADM_coreImageLoader6.dll + ${File} ${ADM_DIR}/libADM_coreJobs.dll + ${File} ${ADM_DIR}/libADM_coreMuxer6.dll + ${File} ${ADM_DIR}/libADM_coreScript.dll + ${File} ${ADM_DIR}/libADM_coreSocket6.dll + ${File} ${ADM_DIR}/libADM_coreSqlLight3.dll + ${File} ${ADM_DIR}/libADM_coreUI6.dll + ${File} ${ADM_DIR}/libADM_coreUtils6.dll + ${File} ${ADM_DIR}/libADM_coreVideoCodec6.dll + ${File} ${ADM_DIR}/libADM_coreVideoEncoder6.dll + ${File} ${ADM_DIR}/libADM_coreVideoFilter6.dll + ${File} ${ADM_DIR}/libADM_coreSubtitle.dll + ${File} ${QT_DIR}/QtCore4.dll + ${File} ${QT_DIR}/QtGui4.dll + ${File} ${NSIDIR}/../../AUTHORS. + ${File} ${NSIDIR}/../../COPYING. + ${File} ${NSIDIR}/../../README. + ${File} ${ADM_DIR}/avcodec-*.dll + ${File} ${ADM_DIR}/avformat-*.dll + ${File} ${ADM_DIR}/avutil-*.dll + ${File} ${ADM_DIR}/postproc-*.dll + ${File} ${ADM_DIR}/swscale-*.dll + + WriteRegStr HKLM "${REGKEY}" CreateDesktopIcon $CreateDesktopIcon + WriteRegStr HKLM "${REGKEY}" CreateStartMenuGroup $CreateStartMenuGroup + + ${If} ${AtMostWinVista} + WriteRegStr HKLM "${REGKEY}" CreateQuickLaunchIcon $CreateQuickLaunchIcon + ${EndIf} +SectionEnd + +SectionGroup /e "User interfaces" SecGrpUI + ${MementoUnselectedSection} "Command Line" SecUiCli + SectionIn 2 + SetOutPath $INSTDIR + SetOverwrite on + ${File} ${ADM_DIR}/avidemux_cli.exe + ${File} ${ADM_DIR}/libADM_render6_cli.dll + ${File} ${ADM_DIR}/libADM_UI_Cli6.dll + ${MementoSectionEnd} + + ${MementoSection} Qt SecUiQt + SectionIn 1 2 RO + SetOutPath $INSTDIR + SetOverwrite on + ${File} ${ADM_DIR}/avidemux.exe + ${File} ${ADM_DIR}/avidemux_jobs.exe + ${File} ${ADM_DIR}/libADM_render6_QT4.dll + ${File} ${ADM_DIR}/libADM_UIQT46.dll + ${File} ${QT_DIR}/QtOpenGL4.dll + ${MementoSectionEnd} +SectionGroupEnd + +SectionGroup "Audio Decoders" SecGrpAudioDecoder + ${MementoSection} "µ-law" SecAudDecUlaw + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_ulaw.dll + ${MementoSectionEnd} + ${MementoSection} "AAC (FAAD)" SecAudDecFaad + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_faad.dll + #SetOutPath $INSTDIR + ${MementoSectionEnd} + ${MementoSection} "AAC, AC-3, ADPCM IMA AMV, DTS, E-AC-3, MP2, MP3, Nellymoser, QDesign, WMA (libavcodec)" SecAudDecAvcodec + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_lav.dll + ${MementoSectionEnd} + ${MementoSection} "AC-3 (liba52)" SecAudDecA52 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_a52.dll + ${MementoSectionEnd} + ${MementoSection} "ADPCM IMA" SecAudDecImaAdpcm + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_ima_adpcm.dll + ${MementoSectionEnd} + ${MementoSection} "ADPCM Microsoft" SecAudDecMsAdpcm + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_ms_adpcm.dll + ${MementoSectionEnd} + ${MementoSection} "AMR-NB" SecAudDecOpencoreAmrNb + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_opencore_amrnb.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libopencore-amrnb-*.dll + ${MementoSectionEnd} + ${MementoSection} "AMR-WB" SecAudDecOpencoreAmrWb + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_opencore_amrwb.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libopencore-amrwb-*.dll + ${MementoSectionEnd} + ${MementoSection} "MP2, MP3 (MAD)" SecAudDecMad + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_Mad.dll + ${MementoSectionEnd} + ${MementoSection} "Vorbis" SecAudDecVorbis + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_vorbis.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libogg-0.dll + ${File} ${ADM_SYSDIR}/libvorbis-0.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Audio Devices" SecGrpAudioDevice + ${MementoSection} "Waveform" SecAudDevWaveform + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDevices + ${File} ${ADM_DIR}/plugins/audioDevices/libADM_av_win32.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Audio Encoders" SecGrpAudioEncoder + ${MementoSection} "AAC (FAAC)" SecAudEncFaac + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_faac.dll + #SetOutPath $INSTDIR + ${MementoSectionEnd} + ${MementoSection} "AAC (libavcodec)" SecAudEncLavAac + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lav_aac.dll + ${MementoSectionEnd} + ${MementoSection} "AC-3 (Aften)" SecAudDecAften + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_aften.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libaften.dll + ${MementoSectionEnd} + ${MementoSection} "AC-3 (libavcodec)" SecAudEncLavAc3 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lav_ac3.dll + ${MementoSectionEnd} + #${MementoSection} "DTS (dcaenc)" SecAudDecDcaEnc + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\audioEncoders + #${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_dcaenc.dll + #SetOutPath $INSTDIR + #${File} libdcaenc-0.dll + #${MementoSectionEnd} + ${MementoSection} "MP2 (libavcodec)" SecAudEncLavMp2 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lav_mp2.dll + SetOutPath $INSTDIR + ${MementoSectionEnd} + #${MementoSection} "MP2 (TwoLAME)" SecAudEncTwoLame + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\audioEncoders + #${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_twolame.dll + #${MementoSectionEnd} + ${MementoSection} "MP3" SecAudEncLame + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lame.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libmp3lame-0.dll + ${MementoSectionEnd} + ${MementoSection} "PCM" SecAudEncPcm + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_pcm.dll + ${MementoSectionEnd} + ${MementoSection} "Vorbis" SecAudEncVorbis + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_vorbis.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libogg-0.dll + ${File} ${ADM_SYSDIR}/libvorbis-0.dll + ${File} ${ADM_SYSDIR}/libvorbisenc-2.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Avisynth" SecGrpAvisynth + ${MementoUnselectedSection} "Avisynth Proxy" SecAvsProxy + SectionIn 2 + SetOutPath $INSTDIR + SetOverwrite on + ${File} ${ADM_SYSDIR}/avsproxy.exe + ${File} ${ADM_SYSDIR}/avsproxy_gui.exe + ${MementoSectionEnd} + ${MementoUnselectedSection} "Avisynth Proxy Demuxer" SecDemuxAvisynth + SectionIn 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_avsproxy.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Demuxers" SecGrpDemuxers + ${MementoSection} "ASF" SecDemuxAsf + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_asf.dll + ${MementoSectionEnd} + ${MementoSection} "BMP, JPEG, PNG Images" SecDemuxImage + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_pic.dll + ${MementoSectionEnd} + ${MementoSection} "Flash Video" SecDemuxFlv + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_flv.dll + ${MementoSectionEnd} + ${MementoSection} "Matroska" SecDemuxMatroska + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_matroska.dll + ${MementoSectionEnd} + ${MementoSection} "MP4" SecDemuxMp4 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_mp4.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-PS" SecDemuxMpegPs + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_ps.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-TS" SecDemuxMpegTs + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_ts.dll + ${MementoSectionEnd} + ${MementoSection} "MXF" SecDemuxMxf + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_mxf.dll + ${MementoSectionEnd} + ${MementoSection} "OpenDML AVI" SecDemuxOpenDml + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_opendml.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Muxers" SecGrpMuxers + ${MementoSection} "Dummy [Raw Audio/Video]" SecMuxDummy + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_dummy.dll + ${MementoSectionEnd} + ${MementoSection} "Flash Video" SecMuxLavFlv + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_flv.dll + ${MementoSectionEnd} + ${MementoSection} "Matroska" SecMuxLavMatroska + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_Mkv.dll + ${MementoSectionEnd} + ${MementoSection} "MP4 (libavcodec)" SecMuxLavMp4 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_mp4.dll + ${MementoSectionEnd} + ${MementoSection} "MP4 (MP4v2)" SecMuxMp4v2 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_mp4v2.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-PS" SecMuxLavMpegPs + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_ffPS.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-TS" SecMuxLavMpegTs + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_ffTS.dll + ${MementoSectionEnd} + ${MementoSection} "OpenDML AVI" SecMuxOpenDml + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_avi.dll + ${MementoSectionEnd} + ${MementoSection} "Raw Video" SecMuxRaw + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_raw.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Script Engines" SecGrpScriptEngine + #${MementoSection} "QtScript" SecScriptQt + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR + #${File} ${QT_DIR}/QtScript4.dll + #${File} ${QT_DIR}/QtScriptTools4.dll + #SetOutPath $INSTDIR\plugins\scriptEngines + #${File} ${ADM_DIR}/plugins/scriptEngines/libADM_script_qt.dll + #SetOutPath $INSTDIR\help\QtScript + #${Folder} help/QtScript + #${MementoSectionEnd} + ${MementoSection} "Tinypy" SecScriptTinypy + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\scriptEngines + ${File} ${ADM_DIR}/plugins/scriptEngines/libADM_script_tinyPy.dll + SetOutPath $INSTDIR\plugins\autoScripts + ${Folder} ${ADM_DIR}/plugins/autoScripts + ${MementoSectionEnd} +SectionGroupEnd +#SectionGroup "Video Decoders" SecGrpVideoDecoder + #${MementoSection} "VP8" SecVidDecVpx + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoDecoders + #${File} ${ADM_DIR}/plugins/videoDecoders/libADM_vd_vpx.dll + #${MementoSectionEnd} +#SectionGroupEnd +SectionGroup "Video Encoders" SecGrpVideoEncoder + ${MementoSection} "[Null]" SecVidEncNull + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_null.dll + ${MementoSectionEnd} + ${MementoSection} "Huffyuv, FFVHuff" SecVidEncLavHuffyuv + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_huff.dll + ${MementoSectionEnd} + ${MementoSection} "JPEG" SecVidEncLavJpeg + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_jpeg.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-2" SecVidEncLavMpeg2 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_ffMpeg2.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-4 ASP (libavcodec)" SecVidEncLavMpeg4asp + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_ffMpeg4.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-4 ASP (Xvid)" SecVidEncXvid + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_xvid4.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/xvidcore.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-4 AVC" SecVidEncX264 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_x264_other.dll + + SetOutPath $INSTDIR\plugins\videoEncoders\qt4 + ${File} ${ADM_DIR}/plugins/videoEncoders/qt4/libADM_ve_x264_QT4.dll + + SetOutPath $INSTDIR\plugins\pluginSettings\x264 + ${Folder} ${ADM_DIR}/plugins/pluginSettings/x264 + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libx264-*.dll + #${File} ${ADM_SYSDIR}/pthreadGC2.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-4 HEVC" SecVidEncX265 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_x265_other.dll + + SetOutPath $INSTDIR\plugins\videoEncoders\qt4 + ${File} ${ADM_DIR}/plugins/videoEncoders/qt4/libADM_ve_x265_QT4.dll + + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libx265*.dll + #${File} ${ADM_SYSDIR}/pthreadGC2.dll + ${MementoSectionEnd} +${MementoSection} "PNG" SecVidEncLavPng + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_png.dll + ${MementoSectionEnd} + ${MementoSection} "Sorenson Spark" SecVidEncSorenson + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_ffFlv1.dll + ${MementoSectionEnd} + ${MementoSection} "YV12" SecVidEncYv12 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_yv12.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Video Filters" SecGrpVideoFilter + SectionGroup "Transform Filters" SecGrpVideoFilterTransform + ${MementoSection} "Add Black Borders" SecVidFltBlackBorders + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_addBorders.dll + ${MementoSectionEnd} + ${MementoSection} "Add Logo" SecVidFltLogo + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_logo.dll + ${MementoSectionEnd} + ${MementoSection} "Blacken Borders" SecVidFltBlackenBorders + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_blackenBorders.dll + ${MementoSectionEnd} + ${MementoSection} "Change FPS" SecVidFltChangeFps + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_changeFps.dll + ${MementoSectionEnd} + ${MementoSection} "Crop" SecVidFltCrop + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_CropCli.dll + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_cropQt4.dll + ${MementoSectionEnd} + ${MementoSection} "Fade" SecVidFltFade + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_fadeToBlack.dll + ${MementoSectionEnd} + ${MementoSection} "Greyscale" SecVidFltLumaOnly + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_lumaOnly.dll + ${MementoSectionEnd} + ${MementoSection} "Horizontal Flip" SecVidFltHorizontalFlip + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_hf_hflip.dll + ${MementoSectionEnd} + ${MementoSection} "libswscale Resize" SecVidFltSwscaleResize + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_swscaleResize_cli.dll + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_swscaleResizeQT4.dll + ${MementoSectionEnd} + ${MementoSection} "Resample FPS" SecVidFltResampleFps + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_resampleFps.dll + ${MementoSectionEnd} + ${MementoSection} "Rotate" SecVidFltRotate + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_rotate.dll + ${MementoSectionEnd} + ${MementoSection} "Vertical Flip" SecVidFltVerticalFlip + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_vflip.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Interlacing Filters" SecGrpVideoFilterInterlacing + ${MementoSection} "Decomb Decimate" SecVidFltDecombDecimate + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_decimate.dll + ${MementoSectionEnd} + ${MementoSection} "Decomb Telecide" SecVidFltDecombTelecide + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_telecide.dll + ${MementoSectionEnd} + ${MementoSection} "DGBob" SecVidFltDgbob + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_DgBob.dll + ${MementoSectionEnd} + ${MementoSection} "Horizontal Stack Fields" SecVidFltHzStackFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_hzstackField.dll + ${MementoSectionEnd} + ${MementoSection} "Kernel Deint" SecVidFltKernelDeint + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_kernelDeint.dll + ${MementoSectionEnd} + ${MementoSection} "libavcodec Deinterlacers" SecVidFltLavDeinterlacers + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_lavDeint.dll + ${MementoSectionEnd} + ${MementoSection} "Merge Fields" SecVidFltMergeFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_mergeField.dll + ${MementoSectionEnd} + ${MementoSection} "Separate Fields" SecVidFltSeparateFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_separateField.dll + ${MementoSectionEnd} + ${MementoSection} "Stack Fields" SecVidFltStackFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_stackField.dll + ${MementoSectionEnd} + ${MementoSection} "Unstack Fields" SecVidFltUnstackFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_unstackField.dll + ${MementoSectionEnd} + ${MementoSection} "Yadif" SecVidFltYadif + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_yadif.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Colour Filters" SecGrpVideoFilterColour + ${MementoSection} "Avisynth Colour YUV" SecVidFltAvisynthColourYuv + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_colorYuv.dll + ${MementoSectionEnd} + ${MementoSection} "ChromaShift" SecVidFltChromaShift + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_chromaShiftCli.dll + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_chromaShiftQt4.dll + ${MementoSectionEnd} + ${MementoSection} "Contrast" SecVidFltContrast + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_contrastCli.dll + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_contrastQt4.dll + ${MementoSectionEnd} + ${MementoSection} "MPlater Eq2" SecVidFltMplayerEq2 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_eq2Cli.dll + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_eq2Qt4.dll + ${MementoSectionEnd} + ${MementoSection} "MPlater Hue" SecVidFltMplayerHue + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_HueCli.dll + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_HueQt4.dll + ${MementoSectionEnd} + ${MementoSection} "Remove Plane" SecVidFltRemovePlane + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_removePlane.dll + ${MementoSectionEnd} + ${MementoSection} "Swap U and V" SecVidFltSwapUandV + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_swapUV.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Noise Filters" SecGrpVideoFilterNoise + ${MementoSection} "FluxSmooth" SecVidFltFluxSmooth + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_FluxSmooth.dll + ${MementoSectionEnd} + ${MementoSection} "Gaussian Convolution" SecVidFltGauss + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_gauss.dll + ${MementoSectionEnd} + ${MementoSection} "Large Median (5x5)" SecVidFltMediam5x5 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_largeMedian.dll + ${MementoSectionEnd} + ${MementoSection} "Mean Convolution" SecVidFltMean + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_mean.dll + ${MementoSectionEnd} + ${MementoSection} "Median Convolution" SecVidFltMedian + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_median.dll + ${MementoSectionEnd} + ${MementoSection} "MPlayer Denoise 3D" SecVidFltMPlayerDenoise3d + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_denoise3d.dll + ${MementoSectionEnd} + ${MementoSection} "MPlayer Denoise 3D HQ" SecVidFltMPlayerDenoise3dHq + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_denoise3dhq.dll + ${MementoSectionEnd} + ${MementoSection} "MSharpen" SecVidFltMSharpen + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_msharpen.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Sharpness Filters" SecGrpVideoFilterSharpness + ${MementoSection} "asharp" SecVidFltAsharp + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_asharpQt4.dll + ${MementoSectionEnd} + ${MementoSection} "MPlayer Delogo" SecVidFltMPlayerDelogo + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_mpdelogoQt4.dll + ${MementoSectionEnd} + ${MementoSection} "Sharpen" SecVidFltSharpen + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_sharpen.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Subtitle Filters" SecGrpVideoFilterSubtitle + ${MementoSection} "ASS, SSA" SecVidFltAssSsa + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_ssa.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libfribidi-0.dll + ${File} ${ADM_SYSDIR}/libiconv-2.dll + ${File} ${ADM_SYSDIR}/libfreetype-6.dll + ${File} ${ADM_SYSDIR}/libfontconfig-1.dll + ${File} ${ADM_SYSDIR}/libexpat-1.dll + SetOutPath $INSTDIR\etc\fonts + ${Folder} ${ADM_DIR}/etc/fonts + ${MementoSectionEnd} + SectionGroupEnd + #SectionGroup "OpenGL Filters" SecGrpVideoFilterOpenGl + #${MementoSection} "Fragment Shader" SecVidFltOpenGlFragmentShader + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_sampleGlFrag2.dll + #${MementoSectionEnd} + #${MementoSection} "Read Back Benchmark" SecVidFltOpenGlReadBack + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_glBenchmark.dll + #${MementoSectionEnd} + #${MementoSection} "Resize" SecVidFltOpenGlResize + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_glResize.dll + #${MementoSectionEnd} + #${MementoSection} "Rotate" SecVidFltOpenGlRotate + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_rotateGlFrag2.dll + #${MementoSectionEnd} + #${MementoSection} "Wave" SecVidFltOpenGlWave + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_sampleGlVertex.dll + #${MementoSectionEnd} + #SectionGroupEnd + SectionGroup "Miscellaneous Filters" SecGrpVideoFilterMiscellaneous + ${MementoSection} "Print Information" SecVidFltPrintInfo + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_printInfo.dll + ${MementoSectionEnd} + SectionGroupEnd +SectionGroupEnd + +${MementoSection} "-Start menu Change Log" SecStartMenuChangeLog + CreateDirectory $SMPROGRAMS\$StartMenuGroup + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + SetOutPath $INSTDIR + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Change Log ${CORE_VERSION}.lnk" "$INSTDIR\Change Log.html" + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Avidemux job control.lnk" $INSTDIR\avidemux_jobs.exe + !insertmacro MUI_STARTMENU_WRITE_END +${MementoSectionEnd} + + +${MementoSection} "-Start menu Qt" SecStartMenuQt + CreateDirectory $SMPROGRAMS\$StartMenuGroup + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + SetOutPath $INSTDIR + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe + !insertmacro MUI_STARTMENU_WRITE_END +${MementoSectionEnd} + +${MementoSection} "-Start menu AVS Proxy GUI" SecStartMenuAvsProxyGui + CreateDirectory $SMPROGRAMS\$StartMenuGroup + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + SetOutPath $INSTDIR + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\AVS Proxy GUI ${CORE_VERSION}.lnk" "$INSTDIR\avsproxy_gui.exe" + !insertmacro MUI_STARTMENU_WRITE_END +${MementoSectionEnd} + + +${MementoSection} "-Quick Launch Qt" SecQuickLaunchQt + SetOutPath $INSTDIR + CreateShortcut "$QUICKLAUNCH\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe +${MementoSectionEnd} + + +${MementoSection} "-Desktop Qt" SecDesktopQt + SetOutPath $INSTDIR + CreateShortcut "$DESKTOP\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe +${MementoSectionEnd} + +${MementoSectionDone} + +Section -post SecUninstaller + SectionIn 1 2 + WriteRegStr HKLM "${REGKEY}" Path $INSTDIR + WriteRegStr HKLM "${REGKEY}" Version ${PRODUCT_VERSION} + SetOutPath $INSTDIR + WriteUninstaller $INSTDIR\uninstall.exe + WriteRegStr HKLM "${UNINST_REGKEY}" DisplayName "${SHORTCUT_NAME}" + WriteRegStr HKLM "${UNINST_REGKEY}" DisplayVersion "${PRODUCT_VERSION}" + WriteRegStr HKLM "${UNINST_REGKEY}" DisplayIcon $INSTDIR\uninstall.exe + WriteRegStr HKLM "${UNINST_REGKEY}" UninstallString $INSTDIR\uninstall.exe + WriteRegDWORD HKLM "${UNINST_REGKEY}" NoModify 1 + WriteRegDWORD HKLM "${UNINST_REGKEY}" NoRepair 1 +SectionEnd + +Section -CloseLogFile + FileClose $UninstallLogHandle + SetFileAttributes ${UninstallLogPath} HIDDEN +SectionEnd + +Section Uninstall + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup + + + Delete /REBOOTOK "$QUICKLAUNCH\${SHORTCUT_NAME}.lnk" + Delete /REBOOTOK "$DESKTOP\${SHORTCUT_NAME}.lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME}.lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Avidemux job control.lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Change Log ${CORE_VERSION}.lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\AVS Proxy GUI ${CORE_VERSION}.lnk" + RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup + DeleteRegValue HKLM "${REGKEY}" StartMenuGroup + + DeleteRegKey HKLM "${UNINST_REGKEY}" + DeleteRegValue HKLM "${REGKEY}" Path + DeleteRegValue HKLM "${REGKEY}" CreateDesktopIcon + DeleteRegValue HKLM "${REGKEY}" CreateStartMenuGroup + DeleteRegValue HKLM "${REGKEY}" CreateQuickLaunchIcon + DeleteRegKey /IfEmpty HKLM "${REGKEY}" + + FileOpen $UninstallLogHandle "${UninstallLogPath}" r +UninstallLoop: + ClearErrors + FileRead $UninstallLogHandle $R0 + IfErrors UninstallEnd + Push $R0 + Call un.TrimNewLines + Pop $R0 + Delete "$R0" + Goto UninstallLoop +UninstallEnd: + FileClose $UninstallLogHandle + Delete "${UninstallLogPath}" + Delete "$INSTDIR\uninstall.exe" + Push "\" + Call un.RemoveEmptyDirs + RMDir "$INSTDIR" +SectionEnd + +########################## +# Installer functions +########################## +Function .onInit +UAC_Elevate: + !insertmacro UAC_RunElevated + StrCmp 1223 $0 UAC_ElevationAborted + StrCmp 0 $0 0 UAC_Err + StrCmp 1 $1 0 UAC_Success + Quit + +UAC_Err: + MessageBox MB_ICONSTOP "Unable to elevate, error $0" + Abort + +UAC_ElevationAborted: + Abort + +UAC_Success: + StrCmp 1 $3 +4 + StrCmp 3 $1 0 UAC_ElevationAborted + MessageBox MB_ICONSTOP "This installer requires admin access." + Goto UAC_Elevate + + Call LoadPreviousSettings + ReadRegStr $PreviousVersion HKLM "${REGKEY}" Version + + ${If} $PreviousVersion != "" + ${VersionCompare} ${PRODUCT_VERSION} $PreviousVersion $PreviousVersionState + ${EndIf} + + InitPluginsDir + SetShellVarContext all +FunctionEnd + +Function .onInstSuccess + ${MementoSectionSave} +FunctionEnd + +Function LoadPreviousSettings + ${MementoSectionRestore} + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup + + ReadRegStr $CreateStartMenuGroup HKLM "${REGKEY}" CreateStartMenuGroup + + ${If} $CreateStartMenuGroup == "" + StrCpy $CreateStartMenuGroup 1 + ${EndIf} + + ReadRegStr $CreateDesktopIcon HKLM "${REGKEY}" CreateDesktopIcon + + ${If} $CreateDesktopIcon == "" + StrCpy $CreateDesktopIcon 1 + ${EndIf} + + ${If} ${AtMostWinVista} + ReadRegStr $CreateQuickLaunchIcon HKLM "${REGKEY}" CreateQuickLaunchIcon + + ${If} $CreateQuickLaunchIcon == "" + StrCpy $CreateQuickLaunchIcon 1 + ${EndIf} + ${EndIf} + +FunctionEnd + +Function RunUninstaller + ReadRegStr $R1 HKLM "${UNINST_REGKEY}" "UninstallString" + + ${If} $R1 == "" + Return + ${EndIf} + + ;Run uninstaller + HideWindow + ClearErrors + + ${If} $PreviousVersionState == 0 + ${AndIf} $ReinstallUninstall == 1 + ExecWait '$R1 _?=$INSTDIR' + ${Else} + ExecWait '$R1 /frominstall _?=$INSTDIR' + ${EndIf} + + IfErrors NoRemoveUninstaller + IfFileExists "$INSTDIR\uninstall.exe" 0 NoRemoveUninstaller + Delete "$R1" + RMDir $INSTDIR + +NoRemoveUninstaller: +FunctionEnd + +Function CheckSelectedUIs + !insertmacro SectionFlagIsSet ${SecGrpUI} ${SF_SELECTED} end checkPartial +checkPartial: + !insertmacro SectionFlagIsSet ${SecGrpUI} ${SF_PSELECTED} end displayError +displayError: + MessageBox MB_OK|MB_ICONSTOP "At least one User Interface must be selected." + Abort +end: +FunctionEnd + +LangString INSTALL_OPTS_PAGE_TITLE ${LANG_ENGLISH} "Choose Install Options" +LangString INSTALL_OPTS_PAGE_SUBTITLE ${LANG_ENGLISH} "Choose where to install Avidemux icons." +Var dlgInstallOptions +Var lblCreateIcons +Var chkDesktop +Var chkStartMenu +Var chkQuickLaunch + +Function InstallOptionsPage + Call IsInstallOptionsRequired + !insertmacro MUI_HEADER_TEXT "$(INSTALL_OPTS_PAGE_TITLE)" "$(INSTALL_OPTS_PAGE_SUBTITLE)" + + nsDialogs::Create 1018 + Pop $dlgInstallOptions + + ${If} $dlgInstallOptions == error + Abort + ${EndIf} + + ${NSD_CreateLabel} 0 0u 100% 12u "Create icons for Avidemux:" + Pop $lblCreateIcons + + ${NSD_CreateCheckBox} 0 18u 100% 12u "On my &Desktop" + Pop $chkDesktop + ${NSD_SetState} $chkDesktop $CreateDesktopIcon + ${NSD_OnClick} $chkDesktop UpdateInstallOptions + + ${NSD_CreateCheckBox} 0 36u 100% 12u "In my &Start Menu Programs folder" + Pop $chkStartMenu + ${NSD_SetState} $chkStartMenu $CreateStartMenuGroup + ${NSD_OnClick} $chkStartMenu UpdateInstallOptions + + ${If} ${AtMostWinVista} + ${NSD_CreateCheckBox} 0 54u 100% 12u "In my &Quick Launch bar" + Pop $chkQuickLaunch + ${NSD_SetState} $chkQuickLaunch $CreateQuickLaunchIcon + ${NSD_OnClick} $chkQuickLaunch UpdateInstallOptions + ${EndIf} + #${If} ${IsWin2003} + #WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\avidemux.exe" "WIN2000" + #${EndIf} + #${If} ${IsWinXp} + #WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\avidemux.exe" "WIN2000" + #${EndIf} + nsDialogs::Show +FunctionEnd + +Function UpdateInstallOptions + ${NSD_GetState} $chkDesktop $CreateDesktopIcon + ${NSD_GetState} $chkStartMenu $CreateStartMenuGroup + ${NSD_GetState} $chkQuickLaunch $CreateQuickLaunchIcon +FunctionEnd + +Function IsInstallOptionsRequired +Goto end + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} end resetOptions +resetOptions: + + StrCpy $CreateDesktopIcon 0 + StrCpy $CreateStartMenuGroup 0 + StrCpy $CreateQuickLaunchIcon 0 + Abort + +end: +FunctionEnd + +Function IsStartMenuRequired + StrCmp $CreateStartMenuGroup 1 +2 + Abort +FunctionEnd + +Function ActivateInternalSections + #AVS Proxy GUI shortcut: + SectionGetFlags ${SecAvsProxy} $0 + IntOp $0 $0 & ${SF_SELECTED} + IntOp $0 $0 & $CreateStartMenuGroup + SectionSetFlags ${SecStartMenuAvsProxyGui} $0 + + #Change Log shortcut: + SectionSetFlags ${SecStartMenuChangeLog} $CreateStartMenuGroup + + #Qt shortcuts: + SectionGetFlags ${SecUiQt} $0 + IntOp $0 $0 & ${SF_SELECTED} + + IntOp $1 $0 & $CreateDesktopIcon + SectionSetFlags ${SecDesktopQt} $1 + + IntOp $1 $0 & $CreateQuickLaunchIcon + SectionSetFlags ${SecQuickLaunchQt} $1 + + IntOp $1 $0 & $CreateStartMenuGroup + SectionSetFlags ${SecStartMenuQt} $1 +FunctionEnd + +Function InstFilesPageShow + ${If} $ReinstallUninstall != "" + Call RunUninstaller + BringToFront + ${EndIf} +FunctionEnd + +Function InstFilesPageLeave + ; Don't advance automatically if details expanded + FindWindow $R0 "#32770" "" $HWNDPARENT + GetDlgItem $R0 $R0 1016 + System::Call user32::IsWindowVisible(i$R0)i.s + Pop $R0 + + StrCmp $R0 0 +2 + SetAutoClose false +FunctionEnd + +Function ConfigureFinishPage + + SectionGetFlags ${SecUiQt} $0 + IntOp $0 $0 & ${SF_SELECTED} + StrCmp $0 ${SF_SELECTED} end + + DeleteINISec "$PLUGINSDIR\ioSpecial.ini" "Field 4" + +end: +FunctionEnd + +Function RunAvidemux + SetOutPath $INSTDIR + + SectionGetFlags ${SecUiQt} $0 + IntOp $0 $0 & ${SF_SELECTED} + + !insertmacro UAC_AsUser_ExecShell "" "$INSTDIR\avidemux.exe" "" "" "" + + Goto end + + +end: +FunctionEnd + +Var ReinstallUninstallButton + +Function ReinstallPage + ${If} $PreviousVersion == "" + Abort + ${EndIf} + + nsDialogs::Create /NOUNLOAD 1018 + Pop $0 + + ${If} $PreviousVersionState == 1 + !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_FULLNAME}." + nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "An older version of Avidemux is installed on your system. Select the operation you want to perform and click Next to continue." + Pop $R0 + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Upgrade Avidemux using previous settings (recommended)" + Pop $ReinstallUninstallButton + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Change settings (advanced)" + Pop $R0 + + ${If} $ReinstallUninstall == "" + StrCpy $ReinstallUninstall 1 + ${EndIf} + ${ElseIf} $PreviousVersionState == 2 + !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_FULLNAME}." + nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "A newer version of Avidemux is already installed! It is not recommended that you downgrade to an older version. Select the operation you want to perform and click Next to continue." + Pop $R0 + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Downgrade Avidemux using previous settings (recommended)" + Pop $ReinstallUninstallButton + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Change settings (advanced)" + Pop $R0 + + ${If} $ReinstallUninstall == "" + StrCpy $ReinstallUninstall 1 + ${EndIf} + ${ElseIf} $PreviousVersionState == 0 + !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform." + nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "${PRODUCT_FULLNAME} is already installed. Select the operation you want to perform and click Next to continue." + Pop $R0 + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Add/Remove/Reinstall components" + Pop $R0 + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Uninstall Avidemux" + Pop $ReinstallUninstallButton + + ${If} $ReinstallUninstall == "" + StrCpy $ReinstallUninstall 2 + ${EndIf} + ${Else} + MessageBox MB_ICONSTOP "Unknown value of PreviousVersionState, aborting" /SD IDOK + Abort + ${EndIf} + + ${If} $ReinstallUninstall == "1" + SendMessage $ReinstallUninstallButton ${BM_SETCHECK} 1 0 + ${Else} + SendMessage $R0 ${BM_SETCHECK} 1 0 + ${EndIf} + + nsDialogs::Show +FunctionEnd + +Function ReinstallPageLeave + SendMessage $ReinstallUninstallButton ${BM_GETCHECK} 0 0 $R0 + + ${If} $R0 == 1 + ; Option to uninstall old version selected + StrCpy $ReinstallUninstall 1 + ${Else} + ; Custom up/downgrade or add/remove/reinstall + StrCpy $ReinstallUninstall 2 + ${EndIf} + + ${If} $ReinstallUninstall == 1 + ${If} $PreviousVersionState == 0 + Call RunUninstaller + Quit + ${Else} + ; Need to reload defaults. User could have + ; chosen custom, change something, went back and selected + ; the express option. + Call LoadPreviousSettings + ${EndIf} + ${EndIf} +FunctionEnd + + +########################## +# Uninstaller functions +########################## +Function un.onInit + SetShellVarContext all + +UAC_Elevate: + !insertmacro UAC_RunElevated + StrCmp 1223 $0 UAC_ElevationAborted + StrCmp 0 $0 0 UAC_Err + StrCmp 1 $1 0 UAC_Success + Quit + +UAC_Err: + MessageBox MB_ICONSTOP "Unable to elevate, error $0" + Abort + +UAC_ElevationAborted: + Abort + +UAC_Success: + StrCmp 1 $3 +4 + StrCmp 3 $1 0 UAC_ElevationAborted + MessageBox MB_ICONSTOP "This installer requires admin access." + Goto UAC_Elevate +FunctionEnd + +; TrimNewlines (copied from NSIS documentation) +; input, top of stack (e.g. whatever$/r$/n) +; output, top of stack (replaces, with e.g. whatever) +; modifies no other variables. +Function un.TrimNewlines + Exch $R0 + Push $R1 + Push $R2 + StrCpy $R1 0 + +loop: + IntOp $R1 $R1 - 1 + StrCpy $R2 $R0 1 $R1 + StrCmp $R2 "$\r" loop + StrCmp $R2 "$\n" loop + IntOp $R1 $R1 + 1 + IntCmp $R1 0 no_trim_needed + StrCpy $R0 $R0 $R1 + +no_trim_needed: + Pop $R2 + Pop $R1 + Exch $R0 +FunctionEnd + +Function un.RemoveEmptyDirs + Pop $9 + !define Index 'Line${__LINE__}' + FindFirst $0 $1 "$INSTDIR$9*" + StrCmp $0 "" "${Index}-End" +"${Index}-Loop:" + StrCmp $1 "" "${Index}-End" + StrCmp $1 "." "${Index}-Next" + StrCmp $1 ".." "${Index}-Next" + Push $0 + Push $1 + Push $9 + Push "$9$1\" + Call un.RemoveEmptyDirs + Pop $9 + Pop $1 + Pop $0 +;"${Index}-Remove:" + RMDir "$INSTDIR$9$1" +"${Index}-Next:" + FindNext $0 $1 + Goto "${Index}-Loop" +"${Index}-End:" + FindClose $0 + !undef Index +FunctionEnd + +Function un.ConfirmPagePre + ${un.GetParameters} $R0 + ${un.GetOptions} $R0 "/frominstall" $R1 + ${Unless} ${Errors} + Abort + ${EndUnless} +FunctionEnd + +Function un.FinishPagePre + ${un.GetParameters} $R0 + ${un.GetOptions} $R0 "/frominstall" $R1 + ${Unless} ${Errors} + SetRebootFlag false + Abort + ${EndUnless} +FunctionEnd diff --git a/avidemux/winInstaller/old/avidemux_cross64.nsi b/avidemux/winInstaller/old/avidemux_cross64.nsi index 5c1d754533..28ad2e3520 100644 --- a/avidemux/winInstaller/old/avidemux_cross64.nsi +++ b/avidemux/winInstaller/old/avidemux_cross64.nsi @@ -1,1593 +1,1593 @@ -########################## -# Included files -########################## -!addincludedir ${NSIDIR} -!addplugindir ${NSIDIR}/plugin - -!include Sections.nsh -!include MUI2.nsh -!include nsDialogs.nsh -!include Memento.nsh -!include FileFunc.nsh -!include UAC.nsh -!include WinVer.nsh -!include WordFunc.nsh -#!include revision.nsh - -SetCompressor /SOLID lzma -SetCompressorDictSize 96 -RequestExecutionLevel user - -########################## -# Defines -########################## -!define BUILD_BITS 64 -!define QT_DIR /mingw/Qt/current/bin/ -!define ADM_SYSDIR /mingw/bin -!define ADM_DIR /mingw/Release -#!define NSIDIR "/home/fx/hudson/workspace/mingw_2.6.2_nsis/avidemux/winInstaller" -#!define SVN_VERSION 6 -!define REVISION ${SVN_VERSION} -!define EXEDIR "${NSIDIR}/install" - -!define CORE_VERSION "2.6" -!define POINT_RELEASE "8" -!define PRODUCT_VERSION "${CORE_VERSION}.${POINT_RELEASE}.${SVN_VERSION}" -!define PRODUCT_NAME "Avidemux ${CORE_VERSION} - 64bits" -!define PRODUCT_FULLNAME "Avidemux ${PRODUCT_VERSION} (${BUILD_BITS}-bit Release)" - -!if ${BUILD_BITS} == 64 - !define SHORTCUT_NAME "${PRODUCT_NAME}" - !define REG_GROUPNAME "${PRODUCT_NAME} (${BUILD_BITS}-bit)" -!else - !define SHORTCUT_NAME "${PRODUCT_NAME} (${BUILD_BITS}-bit)" - !define REG_GROUPNAME "${PRODUCT_NAME}" -!endif - -!define REGKEY "SOFTWARE\${REG_GROUPNAME}" -!define UNINST_REGKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_GROUPNAME}" -!define COMPANY "Free Software Foundation" -!define URL "http://www.avidemux.org" - -OutFile "${EXEDIR}/avidemux_${CORE_VERSION}.${POINT_RELEASE}_r${REVISION}_win${BUILD_BITS}.exe" -Name "${PRODUCT_FULLNAME}" - -########################## -# Memento defines -########################## -!define MEMENTO_REGISTRY_ROOT HKLM -!define MEMENTO_REGISTRY_KEY "${REGKEY}" - -########################## -# MUI defines -########################## -!define MUI_ICON "${NSIDIR}/../common/xpm/adm.ico" -!define MUI_HEADERIMAGE -!define MUI_HEADERIMAGE_RIGHT -!define MUI_HEADERIMAGE_BITMAP "${NSIDIR}/PageHeader.bmp" -!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM -!define MUI_STARTMENUPAGE_REGISTRY_KEY "${REGKEY}" -!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup -!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Avidemux (64bits)" -!define MUI_STARTMENUPAGE_NODISABLE -!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSIDIR}/WelcomeFinishStrip.bmp" -!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSIDIR}/WelcomeFinishStrip.bmp" -!define MUI_UNICON "${NSIDIR}/../common/xpm/adm.ico" -!define MUI_COMPONENTSPAGE_NODESC - -########################## -# Variables -########################## -Var CreateDesktopIcon -Var CreateStartMenuGroup -Var CreateQuickLaunchIcon -Var StartMenuGroup -Var PreviousVersion -Var PreviousVersionState -Var ReinstallUninstall - -########################## -# Installer pages -########################## -!define MUI_WELCOMEPAGE_TITLE "${PRODUCT_FULLNAME} Setup Wizard" -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "${NSIDIR}/License.rtf" - Page custom ReinstallPage ReinstallPageLeave -!insertmacro MUI_PAGE_COMPONENTS -Page custom InstallOptionsPage -!define MUI_PAGE_CUSTOMFUNCTION_PRE IsStartMenuRequired -!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup -!insertmacro MUI_PAGE_DIRECTORY -!define MUI_PAGE_CUSTOMFUNCTION_PRE ActivateInternalSections -!define MUI_PAGE_CUSTOMFUNCTION_SHOW InstFilesPageShow -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE InstFilesPageLeave -!insertmacro MUI_PAGE_INSTFILES -!define MUI_FINISHPAGE_RUN -!define MUI_FINISHPAGE_RUN_FUNCTION RunAvidemux -!define MUI_FINISHPAGE_RUN_TEXT "Run ${PRODUCT_NAME} now" -!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR/Change Log.html" -!define MUI_FINISHPAGE_SHOWREADME_TEXT "View Change Log now" -!define MUI_FINISHPAGE_LINK "Visit the Avidemux website" -!define MUI_FINISHPAGE_LINK_LOCATION "http://www.avidemux.org" -!define MUI_PAGE_CUSTOMFUNCTION_PRE ConfigureFinishPage -!insertmacro MUI_PAGE_FINISH - -!define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES -!define MUI_PAGE_CUSTOMFUNCTION_PRE un.FinishPagePre -!insertmacro MUI_UNPAGE_FINISH - -########################## -# Installer languages -########################## -!insertmacro MUI_LANGUAGE English - -########################## -# Installer attributes -########################## -!if ${BUILD_BITS} == 64 - InstallDir "$PROGRAMFILES64\${PRODUCT_NAME}" -!else - InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" -!endif - -CRCCheck on -XPStyle on -ShowInstDetails nevershow -ShowUninstDetails nevershow -VIProductVersion ${PRODUCT_VERSION} -VIAddVersionKey ProductName Avidemux -VIAddVersionKey ProductVersion "${PRODUCT_VERSION}" -VIAddVersionKey FileVersion "" -VIAddVersionKey FileDescription "" -VIAddVersionKey LegalCopyright "" -InstallDirRegKey HKLM "${REGKEY}" Path -BrandingText "Packaged by Gruntster" -InstType Standard -InstType Full -######################################### -# -######################################### -Function GetAfterChar - Exch $0 ; chop char - Exch - Exch $1 ; input string - Push $2 - Push $3 - StrCpy $2 0 - loop: - IntOp $2 $2 - 1 - StrCpy $3 $1 1 $2 - StrCmp $3 "" 0 +3 - StrCpy $0 "" - Goto exit2 - StrCmp $3 $0 exit1 - Goto loop - exit1: - IntOp $2 $2 + 1 - StrCpy $0 $1 "" $2 - exit2: - Pop $3 - Pop $2 - Pop $1 - Exch $0 ; output -FunctionEnd -#####################################################################  -!define StrReplace '!insertmacro "_Name"' - -########################## -# Uninstaller macros -########################## -!insertmacro un.GetOptions -!insertmacro un.GetParameters - -!define UninstallLogPath "$INSTDIR\uninstall.log" -Var UninstallLogHandle - -; Uninstall log file missing. -LangString UninstallLogMissing ${LANG_ENGLISH} "uninstall.log not found!$\r$\nUninstallation cannot proceed!" -# Regexep Does not work with cross -# Use only one file at a time -!macro InstallFile FILEZ - File "${FILEZ}" - Push "${FILEZ}" - Push "/" - Call GetAfterChar - Pop $R0 - FileWrite $UninstallLogHandle "$OUTDIR\$R0$\r$\n" -!macroend -!define File "!insertmacro InstallFile" - -!macro InstallFolder FILEREGEX - File /r "${FILEREGEX}/*" - Push "$OUTDIR" - Call InstallFolderInternal -!macroend -!define Folder "!insertmacro InstallFolder" - -Function InstallFolderInternal - Pop $9 - !define Index 'Line${__LINE__}' - FindFirst $0 $1 "$9/*" - StrCmp $0 "" "${Index}-End" -"${Index}-Loop:" - StrCmp $1 "" "${Index}-End" - StrCmp $1 "." "${Index}-Next" - StrCmp $1 ".." "${Index}-Next" - IfFileExists "$9\$1\*" 0 "${Index}-Write" - Push $0 - Push $9 - Push "$9\$1" - Call InstallFolderInternal - Pop $9 - Pop $0 - Goto "${Index}-Next" -"${Index}-Write:" - FileWrite $UninstallLogHandle "$9\$1$\r$\n" -"${Index}-Next:" - FindNext $0 $1 - Goto "${Index}-Loop" -"${Index}-End:" - !undef Index -FunctionEnd - -; WriteUninstaller macro -!macro WriteUninstaller Path - WriteUninstaller "${Path}" - FileWrite $UninstallLogHandle "${Path}$\r$\n" -!macroend -!define WriteUninstaller "!insertmacro WriteUninstaller" - -########################## -# Macros -########################## - -!macro InstallQtLanguage LANG_NAME LANG_CODE - SetOverwrite on - - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} installQt${LANG_CODE} endQt${LANG_CODE} - -installQt${LANG_CODE}: - SetOutPath $INSTDIR\i18n - ${File} i18n/avidemux_${LANG_CODE}.qm - ${File} i18n/qt_${LANG_CODE}.qm - -endQt${LANG_CODE}: -!macroend - -########################## -# Installer sections -########################## -Section -OpenLogFile - CreateDirectory "$INSTDIR" - FileOpen $UninstallLogHandle ${UninstallLogPath} a - FileSeek $UninstallLogHandle 0 END -SectionEnd - -Section "Avidemux Core" SecCore - SectionIn 1 2 RO - SetOutPath $INSTDIR - SetOverwrite on - ${File} "./Build Info.txt" - ${File} "./Change Log.html" - ${File} ${ADM_SYSDIR}/libexpat-1.dll - #${File} ${ADM_SYSDIR}/mgwz.dll - ${File} ${ADM_SYSDIR}/libfreetype-6.dll - ${File} ${ADM_SYSDIR}/libsqlite3-0.dll - ${File} ${ADM_SYSDIR}/libstdc++-6.dll - ${File} ${ADM_SYSDIR}/libgcc_s_seh-1.dll - ${File} ${ADM_SYSDIR}/libwinpthread-1.dll - ${File} ${ADM_SYSDIR}/libpng16-16.dll - ${File} ${ADM_SYSDIR}/SDL.dll - ${File} ${ADM_SYSDIR}/libz.dll - ${File} ${ADM_SYSDIR}/libz.dll.1.2.8 - ${File} ${ADM_DIR}/libADM_audioParser6.dll - ${File} ${ADM_DIR}/libADM_core6.dll - ${File} ${ADM_DIR}/libADM_coreAudio6.dll - ${File} ${ADM_DIR}/libADM_coreAudioDevice6.dll - ${File} ${ADM_DIR}/libADM_coreAudioEncoder6.dll - ${File} ${ADM_DIR}/libADM_coreAudioFilterAPI6.dll - ${File} ${ADM_DIR}/libADM_coreDemuxer6.dll - ${File} ${ADM_DIR}/libADM_coreDemuxerMpeg6.dll - ${File} ${ADM_DIR}/libADM_coreImage6.dll - ${File} ${ADM_DIR}/libADM_coreImageLoader6.dll - ${File} ${ADM_DIR}/libADM_coreJobs.dll - ${File} ${ADM_DIR}/libADM_coreMuxer6.dll - ${File} ${ADM_DIR}/libADM_coreScript.dll - ${File} ${ADM_DIR}/libADM_coreSocket6.dll - ${File} ${ADM_DIR}/libADM_coreSqlLight3.dll - ${File} ${ADM_DIR}/libADM_coreUI6.dll - ${File} ${ADM_DIR}/libADM_coreUtils6.dll - ${File} ${ADM_DIR}/libADM_coreVideoCodec6.dll - ${File} ${ADM_DIR}/libADM_coreVideoEncoder6.dll - ${File} ${ADM_DIR}/libADM_coreVideoFilter6.dll - ${File} ${ADM_DIR}/libADM_coreSubtitle.dll - ${File} ${QT_DIR}/QtCore4.dll - ${File} ${QT_DIR}/QtGui4.dll - ${File} ${NSIDIR}/../../AUTHORS. - ${File} ${NSIDIR}/../../COPYING. - ${File} ${NSIDIR}/../../README. - ${File} ${ADM_DIR}/avcodec-*.dll - ${File} ${ADM_DIR}/avformat-*.dll - ${File} ${ADM_DIR}/avutil-*.dll - ${File} ${ADM_DIR}/postproc-*.dll - ${File} ${ADM_DIR}/swscale-*.dll - - WriteRegStr HKLM "${REGKEY}" CreateDesktopIcon $CreateDesktopIcon - WriteRegStr HKLM "${REGKEY}" CreateStartMenuGroup $CreateStartMenuGroup - - ${If} ${AtMostWinVista} - WriteRegStr HKLM "${REGKEY}" CreateQuickLaunchIcon $CreateQuickLaunchIcon - ${EndIf} -SectionEnd - -SectionGroup /e "User interfaces" SecGrpUI - ${MementoUnselectedSection} "Command Line" SecUiCli - SectionIn 2 - SetOutPath $INSTDIR - SetOverwrite on - ${File} ${ADM_DIR}/avidemux_cli.exe - ${File} ${ADM_DIR}/libADM_render6_cli.dll - ${File} ${ADM_DIR}/libADM_UI_Cli6.dll - ${MementoSectionEnd} - - ${MementoSection} Qt SecUiQt - SectionIn 1 2 RO - SetOutPath $INSTDIR - SetOverwrite on - ${File} ${ADM_DIR}/avidemux.exe - ${File} ${ADM_DIR}/avidemux_jobs.exe - ${File} ${ADM_DIR}/libADM_render6_QT4.dll - ${File} ${ADM_DIR}/libADM_UIQT46.dll - ${File} ${QT_DIR}/QtOpenGL4.dll - #${File} ${QT_DIR}/libgcc_s_dw2-1.dll - #${File} ${QT_DIR}/mingwm10.dll - ${MementoSectionEnd} -SectionGroupEnd - -SectionGroup "Audio Decoders" SecGrpAudioDecoder - ${MementoSection} "µ-law" SecAudDecUlaw - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_ulaw.dll - ${MementoSectionEnd} - ${MementoSection} "AAC (FAAD)" SecAudDecFaad - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_faad.dll - #SetOutPath $INSTDIR - #${File} ${ADM_SYSDIR}/libfaad2.dll - ${MementoSectionEnd} - ${MementoSection} "AAC, AC-3, ADPCM IMA AMV, DTS, E-AC-3, MP2, MP3, Nellymoser, QDesign, WMA (libavcodec)" SecAudDecAvcodec - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_lav.dll - ${MementoSectionEnd} - ${MementoSection} "AC-3 (liba52)" SecAudDecA52 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_a52.dll - ${MementoSectionEnd} - ${MementoSection} "ADPCM IMA" SecAudDecImaAdpcm - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_ima_adpcm.dll - ${MementoSectionEnd} - ${MementoSection} "ADPCM Microsoft" SecAudDecMsAdpcm - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_ms_adpcm.dll - ${MementoSectionEnd} - ${MementoSection} "AMR-NB" SecAudDecOpencoreAmrNb - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_opencore_amrnb.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libopencore-amrnb-*.dll - ${MementoSectionEnd} - ${MementoSection} "AMR-WB" SecAudDecOpencoreAmrWb - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_opencore_amrwb.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libopencore-amrwb-*.dll - ${MementoSectionEnd} - ${MementoSection} "MP2, MP3 (MAD)" SecAudDecMad - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_Mad.dll - ${MementoSectionEnd} - ${MementoSection} "Vorbis" SecAudDecVorbis - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDecoder - ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_vorbis.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libogg-0.dll - ${File} ${ADM_SYSDIR}/libvorbis-0.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Audio Devices" SecGrpAudioDevice - ${MementoSection} "Waveform" SecAudDevWaveform - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioDevices - ${File} ${ADM_DIR}/plugins/audioDevices/libADM_av_win32.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Audio Encoders" SecGrpAudioEncoder - ${MementoSection} "AAC (FAAC)" SecAudEncFaac - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_faac.dll - #SetOutPath $INSTDIR - #${File} ${ADM_SYSDIR}libfaac.dll - ${MementoSectionEnd} - ${MementoSection} "AAC (libavcodec)" SecAudEncLavAac - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lav_aac.dll - ${MementoSectionEnd} - ${MementoSection} "AC-3 (Aften)" SecAudDecAften - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_aften.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libaften.dll - ${MementoSectionEnd} - ${MementoSection} "AC-3 (libavcodec)" SecAudEncLavAc3 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lav_ac3.dll - ${MementoSectionEnd} - #${MementoSection} "DTS (dcaenc)" SecAudDecDcaEnc - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\audioEncoders - #${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_dcaenc.dll - #SetOutPath $INSTDIR - #${File} libdcaenc-0.dll - #${MementoSectionEnd} - ${MementoSection} "MP2 (libavcodec)" SecAudEncLavMp2 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lav_mp2.dll - SetOutPath $INSTDIR - #${File} ${ADM_SYSDIR}/libtwolame-*.dll - ${MementoSectionEnd} - #${MementoSection} "MP2 (TwoLAME)" SecAudEncTwoLame - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\audioEncoders - #${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_twolame.dll - #${MementoSectionEnd} - ${MementoSection} "MP3" SecAudEncLame - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lame.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libmp3lame-0.dll - ${MementoSectionEnd} - ${MementoSection} "PCM" SecAudEncPcm - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_pcm.dll - ${MementoSectionEnd} - ${MementoSection} "Vorbis" SecAudEncVorbis - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\audioEncoders - ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_vorbis.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libogg-0.dll - ${File} ${ADM_SYSDIR}/libvorbis-0.dll - ${File} ${ADM_SYSDIR}/libvorbisenc-2.dll - ${File} ${ADM_SYSDIR}/libvorbisfile-3.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Avisynth" SecGrpAvisynth - ${MementoUnselectedSection} "Avisynth Proxy" SecAvsProxy - SectionIn 2 - SetOutPath $INSTDIR - SetOverwrite on - ${File} ${ADM_SYSDIR}/avsproxy.exe - ${File} ${ADM_SYSDIR}/avsproxy_gui.exe - ${MementoSectionEnd} - ${MementoUnselectedSection} "Avisynth Proxy Demuxer" SecDemuxAvisynth - SectionIn 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_avsproxy.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Demuxers" SecGrpDemuxers - ${MementoSection} "ASF" SecDemuxAsf - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_asf.dll - ${MementoSectionEnd} - ${MementoSection} "BMP, JPEG, PNG Images" SecDemuxImage - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_pic.dll - ${MementoSectionEnd} - ${MementoSection} "Flash Video" SecDemuxFlv - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_flv.dll - ${MementoSectionEnd} - ${MementoSection} "Matroska" SecDemuxMatroska - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_matroska.dll - ${MementoSectionEnd} - ${MementoSection} "MP4" SecDemuxMp4 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_mp4.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-PS" SecDemuxMpegPs - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_ps.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-TS" SecDemuxMpegTs - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_ts.dll - ${MementoSectionEnd} - ${MementoSection} "MXF" SecDemuxMxf - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_mxf.dll - ${MementoSectionEnd} - ${MementoSection} "OpenDML AVI" SecDemuxOpenDml - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\demuxers - ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_opendml.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Muxers" SecGrpMuxers - ${MementoSection} "Dummy [Raw Audio/Video]" SecMuxDummy - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_dummy.dll - ${MementoSectionEnd} - ${MementoSection} "Flash Video" SecMuxLavFlv - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_flv.dll - ${MementoSectionEnd} - ${MementoSection} "Matroska" SecMuxLavMatroska - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_Mkv.dll - ${MementoSectionEnd} - ${MementoSection} "MP4 (libavcodec)" SecMuxLavMp4 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_mp4.dll - ${MementoSectionEnd} - ${MementoSection} "MP4 (MP4v2)" SecMuxMp4v2 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_mp4v2.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-PS" SecMuxLavMpegPs - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_ffPS.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-TS" SecMuxLavMpegTs - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_ffTS.dll - ${MementoSectionEnd} - ${MementoSection} "OpenDML AVI" SecMuxOpenDml - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_avi.dll - ${MementoSectionEnd} - ${MementoSection} "Raw Video" SecMuxRaw - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\muxers - ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_raw.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Script Engines" SecGrpScriptEngine - #${MementoSection} "QtScript" SecScriptQt - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR - #${File} ${QT_DIR}/QtScript4.dll - #${File} ${QT_DIR}/QtScriptTools4.dll - #SetOutPath $INSTDIR\plugins\scriptEngines - #${File} ${ADM_DIR}/plugins/scriptEngines/libADM_script_qt.dll - #SetOutPath $INSTDIR\help\QtScript - #${Folder} help/QtScript - #${MementoSectionEnd} - ${MementoSection} "Tinypy" SecScriptTinypy - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\scriptEngines - ${File} ${ADM_DIR}/plugins/scriptEngines/libADM_script_tinyPy.dll - SetOutPath $INSTDIR\plugins\autoScripts - ${Folder} ${ADM_DIR}/plugins/autoScripts - ${MementoSectionEnd} -SectionGroupEnd -#SectionGroup "Video Decoders" SecGrpVideoDecoder - #${MementoSection} "VP8" SecVidDecVpx - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoDecoders - #${File} ${ADM_DIR}/plugins/videoDecoders/libADM_vd_vpx.dll - #${MementoSectionEnd} -#SectionGroupEnd -SectionGroup "Video Encoders" SecGrpVideoEncoder - ${MementoSection} "[Null]" SecVidEncNull - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_null.dll - ${MementoSectionEnd} - ${MementoSection} "Huffyuv, FFVHuff" SecVidEncLavHuffyuv - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_huff.dll - ${MementoSectionEnd} - ${MementoSection} "JPEG" SecVidEncLavJpeg - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_jpeg.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-2" SecVidEncLavMpeg2 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_ffMpeg2.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-4 ASP (libavcodec)" SecVidEncLavMpeg4asp - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_ffMpeg4.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-4 ASP (Xvid)" SecVidEncXvid - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_xvid4.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/xvidcore.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-4 AVC" SecVidEncX264 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_x264_other.dll - - SetOutPath $INSTDIR\plugins\videoEncoders\qt4 - ${File} ${ADM_DIR}/plugins/videoEncoders/qt4/libADM_ve_x264_QT4.dll - - SetOutPath $INSTDIR\plugins\pluginSettings\x264 - ${Folder} ${ADM_DIR}/plugins/pluginSettings/x264 - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libx264-*.dll - #${File} ${ADM_SYSDIR}/pthreadGC2-w64.dll - ${MementoSectionEnd} - ${MementoSection} "MPEG-4 HEC" SecVidEncX265 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_x265_other.dll - - SetOutPath $INSTDIR\plugins\videoEncoders\qt4 - ${File} ${ADM_DIR}/plugins/videoEncoders/qt4/libADM_ve_x265_QT4.dll - - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libx265*.dll - #${File} ${ADM_SYSDIR}/pthreadGC2-w64.dll - ${MementoSectionEnd} -${MementoSection} "PNG" SecVidEncLavPng - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_png.dll - ${MementoSectionEnd} - ${MementoSection} "Sorenson Spark" SecVidEncSorenson - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_ffFlv1.dll - ${MementoSectionEnd} - ${MementoSection} "YV12" SecVidEncYv12 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoEncoders - ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_yv12.dll - ${MementoSectionEnd} -SectionGroupEnd -SectionGroup "Video Filters" SecGrpVideoFilter - SectionGroup "Transform Filters" SecGrpVideoFilterTransform - ${MementoSection} "Add Black Borders" SecVidFltBlackBorders - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_addBorders.dll - ${MementoSectionEnd} - ${MementoSection} "Add Logo" SecVidFltLogo - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_logo.dll - ${MementoSectionEnd} - ${MementoSection} "Blacken Borders" SecVidFltBlackenBorders - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_blackenBorders.dll - ${MementoSectionEnd} - ${MementoSection} "Change FPS" SecVidFltChangeFps - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_changeFps.dll - ${MementoSectionEnd} - ${MementoSection} "Crop" SecVidFltCrop - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_CropCli.dll - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_cropQT4.dll - ${MementoSectionEnd} - ${MementoSection} "Fade" SecVidFltFade - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_fadeToBlack.dll - ${MementoSectionEnd} - ${MementoSection} "Greyscale" SecVidFltLumaOnly - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_lumaOnly.dll - ${MementoSectionEnd} - ${MementoSection} "Horizontal Flip" SecVidFltHorizontalFlip - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_hf_hflip.dll - ${MementoSectionEnd} - ${MementoSection} "libswscale Resize" SecVidFltSwscaleResize - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_swscaleResize_cli.dll - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_swscaleResizeQT4.dll - ${MementoSectionEnd} - ${MementoSection} "Resample FPS" SecVidFltResampleFps - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_resampleFps.dll - ${MementoSectionEnd} - ${MementoSection} "Rotate" SecVidFltRotate - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_rotate.dll - ${MementoSectionEnd} - ${MementoSection} "Vertical Flip" SecVidFltVerticalFlip - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_vflip.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Interlacing Filters" SecGrpVideoFilterInterlacing - ${MementoSection} "Decomb Decimate" SecVidFltDecombDecimate - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_decimate.dll - ${MementoSectionEnd} - ${MementoSection} "Decomb Telecide" SecVidFltDecombTelecide - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_telecide.dll - ${MementoSectionEnd} - ${MementoSection} "DGBob" SecVidFltDgbob - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_DgBob.dll - ${MementoSectionEnd} - ${MementoSection} "Horizontal Stack Fields" SecVidFltHzStackFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_hzstackField.dll - ${MementoSectionEnd} - ${MementoSection} "Kernel Deint" SecVidFltKernelDeint - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_kernelDeint.dll - ${MementoSectionEnd} - ${MementoSection} "libavcodec Deinterlacers" SecVidFltLavDeinterlacers - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_lavDeint.dll - ${MementoSectionEnd} - ${MementoSection} "Merge Fields" SecVidFltMergeFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_mergeField.dll - ${MementoSectionEnd} - ${MementoSection} "Separate Fields" SecVidFltSeparateFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_separateField.dll - ${MementoSectionEnd} - ${MementoSection} "Stack Fields" SecVidFltStackFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_stackField.dll - ${MementoSectionEnd} - ${MementoSection} "Unstack Fields" SecVidFltUnstackFields - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_unstackField.dll - ${MementoSectionEnd} - ${MementoSection} "Yadif" SecVidFltYadif - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_yadif.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Colour Filters" SecGrpVideoFilterColour - ${MementoSection} "Avisynth Colour YUV" SecVidFltAvisynthColourYuv - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_colorYuv.dll - ${MementoSectionEnd} - ${MementoSection} "ChromaShift" SecVidFltChromaShift - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_chromaShiftCli.dll - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_chromaShiftQT4.dll - ${MementoSectionEnd} - ${MementoSection} "Contrast" SecVidFltContrast - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_contrastCli.dll - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_contrastQT4.dll - ${MementoSectionEnd} - ${MementoSection} "MPlater Eq2" SecVidFltMplayerEq2 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_eq2Cli.dll - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_eq2QT4.dll - ${MementoSectionEnd} - ${MementoSection} "MPlater Hue" SecVidFltMplayerHue - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_HueCli.dll - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_HueQT4.dll - ${MementoSectionEnd} - ${MementoSection} "Remove Plane" SecVidFltRemovePlane - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_removePlane.dll - ${MementoSectionEnd} - ${MementoSection} "Swap U and V" SecVidFltSwapUandV - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_swapUV.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Noise Filters" SecGrpVideoFilterNoise - ${MementoSection} "FluxSmooth" SecVidFltFluxSmooth - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_FluxSmooth.dll - ${MementoSectionEnd} - ${MementoSection} "Gaussian Convolution" SecVidFltGauss - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_gauss.dll - ${MementoSectionEnd} - ${MementoSection} "Large Median (5x5)" SecVidFltMediam5x5 - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_largeMedian.dll - ${MementoSectionEnd} - ${MementoSection} "Mean Convolution" SecVidFltMean - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_mean.dll - ${MementoSectionEnd} - ${MementoSection} "Median Convolution" SecVidFltMedian - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_median.dll - ${MementoSectionEnd} - ${MementoSection} "MPlayer Denoise 3D" SecVidFltMPlayerDenoise3d - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_denoise3d.dll - ${MementoSectionEnd} - ${MementoSection} "MPlayer Denoise 3D HQ" SecVidFltMPlayerDenoise3dHq - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_denoise3dhq.dll - ${MementoSectionEnd} - ${MementoSection} "MSharpen" SecVidFltMSharpen - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_msharpen.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Sharpness Filters" SecGrpVideoFilterSharpness - ${MementoSection} "asharp" SecVidFltAsharp - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_asharpQT4.dll - ${MementoSectionEnd} - ${MementoSection} "MPlayer Delogo" SecVidFltMPlayerDelogo - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - SetOutPath $INSTDIR\plugins\videoFilters\qt4 - ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_mpdelogoQT4.dll - ${MementoSectionEnd} - ${MementoSection} "Sharpen" SecVidFltSharpen - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_sharpen.dll - ${MementoSectionEnd} - SectionGroupEnd - SectionGroup "Subtitle Filters" SecGrpVideoFilterSubtitle - ${MementoSection} "ASS, SSA" SecVidFltAssSsa - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_ssa.dll - SetOutPath $INSTDIR - ${File} ${ADM_SYSDIR}/libfribidi-0.dll - ${File} ${ADM_SYSDIR}/libiconv-2.dll - ${File} ${ADM_SYSDIR}/libfontconfig-1.dll - #${File} ${ADM_SYSDIR}/libexpat-1.dll - SetOutPath $INSTDIR\etc\fonts - ${Folder} ${ADM_DIR}/etc/fonts - ${MementoSectionEnd} - SectionGroupEnd - #SectionGroup "OpenGL Filters" SecGrpVideoFilterOpenGl - #${MementoSection} "Fragment Shader" SecVidFltOpenGlFragmentShader - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_sampleGlFrag2.dll - #${MementoSectionEnd} - #${MementoSection} "Read Back Benchmark" SecVidFltOpenGlReadBack - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_glBenchmark.dll - #${MementoSectionEnd} - #${MementoSection} "Resize" SecVidFltOpenGlResize - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_glResize.dll - #${MementoSectionEnd} - #${MementoSection} "Rotate" SecVidFltOpenGlRotate - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_rotateGlFrag2.dll - #${MementoSectionEnd} - #${MementoSection} "Wave" SecVidFltOpenGlWave - #SectionIn 1 2 - #SetOverwrite on - #SetOutPath $INSTDIR\plugins\videoFilters - #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_sampleGlVertex.dll - #${MementoSectionEnd} - #SectionGroupEnd - SectionGroup "Miscellaneous Filters" SecGrpVideoFilterMiscellaneous - ${MementoSection} "Print Information" SecVidFltPrintInfo - SectionIn 1 2 - SetOverwrite on - SetOutPath $INSTDIR\plugins\videoFilters - ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_printInfo.dll - ${MementoSectionEnd} - SectionGroupEnd -SectionGroupEnd - -${MementoSection} "-Start menu Change Log" SecStartMenuChangeLog - CreateDirectory $SMPROGRAMS\$StartMenuGroup - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - SetOutPath $INSTDIR - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Change Log ${CORE_VERSION}.lnk" "$INSTDIR\Change Log.html" - !insertmacro MUI_STARTMENU_WRITE_END -${MementoSectionEnd} - - -${MementoSection} "-Start menu Qt" SecStartMenuQt - CreateDirectory $SMPROGRAMS\$StartMenuGroup - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - SetOutPath $INSTDIR - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Avidemux job control (64 Bits).lnk" $INSTDIR\avidemux_jobs.exe - !insertmacro MUI_STARTMENU_WRITE_END -${MementoSectionEnd} - -${MementoSection} "-Start menu AVS Proxy GUI" SecStartMenuAvsProxyGui - CreateDirectory $SMPROGRAMS\$StartMenuGroup - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - SetOutPath $INSTDIR - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\AVS Proxy GUI ${CORE_VERSION}.lnk" "$INSTDIR\avsproxy_gui.exe" - !insertmacro MUI_STARTMENU_WRITE_END -${MementoSectionEnd} - - -${MementoSection} "-Quick Launch Qt" SecQuickLaunchQt - SetOutPath $INSTDIR - CreateShortcut "$QUICKLAUNCH\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe -${MementoSectionEnd} - - -${MementoSection} "-Desktop Qt" SecDesktopQt - SetOutPath $INSTDIR - CreateShortcut "$DESKTOP\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe -${MementoSectionEnd} - -${MementoSectionDone} - -Section -post SecUninstaller - SectionIn 1 2 - WriteRegStr HKLM "${REGKEY}" Path $INSTDIR - WriteRegStr HKLM "${REGKEY}" Version ${PRODUCT_VERSION} - SetOutPath $INSTDIR - WriteUninstaller $INSTDIR\uninstall.exe - WriteRegStr HKLM "${UNINST_REGKEY}" DisplayName "${SHORTCUT_NAME}" - WriteRegStr HKLM "${UNINST_REGKEY}" DisplayVersion "${PRODUCT_VERSION}" - WriteRegStr HKLM "${UNINST_REGKEY}" DisplayIcon $INSTDIR\uninstall.exe - WriteRegStr HKLM "${UNINST_REGKEY}" UninstallString $INSTDIR\uninstall.exe - WriteRegDWORD HKLM "${UNINST_REGKEY}" NoModify 1 - WriteRegDWORD HKLM "${UNINST_REGKEY}" NoRepair 1 -SectionEnd - -Section -CloseLogFile - FileClose $UninstallLogHandle - SetFileAttributes ${UninstallLogPath} HIDDEN -SectionEnd - -Section Uninstall - !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup - - - Delete /REBOOTOK "$QUICKLAUNCH\${SHORTCUT_NAME}.lnk" - Delete /REBOOTOK "$DESKTOP\${SHORTCUT_NAME}.lnk" - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME}.lnk" - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Avidemux job control (64 Bits).lnk" - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Change Log ${CORE_VERSION}.lnk" - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\AVS Proxy GUI ${CORE_VERSION}.lnk" - RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup - DeleteRegValue HKLM "${REGKEY}" StartMenuGroup - - DeleteRegKey HKLM "${UNINST_REGKEY}" - DeleteRegValue HKLM "${REGKEY}" Path - DeleteRegValue HKLM "${REGKEY}" CreateDesktopIcon - DeleteRegValue HKLM "${REGKEY}" CreateStartMenuGroup - DeleteRegValue HKLM "${REGKEY}" CreateQuickLaunchIcon - DeleteRegKey /IfEmpty HKLM "${REGKEY}" - - FileOpen $UninstallLogHandle "${UninstallLogPath}" r -UninstallLoop: - ClearErrors - FileRead $UninstallLogHandle $R0 - IfErrors UninstallEnd - Push $R0 - Call un.TrimNewLines - Pop $R0 - Delete "$R0" - Goto UninstallLoop -UninstallEnd: - FileClose $UninstallLogHandle - Delete "${UninstallLogPath}" - Delete "$INSTDIR\uninstall.exe" - Push "\" - Call un.RemoveEmptyDirs - RMDir "$INSTDIR" -SectionEnd - -########################## -# Installer functions -########################## -Function .onInit -UAC_Elevate: - !insertmacro UAC_RunElevated - StrCmp 1223 $0 UAC_ElevationAborted - StrCmp 0 $0 0 UAC_Err - StrCmp 1 $1 0 UAC_Success - Quit - -UAC_Err: - MessageBox MB_ICONSTOP "Unable to elevate, error $0" - Abort - -UAC_ElevationAborted: - Abort - -UAC_Success: - StrCmp 1 $3 +4 - StrCmp 3 $1 0 UAC_ElevationAborted - MessageBox MB_ICONSTOP "This installer requires admin access." - Goto UAC_Elevate - - Call LoadPreviousSettings - ReadRegStr $PreviousVersion HKLM "${REGKEY}" Version - - ${If} $PreviousVersion != "" - ${VersionCompare} ${PRODUCT_VERSION} $PreviousVersion $PreviousVersionState - ${EndIf} - - InitPluginsDir - SetShellVarContext all -FunctionEnd - -Function .onInstSuccess - ${MementoSectionSave} -FunctionEnd - -Function LoadPreviousSettings - ${MementoSectionRestore} - !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup - - ReadRegStr $CreateStartMenuGroup HKLM "${REGKEY}" CreateStartMenuGroup - - ${If} $CreateStartMenuGroup == "" - StrCpy $CreateStartMenuGroup 1 - ${EndIf} - - ReadRegStr $CreateDesktopIcon HKLM "${REGKEY}" CreateDesktopIcon - - ${If} $CreateDesktopIcon == "" - StrCpy $CreateDesktopIcon 1 - ${EndIf} - - ${If} ${AtMostWinVista} - ReadRegStr $CreateQuickLaunchIcon HKLM "${REGKEY}" CreateQuickLaunchIcon - - ${If} $CreateQuickLaunchIcon == "" - StrCpy $CreateQuickLaunchIcon 1 - ${EndIf} - ${EndIf} - -FunctionEnd - -Function RunUninstaller - ReadRegStr $R1 HKLM "${UNINST_REGKEY}" "UninstallString" - - ${If} $R1 == "" - Return - ${EndIf} - - ;Run uninstaller - HideWindow - ClearErrors - - ${If} $PreviousVersionState == 0 - ${AndIf} $ReinstallUninstall == 1 - ExecWait '$R1 _?=$INSTDIR' - ${Else} - ExecWait '$R1 /frominstall _?=$INSTDIR' - ${EndIf} - - IfErrors NoRemoveUninstaller - IfFileExists "$INSTDIR\uninstall.exe" 0 NoRemoveUninstaller - Delete "$R1" - RMDir $INSTDIR - -NoRemoveUninstaller: -FunctionEnd - -Function CheckSelectedUIs - !insertmacro SectionFlagIsSet ${SecGrpUI} ${SF_SELECTED} end checkPartial -checkPartial: - !insertmacro SectionFlagIsSet ${SecGrpUI} ${SF_PSELECTED} end displayError -displayError: - MessageBox MB_OK|MB_ICONSTOP "At least one User Interface must be selected." - Abort -end: -FunctionEnd - -LangString INSTALL_OPTS_PAGE_TITLE ${LANG_ENGLISH} "Choose Install Options" -LangString INSTALL_OPTS_PAGE_SUBTITLE ${LANG_ENGLISH} "Choose where to install Avidemux icons." -Var dlgInstallOptions -Var lblCreateIcons -Var chkDesktop -Var chkStartMenu -Var chkQuickLaunch - -Function InstallOptionsPage - Call IsInstallOptionsRequired - !insertmacro MUI_HEADER_TEXT "$(INSTALL_OPTS_PAGE_TITLE)" "$(INSTALL_OPTS_PAGE_SUBTITLE)" - - nsDialogs::Create 1018 - Pop $dlgInstallOptions - - ${If} $dlgInstallOptions == error - Abort - ${EndIf} - - ${NSD_CreateLabel} 0 0u 100% 12u "Create icons for Avidemux:" - Pop $lblCreateIcons - - ${NSD_CreateCheckBox} 0 18u 100% 12u "On my &Desktop" - Pop $chkDesktop - ${NSD_SetState} $chkDesktop $CreateDesktopIcon - ${NSD_OnClick} $chkDesktop UpdateInstallOptions - - ${NSD_CreateCheckBox} 0 36u 100% 12u "In my &Start Menu Programs folder" - Pop $chkStartMenu - ${NSD_SetState} $chkStartMenu $CreateStartMenuGroup - ${NSD_OnClick} $chkStartMenu UpdateInstallOptions - - ${If} ${AtMostWinVista} - ${NSD_CreateCheckBox} 0 54u 100% 12u "In my &Quick Launch bar" - Pop $chkQuickLaunch - ${NSD_SetState} $chkQuickLaunch $CreateQuickLaunchIcon - ${NSD_OnClick} $chkQuickLaunch UpdateInstallOptions - ${EndIf} - #${If} ${IsWin2003} - #WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\avidemux.exe" "WIN2000" - #${EndIf} - #${If} ${IsWinXp} - #WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\avidemux.exe" "WIN2000" - #${EndIf} - nsDialogs::Show -FunctionEnd - -Function UpdateInstallOptions - ${NSD_GetState} $chkDesktop $CreateDesktopIcon - ${NSD_GetState} $chkStartMenu $CreateStartMenuGroup - ${NSD_GetState} $chkQuickLaunch $CreateQuickLaunchIcon -FunctionEnd - -Function IsInstallOptionsRequired -Goto end - !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} end resetOptions -resetOptions: - - StrCpy $CreateDesktopIcon 0 - StrCpy $CreateStartMenuGroup 0 - StrCpy $CreateQuickLaunchIcon 0 - Abort - -end: -FunctionEnd - -Function IsStartMenuRequired - StrCmp $CreateStartMenuGroup 1 +2 - Abort -FunctionEnd - -Function ActivateInternalSections - #AVS Proxy GUI shortcut: - SectionGetFlags ${SecAvsProxy} $0 - IntOp $0 $0 & ${SF_SELECTED} - IntOp $0 $0 & $CreateStartMenuGroup - SectionSetFlags ${SecStartMenuAvsProxyGui} $0 - - #Change Log shortcut: - SectionSetFlags ${SecStartMenuChangeLog} $CreateStartMenuGroup - - #Qt shortcuts: - SectionGetFlags ${SecUiQt} $0 - IntOp $0 $0 & ${SF_SELECTED} - - IntOp $1 $0 & $CreateDesktopIcon - SectionSetFlags ${SecDesktopQt} $1 - - IntOp $1 $0 & $CreateQuickLaunchIcon - SectionSetFlags ${SecQuickLaunchQt} $1 - - IntOp $1 $0 & $CreateStartMenuGroup - SectionSetFlags ${SecStartMenuQt} $1 -FunctionEnd - -Function InstFilesPageShow - ${If} $ReinstallUninstall != "" - Call RunUninstaller - BringToFront - ${EndIf} -FunctionEnd - -Function InstFilesPageLeave - ; Don't advance automatically if details expanded - FindWindow $R0 "#32770" "" $HWNDPARENT - GetDlgItem $R0 $R0 1016 - System::Call user32::IsWindowVisible(i$R0)i.s - Pop $R0 - - StrCmp $R0 0 +2 - SetAutoClose false -FunctionEnd - -Function ConfigureFinishPage - - SectionGetFlags ${SecUiQt} $0 - IntOp $0 $0 & ${SF_SELECTED} - StrCmp $0 ${SF_SELECTED} end - - DeleteINISec "$PLUGINSDIR\ioSpecial.ini" "Field 4" - -end: -FunctionEnd - -Function RunAvidemux - SetOutPath $INSTDIR - - SectionGetFlags ${SecUiQt} $0 - IntOp $0 $0 & ${SF_SELECTED} - - !insertmacro UAC_AsUser_ExecShell "" "$INSTDIR\avidemux.exe" "" "" "" - - Goto end - - -end: -FunctionEnd - -Var ReinstallUninstallButton - -Function ReinstallPage - ${If} $PreviousVersion == "" - Abort - ${EndIf} - - nsDialogs::Create /NOUNLOAD 1018 - Pop $0 - - ${If} $PreviousVersionState == 1 - !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_FULLNAME}." - nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "An older version of Avidemux is installed on your system. Select the operation you want to perform and click Next to continue." - Pop $R0 - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Upgrade Avidemux using previous settings (recommended)" - Pop $ReinstallUninstallButton - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Change settings (advanced)" - Pop $R0 - - ${If} $ReinstallUninstall == "" - StrCpy $ReinstallUninstall 1 - ${EndIf} - ${ElseIf} $PreviousVersionState == 2 - !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_FULLNAME}." - nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "A newer version of Avidemux is already installed! It is not recommended that you downgrade to an older version. Select the operation you want to perform and click Next to continue." - Pop $R0 - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Downgrade Avidemux using previous settings (recommended)" - Pop $ReinstallUninstallButton - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Change settings (advanced)" - Pop $R0 - - ${If} $ReinstallUninstall == "" - StrCpy $ReinstallUninstall 1 - ${EndIf} - ${ElseIf} $PreviousVersionState == 0 - !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform." - nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "${PRODUCT_FULLNAME} is already installed. Select the operation you want to perform and click Next to continue." - Pop $R0 - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Add/Remove/Reinstall components" - Pop $R0 - nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Uninstall Avidemux" - Pop $ReinstallUninstallButton - - ${If} $ReinstallUninstall == "" - StrCpy $ReinstallUninstall 2 - ${EndIf} - ${Else} - MessageBox MB_ICONSTOP "Unknown value of PreviousVersionState, aborting" /SD IDOK - Abort - ${EndIf} - - ${If} $ReinstallUninstall == "1" - SendMessage $ReinstallUninstallButton ${BM_SETCHECK} 1 0 - ${Else} - SendMessage $R0 ${BM_SETCHECK} 1 0 - ${EndIf} - - nsDialogs::Show -FunctionEnd - -Function ReinstallPageLeave - SendMessage $ReinstallUninstallButton ${BM_GETCHECK} 0 0 $R0 - - ${If} $R0 == 1 - ; Option to uninstall old version selected - StrCpy $ReinstallUninstall 1 - ${Else} - ; Custom up/downgrade or add/remove/reinstall - StrCpy $ReinstallUninstall 2 - ${EndIf} - - ${If} $ReinstallUninstall == 1 - ${If} $PreviousVersionState == 0 - Call RunUninstaller - Quit - ${Else} - ; Need to reload defaults. User could have - ; chosen custom, change something, went back and selected - ; the express option. - Call LoadPreviousSettings - ${EndIf} - ${EndIf} -FunctionEnd - - -########################## -# Uninstaller functions -########################## -Function un.onInit - SetShellVarContext all - -UAC_Elevate: - !insertmacro UAC_RunElevated - StrCmp 1223 $0 UAC_ElevationAborted - StrCmp 0 $0 0 UAC_Err - StrCmp 1 $1 0 UAC_Success - Quit - -UAC_Err: - MessageBox MB_ICONSTOP "Unable to elevate, error $0" - Abort - -UAC_ElevationAborted: - Abort - -UAC_Success: - StrCmp 1 $3 +4 - StrCmp 3 $1 0 UAC_ElevationAborted - MessageBox MB_ICONSTOP "This installer requires admin access." - Goto UAC_Elevate -FunctionEnd - -; TrimNewlines (copied from NSIS documentation) -; input, top of stack (e.g. whatever$/r$/n) -; output, top of stack (replaces, with e.g. whatever) -; modifies no other variables. -Function un.TrimNewlines - Exch $R0 - Push $R1 - Push $R2 - StrCpy $R1 0 - -loop: - IntOp $R1 $R1 - 1 - StrCpy $R2 $R0 1 $R1 - StrCmp $R2 "$\r" loop - StrCmp $R2 "$\n" loop - IntOp $R1 $R1 + 1 - IntCmp $R1 0 no_trim_needed - StrCpy $R0 $R0 $R1 - -no_trim_needed: - Pop $R2 - Pop $R1 - Exch $R0 -FunctionEnd - -Function un.RemoveEmptyDirs - Pop $9 - !define Index 'Line${__LINE__}' - FindFirst $0 $1 "$INSTDIR$9*" - StrCmp $0 "" "${Index}-End" -"${Index}-Loop:" - StrCmp $1 "" "${Index}-End" - StrCmp $1 "." "${Index}-Next" - StrCmp $1 ".." "${Index}-Next" - Push $0 - Push $1 - Push $9 - Push "$9$1\" - Call un.RemoveEmptyDirs - Pop $9 - Pop $1 - Pop $0 -;"${Index}-Remove:" - RMDir "$INSTDIR$9$1" -"${Index}-Next:" - FindNext $0 $1 - Goto "${Index}-Loop" -"${Index}-End:" - FindClose $0 - !undef Index -FunctionEnd - -Function un.ConfirmPagePre - ${un.GetParameters} $R0 - ${un.GetOptions} $R0 "/frominstall" $R1 - ${Unless} ${Errors} - Abort - ${EndUnless} -FunctionEnd - -Function un.FinishPagePre - ${un.GetParameters} $R0 - ${un.GetOptions} $R0 "/frominstall" $R1 - ${Unless} ${Errors} - SetRebootFlag false - Abort - ${EndUnless} -FunctionEnd +########################## +# Included files +########################## +!addincludedir ${NSIDIR} +!addplugindir ${NSIDIR}/plugin + +!include Sections.nsh +!include MUI2.nsh +!include nsDialogs.nsh +!include Memento.nsh +!include FileFunc.nsh +!include UAC.nsh +!include WinVer.nsh +!include WordFunc.nsh +#!include revision.nsh + +SetCompressor /SOLID lzma +SetCompressorDictSize 96 +RequestExecutionLevel user + +########################## +# Defines +########################## +!define BUILD_BITS 64 +!define QT_DIR /mingw/Qt/current/bin/ +!define ADM_SYSDIR /mingw/bin +!define ADM_DIR /mingw/Release +#!define NSIDIR "/home/fx/hudson/workspace/mingw_2.6.2_nsis/avidemux/winInstaller" +#!define SVN_VERSION 6 +!define REVISION ${SVN_VERSION} +!define EXEDIR "${NSIDIR}/install" + +!define CORE_VERSION "2.6" +!define POINT_RELEASE "8" +!define PRODUCT_VERSION "${CORE_VERSION}.${POINT_RELEASE}.${SVN_VERSION}" +!define PRODUCT_NAME "Avidemux ${CORE_VERSION} - 64bits" +!define PRODUCT_FULLNAME "Avidemux ${PRODUCT_VERSION} (${BUILD_BITS}-bit Release)" + +!if ${BUILD_BITS} == 64 + !define SHORTCUT_NAME "${PRODUCT_NAME}" + !define REG_GROUPNAME "${PRODUCT_NAME} (${BUILD_BITS}-bit)" +!else + !define SHORTCUT_NAME "${PRODUCT_NAME} (${BUILD_BITS}-bit)" + !define REG_GROUPNAME "${PRODUCT_NAME}" +!endif + +!define REGKEY "SOFTWARE\${REG_GROUPNAME}" +!define UNINST_REGKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_GROUPNAME}" +!define COMPANY "Free Software Foundation" +!define URL "http://www.avidemux.org" + +OutFile "${EXEDIR}/avidemux_${CORE_VERSION}.${POINT_RELEASE}_r${REVISION}_win${BUILD_BITS}.exe" +Name "${PRODUCT_FULLNAME}" + +########################## +# Memento defines +########################## +!define MEMENTO_REGISTRY_ROOT HKLM +!define MEMENTO_REGISTRY_KEY "${REGKEY}" + +########################## +# MUI defines +########################## +!define MUI_ICON "${NSIDIR}/../common/xpm/adm.ico" +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_RIGHT +!define MUI_HEADERIMAGE_BITMAP "${NSIDIR}/PageHeader.bmp" +!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM +!define MUI_STARTMENUPAGE_REGISTRY_KEY "${REGKEY}" +!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup +!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Avidemux (64bits)" +!define MUI_STARTMENUPAGE_NODISABLE +!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSIDIR}/WelcomeFinishStrip.bmp" +!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSIDIR}/WelcomeFinishStrip.bmp" +!define MUI_UNICON "${NSIDIR}/../common/xpm/adm.ico" +!define MUI_COMPONENTSPAGE_NODESC + +########################## +# Variables +########################## +Var CreateDesktopIcon +Var CreateStartMenuGroup +Var CreateQuickLaunchIcon +Var StartMenuGroup +Var PreviousVersion +Var PreviousVersionState +Var ReinstallUninstall + +########################## +# Installer pages +########################## +!define MUI_WELCOMEPAGE_TITLE "${PRODUCT_FULLNAME} Setup Wizard" +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "${NSIDIR}/License.rtf" + Page custom ReinstallPage ReinstallPageLeave +!insertmacro MUI_PAGE_COMPONENTS +Page custom InstallOptionsPage +!define MUI_PAGE_CUSTOMFUNCTION_PRE IsStartMenuRequired +!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup +!insertmacro MUI_PAGE_DIRECTORY +!define MUI_PAGE_CUSTOMFUNCTION_PRE ActivateInternalSections +!define MUI_PAGE_CUSTOMFUNCTION_SHOW InstFilesPageShow +!define MUI_PAGE_CUSTOMFUNCTION_LEAVE InstFilesPageLeave +!insertmacro MUI_PAGE_INSTFILES +!define MUI_FINISHPAGE_RUN +!define MUI_FINISHPAGE_RUN_FUNCTION RunAvidemux +!define MUI_FINISHPAGE_RUN_TEXT "Run ${PRODUCT_NAME} now" +!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR/Change Log.html" +!define MUI_FINISHPAGE_SHOWREADME_TEXT "View Change Log now" +!define MUI_FINISHPAGE_LINK "Visit the Avidemux website" +!define MUI_FINISHPAGE_LINK_LOCATION "http://www.avidemux.org" +!define MUI_PAGE_CUSTOMFUNCTION_PRE ConfigureFinishPage +!insertmacro MUI_PAGE_FINISH + +!define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!define MUI_PAGE_CUSTOMFUNCTION_PRE un.FinishPagePre +!insertmacro MUI_UNPAGE_FINISH + +########################## +# Installer languages +########################## +!insertmacro MUI_LANGUAGE English + +########################## +# Installer attributes +########################## +!if ${BUILD_BITS} == 64 + InstallDir "$PROGRAMFILES64\${PRODUCT_NAME}" +!else + InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" +!endif + +CRCCheck on +XPStyle on +ShowInstDetails nevershow +ShowUninstDetails nevershow +VIProductVersion ${PRODUCT_VERSION} +VIAddVersionKey ProductName Avidemux +VIAddVersionKey ProductVersion "${PRODUCT_VERSION}" +VIAddVersionKey FileVersion "" +VIAddVersionKey FileDescription "" +VIAddVersionKey LegalCopyright "" +InstallDirRegKey HKLM "${REGKEY}" Path +BrandingText "Packaged by Gruntster" +InstType Standard +InstType Full +######################################### +# +######################################### +Function GetAfterChar + Exch $0 ; chop char + Exch + Exch $1 ; input string + Push $2 + Push $3 + StrCpy $2 0 + loop: + IntOp $2 $2 - 1 + StrCpy $3 $1 1 $2 + StrCmp $3 "" 0 +3 + StrCpy $0 "" + Goto exit2 + StrCmp $3 $0 exit1 + Goto loop + exit1: + IntOp $2 $2 + 1 + StrCpy $0 $1 "" $2 + exit2: + Pop $3 + Pop $2 + Pop $1 + Exch $0 ; output +FunctionEnd +#####################################################################  +!define StrReplace '!insertmacro "_Name"' + +########################## +# Uninstaller macros +########################## +!insertmacro un.GetOptions +!insertmacro un.GetParameters + +!define UninstallLogPath "$INSTDIR\uninstall.log" +Var UninstallLogHandle + +; Uninstall log file missing. +LangString UninstallLogMissing ${LANG_ENGLISH} "uninstall.log not found!$\r$\nUninstallation cannot proceed!" +# Regexep Does not work with cross +# Use only one file at a time +!macro InstallFile FILEZ + File "${FILEZ}" + Push "${FILEZ}" + Push "/" + Call GetAfterChar + Pop $R0 + FileWrite $UninstallLogHandle "$OUTDIR\$R0$\r$\n" +!macroend +!define File "!insertmacro InstallFile" + +!macro InstallFolder FILEREGEX + File /r "${FILEREGEX}/*" + Push "$OUTDIR" + Call InstallFolderInternal +!macroend +!define Folder "!insertmacro InstallFolder" + +Function InstallFolderInternal + Pop $9 + !define Index 'Line${__LINE__}' + FindFirst $0 $1 "$9/*" + StrCmp $0 "" "${Index}-End" +"${Index}-Loop:" + StrCmp $1 "" "${Index}-End" + StrCmp $1 "." "${Index}-Next" + StrCmp $1 ".." "${Index}-Next" + IfFileExists "$9\$1\*" 0 "${Index}-Write" + Push $0 + Push $9 + Push "$9\$1" + Call InstallFolderInternal + Pop $9 + Pop $0 + Goto "${Index}-Next" +"${Index}-Write:" + FileWrite $UninstallLogHandle "$9\$1$\r$\n" +"${Index}-Next:" + FindNext $0 $1 + Goto "${Index}-Loop" +"${Index}-End:" + !undef Index +FunctionEnd + +; WriteUninstaller macro +!macro WriteUninstaller Path + WriteUninstaller "${Path}" + FileWrite $UninstallLogHandle "${Path}$\r$\n" +!macroend +!define WriteUninstaller "!insertmacro WriteUninstaller" + +########################## +# Macros +########################## + +!macro InstallQtLanguage LANG_NAME LANG_CODE + SetOverwrite on + + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} installQt${LANG_CODE} endQt${LANG_CODE} + +installQt${LANG_CODE}: + SetOutPath $INSTDIR\i18n + ${File} i18n/avidemux_${LANG_CODE}.qm + ${File} i18n/qt_${LANG_CODE}.qm + +endQt${LANG_CODE}: +!macroend + +########################## +# Installer sections +########################## +Section -OpenLogFile + CreateDirectory "$INSTDIR" + FileOpen $UninstallLogHandle ${UninstallLogPath} a + FileSeek $UninstallLogHandle 0 END +SectionEnd + +Section "Avidemux Core" SecCore + SectionIn 1 2 RO + SetOutPath $INSTDIR + SetOverwrite on + ${File} "./Build Info.txt" + ${File} "./Change Log.html" + ${File} ${ADM_SYSDIR}/libexpat-1.dll + #${File} ${ADM_SYSDIR}/mgwz.dll + ${File} ${ADM_SYSDIR}/libfreetype-6.dll + ${File} ${ADM_SYSDIR}/libsqlite3-0.dll + ${File} ${ADM_SYSDIR}/libstdc++-6.dll + ${File} ${ADM_SYSDIR}/libgcc_s_seh-1.dll + ${File} ${ADM_SYSDIR}/libwinpthread-1.dll + ${File} ${ADM_SYSDIR}/libpng16-16.dll + ${File} ${ADM_SYSDIR}/SDL.dll + ${File} ${ADM_SYSDIR}/libz.dll + ${File} ${ADM_SYSDIR}/libz.dll.1.2.8 + ${File} ${ADM_DIR}/libADM_audioParser6.dll + ${File} ${ADM_DIR}/libADM_core6.dll + ${File} ${ADM_DIR}/libADM_coreAudio6.dll + ${File} ${ADM_DIR}/libADM_coreAudioDevice6.dll + ${File} ${ADM_DIR}/libADM_coreAudioEncoder6.dll + ${File} ${ADM_DIR}/libADM_coreAudioFilterAPI6.dll + ${File} ${ADM_DIR}/libADM_coreDemuxer6.dll + ${File} ${ADM_DIR}/libADM_coreDemuxerMpeg6.dll + ${File} ${ADM_DIR}/libADM_coreImage6.dll + ${File} ${ADM_DIR}/libADM_coreImageLoader6.dll + ${File} ${ADM_DIR}/libADM_coreJobs.dll + ${File} ${ADM_DIR}/libADM_coreMuxer6.dll + ${File} ${ADM_DIR}/libADM_coreScript.dll + ${File} ${ADM_DIR}/libADM_coreSocket6.dll + ${File} ${ADM_DIR}/libADM_coreSqlLight3.dll + ${File} ${ADM_DIR}/libADM_coreUI6.dll + ${File} ${ADM_DIR}/libADM_coreUtils6.dll + ${File} ${ADM_DIR}/libADM_coreVideoCodec6.dll + ${File} ${ADM_DIR}/libADM_coreVideoEncoder6.dll + ${File} ${ADM_DIR}/libADM_coreVideoFilter6.dll + ${File} ${ADM_DIR}/libADM_coreSubtitle.dll + ${File} ${QT_DIR}/QtCore4.dll + ${File} ${QT_DIR}/QtGui4.dll + ${File} ${NSIDIR}/../../AUTHORS. + ${File} ${NSIDIR}/../../COPYING. + ${File} ${NSIDIR}/../../README. + ${File} ${ADM_DIR}/avcodec-*.dll + ${File} ${ADM_DIR}/avformat-*.dll + ${File} ${ADM_DIR}/avutil-*.dll + ${File} ${ADM_DIR}/postproc-*.dll + ${File} ${ADM_DIR}/swscale-*.dll + + WriteRegStr HKLM "${REGKEY}" CreateDesktopIcon $CreateDesktopIcon + WriteRegStr HKLM "${REGKEY}" CreateStartMenuGroup $CreateStartMenuGroup + + ${If} ${AtMostWinVista} + WriteRegStr HKLM "${REGKEY}" CreateQuickLaunchIcon $CreateQuickLaunchIcon + ${EndIf} +SectionEnd + +SectionGroup /e "User interfaces" SecGrpUI + ${MementoUnselectedSection} "Command Line" SecUiCli + SectionIn 2 + SetOutPath $INSTDIR + SetOverwrite on + ${File} ${ADM_DIR}/avidemux_cli.exe + ${File} ${ADM_DIR}/libADM_render6_cli.dll + ${File} ${ADM_DIR}/libADM_UI_Cli6.dll + ${MementoSectionEnd} + + ${MementoSection} Qt SecUiQt + SectionIn 1 2 RO + SetOutPath $INSTDIR + SetOverwrite on + ${File} ${ADM_DIR}/avidemux.exe + ${File} ${ADM_DIR}/avidemux_jobs.exe + ${File} ${ADM_DIR}/libADM_render6_QT4.dll + ${File} ${ADM_DIR}/libADM_UIQT46.dll + ${File} ${QT_DIR}/QtOpenGL4.dll + #${File} ${QT_DIR}/libgcc_s_dw2-1.dll + #${File} ${QT_DIR}/mingwm10.dll + ${MementoSectionEnd} +SectionGroupEnd + +SectionGroup "Audio Decoders" SecGrpAudioDecoder + ${MementoSection} "µ-law" SecAudDecUlaw + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_ulaw.dll + ${MementoSectionEnd} + ${MementoSection} "AAC (FAAD)" SecAudDecFaad + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_faad.dll + #SetOutPath $INSTDIR + #${File} ${ADM_SYSDIR}/libfaad2.dll + ${MementoSectionEnd} + ${MementoSection} "AAC, AC-3, ADPCM IMA AMV, DTS, E-AC-3, MP2, MP3, Nellymoser, QDesign, WMA (libavcodec)" SecAudDecAvcodec + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_lav.dll + ${MementoSectionEnd} + ${MementoSection} "AC-3 (liba52)" SecAudDecA52 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_a52.dll + ${MementoSectionEnd} + ${MementoSection} "ADPCM IMA" SecAudDecImaAdpcm + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_ima_adpcm.dll + ${MementoSectionEnd} + ${MementoSection} "ADPCM Microsoft" SecAudDecMsAdpcm + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_ms_adpcm.dll + ${MementoSectionEnd} + ${MementoSection} "AMR-NB" SecAudDecOpencoreAmrNb + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_opencore_amrnb.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libopencore-amrnb-*.dll + ${MementoSectionEnd} + ${MementoSection} "AMR-WB" SecAudDecOpencoreAmrWb + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_opencore_amrwb.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libopencore-amrwb-*.dll + ${MementoSectionEnd} + ${MementoSection} "MP2, MP3 (MAD)" SecAudDecMad + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_Mad.dll + ${MementoSectionEnd} + ${MementoSection} "Vorbis" SecAudDecVorbis + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDecoder + ${File} ${ADM_DIR}/plugins/audioDecoder/libADM_ad_vorbis.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libogg-0.dll + ${File} ${ADM_SYSDIR}/libvorbis-0.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Audio Devices" SecGrpAudioDevice + ${MementoSection} "Waveform" SecAudDevWaveform + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioDevices + ${File} ${ADM_DIR}/plugins/audioDevices/libADM_av_win32.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Audio Encoders" SecGrpAudioEncoder + ${MementoSection} "AAC (FAAC)" SecAudEncFaac + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_faac.dll + #SetOutPath $INSTDIR + #${File} ${ADM_SYSDIR}libfaac.dll + ${MementoSectionEnd} + ${MementoSection} "AAC (libavcodec)" SecAudEncLavAac + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lav_aac.dll + ${MementoSectionEnd} + ${MementoSection} "AC-3 (Aften)" SecAudDecAften + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_aften.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libaften.dll + ${MementoSectionEnd} + ${MementoSection} "AC-3 (libavcodec)" SecAudEncLavAc3 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lav_ac3.dll + ${MementoSectionEnd} + #${MementoSection} "DTS (dcaenc)" SecAudDecDcaEnc + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\audioEncoders + #${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_dcaenc.dll + #SetOutPath $INSTDIR + #${File} libdcaenc-0.dll + #${MementoSectionEnd} + ${MementoSection} "MP2 (libavcodec)" SecAudEncLavMp2 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lav_mp2.dll + SetOutPath $INSTDIR + #${File} ${ADM_SYSDIR}/libtwolame-*.dll + ${MementoSectionEnd} + #${MementoSection} "MP2 (TwoLAME)" SecAudEncTwoLame + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\audioEncoders + #${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_twolame.dll + #${MementoSectionEnd} + ${MementoSection} "MP3" SecAudEncLame + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_lame.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libmp3lame-0.dll + ${MementoSectionEnd} + ${MementoSection} "PCM" SecAudEncPcm + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_pcm.dll + ${MementoSectionEnd} + ${MementoSection} "Vorbis" SecAudEncVorbis + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\audioEncoders + ${File} ${ADM_DIR}/plugins/audioEncoders/libADM_ae_vorbis.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libogg-0.dll + ${File} ${ADM_SYSDIR}/libvorbis-0.dll + ${File} ${ADM_SYSDIR}/libvorbisenc-2.dll + ${File} ${ADM_SYSDIR}/libvorbisfile-3.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Avisynth" SecGrpAvisynth + ${MementoUnselectedSection} "Avisynth Proxy" SecAvsProxy + SectionIn 2 + SetOutPath $INSTDIR + SetOverwrite on + ${File} ${ADM_SYSDIR}/avsproxy.exe + ${File} ${ADM_SYSDIR}/avsproxy_gui.exe + ${MementoSectionEnd} + ${MementoUnselectedSection} "Avisynth Proxy Demuxer" SecDemuxAvisynth + SectionIn 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_avsproxy.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Demuxers" SecGrpDemuxers + ${MementoSection} "ASF" SecDemuxAsf + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_asf.dll + ${MementoSectionEnd} + ${MementoSection} "BMP, JPEG, PNG Images" SecDemuxImage + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_pic.dll + ${MementoSectionEnd} + ${MementoSection} "Flash Video" SecDemuxFlv + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_flv.dll + ${MementoSectionEnd} + ${MementoSection} "Matroska" SecDemuxMatroska + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_matroska.dll + ${MementoSectionEnd} + ${MementoSection} "MP4" SecDemuxMp4 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_mp4.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-PS" SecDemuxMpegPs + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_ps.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-TS" SecDemuxMpegTs + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_ts.dll + ${MementoSectionEnd} + ${MementoSection} "MXF" SecDemuxMxf + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_mxf.dll + ${MementoSectionEnd} + ${MementoSection} "OpenDML AVI" SecDemuxOpenDml + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\demuxers + ${File} ${ADM_DIR}/plugins/demuxers/libADM_dm_opendml.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Muxers" SecGrpMuxers + ${MementoSection} "Dummy [Raw Audio/Video]" SecMuxDummy + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_dummy.dll + ${MementoSectionEnd} + ${MementoSection} "Flash Video" SecMuxLavFlv + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_flv.dll + ${MementoSectionEnd} + ${MementoSection} "Matroska" SecMuxLavMatroska + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_Mkv.dll + ${MementoSectionEnd} + ${MementoSection} "MP4 (libavcodec)" SecMuxLavMp4 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_mp4.dll + ${MementoSectionEnd} + ${MementoSection} "MP4 (MP4v2)" SecMuxMp4v2 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_mp4v2.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-PS" SecMuxLavMpegPs + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_ffPS.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-TS" SecMuxLavMpegTs + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_ffTS.dll + ${MementoSectionEnd} + ${MementoSection} "OpenDML AVI" SecMuxOpenDml + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_avi.dll + ${MementoSectionEnd} + ${MementoSection} "Raw Video" SecMuxRaw + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\muxers + ${File} ${ADM_DIR}/plugins/muxers/libADM_mx_raw.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Script Engines" SecGrpScriptEngine + #${MementoSection} "QtScript" SecScriptQt + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR + #${File} ${QT_DIR}/QtScript4.dll + #${File} ${QT_DIR}/QtScriptTools4.dll + #SetOutPath $INSTDIR\plugins\scriptEngines + #${File} ${ADM_DIR}/plugins/scriptEngines/libADM_script_qt.dll + #SetOutPath $INSTDIR\help\QtScript + #${Folder} help/QtScript + #${MementoSectionEnd} + ${MementoSection} "Tinypy" SecScriptTinypy + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\scriptEngines + ${File} ${ADM_DIR}/plugins/scriptEngines/libADM_script_tinyPy.dll + SetOutPath $INSTDIR\plugins\autoScripts + ${Folder} ${ADM_DIR}/plugins/autoScripts + ${MementoSectionEnd} +SectionGroupEnd +#SectionGroup "Video Decoders" SecGrpVideoDecoder + #${MementoSection} "VP8" SecVidDecVpx + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoDecoders + #${File} ${ADM_DIR}/plugins/videoDecoders/libADM_vd_vpx.dll + #${MementoSectionEnd} +#SectionGroupEnd +SectionGroup "Video Encoders" SecGrpVideoEncoder + ${MementoSection} "[Null]" SecVidEncNull + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_null.dll + ${MementoSectionEnd} + ${MementoSection} "Huffyuv, FFVHuff" SecVidEncLavHuffyuv + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_huff.dll + ${MementoSectionEnd} + ${MementoSection} "JPEG" SecVidEncLavJpeg + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_jpeg.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-2" SecVidEncLavMpeg2 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_ffMpeg2.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-4 ASP (libavcodec)" SecVidEncLavMpeg4asp + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_ffMpeg4.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-4 ASP (Xvid)" SecVidEncXvid + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_xvid4.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/xvidcore.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-4 AVC" SecVidEncX264 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_x264_other.dll + + SetOutPath $INSTDIR\plugins\videoEncoders\qt4 + ${File} ${ADM_DIR}/plugins/videoEncoders/qt4/libADM_ve_x264_QT4.dll + + SetOutPath $INSTDIR\plugins\pluginSettings\x264 + ${Folder} ${ADM_DIR}/plugins/pluginSettings/x264 + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libx264-*.dll + #${File} ${ADM_SYSDIR}/pthreadGC2-w64.dll + ${MementoSectionEnd} + ${MementoSection} "MPEG-4 HEC" SecVidEncX265 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_x265_other.dll + + SetOutPath $INSTDIR\plugins\videoEncoders\qt4 + ${File} ${ADM_DIR}/plugins/videoEncoders/qt4/libADM_ve_x265_QT4.dll + + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libx265*.dll + #${File} ${ADM_SYSDIR}/pthreadGC2-w64.dll + ${MementoSectionEnd} +${MementoSection} "PNG" SecVidEncLavPng + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_png.dll + ${MementoSectionEnd} + ${MementoSection} "Sorenson Spark" SecVidEncSorenson + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_ffFlv1.dll + ${MementoSectionEnd} + ${MementoSection} "YV12" SecVidEncYv12 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoEncoders + ${File} ${ADM_DIR}/plugins/videoEncoders/libADM_ve_yv12.dll + ${MementoSectionEnd} +SectionGroupEnd +SectionGroup "Video Filters" SecGrpVideoFilter + SectionGroup "Transform Filters" SecGrpVideoFilterTransform + ${MementoSection} "Add Black Borders" SecVidFltBlackBorders + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_addBorders.dll + ${MementoSectionEnd} + ${MementoSection} "Add Logo" SecVidFltLogo + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_logo.dll + ${MementoSectionEnd} + ${MementoSection} "Blacken Borders" SecVidFltBlackenBorders + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_blackenBorders.dll + ${MementoSectionEnd} + ${MementoSection} "Change FPS" SecVidFltChangeFps + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_changeFps.dll + ${MementoSectionEnd} + ${MementoSection} "Crop" SecVidFltCrop + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_CropCli.dll + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_cropQT4.dll + ${MementoSectionEnd} + ${MementoSection} "Fade" SecVidFltFade + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_fadeToBlack.dll + ${MementoSectionEnd} + ${MementoSection} "Greyscale" SecVidFltLumaOnly + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_lumaOnly.dll + ${MementoSectionEnd} + ${MementoSection} "Horizontal Flip" SecVidFltHorizontalFlip + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_hf_hflip.dll + ${MementoSectionEnd} + ${MementoSection} "libswscale Resize" SecVidFltSwscaleResize + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_swscaleResize_cli.dll + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_swscaleResizeQT4.dll + ${MementoSectionEnd} + ${MementoSection} "Resample FPS" SecVidFltResampleFps + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_resampleFps.dll + ${MementoSectionEnd} + ${MementoSection} "Rotate" SecVidFltRotate + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_rotate.dll + ${MementoSectionEnd} + ${MementoSection} "Vertical Flip" SecVidFltVerticalFlip + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_vflip.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Interlacing Filters" SecGrpVideoFilterInterlacing + ${MementoSection} "Decomb Decimate" SecVidFltDecombDecimate + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_decimate.dll + ${MementoSectionEnd} + ${MementoSection} "Decomb Telecide" SecVidFltDecombTelecide + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_telecide.dll + ${MementoSectionEnd} + ${MementoSection} "DGBob" SecVidFltDgbob + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_DgBob.dll + ${MementoSectionEnd} + ${MementoSection} "Horizontal Stack Fields" SecVidFltHzStackFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_hzstackField.dll + ${MementoSectionEnd} + ${MementoSection} "Kernel Deint" SecVidFltKernelDeint + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_kernelDeint.dll + ${MementoSectionEnd} + ${MementoSection} "libavcodec Deinterlacers" SecVidFltLavDeinterlacers + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_lavDeint.dll + ${MementoSectionEnd} + ${MementoSection} "Merge Fields" SecVidFltMergeFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_mergeField.dll + ${MementoSectionEnd} + ${MementoSection} "Separate Fields" SecVidFltSeparateFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_separateField.dll + ${MementoSectionEnd} + ${MementoSection} "Stack Fields" SecVidFltStackFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_stackField.dll + ${MementoSectionEnd} + ${MementoSection} "Unstack Fields" SecVidFltUnstackFields + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_unstackField.dll + ${MementoSectionEnd} + ${MementoSection} "Yadif" SecVidFltYadif + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_yadif.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Colour Filters" SecGrpVideoFilterColour + ${MementoSection} "Avisynth Colour YUV" SecVidFltAvisynthColourYuv + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_colorYuv.dll + ${MementoSectionEnd} + ${MementoSection} "ChromaShift" SecVidFltChromaShift + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_chromaShiftCli.dll + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_chromaShiftQT4.dll + ${MementoSectionEnd} + ${MementoSection} "Contrast" SecVidFltContrast + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_contrastCli.dll + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_contrastQT4.dll + ${MementoSectionEnd} + ${MementoSection} "MPlater Eq2" SecVidFltMplayerEq2 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_eq2Cli.dll + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_eq2QT4.dll + ${MementoSectionEnd} + ${MementoSection} "MPlater Hue" SecVidFltMplayerHue + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_HueCli.dll + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_HueQT4.dll + ${MementoSectionEnd} + ${MementoSection} "Remove Plane" SecVidFltRemovePlane + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_removePlane.dll + ${MementoSectionEnd} + ${MementoSection} "Swap U and V" SecVidFltSwapUandV + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_swapUV.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Noise Filters" SecGrpVideoFilterNoise + ${MementoSection} "FluxSmooth" SecVidFltFluxSmooth + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_FluxSmooth.dll + ${MementoSectionEnd} + ${MementoSection} "Gaussian Convolution" SecVidFltGauss + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_gauss.dll + ${MementoSectionEnd} + ${MementoSection} "Large Median (5x5)" SecVidFltMediam5x5 + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_largeMedian.dll + ${MementoSectionEnd} + ${MementoSection} "Mean Convolution" SecVidFltMean + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_mean.dll + ${MementoSectionEnd} + ${MementoSection} "Median Convolution" SecVidFltMedian + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_median.dll + ${MementoSectionEnd} + ${MementoSection} "MPlayer Denoise 3D" SecVidFltMPlayerDenoise3d + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_denoise3d.dll + ${MementoSectionEnd} + ${MementoSection} "MPlayer Denoise 3D HQ" SecVidFltMPlayerDenoise3dHq + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_denoise3dhq.dll + ${MementoSectionEnd} + ${MementoSection} "MSharpen" SecVidFltMSharpen + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_msharpen.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Sharpness Filters" SecGrpVideoFilterSharpness + ${MementoSection} "asharp" SecVidFltAsharp + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_asharpQT4.dll + ${MementoSectionEnd} + ${MementoSection} "MPlayer Delogo" SecVidFltMPlayerDelogo + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + SetOutPath $INSTDIR\plugins\videoFilters\qt4 + ${File} ${ADM_DIR}/plugins/videoFilters/qt4/libADM_vf_mpdelogoQT4.dll + ${MementoSectionEnd} + ${MementoSection} "Sharpen" SecVidFltSharpen + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_sharpen.dll + ${MementoSectionEnd} + SectionGroupEnd + SectionGroup "Subtitle Filters" SecGrpVideoFilterSubtitle + ${MementoSection} "ASS, SSA" SecVidFltAssSsa + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_ssa.dll + SetOutPath $INSTDIR + ${File} ${ADM_SYSDIR}/libfribidi-0.dll + ${File} ${ADM_SYSDIR}/libiconv-2.dll + ${File} ${ADM_SYSDIR}/libfontconfig-1.dll + #${File} ${ADM_SYSDIR}/libexpat-1.dll + SetOutPath $INSTDIR\etc\fonts + ${Folder} ${ADM_DIR}/etc/fonts + ${MementoSectionEnd} + SectionGroupEnd + #SectionGroup "OpenGL Filters" SecGrpVideoFilterOpenGl + #${MementoSection} "Fragment Shader" SecVidFltOpenGlFragmentShader + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_sampleGlFrag2.dll + #${MementoSectionEnd} + #${MementoSection} "Read Back Benchmark" SecVidFltOpenGlReadBack + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_glBenchmark.dll + #${MementoSectionEnd} + #${MementoSection} "Resize" SecVidFltOpenGlResize + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_glResize.dll + #${MementoSectionEnd} + #${MementoSection} "Rotate" SecVidFltOpenGlRotate + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_rotateGlFrag2.dll + #${MementoSectionEnd} + #${MementoSection} "Wave" SecVidFltOpenGlWave + #SectionIn 1 2 + #SetOverwrite on + #SetOutPath $INSTDIR\plugins\videoFilters + #${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_sampleGlVertex.dll + #${MementoSectionEnd} + #SectionGroupEnd + SectionGroup "Miscellaneous Filters" SecGrpVideoFilterMiscellaneous + ${MementoSection} "Print Information" SecVidFltPrintInfo + SectionIn 1 2 + SetOverwrite on + SetOutPath $INSTDIR\plugins\videoFilters + ${File} ${ADM_DIR}/plugins/videoFilters/libADM_vf_printInfo.dll + ${MementoSectionEnd} + SectionGroupEnd +SectionGroupEnd + +${MementoSection} "-Start menu Change Log" SecStartMenuChangeLog + CreateDirectory $SMPROGRAMS\$StartMenuGroup + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + SetOutPath $INSTDIR + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Change Log ${CORE_VERSION}.lnk" "$INSTDIR\Change Log.html" + !insertmacro MUI_STARTMENU_WRITE_END +${MementoSectionEnd} + + +${MementoSection} "-Start menu Qt" SecStartMenuQt + CreateDirectory $SMPROGRAMS\$StartMenuGroup + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + SetOutPath $INSTDIR + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Avidemux job control (64 Bits).lnk" $INSTDIR\avidemux_jobs.exe + !insertmacro MUI_STARTMENU_WRITE_END +${MementoSectionEnd} + +${MementoSection} "-Start menu AVS Proxy GUI" SecStartMenuAvsProxyGui + CreateDirectory $SMPROGRAMS\$StartMenuGroup + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + SetOutPath $INSTDIR + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\AVS Proxy GUI ${CORE_VERSION}.lnk" "$INSTDIR\avsproxy_gui.exe" + !insertmacro MUI_STARTMENU_WRITE_END +${MementoSectionEnd} + + +${MementoSection} "-Quick Launch Qt" SecQuickLaunchQt + SetOutPath $INSTDIR + CreateShortcut "$QUICKLAUNCH\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe +${MementoSectionEnd} + + +${MementoSection} "-Desktop Qt" SecDesktopQt + SetOutPath $INSTDIR + CreateShortcut "$DESKTOP\${SHORTCUT_NAME}.lnk" $INSTDIR\avidemux.exe +${MementoSectionEnd} + +${MementoSectionDone} + +Section -post SecUninstaller + SectionIn 1 2 + WriteRegStr HKLM "${REGKEY}" Path $INSTDIR + WriteRegStr HKLM "${REGKEY}" Version ${PRODUCT_VERSION} + SetOutPath $INSTDIR + WriteUninstaller $INSTDIR\uninstall.exe + WriteRegStr HKLM "${UNINST_REGKEY}" DisplayName "${SHORTCUT_NAME}" + WriteRegStr HKLM "${UNINST_REGKEY}" DisplayVersion "${PRODUCT_VERSION}" + WriteRegStr HKLM "${UNINST_REGKEY}" DisplayIcon $INSTDIR\uninstall.exe + WriteRegStr HKLM "${UNINST_REGKEY}" UninstallString $INSTDIR\uninstall.exe + WriteRegDWORD HKLM "${UNINST_REGKEY}" NoModify 1 + WriteRegDWORD HKLM "${UNINST_REGKEY}" NoRepair 1 +SectionEnd + +Section -CloseLogFile + FileClose $UninstallLogHandle + SetFileAttributes ${UninstallLogPath} HIDDEN +SectionEnd + +Section Uninstall + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup + + + Delete /REBOOTOK "$QUICKLAUNCH\${SHORTCUT_NAME}.lnk" + Delete /REBOOTOK "$DESKTOP\${SHORTCUT_NAME}.lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\${SHORTCUT_NAME}.lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Avidemux job control (64 Bits).lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Change Log ${CORE_VERSION}.lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\AVS Proxy GUI ${CORE_VERSION}.lnk" + RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup + DeleteRegValue HKLM "${REGKEY}" StartMenuGroup + + DeleteRegKey HKLM "${UNINST_REGKEY}" + DeleteRegValue HKLM "${REGKEY}" Path + DeleteRegValue HKLM "${REGKEY}" CreateDesktopIcon + DeleteRegValue HKLM "${REGKEY}" CreateStartMenuGroup + DeleteRegValue HKLM "${REGKEY}" CreateQuickLaunchIcon + DeleteRegKey /IfEmpty HKLM "${REGKEY}" + + FileOpen $UninstallLogHandle "${UninstallLogPath}" r +UninstallLoop: + ClearErrors + FileRead $UninstallLogHandle $R0 + IfErrors UninstallEnd + Push $R0 + Call un.TrimNewLines + Pop $R0 + Delete "$R0" + Goto UninstallLoop +UninstallEnd: + FileClose $UninstallLogHandle + Delete "${UninstallLogPath}" + Delete "$INSTDIR\uninstall.exe" + Push "\" + Call un.RemoveEmptyDirs + RMDir "$INSTDIR" +SectionEnd + +########################## +# Installer functions +########################## +Function .onInit +UAC_Elevate: + !insertmacro UAC_RunElevated + StrCmp 1223 $0 UAC_ElevationAborted + StrCmp 0 $0 0 UAC_Err + StrCmp 1 $1 0 UAC_Success + Quit + +UAC_Err: + MessageBox MB_ICONSTOP "Unable to elevate, error $0" + Abort + +UAC_ElevationAborted: + Abort + +UAC_Success: + StrCmp 1 $3 +4 + StrCmp 3 $1 0 UAC_ElevationAborted + MessageBox MB_ICONSTOP "This installer requires admin access." + Goto UAC_Elevate + + Call LoadPreviousSettings + ReadRegStr $PreviousVersion HKLM "${REGKEY}" Version + + ${If} $PreviousVersion != "" + ${VersionCompare} ${PRODUCT_VERSION} $PreviousVersion $PreviousVersionState + ${EndIf} + + InitPluginsDir + SetShellVarContext all +FunctionEnd + +Function .onInstSuccess + ${MementoSectionSave} +FunctionEnd + +Function LoadPreviousSettings + ${MementoSectionRestore} + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup + + ReadRegStr $CreateStartMenuGroup HKLM "${REGKEY}" CreateStartMenuGroup + + ${If} $CreateStartMenuGroup == "" + StrCpy $CreateStartMenuGroup 1 + ${EndIf} + + ReadRegStr $CreateDesktopIcon HKLM "${REGKEY}" CreateDesktopIcon + + ${If} $CreateDesktopIcon == "" + StrCpy $CreateDesktopIcon 1 + ${EndIf} + + ${If} ${AtMostWinVista} + ReadRegStr $CreateQuickLaunchIcon HKLM "${REGKEY}" CreateQuickLaunchIcon + + ${If} $CreateQuickLaunchIcon == "" + StrCpy $CreateQuickLaunchIcon 1 + ${EndIf} + ${EndIf} + +FunctionEnd + +Function RunUninstaller + ReadRegStr $R1 HKLM "${UNINST_REGKEY}" "UninstallString" + + ${If} $R1 == "" + Return + ${EndIf} + + ;Run uninstaller + HideWindow + ClearErrors + + ${If} $PreviousVersionState == 0 + ${AndIf} $ReinstallUninstall == 1 + ExecWait '$R1 _?=$INSTDIR' + ${Else} + ExecWait '$R1 /frominstall _?=$INSTDIR' + ${EndIf} + + IfErrors NoRemoveUninstaller + IfFileExists "$INSTDIR\uninstall.exe" 0 NoRemoveUninstaller + Delete "$R1" + RMDir $INSTDIR + +NoRemoveUninstaller: +FunctionEnd + +Function CheckSelectedUIs + !insertmacro SectionFlagIsSet ${SecGrpUI} ${SF_SELECTED} end checkPartial +checkPartial: + !insertmacro SectionFlagIsSet ${SecGrpUI} ${SF_PSELECTED} end displayError +displayError: + MessageBox MB_OK|MB_ICONSTOP "At least one User Interface must be selected." + Abort +end: +FunctionEnd + +LangString INSTALL_OPTS_PAGE_TITLE ${LANG_ENGLISH} "Choose Install Options" +LangString INSTALL_OPTS_PAGE_SUBTITLE ${LANG_ENGLISH} "Choose where to install Avidemux icons." +Var dlgInstallOptions +Var lblCreateIcons +Var chkDesktop +Var chkStartMenu +Var chkQuickLaunch + +Function InstallOptionsPage + Call IsInstallOptionsRequired + !insertmacro MUI_HEADER_TEXT "$(INSTALL_OPTS_PAGE_TITLE)" "$(INSTALL_OPTS_PAGE_SUBTITLE)" + + nsDialogs::Create 1018 + Pop $dlgInstallOptions + + ${If} $dlgInstallOptions == error + Abort + ${EndIf} + + ${NSD_CreateLabel} 0 0u 100% 12u "Create icons for Avidemux:" + Pop $lblCreateIcons + + ${NSD_CreateCheckBox} 0 18u 100% 12u "On my &Desktop" + Pop $chkDesktop + ${NSD_SetState} $chkDesktop $CreateDesktopIcon + ${NSD_OnClick} $chkDesktop UpdateInstallOptions + + ${NSD_CreateCheckBox} 0 36u 100% 12u "In my &Start Menu Programs folder" + Pop $chkStartMenu + ${NSD_SetState} $chkStartMenu $CreateStartMenuGroup + ${NSD_OnClick} $chkStartMenu UpdateInstallOptions + + ${If} ${AtMostWinVista} + ${NSD_CreateCheckBox} 0 54u 100% 12u "In my &Quick Launch bar" + Pop $chkQuickLaunch + ${NSD_SetState} $chkQuickLaunch $CreateQuickLaunchIcon + ${NSD_OnClick} $chkQuickLaunch UpdateInstallOptions + ${EndIf} + #${If} ${IsWin2003} + #WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\avidemux.exe" "WIN2000" + #${EndIf} + #${If} ${IsWinXp} + #WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\avidemux.exe" "WIN2000" + #${EndIf} + nsDialogs::Show +FunctionEnd + +Function UpdateInstallOptions + ${NSD_GetState} $chkDesktop $CreateDesktopIcon + ${NSD_GetState} $chkStartMenu $CreateStartMenuGroup + ${NSD_GetState} $chkQuickLaunch $CreateQuickLaunchIcon +FunctionEnd + +Function IsInstallOptionsRequired +Goto end + !insertmacro SectionFlagIsSet ${SecUiQt} ${SF_SELECTED} end resetOptions +resetOptions: + + StrCpy $CreateDesktopIcon 0 + StrCpy $CreateStartMenuGroup 0 + StrCpy $CreateQuickLaunchIcon 0 + Abort + +end: +FunctionEnd + +Function IsStartMenuRequired + StrCmp $CreateStartMenuGroup 1 +2 + Abort +FunctionEnd + +Function ActivateInternalSections + #AVS Proxy GUI shortcut: + SectionGetFlags ${SecAvsProxy} $0 + IntOp $0 $0 & ${SF_SELECTED} + IntOp $0 $0 & $CreateStartMenuGroup + SectionSetFlags ${SecStartMenuAvsProxyGui} $0 + + #Change Log shortcut: + SectionSetFlags ${SecStartMenuChangeLog} $CreateStartMenuGroup + + #Qt shortcuts: + SectionGetFlags ${SecUiQt} $0 + IntOp $0 $0 & ${SF_SELECTED} + + IntOp $1 $0 & $CreateDesktopIcon + SectionSetFlags ${SecDesktopQt} $1 + + IntOp $1 $0 & $CreateQuickLaunchIcon + SectionSetFlags ${SecQuickLaunchQt} $1 + + IntOp $1 $0 & $CreateStartMenuGroup + SectionSetFlags ${SecStartMenuQt} $1 +FunctionEnd + +Function InstFilesPageShow + ${If} $ReinstallUninstall != "" + Call RunUninstaller + BringToFront + ${EndIf} +FunctionEnd + +Function InstFilesPageLeave + ; Don't advance automatically if details expanded + FindWindow $R0 "#32770" "" $HWNDPARENT + GetDlgItem $R0 $R0 1016 + System::Call user32::IsWindowVisible(i$R0)i.s + Pop $R0 + + StrCmp $R0 0 +2 + SetAutoClose false +FunctionEnd + +Function ConfigureFinishPage + + SectionGetFlags ${SecUiQt} $0 + IntOp $0 $0 & ${SF_SELECTED} + StrCmp $0 ${SF_SELECTED} end + + DeleteINISec "$PLUGINSDIR\ioSpecial.ini" "Field 4" + +end: +FunctionEnd + +Function RunAvidemux + SetOutPath $INSTDIR + + SectionGetFlags ${SecUiQt} $0 + IntOp $0 $0 & ${SF_SELECTED} + + !insertmacro UAC_AsUser_ExecShell "" "$INSTDIR\avidemux.exe" "" "" "" + + Goto end + + +end: +FunctionEnd + +Var ReinstallUninstallButton + +Function ReinstallPage + ${If} $PreviousVersion == "" + Abort + ${EndIf} + + nsDialogs::Create /NOUNLOAD 1018 + Pop $0 + + ${If} $PreviousVersionState == 1 + !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_FULLNAME}." + nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "An older version of Avidemux is installed on your system. Select the operation you want to perform and click Next to continue." + Pop $R0 + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Upgrade Avidemux using previous settings (recommended)" + Pop $ReinstallUninstallButton + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Change settings (advanced)" + Pop $R0 + + ${If} $ReinstallUninstall == "" + StrCpy $ReinstallUninstall 1 + ${EndIf} + ${ElseIf} $PreviousVersionState == 2 + !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_FULLNAME}." + nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "A newer version of Avidemux is already installed! It is not recommended that you downgrade to an older version. Select the operation you want to perform and click Next to continue." + Pop $R0 + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Downgrade Avidemux using previous settings (recommended)" + Pop $ReinstallUninstallButton + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Change settings (advanced)" + Pop $R0 + + ${If} $ReinstallUninstall == "" + StrCpy $ReinstallUninstall 1 + ${EndIf} + ${ElseIf} $PreviousVersionState == 0 + !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform." + nsDialogs::CreateItem /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 0 100% 40 "${PRODUCT_FULLNAME} is already installed. Select the operation you want to perform and click Next to continue." + Pop $R0 + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_VCENTER}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_GROUP}|${WS_TABSTOP} 0 10 55 100% 30 "Add/Remove/Reinstall components" + Pop $R0 + nsDialogs::CreateItem /NOUNLOAD BUTTON ${BS_AUTORADIOBUTTON}|${BS_TOP}|${BS_MULTILINE}|${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 10 85 100% 50 "Uninstall Avidemux" + Pop $ReinstallUninstallButton + + ${If} $ReinstallUninstall == "" + StrCpy $ReinstallUninstall 2 + ${EndIf} + ${Else} + MessageBox MB_ICONSTOP "Unknown value of PreviousVersionState, aborting" /SD IDOK + Abort + ${EndIf} + + ${If} $ReinstallUninstall == "1" + SendMessage $ReinstallUninstallButton ${BM_SETCHECK} 1 0 + ${Else} + SendMessage $R0 ${BM_SETCHECK} 1 0 + ${EndIf} + + nsDialogs::Show +FunctionEnd + +Function ReinstallPageLeave + SendMessage $ReinstallUninstallButton ${BM_GETCHECK} 0 0 $R0 + + ${If} $R0 == 1 + ; Option to uninstall old version selected + StrCpy $ReinstallUninstall 1 + ${Else} + ; Custom up/downgrade or add/remove/reinstall + StrCpy $ReinstallUninstall 2 + ${EndIf} + + ${If} $ReinstallUninstall == 1 + ${If} $PreviousVersionState == 0 + Call RunUninstaller + Quit + ${Else} + ; Need to reload defaults. User could have + ; chosen custom, change something, went back and selected + ; the express option. + Call LoadPreviousSettings + ${EndIf} + ${EndIf} +FunctionEnd + + +########################## +# Uninstaller functions +########################## +Function un.onInit + SetShellVarContext all + +UAC_Elevate: + !insertmacro UAC_RunElevated + StrCmp 1223 $0 UAC_ElevationAborted + StrCmp 0 $0 0 UAC_Err + StrCmp 1 $1 0 UAC_Success + Quit + +UAC_Err: + MessageBox MB_ICONSTOP "Unable to elevate, error $0" + Abort + +UAC_ElevationAborted: + Abort + +UAC_Success: + StrCmp 1 $3 +4 + StrCmp 3 $1 0 UAC_ElevationAborted + MessageBox MB_ICONSTOP "This installer requires admin access." + Goto UAC_Elevate +FunctionEnd + +; TrimNewlines (copied from NSIS documentation) +; input, top of stack (e.g. whatever$/r$/n) +; output, top of stack (replaces, with e.g. whatever) +; modifies no other variables. +Function un.TrimNewlines + Exch $R0 + Push $R1 + Push $R2 + StrCpy $R1 0 + +loop: + IntOp $R1 $R1 - 1 + StrCpy $R2 $R0 1 $R1 + StrCmp $R2 "$\r" loop + StrCmp $R2 "$\n" loop + IntOp $R1 $R1 + 1 + IntCmp $R1 0 no_trim_needed + StrCpy $R0 $R0 $R1 + +no_trim_needed: + Pop $R2 + Pop $R1 + Exch $R0 +FunctionEnd + +Function un.RemoveEmptyDirs + Pop $9 + !define Index 'Line${__LINE__}' + FindFirst $0 $1 "$INSTDIR$9*" + StrCmp $0 "" "${Index}-End" +"${Index}-Loop:" + StrCmp $1 "" "${Index}-End" + StrCmp $1 "." "${Index}-Next" + StrCmp $1 ".." "${Index}-Next" + Push $0 + Push $1 + Push $9 + Push "$9$1\" + Call un.RemoveEmptyDirs + Pop $9 + Pop $1 + Pop $0 +;"${Index}-Remove:" + RMDir "$INSTDIR$9$1" +"${Index}-Next:" + FindNext $0 $1 + Goto "${Index}-Loop" +"${Index}-End:" + FindClose $0 + !undef Index +FunctionEnd + +Function un.ConfirmPagePre + ${un.GetParameters} $R0 + ${un.GetOptions} $R0 "/frominstall" $R1 + ${Unless} ${Errors} + Abort + ${EndUnless} +FunctionEnd + +Function un.FinishPagePre + ${un.GetParameters} $R0 + ${un.GetOptions} $R0 "/frominstall" $R1 + ${Unless} ${Errors} + SetRebootFlag false + Abort + ${EndUnless} +FunctionEnd diff --git a/avidemux/winInstaller/qtifw/config/config.xml.in b/avidemux/winInstaller/qtifw/config/config.xml.in index 43e2a24bf4..998a60ab55 100755 --- a/avidemux/winInstaller/qtifw/config/config.xml.in +++ b/avidemux/winInstaller/qtifw/config/config.xml.in @@ -1,15 +1,15 @@ - - - Avidemux @ADM_FLAVOR@ - @ADM_VERSION@ - Avidemux @ADM_FLAVOR@ - watermark.png - Mean - Modern - avidemux - avidemux - Avidemux @ADM_MENU_VERSION@ @ADM_FLAVOR@ - @ApplicationsDirX64@/Avidemux @ADM_MENU_VERSION@ @ADM_FLAVOR@ - Uninstall Avidemux @ADM_FLAVOR@ - - + + + Avidemux @ADM_FLAVOR@ + @ADM_VERSION@ + Avidemux @ADM_FLAVOR@ + watermark.png + Mean + Modern + avidemux + avidemux + Avidemux @ADM_MENU_VERSION@ @ADM_FLAVOR@ + @ApplicationsDirX64@/Avidemux @ADM_MENU_VERSION@ @ADM_FLAVOR@ + Uninstall Avidemux @ADM_FLAVOR@ + + diff --git a/avidemux/winInstaller/qtifw/packages/org.avidemux.dev/meta/installscript.qs b/avidemux/winInstaller/qtifw/packages/org.avidemux.dev/meta/installscript.qs index e34228fc2f..e48f7dde61 100755 --- a/avidemux/winInstaller/qtifw/packages/org.avidemux.dev/meta/installscript.qs +++ b/avidemux/winInstaller/qtifw/packages/org.avidemux.dev/meta/installscript.qs @@ -1,31 +1,31 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the FOO module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - - - +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + + + diff --git a/avidemux/winInstaller/qtifw/packages/org.avidemux.dev/meta/package.xml.in b/avidemux/winInstaller/qtifw/packages/org.avidemux.dev/meta/package.xml.in index a18286761f..5ef2d670b8 100755 --- a/avidemux/winInstaller/qtifw/packages/org.avidemux.dev/meta/package.xml.in +++ b/avidemux/winInstaller/qtifw/packages/org.avidemux.dev/meta/package.xml.in @@ -1,7 +1,7 @@ - - - Dev files - Avidemux development files, if you want to write plugins - @ADM_VERSION@ - 2010-09-21 - + + + Dev files + Avidemux development files, if you want to write plugins + @ADM_VERSION@ + 2010-09-21 + diff --git a/avidemux/winInstaller/qtifw/packages/org.avidemux.run/data/scripts/auto_uninstall.js b/avidemux/winInstaller/qtifw/packages/org.avidemux.run/data/scripts/auto_uninstall.js index ae1b6062f6..8477947f26 100755 --- a/avidemux/winInstaller/qtifw/packages/org.avidemux.run/data/scripts/auto_uninstall.js +++ b/avidemux/winInstaller/qtifw/packages/org.avidemux.run/data/scripts/auto_uninstall.js @@ -1,23 +1,23 @@ -// Controller script to pass to the uninstaller to get it to run automatically. -// It's passed to the maintenance tool during installation if there is already an -// installation present with: /maintenancetool.exe --script=/scripts/auto_uninstall.qs. -// This is required so that the user doesn't have to see/deal with the uninstaller in the middle of -// an installation. - -function Controller() -{ - gui.clickButton(buttons.NextButton); - gui.clickButton(buttons.NextButton); - - installer.uninstallationFinished.connect(this, this.uninstallationFinished); -} - -Controller.prototype.uninstallationFinished = function() -{ - gui.clickButton(buttons.NextButton); -} - -Controller.prototype.FinishedPageCallback = function() -{ - gui.clickButton(buttons.FinishButton); -} +// Controller script to pass to the uninstaller to get it to run automatically. +// It's passed to the maintenance tool during installation if there is already an +// installation present with: /maintenancetool.exe --script=/scripts/auto_uninstall.qs. +// This is required so that the user doesn't have to see/deal with the uninstaller in the middle of +// an installation. + +function Controller() +{ + gui.clickButton(buttons.NextButton); + gui.clickButton(buttons.NextButton); + + installer.uninstallationFinished.connect(this, this.uninstallationFinished); +} + +Controller.prototype.uninstallationFinished = function() +{ + gui.clickButton(buttons.NextButton); +} + +Controller.prototype.FinishedPageCallback = function() +{ + gui.clickButton(buttons.FinishButton); +} diff --git a/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/installscript.js b/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/installscript.js index 37106aa799..c827d75e73 100755 --- a/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/installscript.js +++ b/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/installscript.js @@ -1,154 +1,154 @@ -/************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Installer Framework. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -**************************************************************************/ - -// Derived from dynamic page example - -var ComponentSelectionPage = null; -var update=false; - -function Controller() -{ - installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes); -} -var Dir = new function () { - this.toNativeSparator = function (path) { - if (systemInfo.productType === "windows") - return path.replace(/\//g, '\\'); - return path; - } -}; - -function Component() -{ - console.log("xxxxxxxxxxxx"); - if (installer.isInstaller()) - { - update=false; - component.loaded.connect(this, Component.prototype.installerLoaded); - ComponentSelectionPage = gui.pageById(QInstaller.ComponentSelection); - - var folder=installer.value( "TargetDir"); - if (installer.fileExists(folder + "/components.xml")) - { - update=true; - // remove old one - // https://stackoverflow.com/questions/46455360/workaround-for-qt-installer-framework-not-overwriting-existing-installation - QMessageBox.question("question","Uninstall","I will now uninstall the previous version of avidemux VC++" , QMessageBox.Yes); - if (installer.fileExists(folder + "/scripts/auto_uninstall.js")) - installer.execute(folder+"/Uninstall Avidemux VC++ 64bits.exe", "--script="+folder+"/scripts/auto_uninstall.js"); - else - installer.execute(folder+"/Uninstall Avidemux VC++ 64bits.exe"); - } - - installer.setDefaultPageVisible(QInstaller.TargetDirectory, !update); - installer.setDefaultPageVisible(QInstaller.ComponentSelection, !update); - installer.setDefaultPageVisible(QInstaller.LicenseCheck, !update); - /* - if (systemInfo.productType === "windows") - installer.setDefaultPageVisible(QInstaller.StartMenuSelection, !update); - */ - installer.setDefaultPageVisible(QInstaller.ReadyForInstallation, false); - } -} -Component.prototype.installerLoaded = function () -{ -/* - if(update==true) - { - QMessageBox.question("quit.question","zzz" , text, QMessageBox.Yes); - } - */ -/* - if (installer.addWizardPage(component, "TargetWidget", QInstaller.TargetDirectory)) - { - var widget = gui.pageWidgetByObjectName("DynamicTargetWidget"); - if (widget != null) { - widget.targetChooser.clicked.connect(this, Component.prototype.chooseTarget); - widget.targetDirectory.textChanged.connect(this, Component.prototype.targetChanged); - - widget.windowTitle = "Installation Folder"; - widget.targetDirectory.text = Dir.toNativeSparator(installer.value("TargetDir")); - } - } - */ -} -Component.prototype.targetChanged = function (text) { -/* - var widget = gui.pageWidgetByObjectName("DynamicTargetWidget"); - - if (widget != null && text != "") - { - if (installer.fileExists(text + "/components.xml")) - { - QMessageBox.question("quit.question","zzz" , text, QMessageBox.Yes); - installer.setValue("TargetDir", text); - update=true; - widget.complete = true; - } - } - if(update==false) - { - installer.setDefaultPageVisible(QInstaller.ComponentSelection, true); - installer.setDefaultPageVisible(QInstaller.LicenseCheck, true); - if (systemInfo.productType === "windows") - installer.setDefaultPageVisible(QInstaller.StartMenuSelection, true); - }else - { - gui.clickButton(buttons.NextButton); - } - */ -} - -Component.prototype.chooseTarget = function () { - QMessageBox.question("quit.question", "chooseTarget", QMessageBox.Yes); - var widget = gui.pageWidgetByObjectName("DynamicTargetWidget"); - if (widget != null) { - var newTarget = QFileDialog.getExistingDirectory("Choose your target directory.", widget.targetDirectory.text); - if (newTarget != "") - widget.targetDirectory.text = Dir.toNativeSparator(newTarget); - } -} - - -Component.prototype.createOperationsForArchive = function(archive) -{ - // don't use the default operation - component.createOperationsForArchive(archive); - component.addOperation("CreateShortcut", - "@TargetDir@/avidemux.exe", - "@StartMenuDir@/avidemux.lnk", - "workingDirectory=@TargetDir@"); - component.addOperation("CreateShortcut", - "@TargetDir@/avidemux_jobs.exe", - "@StartMenuDir@/avidemux_jobs.lnk", - "workingDirectory=@TargetDir@"); - component.addOperation("CreateShortcut", - "@TargetDir@/@MaintenanceToolName@.exe", - "@StartMenuDir@/@MaintenanceToolName@.lnk", - "workingDirectory=@TargetDir@"); -} +/************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Installer Framework. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +**************************************************************************/ + +// Derived from dynamic page example + +var ComponentSelectionPage = null; +var update=false; + +function Controller() +{ + installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes); +} +var Dir = new function () { + this.toNativeSparator = function (path) { + if (systemInfo.productType === "windows") + return path.replace(/\//g, '\\'); + return path; + } +}; + +function Component() +{ + console.log("xxxxxxxxxxxx"); + if (installer.isInstaller()) + { + update=false; + component.loaded.connect(this, Component.prototype.installerLoaded); + ComponentSelectionPage = gui.pageById(QInstaller.ComponentSelection); + + var folder=installer.value( "TargetDir"); + if (installer.fileExists(folder + "/components.xml")) + { + update=true; + // remove old one + // https://stackoverflow.com/questions/46455360/workaround-for-qt-installer-framework-not-overwriting-existing-installation + QMessageBox.question("question","Uninstall","I will now uninstall the previous version of avidemux VC++" , QMessageBox.Yes); + if (installer.fileExists(folder + "/scripts/auto_uninstall.js")) + installer.execute(folder+"/Uninstall Avidemux VC++ 64bits.exe", "--script="+folder+"/scripts/auto_uninstall.js"); + else + installer.execute(folder+"/Uninstall Avidemux VC++ 64bits.exe"); + } + + installer.setDefaultPageVisible(QInstaller.TargetDirectory, !update); + installer.setDefaultPageVisible(QInstaller.ComponentSelection, !update); + installer.setDefaultPageVisible(QInstaller.LicenseCheck, !update); + /* + if (systemInfo.productType === "windows") + installer.setDefaultPageVisible(QInstaller.StartMenuSelection, !update); + */ + installer.setDefaultPageVisible(QInstaller.ReadyForInstallation, false); + } +} +Component.prototype.installerLoaded = function () +{ +/* + if(update==true) + { + QMessageBox.question("quit.question","zzz" , text, QMessageBox.Yes); + } + */ +/* + if (installer.addWizardPage(component, "TargetWidget", QInstaller.TargetDirectory)) + { + var widget = gui.pageWidgetByObjectName("DynamicTargetWidget"); + if (widget != null) { + widget.targetChooser.clicked.connect(this, Component.prototype.chooseTarget); + widget.targetDirectory.textChanged.connect(this, Component.prototype.targetChanged); + + widget.windowTitle = "Installation Folder"; + widget.targetDirectory.text = Dir.toNativeSparator(installer.value("TargetDir")); + } + } + */ +} +Component.prototype.targetChanged = function (text) { +/* + var widget = gui.pageWidgetByObjectName("DynamicTargetWidget"); + + if (widget != null && text != "") + { + if (installer.fileExists(text + "/components.xml")) + { + QMessageBox.question("quit.question","zzz" , text, QMessageBox.Yes); + installer.setValue("TargetDir", text); + update=true; + widget.complete = true; + } + } + if(update==false) + { + installer.setDefaultPageVisible(QInstaller.ComponentSelection, true); + installer.setDefaultPageVisible(QInstaller.LicenseCheck, true); + if (systemInfo.productType === "windows") + installer.setDefaultPageVisible(QInstaller.StartMenuSelection, true); + }else + { + gui.clickButton(buttons.NextButton); + } + */ +} + +Component.prototype.chooseTarget = function () { + QMessageBox.question("quit.question", "chooseTarget", QMessageBox.Yes); + var widget = gui.pageWidgetByObjectName("DynamicTargetWidget"); + if (widget != null) { + var newTarget = QFileDialog.getExistingDirectory("Choose your target directory.", widget.targetDirectory.text); + if (newTarget != "") + widget.targetDirectory.text = Dir.toNativeSparator(newTarget); + } +} + + +Component.prototype.createOperationsForArchive = function(archive) +{ + // don't use the default operation + component.createOperationsForArchive(archive); + component.addOperation("CreateShortcut", + "@TargetDir@/avidemux.exe", + "@StartMenuDir@/avidemux.lnk", + "workingDirectory=@TargetDir@"); + component.addOperation("CreateShortcut", + "@TargetDir@/avidemux_jobs.exe", + "@StartMenuDir@/avidemux_jobs.lnk", + "workingDirectory=@TargetDir@"); + component.addOperation("CreateShortcut", + "@TargetDir@/@MaintenanceToolName@.exe", + "@StartMenuDir@/@MaintenanceToolName@.lnk", + "workingDirectory=@TargetDir@"); +} diff --git a/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/license.txt b/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/license.txt index 89e08fb002..d159169d10 100755 --- a/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/license.txt +++ b/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/license.txt @@ -1,339 +1,339 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/package.xml.in b/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/package.xml.in index 1a269cfa33..bf2d4a6b23 100755 --- a/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/package.xml.in +++ b/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/package.xml.in @@ -1,16 +1,16 @@ - - - Avidemux @ADM_FLAVOR@ - Main files - @ADM_VERSION@ - 2014-12-19 - true - - - targetwidget.ui - - - - - true - + + + Avidemux @ADM_FLAVOR@ + Main files + @ADM_VERSION@ + 2014-12-19 + true + + + targetwidget.ui + + + + + true + diff --git a/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/targetwidget.ui b/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/targetwidget.ui index cd17db5ffb..f652329e70 100755 --- a/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/targetwidget.ui +++ b/avidemux/winInstaller/qtifw/packages/org.avidemux.run/meta/targetwidget.ui @@ -1,83 +1,83 @@ - - - TargetWidget - - - - 0 - 0 - 491 - 190 - - - - - 0 - 0 - - - - - 491 - 190 - - - - Form - - - - - - Please specify the folder where Dynamic Page Installer Example will be installed. - - - - - - - - - true - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - ... - - - - - - - - - Qt::Vertical - - - - 20 - 122 - - - - - - - - - + + + TargetWidget + + + + 0 + 0 + 491 + 190 + + + + + 0 + 0 + + + + + 491 + 190 + + + + Form + + + + + + Please specify the folder where Dynamic Page Installer Example will be installed. + + + + + + + + + true + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + ... + + + + + + + + + Qt::Vertical + + + + 20 + 122 + + + + + + + + + diff --git a/avidemux/winInstaller/qtifw/split.bash b/avidemux/winInstaller/qtifw/split.bash index 0230986aa3..4e89adc028 100755 --- a/avidemux/winInstaller/qtifw/split.bash +++ b/avidemux/winInstaller/qtifw/split.bash @@ -1,27 +1,27 @@ -#/bin/bash -export bash_path=$(cygpath -ua $(dirname $0)) -export src_path=`cygpath -u $1` -export run_path="packages/org.avidemux.run/data/" -export dev_path="packages/org.avidemux.dev/data/" - -if [ ! -d "$src_path" ]; then - echo "Source path does not exist" - exit 1 -fi - -echo "Cleaning" -rm -Rf $run_path -rm -Rf $dev_path -mkdir -p $run_path $dev_path - -echo "Copying" - -cp -Rap $src_path/* $run_path/ -cp -Rap $bash_path/packages/org.avidemux.run/data/scripts $run_path/ -echo "Moving" -mv $run_path/include $dev_path -mv $run_path/*.lib $dev_path -rm $run_path/plugins/*/*.lib -rm -f $run_path/vsscript.dll -rm -f $run_path/vapoursynth.dll -echo "Done" +#/bin/bash +export bash_path=$(cygpath -ua $(dirname $0)) +export src_path=`cygpath -u $1` +export run_path="packages/org.avidemux.run/data/" +export dev_path="packages/org.avidemux.dev/data/" + +if [ ! -d "$src_path" ]; then + echo "Source path does not exist" + exit 1 +fi + +echo "Cleaning" +rm -Rf $run_path +rm -Rf $dev_path +mkdir -p $run_path $dev_path + +echo "Copying" + +cp -Rap $src_path/* $run_path/ +cp -Rap $bash_path/packages/org.avidemux.run/data/scripts $run_path/ +echo "Moving" +mv $run_path/include $dev_path +mv $run_path/*.lib $dev_path +rm $run_path/plugins/*/*.lib +rm -f $run_path/vsscript.dll +rm -f $run_path/vapoursynth.dll +echo "Done" diff --git a/avidemux/winInstaller/revision.xslt b/avidemux/winInstaller/revision.xslt index cd4724c1f7..3fbc69e28d 100644 --- a/avidemux/winInstaller/revision.xslt +++ b/avidemux/winInstaller/revision.xslt @@ -1,12 +1,12 @@ - - - - - - - - !define REVISION - - + + + + + + + + !define REVISION + + \ No newline at end of file diff --git a/avidemux/winInstaller/svnlog.xslt b/avidemux/winInstaller/svnlog.xslt index df06d8b6ff..9551e99f6c 100644 --- a/avidemux/winInstaller/svnlog.xslt +++ b/avidemux/winInstaller/svnlog.xslt @@ -1,132 +1,132 @@ - - - - - - - - - - Avidemux 2.6 Change Log - - -

Avidemux 2.6 Change Log

-
- - - - - - - - -
RevisionDateAuthorDescription
-
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -   - - - - - -   - - - - - - - - - - - - - Jan - Feb - Mar - Apr - May - Jun - Jul - Aug - Sep - Oct - Nov - Dec - - -
+ + + + + + + + + + Avidemux 2.6 Change Log + + +

Avidemux 2.6 Change Log

+
+ + + + + + + + +
RevisionDateAuthorDescription
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +   + + + + + +   + + + + + + + + + + + + + Jan + Feb + Mar + Apr + May + Jun + Jul + Aug + Sep + Oct + Nov + Dec + + +
diff --git a/avidemux_core/ADM_core/include/ADM_crashdump_vs.h b/avidemux_core/ADM_core/include/ADM_crashdump_vs.h index 8a843060c4..f4267d2226 100755 --- a/avidemux_core/ADM_core/include/ADM_crashdump_vs.h +++ b/avidemux_core/ADM_core/include/ADM_crashdump_vs.h @@ -1,11 +1,11 @@ -/** - * \file ADM_crashdump_mingw - * \brief Catch low level error, mingw version - */ -#if defined(_MSC_VER) - -#pragma once -ADM_CORE6_EXPORT void installSigHandler(void); -ADM_CORE6_EXPORT void uninstallSigHandler(void); - -#endif +/** + * \file ADM_crashdump_mingw + * \brief Catch low level error, mingw version + */ +#if defined(_MSC_VER) + +#pragma once +ADM_CORE6_EXPORT void installSigHandler(void); +ADM_CORE6_EXPORT void uninstallSigHandler(void); + +#endif diff --git a/avidemux_core/ADM_core/src/ADM_folder_vs.cpp b/avidemux_core/ADM_core/src/ADM_folder_vs.cpp index d055dcee11..5e2e2dfe21 100755 --- a/avidemux_core/ADM_core/src/ADM_folder_vs.cpp +++ b/avidemux_core/ADM_core/src/ADM_folder_vs.cpp @@ -1,298 +1,298 @@ - /*************************************************************************** - - copyright : (C) 2016 by mean - email : fixounet@free.fr - ***************************************************************************/ - - /*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - - - #include - #include - #include - #include - #include - #include - #include - #include "ADM_win32.h" - #include "ADM_default.h" - -extern char *ADM_getRelativePath(const char *base0, const char *base1, const char *base2, const char *base3); - - #undef fread - #undef fwrite - #undef fopen - #undef fclose - - char *ADM_getInstallRelativePath(const char *base1, const char *base2, const char *base3) - { - - wchar_t wcModuleName[MAX_PATH]; - - GetModuleFileNameW(0, wcModuleName, sizeof(wcModuleName) / sizeof(wchar_t)); - - int len = wideCharStringToUtf8(wcModuleName, -1, NULL); - char *moduleName = new char[len]; - - wideCharStringToUtf8(wcModuleName, -1, moduleName); - - char *slash = strrchr(moduleName, '\\'); - - if (slash) - *slash = '\0'; - - char *relativePath = ADM_getRelativePath(moduleName, base1, base2, base3); - - delete [] moduleName; - - return relativePath; - } - - - - /** - \fn ADM_fopen - \brief utf8 aware fopen, so that we can use utf8 string even on win32 - */ - FILE *ADM_fopen(const char *file, const char *mode) - { - - // Override fopen to handle Unicode filenames and to ensure exclusive access when initially writing to a file. - int fileNameLength = utf8StringToWideChar(file, -1, NULL); - wchar_t *wcFile = new wchar_t[fileNameLength]; - int creation = 0, access = 0; - HANDLE hFile; - - utf8StringToWideChar(file, -1, wcFile); - - while (true) - { - if (strchr(mode, 'w')) - { - creation = CREATE_ALWAYS; - access = GENERIC_WRITE; - - if (strchr(mode, '+')) - access |= GENERIC_READ; - } - else if (strchr(mode, 'r')) - { - creation = OPEN_EXISTING; - access = GENERIC_READ; - - if (strchr(mode, '+')) - access = GENERIC_WRITE; - } - else if (strchr(mode, 'a')) - { - creation = OPEN_ALWAYS; - access = GENERIC_WRITE; - - if (strchr(mode, '+')) - access |= GENERIC_READ; - } - - if (creation & GENERIC_WRITE) - { - hFile = CreateFileW(wcFile, access, 0, NULL, creation, 0, NULL); - - if (hFile == INVALID_HANDLE_VALUE) - break; - else - CloseHandle(hFile); - } - - hFile = CreateFileW(wcFile, access, FILE_SHARE_READ, NULL, creation, 0, NULL); - break; - } - - delete [] wcFile; - - if (hFile == INVALID_HANDLE_VALUE) - return NULL; - else - return _fdopen(_open_osfhandle((intptr_t)hFile, 0), mode); - } - - - extern "C" - { - // libavformat uses open (in the file_open function) so we need to override that too. - // Following the same rules as ADM_fopen. - int ADM_open(const char *path, int oflag, ...) - { - int fileNameLength = utf8StringToWideChar(path, -1, NULL); - wchar_t *wcFile = new wchar_t[fileNameLength]; - int creation = 0, access = 0; - HANDLE hFile; - - utf8StringToWideChar(path, -1, wcFile); - - delete [] wcFile; - - if (oflag & O_WRONLY || oflag & O_RDWR) - { - access = GENERIC_WRITE; - - if (oflag & O_RDWR) - access |= GENERIC_READ; - - if (oflag & O_CREAT) - { - if (oflag & O_EXCL) - creation = CREATE_NEW; - else if (oflag & O_TRUNC) - creation = CREATE_ALWAYS; - else - creation = OPEN_ALWAYS; - } - else if (oflag & O_TRUNC) - creation = TRUNCATE_EXISTING; - } - else if (oflag & O_RDONLY) - creation = OPEN_EXISTING; - - if (creation & GENERIC_WRITE) - { - hFile = CreateFileW(wcFile, access, 0, NULL, creation, 0, NULL); - - if (hFile == INVALID_HANDLE_VALUE) - return -1; - else - CloseHandle(hFile); - } - - hFile = CreateFileW(wcFile, access, FILE_SHARE_READ, NULL, creation, 0, NULL); - - if (hFile == INVALID_HANDLE_VALUE) - return -1; - else - return _open_osfhandle((intptr_t)hFile, oflag); - } - } - - - /*---------------------------------------- - Create a directory - If it already exists, do nothing - ------------------------------------------*/ - uint8_t ADM_mkdir(const char *dirname) - { - - int dirNameLength = utf8StringToWideChar(dirname, -1, NULL); - wchar_t *dirname2 = new wchar_t[dirNameLength]; - utf8StringToWideChar(dirname, -1, dirname2); - int er = _wmkdir(dirname2); - delete[] dirname2; - uint8_t retVal = 0; - - - if (er != -1) - retVal = true; - else - { - if (errno == EEXIST) - retVal = true; - else - { - ADM_warning("Failed to create folder %s with error %d\n", dirname, errno); - retVal = false; - } - } - - - return retVal; - } - - - - // Convert string from Wide Char to ANSI code page - static int wideCharStringToAnsi(const wchar_t *wideCharString, int wideCharStringLength, char *ansiString, const char *filler) - { - int flags = WC_COMPOSITECHECK; - - if (filler) - flags |= WC_NO_BEST_FIT_CHARS | WC_DEFAULTCHAR; - - int ansiStringLen = WideCharToMultiByte(CP_ACP, flags, wideCharString, wideCharStringLength, NULL, 0, filler, NULL); - - if (ansiString) - WideCharToMultiByte(CP_ACP, flags, wideCharString, wideCharStringLength, ansiString, ansiStringLen, filler, NULL); - - return ansiStringLen; - } -/** - * \fn buildDirectoryContent - * \brief Returns the content of a dir with the extension ext. The receiving vector must be allocated by caller - */ -uint8_t buildDirectoryContent(const char *base, std::vector *list, const char *ext) - { - std::string joker = base; - joker += "/*."; - joker += ext; - - list->clear(); - - int dirNameLength = utf8StringToWideChar(joker.c_str(), -1, NULL); - wchar_t *base2 = new wchar_t[dirNameLength]; - utf8StringToWideChar(joker.c_str(), -1, base2); -//-- - HANDLE hFind; - WIN32_FIND_DATAW FindFileData; - - hFind = FindFirstFileW(base2,&FindFileData); - if(hFind == INVALID_HANDLE_VALUE) - { - ADM_warning("Cannot list content of %s\n", base); - delete[] base2; - return true; - } - - do - { - WCHAR *wname = FindFileData.cFileName; - //int wideCharStringToAnsi(const wchar_t *wideCharString, int wideCharStringLength, char *ansiString, const char *filler) - int nameLength = wideCharStringToUtf8(wname, -1, NULL); - char *shortName = new char[nameLength]; - nameLength = wideCharStringToUtf8(wname, -1, shortName); - std::string item = base; - item += ADM_SEPARATOR; - item += shortName; - list->push_back(item); - delete[] shortName; - - } while (FindNextFileW(hFind, &FindFileData)); - FindClose(hFind); - - delete[] base2; - std::sort(list->begin(),list->end()); - return true; - } - - /** - \fn ADM_copyFile - */ - uint8_t ADM_renameFile(const char *source, const char *target) - { - - int sourceFileNameLength = utf8StringToWideChar(source, -1, NULL); - int targetFileNameLength = utf8StringToWideChar(target, -1, NULL); - wchar_t *wcFileSource=(wchar_t*)_alloca(sourceFileNameLength*sizeof(wchar_t)); - wchar_t *wcFileTarget= (wchar_t*)_alloca(targetFileNameLength * sizeof(wchar_t)); - - utf8StringToWideChar(source, -1, wcFileSource); - utf8StringToWideChar(target, -1, wcFileTarget); - - if(!_wrename(wcFileSource,wcFileTarget)) return true; - ADM_error("Failed to rename %s to %s\n",source,target); - return false; - } - -// EOF + /*************************************************************************** + + copyright : (C) 2016 by mean + email : fixounet@free.fr + ***************************************************************************/ + + /*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + + + #include + #include + #include + #include + #include + #include + #include + #include "ADM_win32.h" + #include "ADM_default.h" + +extern char *ADM_getRelativePath(const char *base0, const char *base1, const char *base2, const char *base3); + + #undef fread + #undef fwrite + #undef fopen + #undef fclose + + char *ADM_getInstallRelativePath(const char *base1, const char *base2, const char *base3) + { + + wchar_t wcModuleName[MAX_PATH]; + + GetModuleFileNameW(0, wcModuleName, sizeof(wcModuleName) / sizeof(wchar_t)); + + int len = wideCharStringToUtf8(wcModuleName, -1, NULL); + char *moduleName = new char[len]; + + wideCharStringToUtf8(wcModuleName, -1, moduleName); + + char *slash = strrchr(moduleName, '\\'); + + if (slash) + *slash = '\0'; + + char *relativePath = ADM_getRelativePath(moduleName, base1, base2, base3); + + delete [] moduleName; + + return relativePath; + } + + + + /** + \fn ADM_fopen + \brief utf8 aware fopen, so that we can use utf8 string even on win32 + */ + FILE *ADM_fopen(const char *file, const char *mode) + { + + // Override fopen to handle Unicode filenames and to ensure exclusive access when initially writing to a file. + int fileNameLength = utf8StringToWideChar(file, -1, NULL); + wchar_t *wcFile = new wchar_t[fileNameLength]; + int creation = 0, access = 0; + HANDLE hFile; + + utf8StringToWideChar(file, -1, wcFile); + + while (true) + { + if (strchr(mode, 'w')) + { + creation = CREATE_ALWAYS; + access = GENERIC_WRITE; + + if (strchr(mode, '+')) + access |= GENERIC_READ; + } + else if (strchr(mode, 'r')) + { + creation = OPEN_EXISTING; + access = GENERIC_READ; + + if (strchr(mode, '+')) + access = GENERIC_WRITE; + } + else if (strchr(mode, 'a')) + { + creation = OPEN_ALWAYS; + access = GENERIC_WRITE; + + if (strchr(mode, '+')) + access |= GENERIC_READ; + } + + if (creation & GENERIC_WRITE) + { + hFile = CreateFileW(wcFile, access, 0, NULL, creation, 0, NULL); + + if (hFile == INVALID_HANDLE_VALUE) + break; + else + CloseHandle(hFile); + } + + hFile = CreateFileW(wcFile, access, FILE_SHARE_READ, NULL, creation, 0, NULL); + break; + } + + delete [] wcFile; + + if (hFile == INVALID_HANDLE_VALUE) + return NULL; + else + return _fdopen(_open_osfhandle((intptr_t)hFile, 0), mode); + } + + + extern "C" + { + // libavformat uses open (in the file_open function) so we need to override that too. + // Following the same rules as ADM_fopen. + int ADM_open(const char *path, int oflag, ...) + { + int fileNameLength = utf8StringToWideChar(path, -1, NULL); + wchar_t *wcFile = new wchar_t[fileNameLength]; + int creation = 0, access = 0; + HANDLE hFile; + + utf8StringToWideChar(path, -1, wcFile); + + delete [] wcFile; + + if (oflag & O_WRONLY || oflag & O_RDWR) + { + access = GENERIC_WRITE; + + if (oflag & O_RDWR) + access |= GENERIC_READ; + + if (oflag & O_CREAT) + { + if (oflag & O_EXCL) + creation = CREATE_NEW; + else if (oflag & O_TRUNC) + creation = CREATE_ALWAYS; + else + creation = OPEN_ALWAYS; + } + else if (oflag & O_TRUNC) + creation = TRUNCATE_EXISTING; + } + else if (oflag & O_RDONLY) + creation = OPEN_EXISTING; + + if (creation & GENERIC_WRITE) + { + hFile = CreateFileW(wcFile, access, 0, NULL, creation, 0, NULL); + + if (hFile == INVALID_HANDLE_VALUE) + return -1; + else + CloseHandle(hFile); + } + + hFile = CreateFileW(wcFile, access, FILE_SHARE_READ, NULL, creation, 0, NULL); + + if (hFile == INVALID_HANDLE_VALUE) + return -1; + else + return _open_osfhandle((intptr_t)hFile, oflag); + } + } + + + /*---------------------------------------- + Create a directory + If it already exists, do nothing + ------------------------------------------*/ + uint8_t ADM_mkdir(const char *dirname) + { + + int dirNameLength = utf8StringToWideChar(dirname, -1, NULL); + wchar_t *dirname2 = new wchar_t[dirNameLength]; + utf8StringToWideChar(dirname, -1, dirname2); + int er = _wmkdir(dirname2); + delete[] dirname2; + uint8_t retVal = 0; + + + if (er != -1) + retVal = true; + else + { + if (errno == EEXIST) + retVal = true; + else + { + ADM_warning("Failed to create folder %s with error %d\n", dirname, errno); + retVal = false; + } + } + + + return retVal; + } + + + + // Convert string from Wide Char to ANSI code page + static int wideCharStringToAnsi(const wchar_t *wideCharString, int wideCharStringLength, char *ansiString, const char *filler) + { + int flags = WC_COMPOSITECHECK; + + if (filler) + flags |= WC_NO_BEST_FIT_CHARS | WC_DEFAULTCHAR; + + int ansiStringLen = WideCharToMultiByte(CP_ACP, flags, wideCharString, wideCharStringLength, NULL, 0, filler, NULL); + + if (ansiString) + WideCharToMultiByte(CP_ACP, flags, wideCharString, wideCharStringLength, ansiString, ansiStringLen, filler, NULL); + + return ansiStringLen; + } +/** + * \fn buildDirectoryContent + * \brief Returns the content of a dir with the extension ext. The receiving vector must be allocated by caller + */ +uint8_t buildDirectoryContent(const char *base, std::vector *list, const char *ext) + { + std::string joker = base; + joker += "/*."; + joker += ext; + + list->clear(); + + int dirNameLength = utf8StringToWideChar(joker.c_str(), -1, NULL); + wchar_t *base2 = new wchar_t[dirNameLength]; + utf8StringToWideChar(joker.c_str(), -1, base2); +//-- + HANDLE hFind; + WIN32_FIND_DATAW FindFileData; + + hFind = FindFirstFileW(base2,&FindFileData); + if(hFind == INVALID_HANDLE_VALUE) + { + ADM_warning("Cannot list content of %s\n", base); + delete[] base2; + return true; + } + + do + { + WCHAR *wname = FindFileData.cFileName; + //int wideCharStringToAnsi(const wchar_t *wideCharString, int wideCharStringLength, char *ansiString, const char *filler) + int nameLength = wideCharStringToUtf8(wname, -1, NULL); + char *shortName = new char[nameLength]; + nameLength = wideCharStringToUtf8(wname, -1, shortName); + std::string item = base; + item += ADM_SEPARATOR; + item += shortName; + list->push_back(item); + delete[] shortName; + + } while (FindNextFileW(hFind, &FindFileData)); + FindClose(hFind); + + delete[] base2; + std::sort(list->begin(),list->end()); + return true; + } + + /** + \fn ADM_copyFile + */ + uint8_t ADM_renameFile(const char *source, const char *target) + { + + int sourceFileNameLength = utf8StringToWideChar(source, -1, NULL); + int targetFileNameLength = utf8StringToWideChar(target, -1, NULL); + wchar_t *wcFileSource=(wchar_t*)_alloca(sourceFileNameLength*sizeof(wchar_t)); + wchar_t *wcFileTarget= (wchar_t*)_alloca(targetFileNameLength * sizeof(wchar_t)); + + utf8StringToWideChar(source, -1, wcFileSource); + utf8StringToWideChar(target, -1, wcFileTarget); + + if(!_wrename(wcFileSource,wcFileTarget)) return true; + ADM_error("Failed to rename %s to %s\n",source,target); + return false; + } + +// EOF diff --git a/avidemux_core/ADM_coreSubtitles/include/ADM_coreSubtitles_export.h b/avidemux_core/ADM_coreSubtitles/include/ADM_coreSubtitles_export.h index cf5d0fbbe9..2f4506a740 100755 --- a/avidemux_core/ADM_coreSubtitles/include/ADM_coreSubtitles_export.h +++ b/avidemux_core/ADM_coreSubtitles/include/ADM_coreSubtitles_export.h @@ -1,53 +1,53 @@ - -#ifndef ADM_CORESUBTITLES6_EXPORT_H -#define ADM_CORESUBTITLES6_EXPORT_H - -#ifdef ADM_CORESUBTITLE6_STATIC_DEFINE -# define ADM_CORESUBTITLES6_EXPORT -# define ADM_CORESUBTITLE6_NO_EXPORT -#else -# ifndef ADM_CORESUBTITLES6_EXPORT -# ifdef ADM_coreSubtitles6_EXPORTS - /* We are building this library */ -# ifdef _WIN32 -# define ADM_CORESUBTITLES6_EXPORT __declspec(dllexport) -# else -# define ADM_CORESUBTITLES6_EXPORT __attribute__((visibility("default"))) -# endif -# else - /* We are using this library */ -# ifdef _WIN32 -# define ADM_CORESUBTITLES6_EXPORT __declspec(dllimport) -# else -# define ADM_CORESUBTITLES6_EXPORT __attribute__((visibility("default"))) -# endif -# endif -# endif - -# ifndef ADM_CORESUBTITLE6_NO_EXPORT -# ifdef _WIN32 -# define ADM_CORESUBTITLE6_NO_EXPORT -# else -# define ADM_CORESUBTITLE6_NO_EXPORT __attribute__((visibility("hidden"))) -# endif -# endif -#endif - -#ifndef ADM_CORESUBTITLE6_DEPRECATED -# ifdef __GNUC__ -# define ADM_CORESUBTITLE6_DEPRECATED __attribute__ ((__deprecated__)) -# define ADM_CORESUBTITLE6_DEPRECATED_EXPORT ADM_CORESUBTITLES6_EXPORT __attribute__ ((__deprecated__)) -# define ADM_CORESUBTITLE6_DEPRECATED_NO_EXPORT ADM_CORESUBTITLE6_NO_EXPORT __attribute__ ((__deprecated__)) -# elif defined(_WIN32) -# define ADM_CORESUBTITLE6_DEPRECATED __declspec(deprecated) -# define ADM_CORESUBTITLE6_DEPRECATED_EXPORT ADM_CORESUBTITLES6_EXPORT __declspec(deprecated) -# define ADM_CORESUBTITLE6_DEPRECATED_NO_EXPORT ADM_CORESUBTITLE6_NO_EXPORT __declspec(deprecated) -# endif -#endif - -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define ADM_CORESUBTITLE6_NO_DEPRECATED -#endif - -#endif + +#ifndef ADM_CORESUBTITLES6_EXPORT_H +#define ADM_CORESUBTITLES6_EXPORT_H + +#ifdef ADM_CORESUBTITLE6_STATIC_DEFINE +# define ADM_CORESUBTITLES6_EXPORT +# define ADM_CORESUBTITLE6_NO_EXPORT +#else +# ifndef ADM_CORESUBTITLES6_EXPORT +# ifdef ADM_coreSubtitles6_EXPORTS + /* We are building this library */ +# ifdef _WIN32 +# define ADM_CORESUBTITLES6_EXPORT __declspec(dllexport) +# else +# define ADM_CORESUBTITLES6_EXPORT __attribute__((visibility("default"))) +# endif +# else + /* We are using this library */ +# ifdef _WIN32 +# define ADM_CORESUBTITLES6_EXPORT __declspec(dllimport) +# else +# define ADM_CORESUBTITLES6_EXPORT __attribute__((visibility("default"))) +# endif +# endif +# endif + +# ifndef ADM_CORESUBTITLE6_NO_EXPORT +# ifdef _WIN32 +# define ADM_CORESUBTITLE6_NO_EXPORT +# else +# define ADM_CORESUBTITLE6_NO_EXPORT __attribute__((visibility("hidden"))) +# endif +# endif +#endif + +#ifndef ADM_CORESUBTITLE6_DEPRECATED +# ifdef __GNUC__ +# define ADM_CORESUBTITLE6_DEPRECATED __attribute__ ((__deprecated__)) +# define ADM_CORESUBTITLE6_DEPRECATED_EXPORT ADM_CORESUBTITLES6_EXPORT __attribute__ ((__deprecated__)) +# define ADM_CORESUBTITLE6_DEPRECATED_NO_EXPORT ADM_CORESUBTITLE6_NO_EXPORT __attribute__ ((__deprecated__)) +# elif defined(_WIN32) +# define ADM_CORESUBTITLE6_DEPRECATED __declspec(deprecated) +# define ADM_CORESUBTITLE6_DEPRECATED_EXPORT ADM_CORESUBTITLES6_EXPORT __declspec(deprecated) +# define ADM_CORESUBTITLE6_DEPRECATED_NO_EXPORT ADM_CORESUBTITLE6_NO_EXPORT __declspec(deprecated) +# endif +#endif + +#define DEFINE_NO_DEPRECATED 0 +#if DEFINE_NO_DEPRECATED +# define ADM_CORESUBTITLE6_NO_DEPRECATED +#endif + +#endif diff --git a/avidemux_core/ADM_coreSubtitles/src/CMakeLists.txt b/avidemux_core/ADM_coreSubtitles/src/CMakeLists.txt index b979e6fa67..680c05806d 100644 --- a/avidemux_core/ADM_coreSubtitles/src/CMakeLists.txt +++ b/avidemux_core/ADM_coreSubtitles/src/CMakeLists.txt @@ -1,6 +1,6 @@ -SET(ADM_core_subtitles_SRCS ADM_coreSubtitles.cpp ADM_subLoader.cpp ADM_subConvert.cpp) -INCLUDE_DIRECTORIES(../include) -# We force the use of fontconfig -ADM_ADD_SHARED_LIBRARY(ADM_coreSubtitles6 ${ADM_core_subtitles_SRCS}) -TARGET_LINK_LIBRARIES(ADM_coreSubtitles6 ADM_core6 ) -ADM_INSTALL_LIB(ADM_coreSubtitles6) +SET(ADM_core_subtitles_SRCS ADM_coreSubtitles.cpp ADM_subLoader.cpp ADM_subConvert.cpp) +INCLUDE_DIRECTORIES(../include) +# We force the use of fontconfig +ADM_ADD_SHARED_LIBRARY(ADM_coreSubtitles6 ${ADM_core_subtitles_SRCS}) +TARGET_LINK_LIBRARIES(ADM_coreSubtitles6 ADM_core6 ) +ADM_INSTALL_LIB(ADM_coreSubtitles6) diff --git a/avidemux_core/ffmpeg_package/patches/createPatches.sh b/avidemux_core/ffmpeg_package/patches/createPatches.sh index 72fe2e2950..2074115198 100644 --- a/avidemux_core/ffmpeg_package/patches/createPatches.sh +++ b/avidemux_core/ffmpeg_package/patches/createPatches.sh @@ -1,47 +1,47 @@ -#!/bin/bash - -export curDir=$PWD -export ffmpegPath=$PWD/source -export origFfmpegPath=$PWD/ffmpeg - -echo Updating patches in $ffmpegPath - -function updatePatch { - #cd $ffmpegPath - #cp $1/$2 $1/$2.new - #svn revert $1/$2 - #unix2dos $1/$2 - #unix2dos $1/$2.new - #mv $1/$2 $1/$2.old - #mv $1/$2.new $1/$2 - #diff -u $1/$2.old $1/$2 > $curDir/$1_$2.patch - #rm $1/$2.old - #cd $curDir - #dos2unix $1_$2.patch - - cd $ffmpegPath - unix2dos $1/$2 - unix2dos $origFfmpegPath/$1/$2 - diff -u $origFfmpegPath/$1/$2 $1/$2 > $curDir/${1//\//_}_$2.patch - cd $curDir - dos2unix ${1//\//_}_$2.patch -} - -updatePatch libavcodec avcodec.h -updatePatch libavcodec golomb.h -updatePatch libavcodec h263dec.c -updatePatch libavcodec h264_parser.c -updatePatch libavcodec libavcodec.v -updatePatch libavcodec mathops.h -updatePatch libavcodec mpeg12enc.c -updatePatch libavcodec mpegvideo_enc.c -updatePatch libavcodec put_bits.h -updatePatch libavcodec vdpau.h -updatePatch libavcodec/x86 fmtconvert_init.c -updatePatch libavformat isom.c -updatePatch libavformat matroskaenc.c -updatePatch libavformat mpegtsenc.c -updatePatch libavutil avutil.h -updatePatch libavutil common.h -updatePatch libavutil lfg.c +#!/bin/bash + +export curDir=$PWD +export ffmpegPath=$PWD/source +export origFfmpegPath=$PWD/ffmpeg + +echo Updating patches in $ffmpegPath + +function updatePatch { + #cd $ffmpegPath + #cp $1/$2 $1/$2.new + #svn revert $1/$2 + #unix2dos $1/$2 + #unix2dos $1/$2.new + #mv $1/$2 $1/$2.old + #mv $1/$2.new $1/$2 + #diff -u $1/$2.old $1/$2 > $curDir/$1_$2.patch + #rm $1/$2.old + #cd $curDir + #dos2unix $1_$2.patch + + cd $ffmpegPath + unix2dos $1/$2 + unix2dos $origFfmpegPath/$1/$2 + diff -u $origFfmpegPath/$1/$2 $1/$2 > $curDir/${1//\//_}_$2.patch + cd $curDir + dos2unix ${1//\//_}_$2.patch +} + +updatePatch libavcodec avcodec.h +updatePatch libavcodec golomb.h +updatePatch libavcodec h263dec.c +updatePatch libavcodec h264_parser.c +updatePatch libavcodec libavcodec.v +updatePatch libavcodec mathops.h +updatePatch libavcodec mpeg12enc.c +updatePatch libavcodec mpegvideo_enc.c +updatePatch libavcodec put_bits.h +updatePatch libavcodec vdpau.h +updatePatch libavcodec/x86 fmtconvert_init.c +updatePatch libavformat isom.c +updatePatch libavformat matroskaenc.c +updatePatch libavformat mpegtsenc.c +updatePatch libavutil avutil.h +updatePatch libavutil common.h +updatePatch libavutil lfg.c updatePatch libavutil lfg.h \ No newline at end of file diff --git a/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/ADM_libMad/CMakeLists.txt b/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/ADM_libMad/CMakeLists.txt index ed988d4590..86f4200731 100644 --- a/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/ADM_libMad/CMakeLists.txt +++ b/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/ADM_libMad/CMakeLists.txt @@ -1,19 +1,19 @@ -SET(ADM_LIB ADM_libMad) - - -SET(${ADM_LIB}_SRCS - bit.c decoder.c fixed.c frame.c huffman.c layer12.c layer3.c - stream.c synth.c timer.c version.c) - -ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) - -IF (UNIX) - ADD_TARGET_CFLAGS(${ADM_LIB} -fPIC) -ENDIF (UNIX) - -IF (ADM_BIG_ENDIAN) - ADD_TARGET_CFLAGS(${ADM_LIB} "-DWORDS_BIGENDIAN") -ENDIF (ADM_BIG_ENDIAN) - -INIT_AUDIO_PLUGIN(${ADM_LIB}) -TARGET_LINK_LIBRARIES(${ADM_LIB} ADM_core6) +SET(ADM_LIB ADM_libMad) + + +SET(${ADM_LIB}_SRCS + bit.c decoder.c fixed.c frame.c huffman.c layer12.c layer3.c + stream.c synth.c timer.c version.c) + +ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) + +IF (UNIX) + ADD_TARGET_CFLAGS(${ADM_LIB} -fPIC) +ENDIF (UNIX) + +IF (ADM_BIG_ENDIAN) + ADD_TARGET_CFLAGS(${ADM_LIB} "-DWORDS_BIGENDIAN") +ENDIF (ADM_BIG_ENDIAN) + +INIT_AUDIO_PLUGIN(${ADM_LIB}) +TARGET_LINK_LIBRARIES(${ADM_LIB} ADM_core6) diff --git a/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/CMakeLists.txt b/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/CMakeLists.txt index 3deb3e49c1..f6b7cb547e 100644 --- a/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/CMakeLists.txt +++ b/avidemux_plugins/ADM_audioDecoders/ADM_ad_mad/CMakeLists.txt @@ -1,34 +1,34 @@ -INCLUDE(ad_plugin) - -IF(MSVC) - ADD_DEFINITIONS("-DFPM_DEFAULT") -ENDIF(MSVC) - -IF (ADM_CPU_X86_32) - ADD_DEFINITIONS("-DFPM_INTEL") -ELSEIF (ADM_CPU_X86_64 OR ADM_CPU_ARM64 OR ADM_CPU_RISCV OR ADM_CPU_RISCV_64 OR ADM_CPU_LOONGARCH64) - ADD_DEFINITIONS("-DFPM_DEFAULT") -ELSEIF (ADM_CPU_PPC) - ADD_DEFINITIONS("-DFPM_PPC") -ELSEIF (ADM_CPU_ARMEL) - ADD_DEFINITIONS("-DFPM_ARM") -ENDIF (ADM_CPU_X86_32) - -IF(NOT USE_EXTERNAL_LIBMAD) - ADD_SUBDIRECTORY(ADM_libMad) -ENDIF() - -ADD_DEFINITIONS("-DHAVE_ASSERT_H") -SET(ADM_ad_Mad_SRCS ADM_ad_mad.cpp) - -ADD_AUDIO_DECODER( ADM_ad_Mad ${ADM_ad_Mad_SRCS}) - -IF(USE_EXTERNAL_LIBMAD) - ADD_DEFINITIONS("-DUSE_EXTERNAL_LIBMAD") - TARGET_LINK_LIBRARIES(ADM_ad_Mad ${LIBMAD_LIBRARIES}) -ELSE() - TARGET_LINK_LIBRARIES(ADM_ad_Mad ADM_libMad) -ENDIF() - -INIT_AUDIO_PLUGIN(ADM_ad_Mad) -INSTALL_AUDIODECODER(ADM_ad_Mad) +INCLUDE(ad_plugin) + +IF(MSVC) + ADD_DEFINITIONS("-DFPM_DEFAULT") +ENDIF(MSVC) + +IF (ADM_CPU_X86_32) + ADD_DEFINITIONS("-DFPM_INTEL") +ELSEIF (ADM_CPU_X86_64 OR ADM_CPU_ARM64 OR ADM_CPU_RISCV OR ADM_CPU_RISCV_64 OR ADM_CPU_LOONGARCH64) + ADD_DEFINITIONS("-DFPM_DEFAULT") +ELSEIF (ADM_CPU_PPC) + ADD_DEFINITIONS("-DFPM_PPC") +ELSEIF (ADM_CPU_ARMEL) + ADD_DEFINITIONS("-DFPM_ARM") +ENDIF (ADM_CPU_X86_32) + +IF(NOT USE_EXTERNAL_LIBMAD) + ADD_SUBDIRECTORY(ADM_libMad) +ENDIF() + +ADD_DEFINITIONS("-DHAVE_ASSERT_H") +SET(ADM_ad_Mad_SRCS ADM_ad_mad.cpp) + +ADD_AUDIO_DECODER( ADM_ad_Mad ${ADM_ad_Mad_SRCS}) + +IF(USE_EXTERNAL_LIBMAD) + ADD_DEFINITIONS("-DUSE_EXTERNAL_LIBMAD") + TARGET_LINK_LIBRARIES(ADM_ad_Mad ${LIBMAD_LIBRARIES}) +ELSE() + TARGET_LINK_LIBRARIES(ADM_ad_Mad ADM_libMad) +ENDIF() + +INIT_AUDIO_PLUGIN(ADM_ad_Mad) +INSTALL_AUDIODECODER(ADM_ad_Mad) diff --git a/avidemux_plugins/ADM_autoScrips/CMakeLists.txt b/avidemux_plugins/ADM_autoScrips/CMakeLists.txt index 4aa3ab1132..01a4bf2b3f 100644 --- a/avidemux_plugins/ADM_autoScrips/CMakeLists.txt +++ b/avidemux_plugins/ADM_autoScrips/CMakeLists.txt @@ -1,7 +1,7 @@ -SET(AUTOSCRIPT_DIR "${AVIDEMUX_LIB_DIR}/${ADM_PLUGIN_DIR}/autoScripts/") - -FILE(GLOB py_files ${CMAKE_CURRENT_SOURCE_DIR}/*.py) -FILE(GLOB py_libFiles ${CMAKE_CURRENT_SOURCE_DIR}/lib/*.py) -INSTALL(FILES ${py_files} DESTINATION "${AUTOSCRIPT_DIR}" COMPONENT plugins) -INSTALL(FILES ${py_libFiles} DESTINATION "${AUTOSCRIPT_DIR}/lib" COMPONENT plugins) - +SET(AUTOSCRIPT_DIR "${AVIDEMUX_LIB_DIR}/${ADM_PLUGIN_DIR}/autoScripts/") + +FILE(GLOB py_files ${CMAKE_CURRENT_SOURCE_DIR}/*.py) +FILE(GLOB py_libFiles ${CMAKE_CURRENT_SOURCE_DIR}/lib/*.py) +INSTALL(FILES ${py_files} DESTINATION "${AUTOSCRIPT_DIR}" COMPONENT plugins) +INSTALL(FILES ${py_libFiles} DESTINATION "${AUTOSCRIPT_DIR}/lib" COMPONENT plugins) + diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvs.cpp b/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvs.cpp index 0b269515fa..360c8e857d 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvs.cpp +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvs.cpp @@ -1,446 +1,446 @@ -/** ************************************************************************* - \file ADM_nativeAv.cpp - \brief Native AVISynth demuxer - contains code derived from Avs2YUV by Loren Merritt - copyright : (C) 2019 by mean - email : fixounet@free.fr - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "ADM_default.h" -#include "ADM_Video.h" -#include "ADM_assert.h" - -#include "fourcc.h" -#include "DIA_coreToolkit.h" -#include "ADM_nativeAvs.h" -#include "ADM_image.h" - -/** -*/ -const AVS_Linkage *AVS_linkage = 0; -static IScriptEnvironment *env=NULL; -static bool tried = false; -#if 0 -#define aprintf printf -#else -#define aprintf(...) {} -#endif -#define nbImage _videostream.dwLength - -typedef IScriptEnvironment * __stdcall DLLFUNC(int); - -/** -*/ -static bool tryColdInit(void) -{ - DLLFUNC *CreateScriptEnvironment = NULL; - ADM_info("Loading Avisynth.dll \n"); - HMODULE instance = LoadLibrary("avisynth.dll"); - if (!instance) - { - ADM_warning("Cannot load avisynth dll\n"); - return false; - } - ADM_info("Avisynth.dll loaded\n"); - CreateScriptEnvironment = (DLLFUNC *)GetProcAddress(instance, "CreateScriptEnvironment"); - if (!CreateScriptEnvironment) - { - ADM_warning("failed to load CreateScriptEnvironment()\n"); - return false; - } - try - { - env = CreateScriptEnvironment(AVISYNTH_INTERFACE_VERSION); - if (!env) - { - ADM_warning("Create Env failed\n"); - return false; - } - AVS_linkage = env->GetAVSLinkage(); - } - catch (AvisynthError err) - { - ADM_warning("Avisynth error:\n%s\n", err.msg); - return false; - } - return true; -} -/** -*/ -static bool coldInit(void) -{ - if (!tried) - { - tried = true; - return tryColdInit(); - } - return env!=NULL; -} - -/** - \fn getAudioInfo -*/ -WAVHeader *nativeAvsHeader::getAudioInfo(uint32_t i ) -{ - if (audioAccess) - return &audioInfo; - return NULL; - -} -/** - \fn getAudioStream -*/ -uint8_t nativeAvsHeader::getAudioStream(uint32_t i,ADM_audioStream **audio) -{ - if (audioAccess && !i) - { - *audio = audioStream; - return true; - } - return false; -} -/** - \fn getNbAudioStreams -*/ -uint8_t nativeAvsHeader::getNbAudioStreams(void) -{ - if (audioAccess) - return 1; - return 0; -} - -/** - \fn Dump -*/ - -void nativeAvsHeader::Dump(void) -{ - - printf("*********** nativeAvs INFO***********\n"); -} - -/** - \fn close -*/ - -uint8_t nativeAvsHeader::close(void) -{ - if (clip) - { - delete clip; - clip = NULL; - } - if (audioStream) - { - delete audioStream; - audioStream = NULL; - } - if (audioAccess) - { - delete audioAccess; - audioAccess = NULL; - } - return 1; -} -/** - \fn nativeAvsHeader -*/ - - - nativeAvsHeader::nativeAvsHeader( void ) : vidHeader() -{ - clip = NULL; - audioAccess = NULL; - audioStream = NULL; -} -/** - \fn ~ nativeAvsHeader -*/ - - nativeAvsHeader::~nativeAvsHeader( ) -{ - close(); - audioAccess = NULL; // need to delete it ? -} -/** - \fn open -*/ - -uint8_t nativeAvsHeader::open(const char *name) -{ - if (!coldInit()) - return false; - -try{ - - AVSValue arg(name); - AVSValue res = env->Invoke("Import", AVSValue(&arg, 1)); - if (!res.IsClip()) - { - ADM_warning("Avisynth:%s didn t return a video clip.\n", name); - return 0; - } -#if 0 - if (res.AsClip()->GetVersion() < 5) - { - ADM_warning(" avisynth.dll version is too old (%d)\n", res.GetVersion()); - return 0; - } -#endif - - clip = new PClip; - (*clip) = res.AsClip(); - // Collect informations... - VideoInfo inf = (*clip)->GetVideoInfo(); - // - _isaudiopresent = 0; - _isvideopresent = 1; - _videostream.dwRate = inf.fps_numerator; - _videostream.dwScale = inf.fps_denominator; - _mainaviheader.dwMicroSecPerFrame = 40000;; // 25 fps hard coded - - if(inf.IsYV12()) - { - pixfrmt=ADM_PIXFRMT_YV12; - _videostream.fccHandler = fourCC::get((uint8_t *) "YV12"); - }else - if(inf.IsYUY2()) - { - pixfrmt=ADM_PIXFRMT_YUV422; - _videostream.fccHandler = fourCC::get((uint8_t *) "YUY2"); - } - else - return 0; - - - _video_bih.biCompression=_videostream.fccHandler; - _videostream.dwLength = _mainaviheader.dwTotalFrames = inf.num_frames; - _videostream.dwInitialFrames = 0; - _videostream.dwStart = 0; - _video_bih.biWidth = _mainaviheader.dwWidth = inf.width; - _video_bih.biHeight = _mainaviheader.dwHeight = inf.height; - - // Do we have audio ? - if(inf.SamplesPerSecond()) // 0 means no audio - { - audioInfo.frequency=inf.SamplesPerSecond(), - audioInfo.channels=inf.AudioChannels(); - - audioInfo.byterate = audioInfo.channels*audioInfo.frequency; - if(audioInfo.frequency) - { - int sampleType = inf.SampleType(); - if(sampleType == SAMPLE_INT16 || sampleType == SAMPLE_FLOAT) - { - switch (sampleType) - { - case SAMPLE_INT16: audioInfo.encoding = WAV_PCM; audioInfo.bitspersample = 16; break; - case SAMPLE_FLOAT: audioInfo.encoding = WAV_PCM_FLOAT; audioInfo.bitspersample = 32; break; - default: - return false; - } - audioAccess=new nativeAvsAudio(this,&audioInfo, sampleType,getVideoDuration()); - audioStream = ADM_audioCreateStream(&audioInfo, audioAccess); - if (audioStream) - { - ADM_info("Created audio stream\n"); - _isaudiopresent = 1; - } - } - else - { - ADM_warning("Only int16 for audio and not %d!\n",(int)inf.SampleType()); - } - } - } - } - catch(AvisynthError err) - { - ADM_warning( "Avisynth error:\n%s\n", err.msg); - return false; - } - return true; -} -/** - \fn setFlag -*/ - -uint8_t nativeAvsHeader::setFlag(uint32_t frame,uint32_t flags) -{ - ADM_assert(frame=nbImage) return 0; - *flags=AVI_KEY_FRAME; - return 1; -} -/** - \fn getFrameSize -*/ -uint8_t nativeAvsHeader::getFrameSize(uint32_t frame,uint32_t *size) -{ - *size=0; - if(frame>=nbImage) return 0; - *size= (3* _video_bih.biWidth * _video_bih.biHeight)>>1; - return true; -} -/** - \fn getTime -*/ -uint64_t nativeAvsHeader::getTime(uint32_t frameNum) -{ - if(frameNum>=nbImage) return 0; - return frameNum2PTS(frameNum); -} -/** - \fn getTime -*/ - -uint64_t nativeAvsHeader::getVideoDuration(void) -{ - return frameNum2PTS(_mainaviheader.dwTotalFrames+1); -} -/** - \fn getTime -*/ - -bool nativeAvsHeader::getPtsDts(uint32_t frame,uint64_t *pts,uint64_t *dts) -{ - if(frame>=nbImage) return false; - *pts=frameNum2PTS(frame); - *dts=frameNum2PTS(frame); - return true; -} -/** - \fn getTime -*/ - -bool nativeAvsHeader::setPtsDts(uint32_t frame,uint64_t pts,uint64_t dts) -{ - if(frame>=nbImage) return false; - return true; -} -/** - \fn getFrame -*/ -uint8_t nativeAvsHeader::getFrame(uint32_t framenum,ADMCompressedImage *img) -{ - img->dataLength=0; - img->flags=AVI_KEY_FRAME; - - PVideoFrame Aframe=NULL; - - try - { - Aframe=(*clip)->GetFrame(framenum,env); - - } - catch(AvisynthError err) - { - ADM_warning( "Avisynth get frame error :\n%s\n", err.msg); - return false; - } - if(!Aframe) - { - ADM_warning("No video frame\n"); - return false; - } - // Pack - int w= _video_bih.biWidth ; - int h= _video_bih.biHeight; - int plane= w*h; - uint8_t *source; - uint8_t *dst; - int sourcePitch; - switch(pixfrmt) - { - - case ADM_PIXFRMT_YV12: - { - // Y - source= (uint8_t *)Aframe->GetReadPtr(AVS_PLANAR_Y); - sourcePitch = Aframe->GetPitch(AVS_PLANAR_Y); - dst=img->data; - BitBlit(dst,w,source,sourcePitch,w,h); - // U - source=(uint8_t *)Aframe->GetReadPtr(AVS_PLANAR_U); - sourcePitch= Aframe->GetPitch(AVS_PLANAR_U); - dst=img->data+ (plane * 5) / 4; - BitBlit(dst,w>>1,source,sourcePitch,w>>1,h>>1); - // V - source= (uint8_t *)Aframe->GetReadPtr(AVS_PLANAR_V); - sourcePitch= Aframe->GetPitch(AVS_PLANAR_V); - dst = img->data + (plane); - BitBlit(dst,w>>1,source,sourcePitch,w>>1,h>>1); - // misc infos - img->dataLength=(plane*3)>>1; - - } - break; - case ADM_PIXFRMT_YUV422: - { - source= (uint8_t *)Aframe->GetReadPtr(); - sourcePitch = Aframe->GetPitch(); - dst=img->data; - BitBlit(dst,w*2,source,sourcePitch,w*2,h); - img->dataLength=(plane*2); - } - break; - default: - Aframe=NULL; - return false; - break; - - } - // done - img->flags=AVI_KEY_FRAME; - img->demuxerFrameNo=framenum; - img->demuxerPts=frameNum2PTS(framenum); - img->demuxerDts=frameNum2PTS(framenum); - Aframe=NULL; - return true; -} -/** - -*/ -uint64_t nativeAvsHeader::frameNum2PTS(int frameNumber) -{ - if(!frameNumber) - return 0; - double d = _videostream.dwScale ; - d *= (double)frameNumber; - d /= (double)_videostream.dwRate; - d *= 1000000.; - return (uint64_t)d; -} -/** -*/ -bool nativeAvsHeader::getAudioPacket(uint64_t sample,uint8_t *buffer, uint32_t size) -{ - try - { - (*clip)->GetAudio(buffer, sample, size, env); - return true; - } - catch (AvisynthError err) - { - ADM_warning("Avisynth Audio error:\n%s\n", err.msg); - return false; - } -} -//EOF +/** ************************************************************************* + \file ADM_nativeAv.cpp + \brief Native AVISynth demuxer + contains code derived from Avs2YUV by Loren Merritt + copyright : (C) 2019 by mean + email : fixounet@free.fr + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "ADM_default.h" +#include "ADM_Video.h" +#include "ADM_assert.h" + +#include "fourcc.h" +#include "DIA_coreToolkit.h" +#include "ADM_nativeAvs.h" +#include "ADM_image.h" + +/** +*/ +const AVS_Linkage *AVS_linkage = 0; +static IScriptEnvironment *env=NULL; +static bool tried = false; +#if 0 +#define aprintf printf +#else +#define aprintf(...) {} +#endif +#define nbImage _videostream.dwLength + +typedef IScriptEnvironment * __stdcall DLLFUNC(int); + +/** +*/ +static bool tryColdInit(void) +{ + DLLFUNC *CreateScriptEnvironment = NULL; + ADM_info("Loading Avisynth.dll \n"); + HMODULE instance = LoadLibrary("avisynth.dll"); + if (!instance) + { + ADM_warning("Cannot load avisynth dll\n"); + return false; + } + ADM_info("Avisynth.dll loaded\n"); + CreateScriptEnvironment = (DLLFUNC *)GetProcAddress(instance, "CreateScriptEnvironment"); + if (!CreateScriptEnvironment) + { + ADM_warning("failed to load CreateScriptEnvironment()\n"); + return false; + } + try + { + env = CreateScriptEnvironment(AVISYNTH_INTERFACE_VERSION); + if (!env) + { + ADM_warning("Create Env failed\n"); + return false; + } + AVS_linkage = env->GetAVSLinkage(); + } + catch (AvisynthError err) + { + ADM_warning("Avisynth error:\n%s\n", err.msg); + return false; + } + return true; +} +/** +*/ +static bool coldInit(void) +{ + if (!tried) + { + tried = true; + return tryColdInit(); + } + return env!=NULL; +} + +/** + \fn getAudioInfo +*/ +WAVHeader *nativeAvsHeader::getAudioInfo(uint32_t i ) +{ + if (audioAccess) + return &audioInfo; + return NULL; + +} +/** + \fn getAudioStream +*/ +uint8_t nativeAvsHeader::getAudioStream(uint32_t i,ADM_audioStream **audio) +{ + if (audioAccess && !i) + { + *audio = audioStream; + return true; + } + return false; +} +/** + \fn getNbAudioStreams +*/ +uint8_t nativeAvsHeader::getNbAudioStreams(void) +{ + if (audioAccess) + return 1; + return 0; +} + +/** + \fn Dump +*/ + +void nativeAvsHeader::Dump(void) +{ + + printf("*********** nativeAvs INFO***********\n"); +} + +/** + \fn close +*/ + +uint8_t nativeAvsHeader::close(void) +{ + if (clip) + { + delete clip; + clip = NULL; + } + if (audioStream) + { + delete audioStream; + audioStream = NULL; + } + if (audioAccess) + { + delete audioAccess; + audioAccess = NULL; + } + return 1; +} +/** + \fn nativeAvsHeader +*/ + + + nativeAvsHeader::nativeAvsHeader( void ) : vidHeader() +{ + clip = NULL; + audioAccess = NULL; + audioStream = NULL; +} +/** + \fn ~ nativeAvsHeader +*/ + + nativeAvsHeader::~nativeAvsHeader( ) +{ + close(); + audioAccess = NULL; // need to delete it ? +} +/** + \fn open +*/ + +uint8_t nativeAvsHeader::open(const char *name) +{ + if (!coldInit()) + return false; + +try{ + + AVSValue arg(name); + AVSValue res = env->Invoke("Import", AVSValue(&arg, 1)); + if (!res.IsClip()) + { + ADM_warning("Avisynth:%s didn t return a video clip.\n", name); + return 0; + } +#if 0 + if (res.AsClip()->GetVersion() < 5) + { + ADM_warning(" avisynth.dll version is too old (%d)\n", res.GetVersion()); + return 0; + } +#endif + + clip = new PClip; + (*clip) = res.AsClip(); + // Collect informations... + VideoInfo inf = (*clip)->GetVideoInfo(); + // + _isaudiopresent = 0; + _isvideopresent = 1; + _videostream.dwRate = inf.fps_numerator; + _videostream.dwScale = inf.fps_denominator; + _mainaviheader.dwMicroSecPerFrame = 40000;; // 25 fps hard coded + + if(inf.IsYV12()) + { + pixfrmt=ADM_PIXFRMT_YV12; + _videostream.fccHandler = fourCC::get((uint8_t *) "YV12"); + }else + if(inf.IsYUY2()) + { + pixfrmt=ADM_PIXFRMT_YUV422; + _videostream.fccHandler = fourCC::get((uint8_t *) "YUY2"); + } + else + return 0; + + + _video_bih.biCompression=_videostream.fccHandler; + _videostream.dwLength = _mainaviheader.dwTotalFrames = inf.num_frames; + _videostream.dwInitialFrames = 0; + _videostream.dwStart = 0; + _video_bih.biWidth = _mainaviheader.dwWidth = inf.width; + _video_bih.biHeight = _mainaviheader.dwHeight = inf.height; + + // Do we have audio ? + if(inf.SamplesPerSecond()) // 0 means no audio + { + audioInfo.frequency=inf.SamplesPerSecond(), + audioInfo.channels=inf.AudioChannels(); + + audioInfo.byterate = audioInfo.channels*audioInfo.frequency; + if(audioInfo.frequency) + { + int sampleType = inf.SampleType(); + if(sampleType == SAMPLE_INT16 || sampleType == SAMPLE_FLOAT) + { + switch (sampleType) + { + case SAMPLE_INT16: audioInfo.encoding = WAV_PCM; audioInfo.bitspersample = 16; break; + case SAMPLE_FLOAT: audioInfo.encoding = WAV_PCM_FLOAT; audioInfo.bitspersample = 32; break; + default: + return false; + } + audioAccess=new nativeAvsAudio(this,&audioInfo, sampleType,getVideoDuration()); + audioStream = ADM_audioCreateStream(&audioInfo, audioAccess); + if (audioStream) + { + ADM_info("Created audio stream\n"); + _isaudiopresent = 1; + } + } + else + { + ADM_warning("Only int16 for audio and not %d!\n",(int)inf.SampleType()); + } + } + } + } + catch(AvisynthError err) + { + ADM_warning( "Avisynth error:\n%s\n", err.msg); + return false; + } + return true; +} +/** + \fn setFlag +*/ + +uint8_t nativeAvsHeader::setFlag(uint32_t frame,uint32_t flags) +{ + ADM_assert(frame=nbImage) return 0; + *flags=AVI_KEY_FRAME; + return 1; +} +/** + \fn getFrameSize +*/ +uint8_t nativeAvsHeader::getFrameSize(uint32_t frame,uint32_t *size) +{ + *size=0; + if(frame>=nbImage) return 0; + *size= (3* _video_bih.biWidth * _video_bih.biHeight)>>1; + return true; +} +/** + \fn getTime +*/ +uint64_t nativeAvsHeader::getTime(uint32_t frameNum) +{ + if(frameNum>=nbImage) return 0; + return frameNum2PTS(frameNum); +} +/** + \fn getTime +*/ + +uint64_t nativeAvsHeader::getVideoDuration(void) +{ + return frameNum2PTS(_mainaviheader.dwTotalFrames+1); +} +/** + \fn getTime +*/ + +bool nativeAvsHeader::getPtsDts(uint32_t frame,uint64_t *pts,uint64_t *dts) +{ + if(frame>=nbImage) return false; + *pts=frameNum2PTS(frame); + *dts=frameNum2PTS(frame); + return true; +} +/** + \fn getTime +*/ + +bool nativeAvsHeader::setPtsDts(uint32_t frame,uint64_t pts,uint64_t dts) +{ + if(frame>=nbImage) return false; + return true; +} +/** + \fn getFrame +*/ +uint8_t nativeAvsHeader::getFrame(uint32_t framenum,ADMCompressedImage *img) +{ + img->dataLength=0; + img->flags=AVI_KEY_FRAME; + + PVideoFrame Aframe=NULL; + + try + { + Aframe=(*clip)->GetFrame(framenum,env); + + } + catch(AvisynthError err) + { + ADM_warning( "Avisynth get frame error :\n%s\n", err.msg); + return false; + } + if(!Aframe) + { + ADM_warning("No video frame\n"); + return false; + } + // Pack + int w= _video_bih.biWidth ; + int h= _video_bih.biHeight; + int plane= w*h; + uint8_t *source; + uint8_t *dst; + int sourcePitch; + switch(pixfrmt) + { + + case ADM_PIXFRMT_YV12: + { + // Y + source= (uint8_t *)Aframe->GetReadPtr(AVS_PLANAR_Y); + sourcePitch = Aframe->GetPitch(AVS_PLANAR_Y); + dst=img->data; + BitBlit(dst,w,source,sourcePitch,w,h); + // U + source=(uint8_t *)Aframe->GetReadPtr(AVS_PLANAR_U); + sourcePitch= Aframe->GetPitch(AVS_PLANAR_U); + dst=img->data+ (plane * 5) / 4; + BitBlit(dst,w>>1,source,sourcePitch,w>>1,h>>1); + // V + source= (uint8_t *)Aframe->GetReadPtr(AVS_PLANAR_V); + sourcePitch= Aframe->GetPitch(AVS_PLANAR_V); + dst = img->data + (plane); + BitBlit(dst,w>>1,source,sourcePitch,w>>1,h>>1); + // misc infos + img->dataLength=(plane*3)>>1; + + } + break; + case ADM_PIXFRMT_YUV422: + { + source= (uint8_t *)Aframe->GetReadPtr(); + sourcePitch = Aframe->GetPitch(); + dst=img->data; + BitBlit(dst,w*2,source,sourcePitch,w*2,h); + img->dataLength=(plane*2); + } + break; + default: + Aframe=NULL; + return false; + break; + + } + // done + img->flags=AVI_KEY_FRAME; + img->demuxerFrameNo=framenum; + img->demuxerPts=frameNum2PTS(framenum); + img->demuxerDts=frameNum2PTS(framenum); + Aframe=NULL; + return true; +} +/** + +*/ +uint64_t nativeAvsHeader::frameNum2PTS(int frameNumber) +{ + if(!frameNumber) + return 0; + double d = _videostream.dwScale ; + d *= (double)frameNumber; + d /= (double)_videostream.dwRate; + d *= 1000000.; + return (uint64_t)d; +} +/** +*/ +bool nativeAvsHeader::getAudioPacket(uint64_t sample,uint8_t *buffer, uint32_t size) +{ + try + { + (*clip)->GetAudio(buffer, sample, size, env); + return true; + } + catch (AvisynthError err) + { + ADM_warning("Avisynth Audio error:\n%s\n", err.msg); + return false; + } +} +//EOF diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvs.h b/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvs.h index f174c22ae3..02f4bf78dd 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvs.h +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvs.h @@ -1,112 +1,112 @@ -/*************************************************************************** - ADM_pics.h - description - ------------------- - begin : Mon Jun 3 2002 - copyright : (C) 2002/2009 by mean - email : fixounet@free.fr - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ -#pragma once -#include -using std::vector; -#include "ADM_Video.h" -#include "ADM_audioClock.h" -#include "avisynth.h" - -class nativeAvsHeader; -/** -\fn nativeAvsAudio -*/ -class nativeAvsAudio : public ADM_audioAccess -{ -protected: - audioClock clock; - WAVHeader *wavHeader; - uint64_t duration; - uint64_t nextSample; - nativeAvsHeader *avs; - int sampleType; -public: - nativeAvsAudio(nativeAvsHeader *net, WAVHeader *wav, int sampleType, uint64_t duration); - virtual ~nativeAvsAudio(); - /// Hint, the stream is pure CBR (AC3,MP2,MP3) - virtual bool isCBR(void) { return true; } - /// Return true if the demuxer can seek in time - virtual bool canSeekTime(void) { return true; }; - /// Return true if the demuxer can seek by offser - virtual bool canSeekOffset(void) { return false; }; - /// Return true if we can have the audio duration - virtual bool canGetDuration(void) { return true; }; - /// Returns audio duration in us - virtual uint64_t getDurationInUs(void); - /// Go to a given time - virtual bool goToTime(uint64_t timeUs); - virtual bool getPacket(uint8_t *buffer, uint32_t *size, uint32_t maxSize, uint64_t *dts); - bool getExtraData(uint32_t *l, uint8_t **d) { *l = 0; *d = NULL; return true; }; -}; - -/** - \class nativeAvsHeader - \brief Asf Demuxer -*/ - -class nativeAvsHeader :public vidHeader -{ - protected: - - uint8_t close(void); - PClip *clip; - - - public: // Shared with audio track - public: - nativeAvsHeader(void); - virtual ~nativeAvsHeader(); - uint8_t open(const char *name); - //__________________________ - // Audio - //__________________________ - - virtual WAVHeader *getAudioInfo(uint32_t i ) ; - virtual uint8_t getAudioStream(uint32_t i,ADM_audioStream **audio); - virtual uint8_t getNbAudioStreams(void); - // Frames - //__________________________ - // video - //__________________________ - - virtual uint8_t setFlag(uint32_t frame,uint32_t flags); - virtual uint32_t getFlags(uint32_t frame,uint32_t *flags); - virtual uint8_t getFrameSize(uint32_t frame,uint32_t *size); - virtual uint8_t getFrame(uint32_t framenum,ADMCompressedImage *img); - - virtual void Dump(void); - virtual uint64_t getTime(uint32_t frameNum); - virtual uint64_t getVideoDuration(void); - - // Return true if the container provides pts informations - virtual bool providePts(void) {return false;}; - // - virtual bool getPtsDts(uint32_t frame,uint64_t *pts,uint64_t *dts); - virtual bool setPtsDts(uint32_t frame,uint64_t pts,uint64_t dts); - - PClip *getClip() { return clip; } - bool getAudioPacket(uint64_t sample, uint8_t *buffer, uint32_t size); - -protected: - uint64_t frameNum2PTS(int frameNumber); - ADM_pixelFormat pixfrmt; - WAVHeader audioInfo; - nativeAvsAudio *audioAccess; - ADM_audioStream *audioStream; -}; - - +/*************************************************************************** + ADM_pics.h - description + ------------------- + begin : Mon Jun 3 2002 + copyright : (C) 2002/2009 by mean + email : fixounet@free.fr + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#pragma once +#include +using std::vector; +#include "ADM_Video.h" +#include "ADM_audioClock.h" +#include "avisynth.h" + +class nativeAvsHeader; +/** +\fn nativeAvsAudio +*/ +class nativeAvsAudio : public ADM_audioAccess +{ +protected: + audioClock clock; + WAVHeader *wavHeader; + uint64_t duration; + uint64_t nextSample; + nativeAvsHeader *avs; + int sampleType; +public: + nativeAvsAudio(nativeAvsHeader *net, WAVHeader *wav, int sampleType, uint64_t duration); + virtual ~nativeAvsAudio(); + /// Hint, the stream is pure CBR (AC3,MP2,MP3) + virtual bool isCBR(void) { return true; } + /// Return true if the demuxer can seek in time + virtual bool canSeekTime(void) { return true; }; + /// Return true if the demuxer can seek by offser + virtual bool canSeekOffset(void) { return false; }; + /// Return true if we can have the audio duration + virtual bool canGetDuration(void) { return true; }; + /// Returns audio duration in us + virtual uint64_t getDurationInUs(void); + /// Go to a given time + virtual bool goToTime(uint64_t timeUs); + virtual bool getPacket(uint8_t *buffer, uint32_t *size, uint32_t maxSize, uint64_t *dts); + bool getExtraData(uint32_t *l, uint8_t **d) { *l = 0; *d = NULL; return true; }; +}; + +/** + \class nativeAvsHeader + \brief Asf Demuxer +*/ + +class nativeAvsHeader :public vidHeader +{ + protected: + + uint8_t close(void); + PClip *clip; + + + public: // Shared with audio track + public: + nativeAvsHeader(void); + virtual ~nativeAvsHeader(); + uint8_t open(const char *name); + //__________________________ + // Audio + //__________________________ + + virtual WAVHeader *getAudioInfo(uint32_t i ) ; + virtual uint8_t getAudioStream(uint32_t i,ADM_audioStream **audio); + virtual uint8_t getNbAudioStreams(void); + // Frames + //__________________________ + // video + //__________________________ + + virtual uint8_t setFlag(uint32_t frame,uint32_t flags); + virtual uint32_t getFlags(uint32_t frame,uint32_t *flags); + virtual uint8_t getFrameSize(uint32_t frame,uint32_t *size); + virtual uint8_t getFrame(uint32_t framenum,ADMCompressedImage *img); + + virtual void Dump(void); + virtual uint64_t getTime(uint32_t frameNum); + virtual uint64_t getVideoDuration(void); + + // Return true if the container provides pts informations + virtual bool providePts(void) {return false;}; + // + virtual bool getPtsDts(uint32_t frame,uint64_t *pts,uint64_t *dts); + virtual bool setPtsDts(uint32_t frame,uint64_t pts,uint64_t dts); + + PClip *getClip() { return clip; } + bool getAudioPacket(uint64_t sample, uint8_t *buffer, uint32_t size); + +protected: + uint64_t frameNum2PTS(int frameNumber); + ADM_pixelFormat pixfrmt; + WAVHeader audioInfo; + nativeAvsAudio *audioAccess; + ADM_audioStream *audioStream; +}; + + diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvsAudio.cpp b/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvsAudio.cpp index 7f99c2b4c9..4d70ea7c08 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvsAudio.cpp +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvsAudio.cpp @@ -1,99 +1,99 @@ -/*************************************************************************** - \file ADM_nativeAvsAudio.cpp - \author (C) 2018 by mean fixounet@free.fr - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "ADM_default.h" -#include "fourcc.h" -#include "DIA_coreToolkit.h" - -#include "fourcc.h" -#include "ADM_nativeAvs.h" -/** - \fn ADM_avsAccess -*/ -nativeAvsAudio::nativeAvsAudio(nativeAvsHeader *avsh, WAVHeader *wav,int sampleT,uint64_t duration): - clock(wav->frequency) -{ - this->avs=avsh; - this->wavHeader=wav; - this->duration=duration; - nextSample=0; - sampleType = sampleT; -} -/** - \fn ~ADM_avsAccess -*/ - -nativeAvsAudio::~nativeAvsAudio() -{ - avs = NULL; - wavHeader = NULL; -} -/** - \fn getDurationInUs -*/ -uint64_t nativeAvsAudio::getDurationInUs(void) -{ - return duration; -} -/** - \fn goToTime -*/ -bool nativeAvsAudio::goToTime(uint64_t timeUs) -{ - // convert us to sample - float f=timeUs; - f*=wavHeader->frequency; - f/=1000000.; - nextSample=(uint32_t )f; - clock.setTimeUs(timeUs); - return true; -} -/** - \fn getPacket -*/ -bool nativeAvsAudio::getPacket(uint8_t *buffer, uint32_t *size, uint32_t maxSize,uint64_t *dts) -{ - uint32_t sizeInSample; - int multiply; - switch (sampleType) - { - case SAMPLE_INT16: - multiply = (2 * wavHeader->channels); - break; - case SAMPLE_FLOAT: - multiply = (4 * wavHeader->channels); - break; - default: - return false; - } - sizeInSample = maxSize / multiply; - - if (!avs->getAudioPacket(nextSample, buffer, sizeInSample)) - { - ADM_warning("Error getPacket\n"); - return false; - } - *dts = clock.getTimeUs(); - clock.advanceBySample(sizeInSample ); - - *size = sizeInSample*multiply; - nextSample += sizeInSample; - - if (!*size) - return false; - return true; -}; -//EOF - +/*************************************************************************** + \file ADM_nativeAvsAudio.cpp + \author (C) 2018 by mean fixounet@free.fr + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "ADM_default.h" +#include "fourcc.h" +#include "DIA_coreToolkit.h" + +#include "fourcc.h" +#include "ADM_nativeAvs.h" +/** + \fn ADM_avsAccess +*/ +nativeAvsAudio::nativeAvsAudio(nativeAvsHeader *avsh, WAVHeader *wav,int sampleT,uint64_t duration): + clock(wav->frequency) +{ + this->avs=avsh; + this->wavHeader=wav; + this->duration=duration; + nextSample=0; + sampleType = sampleT; +} +/** + \fn ~ADM_avsAccess +*/ + +nativeAvsAudio::~nativeAvsAudio() +{ + avs = NULL; + wavHeader = NULL; +} +/** + \fn getDurationInUs +*/ +uint64_t nativeAvsAudio::getDurationInUs(void) +{ + return duration; +} +/** + \fn goToTime +*/ +bool nativeAvsAudio::goToTime(uint64_t timeUs) +{ + // convert us to sample + float f=timeUs; + f*=wavHeader->frequency; + f/=1000000.; + nextSample=(uint32_t )f; + clock.setTimeUs(timeUs); + return true; +} +/** + \fn getPacket +*/ +bool nativeAvsAudio::getPacket(uint8_t *buffer, uint32_t *size, uint32_t maxSize,uint64_t *dts) +{ + uint32_t sizeInSample; + int multiply; + switch (sampleType) + { + case SAMPLE_INT16: + multiply = (2 * wavHeader->channels); + break; + case SAMPLE_FLOAT: + multiply = (4 * wavHeader->channels); + break; + default: + return false; + } + sizeInSample = maxSize / multiply; + + if (!avs->getAudioPacket(nextSample, buffer, sizeInSample)) + { + ADM_warning("Error getPacket\n"); + return false; + } + *dts = clock.getTimeUs(); + clock.advanceBySample(sizeInSample ); + + *size = sizeInSample*multiply; + nextSample += sizeInSample; + + if (!*size) + return false; + return true; +}; +//EOF + diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvsPlugin.cpp b/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvsPlugin.cpp index 1f2f0dc57c..7e690b308e 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvsPlugin.cpp +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/ADM_nativeAvsPlugin.cpp @@ -1,42 +1,42 @@ -/*************************************************************************** - copyright : (C) 2007 by mean - email : fixounet@free.fr - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ -#include "ADM_default.h" -#include "ADM_nativeAvs.h" -#include "ADM_demuxerInternal.h" -#include "fourcc.h" - -ADM_DEMUXER_BEGIN(nativeAvsHeader, 50, - 1,0,0, - "navs", - "native avs demuxer plugin (c) Mean 2018" - ); - -/** - \fn Probe -*/ - -extern "C" uint32_t ADM_PLUGIN_EXPORT probe(uint32_t magic, const char *fileName) -{ - std::string st = std::string(fileName); - std::string extension("avs"); - - if (st.length() >= extension.length()) - { - if (!st.compare(st.length() - extension.length(), extension.length(), extension)) - return 100; - } - ADM_warning (" [avsProxy] Cannot open that\n"); - return 0; -} +/*************************************************************************** + copyright : (C) 2007 by mean + email : fixounet@free.fr + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#include "ADM_default.h" +#include "ADM_nativeAvs.h" +#include "ADM_demuxerInternal.h" +#include "fourcc.h" + +ADM_DEMUXER_BEGIN(nativeAvsHeader, 50, + 1,0,0, + "navs", + "native avs demuxer plugin (c) Mean 2018" + ); + +/** + \fn Probe +*/ + +extern "C" uint32_t ADM_PLUGIN_EXPORT probe(uint32_t magic, const char *fileName) +{ + std::string st = std::string(fileName); + std::string extension("avs"); + + if (st.length() >= extension.length()) + { + if (!st.compare(st.length() - extension.length(), extension.length(), extension)) + return 100; + } + ADM_warning (" [avsProxy] Cannot open that\n"); + return 0; +} diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/CMakeLists.txt b/avidemux_plugins/ADM_demuxers/NativeAvisynth/CMakeLists.txt index 8dd49d8c4f..f89ebf854d 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/CMakeLists.txt +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/CMakeLists.txt @@ -1,83 +1,83 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0 FATAL_ERROR) - -PROJECT(AdmAsfDemuxer) - -MESSAGE("#####################################") -MESSAGE("Custom demuxer plugin template Started") -MESSAGE("#####################################") -MESSAGE("") - -SET(PLUGINS TRUE) -SET(DO_COMMON TRUE) -SET(AVIDEMUX_VERSION 2.8) # important ! -SET(AVIDEMUX_EXTERNAL_BUILD True) # important ! - -###################################################### -# Try to locate & setup avidemux development files -###################################################### - -MESSAGE(STATUS "Checking for avidemux development files ..") - -SET(ADM_HEADER_DIR ${CMAKE_INSTALL_PREFIX}/include/avidemux/${AVIDEMUX_VERSION}) -SET(ADM_CMAKE_DIR ${ADM_HEADER_DIR}/cmake) - -# Common definitions... -SET(CMAKE_MODULE_PATH "${ADM_CMAKE_DIR}" "${CMAKE_MODULE_PATH}") -MESSAGE(STATUS "Checking for avidemux include folder (i.e. CMAKE_INSTALL_PREFIX/include/avidemux/${AVIDEMUX_VERSION}") -if(NOT EXISTS "${ADM_HEADER_DIR}") - MESSAGE(STATUS "Make sure you installed all the files.\n i cannot find avidemux include folder.cmake .\nSet CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") - MESSAGE(FATAL_ERROR "Aborting") -endif(NOT EXISTS "${ADM_HEADER_DIR}") - -MESSAGE(STATUS "Found avidemux include folder. good.") -MESSAGE(STATUS "Checking for cmake subfolder") - -if(NOT EXISTS "${ADM_CMAKE_DIR}/admCoreIncludesExternalBuild.cmake") - MESSAGE(STATUS "Make sure you installed all the files.\n I cannot find content of the cmake subfolder .\n") - MESSAGE(STATUS "Set CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") - MESSAGE(STATUS "I was looking for admCoreIncludesExternalBuild.cmake in ${ADM_CMAKE_DIR}") - MESSAGE(FATAL_ERROR "Aborting") -endif(NOT EXISTS "${ADM_CMAKE_DIR}/admCoreIncludesExternalBuild.cmake") -MESSAGE(STATUS "Found cmake subfolder.good.") - - -include(${ADM_CMAKE_DIR}/admCoreIncludesExternalBuild.cmake) -include(${ADM_CMAKE_DIR}/admConfigHelper.cmake) -######################################## -# Add include dirs -######################################## -SET(AVIDEMUX_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}") -MARK_AS_ADVANCED(AVIDEMUX_INSTALL_DIR) -include(admInstallDir) -######################################### -# Get regular stuff from main app -######################################### -LINK_DIRECTORIES("${AVIDEMUX_SEARCH_LIB_DIR}") -INCLUDE_DIRECTORIES(${AVIDEMUX_SEARCH_INCLUDE_DIR}/avidemux/${AVIDEMUX_VERSION}/) - -IF (FRESH_BUILD) - MESSAGE("") -ENDIF (FRESH_BUILD) - -######################################## -# Global options -######################################## -OPTION(VERBOSE "" OFF) - -################################################ -# Now really define our plugin... -############################################### - -include(dm_plugin) -SET(ADM_nativeAvs_SRCS - ADM_nativeAvsAudio.cpp - ADM_nativeAvs.cpp - ADM_nativeAvsPlugin.cpp -) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -link_directories(${CMAKE_CURRENT_SOURCE_DIR}) -ADD_DEMUXER(ADM_dm_nativeAvs ${ADM_nativeAvs_SRCS}) - -INIT_DEMUXER(ADM_dm_nativeAvs) -INSTALL_DEMUXER(ADM_dm_nativeAvs) -#TARGET_LINK_LIBRARIES(ADM_dm_nativeAvs ${CMAKE_CURRENT_SOURCE_DIR}/AviSynth.lib) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0 FATAL_ERROR) + +PROJECT(AdmAsfDemuxer) + +MESSAGE("#####################################") +MESSAGE("Custom demuxer plugin template Started") +MESSAGE("#####################################") +MESSAGE("") + +SET(PLUGINS TRUE) +SET(DO_COMMON TRUE) +SET(AVIDEMUX_VERSION 2.8) # important ! +SET(AVIDEMUX_EXTERNAL_BUILD True) # important ! + +###################################################### +# Try to locate & setup avidemux development files +###################################################### + +MESSAGE(STATUS "Checking for avidemux development files ..") + +SET(ADM_HEADER_DIR ${CMAKE_INSTALL_PREFIX}/include/avidemux/${AVIDEMUX_VERSION}) +SET(ADM_CMAKE_DIR ${ADM_HEADER_DIR}/cmake) + +# Common definitions... +SET(CMAKE_MODULE_PATH "${ADM_CMAKE_DIR}" "${CMAKE_MODULE_PATH}") +MESSAGE(STATUS "Checking for avidemux include folder (i.e. CMAKE_INSTALL_PREFIX/include/avidemux/${AVIDEMUX_VERSION}") +if(NOT EXISTS "${ADM_HEADER_DIR}") + MESSAGE(STATUS "Make sure you installed all the files.\n i cannot find avidemux include folder.cmake .\nSet CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") + MESSAGE(FATAL_ERROR "Aborting") +endif(NOT EXISTS "${ADM_HEADER_DIR}") + +MESSAGE(STATUS "Found avidemux include folder. good.") +MESSAGE(STATUS "Checking for cmake subfolder") + +if(NOT EXISTS "${ADM_CMAKE_DIR}/admCoreIncludesExternalBuild.cmake") + MESSAGE(STATUS "Make sure you installed all the files.\n I cannot find content of the cmake subfolder .\n") + MESSAGE(STATUS "Set CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") + MESSAGE(STATUS "I was looking for admCoreIncludesExternalBuild.cmake in ${ADM_CMAKE_DIR}") + MESSAGE(FATAL_ERROR "Aborting") +endif(NOT EXISTS "${ADM_CMAKE_DIR}/admCoreIncludesExternalBuild.cmake") +MESSAGE(STATUS "Found cmake subfolder.good.") + + +include(${ADM_CMAKE_DIR}/admCoreIncludesExternalBuild.cmake) +include(${ADM_CMAKE_DIR}/admConfigHelper.cmake) +######################################## +# Add include dirs +######################################## +SET(AVIDEMUX_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}") +MARK_AS_ADVANCED(AVIDEMUX_INSTALL_DIR) +include(admInstallDir) +######################################### +# Get regular stuff from main app +######################################### +LINK_DIRECTORIES("${AVIDEMUX_SEARCH_LIB_DIR}") +INCLUDE_DIRECTORIES(${AVIDEMUX_SEARCH_INCLUDE_DIR}/avidemux/${AVIDEMUX_VERSION}/) + +IF (FRESH_BUILD) + MESSAGE("") +ENDIF (FRESH_BUILD) + +######################################## +# Global options +######################################## +OPTION(VERBOSE "" OFF) + +################################################ +# Now really define our plugin... +############################################### + +include(dm_plugin) +SET(ADM_nativeAvs_SRCS + ADM_nativeAvsAudio.cpp + ADM_nativeAvs.cpp + ADM_nativeAvsPlugin.cpp +) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +link_directories(${CMAKE_CURRENT_SOURCE_DIR}) +ADD_DEMUXER(ADM_dm_nativeAvs ${ADM_nativeAvs_SRCS}) + +INIT_DEMUXER(ADM_dm_nativeAvs) +INSTALL_DEMUXER(ADM_dm_nativeAvs) +#TARGET_LINK_LIBRARIES(ADM_dm_nativeAvs ${CMAKE_CURRENT_SOURCE_DIR}/AviSynth.lib) diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/Syntax.avs b/avidemux_plugins/ADM_demuxers/NativeAvisynth/Syntax.avs index 4a73f93e48..690a9315a2 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/Syntax.avs +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/Syntax.avs @@ -1,45 +1,45 @@ -# Generates colorbar image and converts it to YUY2 -# The image and sound is now "current clip" - -Colorbars(320,240) -ConvertToYUY2() - -# Take the "current clip", and add greayscale to this. -# The result is now in the variable Grey. -# Current clip is still the original Colorbars(320,240) - -Grey = Greyscale() - -# Now you can use Grey as an alternative clip, instead if the current clip -# This creates a new variable called Grey_Half_Size, that contains the grey colorbar at half the height. -# Current clip is still the original Colorbars(320,240) - -Grey_Half_Size = VerticalReduceBy2(Grey) - -# If we specify more parameters, but don't want it used on the current clip, -# we can either specify the clip in front of the filter, using '.' -# or specify the clip as the first parameter. - -Grey_Same_Size = Grey_half_size.AddBorders(0,60,0,60) - -# which is the same as: - -Grey_Same_Size = AddBorders(Grey_half_size,0,60,0,60) - -# More examples: - -Combined = MergeLuma(grey_same_size) -#Combined = MergeChroma(Combined, grey_same_size) -#Grey_same_size=mergeluma(combined) -# Add titles to clips: - -Thisclip = Subtitle("Current Clip") -Grey_Half_size = Subtitle(Grey_Half_size,"Grey_Half_size") -Grey_Same_size = Subtitle(Grey_Same_size,"Grey_Same_size") -Combined = Subtitle(Combined,"Combined") - -# Put them on top of eachother - -Stackvertical(thisclip, Grey_Half_size, Grey_Same_size, Combined) - +# Generates colorbar image and converts it to YUY2 +# The image and sound is now "current clip" + +Colorbars(320,240) +ConvertToYUY2() + +# Take the "current clip", and add greayscale to this. +# The result is now in the variable Grey. +# Current clip is still the original Colorbars(320,240) + +Grey = Greyscale() + +# Now you can use Grey as an alternative clip, instead if the current clip +# This creates a new variable called Grey_Half_Size, that contains the grey colorbar at half the height. +# Current clip is still the original Colorbars(320,240) + +Grey_Half_Size = VerticalReduceBy2(Grey) + +# If we specify more parameters, but don't want it used on the current clip, +# we can either specify the clip in front of the filter, using '.' +# or specify the clip as the first parameter. + +Grey_Same_Size = Grey_half_size.AddBorders(0,60,0,60) + +# which is the same as: + +Grey_Same_Size = AddBorders(Grey_half_size,0,60,0,60) + +# More examples: + +Combined = MergeLuma(grey_same_size) +#Combined = MergeChroma(Combined, grey_same_size) +#Grey_same_size=mergeluma(combined) +# Add titles to clips: + +Thisclip = Subtitle("Current Clip") +Grey_Half_size = Subtitle(Grey_Half_size,"Grey_Half_size") +Grey_Same_size = Subtitle(Grey_Same_size,"Grey_Same_size") +Combined = Subtitle(Combined,"Combined") + +# Put them on top of eachother + +Stackvertical(thisclip, Grey_Half_size, Grey_Same_size, Combined) + ConvertToYV12(thisclip) \ No newline at end of file diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avisynth.h b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avisynth.h index d73d6d1e31..50e9a8df91 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avisynth.h +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avisynth.h @@ -1,1383 +1,1383 @@ -// Avisynth v2.5. Copyright 2002 Ben Rudiak-Gould et al. -// Avisynth v2.6. Copyright 2006 Klaus Post. -// Avisynth v2.6. Copyright 2009 Ian Brabham. -// Avisynth+ project -// 20160613: new 16 bit planar pixel_type constants go live! -// 20160725: pixel_type constants 10-12-14 bit + planar RGB + BRG48/64 -// 20161005: Fallback of VideoInfo functions to defaults if no function exists -// 20170117: global variables for VfW output OPT_xxxx -// 20170310: new MT mode: MT_SPECIAL_MT -// 20171103: (test with SIZETMOD define: Videoframe offsets to size_t, may affect x64) -// 20171207: C++ Standard Conformance (no change for plugin writers) -// 20180525: AVS_UNUSED define to supress parameter not used warnings - -// http://www.avisynth.org - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// Linking Avisynth statically or dynamically with other modules is making -// a combined work based on Avisynth. Thus, the terms and conditions of -// the GNU General Public License cover the whole combination. -// -// As a special exception, the copyright holders of Avisynth give you -// permission to link Avisynth with independent modules that communicate -// with Avisynth solely through the interfaces defined in avisynth.h, -// regardless of the license terms of these independent modules, and to -// copy and distribute the resulting combined work under terms of your -// choice, provided that every copy of the combined work is accompanied -// by a complete copy of the source code of Avisynth (the version of -// Avisynth used to produce the combined work), being distributed under -// the terms of the GNU General Public License plus this exception. An -// independent module is a module which is not derived from or based on -// Avisynth, such as 3rd-party filters, import and export plugins, or -// graphical user interfaces. - - - - -#ifndef __AVISYNTH_6_H__ -#define __AVISYNTH_6_H__ - -#include -#include -#include - - -enum { AVISYNTH_INTERFACE_VERSION = 6 }; - - -/* Compiler-specific crap */ - -// Tell MSVC to stop precompiling here -#if defined(_MSC_VER) && !defined(__clang__) - #pragma hdrstop -#endif - -// Set up debugging macros for MS compilers; for others, step down to the -// standard interface -#ifdef _MSC_VER - #include -#else - #undef _RPT0 - #undef _RPT1 - #undef _RPT2 - #undef _RPT3 - #undef _RPT4 - #undef _RPT5 - #define _RPT0(a,b) ((void)0) - #define _RPT1(a,b,c) ((void)0) - #define _RPT2(a,b,c,d) ((void)0) - #define _RPT3(a,b,c,d,e) ((void)0) - #define _RPT4(a,b,c,d,e,f) ((void)0) - #define _RPT5(a,b,c,d,e,f,g) ((void)0) - - #include - #undef _ASSERTE - #undef _ASSERT - #define _ASSERTE(x) assert(x) - #define _ASSERT(x) assert(x) -#endif - - - -// I had problems with Premiere wanting 1-byte alignment for its structures, -// so I now set the Avisynth struct alignment explicitly here. -#pragma pack(push,8) - -// The VideoInfo struct holds global information about a clip (i.e. -// information that does not depend on the frame number). The GetVideoInfo -// method in IClip returns this struct. - -enum {SAMPLE_INT8 = 1<<0, - SAMPLE_INT16 = 1<<1, - SAMPLE_INT24 = 1<<2, // Int24 is a very stupid thing to code, but it's supported by some hardware. - SAMPLE_INT32 = 1<<3, - SAMPLE_FLOAT = 1<<4}; - -enum { - AVS_PLANAR_Y=1<<0, - AVS_PLANAR_U=1<<1, - AVS_PLANAR_V=1<<2, - AVS_PLANAR_ALIGNED=1<<3, - AVS_PLANAR_Y_ALIGNED= AVS_PLANAR_Y| AVS_PLANAR_ALIGNED, // MEANX : Patched to avoid clash with adm names - AVS_PLANAR_U_ALIGNED= AVS_PLANAR_U| AVS_PLANAR_ALIGNED, - AVS_PLANAR_V_ALIGNED= AVS_PLANAR_V| AVS_PLANAR_ALIGNED, - PLANAR_A=1<<4, - PLANAR_R=1<<5, - PLANAR_G=1<<6, - PLANAR_B=1<<7, - PLANAR_A_ALIGNED=PLANAR_A| AVS_PLANAR_ALIGNED, - PLANAR_R_ALIGNED=PLANAR_R| AVS_PLANAR_ALIGNED, - PLANAR_G_ALIGNED=PLANAR_G| AVS_PLANAR_ALIGNED, - PLANAR_B_ALIGNED=PLANAR_B| AVS_PLANAR_ALIGNED, - }; - -class AvisynthError /* exception */ { -public: - const char* const msg; - AvisynthError(const char* _msg) : msg(_msg) {} - -// Ensure AvisynthError cannot be publicly assigned! -private: - AvisynthError& operator=(const AvisynthError&); -}; // end class AvisynthError - - -/* Forward references */ -#if defined(MSVC) - #define SINGLE_INHERITANCE __single_inheritance -#else - #define SINGLE_INHERITANCE -#endif -struct SINGLE_INHERITANCE VideoInfo; -class SINGLE_INHERITANCE VideoFrameBuffer; -class SINGLE_INHERITANCE VideoFrame; -class IClip; -class SINGLE_INHERITANCE PClip; -class SINGLE_INHERITANCE PVideoFrame; -class IScriptEnvironment; -class SINGLE_INHERITANCE AVSValue; - - -/* - * Avisynth C++ plugin API code function pointers. - * - * In order to maintain binary compatibility with - * future version do not change the order of the - * existing function pointers. It will be baked - * into all existing plugins. - * - * Add new function pointers to the end of the - * structure. The linkage macros generate some - * protection code to ensure newer plugin do not - * call non-existing functions in an older host. - */ - -struct AVS_Linkage { - - int Size; - -/**********************************************************************/ - -// struct VideoInfo - bool (VideoInfo::*HasVideo)() const; - bool (VideoInfo::*HasAudio)() const; - bool (VideoInfo::*IsRGB)() const; - bool (VideoInfo::*IsRGB24)() const; - bool (VideoInfo::*IsRGB32)() const; - bool (VideoInfo::*IsYUV)() const; - bool (VideoInfo::*IsYUY2)() const; - bool (VideoInfo::*IsYV24)() const; - bool (VideoInfo::*IsYV16)() const; - bool (VideoInfo::*IsYV12)() const; - bool (VideoInfo::*IsYV411)() const; - bool (VideoInfo::*IsY8)() const; - bool (VideoInfo::*IsColorSpace)(int c_space) const; - bool (VideoInfo::*Is)(int property) const; - bool (VideoInfo::*IsPlanar)() const; - bool (VideoInfo::*IsFieldBased)() const; - bool (VideoInfo::*IsParityKnown)() const; - bool (VideoInfo::*IsBFF)() const; - bool (VideoInfo::*IsTFF)() const; - bool (VideoInfo::*IsVPlaneFirst)() const; - int (VideoInfo::*BytesFromPixels)(int pixels) const; - int (VideoInfo::*RowSize)(int plane) const; - int (VideoInfo::*BMPSize)() const; - __int64 (VideoInfo::*AudioSamplesFromFrames)(int frames) const; - int (VideoInfo::*FramesFromAudioSamples)(__int64 samples) const; - __int64 (VideoInfo::*AudioSamplesFromBytes)(__int64 bytes) const; - __int64 (VideoInfo::*BytesFromAudioSamples)(__int64 samples) const; - int (VideoInfo::*AudioChannels)() const; - int (VideoInfo::*SampleType)() const; - bool (VideoInfo::*IsSampleType)(int testtype) const; - int (VideoInfo::*SamplesPerSecond)() const; - int (VideoInfo::*BytesPerAudioSample)() const; - void (VideoInfo::*SetFieldBased)(bool isfieldbased); - void (VideoInfo::*Set)(int property); - void (VideoInfo::*Clear)(int property); - int (VideoInfo::*GetPlaneWidthSubsampling)(int plane) const; - int (VideoInfo::*GetPlaneHeightSubsampling)(int plane) const; - int (VideoInfo::*BitsPerPixel)() const; - int (VideoInfo::*BytesPerChannelSample)() const; - void (VideoInfo::*SetFPS)(unsigned numerator, unsigned denominator); - void (VideoInfo::*MulDivFPS)(unsigned multiplier, unsigned divisor); - bool (VideoInfo::*IsSameColorspace)(const VideoInfo& vi) const; -// end struct VideoInfo - -/**********************************************************************/ - -// class VideoFrameBuffer - const BYTE* (VideoFrameBuffer::*VFBGetReadPtr)() const; - BYTE* (VideoFrameBuffer::*VFBGetWritePtr)(); -#ifdef SIZETMOD - size_t (VideoFrameBuffer::*GetDataSize)() const; -#else - int (VideoFrameBuffer::*GetDataSize)() const; -#endif - int (VideoFrameBuffer::*GetSequenceNumber)() const; - int (VideoFrameBuffer::*GetRefcount)() const; -// end class VideoFrameBuffer - -/**********************************************************************/ - -// class VideoFrame - int (VideoFrame::*GetPitch)(int plane) const; - int (VideoFrame::*GetRowSize)(int plane) const; - int (VideoFrame::*GetHeight)(int plane) const; - VideoFrameBuffer* (VideoFrame::*GetFrameBuffer)() const; -#ifdef SIZETMOD - size_t (VideoFrame::*GetOffset)(int plane) const; -#else - int (VideoFrame::*GetOffset)(int plane) const; -#endif - const BYTE* (VideoFrame::*VFGetReadPtr)(int plane) const; - bool (VideoFrame::*IsWritable)() const; - BYTE* (VideoFrame::*VFGetWritePtr)(int plane) const; - void (VideoFrame::*VideoFrame_DESTRUCTOR)(); -// end class VideoFrame - -/**********************************************************************/ - -// class IClip - /* nothing */ -// end class IClip - -/**********************************************************************/ - -// class PClip - void (PClip::*PClip_CONSTRUCTOR0)(); - void (PClip::*PClip_CONSTRUCTOR1)(const PClip& x); - void (PClip::*PClip_CONSTRUCTOR2)(IClip* x); - void (PClip::*PClip_OPERATOR_ASSIGN0)(IClip* x); - void (PClip::*PClip_OPERATOR_ASSIGN1)(const PClip& x); - void (PClip::*PClip_DESTRUCTOR)(); -// end class PClip - -/**********************************************************************/ - -// class PVideoFrame - void (PVideoFrame::*PVideoFrame_CONSTRUCTOR0)(); - void (PVideoFrame::*PVideoFrame_CONSTRUCTOR1)(const PVideoFrame& x); - void (PVideoFrame::*PVideoFrame_CONSTRUCTOR2)(VideoFrame* x); - void (PVideoFrame::*PVideoFrame_OPERATOR_ASSIGN0)(VideoFrame* x); - void (PVideoFrame::*PVideoFrame_OPERATOR_ASSIGN1)(const PVideoFrame& x); - void (PVideoFrame::*PVideoFrame_DESTRUCTOR)(); -// end class PVideoFrame - -/**********************************************************************/ - -// class AVSValue - void (AVSValue::*AVSValue_CONSTRUCTOR0)(); - void (AVSValue::*AVSValue_CONSTRUCTOR1)(IClip* c); - void (AVSValue::*AVSValue_CONSTRUCTOR2)(const PClip& c); - void (AVSValue::*AVSValue_CONSTRUCTOR3)(bool b); - void (AVSValue::*AVSValue_CONSTRUCTOR4)(int i); - void (AVSValue::*AVSValue_CONSTRUCTOR5)(float f); - void (AVSValue::*AVSValue_CONSTRUCTOR6)(double f); - void (AVSValue::*AVSValue_CONSTRUCTOR7)(const char* s); - void (AVSValue::*AVSValue_CONSTRUCTOR8)(const AVSValue* a, int size); - void (AVSValue::*AVSValue_CONSTRUCTOR9)(const AVSValue& v); - void (AVSValue::*AVSValue_DESTRUCTOR)(); - AVSValue& (AVSValue::*AVSValue_OPERATOR_ASSIGN)(const AVSValue& v); - const AVSValue& (AVSValue::*AVSValue_OPERATOR_INDEX)(int index) const; - bool (AVSValue::*Defined)() const; - bool (AVSValue::*IsClip)() const; - bool (AVSValue::*IsBool)() const; - bool (AVSValue::*IsInt)() const; - bool (AVSValue::*IsFloat)() const; - bool (AVSValue::*IsString)() const; - bool (AVSValue::*IsArray)() const; - PClip (AVSValue::*AsClip)() const; - bool (AVSValue::*AsBool1)() const; - int (AVSValue::*AsInt1)() const; - const char* (AVSValue::*AsString1)() const; - double (AVSValue::*AsFloat1)() const; - bool (AVSValue::*AsBool2)(bool def) const; - int (AVSValue::*AsInt2)(int def) const; - double (AVSValue::*AsDblDef)(double def) const; - double (AVSValue::*AsFloat2)(float def) const; - const char* (AVSValue::*AsString2)(const char* def) const; - int (AVSValue::*ArraySize)() const; -// end class AVSValue - -/**********************************************************************/ - // Reserve pointer space so that we can keep compatibility with Avs "classic" even if it adds functions on its own - void (VideoInfo::*reserved[32])(); -/**********************************************************************/ - // AviSynth+ additions - int (VideoInfo::*NumComponents)() const; - int (VideoInfo::*ComponentSize)() const; - int (VideoInfo::*BitsPerComponent)() const; - bool (VideoInfo::*Is444)() const; - bool (VideoInfo::*Is422)() const; - bool (VideoInfo::*Is420)() const; - bool (VideoInfo::*IsY)() const; - bool (VideoInfo::*IsRGB48)() const; - bool (VideoInfo::*IsRGB64)() const; - bool (VideoInfo::*IsYUVA)() const; - bool (VideoInfo::*IsPlanarRGB)() const; - bool (VideoInfo::*IsPlanarRGBA)() const; - /**********************************************************************/ -}; - -#ifdef BUILDING_AVSCORE -/* Macro resolution for code inside Avisynth.dll */ -# define AVS_BakedCode(arg) ; -# define AVS_LinkCall(arg) -# define AVS_LinkCallV(arg) -# define AVS_LinkCallOpt(arg, argOpt) AVSLinkCall(arg) -# define AVS_LinkCallOptDefault(arg, argDefaultValue) AVSLinkCall(arg()) -# define CALL_MEMBER_FN(object,ptrToMember) - -#else -/* Macro resolution for code inside user plugin */ -# ifdef AVS_LINKAGE_DLLIMPORT -extern __declspec(dllimport) const AVS_Linkage* const AVS_linkage; -# else -extern const AVS_Linkage* AVS_linkage; -# endif - -# ifndef offsetof -# include -# endif - -# define AVS_BakedCode(arg) { arg ; } -# define AVS_LinkCall(arg) !AVS_linkage || offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? 0 : (this->*(AVS_linkage->arg)) -# define AVS_LinkCall_Void(arg) !AVS_linkage || offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? (void)0 : (this->*(AVS_linkage->arg)) -# define AVS_LinkCallV(arg) !AVS_linkage || offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? *this : (this->*(AVS_linkage->arg)) -// Helper macros for fallback option when a function does not exists -#define CALL_MEMBER_FN(object,ptrToMember) ((object)->*(ptrToMember)) -#define AVS_LinkCallOpt(arg, argOpt) !AVS_linkage ? 0 : \ - ( offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? \ - (offsetof(AVS_Linkage, argOpt) >= AVS_linkage->Size ? 0 : CALL_MEMBER_FN(this, AVS_linkage->argOpt)() ) : \ - CALL_MEMBER_FN(this, AVS_linkage->arg)() ) -// AVS_LinkCallOptDefault puts automatically () only after arg -# define AVS_LinkCallOptDefault(arg, argDefaultValue) !AVS_linkage || offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? (argDefaultValue) : ((this->*(AVS_linkage->arg))()) - -#endif - -struct VideoInfo { - int width, height; // width=0 means no video - unsigned fps_numerator, fps_denominator; - int num_frames; - // This is more extensible than previous versions. More properties can be added seeminglesly. - - // Colorspace properties. -/* - -Planar match mask 1111.1000.0000.0111.0000.0111.0000.0111 -Planar signature 10xx.1000.0000.00xx.0000.00xx.00xx.00xx ? -Planar signature 10xx.1000.0000.0xxx.0000.00xx.000x.x0xx ? *new -Planar filter mask 1111.1111.1111.1111.1111.1111.1110.0111 (typo from old header fixed) - -pixel_type mapping -================== -pixel_type bit-map PIYB.Z000.0???.0SSS.0000.0???.????.???? - planar YUV CCC HHH.000u.vWWW - planar RGB(A) CCC AR - nonplanar CCC 000.00wx xyAR -Legend -====== -Planar YUV: - Code Bits Remark - W 0-2 Planar Width Subsampling bits - Use (X+1) & 3 for GetPlaneWidthSubsampling - 000 => 1 YV12, YV16, YUV420, YUV422 - 001 => 2 YV411, YUV9 - 010 => reserved - 011 => 0 YV24, YUV444, RGBP - 1xx => reserved - v 3 VPlaneFirst YV12, YV16, YV24, YV411, YUV9 - u 4 UPlaneFirst I420 - H 7-9 Planar Height Subsampling bits - Use ((X>>8)+1) & 3 for GetPlaneHeightSubsampling - 000 => 1 YV12, YUV420 - 001 => 2 YUV9 - 010 => reserved - 011 => 0 YV16, YV24, YV411, YUV422, YUV444, RGBP - 1xx => reserved - -Planar RGB - Code Bits Remark - R 0 BGR, (with SSS bits for 8/16 bit/sample or float) - A 1 BGRA, (with SSS bits for 8/16 bit/sample or float) - - -Not Planar, Interleaved (I flag) -Code Bits Remark - R 0 BGR24, and BGRx in future (with SSS bits for 8/16 bit/sample or float) - A 1 BGR32, and BGRAx in future (with SSS bits for 8/16 bit/sample or float) - y 2 YUY2 - x 3-4 reserved - w 5 Raw32 - -General -Code Bits Remark - S 16-18 Sample resolution bits - 000 => 8 - 001 => 16 - 010 => 32 (float) - 011,100 => reserved - 101 => 10 bits - 110 => 12 bits - 111 => 14 bits -for packed RGB(A): only 8 and 16 bits are valid - -Other YV12 specific (not used?) - C 20-22 Chroma Placement values 0-4 see CS_xxx_CHROMA_PLACEMENT - -Color family and layout - Packed Planar Planar Planar -Code Bits Remark RGB/RGBA YUV YUY2 Y_Grey RGB/RGBA YUVA - R 0 1/0 - 0 - 1/0 - - A 1 0/1 - 0 - 0/1 - - y 2 - - 1 - 0 - - Z 27 YUVA 0 0 0 0 1 1 - B 28 BGR 1 0 0 0 1* 0 - Y 29 YUV 0 1 1 1 0 0 - I 30 Interleaved 1 0 1 1 0 0 - P 31 Planar 0 1 0 1 1 1 -* Planar RGB plane order: G,B,R(,A) - -*/ -enum { - CS_YUVA = 1<<27, - CS_BGR = 1<<28, - CS_YUV = 1<<29, - CS_INTERLEAVED = 1<<30, - CS_PLANAR = 1<<31, - - CS_Shift_Sub_Width = 0, - CS_Shift_Sub_Height = 8, - CS_Shift_Sample_Bits = 16, - - CS_Sub_Width_Mask = 7 << CS_Shift_Sub_Width, - CS_Sub_Width_1 = 3 << CS_Shift_Sub_Width, // YV24 - CS_Sub_Width_2 = 0 << CS_Shift_Sub_Width, // YV12, I420, YV16 - CS_Sub_Width_4 = 1 << CS_Shift_Sub_Width, // YUV9, YV411 - - CS_VPlaneFirst = 1 << 3, // YV12, YV16, YV24, YV411, YUV9 - CS_UPlaneFirst = 1 << 4, // I420 - - CS_Sub_Height_Mask = 7 << CS_Shift_Sub_Height, - CS_Sub_Height_1 = 3 << CS_Shift_Sub_Height, // YV16, YV24, YV411 - CS_Sub_Height_2 = 0 << CS_Shift_Sub_Height, // YV12, I420 - CS_Sub_Height_4 = 1 << CS_Shift_Sub_Height, // YUV9 - - CS_Sample_Bits_Mask = 7 << CS_Shift_Sample_Bits, - CS_Sample_Bits_8 = 0 << CS_Shift_Sample_Bits, - CS_Sample_Bits_10 = 5 << CS_Shift_Sample_Bits, - CS_Sample_Bits_12 = 6 << CS_Shift_Sample_Bits, - CS_Sample_Bits_14 = 7 << CS_Shift_Sample_Bits, - CS_Sample_Bits_16 = 1 << CS_Shift_Sample_Bits, - CS_Sample_Bits_32 = 2 << CS_Shift_Sample_Bits, - - CS_PLANAR_MASK = CS_PLANAR | CS_INTERLEAVED | CS_YUV | CS_BGR | CS_YUVA | CS_Sample_Bits_Mask - | CS_Sub_Height_Mask | CS_Sub_Width_Mask, - CS_PLANAR_FILTER = ~( CS_VPlaneFirst | CS_UPlaneFirst ), - - CS_RGB_TYPE = 1 << 0, - CS_RGBA_TYPE = 1 << 1, - - // Specific colorformats - CS_UNKNOWN = 0, - - CS_BGR24 = CS_RGB_TYPE | CS_BGR | CS_INTERLEAVED, - CS_BGR32 = CS_RGBA_TYPE | CS_BGR | CS_INTERLEAVED, - CS_YUY2 = 1<<2 | CS_YUV | CS_INTERLEAVED, - // CS_YV12 = 1<<3 Reserved - // CS_I420 = 1<<4 Reserved - CS_RAW32 = 1<<5 | CS_INTERLEAVED, - - // YV12 must be 0xA000008 2.5 Baked API will see all new planar as YV12 - // I420 must be 0xA000010 - - CS_GENERIC_YUV420 = CS_PLANAR | CS_YUV | CS_VPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2, // 4:2:0 planar - CS_GENERIC_YUV422 = CS_PLANAR | CS_YUV | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_2, // 4:2:2 planar - CS_GENERIC_YUV444 = CS_PLANAR | CS_YUV | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_1, // 4:4:4 planar - CS_GENERIC_Y = CS_PLANAR | CS_INTERLEAVED | CS_YUV, // Y only (4:0:0) - CS_GENERIC_RGBP = CS_PLANAR | CS_BGR | CS_RGB_TYPE, // planar RGB. Though name is RGB but plane order G,B,R - CS_GENERIC_RGBAP = CS_PLANAR | CS_BGR | CS_RGBA_TYPE, // planar RGBA - CS_GENERIC_YUVA420 = CS_PLANAR | CS_YUVA | CS_VPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2, // 4:2:0:A planar - CS_GENERIC_YUVA422 = CS_PLANAR | CS_YUVA | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_2, // 4:2:2:A planar - CS_GENERIC_YUVA444 = CS_PLANAR | CS_YUVA | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_1, // 4:4:4:A planar - - CS_YV24 = CS_GENERIC_YUV444 | CS_Sample_Bits_8, // YVU 4:4:4 planar - CS_YV16 = CS_GENERIC_YUV422 | CS_Sample_Bits_8, // YVU 4:2:2 planar - CS_YV12 = CS_GENERIC_YUV420 | CS_Sample_Bits_8, // YVU 4:2:0 planar - CS_I420 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_UPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2, // YUV 4:2:0 planar - CS_IYUV = CS_I420, - CS_YUV9 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_4 | CS_Sub_Width_4, // YUV 4:1:0 planar - CS_YV411 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_4, // YUV 4:1:1 planar - - CS_Y8 = CS_GENERIC_Y | CS_Sample_Bits_8, // Y 4:0:0 planar - - //------------------------- - // AVS16: new planar constants go live! Experimental PF 160613 - // 10-12-14 bit + planar RGB + BRG48/64 160725 - - CS_YUV444P10 = CS_GENERIC_YUV444 | CS_Sample_Bits_10, // YUV 4:4:4 10bit samples - CS_YUV422P10 = CS_GENERIC_YUV422 | CS_Sample_Bits_10, // YUV 4:2:2 10bit samples - CS_YUV420P10 = CS_GENERIC_YUV420 | CS_Sample_Bits_10, // YUV 4:2:0 10bit samples - CS_Y10 = CS_GENERIC_Y | CS_Sample_Bits_10, // Y 4:0:0 10bit samples - - CS_YUV444P12 = CS_GENERIC_YUV444 | CS_Sample_Bits_12, // YUV 4:4:4 12bit samples - CS_YUV422P12 = CS_GENERIC_YUV422 | CS_Sample_Bits_12, // YUV 4:2:2 12bit samples - CS_YUV420P12 = CS_GENERIC_YUV420 | CS_Sample_Bits_12, // YUV 4:2:0 12bit samples - CS_Y12 = CS_GENERIC_Y | CS_Sample_Bits_12, // Y 4:0:0 12bit samples - - CS_YUV444P14 = CS_GENERIC_YUV444 | CS_Sample_Bits_14, // YUV 4:4:4 14bit samples - CS_YUV422P14 = CS_GENERIC_YUV422 | CS_Sample_Bits_14, // YUV 4:2:2 14bit samples - CS_YUV420P14 = CS_GENERIC_YUV420 | CS_Sample_Bits_14, // YUV 4:2:0 14bit samples - CS_Y14 = CS_GENERIC_Y | CS_Sample_Bits_14, // Y 4:0:0 14bit samples - - CS_YUV444P16 = CS_GENERIC_YUV444 | CS_Sample_Bits_16, // YUV 4:4:4 16bit samples - CS_YUV422P16 = CS_GENERIC_YUV422 | CS_Sample_Bits_16, // YUV 4:2:2 16bit samples - CS_YUV420P16 = CS_GENERIC_YUV420 | CS_Sample_Bits_16, // YUV 4:2:0 16bit samples - CS_Y16 = CS_GENERIC_Y | CS_Sample_Bits_16, // Y 4:0:0 16bit samples - - // 32 bit samples (float) - CS_YUV444PS = CS_GENERIC_YUV444 | CS_Sample_Bits_32, // YUV 4:4:4 32bit samples - CS_YUV422PS = CS_GENERIC_YUV422 | CS_Sample_Bits_32, // YUV 4:2:2 32bit samples - CS_YUV420PS = CS_GENERIC_YUV420 | CS_Sample_Bits_32, // YUV 4:2:0 32bit samples - CS_Y32 = CS_GENERIC_Y | CS_Sample_Bits_32, // Y 4:0:0 32bit samples - - // RGB packed - CS_BGR48 = CS_RGB_TYPE | CS_BGR | CS_INTERLEAVED | CS_Sample_Bits_16, // BGR 3x16 bit - CS_BGR64 = CS_RGBA_TYPE | CS_BGR | CS_INTERLEAVED | CS_Sample_Bits_16, // BGR 4x16 bit - // no packed 32 bit (float) support for these legacy types - - // RGB planar - CS_RGBP = CS_GENERIC_RGBP | CS_Sample_Bits_8, // Planar RGB 8 bit samples - CS_RGBP10 = CS_GENERIC_RGBP | CS_Sample_Bits_10, // Planar RGB 10bit samples - CS_RGBP12 = CS_GENERIC_RGBP | CS_Sample_Bits_12, // Planar RGB 12bit samples - CS_RGBP14 = CS_GENERIC_RGBP | CS_Sample_Bits_14, // Planar RGB 14bit samples - CS_RGBP16 = CS_GENERIC_RGBP | CS_Sample_Bits_16, // Planar RGB 16bit samples - CS_RGBPS = CS_GENERIC_RGBP | CS_Sample_Bits_32, // Planar RGB 32bit samples - - // RGBA planar - CS_RGBAP = CS_GENERIC_RGBAP | CS_Sample_Bits_8, // Planar RGBA 8 bit samples - CS_RGBAP10 = CS_GENERIC_RGBAP | CS_Sample_Bits_10, // Planar RGBA 10bit samples - CS_RGBAP12 = CS_GENERIC_RGBAP | CS_Sample_Bits_12, // Planar RGBA 12bit samples - CS_RGBAP14 = CS_GENERIC_RGBAP | CS_Sample_Bits_14, // Planar RGBA 14bit samples - CS_RGBAP16 = CS_GENERIC_RGBAP | CS_Sample_Bits_16, // Planar RGBA 16bit samples - CS_RGBAPS = CS_GENERIC_RGBAP | CS_Sample_Bits_32, // Planar RGBA 32bit samples - - // Planar YUVA - CS_YUVA444 = CS_GENERIC_YUVA444 | CS_Sample_Bits_8, // YUVA 4:4:4 8bit samples - CS_YUVA422 = CS_GENERIC_YUVA422 | CS_Sample_Bits_8, // YUVA 4:2:2 8bit samples - CS_YUVA420 = CS_GENERIC_YUVA420 | CS_Sample_Bits_8, // YUVA 4:2:0 8bit samples - - CS_YUVA444P10 = CS_GENERIC_YUVA444 | CS_Sample_Bits_10, // YUVA 4:4:4 10bit samples - CS_YUVA422P10 = CS_GENERIC_YUVA422 | CS_Sample_Bits_10, // YUVA 4:2:2 10bit samples - CS_YUVA420P10 = CS_GENERIC_YUVA420 | CS_Sample_Bits_10, // YUVA 4:2:0 10bit samples - - CS_YUVA444P12 = CS_GENERIC_YUVA444 | CS_Sample_Bits_12, // YUVA 4:4:4 12bit samples - CS_YUVA422P12 = CS_GENERIC_YUVA422 | CS_Sample_Bits_12, // YUVA 4:2:2 12bit samples - CS_YUVA420P12 = CS_GENERIC_YUVA420 | CS_Sample_Bits_12, // YUVA 4:2:0 12bit samples - - CS_YUVA444P14 = CS_GENERIC_YUVA444 | CS_Sample_Bits_14, // YUVA 4:4:4 14bit samples - CS_YUVA422P14 = CS_GENERIC_YUVA422 | CS_Sample_Bits_14, // YUVA 4:2:2 14bit samples - CS_YUVA420P14 = CS_GENERIC_YUVA420 | CS_Sample_Bits_14, // YUVA 4:2:0 14bit samples - - CS_YUVA444P16 = CS_GENERIC_YUVA444 | CS_Sample_Bits_16, // YUVA 4:4:4 16bit samples - CS_YUVA422P16 = CS_GENERIC_YUVA422 | CS_Sample_Bits_16, // YUVA 4:2:2 16bit samples - CS_YUVA420P16 = CS_GENERIC_YUVA420 | CS_Sample_Bits_16, // YUVA 4:2:0 16bit samples - - CS_YUVA444PS = CS_GENERIC_YUVA444 | CS_Sample_Bits_32, // YUVA 4:4:4 32bit samples - CS_YUVA422PS = CS_GENERIC_YUVA422 | CS_Sample_Bits_32, // YUVA 4:2:2 32bit samples - CS_YUVA420PS = CS_GENERIC_YUVA420 | CS_Sample_Bits_32, // YUVA 4:2:0 32bit samples - - }; - - int pixel_type; // changed to int as of 2.5 - - - int audio_samples_per_second; // 0 means no audio - int sample_type; // as of 2.5 - __int64 num_audio_samples; // changed as of 2.5 - int nchannels; // as of 2.5 - - // Imagetype properties - - int image_type; - - enum { - IT_BFF = 1<<0, - IT_TFF = 1<<1, - IT_FIELDBASED = 1<<2 - }; - - // Chroma placement bits 20 -> 23 ::FIXME:: Really want a Class to support this - enum { - CS_UNKNOWN_CHROMA_PLACEMENT = 0 << 20, - CS_MPEG1_CHROMA_PLACEMENT = 1 << 20, - CS_MPEG2_CHROMA_PLACEMENT = 2 << 20, - CS_YUY2_CHROMA_PLACEMENT = 3 << 20, - CS_TOPLEFT_CHROMA_PLACEMENT = 4 << 20 - }; - - // useful functions of the above - bool HasVideo() const AVS_BakedCode(return AVS_LinkCall(HasVideo)()) - bool HasAudio() const AVS_BakedCode(return AVS_LinkCall(HasAudio)()) - bool IsRGB() const AVS_BakedCode(return AVS_LinkCall(IsRGB)()) - bool IsRGB24() const AVS_BakedCode(return AVS_LinkCall(IsRGB24)()) - bool IsRGB32() const AVS_BakedCode(return AVS_LinkCall(IsRGB32)()) - bool IsYUV() const AVS_BakedCode(return AVS_LinkCall(IsYUV)()) - bool IsYUY2() const AVS_BakedCode(return AVS_LinkCall(IsYUY2)()) - - bool IsYV24() const AVS_BakedCode(return AVS_LinkCall(IsYV24)()) - bool IsYV16() const AVS_BakedCode(return AVS_LinkCall(IsYV16)()) - bool IsYV12() const AVS_BakedCode(return AVS_LinkCall(IsYV12)()) - bool IsYV411() const AVS_BakedCode(return AVS_LinkCall(IsYV411)()) - //bool IsYUV9() const; - bool IsY8() const AVS_BakedCode(return AVS_LinkCall(IsY8)()) - - bool IsColorSpace(int c_space) const AVS_BakedCode(return AVS_LinkCall(IsColorSpace)(c_space)) - - bool Is(int property) const AVS_BakedCode(return AVS_LinkCall(Is)(property)) - bool IsPlanar() const AVS_BakedCode(return AVS_LinkCall(IsPlanar)()) - bool IsFieldBased() const AVS_BakedCode(return AVS_LinkCall(IsFieldBased)()) - bool IsParityKnown() const AVS_BakedCode(return AVS_LinkCall(IsParityKnown)()) - bool IsBFF() const AVS_BakedCode(return AVS_LinkCall(IsBFF)()) - bool IsTFF() const AVS_BakedCode(return AVS_LinkCall(IsTFF)()) - - bool IsVPlaneFirst() const AVS_BakedCode(return AVS_LinkCall(IsVPlaneFirst)()) // Don't use this - // Will not work on planar images, but will return only luma planes - int BytesFromPixels(int pixels) const AVS_BakedCode(return AVS_LinkCall(BytesFromPixels)(pixels)) - int RowSize(int plane = 0) const AVS_BakedCode(return AVS_LinkCall(RowSize)(plane)) - int BMPSize() const AVS_BakedCode(return AVS_LinkCall(BMPSize)()) - - __int64 AudioSamplesFromFrames(int frames) const AVS_BakedCode(return AVS_LinkCall(AudioSamplesFromFrames)(frames)) - int FramesFromAudioSamples(__int64 samples) const AVS_BakedCode(return AVS_LinkCall(FramesFromAudioSamples)(samples)) - __int64 AudioSamplesFromBytes(__int64 bytes) const AVS_BakedCode(return AVS_LinkCall(AudioSamplesFromBytes)(bytes)) - __int64 BytesFromAudioSamples(__int64 samples) const AVS_BakedCode(return AVS_LinkCall(BytesFromAudioSamples)(samples)) - int AudioChannels() const AVS_BakedCode(return AVS_LinkCall(AudioChannels)()) - int SampleType() const AVS_BakedCode(return AVS_LinkCall(SampleType)()) - bool IsSampleType(int testtype) const AVS_BakedCode(return AVS_LinkCall(IsSampleType)(testtype)) - int SamplesPerSecond() const AVS_BakedCode(return AVS_LinkCall(SamplesPerSecond)()) - int BytesPerAudioSample() const AVS_BakedCode(return AVS_LinkCall(BytesPerAudioSample)()) - void SetFieldBased(bool isfieldbased) AVS_BakedCode(AVS_LinkCall_Void(SetFieldBased)(isfieldbased)) - void Set(int property) AVS_BakedCode(AVS_LinkCall_Void(Set)(property)) - void Clear(int property) AVS_BakedCode(AVS_LinkCall_Void(Clear)(property)) - // Subsampling in bitshifts! - int GetPlaneWidthSubsampling(int plane) const AVS_BakedCode(return AVS_LinkCall(GetPlaneWidthSubsampling)(plane)) - int GetPlaneHeightSubsampling(int plane) const AVS_BakedCode(return AVS_LinkCall(GetPlaneHeightSubsampling)(plane)) - int BitsPerPixel() const AVS_BakedCode(return AVS_LinkCall(BitsPerPixel)()) - - int BytesPerChannelSample() const AVS_BakedCode(return AVS_LinkCall(BytesPerChannelSample)()) - - // useful mutator - void SetFPS(unsigned numerator, unsigned denominator) AVS_BakedCode(AVS_LinkCall_Void(SetFPS)(numerator, denominator)) - - // Range protected multiply-divide of FPS - void MulDivFPS(unsigned multiplier, unsigned divisor) AVS_BakedCode(AVS_LinkCall_Void(MulDivFPS)(multiplier, divisor)) - - // Test for same colorspace - bool IsSameColorspace(const VideoInfo& vi) const AVS_BakedCode(return AVS_LinkCall(IsSameColorspace)(vi)) - - // AVS+ extensions - // 20161005: - // Mapping of AVS+ extensions to classic 2.6 functions. - // In order to use these extended AVS+ functions for plugins that should work - // either with AVS+ or with Classic (8 bit) Avs 2.6 ans earlier AVS+ versions, there is an - // automatic fallback mechanism. - // From AVS+'s point of view these are not "baked" codes, the primary functions should exist. - // Examples: - // Is444() is mapped to IsYV24() for classic AVS2.6 - // ComponentSize() returns constant 1 (1 bytes per pixel component) - // BitsPerComponent() returns constant 8 (Classic AVS2.6 is 8 bit only) - - // Returns the number of color channels or planes in a frame - int NumComponents() const AVS_BakedCode(return AVS_LinkCallOptDefault(NumComponents, (((AVS_LinkCall(IsYUV)()) && !(AVS_LinkCall(IsY8)())) ? 3 : AVS_LinkCall(BytesFromPixels)(1)) ) ) - - // Returns the size in bytes of a single component of a pixel - int ComponentSize() const AVS_BakedCode(return AVS_LinkCallOptDefault(ComponentSize, 1)) - - // Returns the bit depth of a single component of a pixel - int BitsPerComponent() const AVS_BakedCode(return AVS_LinkCallOptDefault(BitsPerComponent, 8)) - - // like IsYV24, but bit-depth independent also for YUVA - bool Is444() const AVS_BakedCode(return AVS_LinkCallOpt(Is444, IsYV24) ) - - // like IsYV16, but bit-depth independent also for YUVA - bool Is422() const AVS_BakedCode(return AVS_LinkCallOpt(Is422, IsYV16) ) - - // like IsYV12, but bit-depth independent also for YUVA - bool Is420() const AVS_BakedCode( return AVS_LinkCallOpt(Is420, IsYV12) ) - - // like IsY8, but bit-depth independent - bool IsY() const AVS_BakedCode( return AVS_LinkCallOpt(IsY, IsY8) ) - - // like IsRGB24 for 16 bit samples - bool IsRGB48() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsRGB48, false) ) - - // like IsRGB32 for 16 bit samples - bool IsRGB64() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsRGB64, false) ) - - // YUVA? - bool IsYUVA() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsYUVA, false) ) - - // Planar RGB? - bool IsPlanarRGB() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsPlanarRGB, false) ) - - // Planar RGBA? - bool IsPlanarRGBA() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsPlanarRGBA, false) ) - -}; // end struct VideoInfo - - - - -// VideoFrameBuffer holds information about a memory block which is used -// for video data. For efficiency, instances of this class are not deleted -// when the refcount reaches zero; instead they're stored in a linked list -// to be reused. The instances are deleted when the corresponding AVS -// file is closed. - -class VideoFrameBuffer { - BYTE* data; -#ifdef SIZETMOD - size_t data_size; -#else - int data_size; -#endif - // sequence_number is incremented every time the buffer is changed, so - // that stale views can tell they're no longer valid. - volatile long sequence_number; - - friend class VideoFrame; - friend class Cache; - friend class ScriptEnvironment; - volatile long refcount; - -protected: -#ifdef SIZETMOD - VideoFrameBuffer(size_t size); -#else - VideoFrameBuffer(int size); -#endif - VideoFrameBuffer(); - ~VideoFrameBuffer(); - -public: - const BYTE* GetReadPtr() const AVS_BakedCode( return AVS_LinkCall(VFBGetReadPtr)() ) - BYTE* GetWritePtr() AVS_BakedCode( return AVS_LinkCall(VFBGetWritePtr)() ) -#ifdef SIZETMOD - size_t GetDataSize() const AVS_BakedCode(return AVS_LinkCall(GetDataSize)()) -#else - int GetDataSize() const AVS_BakedCode( return AVS_LinkCall(GetDataSize)() ) -#endif - int GetSequenceNumber() const AVS_BakedCode( return AVS_LinkCall(GetSequenceNumber)() ) - int GetRefcount() const AVS_BakedCode( return AVS_LinkCall(GetRefcount)() ) - -// Ensure VideoFrameBuffer cannot be publicly assigned -private: - VideoFrameBuffer& operator=(const VideoFrameBuffer&); - -}; // end class VideoFrameBuffer - - -// VideoFrame holds a "window" into a VideoFrameBuffer. Operator new -// is overloaded to recycle class instances. - -class VideoFrame { - volatile long refcount; - VideoFrameBuffer* vfb; - - // Due to technical reasons these members are not const, but should be treated as such. - // That means do not modify them once the class has been constructed. -#ifdef SIZETMOD - size_t offset; -#else - int offset; -#endif - int pitch, row_size, height; -#ifdef SIZETMOD - size_t offsetU, offsetV; // U&V offsets are from top of picture. -#else - int offsetU, offsetV; // U&V offsets are from top of picture. -#endif - int pitchUV, row_sizeUV, heightUV; // for Planar RGB offsetU, offsetV is for the 2nd and 3rd Plane. - // for Planar RGB pitchUV and row_sizeUV = 0, because when no VideoInfo (MakeWriteable) - // the decision on existance of UV is checked by zero pitch - // AVS+ extension, does not break plugins if appended here -#ifdef SIZETMOD - size_t offsetA; -#else - int offsetA; -#endif - int pitchA, row_sizeA; // 4th alpha plane support, pitch and row_size is 0 is none - - friend class PVideoFrame; - void AddRef(); - void Release(); - - friend class ScriptEnvironment; - friend class Cache; - -#ifdef SIZETMOD - VideoFrame(VideoFrameBuffer* _vfb, size_t _offset, int _pitch, int _row_size, int _height); - VideoFrame(VideoFrameBuffer* _vfb, size_t _offset, int _pitch, int _row_size, int _height, size_t _offsetU, size_t _offsetV, int _pitchUV, int _row_sizeUV, int _heightUV); - // for Alpha - VideoFrame(VideoFrameBuffer* _vfb, size_t _offset, int _pitch, int _row_size, int _height, size_t _offsetU, size_t _offsetV, int _pitchUV, int _row_sizeUV, int _heightUV, size_t _offsetA); -#else - VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height); - VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height, int _offsetU, int _offsetV, int _pitchUV, int _row_sizeUV, int _heightUV); - // for Alpha - VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height, int _offsetU, int _offsetV, int _pitchUV, int _row_sizeUV, int _heightUV, int _offsetA); -#endif - - void* operator new(size_t size); -// TESTME: OFFSET U/V may be switched to what could be expected from AVI standard! -public: - int GetPitch(int plane=0) const AVS_BakedCode( return AVS_LinkCall(GetPitch)(plane) ) - int GetRowSize(int plane=0) const AVS_BakedCode( return AVS_LinkCall(GetRowSize)(plane) ) - int GetHeight(int plane=0) const AVS_BakedCode( return AVS_LinkCall(GetHeight)(plane) ) - - // generally you shouldn't use these three - VideoFrameBuffer* GetFrameBuffer() const AVS_BakedCode( return AVS_LinkCall(GetFrameBuffer)() ) -#ifdef SIZETMOD - size_t GetOffset(int plane = 0) const AVS_BakedCode(return AVS_LinkCall(GetOffset)(plane)) -#else - int GetOffset(int plane=0) const AVS_BakedCode( return AVS_LinkCall(GetOffset)(plane) ) -#endif - - // in plugins use env->SubFrame() -- because implementation code is only available inside avisynth.dll. Doh! - VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height) const; - VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int pitchUV) const; - // for Alpha - VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int pitchUV, int rel_offsetA) const; - - const BYTE* GetReadPtr(int plane=0) const AVS_BakedCode( return AVS_LinkCall(VFGetReadPtr)(plane) ) - bool IsWritable() const AVS_BakedCode( return AVS_LinkCall(IsWritable)() ) - BYTE* GetWritePtr(int plane=0) const AVS_BakedCode( return AVS_LinkCall(VFGetWritePtr)(plane) ) - - ~VideoFrame() AVS_BakedCode( AVS_LinkCall_Void(VideoFrame_DESTRUCTOR)() ) -#ifdef BUILDING_AVSCORE -public: - void DESTRUCTOR(); /* Damn compiler won't allow taking the address of reserved constructs, make a dummy interlude */ -#endif - -// Ensure VideoFrame cannot be publicly assigned -private: - VideoFrame& operator=(const VideoFrame&); - -}; // end class VideoFrame - -enum CachePolicyHint { - // Values 0 to 5 are reserved for old 2.5 plugins - // do not use them in new plugins - - // New 2.6 explicitly defined cache hints. - CACHE_NOTHING=10, // Do not cache video. - CACHE_WINDOW=11, // Hard protect upto X frames within a range of X from the current frame N. - CACHE_GENERIC=12, // LRU cache upto X frames. - CACHE_FORCE_GENERIC=13, // LRU cache upto X frames, override any previous CACHE_WINDOW. - - CACHE_GET_POLICY=30, // Get the current policy. - CACHE_GET_WINDOW=31, // Get the current window h_span. - CACHE_GET_RANGE=32, // Get the current generic frame range. - - CACHE_AUDIO=50, // Explicitly cache audio, X byte cache. - CACHE_AUDIO_NOTHING=51, // Explicitly do not cache audio. - CACHE_AUDIO_NONE=52, // Audio cache off (auto mode), X byte intial cache. - CACHE_AUDIO_AUTO=53, // Audio cache on (auto mode), X byte intial cache. - - CACHE_GET_AUDIO_POLICY=70, // Get the current audio policy. - CACHE_GET_AUDIO_SIZE=71, // Get the current audio cache size. - - CACHE_PREFETCH_FRAME=100, // Queue request to prefetch frame N. - CACHE_PREFETCH_GO=101, // Action video prefetches. - - CACHE_PREFETCH_AUDIO_BEGIN=120, // Begin queue request transaction to prefetch audio (take critical section). - CACHE_PREFETCH_AUDIO_STARTLO=121, // Set low 32 bits of start. - CACHE_PREFETCH_AUDIO_STARTHI=122, // Set high 32 bits of start. - CACHE_PREFETCH_AUDIO_COUNT=123, // Set low 32 bits of length. - CACHE_PREFETCH_AUDIO_COMMIT=124, // Enqueue request transaction to prefetch audio (release critical section). - CACHE_PREFETCH_AUDIO_GO=125, // Action audio prefetches. - - CACHE_GETCHILD_CACHE_MODE=200, // Cache ask Child for desired video cache mode. - CACHE_GETCHILD_CACHE_SIZE=201, // Cache ask Child for desired video cache size. - CACHE_GETCHILD_AUDIO_MODE=202, // Cache ask Child for desired audio cache mode. - CACHE_GETCHILD_AUDIO_SIZE=203, // Cache ask Child for desired audio cache size. - - CACHE_GETCHILD_COST=220, // Cache ask Child for estimated processing cost. - CACHE_COST_ZERO=221, // Child response of zero cost (ptr arithmetic only). - CACHE_COST_UNIT=222, // Child response of unit cost (less than or equal 1 full frame blit). - CACHE_COST_LOW=223, // Child response of light cost. (Fast) - CACHE_COST_MED=224, // Child response of medium cost. (Real time) - CACHE_COST_HI=225, // Child response of heavy cost. (Slow) - - CACHE_GETCHILD_THREAD_MODE=240, // Cache ask Child for thread safetyness. - CACHE_THREAD_UNSAFE=241, // Only 1 thread allowed for all instances. 2.5 filters default! - CACHE_THREAD_CLASS=242, // Only 1 thread allowed for each instance. 2.6 filters default! - CACHE_THREAD_SAFE=243, // Allow all threads in any instance. - CACHE_THREAD_OWN=244, // Safe but limit to 1 thread, internally threaded. - - CACHE_GETCHILD_ACCESS_COST=260, // Cache ask Child for preferred access pattern. - CACHE_ACCESS_RAND=261, // Filter is access order agnostic. - CACHE_ACCESS_SEQ0=262, // Filter prefers sequential access (low cost) - CACHE_ACCESS_SEQ1=263, // Filter needs sequential access (high cost) - - CACHE_AVSPLUS_CONSTANTS = 500, // Smaller values are reserved for classic Avisynth - - CACHE_DONT_CACHE_ME, // Filters that don't need caching (eg. trim, cache etc.) should return 1 to this request - CACHE_SET_MIN_CAPACITY, - CACHE_SET_MAX_CAPACITY, - CACHE_GET_MIN_CAPACITY, - CACHE_GET_MAX_CAPACITY, - CACHE_GET_SIZE, - CACHE_GET_REQUESTED_CAP, - CACHE_GET_CAPACITY, - CACHE_GET_MTMODE, - - CACHE_IS_CACHE_REQ, - CACHE_IS_CACHE_ANS, - CACHE_IS_MTGUARD_REQ, - CACHE_IS_MTGUARD_ANS, - - CACHE_USER_CONSTANTS = 1000 // Smaller values are reserved for the core - -}; - -// Base class for all filters. -class IClip { - friend class PClip; - friend class AVSValue; - volatile long refcnt; - void AddRef(); - void Release(); -public: - IClip() : refcnt(0) {} - virtual int __stdcall GetVersion() { return AVISYNTH_INTERFACE_VERSION; } - virtual PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) = 0; - virtual bool __stdcall GetParity(int n) = 0; // return field parity if field_based, else parity of first field in frame - virtual void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) = 0; // start and count are in samples - /* Need to check GetVersion first, pre v5 will return random crap from EAX reg. */ - virtual int __stdcall SetCacheHints(int cachehints,int frame_range) = 0 ; // We do not pass cache requests upwards, only to the next filter. - virtual const VideoInfo& __stdcall GetVideoInfo() = 0; - virtual AVSC_CC ~IClip() {} -}; // end class IClip - - -// smart pointer to IClip -class PClip { - - IClip* p; - - IClip* GetPointerWithAddRef() const; - friend class AVSValue; - friend class VideoFrame; - - void Init(IClip* x); - void Set(IClip* x); - -public: - PClip() AVS_BakedCode( AVS_LinkCall_Void(PClip_CONSTRUCTOR0)() ) - PClip(const PClip& x) AVS_BakedCode( AVS_LinkCall_Void(PClip_CONSTRUCTOR1)(x) ) - PClip(IClip* x) AVS_BakedCode( AVS_LinkCall_Void(PClip_CONSTRUCTOR2)(x) ) - void operator=(IClip* x) AVS_BakedCode( AVS_LinkCall_Void(PClip_OPERATOR_ASSIGN0)(x) ) - void operator=(const PClip& x) AVS_BakedCode( AVS_LinkCall_Void(PClip_OPERATOR_ASSIGN1)(x) ) - - IClip* operator->() const { return p; } - - // useful in conditional expressions - operator void*() const { return p; } - bool operator!() const { return !p; } - - ~PClip() AVS_BakedCode( AVS_LinkCall_Void(PClip_DESTRUCTOR)() ) -#ifdef BUILDING_AVSCORE -public: - void CONSTRUCTOR0(); /* Damn compiler won't allow taking the address of reserved constructs, make a dummy interlude */ - void CONSTRUCTOR1(const PClip& x); - void CONSTRUCTOR2(IClip* x); - void OPERATOR_ASSIGN0(IClip* x); - void OPERATOR_ASSIGN1(const PClip& x); - void DESTRUCTOR(); -#endif -}; // end class PClip - - -// smart pointer to VideoFrame -class PVideoFrame { - - VideoFrame* p; - - void Init(VideoFrame* x); - void Set(VideoFrame* x); - -public: - PVideoFrame() AVS_BakedCode( AVS_LinkCall_Void(PVideoFrame_CONSTRUCTOR0)() ) - PVideoFrame(const PVideoFrame& x) AVS_BakedCode( AVS_LinkCall_Void(PVideoFrame_CONSTRUCTOR1)(x) ) - PVideoFrame(VideoFrame* x) AVS_BakedCode( AVS_LinkCall_Void(PVideoFrame_CONSTRUCTOR2)(x) ) - void operator=(VideoFrame* x) AVS_BakedCode( AVS_LinkCall_Void(PVideoFrame_OPERATOR_ASSIGN0)(x) ) - void operator=(const PVideoFrame& x) AVS_BakedCode( AVS_LinkCall_Void(PVideoFrame_OPERATOR_ASSIGN1)(x) ) - - VideoFrame* operator->() const { return p; } - - // for conditional expressions - operator void*() const { return p; } - bool operator!() const { return !p; } - - ~PVideoFrame() AVS_BakedCode( AVS_LinkCall_Void(PVideoFrame_DESTRUCTOR)() ) -#ifdef BUILDING_AVSCORE -public: - void CONSTRUCTOR0(); /* Damn compiler won't allow taking the address of reserved constructs, make a dummy interlude */ - void CONSTRUCTOR1(const PVideoFrame& x); - void CONSTRUCTOR2(VideoFrame* x); - void OPERATOR_ASSIGN0(VideoFrame* x); - void OPERATOR_ASSIGN1(const PVideoFrame& x); - void DESTRUCTOR(); -#endif -}; // end class PVideoFrame - - -class AVSValue { -public: - - AVSValue() AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR0)() ) - AVSValue(IClip* c) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR1)(c) ) - AVSValue(const PClip& c) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR2)(c) ) - AVSValue(bool b) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR3)(b) ) - AVSValue(int i) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR4)(i) ) -// AVSValue(__int64 l); - AVSValue(float f) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR5)(f) ) - AVSValue(double f) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR6)(f) ) - AVSValue(const char* s) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR7)(s) ) - AVSValue(const AVSValue* a, int size) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR8)(a, size) ) - AVSValue(const AVSValue& a, int size) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR8)(&a, size) ) - AVSValue(const AVSValue& v) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR9)(v) ) - - ~AVSValue() AVS_BakedCode( AVS_LinkCall_Void(AVSValue_DESTRUCTOR)() ) - AVSValue& operator=(const AVSValue& v) AVS_BakedCode( return AVS_LinkCallV(AVSValue_OPERATOR_ASSIGN)(v) ) - - // Note that we transparently allow 'int' to be treated as 'float'. - // There are no int<->bool conversions, though. - - bool Defined() const AVS_BakedCode( return AVS_LinkCall(Defined)() ) - bool IsClip() const AVS_BakedCode( return AVS_LinkCall(IsClip)() ) - bool IsBool() const AVS_BakedCode( return AVS_LinkCall(IsBool)() ) - bool IsInt() const AVS_BakedCode( return AVS_LinkCall(IsInt)() ) -// bool IsLong() const; - bool IsFloat() const AVS_BakedCode( return AVS_LinkCall(IsFloat)() ) - bool IsString() const AVS_BakedCode( return AVS_LinkCall(IsString)() ) - bool IsArray() const AVS_BakedCode( return AVS_LinkCall(IsArray)() ) - - PClip AsClip() const AVS_BakedCode( return AVS_LinkCall(AsClip)() ) - bool AsBool() const AVS_BakedCode( return AVS_LinkCall(AsBool1)() ) - int AsInt() const AVS_BakedCode( return AVS_LinkCall(AsInt1)() ) -// int AsLong() const; - const char* AsString() const AVS_BakedCode( return AVS_LinkCall(AsString1)() ) - double AsFloat() const AVS_BakedCode( return AVS_LinkCall(AsFloat1)() ) - float AsFloatf() const AVS_BakedCode( return float( AVS_LinkCall(AsFloat1)() ) ) - - bool AsBool(bool def) const AVS_BakedCode( return AVS_LinkCall(AsBool2)(def) ) - int AsInt(int def) const AVS_BakedCode( return AVS_LinkCall(AsInt2)(def) ) - double AsDblDef(double def) const AVS_BakedCode( return AVS_LinkCall(AsDblDef)(def) ) // Value is still a float - double AsFloat(float def) const AVS_BakedCode( return AVS_LinkCall(AsFloat2)(def) ) - float AsFloatf(float def) const AVS_BakedCode( return float( AVS_LinkCall(AsFloat2)(def) ) ) - const char* AsString(const char* def) const AVS_BakedCode( return AVS_LinkCall(AsString2)(def) ) - - int ArraySize() const AVS_BakedCode( return AVS_LinkCall(ArraySize)() ) - - const AVSValue& operator[](int index) const AVS_BakedCode( return AVS_LinkCallV(AVSValue_OPERATOR_INDEX)(index) ) - -private: - - short type; // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or RFU: 'l'ong ('d'ouble) - short array_size; - union { - IClip* clip; - bool boolean; - int integer; - float floating_pt; - const char* string; - const AVSValue* array; - #ifdef X86_64 - // if ever, only x64 will support. It breaks struct size on 32 bit - __int64 longlong; // 8 bytes - double double_pt; // 8 bytes - #endif - }; - - void Assign(const AVSValue* src, bool init); -#ifdef BUILDING_AVSCORE -public: - void CONSTRUCTOR0(); /* Damn compiler won't allow taking the address of reserved constructs, make a dummy interlude */ - void CONSTRUCTOR1(IClip* c); - void CONSTRUCTOR2(const PClip& c); - void CONSTRUCTOR3(bool b); - void CONSTRUCTOR4(int i); - void CONSTRUCTOR5(float f); - void CONSTRUCTOR6(double f); - void CONSTRUCTOR7(const char* s); - void CONSTRUCTOR8(const AVSValue* a, int size); - void CONSTRUCTOR9(const AVSValue& v); - void DESTRUCTOR(); - AVSValue& OPERATOR_ASSIGN(const AVSValue& v); - const AVSValue& OPERATOR_INDEX(int index) const; - - bool AsBool1() const; - int AsInt1() const; - const char* AsString1() const; - double AsFloat1() const; - - bool AsBool2(bool def) const; - int AsInt2(int def) const; - double AsFloat2(float def) const; - const char* AsString2(const char* def) const; - -#ifdef NEW_AVSVALUE - void MarkArrayAsC(); - void CONSTRUCTOR10(const AVSValue& v, bool c_arrays); - AVSValue(const AVSValue& v, bool c_arrays); - void Assign2(const AVSValue* src, bool init, bool c_arrays); -#endif - -#endif -}; // end class AVSValue - -#undef CALL_MEMBER_FN -#undef AVS_LinkCallOptDefault -#undef AVS_LinkCallOpt -#undef AVS_LinkCallV -#undef AVS_LinkCall -#undef AVS_BakedCode - -#define AVS_UNUSED(x) x - -// instantiable null filter -class GenericVideoFilter : public IClip { -protected: - PClip child; - VideoInfo vi; -public: - GenericVideoFilter(PClip _child) : child(_child) { vi = child->GetVideoInfo(); } - PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) { return child->GetFrame(n, env); } - void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) { child->GetAudio(buf, start, count, env); } - const VideoInfo& __stdcall GetVideoInfo() { return vi; } - bool __stdcall GetParity(int n) { return child->GetParity(n); } - int __stdcall SetCacheHints(int cachehints, int frame_range) { AVS_UNUSED(cachehints); AVS_UNUSED(frame_range); return 0; }; // We do not pass cache requests upwards, only to the next filter. -}; - - - - -#include - - - -class IScriptEnvironment { -public: - virtual AVSC_CC ~IScriptEnvironment() {} - - virtual /*static*/ int __stdcall GetCPUFlags() = 0; - - virtual char* __stdcall SaveString(const char* s, int length = -1) = 0; - virtual char* __stdcall Sprintf(const char* fmt, ...) = 0; - // note: val is really a va_list; I hope everyone typedefs va_list to a pointer - virtual char* __stdcall VSprintf(const char* fmt, void* val) = 0; - - __declspec(noreturn) virtual void __stdcall ThrowError(const char* fmt, ...) = 0; - - class NotFound /*exception*/ {}; // thrown by Invoke and GetVar - - typedef AVSValue (__cdecl *ApplyFunc)(AVSValue args, void* user_data, IScriptEnvironment* env); - - virtual void __stdcall AddFunction(const char* name, const char* params, ApplyFunc apply, void* user_data) = 0; - virtual bool __stdcall FunctionExists(const char* name) = 0; - virtual AVSValue __stdcall Invoke(const char* name, const AVSValue args, const char* const* arg_names=0) = 0; - - virtual AVSValue __stdcall GetVar(const char* name) = 0; - virtual bool __stdcall SetVar(const char* name, const AVSValue& val) = 0; - virtual bool __stdcall SetGlobalVar(const char* name, const AVSValue& val) = 0; - - virtual void __stdcall PushContext(int level=0) = 0; - virtual void __stdcall PopContext() = 0; - - // align should be 4 or 8 - virtual PVideoFrame __stdcall NewVideoFrame(const VideoInfo& vi, int align=FRAME_ALIGN) = 0; - - virtual bool __stdcall MakeWritable(PVideoFrame* pvf) = 0; - - virtual void __stdcall BitBlt(BYTE* dstp, int dst_pitch, const BYTE* srcp, int src_pitch, int row_size, int height) = 0; - - typedef void (__cdecl *ShutdownFunc)(void* user_data, IScriptEnvironment* env); - virtual void __stdcall AtExit(ShutdownFunc function, void* user_data) = 0; - - virtual void __stdcall CheckVersion(int version = AVISYNTH_INTERFACE_VERSION) = 0; - - virtual PVideoFrame __stdcall Subframe(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size, int new_height) = 0; - - virtual int __stdcall SetMemoryMax(int mem) = 0; - - virtual int __stdcall SetWorkingDir(const char * newdir) = 0; - - virtual void* __stdcall ManageCache(int key, void* data) = 0; - - enum PlanarChromaAlignmentMode { - PlanarChromaAlignmentOff, - PlanarChromaAlignmentOn, - PlanarChromaAlignmentTest }; - - virtual bool __stdcall PlanarChromaAlignment(PlanarChromaAlignmentMode key) = 0; - - virtual PVideoFrame __stdcall SubframePlanar(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size, - int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV) = 0; - - virtual void __stdcall DeleteScriptEnvironment() = 0; - - virtual void __stdcall ApplyMessage(PVideoFrame* frame, const VideoInfo& vi, const char* message, int size, - int textcolor, int halocolor, int bgcolor) = 0; - - virtual const AVS_Linkage* const __stdcall GetAVSLinkage() = 0; - - // noThrow version of GetVar - virtual AVSValue __stdcall GetVarDef(const char* name, const AVSValue& def = AVSValue()) = 0; - -}; // end class IScriptEnvironment - - -enum MtMode -{ - MT_INVALID = 0, - MT_NICE_FILTER = 1, - MT_MULTI_INSTANCE = 2, - MT_SERIALIZED = 3, - MT_SPECIAL_MT = 4, - MT_MODE_COUNT = 5 -}; - -class IJobCompletion -{ -public: - - virtual __stdcall ~IJobCompletion() {} - virtual void __stdcall Wait() = 0; - virtual AVSValue __stdcall Get(size_t i) = 0; - virtual size_t __stdcall Size() const = 0; - virtual size_t __stdcall Capacity() const = 0; - virtual void __stdcall Reset() = 0; - virtual void __stdcall Destroy() = 0; -}; - -class IScriptEnvironment2; -class Prefetcher; -typedef AVSValue (*ThreadWorkerFuncPtr)(IScriptEnvironment2* env, void* data); - -enum AvsEnvProperty -{ - AEP_PHYSICAL_CPUS = 1, - AEP_LOGICAL_CPUS = 2, - AEP_THREADPOOL_THREADS = 3, - AEP_FILTERCHAIN_THREADS = 4, - AEP_THREAD_ID = 5, - AEP_VERSION = 6 -}; - -enum AvsAllocType -{ - AVS_NORMAL_ALLOC = 1, - AVS_POOLED_ALLOC = 2 -}; - -/* ----------------------------------------------------------------------------- - Note to plugin authors: The interface in IScriptEnvironment2 is - preliminary / under construction / only for testing / non-final etc.! - As long as you see this note here, IScriptEnvironment2 might still change, - in which case your plugin WILL break. This also means that you are welcome - to test it and give your feedback about any ideas, improvements, or issues - you might have. - ----------------------------------------------------------------------------- */ -class AVSFunction; -class IScriptEnvironment2 : public IScriptEnvironment{ -public: - virtual ~IScriptEnvironment2() {} - - // Generic system to ask for various properties - virtual size_t __stdcall GetProperty(AvsEnvProperty prop) = 0; - - // Returns TRUE and the requested variable. If the method fails, returns FALSE and does not touch 'val'. - virtual bool __stdcall GetVar(const char* name, AVSValue *val) const = 0; - - // Return the value of the requested variable. - // If the variable was not found or had the wrong type, - // return the supplied default value. - virtual bool __stdcall GetVar(const char* name, bool def) const = 0; - virtual int __stdcall GetVar(const char* name, int def) const = 0; - virtual double __stdcall GetVar(const char* name, double def) const = 0; - virtual const char* __stdcall GetVar(const char* name, const char* def) const = 0; - - // Plugin functions - virtual bool __stdcall LoadPlugin(const char* filePath, bool throwOnError, AVSValue *result) = 0; - virtual void __stdcall AddAutoloadDir(const char* dirPath, bool toFront) = 0; - virtual void __stdcall ClearAutoloadDirs() = 0; - virtual void __stdcall AutoloadPlugins() = 0; - virtual void __stdcall AddFunction(const char* name, const char* params, ApplyFunc apply, void* user_data, const char *exportVar) = 0; - virtual bool __stdcall InternalFunctionExists(const char* name) = 0; - - // Threading - virtual void __stdcall SetFilterMTMode(const char* filter, MtMode mode, bool force) = 0; // If filter is "DEFAULT_MT_MODE", sets the default MT mode - virtual IJobCompletion* __stdcall NewCompletion(size_t capacity) = 0; - virtual void __stdcall ParallelJob(ThreadWorkerFuncPtr jobFunc, void* jobData, IJobCompletion* completion) = 0; - - // This version of Invoke will return false instead of throwing NotFound(). - virtual bool __stdcall Invoke(AVSValue *result, const char* name, const AVSValue& args, const char* const* arg_names=0) = 0; - - // Support functions - virtual void* __stdcall Allocate(size_t nBytes, size_t alignment, AvsAllocType type) = 0; - virtual void __stdcall Free(void* ptr) = 0; - - // These lines are needed so that we can overload the older functions from IScriptEnvironment. - using IScriptEnvironment::Invoke; - using IScriptEnvironment::AddFunction; - using IScriptEnvironment::GetVar; - - virtual PVideoFrame __stdcall SubframePlanarA(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size, - int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV, int rel_offsetA) = 0; - -}; // end class IScriptEnvironment2 - - -// avisynth.dll exports this; it's a way to use it as a library, without -// writing an AVS script or without going through AVIFile. -AVSC_API(IScriptEnvironment*, CreateScriptEnvironment)(int version = AVISYNTH_INTERFACE_VERSION); - - -// These are some global variables you can set in your script to change AviSynth's behavior. -#define VARNAME_AllowFloatAudio "OPT_AllowFloatAudio" // Allow WAVE_FORMAT_IEEE_FLOAT audio output -#define VARNAME_VDubPlanarHack "OPT_VDubPlanarHack" // Hack YV16 and YV24 chroma plane order for old VDub's -#define VARNAME_AVIPadScanlines "OPT_AVIPadScanlines" // Have scanlines mod4 padded in all pixel formats -#define VARNAME_UseWaveExtensible "OPT_UseWaveExtensible" // Use WAVEFORMATEXTENSIBLE when describing audio to Windows -#define VARNAME_dwChannelMask "OPT_dwChannelMask" // Integer audio channel mask. See description of WAVEFORMATEXTENSIBLE for more info. -#define VARNAME_Enable_V210 "OPT_Enable_V210" // AVS+ use V210 instead of P210 (VfW) -#define VARNAME_Enable_Y3_10_10 "OPT_Enable_Y3_10_10" // AVS+ use Y3[10][10] instead of P210 (VfW) -#define VARNAME_Enable_Y3_10_16 "OPT_Enable_Y3_10_16" // AVS+ use Y3[10][16] instead of P216 (VfW) -#define VARNAME_Enable_b64a "OPT_Enable_b64a" // AVS+ use b64a instead of BRA[64] (VfW) -#define VARNAME_Enable_PlanarToPackedRGB "OPT_Enable_PlanarToPackedRGB" // AVS+ convert Planar RGB to packed RGB (VfW) - -// C exports -#include -AVSC_API(IScriptEnvironment2*, CreateScriptEnvironment2)(int version = AVISYNTH_INTERFACE_VERSION); - -#ifndef BUILDING_AVSCORE -#undef AVS_UNUSED -#endif - -#pragma pack(pop) - -#endif //__AVISYNTH_6_H__ +// Avisynth v2.5. Copyright 2002 Ben Rudiak-Gould et al. +// Avisynth v2.6. Copyright 2006 Klaus Post. +// Avisynth v2.6. Copyright 2009 Ian Brabham. +// Avisynth+ project +// 20160613: new 16 bit planar pixel_type constants go live! +// 20160725: pixel_type constants 10-12-14 bit + planar RGB + BRG48/64 +// 20161005: Fallback of VideoInfo functions to defaults if no function exists +// 20170117: global variables for VfW output OPT_xxxx +// 20170310: new MT mode: MT_SPECIAL_MT +// 20171103: (test with SIZETMOD define: Videoframe offsets to size_t, may affect x64) +// 20171207: C++ Standard Conformance (no change for plugin writers) +// 20180525: AVS_UNUSED define to supress parameter not used warnings + +// http://www.avisynth.org + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit +// http://www.gnu.org/copyleft/gpl.html . +// +// Linking Avisynth statically or dynamically with other modules is making +// a combined work based on Avisynth. Thus, the terms and conditions of +// the GNU General Public License cover the whole combination. +// +// As a special exception, the copyright holders of Avisynth give you +// permission to link Avisynth with independent modules that communicate +// with Avisynth solely through the interfaces defined in avisynth.h, +// regardless of the license terms of these independent modules, and to +// copy and distribute the resulting combined work under terms of your +// choice, provided that every copy of the combined work is accompanied +// by a complete copy of the source code of Avisynth (the version of +// Avisynth used to produce the combined work), being distributed under +// the terms of the GNU General Public License plus this exception. An +// independent module is a module which is not derived from or based on +// Avisynth, such as 3rd-party filters, import and export plugins, or +// graphical user interfaces. + + + + +#ifndef __AVISYNTH_6_H__ +#define __AVISYNTH_6_H__ + +#include +#include +#include + + +enum { AVISYNTH_INTERFACE_VERSION = 6 }; + + +/* Compiler-specific crap */ + +// Tell MSVC to stop precompiling here +#if defined(_MSC_VER) && !defined(__clang__) + #pragma hdrstop +#endif + +// Set up debugging macros for MS compilers; for others, step down to the +// standard interface +#ifdef _MSC_VER + #include +#else + #undef _RPT0 + #undef _RPT1 + #undef _RPT2 + #undef _RPT3 + #undef _RPT4 + #undef _RPT5 + #define _RPT0(a,b) ((void)0) + #define _RPT1(a,b,c) ((void)0) + #define _RPT2(a,b,c,d) ((void)0) + #define _RPT3(a,b,c,d,e) ((void)0) + #define _RPT4(a,b,c,d,e,f) ((void)0) + #define _RPT5(a,b,c,d,e,f,g) ((void)0) + + #include + #undef _ASSERTE + #undef _ASSERT + #define _ASSERTE(x) assert(x) + #define _ASSERT(x) assert(x) +#endif + + + +// I had problems with Premiere wanting 1-byte alignment for its structures, +// so I now set the Avisynth struct alignment explicitly here. +#pragma pack(push,8) + +// The VideoInfo struct holds global information about a clip (i.e. +// information that does not depend on the frame number). The GetVideoInfo +// method in IClip returns this struct. + +enum {SAMPLE_INT8 = 1<<0, + SAMPLE_INT16 = 1<<1, + SAMPLE_INT24 = 1<<2, // Int24 is a very stupid thing to code, but it's supported by some hardware. + SAMPLE_INT32 = 1<<3, + SAMPLE_FLOAT = 1<<4}; + +enum { + AVS_PLANAR_Y=1<<0, + AVS_PLANAR_U=1<<1, + AVS_PLANAR_V=1<<2, + AVS_PLANAR_ALIGNED=1<<3, + AVS_PLANAR_Y_ALIGNED= AVS_PLANAR_Y| AVS_PLANAR_ALIGNED, // MEANX : Patched to avoid clash with adm names + AVS_PLANAR_U_ALIGNED= AVS_PLANAR_U| AVS_PLANAR_ALIGNED, + AVS_PLANAR_V_ALIGNED= AVS_PLANAR_V| AVS_PLANAR_ALIGNED, + PLANAR_A=1<<4, + PLANAR_R=1<<5, + PLANAR_G=1<<6, + PLANAR_B=1<<7, + PLANAR_A_ALIGNED=PLANAR_A| AVS_PLANAR_ALIGNED, + PLANAR_R_ALIGNED=PLANAR_R| AVS_PLANAR_ALIGNED, + PLANAR_G_ALIGNED=PLANAR_G| AVS_PLANAR_ALIGNED, + PLANAR_B_ALIGNED=PLANAR_B| AVS_PLANAR_ALIGNED, + }; + +class AvisynthError /* exception */ { +public: + const char* const msg; + AvisynthError(const char* _msg) : msg(_msg) {} + +// Ensure AvisynthError cannot be publicly assigned! +private: + AvisynthError& operator=(const AvisynthError&); +}; // end class AvisynthError + + +/* Forward references */ +#if defined(MSVC) + #define SINGLE_INHERITANCE __single_inheritance +#else + #define SINGLE_INHERITANCE +#endif +struct SINGLE_INHERITANCE VideoInfo; +class SINGLE_INHERITANCE VideoFrameBuffer; +class SINGLE_INHERITANCE VideoFrame; +class IClip; +class SINGLE_INHERITANCE PClip; +class SINGLE_INHERITANCE PVideoFrame; +class IScriptEnvironment; +class SINGLE_INHERITANCE AVSValue; + + +/* + * Avisynth C++ plugin API code function pointers. + * + * In order to maintain binary compatibility with + * future version do not change the order of the + * existing function pointers. It will be baked + * into all existing plugins. + * + * Add new function pointers to the end of the + * structure. The linkage macros generate some + * protection code to ensure newer plugin do not + * call non-existing functions in an older host. + */ + +struct AVS_Linkage { + + int Size; + +/**********************************************************************/ + +// struct VideoInfo + bool (VideoInfo::*HasVideo)() const; + bool (VideoInfo::*HasAudio)() const; + bool (VideoInfo::*IsRGB)() const; + bool (VideoInfo::*IsRGB24)() const; + bool (VideoInfo::*IsRGB32)() const; + bool (VideoInfo::*IsYUV)() const; + bool (VideoInfo::*IsYUY2)() const; + bool (VideoInfo::*IsYV24)() const; + bool (VideoInfo::*IsYV16)() const; + bool (VideoInfo::*IsYV12)() const; + bool (VideoInfo::*IsYV411)() const; + bool (VideoInfo::*IsY8)() const; + bool (VideoInfo::*IsColorSpace)(int c_space) const; + bool (VideoInfo::*Is)(int property) const; + bool (VideoInfo::*IsPlanar)() const; + bool (VideoInfo::*IsFieldBased)() const; + bool (VideoInfo::*IsParityKnown)() const; + bool (VideoInfo::*IsBFF)() const; + bool (VideoInfo::*IsTFF)() const; + bool (VideoInfo::*IsVPlaneFirst)() const; + int (VideoInfo::*BytesFromPixels)(int pixels) const; + int (VideoInfo::*RowSize)(int plane) const; + int (VideoInfo::*BMPSize)() const; + __int64 (VideoInfo::*AudioSamplesFromFrames)(int frames) const; + int (VideoInfo::*FramesFromAudioSamples)(__int64 samples) const; + __int64 (VideoInfo::*AudioSamplesFromBytes)(__int64 bytes) const; + __int64 (VideoInfo::*BytesFromAudioSamples)(__int64 samples) const; + int (VideoInfo::*AudioChannels)() const; + int (VideoInfo::*SampleType)() const; + bool (VideoInfo::*IsSampleType)(int testtype) const; + int (VideoInfo::*SamplesPerSecond)() const; + int (VideoInfo::*BytesPerAudioSample)() const; + void (VideoInfo::*SetFieldBased)(bool isfieldbased); + void (VideoInfo::*Set)(int property); + void (VideoInfo::*Clear)(int property); + int (VideoInfo::*GetPlaneWidthSubsampling)(int plane) const; + int (VideoInfo::*GetPlaneHeightSubsampling)(int plane) const; + int (VideoInfo::*BitsPerPixel)() const; + int (VideoInfo::*BytesPerChannelSample)() const; + void (VideoInfo::*SetFPS)(unsigned numerator, unsigned denominator); + void (VideoInfo::*MulDivFPS)(unsigned multiplier, unsigned divisor); + bool (VideoInfo::*IsSameColorspace)(const VideoInfo& vi) const; +// end struct VideoInfo + +/**********************************************************************/ + +// class VideoFrameBuffer + const BYTE* (VideoFrameBuffer::*VFBGetReadPtr)() const; + BYTE* (VideoFrameBuffer::*VFBGetWritePtr)(); +#ifdef SIZETMOD + size_t (VideoFrameBuffer::*GetDataSize)() const; +#else + int (VideoFrameBuffer::*GetDataSize)() const; +#endif + int (VideoFrameBuffer::*GetSequenceNumber)() const; + int (VideoFrameBuffer::*GetRefcount)() const; +// end class VideoFrameBuffer + +/**********************************************************************/ + +// class VideoFrame + int (VideoFrame::*GetPitch)(int plane) const; + int (VideoFrame::*GetRowSize)(int plane) const; + int (VideoFrame::*GetHeight)(int plane) const; + VideoFrameBuffer* (VideoFrame::*GetFrameBuffer)() const; +#ifdef SIZETMOD + size_t (VideoFrame::*GetOffset)(int plane) const; +#else + int (VideoFrame::*GetOffset)(int plane) const; +#endif + const BYTE* (VideoFrame::*VFGetReadPtr)(int plane) const; + bool (VideoFrame::*IsWritable)() const; + BYTE* (VideoFrame::*VFGetWritePtr)(int plane) const; + void (VideoFrame::*VideoFrame_DESTRUCTOR)(); +// end class VideoFrame + +/**********************************************************************/ + +// class IClip + /* nothing */ +// end class IClip + +/**********************************************************************/ + +// class PClip + void (PClip::*PClip_CONSTRUCTOR0)(); + void (PClip::*PClip_CONSTRUCTOR1)(const PClip& x); + void (PClip::*PClip_CONSTRUCTOR2)(IClip* x); + void (PClip::*PClip_OPERATOR_ASSIGN0)(IClip* x); + void (PClip::*PClip_OPERATOR_ASSIGN1)(const PClip& x); + void (PClip::*PClip_DESTRUCTOR)(); +// end class PClip + +/**********************************************************************/ + +// class PVideoFrame + void (PVideoFrame::*PVideoFrame_CONSTRUCTOR0)(); + void (PVideoFrame::*PVideoFrame_CONSTRUCTOR1)(const PVideoFrame& x); + void (PVideoFrame::*PVideoFrame_CONSTRUCTOR2)(VideoFrame* x); + void (PVideoFrame::*PVideoFrame_OPERATOR_ASSIGN0)(VideoFrame* x); + void (PVideoFrame::*PVideoFrame_OPERATOR_ASSIGN1)(const PVideoFrame& x); + void (PVideoFrame::*PVideoFrame_DESTRUCTOR)(); +// end class PVideoFrame + +/**********************************************************************/ + +// class AVSValue + void (AVSValue::*AVSValue_CONSTRUCTOR0)(); + void (AVSValue::*AVSValue_CONSTRUCTOR1)(IClip* c); + void (AVSValue::*AVSValue_CONSTRUCTOR2)(const PClip& c); + void (AVSValue::*AVSValue_CONSTRUCTOR3)(bool b); + void (AVSValue::*AVSValue_CONSTRUCTOR4)(int i); + void (AVSValue::*AVSValue_CONSTRUCTOR5)(float f); + void (AVSValue::*AVSValue_CONSTRUCTOR6)(double f); + void (AVSValue::*AVSValue_CONSTRUCTOR7)(const char* s); + void (AVSValue::*AVSValue_CONSTRUCTOR8)(const AVSValue* a, int size); + void (AVSValue::*AVSValue_CONSTRUCTOR9)(const AVSValue& v); + void (AVSValue::*AVSValue_DESTRUCTOR)(); + AVSValue& (AVSValue::*AVSValue_OPERATOR_ASSIGN)(const AVSValue& v); + const AVSValue& (AVSValue::*AVSValue_OPERATOR_INDEX)(int index) const; + bool (AVSValue::*Defined)() const; + bool (AVSValue::*IsClip)() const; + bool (AVSValue::*IsBool)() const; + bool (AVSValue::*IsInt)() const; + bool (AVSValue::*IsFloat)() const; + bool (AVSValue::*IsString)() const; + bool (AVSValue::*IsArray)() const; + PClip (AVSValue::*AsClip)() const; + bool (AVSValue::*AsBool1)() const; + int (AVSValue::*AsInt1)() const; + const char* (AVSValue::*AsString1)() const; + double (AVSValue::*AsFloat1)() const; + bool (AVSValue::*AsBool2)(bool def) const; + int (AVSValue::*AsInt2)(int def) const; + double (AVSValue::*AsDblDef)(double def) const; + double (AVSValue::*AsFloat2)(float def) const; + const char* (AVSValue::*AsString2)(const char* def) const; + int (AVSValue::*ArraySize)() const; +// end class AVSValue + +/**********************************************************************/ + // Reserve pointer space so that we can keep compatibility with Avs "classic" even if it adds functions on its own + void (VideoInfo::*reserved[32])(); +/**********************************************************************/ + // AviSynth+ additions + int (VideoInfo::*NumComponents)() const; + int (VideoInfo::*ComponentSize)() const; + int (VideoInfo::*BitsPerComponent)() const; + bool (VideoInfo::*Is444)() const; + bool (VideoInfo::*Is422)() const; + bool (VideoInfo::*Is420)() const; + bool (VideoInfo::*IsY)() const; + bool (VideoInfo::*IsRGB48)() const; + bool (VideoInfo::*IsRGB64)() const; + bool (VideoInfo::*IsYUVA)() const; + bool (VideoInfo::*IsPlanarRGB)() const; + bool (VideoInfo::*IsPlanarRGBA)() const; + /**********************************************************************/ +}; + +#ifdef BUILDING_AVSCORE +/* Macro resolution for code inside Avisynth.dll */ +# define AVS_BakedCode(arg) ; +# define AVS_LinkCall(arg) +# define AVS_LinkCallV(arg) +# define AVS_LinkCallOpt(arg, argOpt) AVSLinkCall(arg) +# define AVS_LinkCallOptDefault(arg, argDefaultValue) AVSLinkCall(arg()) +# define CALL_MEMBER_FN(object,ptrToMember) + +#else +/* Macro resolution for code inside user plugin */ +# ifdef AVS_LINKAGE_DLLIMPORT +extern __declspec(dllimport) const AVS_Linkage* const AVS_linkage; +# else +extern const AVS_Linkage* AVS_linkage; +# endif + +# ifndef offsetof +# include +# endif + +# define AVS_BakedCode(arg) { arg ; } +# define AVS_LinkCall(arg) !AVS_linkage || offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? 0 : (this->*(AVS_linkage->arg)) +# define AVS_LinkCall_Void(arg) !AVS_linkage || offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? (void)0 : (this->*(AVS_linkage->arg)) +# define AVS_LinkCallV(arg) !AVS_linkage || offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? *this : (this->*(AVS_linkage->arg)) +// Helper macros for fallback option when a function does not exists +#define CALL_MEMBER_FN(object,ptrToMember) ((object)->*(ptrToMember)) +#define AVS_LinkCallOpt(arg, argOpt) !AVS_linkage ? 0 : \ + ( offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? \ + (offsetof(AVS_Linkage, argOpt) >= AVS_linkage->Size ? 0 : CALL_MEMBER_FN(this, AVS_linkage->argOpt)() ) : \ + CALL_MEMBER_FN(this, AVS_linkage->arg)() ) +// AVS_LinkCallOptDefault puts automatically () only after arg +# define AVS_LinkCallOptDefault(arg, argDefaultValue) !AVS_linkage || offsetof(AVS_Linkage, arg) >= AVS_linkage->Size ? (argDefaultValue) : ((this->*(AVS_linkage->arg))()) + +#endif + +struct VideoInfo { + int width, height; // width=0 means no video + unsigned fps_numerator, fps_denominator; + int num_frames; + // This is more extensible than previous versions. More properties can be added seeminglesly. + + // Colorspace properties. +/* + +Planar match mask 1111.1000.0000.0111.0000.0111.0000.0111 +Planar signature 10xx.1000.0000.00xx.0000.00xx.00xx.00xx ? +Planar signature 10xx.1000.0000.0xxx.0000.00xx.000x.x0xx ? *new +Planar filter mask 1111.1111.1111.1111.1111.1111.1110.0111 (typo from old header fixed) + +pixel_type mapping +================== +pixel_type bit-map PIYB.Z000.0???.0SSS.0000.0???.????.???? + planar YUV CCC HHH.000u.vWWW + planar RGB(A) CCC AR + nonplanar CCC 000.00wx xyAR +Legend +====== +Planar YUV: + Code Bits Remark + W 0-2 Planar Width Subsampling bits + Use (X+1) & 3 for GetPlaneWidthSubsampling + 000 => 1 YV12, YV16, YUV420, YUV422 + 001 => 2 YV411, YUV9 + 010 => reserved + 011 => 0 YV24, YUV444, RGBP + 1xx => reserved + v 3 VPlaneFirst YV12, YV16, YV24, YV411, YUV9 + u 4 UPlaneFirst I420 + H 7-9 Planar Height Subsampling bits + Use ((X>>8)+1) & 3 for GetPlaneHeightSubsampling + 000 => 1 YV12, YUV420 + 001 => 2 YUV9 + 010 => reserved + 011 => 0 YV16, YV24, YV411, YUV422, YUV444, RGBP + 1xx => reserved + +Planar RGB + Code Bits Remark + R 0 BGR, (with SSS bits for 8/16 bit/sample or float) + A 1 BGRA, (with SSS bits for 8/16 bit/sample or float) + + +Not Planar, Interleaved (I flag) +Code Bits Remark + R 0 BGR24, and BGRx in future (with SSS bits for 8/16 bit/sample or float) + A 1 BGR32, and BGRAx in future (with SSS bits for 8/16 bit/sample or float) + y 2 YUY2 + x 3-4 reserved + w 5 Raw32 + +General +Code Bits Remark + S 16-18 Sample resolution bits + 000 => 8 + 001 => 16 + 010 => 32 (float) + 011,100 => reserved + 101 => 10 bits + 110 => 12 bits + 111 => 14 bits +for packed RGB(A): only 8 and 16 bits are valid + +Other YV12 specific (not used?) + C 20-22 Chroma Placement values 0-4 see CS_xxx_CHROMA_PLACEMENT + +Color family and layout + Packed Planar Planar Planar +Code Bits Remark RGB/RGBA YUV YUY2 Y_Grey RGB/RGBA YUVA + R 0 1/0 - 0 - 1/0 - + A 1 0/1 - 0 - 0/1 - + y 2 - - 1 - 0 - + Z 27 YUVA 0 0 0 0 1 1 + B 28 BGR 1 0 0 0 1* 0 + Y 29 YUV 0 1 1 1 0 0 + I 30 Interleaved 1 0 1 1 0 0 + P 31 Planar 0 1 0 1 1 1 +* Planar RGB plane order: G,B,R(,A) + +*/ +enum { + CS_YUVA = 1<<27, + CS_BGR = 1<<28, + CS_YUV = 1<<29, + CS_INTERLEAVED = 1<<30, + CS_PLANAR = 1<<31, + + CS_Shift_Sub_Width = 0, + CS_Shift_Sub_Height = 8, + CS_Shift_Sample_Bits = 16, + + CS_Sub_Width_Mask = 7 << CS_Shift_Sub_Width, + CS_Sub_Width_1 = 3 << CS_Shift_Sub_Width, // YV24 + CS_Sub_Width_2 = 0 << CS_Shift_Sub_Width, // YV12, I420, YV16 + CS_Sub_Width_4 = 1 << CS_Shift_Sub_Width, // YUV9, YV411 + + CS_VPlaneFirst = 1 << 3, // YV12, YV16, YV24, YV411, YUV9 + CS_UPlaneFirst = 1 << 4, // I420 + + CS_Sub_Height_Mask = 7 << CS_Shift_Sub_Height, + CS_Sub_Height_1 = 3 << CS_Shift_Sub_Height, // YV16, YV24, YV411 + CS_Sub_Height_2 = 0 << CS_Shift_Sub_Height, // YV12, I420 + CS_Sub_Height_4 = 1 << CS_Shift_Sub_Height, // YUV9 + + CS_Sample_Bits_Mask = 7 << CS_Shift_Sample_Bits, + CS_Sample_Bits_8 = 0 << CS_Shift_Sample_Bits, + CS_Sample_Bits_10 = 5 << CS_Shift_Sample_Bits, + CS_Sample_Bits_12 = 6 << CS_Shift_Sample_Bits, + CS_Sample_Bits_14 = 7 << CS_Shift_Sample_Bits, + CS_Sample_Bits_16 = 1 << CS_Shift_Sample_Bits, + CS_Sample_Bits_32 = 2 << CS_Shift_Sample_Bits, + + CS_PLANAR_MASK = CS_PLANAR | CS_INTERLEAVED | CS_YUV | CS_BGR | CS_YUVA | CS_Sample_Bits_Mask + | CS_Sub_Height_Mask | CS_Sub_Width_Mask, + CS_PLANAR_FILTER = ~( CS_VPlaneFirst | CS_UPlaneFirst ), + + CS_RGB_TYPE = 1 << 0, + CS_RGBA_TYPE = 1 << 1, + + // Specific colorformats + CS_UNKNOWN = 0, + + CS_BGR24 = CS_RGB_TYPE | CS_BGR | CS_INTERLEAVED, + CS_BGR32 = CS_RGBA_TYPE | CS_BGR | CS_INTERLEAVED, + CS_YUY2 = 1<<2 | CS_YUV | CS_INTERLEAVED, + // CS_YV12 = 1<<3 Reserved + // CS_I420 = 1<<4 Reserved + CS_RAW32 = 1<<5 | CS_INTERLEAVED, + + // YV12 must be 0xA000008 2.5 Baked API will see all new planar as YV12 + // I420 must be 0xA000010 + + CS_GENERIC_YUV420 = CS_PLANAR | CS_YUV | CS_VPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2, // 4:2:0 planar + CS_GENERIC_YUV422 = CS_PLANAR | CS_YUV | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_2, // 4:2:2 planar + CS_GENERIC_YUV444 = CS_PLANAR | CS_YUV | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_1, // 4:4:4 planar + CS_GENERIC_Y = CS_PLANAR | CS_INTERLEAVED | CS_YUV, // Y only (4:0:0) + CS_GENERIC_RGBP = CS_PLANAR | CS_BGR | CS_RGB_TYPE, // planar RGB. Though name is RGB but plane order G,B,R + CS_GENERIC_RGBAP = CS_PLANAR | CS_BGR | CS_RGBA_TYPE, // planar RGBA + CS_GENERIC_YUVA420 = CS_PLANAR | CS_YUVA | CS_VPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2, // 4:2:0:A planar + CS_GENERIC_YUVA422 = CS_PLANAR | CS_YUVA | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_2, // 4:2:2:A planar + CS_GENERIC_YUVA444 = CS_PLANAR | CS_YUVA | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_1, // 4:4:4:A planar + + CS_YV24 = CS_GENERIC_YUV444 | CS_Sample_Bits_8, // YVU 4:4:4 planar + CS_YV16 = CS_GENERIC_YUV422 | CS_Sample_Bits_8, // YVU 4:2:2 planar + CS_YV12 = CS_GENERIC_YUV420 | CS_Sample_Bits_8, // YVU 4:2:0 planar + CS_I420 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_UPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2, // YUV 4:2:0 planar + CS_IYUV = CS_I420, + CS_YUV9 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_4 | CS_Sub_Width_4, // YUV 4:1:0 planar + CS_YV411 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_4, // YUV 4:1:1 planar + + CS_Y8 = CS_GENERIC_Y | CS_Sample_Bits_8, // Y 4:0:0 planar + + //------------------------- + // AVS16: new planar constants go live! Experimental PF 160613 + // 10-12-14 bit + planar RGB + BRG48/64 160725 + + CS_YUV444P10 = CS_GENERIC_YUV444 | CS_Sample_Bits_10, // YUV 4:4:4 10bit samples + CS_YUV422P10 = CS_GENERIC_YUV422 | CS_Sample_Bits_10, // YUV 4:2:2 10bit samples + CS_YUV420P10 = CS_GENERIC_YUV420 | CS_Sample_Bits_10, // YUV 4:2:0 10bit samples + CS_Y10 = CS_GENERIC_Y | CS_Sample_Bits_10, // Y 4:0:0 10bit samples + + CS_YUV444P12 = CS_GENERIC_YUV444 | CS_Sample_Bits_12, // YUV 4:4:4 12bit samples + CS_YUV422P12 = CS_GENERIC_YUV422 | CS_Sample_Bits_12, // YUV 4:2:2 12bit samples + CS_YUV420P12 = CS_GENERIC_YUV420 | CS_Sample_Bits_12, // YUV 4:2:0 12bit samples + CS_Y12 = CS_GENERIC_Y | CS_Sample_Bits_12, // Y 4:0:0 12bit samples + + CS_YUV444P14 = CS_GENERIC_YUV444 | CS_Sample_Bits_14, // YUV 4:4:4 14bit samples + CS_YUV422P14 = CS_GENERIC_YUV422 | CS_Sample_Bits_14, // YUV 4:2:2 14bit samples + CS_YUV420P14 = CS_GENERIC_YUV420 | CS_Sample_Bits_14, // YUV 4:2:0 14bit samples + CS_Y14 = CS_GENERIC_Y | CS_Sample_Bits_14, // Y 4:0:0 14bit samples + + CS_YUV444P16 = CS_GENERIC_YUV444 | CS_Sample_Bits_16, // YUV 4:4:4 16bit samples + CS_YUV422P16 = CS_GENERIC_YUV422 | CS_Sample_Bits_16, // YUV 4:2:2 16bit samples + CS_YUV420P16 = CS_GENERIC_YUV420 | CS_Sample_Bits_16, // YUV 4:2:0 16bit samples + CS_Y16 = CS_GENERIC_Y | CS_Sample_Bits_16, // Y 4:0:0 16bit samples + + // 32 bit samples (float) + CS_YUV444PS = CS_GENERIC_YUV444 | CS_Sample_Bits_32, // YUV 4:4:4 32bit samples + CS_YUV422PS = CS_GENERIC_YUV422 | CS_Sample_Bits_32, // YUV 4:2:2 32bit samples + CS_YUV420PS = CS_GENERIC_YUV420 | CS_Sample_Bits_32, // YUV 4:2:0 32bit samples + CS_Y32 = CS_GENERIC_Y | CS_Sample_Bits_32, // Y 4:0:0 32bit samples + + // RGB packed + CS_BGR48 = CS_RGB_TYPE | CS_BGR | CS_INTERLEAVED | CS_Sample_Bits_16, // BGR 3x16 bit + CS_BGR64 = CS_RGBA_TYPE | CS_BGR | CS_INTERLEAVED | CS_Sample_Bits_16, // BGR 4x16 bit + // no packed 32 bit (float) support for these legacy types + + // RGB planar + CS_RGBP = CS_GENERIC_RGBP | CS_Sample_Bits_8, // Planar RGB 8 bit samples + CS_RGBP10 = CS_GENERIC_RGBP | CS_Sample_Bits_10, // Planar RGB 10bit samples + CS_RGBP12 = CS_GENERIC_RGBP | CS_Sample_Bits_12, // Planar RGB 12bit samples + CS_RGBP14 = CS_GENERIC_RGBP | CS_Sample_Bits_14, // Planar RGB 14bit samples + CS_RGBP16 = CS_GENERIC_RGBP | CS_Sample_Bits_16, // Planar RGB 16bit samples + CS_RGBPS = CS_GENERIC_RGBP | CS_Sample_Bits_32, // Planar RGB 32bit samples + + // RGBA planar + CS_RGBAP = CS_GENERIC_RGBAP | CS_Sample_Bits_8, // Planar RGBA 8 bit samples + CS_RGBAP10 = CS_GENERIC_RGBAP | CS_Sample_Bits_10, // Planar RGBA 10bit samples + CS_RGBAP12 = CS_GENERIC_RGBAP | CS_Sample_Bits_12, // Planar RGBA 12bit samples + CS_RGBAP14 = CS_GENERIC_RGBAP | CS_Sample_Bits_14, // Planar RGBA 14bit samples + CS_RGBAP16 = CS_GENERIC_RGBAP | CS_Sample_Bits_16, // Planar RGBA 16bit samples + CS_RGBAPS = CS_GENERIC_RGBAP | CS_Sample_Bits_32, // Planar RGBA 32bit samples + + // Planar YUVA + CS_YUVA444 = CS_GENERIC_YUVA444 | CS_Sample_Bits_8, // YUVA 4:4:4 8bit samples + CS_YUVA422 = CS_GENERIC_YUVA422 | CS_Sample_Bits_8, // YUVA 4:2:2 8bit samples + CS_YUVA420 = CS_GENERIC_YUVA420 | CS_Sample_Bits_8, // YUVA 4:2:0 8bit samples + + CS_YUVA444P10 = CS_GENERIC_YUVA444 | CS_Sample_Bits_10, // YUVA 4:4:4 10bit samples + CS_YUVA422P10 = CS_GENERIC_YUVA422 | CS_Sample_Bits_10, // YUVA 4:2:2 10bit samples + CS_YUVA420P10 = CS_GENERIC_YUVA420 | CS_Sample_Bits_10, // YUVA 4:2:0 10bit samples + + CS_YUVA444P12 = CS_GENERIC_YUVA444 | CS_Sample_Bits_12, // YUVA 4:4:4 12bit samples + CS_YUVA422P12 = CS_GENERIC_YUVA422 | CS_Sample_Bits_12, // YUVA 4:2:2 12bit samples + CS_YUVA420P12 = CS_GENERIC_YUVA420 | CS_Sample_Bits_12, // YUVA 4:2:0 12bit samples + + CS_YUVA444P14 = CS_GENERIC_YUVA444 | CS_Sample_Bits_14, // YUVA 4:4:4 14bit samples + CS_YUVA422P14 = CS_GENERIC_YUVA422 | CS_Sample_Bits_14, // YUVA 4:2:2 14bit samples + CS_YUVA420P14 = CS_GENERIC_YUVA420 | CS_Sample_Bits_14, // YUVA 4:2:0 14bit samples + + CS_YUVA444P16 = CS_GENERIC_YUVA444 | CS_Sample_Bits_16, // YUVA 4:4:4 16bit samples + CS_YUVA422P16 = CS_GENERIC_YUVA422 | CS_Sample_Bits_16, // YUVA 4:2:2 16bit samples + CS_YUVA420P16 = CS_GENERIC_YUVA420 | CS_Sample_Bits_16, // YUVA 4:2:0 16bit samples + + CS_YUVA444PS = CS_GENERIC_YUVA444 | CS_Sample_Bits_32, // YUVA 4:4:4 32bit samples + CS_YUVA422PS = CS_GENERIC_YUVA422 | CS_Sample_Bits_32, // YUVA 4:2:2 32bit samples + CS_YUVA420PS = CS_GENERIC_YUVA420 | CS_Sample_Bits_32, // YUVA 4:2:0 32bit samples + + }; + + int pixel_type; // changed to int as of 2.5 + + + int audio_samples_per_second; // 0 means no audio + int sample_type; // as of 2.5 + __int64 num_audio_samples; // changed as of 2.5 + int nchannels; // as of 2.5 + + // Imagetype properties + + int image_type; + + enum { + IT_BFF = 1<<0, + IT_TFF = 1<<1, + IT_FIELDBASED = 1<<2 + }; + + // Chroma placement bits 20 -> 23 ::FIXME:: Really want a Class to support this + enum { + CS_UNKNOWN_CHROMA_PLACEMENT = 0 << 20, + CS_MPEG1_CHROMA_PLACEMENT = 1 << 20, + CS_MPEG2_CHROMA_PLACEMENT = 2 << 20, + CS_YUY2_CHROMA_PLACEMENT = 3 << 20, + CS_TOPLEFT_CHROMA_PLACEMENT = 4 << 20 + }; + + // useful functions of the above + bool HasVideo() const AVS_BakedCode(return AVS_LinkCall(HasVideo)()) + bool HasAudio() const AVS_BakedCode(return AVS_LinkCall(HasAudio)()) + bool IsRGB() const AVS_BakedCode(return AVS_LinkCall(IsRGB)()) + bool IsRGB24() const AVS_BakedCode(return AVS_LinkCall(IsRGB24)()) + bool IsRGB32() const AVS_BakedCode(return AVS_LinkCall(IsRGB32)()) + bool IsYUV() const AVS_BakedCode(return AVS_LinkCall(IsYUV)()) + bool IsYUY2() const AVS_BakedCode(return AVS_LinkCall(IsYUY2)()) + + bool IsYV24() const AVS_BakedCode(return AVS_LinkCall(IsYV24)()) + bool IsYV16() const AVS_BakedCode(return AVS_LinkCall(IsYV16)()) + bool IsYV12() const AVS_BakedCode(return AVS_LinkCall(IsYV12)()) + bool IsYV411() const AVS_BakedCode(return AVS_LinkCall(IsYV411)()) + //bool IsYUV9() const; + bool IsY8() const AVS_BakedCode(return AVS_LinkCall(IsY8)()) + + bool IsColorSpace(int c_space) const AVS_BakedCode(return AVS_LinkCall(IsColorSpace)(c_space)) + + bool Is(int property) const AVS_BakedCode(return AVS_LinkCall(Is)(property)) + bool IsPlanar() const AVS_BakedCode(return AVS_LinkCall(IsPlanar)()) + bool IsFieldBased() const AVS_BakedCode(return AVS_LinkCall(IsFieldBased)()) + bool IsParityKnown() const AVS_BakedCode(return AVS_LinkCall(IsParityKnown)()) + bool IsBFF() const AVS_BakedCode(return AVS_LinkCall(IsBFF)()) + bool IsTFF() const AVS_BakedCode(return AVS_LinkCall(IsTFF)()) + + bool IsVPlaneFirst() const AVS_BakedCode(return AVS_LinkCall(IsVPlaneFirst)()) // Don't use this + // Will not work on planar images, but will return only luma planes + int BytesFromPixels(int pixels) const AVS_BakedCode(return AVS_LinkCall(BytesFromPixels)(pixels)) + int RowSize(int plane = 0) const AVS_BakedCode(return AVS_LinkCall(RowSize)(plane)) + int BMPSize() const AVS_BakedCode(return AVS_LinkCall(BMPSize)()) + + __int64 AudioSamplesFromFrames(int frames) const AVS_BakedCode(return AVS_LinkCall(AudioSamplesFromFrames)(frames)) + int FramesFromAudioSamples(__int64 samples) const AVS_BakedCode(return AVS_LinkCall(FramesFromAudioSamples)(samples)) + __int64 AudioSamplesFromBytes(__int64 bytes) const AVS_BakedCode(return AVS_LinkCall(AudioSamplesFromBytes)(bytes)) + __int64 BytesFromAudioSamples(__int64 samples) const AVS_BakedCode(return AVS_LinkCall(BytesFromAudioSamples)(samples)) + int AudioChannels() const AVS_BakedCode(return AVS_LinkCall(AudioChannels)()) + int SampleType() const AVS_BakedCode(return AVS_LinkCall(SampleType)()) + bool IsSampleType(int testtype) const AVS_BakedCode(return AVS_LinkCall(IsSampleType)(testtype)) + int SamplesPerSecond() const AVS_BakedCode(return AVS_LinkCall(SamplesPerSecond)()) + int BytesPerAudioSample() const AVS_BakedCode(return AVS_LinkCall(BytesPerAudioSample)()) + void SetFieldBased(bool isfieldbased) AVS_BakedCode(AVS_LinkCall_Void(SetFieldBased)(isfieldbased)) + void Set(int property) AVS_BakedCode(AVS_LinkCall_Void(Set)(property)) + void Clear(int property) AVS_BakedCode(AVS_LinkCall_Void(Clear)(property)) + // Subsampling in bitshifts! + int GetPlaneWidthSubsampling(int plane) const AVS_BakedCode(return AVS_LinkCall(GetPlaneWidthSubsampling)(plane)) + int GetPlaneHeightSubsampling(int plane) const AVS_BakedCode(return AVS_LinkCall(GetPlaneHeightSubsampling)(plane)) + int BitsPerPixel() const AVS_BakedCode(return AVS_LinkCall(BitsPerPixel)()) + + int BytesPerChannelSample() const AVS_BakedCode(return AVS_LinkCall(BytesPerChannelSample)()) + + // useful mutator + void SetFPS(unsigned numerator, unsigned denominator) AVS_BakedCode(AVS_LinkCall_Void(SetFPS)(numerator, denominator)) + + // Range protected multiply-divide of FPS + void MulDivFPS(unsigned multiplier, unsigned divisor) AVS_BakedCode(AVS_LinkCall_Void(MulDivFPS)(multiplier, divisor)) + + // Test for same colorspace + bool IsSameColorspace(const VideoInfo& vi) const AVS_BakedCode(return AVS_LinkCall(IsSameColorspace)(vi)) + + // AVS+ extensions + // 20161005: + // Mapping of AVS+ extensions to classic 2.6 functions. + // In order to use these extended AVS+ functions for plugins that should work + // either with AVS+ or with Classic (8 bit) Avs 2.6 ans earlier AVS+ versions, there is an + // automatic fallback mechanism. + // From AVS+'s point of view these are not "baked" codes, the primary functions should exist. + // Examples: + // Is444() is mapped to IsYV24() for classic AVS2.6 + // ComponentSize() returns constant 1 (1 bytes per pixel component) + // BitsPerComponent() returns constant 8 (Classic AVS2.6 is 8 bit only) + + // Returns the number of color channels or planes in a frame + int NumComponents() const AVS_BakedCode(return AVS_LinkCallOptDefault(NumComponents, (((AVS_LinkCall(IsYUV)()) && !(AVS_LinkCall(IsY8)())) ? 3 : AVS_LinkCall(BytesFromPixels)(1)) ) ) + + // Returns the size in bytes of a single component of a pixel + int ComponentSize() const AVS_BakedCode(return AVS_LinkCallOptDefault(ComponentSize, 1)) + + // Returns the bit depth of a single component of a pixel + int BitsPerComponent() const AVS_BakedCode(return AVS_LinkCallOptDefault(BitsPerComponent, 8)) + + // like IsYV24, but bit-depth independent also for YUVA + bool Is444() const AVS_BakedCode(return AVS_LinkCallOpt(Is444, IsYV24) ) + + // like IsYV16, but bit-depth independent also for YUVA + bool Is422() const AVS_BakedCode(return AVS_LinkCallOpt(Is422, IsYV16) ) + + // like IsYV12, but bit-depth independent also for YUVA + bool Is420() const AVS_BakedCode( return AVS_LinkCallOpt(Is420, IsYV12) ) + + // like IsY8, but bit-depth independent + bool IsY() const AVS_BakedCode( return AVS_LinkCallOpt(IsY, IsY8) ) + + // like IsRGB24 for 16 bit samples + bool IsRGB48() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsRGB48, false) ) + + // like IsRGB32 for 16 bit samples + bool IsRGB64() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsRGB64, false) ) + + // YUVA? + bool IsYUVA() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsYUVA, false) ) + + // Planar RGB? + bool IsPlanarRGB() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsPlanarRGB, false) ) + + // Planar RGBA? + bool IsPlanarRGBA() const AVS_BakedCode( return AVS_LinkCallOptDefault(IsPlanarRGBA, false) ) + +}; // end struct VideoInfo + + + + +// VideoFrameBuffer holds information about a memory block which is used +// for video data. For efficiency, instances of this class are not deleted +// when the refcount reaches zero; instead they're stored in a linked list +// to be reused. The instances are deleted when the corresponding AVS +// file is closed. + +class VideoFrameBuffer { + BYTE* data; +#ifdef SIZETMOD + size_t data_size; +#else + int data_size; +#endif + // sequence_number is incremented every time the buffer is changed, so + // that stale views can tell they're no longer valid. + volatile long sequence_number; + + friend class VideoFrame; + friend class Cache; + friend class ScriptEnvironment; + volatile long refcount; + +protected: +#ifdef SIZETMOD + VideoFrameBuffer(size_t size); +#else + VideoFrameBuffer(int size); +#endif + VideoFrameBuffer(); + ~VideoFrameBuffer(); + +public: + const BYTE* GetReadPtr() const AVS_BakedCode( return AVS_LinkCall(VFBGetReadPtr)() ) + BYTE* GetWritePtr() AVS_BakedCode( return AVS_LinkCall(VFBGetWritePtr)() ) +#ifdef SIZETMOD + size_t GetDataSize() const AVS_BakedCode(return AVS_LinkCall(GetDataSize)()) +#else + int GetDataSize() const AVS_BakedCode( return AVS_LinkCall(GetDataSize)() ) +#endif + int GetSequenceNumber() const AVS_BakedCode( return AVS_LinkCall(GetSequenceNumber)() ) + int GetRefcount() const AVS_BakedCode( return AVS_LinkCall(GetRefcount)() ) + +// Ensure VideoFrameBuffer cannot be publicly assigned +private: + VideoFrameBuffer& operator=(const VideoFrameBuffer&); + +}; // end class VideoFrameBuffer + + +// VideoFrame holds a "window" into a VideoFrameBuffer. Operator new +// is overloaded to recycle class instances. + +class VideoFrame { + volatile long refcount; + VideoFrameBuffer* vfb; + + // Due to technical reasons these members are not const, but should be treated as such. + // That means do not modify them once the class has been constructed. +#ifdef SIZETMOD + size_t offset; +#else + int offset; +#endif + int pitch, row_size, height; +#ifdef SIZETMOD + size_t offsetU, offsetV; // U&V offsets are from top of picture. +#else + int offsetU, offsetV; // U&V offsets are from top of picture. +#endif + int pitchUV, row_sizeUV, heightUV; // for Planar RGB offsetU, offsetV is for the 2nd and 3rd Plane. + // for Planar RGB pitchUV and row_sizeUV = 0, because when no VideoInfo (MakeWriteable) + // the decision on existance of UV is checked by zero pitch + // AVS+ extension, does not break plugins if appended here +#ifdef SIZETMOD + size_t offsetA; +#else + int offsetA; +#endif + int pitchA, row_sizeA; // 4th alpha plane support, pitch and row_size is 0 is none + + friend class PVideoFrame; + void AddRef(); + void Release(); + + friend class ScriptEnvironment; + friend class Cache; + +#ifdef SIZETMOD + VideoFrame(VideoFrameBuffer* _vfb, size_t _offset, int _pitch, int _row_size, int _height); + VideoFrame(VideoFrameBuffer* _vfb, size_t _offset, int _pitch, int _row_size, int _height, size_t _offsetU, size_t _offsetV, int _pitchUV, int _row_sizeUV, int _heightUV); + // for Alpha + VideoFrame(VideoFrameBuffer* _vfb, size_t _offset, int _pitch, int _row_size, int _height, size_t _offsetU, size_t _offsetV, int _pitchUV, int _row_sizeUV, int _heightUV, size_t _offsetA); +#else + VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height); + VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height, int _offsetU, int _offsetV, int _pitchUV, int _row_sizeUV, int _heightUV); + // for Alpha + VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height, int _offsetU, int _offsetV, int _pitchUV, int _row_sizeUV, int _heightUV, int _offsetA); +#endif + + void* operator new(size_t size); +// TESTME: OFFSET U/V may be switched to what could be expected from AVI standard! +public: + int GetPitch(int plane=0) const AVS_BakedCode( return AVS_LinkCall(GetPitch)(plane) ) + int GetRowSize(int plane=0) const AVS_BakedCode( return AVS_LinkCall(GetRowSize)(plane) ) + int GetHeight(int plane=0) const AVS_BakedCode( return AVS_LinkCall(GetHeight)(plane) ) + + // generally you shouldn't use these three + VideoFrameBuffer* GetFrameBuffer() const AVS_BakedCode( return AVS_LinkCall(GetFrameBuffer)() ) +#ifdef SIZETMOD + size_t GetOffset(int plane = 0) const AVS_BakedCode(return AVS_LinkCall(GetOffset)(plane)) +#else + int GetOffset(int plane=0) const AVS_BakedCode( return AVS_LinkCall(GetOffset)(plane) ) +#endif + + // in plugins use env->SubFrame() -- because implementation code is only available inside avisynth.dll. Doh! + VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height) const; + VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int pitchUV) const; + // for Alpha + VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int pitchUV, int rel_offsetA) const; + + const BYTE* GetReadPtr(int plane=0) const AVS_BakedCode( return AVS_LinkCall(VFGetReadPtr)(plane) ) + bool IsWritable() const AVS_BakedCode( return AVS_LinkCall(IsWritable)() ) + BYTE* GetWritePtr(int plane=0) const AVS_BakedCode( return AVS_LinkCall(VFGetWritePtr)(plane) ) + + ~VideoFrame() AVS_BakedCode( AVS_LinkCall_Void(VideoFrame_DESTRUCTOR)() ) +#ifdef BUILDING_AVSCORE +public: + void DESTRUCTOR(); /* Damn compiler won't allow taking the address of reserved constructs, make a dummy interlude */ +#endif + +// Ensure VideoFrame cannot be publicly assigned +private: + VideoFrame& operator=(const VideoFrame&); + +}; // end class VideoFrame + +enum CachePolicyHint { + // Values 0 to 5 are reserved for old 2.5 plugins + // do not use them in new plugins + + // New 2.6 explicitly defined cache hints. + CACHE_NOTHING=10, // Do not cache video. + CACHE_WINDOW=11, // Hard protect upto X frames within a range of X from the current frame N. + CACHE_GENERIC=12, // LRU cache upto X frames. + CACHE_FORCE_GENERIC=13, // LRU cache upto X frames, override any previous CACHE_WINDOW. + + CACHE_GET_POLICY=30, // Get the current policy. + CACHE_GET_WINDOW=31, // Get the current window h_span. + CACHE_GET_RANGE=32, // Get the current generic frame range. + + CACHE_AUDIO=50, // Explicitly cache audio, X byte cache. + CACHE_AUDIO_NOTHING=51, // Explicitly do not cache audio. + CACHE_AUDIO_NONE=52, // Audio cache off (auto mode), X byte intial cache. + CACHE_AUDIO_AUTO=53, // Audio cache on (auto mode), X byte intial cache. + + CACHE_GET_AUDIO_POLICY=70, // Get the current audio policy. + CACHE_GET_AUDIO_SIZE=71, // Get the current audio cache size. + + CACHE_PREFETCH_FRAME=100, // Queue request to prefetch frame N. + CACHE_PREFETCH_GO=101, // Action video prefetches. + + CACHE_PREFETCH_AUDIO_BEGIN=120, // Begin queue request transaction to prefetch audio (take critical section). + CACHE_PREFETCH_AUDIO_STARTLO=121, // Set low 32 bits of start. + CACHE_PREFETCH_AUDIO_STARTHI=122, // Set high 32 bits of start. + CACHE_PREFETCH_AUDIO_COUNT=123, // Set low 32 bits of length. + CACHE_PREFETCH_AUDIO_COMMIT=124, // Enqueue request transaction to prefetch audio (release critical section). + CACHE_PREFETCH_AUDIO_GO=125, // Action audio prefetches. + + CACHE_GETCHILD_CACHE_MODE=200, // Cache ask Child for desired video cache mode. + CACHE_GETCHILD_CACHE_SIZE=201, // Cache ask Child for desired video cache size. + CACHE_GETCHILD_AUDIO_MODE=202, // Cache ask Child for desired audio cache mode. + CACHE_GETCHILD_AUDIO_SIZE=203, // Cache ask Child for desired audio cache size. + + CACHE_GETCHILD_COST=220, // Cache ask Child for estimated processing cost. + CACHE_COST_ZERO=221, // Child response of zero cost (ptr arithmetic only). + CACHE_COST_UNIT=222, // Child response of unit cost (less than or equal 1 full frame blit). + CACHE_COST_LOW=223, // Child response of light cost. (Fast) + CACHE_COST_MED=224, // Child response of medium cost. (Real time) + CACHE_COST_HI=225, // Child response of heavy cost. (Slow) + + CACHE_GETCHILD_THREAD_MODE=240, // Cache ask Child for thread safetyness. + CACHE_THREAD_UNSAFE=241, // Only 1 thread allowed for all instances. 2.5 filters default! + CACHE_THREAD_CLASS=242, // Only 1 thread allowed for each instance. 2.6 filters default! + CACHE_THREAD_SAFE=243, // Allow all threads in any instance. + CACHE_THREAD_OWN=244, // Safe but limit to 1 thread, internally threaded. + + CACHE_GETCHILD_ACCESS_COST=260, // Cache ask Child for preferred access pattern. + CACHE_ACCESS_RAND=261, // Filter is access order agnostic. + CACHE_ACCESS_SEQ0=262, // Filter prefers sequential access (low cost) + CACHE_ACCESS_SEQ1=263, // Filter needs sequential access (high cost) + + CACHE_AVSPLUS_CONSTANTS = 500, // Smaller values are reserved for classic Avisynth + + CACHE_DONT_CACHE_ME, // Filters that don't need caching (eg. trim, cache etc.) should return 1 to this request + CACHE_SET_MIN_CAPACITY, + CACHE_SET_MAX_CAPACITY, + CACHE_GET_MIN_CAPACITY, + CACHE_GET_MAX_CAPACITY, + CACHE_GET_SIZE, + CACHE_GET_REQUESTED_CAP, + CACHE_GET_CAPACITY, + CACHE_GET_MTMODE, + + CACHE_IS_CACHE_REQ, + CACHE_IS_CACHE_ANS, + CACHE_IS_MTGUARD_REQ, + CACHE_IS_MTGUARD_ANS, + + CACHE_USER_CONSTANTS = 1000 // Smaller values are reserved for the core + +}; + +// Base class for all filters. +class IClip { + friend class PClip; + friend class AVSValue; + volatile long refcnt; + void AddRef(); + void Release(); +public: + IClip() : refcnt(0) {} + virtual int __stdcall GetVersion() { return AVISYNTH_INTERFACE_VERSION; } + virtual PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) = 0; + virtual bool __stdcall GetParity(int n) = 0; // return field parity if field_based, else parity of first field in frame + virtual void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) = 0; // start and count are in samples + /* Need to check GetVersion first, pre v5 will return random crap from EAX reg. */ + virtual int __stdcall SetCacheHints(int cachehints,int frame_range) = 0 ; // We do not pass cache requests upwards, only to the next filter. + virtual const VideoInfo& __stdcall GetVideoInfo() = 0; + virtual AVSC_CC ~IClip() {} +}; // end class IClip + + +// smart pointer to IClip +class PClip { + + IClip* p; + + IClip* GetPointerWithAddRef() const; + friend class AVSValue; + friend class VideoFrame; + + void Init(IClip* x); + void Set(IClip* x); + +public: + PClip() AVS_BakedCode( AVS_LinkCall_Void(PClip_CONSTRUCTOR0)() ) + PClip(const PClip& x) AVS_BakedCode( AVS_LinkCall_Void(PClip_CONSTRUCTOR1)(x) ) + PClip(IClip* x) AVS_BakedCode( AVS_LinkCall_Void(PClip_CONSTRUCTOR2)(x) ) + void operator=(IClip* x) AVS_BakedCode( AVS_LinkCall_Void(PClip_OPERATOR_ASSIGN0)(x) ) + void operator=(const PClip& x) AVS_BakedCode( AVS_LinkCall_Void(PClip_OPERATOR_ASSIGN1)(x) ) + + IClip* operator->() const { return p; } + + // useful in conditional expressions + operator void*() const { return p; } + bool operator!() const { return !p; } + + ~PClip() AVS_BakedCode( AVS_LinkCall_Void(PClip_DESTRUCTOR)() ) +#ifdef BUILDING_AVSCORE +public: + void CONSTRUCTOR0(); /* Damn compiler won't allow taking the address of reserved constructs, make a dummy interlude */ + void CONSTRUCTOR1(const PClip& x); + void CONSTRUCTOR2(IClip* x); + void OPERATOR_ASSIGN0(IClip* x); + void OPERATOR_ASSIGN1(const PClip& x); + void DESTRUCTOR(); +#endif +}; // end class PClip + + +// smart pointer to VideoFrame +class PVideoFrame { + + VideoFrame* p; + + void Init(VideoFrame* x); + void Set(VideoFrame* x); + +public: + PVideoFrame() AVS_BakedCode( AVS_LinkCall_Void(PVideoFrame_CONSTRUCTOR0)() ) + PVideoFrame(const PVideoFrame& x) AVS_BakedCode( AVS_LinkCall_Void(PVideoFrame_CONSTRUCTOR1)(x) ) + PVideoFrame(VideoFrame* x) AVS_BakedCode( AVS_LinkCall_Void(PVideoFrame_CONSTRUCTOR2)(x) ) + void operator=(VideoFrame* x) AVS_BakedCode( AVS_LinkCall_Void(PVideoFrame_OPERATOR_ASSIGN0)(x) ) + void operator=(const PVideoFrame& x) AVS_BakedCode( AVS_LinkCall_Void(PVideoFrame_OPERATOR_ASSIGN1)(x) ) + + VideoFrame* operator->() const { return p; } + + // for conditional expressions + operator void*() const { return p; } + bool operator!() const { return !p; } + + ~PVideoFrame() AVS_BakedCode( AVS_LinkCall_Void(PVideoFrame_DESTRUCTOR)() ) +#ifdef BUILDING_AVSCORE +public: + void CONSTRUCTOR0(); /* Damn compiler won't allow taking the address of reserved constructs, make a dummy interlude */ + void CONSTRUCTOR1(const PVideoFrame& x); + void CONSTRUCTOR2(VideoFrame* x); + void OPERATOR_ASSIGN0(VideoFrame* x); + void OPERATOR_ASSIGN1(const PVideoFrame& x); + void DESTRUCTOR(); +#endif +}; // end class PVideoFrame + + +class AVSValue { +public: + + AVSValue() AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR0)() ) + AVSValue(IClip* c) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR1)(c) ) + AVSValue(const PClip& c) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR2)(c) ) + AVSValue(bool b) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR3)(b) ) + AVSValue(int i) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR4)(i) ) +// AVSValue(__int64 l); + AVSValue(float f) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR5)(f) ) + AVSValue(double f) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR6)(f) ) + AVSValue(const char* s) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR7)(s) ) + AVSValue(const AVSValue* a, int size) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR8)(a, size) ) + AVSValue(const AVSValue& a, int size) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR8)(&a, size) ) + AVSValue(const AVSValue& v) AVS_BakedCode( AVS_LinkCall_Void(AVSValue_CONSTRUCTOR9)(v) ) + + ~AVSValue() AVS_BakedCode( AVS_LinkCall_Void(AVSValue_DESTRUCTOR)() ) + AVSValue& operator=(const AVSValue& v) AVS_BakedCode( return AVS_LinkCallV(AVSValue_OPERATOR_ASSIGN)(v) ) + + // Note that we transparently allow 'int' to be treated as 'float'. + // There are no int<->bool conversions, though. + + bool Defined() const AVS_BakedCode( return AVS_LinkCall(Defined)() ) + bool IsClip() const AVS_BakedCode( return AVS_LinkCall(IsClip)() ) + bool IsBool() const AVS_BakedCode( return AVS_LinkCall(IsBool)() ) + bool IsInt() const AVS_BakedCode( return AVS_LinkCall(IsInt)() ) +// bool IsLong() const; + bool IsFloat() const AVS_BakedCode( return AVS_LinkCall(IsFloat)() ) + bool IsString() const AVS_BakedCode( return AVS_LinkCall(IsString)() ) + bool IsArray() const AVS_BakedCode( return AVS_LinkCall(IsArray)() ) + + PClip AsClip() const AVS_BakedCode( return AVS_LinkCall(AsClip)() ) + bool AsBool() const AVS_BakedCode( return AVS_LinkCall(AsBool1)() ) + int AsInt() const AVS_BakedCode( return AVS_LinkCall(AsInt1)() ) +// int AsLong() const; + const char* AsString() const AVS_BakedCode( return AVS_LinkCall(AsString1)() ) + double AsFloat() const AVS_BakedCode( return AVS_LinkCall(AsFloat1)() ) + float AsFloatf() const AVS_BakedCode( return float( AVS_LinkCall(AsFloat1)() ) ) + + bool AsBool(bool def) const AVS_BakedCode( return AVS_LinkCall(AsBool2)(def) ) + int AsInt(int def) const AVS_BakedCode( return AVS_LinkCall(AsInt2)(def) ) + double AsDblDef(double def) const AVS_BakedCode( return AVS_LinkCall(AsDblDef)(def) ) // Value is still a float + double AsFloat(float def) const AVS_BakedCode( return AVS_LinkCall(AsFloat2)(def) ) + float AsFloatf(float def) const AVS_BakedCode( return float( AVS_LinkCall(AsFloat2)(def) ) ) + const char* AsString(const char* def) const AVS_BakedCode( return AVS_LinkCall(AsString2)(def) ) + + int ArraySize() const AVS_BakedCode( return AVS_LinkCall(ArraySize)() ) + + const AVSValue& operator[](int index) const AVS_BakedCode( return AVS_LinkCallV(AVSValue_OPERATOR_INDEX)(index) ) + +private: + + short type; // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or RFU: 'l'ong ('d'ouble) + short array_size; + union { + IClip* clip; + bool boolean; + int integer; + float floating_pt; + const char* string; + const AVSValue* array; + #ifdef X86_64 + // if ever, only x64 will support. It breaks struct size on 32 bit + __int64 longlong; // 8 bytes + double double_pt; // 8 bytes + #endif + }; + + void Assign(const AVSValue* src, bool init); +#ifdef BUILDING_AVSCORE +public: + void CONSTRUCTOR0(); /* Damn compiler won't allow taking the address of reserved constructs, make a dummy interlude */ + void CONSTRUCTOR1(IClip* c); + void CONSTRUCTOR2(const PClip& c); + void CONSTRUCTOR3(bool b); + void CONSTRUCTOR4(int i); + void CONSTRUCTOR5(float f); + void CONSTRUCTOR6(double f); + void CONSTRUCTOR7(const char* s); + void CONSTRUCTOR8(const AVSValue* a, int size); + void CONSTRUCTOR9(const AVSValue& v); + void DESTRUCTOR(); + AVSValue& OPERATOR_ASSIGN(const AVSValue& v); + const AVSValue& OPERATOR_INDEX(int index) const; + + bool AsBool1() const; + int AsInt1() const; + const char* AsString1() const; + double AsFloat1() const; + + bool AsBool2(bool def) const; + int AsInt2(int def) const; + double AsFloat2(float def) const; + const char* AsString2(const char* def) const; + +#ifdef NEW_AVSVALUE + void MarkArrayAsC(); + void CONSTRUCTOR10(const AVSValue& v, bool c_arrays); + AVSValue(const AVSValue& v, bool c_arrays); + void Assign2(const AVSValue* src, bool init, bool c_arrays); +#endif + +#endif +}; // end class AVSValue + +#undef CALL_MEMBER_FN +#undef AVS_LinkCallOptDefault +#undef AVS_LinkCallOpt +#undef AVS_LinkCallV +#undef AVS_LinkCall +#undef AVS_BakedCode + +#define AVS_UNUSED(x) x + +// instantiable null filter +class GenericVideoFilter : public IClip { +protected: + PClip child; + VideoInfo vi; +public: + GenericVideoFilter(PClip _child) : child(_child) { vi = child->GetVideoInfo(); } + PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) { return child->GetFrame(n, env); } + void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) { child->GetAudio(buf, start, count, env); } + const VideoInfo& __stdcall GetVideoInfo() { return vi; } + bool __stdcall GetParity(int n) { return child->GetParity(n); } + int __stdcall SetCacheHints(int cachehints, int frame_range) { AVS_UNUSED(cachehints); AVS_UNUSED(frame_range); return 0; }; // We do not pass cache requests upwards, only to the next filter. +}; + + + + +#include + + + +class IScriptEnvironment { +public: + virtual AVSC_CC ~IScriptEnvironment() {} + + virtual /*static*/ int __stdcall GetCPUFlags() = 0; + + virtual char* __stdcall SaveString(const char* s, int length = -1) = 0; + virtual char* __stdcall Sprintf(const char* fmt, ...) = 0; + // note: val is really a va_list; I hope everyone typedefs va_list to a pointer + virtual char* __stdcall VSprintf(const char* fmt, void* val) = 0; + + __declspec(noreturn) virtual void __stdcall ThrowError(const char* fmt, ...) = 0; + + class NotFound /*exception*/ {}; // thrown by Invoke and GetVar + + typedef AVSValue (__cdecl *ApplyFunc)(AVSValue args, void* user_data, IScriptEnvironment* env); + + virtual void __stdcall AddFunction(const char* name, const char* params, ApplyFunc apply, void* user_data) = 0; + virtual bool __stdcall FunctionExists(const char* name) = 0; + virtual AVSValue __stdcall Invoke(const char* name, const AVSValue args, const char* const* arg_names=0) = 0; + + virtual AVSValue __stdcall GetVar(const char* name) = 0; + virtual bool __stdcall SetVar(const char* name, const AVSValue& val) = 0; + virtual bool __stdcall SetGlobalVar(const char* name, const AVSValue& val) = 0; + + virtual void __stdcall PushContext(int level=0) = 0; + virtual void __stdcall PopContext() = 0; + + // align should be 4 or 8 + virtual PVideoFrame __stdcall NewVideoFrame(const VideoInfo& vi, int align=FRAME_ALIGN) = 0; + + virtual bool __stdcall MakeWritable(PVideoFrame* pvf) = 0; + + virtual void __stdcall BitBlt(BYTE* dstp, int dst_pitch, const BYTE* srcp, int src_pitch, int row_size, int height) = 0; + + typedef void (__cdecl *ShutdownFunc)(void* user_data, IScriptEnvironment* env); + virtual void __stdcall AtExit(ShutdownFunc function, void* user_data) = 0; + + virtual void __stdcall CheckVersion(int version = AVISYNTH_INTERFACE_VERSION) = 0; + + virtual PVideoFrame __stdcall Subframe(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size, int new_height) = 0; + + virtual int __stdcall SetMemoryMax(int mem) = 0; + + virtual int __stdcall SetWorkingDir(const char * newdir) = 0; + + virtual void* __stdcall ManageCache(int key, void* data) = 0; + + enum PlanarChromaAlignmentMode { + PlanarChromaAlignmentOff, + PlanarChromaAlignmentOn, + PlanarChromaAlignmentTest }; + + virtual bool __stdcall PlanarChromaAlignment(PlanarChromaAlignmentMode key) = 0; + + virtual PVideoFrame __stdcall SubframePlanar(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size, + int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV) = 0; + + virtual void __stdcall DeleteScriptEnvironment() = 0; + + virtual void __stdcall ApplyMessage(PVideoFrame* frame, const VideoInfo& vi, const char* message, int size, + int textcolor, int halocolor, int bgcolor) = 0; + + virtual const AVS_Linkage* const __stdcall GetAVSLinkage() = 0; + + // noThrow version of GetVar + virtual AVSValue __stdcall GetVarDef(const char* name, const AVSValue& def = AVSValue()) = 0; + +}; // end class IScriptEnvironment + + +enum MtMode +{ + MT_INVALID = 0, + MT_NICE_FILTER = 1, + MT_MULTI_INSTANCE = 2, + MT_SERIALIZED = 3, + MT_SPECIAL_MT = 4, + MT_MODE_COUNT = 5 +}; + +class IJobCompletion +{ +public: + + virtual __stdcall ~IJobCompletion() {} + virtual void __stdcall Wait() = 0; + virtual AVSValue __stdcall Get(size_t i) = 0; + virtual size_t __stdcall Size() const = 0; + virtual size_t __stdcall Capacity() const = 0; + virtual void __stdcall Reset() = 0; + virtual void __stdcall Destroy() = 0; +}; + +class IScriptEnvironment2; +class Prefetcher; +typedef AVSValue (*ThreadWorkerFuncPtr)(IScriptEnvironment2* env, void* data); + +enum AvsEnvProperty +{ + AEP_PHYSICAL_CPUS = 1, + AEP_LOGICAL_CPUS = 2, + AEP_THREADPOOL_THREADS = 3, + AEP_FILTERCHAIN_THREADS = 4, + AEP_THREAD_ID = 5, + AEP_VERSION = 6 +}; + +enum AvsAllocType +{ + AVS_NORMAL_ALLOC = 1, + AVS_POOLED_ALLOC = 2 +}; + +/* ----------------------------------------------------------------------------- + Note to plugin authors: The interface in IScriptEnvironment2 is + preliminary / under construction / only for testing / non-final etc.! + As long as you see this note here, IScriptEnvironment2 might still change, + in which case your plugin WILL break. This also means that you are welcome + to test it and give your feedback about any ideas, improvements, or issues + you might have. + ----------------------------------------------------------------------------- */ +class AVSFunction; +class IScriptEnvironment2 : public IScriptEnvironment{ +public: + virtual ~IScriptEnvironment2() {} + + // Generic system to ask for various properties + virtual size_t __stdcall GetProperty(AvsEnvProperty prop) = 0; + + // Returns TRUE and the requested variable. If the method fails, returns FALSE and does not touch 'val'. + virtual bool __stdcall GetVar(const char* name, AVSValue *val) const = 0; + + // Return the value of the requested variable. + // If the variable was not found or had the wrong type, + // return the supplied default value. + virtual bool __stdcall GetVar(const char* name, bool def) const = 0; + virtual int __stdcall GetVar(const char* name, int def) const = 0; + virtual double __stdcall GetVar(const char* name, double def) const = 0; + virtual const char* __stdcall GetVar(const char* name, const char* def) const = 0; + + // Plugin functions + virtual bool __stdcall LoadPlugin(const char* filePath, bool throwOnError, AVSValue *result) = 0; + virtual void __stdcall AddAutoloadDir(const char* dirPath, bool toFront) = 0; + virtual void __stdcall ClearAutoloadDirs() = 0; + virtual void __stdcall AutoloadPlugins() = 0; + virtual void __stdcall AddFunction(const char* name, const char* params, ApplyFunc apply, void* user_data, const char *exportVar) = 0; + virtual bool __stdcall InternalFunctionExists(const char* name) = 0; + + // Threading + virtual void __stdcall SetFilterMTMode(const char* filter, MtMode mode, bool force) = 0; // If filter is "DEFAULT_MT_MODE", sets the default MT mode + virtual IJobCompletion* __stdcall NewCompletion(size_t capacity) = 0; + virtual void __stdcall ParallelJob(ThreadWorkerFuncPtr jobFunc, void* jobData, IJobCompletion* completion) = 0; + + // This version of Invoke will return false instead of throwing NotFound(). + virtual bool __stdcall Invoke(AVSValue *result, const char* name, const AVSValue& args, const char* const* arg_names=0) = 0; + + // Support functions + virtual void* __stdcall Allocate(size_t nBytes, size_t alignment, AvsAllocType type) = 0; + virtual void __stdcall Free(void* ptr) = 0; + + // These lines are needed so that we can overload the older functions from IScriptEnvironment. + using IScriptEnvironment::Invoke; + using IScriptEnvironment::AddFunction; + using IScriptEnvironment::GetVar; + + virtual PVideoFrame __stdcall SubframePlanarA(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size, + int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV, int rel_offsetA) = 0; + +}; // end class IScriptEnvironment2 + + +// avisynth.dll exports this; it's a way to use it as a library, without +// writing an AVS script or without going through AVIFile. +AVSC_API(IScriptEnvironment*, CreateScriptEnvironment)(int version = AVISYNTH_INTERFACE_VERSION); + + +// These are some global variables you can set in your script to change AviSynth's behavior. +#define VARNAME_AllowFloatAudio "OPT_AllowFloatAudio" // Allow WAVE_FORMAT_IEEE_FLOAT audio output +#define VARNAME_VDubPlanarHack "OPT_VDubPlanarHack" // Hack YV16 and YV24 chroma plane order for old VDub's +#define VARNAME_AVIPadScanlines "OPT_AVIPadScanlines" // Have scanlines mod4 padded in all pixel formats +#define VARNAME_UseWaveExtensible "OPT_UseWaveExtensible" // Use WAVEFORMATEXTENSIBLE when describing audio to Windows +#define VARNAME_dwChannelMask "OPT_dwChannelMask" // Integer audio channel mask. See description of WAVEFORMATEXTENSIBLE for more info. +#define VARNAME_Enable_V210 "OPT_Enable_V210" // AVS+ use V210 instead of P210 (VfW) +#define VARNAME_Enable_Y3_10_10 "OPT_Enable_Y3_10_10" // AVS+ use Y3[10][10] instead of P210 (VfW) +#define VARNAME_Enable_Y3_10_16 "OPT_Enable_Y3_10_16" // AVS+ use Y3[10][16] instead of P216 (VfW) +#define VARNAME_Enable_b64a "OPT_Enable_b64a" // AVS+ use b64a instead of BRA[64] (VfW) +#define VARNAME_Enable_PlanarToPackedRGB "OPT_Enable_PlanarToPackedRGB" // AVS+ convert Planar RGB to packed RGB (VfW) + +// C exports +#include +AVSC_API(IScriptEnvironment2*, CreateScriptEnvironment2)(int version = AVISYNTH_INTERFACE_VERSION); + +#ifndef BUILDING_AVSCORE +#undef AVS_UNUSED +#endif + +#pragma pack(pop) + +#endif //__AVISYNTH_6_H__ diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/alignment.h b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/alignment.h index 68b4cfee40..cd87ca9cfe 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/alignment.h +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/alignment.h @@ -1,134 +1,134 @@ -// Avisynth C Interface Version 0.20 -// Copyright 2003 Kevin Atkinson - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// As a special exception, I give you permission to link to the -// Avisynth C interface with independent modules that communicate with -// the Avisynth C interface solely through the interfaces defined in -// avisynth_c.h, regardless of the license terms of these independent -// modules, and to copy and distribute the resulting combined work -// under terms of your choice, provided that every copy of the -// combined work is accompanied by a complete copy of the source code -// of the Avisynth C interface and Avisynth itself (with the version -// used to produce the combined work), being distributed under the -// terms of the GNU General Public License plus this exception. An -// independent module is a module which is not derived from or based -// on Avisynth C Interface, such as 3rd-party filters, import and -// export plugins, or graphical user interfaces. - -#ifndef AVS_ALIGNMENT_H -#define AVS_ALIGNMENT_H - -// Functions and macros to help work with alignment requirements. - -// Tells if a number is a power of two. -#define IS_POWER2(n) ((n) && !((n) & ((n) - 1))) - -// Tells if the pointer "ptr" is aligned to "align" bytes. -#define IS_PTR_ALIGNED(ptr, align) (((uintptr_t)ptr & ((uintptr_t)(align-1))) == 0) - -// Rounds up the number "n" to the next greater multiple of "align" -#define ALIGN_NUMBER(n, align) (((n) + (align)-1) & (~((align)-1))) - -// Rounds up the pointer address "ptr" to the next greater multiple of "align" -#define ALIGN_POINTER(ptr, align) (((uintptr_t)(ptr) + (align)-1) & (~(uintptr_t)((align)-1))) - -#ifdef __cplusplus - -#include -#include -#include -#include - -#if defined(MSVC) - // needed for VS2013, otherwise C++11 'alignas' works - #define avs_alignas(x) __declspec(align(x)) -#else - // assumes C++11 support - #define avs_alignas(x) alignas(x) -#endif - -template -static bool IsPtrAligned(T* ptr, size_t align) -{ - assert(IS_POWER2(align)); - return (bool)IS_PTR_ALIGNED(ptr, align); -} - -template -static T AlignNumber(T n, T align) -{ - assert(IS_POWER2(align)); - return ALIGN_NUMBER(n, align); -} - -template -static T* AlignPointer(T* ptr, size_t align) -{ - assert(IS_POWER2(align)); - return (T*)ALIGN_POINTER(ptr, align); -} - -extern "C" -{ -#else -#include -#endif // __cplusplus - -// Returns a new buffer that is at least the size "nbytes". -// The buffer will be aligned to "align" bytes. -// Returns NULL on error. On successful allocation, -// the returned buffer must be freed using "avs_free". -inline void* avs_malloc(size_t nbytes, size_t align) -{ - if (!IS_POWER2(align)) - return NULL; - - size_t offset = sizeof(void*) + align - 1; - - void *orig = malloc(nbytes + offset); - if (orig == NULL) - return NULL; - - void **aligned = (void**)(((uintptr_t)orig + (uintptr_t)offset) & (~(uintptr_t)(align-1))); - aligned[-1] = orig; - return aligned; -} - -// Buffers allocated using "avs_malloc" must be freed -// using "avs_free" instead of "free". -inline void avs_free(void *ptr) -{ - // Mirroring free()'s semantic requires us to accept NULLs - if (ptr == NULL) - return; - - free(((void**)ptr)[-1]); -} - -#ifdef __cplusplus -} // extern "C" - -// The point of these undef's is to force using the template functions -// if we are in C++ mode. For C, the user can rely only on the macros. -#undef IS_PTR_ALIGNED -#undef ALIGN_NUMBER -#undef ALIGN_POINTER - -#endif // __cplusplus - -#endif //AVS_ALIGNMENT_H +// Avisynth C Interface Version 0.20 +// Copyright 2003 Kevin Atkinson + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit +// http://www.gnu.org/copyleft/gpl.html . +// +// As a special exception, I give you permission to link to the +// Avisynth C interface with independent modules that communicate with +// the Avisynth C interface solely through the interfaces defined in +// avisynth_c.h, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting combined work +// under terms of your choice, provided that every copy of the +// combined work is accompanied by a complete copy of the source code +// of the Avisynth C interface and Avisynth itself (with the version +// used to produce the combined work), being distributed under the +// terms of the GNU General Public License plus this exception. An +// independent module is a module which is not derived from or based +// on Avisynth C Interface, such as 3rd-party filters, import and +// export plugins, or graphical user interfaces. + +#ifndef AVS_ALIGNMENT_H +#define AVS_ALIGNMENT_H + +// Functions and macros to help work with alignment requirements. + +// Tells if a number is a power of two. +#define IS_POWER2(n) ((n) && !((n) & ((n) - 1))) + +// Tells if the pointer "ptr" is aligned to "align" bytes. +#define IS_PTR_ALIGNED(ptr, align) (((uintptr_t)ptr & ((uintptr_t)(align-1))) == 0) + +// Rounds up the number "n" to the next greater multiple of "align" +#define ALIGN_NUMBER(n, align) (((n) + (align)-1) & (~((align)-1))) + +// Rounds up the pointer address "ptr" to the next greater multiple of "align" +#define ALIGN_POINTER(ptr, align) (((uintptr_t)(ptr) + (align)-1) & (~(uintptr_t)((align)-1))) + +#ifdef __cplusplus + +#include +#include +#include +#include + +#if defined(MSVC) + // needed for VS2013, otherwise C++11 'alignas' works + #define avs_alignas(x) __declspec(align(x)) +#else + // assumes C++11 support + #define avs_alignas(x) alignas(x) +#endif + +template +static bool IsPtrAligned(T* ptr, size_t align) +{ + assert(IS_POWER2(align)); + return (bool)IS_PTR_ALIGNED(ptr, align); +} + +template +static T AlignNumber(T n, T align) +{ + assert(IS_POWER2(align)); + return ALIGN_NUMBER(n, align); +} + +template +static T* AlignPointer(T* ptr, size_t align) +{ + assert(IS_POWER2(align)); + return (T*)ALIGN_POINTER(ptr, align); +} + +extern "C" +{ +#else +#include +#endif // __cplusplus + +// Returns a new buffer that is at least the size "nbytes". +// The buffer will be aligned to "align" bytes. +// Returns NULL on error. On successful allocation, +// the returned buffer must be freed using "avs_free". +inline void* avs_malloc(size_t nbytes, size_t align) +{ + if (!IS_POWER2(align)) + return NULL; + + size_t offset = sizeof(void*) + align - 1; + + void *orig = malloc(nbytes + offset); + if (orig == NULL) + return NULL; + + void **aligned = (void**)(((uintptr_t)orig + (uintptr_t)offset) & (~(uintptr_t)(align-1))); + aligned[-1] = orig; + return aligned; +} + +// Buffers allocated using "avs_malloc" must be freed +// using "avs_free" instead of "free". +inline void avs_free(void *ptr) +{ + // Mirroring free()'s semantic requires us to accept NULLs + if (ptr == NULL) + return; + + free(((void**)ptr)[-1]); +} + +#ifdef __cplusplus +} // extern "C" + +// The point of these undef's is to force using the template functions +// if we are in C++ mode. For C, the user can rely only on the macros. +#undef IS_PTR_ALIGNED +#undef ALIGN_NUMBER +#undef ALIGN_POINTER + +#endif // __cplusplus + +#endif //AVS_ALIGNMENT_H diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/capi.h b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/capi.h index e735962baf..f45bdcbde1 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/capi.h +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/capi.h @@ -1,66 +1,66 @@ -// Avisynth C Interface Version 0.20 -// Copyright 2003 Kevin Atkinson - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// As a special exception, I give you permission to link to the -// Avisynth C interface with independent modules that communicate with -// the Avisynth C interface solely through the interfaces defined in -// avisynth_c.h, regardless of the license terms of these independent -// modules, and to copy and distribute the resulting combined work -// under terms of your choice, provided that every copy of the -// combined work is accompanied by a complete copy of the source code -// of the Avisynth C interface and Avisynth itself (with the version -// used to produce the combined work), being distributed under the -// terms of the GNU General Public License plus this exception. An -// independent module is a module which is not derived from or based -// on Avisynth C Interface, such as 3rd-party filters, import and -// export plugins, or graphical user interfaces. - -#ifndef AVS_CAPI_H -#define AVS_CAPI_H - -#ifdef __cplusplus -# define EXTERN_C extern "C" -#else -# define EXTERN_C -#endif - -#ifdef MSVC -#ifndef AVSC_USE_STDCALL -# define AVSC_CC __cdecl -#else -# define AVSC_CC __stdcall -#endif -#else -# define AVSC_CC -#endif - -#define AVSC_INLINE static __inline - -#ifdef BUILDING_AVSCORE -# define AVSC_EXPORT __declspec(dllexport) -# define AVSC_API(ret, name) EXTERN_C AVSC_EXPORT ret AVSC_CC name -#else -# define AVSC_EXPORT EXTERN_C __declspec(dllexport) -# ifndef AVSC_NO_DECLSPEC -# define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name -# else -# define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func) -# endif -#endif - -#endif //AVS_CAPI_H +// Avisynth C Interface Version 0.20 +// Copyright 2003 Kevin Atkinson + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit +// http://www.gnu.org/copyleft/gpl.html . +// +// As a special exception, I give you permission to link to the +// Avisynth C interface with independent modules that communicate with +// the Avisynth C interface solely through the interfaces defined in +// avisynth_c.h, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting combined work +// under terms of your choice, provided that every copy of the +// combined work is accompanied by a complete copy of the source code +// of the Avisynth C interface and Avisynth itself (with the version +// used to produce the combined work), being distributed under the +// terms of the GNU General Public License plus this exception. An +// independent module is a module which is not derived from or based +// on Avisynth C Interface, such as 3rd-party filters, import and +// export plugins, or graphical user interfaces. + +#ifndef AVS_CAPI_H +#define AVS_CAPI_H + +#ifdef __cplusplus +# define EXTERN_C extern "C" +#else +# define EXTERN_C +#endif + +#ifdef MSVC +#ifndef AVSC_USE_STDCALL +# define AVSC_CC __cdecl +#else +# define AVSC_CC __stdcall +#endif +#else +# define AVSC_CC +#endif + +#define AVSC_INLINE static __inline + +#ifdef BUILDING_AVSCORE +# define AVSC_EXPORT __declspec(dllexport) +# define AVSC_API(ret, name) EXTERN_C AVSC_EXPORT ret AVSC_CC name +#else +# define AVSC_EXPORT EXTERN_C __declspec(dllexport) +# ifndef AVSC_NO_DECLSPEC +# define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name +# else +# define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func) +# endif +#endif + +#endif //AVS_CAPI_H diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/config.h b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/config.h index fc12547f97..a7d3e692ea 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/config.h +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/config.h @@ -1,70 +1,70 @@ -// Avisynth C Interface Version 0.20 -// Copyright 2003 Kevin Atkinson - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// As a special exception, I give you permission to link to the -// Avisynth C interface with independent modules that communicate with -// the Avisynth C interface solely through the interfaces defined in -// avisynth_c.h, regardless of the license terms of these independent -// modules, and to copy and distribute the resulting combined work -// under terms of your choice, provided that every copy of the -// combined work is accompanied by a complete copy of the source code -// of the Avisynth C interface and Avisynth itself (with the version -// used to produce the combined work), being distributed under the -// terms of the GNU General Public License plus this exception. An -// independent module is a module which is not derived from or based -// on Avisynth C Interface, such as 3rd-party filters, import and -// export plugins, or graphical user interfaces. - -#ifndef AVS_CONFIG_H -#define AVS_CONFIG_H - -// Undefine this to get cdecl calling convention -#define AVSC_USE_STDCALL 1 - -// NOTE TO PLUGIN AUTHORS: -// Because FRAME_ALIGN can be substantially higher than the alignment -// a plugin actually needs, plugins should not use FRAME_ALIGN to check for -// alignment. They should always request the exact alignment value they need. -// This is to make sure that plugins work over the widest range of AviSynth -// builds possible. -#define FRAME_ALIGN 64 - -#if defined(_M_AMD64) || defined(__x86_64) -# define X86_64 -#elif defined(_M_IX86) || defined(__i386__) -# define X86_32 -#else -# error Unsupported CPU architecture. -#endif - -#if defined(_MSC_VER) -# define MSVC -#elif defined(__GNUC__) -# define GCC -#elif defined(__clang__) -# define CLANG -#else -# error Unsupported compiler. -#endif - -#if defined(GCC) -# undef __forceinline -# define __forceinline inline -#endif - -#endif //AVS_CONFIG_H +// Avisynth C Interface Version 0.20 +// Copyright 2003 Kevin Atkinson + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit +// http://www.gnu.org/copyleft/gpl.html . +// +// As a special exception, I give you permission to link to the +// Avisynth C interface with independent modules that communicate with +// the Avisynth C interface solely through the interfaces defined in +// avisynth_c.h, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting combined work +// under terms of your choice, provided that every copy of the +// combined work is accompanied by a complete copy of the source code +// of the Avisynth C interface and Avisynth itself (with the version +// used to produce the combined work), being distributed under the +// terms of the GNU General Public License plus this exception. An +// independent module is a module which is not derived from or based +// on Avisynth C Interface, such as 3rd-party filters, import and +// export plugins, or graphical user interfaces. + +#ifndef AVS_CONFIG_H +#define AVS_CONFIG_H + +// Undefine this to get cdecl calling convention +#define AVSC_USE_STDCALL 1 + +// NOTE TO PLUGIN AUTHORS: +// Because FRAME_ALIGN can be substantially higher than the alignment +// a plugin actually needs, plugins should not use FRAME_ALIGN to check for +// alignment. They should always request the exact alignment value they need. +// This is to make sure that plugins work over the widest range of AviSynth +// builds possible. +#define FRAME_ALIGN 64 + +#if defined(_M_AMD64) || defined(__x86_64) +# define X86_64 +#elif defined(_M_IX86) || defined(__i386__) +# define X86_32 +#else +# error Unsupported CPU architecture. +#endif + +#if defined(_MSC_VER) +# define MSVC +#elif defined(__GNUC__) +# define GCC +#elif defined(__clang__) +# define CLANG +#else +# error Unsupported compiler. +#endif + +#if defined(GCC) +# undef __forceinline +# define __forceinline inline +#endif + +#endif //AVS_CONFIG_H diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/cpuid.h b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/cpuid.h index 8559395cdc..b6354442fd 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/cpuid.h +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/cpuid.h @@ -1,80 +1,80 @@ -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// Linking Avisynth statically or dynamically with other modules is making a -// combined work based on Avisynth. Thus, the terms and conditions of the GNU -// General Public License cover the whole combination. -// -// As a special exception, the copyright holders of Avisynth give you -// permission to link Avisynth with independent modules that communicate with -// Avisynth solely through the interfaces defined in avisynth.h, regardless of the license -// terms of these independent modules, and to copy and distribute the -// resulting combined work under terms of your choice, provided that -// every copy of the combined work is accompanied by a complete copy of -// the source code of Avisynth (the version of Avisynth used to produce the -// combined work), being distributed under the terms of the GNU General -// Public License plus this exception. An independent module is a module -// which is not derived from or based on Avisynth, such as 3rd-party filters, -// import and export plugins, or graphical user interfaces. - -#ifndef AVSCORE_CPUID_H -#define AVSCORE_CPUID_H - -// For GetCPUFlags. These are backwards-compatible with those in VirtualDub. -// ending with SSE4_2 -// For emulation see https://software.intel.com/en-us/articles/intel-software-development-emulator -enum { - /* oldest CPU to support extension */ - CPUF_FORCE = 0x01, // N/A - CPUF_FPU = 0x02, // 386/486DX - CPUF_MMX = 0x04, // P55C, K6, PII - CPUF_INTEGER_SSE = 0x08, // PIII, Athlon - CPUF_SSE = 0x10, // PIII, Athlon XP/MP - CPUF_SSE2 = 0x20, // PIV, K8 - CPUF_3DNOW = 0x40, // K6-2 - CPUF_3DNOW_EXT = 0x80, // Athlon - CPUF_X86_64 = 0xA0, // Hammer (note: equiv. to 3DNow + SSE2, which - // only Hammer will have anyway) - CPUF_SSE3 = 0x100, // PIV+, K8 Venice - CPUF_SSSE3 = 0x200, // Core 2 - CPUF_SSE4 = 0x400, - CPUF_SSE4_1 = 0x400, // Penryn, Wolfdale, Yorkfield - CPUF_AVX = 0x800, // Sandy Bridge, Bulldozer - CPUF_SSE4_2 = 0x1000, // Nehalem - // AVS+ - CPUF_AVX2 = 0x2000, // Haswell - CPUF_FMA3 = 0x4000, - CPUF_F16C = 0x8000, - CPUF_MOVBE = 0x10000, // Big Endian move - CPUF_POPCNT = 0x20000, - CPUF_AES = 0x40000, - CPUF_FMA4 = 0x80000, - - CPUF_AVX512F = 0x100000, // AVX-512 Foundation. - CPUF_AVX512DQ = 0x200000, // AVX-512 DQ (Double/Quad granular) Instructions - CPUF_AVX512PF = 0x400000, // AVX-512 Prefetch - CPUF_AVX512ER = 0x800000, // AVX-512 Exponential and Reciprocal - CPUF_AVX512CD = 0x1000000, // AVX-512 Conflict Detection - CPUF_AVX512BW = 0x2000000, // AVX-512 BW (Byte/Word granular) Instructions - CPUF_AVX512VL = 0x4000000, // AVX-512 VL (128/256 Vector Length) Extensions - CPUF_AVX512IFMA = 0x8000000, // AVX-512 IFMA integer 52 bit - CPUF_AVX512VBMI = 0x10000000,// AVX-512 VBMI -}; - -#ifdef BUILDING_AVSCORE -int GetCPUFlags(); -#endif - -#endif // AVSCORE_CPUID_H +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit +// http://www.gnu.org/copyleft/gpl.html . +// +// Linking Avisynth statically or dynamically with other modules is making a +// combined work based on Avisynth. Thus, the terms and conditions of the GNU +// General Public License cover the whole combination. +// +// As a special exception, the copyright holders of Avisynth give you +// permission to link Avisynth with independent modules that communicate with +// Avisynth solely through the interfaces defined in avisynth.h, regardless of the license +// terms of these independent modules, and to copy and distribute the +// resulting combined work under terms of your choice, provided that +// every copy of the combined work is accompanied by a complete copy of +// the source code of Avisynth (the version of Avisynth used to produce the +// combined work), being distributed under the terms of the GNU General +// Public License plus this exception. An independent module is a module +// which is not derived from or based on Avisynth, such as 3rd-party filters, +// import and export plugins, or graphical user interfaces. + +#ifndef AVSCORE_CPUID_H +#define AVSCORE_CPUID_H + +// For GetCPUFlags. These are backwards-compatible with those in VirtualDub. +// ending with SSE4_2 +// For emulation see https://software.intel.com/en-us/articles/intel-software-development-emulator +enum { + /* oldest CPU to support extension */ + CPUF_FORCE = 0x01, // N/A + CPUF_FPU = 0x02, // 386/486DX + CPUF_MMX = 0x04, // P55C, K6, PII + CPUF_INTEGER_SSE = 0x08, // PIII, Athlon + CPUF_SSE = 0x10, // PIII, Athlon XP/MP + CPUF_SSE2 = 0x20, // PIV, K8 + CPUF_3DNOW = 0x40, // K6-2 + CPUF_3DNOW_EXT = 0x80, // Athlon + CPUF_X86_64 = 0xA0, // Hammer (note: equiv. to 3DNow + SSE2, which + // only Hammer will have anyway) + CPUF_SSE3 = 0x100, // PIV+, K8 Venice + CPUF_SSSE3 = 0x200, // Core 2 + CPUF_SSE4 = 0x400, + CPUF_SSE4_1 = 0x400, // Penryn, Wolfdale, Yorkfield + CPUF_AVX = 0x800, // Sandy Bridge, Bulldozer + CPUF_SSE4_2 = 0x1000, // Nehalem + // AVS+ + CPUF_AVX2 = 0x2000, // Haswell + CPUF_FMA3 = 0x4000, + CPUF_F16C = 0x8000, + CPUF_MOVBE = 0x10000, // Big Endian move + CPUF_POPCNT = 0x20000, + CPUF_AES = 0x40000, + CPUF_FMA4 = 0x80000, + + CPUF_AVX512F = 0x100000, // AVX-512 Foundation. + CPUF_AVX512DQ = 0x200000, // AVX-512 DQ (Double/Quad granular) Instructions + CPUF_AVX512PF = 0x400000, // AVX-512 Prefetch + CPUF_AVX512ER = 0x800000, // AVX-512 Exponential and Reciprocal + CPUF_AVX512CD = 0x1000000, // AVX-512 Conflict Detection + CPUF_AVX512BW = 0x2000000, // AVX-512 BW (Byte/Word granular) Instructions + CPUF_AVX512VL = 0x4000000, // AVX-512 VL (128/256 Vector Length) Extensions + CPUF_AVX512IFMA = 0x8000000, // AVX-512 IFMA integer 52 bit + CPUF_AVX512VBMI = 0x10000000,// AVX-512 VBMI +}; + +#ifdef BUILDING_AVSCORE +int GetCPUFlags(); +#endif + +#endif // AVSCORE_CPUID_H diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/minmax.h b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/minmax.h index ceeebebd19..521ea582c6 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/minmax.h +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/minmax.h @@ -1,54 +1,54 @@ -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// Linking Avisynth statically or dynamically with other modules is making a -// combined work based on Avisynth. Thus, the terms and conditions of the GNU -// General Public License cover the whole combination. -// -// As a special exception, the copyright holders of Avisynth give you -// permission to link Avisynth with independent modules that communicate with -// Avisynth solely through the interfaces defined in avisynth.h, regardless of the license -// terms of these independent modules, and to copy and distribute the -// resulting combined work under terms of your choice, provided that -// every copy of the combined work is accompanied by a complete copy of -// the source code of Avisynth (the version of Avisynth used to produce the -// combined work), being distributed under the terms of the GNU General -// Public License plus this exception. An independent module is a module -// which is not derived from or based on Avisynth, such as 3rd-party filters, -// import and export plugins, or graphical user interfaces. - -#ifndef AVSCORE_MINMAX_H -#define AVSCORE_MINMAX_H - -template -T min(T v1, T v2) -{ - return v1 < v2 ? v1 : v2; -} - -template -T max(T v1, T v2) -{ - return v1 > v2 ? v1 : v2; -} - -template -T clamp(T n, T min, T max) -{ - n = n > max ? max : n; - return n < min ? min : n; -} - -#endif // AVSCORE_MINMAX_H +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit +// http://www.gnu.org/copyleft/gpl.html . +// +// Linking Avisynth statically or dynamically with other modules is making a +// combined work based on Avisynth. Thus, the terms and conditions of the GNU +// General Public License cover the whole combination. +// +// As a special exception, the copyright holders of Avisynth give you +// permission to link Avisynth with independent modules that communicate with +// Avisynth solely through the interfaces defined in avisynth.h, regardless of the license +// terms of these independent modules, and to copy and distribute the +// resulting combined work under terms of your choice, provided that +// every copy of the combined work is accompanied by a complete copy of +// the source code of Avisynth (the version of Avisynth used to produce the +// combined work), being distributed under the terms of the GNU General +// Public License plus this exception. An independent module is a module +// which is not derived from or based on Avisynth, such as 3rd-party filters, +// import and export plugins, or graphical user interfaces. + +#ifndef AVSCORE_MINMAX_H +#define AVSCORE_MINMAX_H + +template +T min(T v1, T v2) +{ + return v1 < v2 ? v1 : v2; +} + +template +T max(T v1, T v2) +{ + return v1 > v2 ? v1 : v2; +} + +template +T clamp(T n, T min, T max) +{ + n = n > max ? max : n; + return n < min ? min : n; +} + +#endif // AVSCORE_MINMAX_H diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/types.h b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/types.h index cdb387e0d9..df15f1d8e5 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/types.h +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/types.h @@ -1,57 +1,57 @@ -// Avisynth C Interface Version 0.20 -// Copyright 2003 Kevin Atkinson - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// As a special exception, I give you permission to link to the -// Avisynth C interface with independent modules that communicate with -// the Avisynth C interface solely through the interfaces defined in -// avisynth_c.h, regardless of the license terms of these independent -// modules, and to copy and distribute the resulting combined work -// under terms of your choice, provided that every copy of the -// combined work is accompanied by a complete copy of the source code -// of the Avisynth C interface and Avisynth itself (with the version -// used to produce the combined work), being distributed under the -// terms of the GNU General Public License plus this exception. An -// independent module is a module which is not derived from or based -// on Avisynth C Interface, such as 3rd-party filters, import and -// export plugins, or graphical user interfaces. - -#ifndef AVS_TYPES_H -#define AVS_TYPES_H - -// Define all types necessary for interfacing with avisynth.dll - -#ifdef __cplusplus - #include -#else - #include -#endif - -// Raster types used by VirtualDub & Avisynth -typedef unsigned int Pixel32; -typedef unsigned char BYTE; - -// Audio Sample information -typedef float SFLOAT; - -#ifdef __GNUC__ -typedef long long int INT64; -#else -typedef __int64 INT64; -#endif - -#endif //AVS_TYPES_H +// Avisynth C Interface Version 0.20 +// Copyright 2003 Kevin Atkinson + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit +// http://www.gnu.org/copyleft/gpl.html . +// +// As a special exception, I give you permission to link to the +// Avisynth C interface with independent modules that communicate with +// the Avisynth C interface solely through the interfaces defined in +// avisynth_c.h, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting combined work +// under terms of your choice, provided that every copy of the +// combined work is accompanied by a complete copy of the source code +// of the Avisynth C interface and Avisynth itself (with the version +// used to produce the combined work), being distributed under the +// terms of the GNU General Public License plus this exception. An +// independent module is a module which is not derived from or based +// on Avisynth C Interface, such as 3rd-party filters, import and +// export plugins, or graphical user interfaces. + +#ifndef AVS_TYPES_H +#define AVS_TYPES_H + +// Define all types necessary for interfacing with avisynth.dll + +#ifdef __cplusplus + #include +#else + #include +#endif + +// Raster types used by VirtualDub & Avisynth +typedef unsigned int Pixel32; +typedef unsigned char BYTE; + +// Audio Sample information +typedef float SFLOAT; + +#ifdef __GNUC__ +typedef long long int INT64; +#else +typedef __int64 INT64; +#endif + +#endif //AVS_TYPES_H diff --git a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/win.h b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/win.h index 7804eafc41..6692021e6d 100755 --- a/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/win.h +++ b/avidemux_plugins/ADM_demuxers/NativeAvisynth/avs/win.h @@ -1,54 +1,54 @@ -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// Linking Avisynth statically or dynamically with other modules is making a -// combined work based on Avisynth. Thus, the terms and conditions of the GNU -// General Public License cover the whole combination. -// -// As a special exception, the copyright holders of Avisynth give you -// permission to link Avisynth with independent modules that communicate with -// Avisynth solely through the interfaces defined in avisynth.h, regardless of the license -// terms of these independent modules, and to copy and distribute the -// resulting combined work under terms of your choice, provided that -// every copy of the combined work is accompanied by a complete copy of -// the source code of Avisynth (the version of Avisynth used to produce the -// combined work), being distributed under the terms of the GNU General -// Public License plus this exception. An independent module is a module -// which is not derived from or based on Avisynth, such as 3rd-party filters, -// import and export plugins, or graphical user interfaces. - -#ifndef AVSCORE_WIN_H -#define AVSCORE_WIN_H - -// Whenever you need windows headers, start by including this file, then the rest. - -// WWUUT? We require XP now? -#if !defined(NTDDI_VERSION) && !defined(_WIN32_WINNT) - #define NTDDI_VERSION 0x05020000 - #define _WIN32_WINNT 0x0502 -#endif - -#define WIN32_LEAN_AND_MEAN -#define STRICT -#if !defined(NOMINMAX) - #define NOMINMAX -#endif - -#include - -// Provision for UTF-8 max 4 bytes per code point -#define AVS_MAX_PATH MAX_PATH*4 - -#endif // AVSCORE_WIN_H +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit +// http://www.gnu.org/copyleft/gpl.html . +// +// Linking Avisynth statically or dynamically with other modules is making a +// combined work based on Avisynth. Thus, the terms and conditions of the GNU +// General Public License cover the whole combination. +// +// As a special exception, the copyright holders of Avisynth give you +// permission to link Avisynth with independent modules that communicate with +// Avisynth solely through the interfaces defined in avisynth.h, regardless of the license +// terms of these independent modules, and to copy and distribute the +// resulting combined work under terms of your choice, provided that +// every copy of the combined work is accompanied by a complete copy of +// the source code of Avisynth (the version of Avisynth used to produce the +// combined work), being distributed under the terms of the GNU General +// Public License plus this exception. An independent module is a module +// which is not derived from or based on Avisynth, such as 3rd-party filters, +// import and export plugins, or graphical user interfaces. + +#ifndef AVSCORE_WIN_H +#define AVSCORE_WIN_H + +// Whenever you need windows headers, start by including this file, then the rest. + +// WWUUT? We require XP now? +#if !defined(NTDDI_VERSION) && !defined(_WIN32_WINNT) + #define NTDDI_VERSION 0x05020000 + #define _WIN32_WINNT 0x0502 +#endif + +#define WIN32_LEAN_AND_MEAN +#define STRICT +#if !defined(NOMINMAX) + #define NOMINMAX +#endif + +#include + +// Provision for UTF-8 max 4 bytes per code point +#define AVS_MAX_PATH MAX_PATH*4 + +#endif // AVSCORE_WIN_H diff --git a/avidemux_plugins/ADM_demuxers/VapourSynth/qt4/CMakeLists.txt b/avidemux_plugins/ADM_demuxers/VapourSynth/qt4/CMakeLists.txt index 81a8ad1dd6..47ee1f08c7 100644 --- a/avidemux_plugins/ADM_demuxers/VapourSynth/qt4/CMakeLists.txt +++ b/avidemux_plugins/ADM_demuxers/VapourSynth/qt4/CMakeLists.txt @@ -1,76 +1,76 @@ -########################################## -# Config -########################################## -IF(ENABLE_QT6) - ADD_DEFINITIONS("-std=c++17") -ELSE(ENABLE_QT6) - IF(NOT MSVC) - ADD_DEFINITIONS("-std=c++11") - ENDIF(NOT MSVC) -ENDIF(ENABLE_QT6) -ADD_DEFINITIONS(${VAPOURSYNTHSCRIPT_CFLAGS}) -# -IF(MSVC) - ADD_DEFINITIONS("-DNO_WINSOCK2") # else double include on windows -ENDIF(MSVC) -# -ADD_DEFINITIONS(-DADM_UI_TYPE_BUILD=ADM_UI_QT4) -SET(CONFIG_HEADER_TYPE ADM_BUILD_QT4) -SET(UI_SUFFIX qt4) -include_directories(./ ${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE(admWindRes) -########################################### -# Executable -########################################### -# -SET(UI vs.ui ) -SET(srcs vsProxy_qt4.h) -#ADM_QT_ADD_RESOURCES(resource jobs.rsc) -ADM_QT_WRAP_UI(VS_PROXY_headers ${UI}) -ADM_QT_WRAP_CPP(VS_PROXY_source ${srcs} vsProxy_qt4.h ) -SET(ADM_vsPROXY_SRCS - ${srcs} - ../ADM_vsProxy.cpp - ../ADM_vsProxy.h - #${resource} - ${VS_PROXY_headers} - ${VS_PROXY_source} - vsProxy_qt4.cpp - ) - - -########################################### -# Executable -########################################### -ADD_EXECUTABLE(vsProxy_gui_${QT_EXTENSION} ${ADM_vsPROXY_SRCS}) -# -GET_PROPERTY(OLD - TARGET vsProxy_gui_${QT_EXTENSION} - PROPERTY LINK_FLAGS) -IF("${OLD}" MATCHES ".*NOT.*FOUND") - SET(OLD "") -ENDIF("${OLD}" MATCHES ".*NOT.*FOUND") -# Keep -L, discard everything else - - -SET_TARGET_PROPERTIES(vsProxy_gui_${QT_EXTENSION} PROPERTIES LINK_FLAGS "${OLD}") - -########################################### -TARGET_LINK_LIBRARIES(vsProxy_gui_${QT_EXTENSION} ADM_core6 ADM_coreSocket6 ADM_coreUtils6) -TARGET_LINK_LIBRARIES(vsProxy_gui_${QT_EXTENSION} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY}) -TARGET_LINK_LIBRARIES(vsProxy_gui_${QT_EXTENSION} ${LIBS_TO_LINK} ) - -include(admCheckThreads) -ADM_LINK_THREAD(vsProxy_gui_${QT_EXTENSION}) - -IF (MINGW) - target_link_libraries(vsProxy_gui_${QT_EXTENSION} -lwsock32 winmm -mwindows ) - target_link_libraries(vsProxy_gui_${QT_EXTENSION} ${LIBS_TO_LINK} "-lm -lstdc++") -ENDIF (MINGW) -IF(MSVC) - set_target_properties(vsProxy_gui_${QT_EXTENSION} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS") - set_target_properties(vsProxy_gui_${QT_EXTENSION} PROPERTIES WIN32_EXECUTABLE True) - TARGET_LINK_LIBRARIES(vsProxy_gui_${QT_EXTENSION} ws2_32.lib winmm -mwindows ) -ENDIF(MSVC) -TARGET_LINK_LIBRARIES(vsProxy_gui_${QT_EXTENSION} "${VS_SYSTEM_LIBS}") -ADM_INSTALL_BIN(vsProxy_gui_${QT_EXTENSION}) +########################################## +# Config +########################################## +IF(ENABLE_QT6) + ADD_DEFINITIONS("-std=c++17") +ELSE(ENABLE_QT6) + IF(NOT MSVC) + ADD_DEFINITIONS("-std=c++11") + ENDIF(NOT MSVC) +ENDIF(ENABLE_QT6) +ADD_DEFINITIONS(${VAPOURSYNTHSCRIPT_CFLAGS}) +# +IF(MSVC) + ADD_DEFINITIONS("-DNO_WINSOCK2") # else double include on windows +ENDIF(MSVC) +# +ADD_DEFINITIONS(-DADM_UI_TYPE_BUILD=ADM_UI_QT4) +SET(CONFIG_HEADER_TYPE ADM_BUILD_QT4) +SET(UI_SUFFIX qt4) +include_directories(./ ${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}) +INCLUDE(admWindRes) +########################################### +# Executable +########################################### +# +SET(UI vs.ui ) +SET(srcs vsProxy_qt4.h) +#ADM_QT_ADD_RESOURCES(resource jobs.rsc) +ADM_QT_WRAP_UI(VS_PROXY_headers ${UI}) +ADM_QT_WRAP_CPP(VS_PROXY_source ${srcs} vsProxy_qt4.h ) +SET(ADM_vsPROXY_SRCS + ${srcs} + ../ADM_vsProxy.cpp + ../ADM_vsProxy.h + #${resource} + ${VS_PROXY_headers} + ${VS_PROXY_source} + vsProxy_qt4.cpp + ) + + +########################################### +# Executable +########################################### +ADD_EXECUTABLE(vsProxy_gui_${QT_EXTENSION} ${ADM_vsPROXY_SRCS}) +# +GET_PROPERTY(OLD + TARGET vsProxy_gui_${QT_EXTENSION} + PROPERTY LINK_FLAGS) +IF("${OLD}" MATCHES ".*NOT.*FOUND") + SET(OLD "") +ENDIF("${OLD}" MATCHES ".*NOT.*FOUND") +# Keep -L, discard everything else + + +SET_TARGET_PROPERTIES(vsProxy_gui_${QT_EXTENSION} PROPERTIES LINK_FLAGS "${OLD}") + +########################################### +TARGET_LINK_LIBRARIES(vsProxy_gui_${QT_EXTENSION} ADM_core6 ADM_coreSocket6 ADM_coreUtils6) +TARGET_LINK_LIBRARIES(vsProxy_gui_${QT_EXTENSION} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY}) +TARGET_LINK_LIBRARIES(vsProxy_gui_${QT_EXTENSION} ${LIBS_TO_LINK} ) + +include(admCheckThreads) +ADM_LINK_THREAD(vsProxy_gui_${QT_EXTENSION}) + +IF (MINGW) + target_link_libraries(vsProxy_gui_${QT_EXTENSION} -lwsock32 winmm -mwindows ) + target_link_libraries(vsProxy_gui_${QT_EXTENSION} ${LIBS_TO_LINK} "-lm -lstdc++") +ENDIF (MINGW) +IF(MSVC) + set_target_properties(vsProxy_gui_${QT_EXTENSION} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS") + set_target_properties(vsProxy_gui_${QT_EXTENSION} PROPERTIES WIN32_EXECUTABLE True) + TARGET_LINK_LIBRARIES(vsProxy_gui_${QT_EXTENSION} ws2_32.lib winmm -mwindows ) +ENDIF(MSVC) +TARGET_LINK_LIBRARIES(vsProxy_gui_${QT_EXTENSION} "${VS_SYSTEM_LIBS}") +ADM_INSTALL_BIN(vsProxy_gui_${QT_EXTENSION}) diff --git a/avidemux_plugins/ADM_muxers/muxerMplex/CMakeLists.txt b/avidemux_plugins/ADM_muxers/muxerMplex/CMakeLists.txt index 912ce548b7..fdfd54a585 100644 --- a/avidemux_plugins/ADM_muxers/muxerMplex/CMakeLists.txt +++ b/avidemux_plugins/ADM_muxers/muxerMplex/CMakeLists.txt @@ -1,33 +1,33 @@ -include(mx_plugin) -SET(ADM_LIB ADM_mx_mplex) - -SET(${ADM_LIB}_SRCS - ADM_mplexMuxer.cpp - ADM_mplexInput.cpp - ADM_mplexOutput.cpp - ac3strm_in.cpp - audiostrm_out.cpp dtsstrm_in.cpp lpcmstrm_in.cpp multiplexor.cpp stream_params.cpp videostrm_in.cpp - ADM_mthread.cpp bits.cpp inputstrm.cpp padstrm.cpp systems.cpp videostrm_out.cpp - ADM_transfert.cpp interact.cpp mpastrm_in.cpp stillsstream.cpp mpegconsts.c mjpeg_logging.c decodebufmodel.cpp - yuv4mpeg.c cpu_accel.c) - -include_directories("${PTHREAD_INCLUDE_DIR}") -ADD_MUXER(${ADM_LIB} ${${ADM_LIB}_SRCS}) -ADD_DEFINITIONS(${ADM_LIB} "-I${CMAKE_CURRENT_SOURCE_DIR} -DHAVE_FMAX -DRETSIGTYPE=void") - -IF (NOT APPLE) - ADD_DEFINITIONS(${ADM_LIB} "-DHAVE_MEMALIGN") -ENDIF (NOT APPLE) - -IF (ADM_CPU_X86) - ADD_DEFINITIONS(${ADM_LIB} "-DHAVE_X86CPU") - - IF (ADM_CPU_X86_64) - ADD_DEFINITIONS(${ADM_LIB} "-DHAVE_X86_64CPU") - ENDIF (ADM_CPU_X86_64) -ELSEIF (ADM_CPU_ALTIVEC) - ADD_DEFINITIONS(${ADM_LIB} "-DHAVE_ALTIVEC") -ENDIF (ADM_CPU_X86) - -INIT_MUXER(${ADM_LIB}) -INSTALL_MUXER(${ADM_LIB}) +include(mx_plugin) +SET(ADM_LIB ADM_mx_mplex) + +SET(${ADM_LIB}_SRCS + ADM_mplexMuxer.cpp + ADM_mplexInput.cpp + ADM_mplexOutput.cpp + ac3strm_in.cpp + audiostrm_out.cpp dtsstrm_in.cpp lpcmstrm_in.cpp multiplexor.cpp stream_params.cpp videostrm_in.cpp + ADM_mthread.cpp bits.cpp inputstrm.cpp padstrm.cpp systems.cpp videostrm_out.cpp + ADM_transfert.cpp interact.cpp mpastrm_in.cpp stillsstream.cpp mpegconsts.c mjpeg_logging.c decodebufmodel.cpp + yuv4mpeg.c cpu_accel.c) + +include_directories("${PTHREAD_INCLUDE_DIR}") +ADD_MUXER(${ADM_LIB} ${${ADM_LIB}_SRCS}) +ADD_DEFINITIONS(${ADM_LIB} "-I${CMAKE_CURRENT_SOURCE_DIR} -DHAVE_FMAX -DRETSIGTYPE=void") + +IF (NOT APPLE) + ADD_DEFINITIONS(${ADM_LIB} "-DHAVE_MEMALIGN") +ENDIF (NOT APPLE) + +IF (ADM_CPU_X86) + ADD_DEFINITIONS(${ADM_LIB} "-DHAVE_X86CPU") + + IF (ADM_CPU_X86_64) + ADD_DEFINITIONS(${ADM_LIB} "-DHAVE_X86_64CPU") + ENDIF (ADM_CPU_X86_64) +ELSEIF (ADM_CPU_ALTIVEC) + ADD_DEFINITIONS(${ADM_LIB} "-DHAVE_ALTIVEC") +ENDIF (ADM_CPU_X86) + +INIT_MUXER(${ADM_LIB}) +INSTALL_MUXER(${ADM_LIB}) diff --git a/avidemux_plugins/ADM_scriptEngines/qtScript/src/exampleScript/Dialog.admjs b/avidemux_plugins/ADM_scriptEngines/qtScript/src/exampleScript/Dialog.admjs index b69ab0f6f2..a91a755067 100644 --- a/avidemux_plugins/ADM_scriptEngines/qtScript/src/exampleScript/Dialog.admjs +++ b/avidemux_plugins/ADM_scriptEngines/qtScript/src/exampleScript/Dialog.admjs @@ -1,29 +1,29 @@ -var dialog = new Dialog("Test Window"); -var checkBox = new CheckBoxControl("Test CheckBox", true); -var spinBox = new SpinBoxControl("Test SpinBox:", 0, 100, 43); -var doubleSpinBox = new DoubleSpinBoxControl("Test DoubleSpinBox:", 0, 100, 48.3); -var lineEdit = new LineEditControl("Test LineEdit:", "text"); -var slider = new SliderControl("Test Slider:", 0, 100, 13, 5); -var comboBox = new ComboBoxControl("Test ComboBox:"); - -comboBox.items.add("item 1", "value 1"); -comboBox.items.add(new ComboBoxItem("item 2", "value 2")); -comboBox.selectedItemIndex = 1; - -dialog.controls.add(checkBox); -dialog.controls.add(spinBox); -dialog.controls.add(doubleSpinBox); -dialog.controls.add(lineEdit); -dialog.controls.add(slider); -dialog.controls.add(comboBox); - -print("Dialog Result: " + dialog.show()); - -print("CheckBox - Value: " + checkBox.checked); -print("SpinBox - Value: " + spinBox.value); -print("DoubleSpinBox - Value: " + doubleSpinBox.value); -print("LineEdit - Value: " + lineEdit.value); -print("Slider - Value: " + slider.value); -print("ComboBox - Selected Index: " + comboBox.selectedItemIndex); -print("ComboBox - Selected Item Title: " + comboBox.selectedItem.title); +var dialog = new Dialog("Test Window"); +var checkBox = new CheckBoxControl("Test CheckBox", true); +var spinBox = new SpinBoxControl("Test SpinBox:", 0, 100, 43); +var doubleSpinBox = new DoubleSpinBoxControl("Test DoubleSpinBox:", 0, 100, 48.3); +var lineEdit = new LineEditControl("Test LineEdit:", "text"); +var slider = new SliderControl("Test Slider:", 0, 100, 13, 5); +var comboBox = new ComboBoxControl("Test ComboBox:"); + +comboBox.items.add("item 1", "value 1"); +comboBox.items.add(new ComboBoxItem("item 2", "value 2")); +comboBox.selectedItemIndex = 1; + +dialog.controls.add(checkBox); +dialog.controls.add(spinBox); +dialog.controls.add(doubleSpinBox); +dialog.controls.add(lineEdit); +dialog.controls.add(slider); +dialog.controls.add(comboBox); + +print("Dialog Result: " + dialog.show()); + +print("CheckBox - Value: " + checkBox.checked); +print("SpinBox - Value: " + spinBox.value); +print("DoubleSpinBox - Value: " + doubleSpinBox.value); +print("LineEdit - Value: " + lineEdit.value); +print("Slider - Value: " + slider.value); +print("ComboBox - Selected Index: " + comboBox.selectedItemIndex); +print("ComboBox - Selected Item Title: " + comboBox.selectedItem.title); print("ComboBox - Selected Item Value: " + comboBox.selectedItem.value); \ No newline at end of file diff --git a/avidemux_plugins/ADM_scriptEngines/qtScript/src/footer.html b/avidemux_plugins/ADM_scriptEngines/qtScript/src/footer.html index 8a8366e749..76a97a27fc 100644 --- a/avidemux_plugins/ADM_scriptEngines/qtScript/src/footer.html +++ b/avidemux_plugins/ADM_scriptEngines/qtScript/src/footer.html @@ -1,12 +1,12 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/avidemux_plugins/ADM_scriptEngines/qtScript/src/header.html b/avidemux_plugins/ADM_scriptEngines/qtScript/src/header.html index 7602507816..4e13050616 100644 --- a/avidemux_plugins/ADM_scriptEngines/qtScript/src/header.html +++ b/avidemux_plugins/ADM_scriptEngines/qtScript/src/header.html @@ -1,48 +1,48 @@ - - - - -$projectname: $title -$title - - -$treeview -$search -$mathjax - - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
-
$projectname -  $projectnumber -
-
$projectbrief
-
-
$projectbrief
-
$searchbox
-
- + + + + +$projectname: $title +$title + + +$treeview +$search +$mathjax + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
+
$projectname +  $projectnumber +
+
$projectbrief
+
+
$projectbrief
+
$searchbox
+
+ diff --git a/avidemux_plugins/ADM_scriptEngines/spiderMonkey/src/ADM_script_spiderMonkey.v b/avidemux_plugins/ADM_scriptEngines/spiderMonkey/src/ADM_script_spiderMonkey.v index 9f526b0c79..527ca6a72c 100644 --- a/avidemux_plugins/ADM_scriptEngines/spiderMonkey/src/ADM_script_spiderMonkey.v +++ b/avidemux_plugins/ADM_scriptEngines/spiderMonkey/src/ADM_script_spiderMonkey.v @@ -1,7 +1,7 @@ -ADM_coreScriptSpiderMoney -{ -global: - createEngine; -local: - *; -}; +ADM_coreScriptSpiderMoney +{ +global: + createEngine; +local: + *; +}; diff --git a/avidemux_plugins/ADM_scriptEngines/spiderMonkey/src/smjs/CMakeLists.txt b/avidemux_plugins/ADM_scriptEngines/spiderMonkey/src/smjs/CMakeLists.txt index 4bb41b10a5..92ca5d7685 100644 --- a/avidemux_plugins/ADM_scriptEngines/spiderMonkey/src/smjs/CMakeLists.txt +++ b/avidemux_plugins/ADM_scriptEngines/spiderMonkey/src/smjs/CMakeLists.txt @@ -1,23 +1,23 @@ -SET(ADM_LIB ADM_smjs6) - -SET(${ADM_LIB}_SRCS - jsapi.c jsatom.c jscntxt.c jsdbgapi.c jsemit.c jsfun.c jsinterp.c jslong.c jsobj.c jsprf.c jsscope.c - jsutil.c prmjtime.c - jsarena.c jsbool.c jsdhash.c jsexn.c jsgc.c jslock.c jsmath.c jsopcode.c jsregexp.c jsscript.c jsxdrapi.c - jsarray.c jsdate.c jsdtoa.c jsfile.c jshash.c jslog2.c jsnum.c jsparse.c jsscan.c jsstr.c jsxml.c - jsiter.c -) - -ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) - -IF (MINGW) - ADD_TARGET_CFLAGS(${ADM_LIB} "-DXP_WIN") -ELSE (MINGW) - ADD_TARGET_CFLAGS(${ADM_LIB} "-fPIC -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_VA_COPY -DVA_COPY=va_copy") -ENDIF (MINGW) - -ADD_TARGET_CFLAGS(${ADM_LIB} "-DNDEBUG -DTRIMMED -DEXPORT_JS_API -DJS_USE_SAFE_ARENA -D_IEEE_LIBM") -ADD_TARGET_CFLAGS(${ADM_LIB} "-Dfopen=ADM_fopen") -ADD_TARGET_CFLAGS(${ADM_LIB} "-DJS_C_STRINGS_ARE_UTF8") - -TARGET_LINK_LIBRARIES(${ADM_LIB} ADM_core6 m) +SET(ADM_LIB ADM_smjs6) + +SET(${ADM_LIB}_SRCS + jsapi.c jsatom.c jscntxt.c jsdbgapi.c jsemit.c jsfun.c jsinterp.c jslong.c jsobj.c jsprf.c jsscope.c + jsutil.c prmjtime.c + jsarena.c jsbool.c jsdhash.c jsexn.c jsgc.c jslock.c jsmath.c jsopcode.c jsregexp.c jsscript.c jsxdrapi.c + jsarray.c jsdate.c jsdtoa.c jsfile.c jshash.c jslog2.c jsnum.c jsparse.c jsscan.c jsstr.c jsxml.c + jsiter.c +) + +ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS}) + +IF (MINGW) + ADD_TARGET_CFLAGS(${ADM_LIB} "-DXP_WIN") +ELSE (MINGW) + ADD_TARGET_CFLAGS(${ADM_LIB} "-fPIC -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_VA_COPY -DVA_COPY=va_copy") +ENDIF (MINGW) + +ADD_TARGET_CFLAGS(${ADM_LIB} "-DNDEBUG -DTRIMMED -DEXPORT_JS_API -DJS_USE_SAFE_ARENA -D_IEEE_LIBM") +ADD_TARGET_CFLAGS(${ADM_LIB} "-Dfopen=ADM_fopen") +ADD_TARGET_CFLAGS(${ADM_LIB} "-DJS_C_STRINGS_ARE_UTF8") + +TARGET_LINK_LIBRARIES(${ADM_LIB} ADM_core6 m) diff --git a/avidemux_plugins/ADM_scriptEngines/spiderMonkey/src/src_dialogFactory/CMakeLists.txt b/avidemux_plugins/ADM_scriptEngines/spiderMonkey/src/src_dialogFactory/CMakeLists.txt index dc2e3926e4..b38dc85f69 100644 --- a/avidemux_plugins/ADM_scriptEngines/spiderMonkey/src/src_dialogFactory/CMakeLists.txt +++ b/avidemux_plugins/ADM_scriptEngines/spiderMonkey/src/src_dialogFactory/CMakeLists.txt @@ -1,23 +1,23 @@ -SET(ADM_scriptDF_SRCS - ADM_JSDFMenu.cpp - ADM_JSDFToggle.cpp - ADM_JSDFInteger.cpp - ADM_JSDialogFactory.cpp - ADM_JSDialogFactory_if.cpp - -) - -ADD_LIBRARY(ADM_scriptDF STATIC ${ADM_scriptDF_SRCS}) -include_directories(../../../ADM_coreScript/include) - -if (UNIX) - add_definitions("-fPIC") -endif (UNIX) - -if (USE_SYSTEM_SPIDERMONKEY) - include_directories(${SPIDERMONKEY_INCLUDE_DIR}) - target_link_libraries(ADM_scriptDF ${SPIDERMONKEY_LIBRARY_DIR}) -else (USE_SYSTEM_SPIDERMONKEY) - include_directories(../smjs) - target_link_libraries(ADM_scriptDF ADM_smjs6) +SET(ADM_scriptDF_SRCS + ADM_JSDFMenu.cpp + ADM_JSDFToggle.cpp + ADM_JSDFInteger.cpp + ADM_JSDialogFactory.cpp + ADM_JSDialogFactory_if.cpp + +) + +ADD_LIBRARY(ADM_scriptDF STATIC ${ADM_scriptDF_SRCS}) +include_directories(../../../ADM_coreScript/include) + +if (UNIX) + add_definitions("-fPIC") +endif (UNIX) + +if (USE_SYSTEM_SPIDERMONKEY) + include_directories(${SPIDERMONKEY_INCLUDE_DIR}) + target_link_libraries(ADM_scriptDF ${SPIDERMONKEY_LIBRARY_DIR}) +else (USE_SYSTEM_SPIDERMONKEY) + include_directories(../smjs) + target_link_libraries(ADM_scriptDF ADM_smjs6) endif (USE_SYSTEM_SPIDERMONKEY) \ No newline at end of file diff --git a/avidemux_plugins/ADM_scriptEngines/tinyPy/src/ADM_script_tinyPy.v b/avidemux_plugins/ADM_scriptEngines/tinyPy/src/ADM_script_tinyPy.v index 3610e88192..c079f976dc 100644 --- a/avidemux_plugins/ADM_scriptEngines/tinyPy/src/ADM_script_tinyPy.v +++ b/avidemux_plugins/ADM_scriptEngines/tinyPy/src/ADM_script_tinyPy.v @@ -1,7 +1,7 @@ -ADM_coreScriptPython -{ -global: - createEngine; -local: - *; -}; +ADM_coreScriptPython +{ +global: + createEngine; +local: + *; +}; diff --git a/avidemux_plugins/ADM_videoDecoder/CMakeLists.txt b/avidemux_plugins/ADM_videoDecoder/CMakeLists.txt index 7ce48d6c2f..56b226c007 100644 --- a/avidemux_plugins/ADM_videoDecoder/CMakeLists.txt +++ b/avidemux_plugins/ADM_videoDecoder/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_SUBDIRECTORY(aom) -#ADD_SUBDIRECTORY(vpx) +ADD_SUBDIRECTORY(aom) +#ADD_SUBDIRECTORY(vpx) diff --git a/avidemux_plugins/ADM_videoEncoder/CMakeLists.txt b/avidemux_plugins/ADM_videoEncoder/CMakeLists.txt index fe94d239cb..33d90ca000 100644 --- a/avidemux_plugins/ADM_videoEncoder/CMakeLists.txt +++ b/avidemux_plugins/ADM_videoEncoder/CMakeLists.txt @@ -1,35 +1,35 @@ -IF(DO_COMMON) - ADD_SUBDIRECTORY(av1aom) - ADD_SUBDIRECTORY(yv12) - #ADD_SUBDIRECTORY(png) - ADD_SUBDIRECTORY(jpeg) - ADD_SUBDIRECTORY(huff) - ADD_SUBDIRECTORY(ffv1) - ADD_SUBDIRECTORY(ffUtVideo) - IF(NOT MSVC) - ADD_SUBDIRECTORY(ffMpeg4) - ENDIF(NOT MSVC) - ADD_SUBDIRECTORY(ffMpeg2) -#ADD_SUBDIRECTORY(ffMsMpeg4) - ADD_SUBDIRECTORY(ffFlv1) - ADD_SUBDIRECTORY(ffDv) - ADD_SUBDIRECTORY(null) - ADD_SUBDIRECTORY(xvid4) - ADD_SUBDIRECTORY(vp9) - IF(USE_NVENC) - ADD_SUBDIRECTORY(ffNvEnc) -# ADD_SUBDIRECTORY(nvEnc) - ENDIF(USE_NVENC) - IF(USE_LIBVA) - ADD_SUBDIRECTORY(directVaEnc) - ADD_SUBDIRECTORY(ffVaH264) - ADD_SUBDIRECTORY(ffVaHEVC) - ADD_SUBDIRECTORY(ffVaAV1) - ENDIF(USE_LIBVA) - IF(USE_VIDEOTOOLBOX) - ADD_SUBDIRECTORY(ffVTEnc) - ENDIF(USE_VIDEOTOOLBOX) -ENDIF(DO_COMMON) -# That one has several UIs... -ADD_SUBDIRECTORY(x264) -ADD_SUBDIRECTORY(x265) +IF(DO_COMMON) + ADD_SUBDIRECTORY(av1aom) + ADD_SUBDIRECTORY(yv12) + #ADD_SUBDIRECTORY(png) + ADD_SUBDIRECTORY(jpeg) + ADD_SUBDIRECTORY(huff) + ADD_SUBDIRECTORY(ffv1) + ADD_SUBDIRECTORY(ffUtVideo) + IF(NOT MSVC) + ADD_SUBDIRECTORY(ffMpeg4) + ENDIF(NOT MSVC) + ADD_SUBDIRECTORY(ffMpeg2) +#ADD_SUBDIRECTORY(ffMsMpeg4) + ADD_SUBDIRECTORY(ffFlv1) + ADD_SUBDIRECTORY(ffDv) + ADD_SUBDIRECTORY(null) + ADD_SUBDIRECTORY(xvid4) + ADD_SUBDIRECTORY(vp9) + IF(USE_NVENC) + ADD_SUBDIRECTORY(ffNvEnc) +# ADD_SUBDIRECTORY(nvEnc) + ENDIF(USE_NVENC) + IF(USE_LIBVA) + ADD_SUBDIRECTORY(directVaEnc) + ADD_SUBDIRECTORY(ffVaH264) + ADD_SUBDIRECTORY(ffVaHEVC) + ADD_SUBDIRECTORY(ffVaAV1) + ENDIF(USE_LIBVA) + IF(USE_VIDEOTOOLBOX) + ADD_SUBDIRECTORY(ffVTEnc) + ENDIF(USE_VIDEOTOOLBOX) +ENDIF(DO_COMMON) +# That one has several UIs... +ADD_SUBDIRECTORY(x264) +ADD_SUBDIRECTORY(x265) diff --git a/avidemux_plugins/ADM_videoEncoder/ffv1/CMakeLists.txt b/avidemux_plugins/ADM_videoEncoder/ffv1/CMakeLists.txt index 2cffa76604..65680f8148 100644 --- a/avidemux_plugins/ADM_videoEncoder/ffv1/CMakeLists.txt +++ b/avidemux_plugins/ADM_videoEncoder/ffv1/CMakeLists.txt @@ -1,14 +1,14 @@ -INCLUDE(ve_plugin) - -SET(ffv1_SRCS - ffv1Plugin.cpp - ADM_ffv1Encoder.cpp -) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) - -ADD_VIDEO_ENCODER(ADM_ve_ffv1 ${ffv1_SRCS}) - -INIT_VIDEO_ENCODER(ADM_ve_ffv1) -INSTALL_VIDEO_ENCODER(ADM_ve_ffv1) -TARGET_LINK_LIBRARIES(ADM_ve_ffv1 ADM_libavcodec ADM_libavutil) -INCLUDE_DIRECTORIES("${AVIDEMUX_SOURCE_DIR}/avidemux/") +INCLUDE(ve_plugin) + +SET(ffv1_SRCS + ffv1Plugin.cpp + ADM_ffv1Encoder.cpp +) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + +ADD_VIDEO_ENCODER(ADM_ve_ffv1 ${ffv1_SRCS}) + +INIT_VIDEO_ENCODER(ADM_ve_ffv1) +INSTALL_VIDEO_ENCODER(ADM_ve_ffv1) +TARGET_LINK_LIBRARIES(ADM_ve_ffv1 ADM_libavcodec ADM_libavutil) +INCLUDE_DIRECTORIES("${AVIDEMUX_SOURCE_DIR}/avidemux/") diff --git a/avidemux_plugins/ADM_videoEncoder/huff/CMakeLists.txt b/avidemux_plugins/ADM_videoEncoder/huff/CMakeLists.txt index 37cae11c12..8b84330ec2 100644 --- a/avidemux_plugins/ADM_videoEncoder/huff/CMakeLists.txt +++ b/avidemux_plugins/ADM_videoEncoder/huff/CMakeLists.txt @@ -1,14 +1,14 @@ -INCLUDE(ve_plugin) - -SET(huff_SRCS - huffPlugin.cpp - ADM_huffEncoder.cpp -) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) - -ADD_VIDEO_ENCODER(ADM_ve_huff ${huff_SRCS}) - -INIT_VIDEO_ENCODER(ADM_ve_huff) -INSTALL_VIDEO_ENCODER(ADM_ve_huff) -TARGET_LINK_LIBRARIES(ADM_ve_huff ADM_libavcodec ADM_libavutil) -INCLUDE_DIRECTORIES("${AVIDEMUX_SOURCE_DIR}/avidemux/") +INCLUDE(ve_plugin) + +SET(huff_SRCS + huffPlugin.cpp + ADM_huffEncoder.cpp +) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + +ADD_VIDEO_ENCODER(ADM_ve_huff ${huff_SRCS}) + +INIT_VIDEO_ENCODER(ADM_ve_huff) +INSTALL_VIDEO_ENCODER(ADM_ve_huff) +TARGET_LINK_LIBRARIES(ADM_ve_huff ADM_libavcodec ADM_libavutil) +INCLUDE_DIRECTORIES("${AVIDEMUX_SOURCE_DIR}/avidemux/") diff --git a/avidemux_plugins/ADM_videoEncoder/jpeg/CMakeLists.txt b/avidemux_plugins/ADM_videoEncoder/jpeg/CMakeLists.txt index 1eb976c489..cd1fd66aea 100644 --- a/avidemux_plugins/ADM_videoEncoder/jpeg/CMakeLists.txt +++ b/avidemux_plugins/ADM_videoEncoder/jpeg/CMakeLists.txt @@ -1,14 +1,14 @@ -INCLUDE(ve_plugin) - -SET(jpeg_SRCS - jpegPlugin.cpp - ADM_jpegEncoder.cpp -) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) - -ADD_VIDEO_ENCODER(ADM_ve_jpeg ${jpeg_SRCS}) - -INIT_VIDEO_ENCODER(ADM_ve_jpeg) -INSTALL_VIDEO_ENCODER(ADM_ve_jpeg) -TARGET_LINK_LIBRARIES(ADM_ve_jpeg ADM_libavcodec ADM_libavutil) -INCLUDE_DIRECTORIES("${AVIDEMUX_SOURCE_DIR}/avidemux/") +INCLUDE(ve_plugin) + +SET(jpeg_SRCS + jpegPlugin.cpp + ADM_jpegEncoder.cpp +) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + +ADD_VIDEO_ENCODER(ADM_ve_jpeg ${jpeg_SRCS}) + +INIT_VIDEO_ENCODER(ADM_ve_jpeg) +INSTALL_VIDEO_ENCODER(ADM_ve_jpeg) +TARGET_LINK_LIBRARIES(ADM_ve_jpeg ADM_libavcodec ADM_libavutil) +INCLUDE_DIRECTORIES("${AVIDEMUX_SOURCE_DIR}/avidemux/") diff --git a/avidemux_plugins/ADM_videoEncoder/png/CMakeLists.txt b/avidemux_plugins/ADM_videoEncoder/png/CMakeLists.txt index c9fa3ae7ad..992bc9a157 100644 --- a/avidemux_plugins/ADM_videoEncoder/png/CMakeLists.txt +++ b/avidemux_plugins/ADM_videoEncoder/png/CMakeLists.txt @@ -1,12 +1,12 @@ -INCLUDE(ve_plugin) - -SET(png_SRCS - pngPlugin.cpp - ADM_pngEncoder.cpp -) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) - -ADD_VIDEO_ENCODER(ADM_ve_png ${png_SRCS}) -TARGET_LINK_LIBRARIES(ADM_ve_png ${PNG_LIBRARIES}) -INIT_VIDEO_ENCODER(ADM_ve_png) -INSTALL_VIDEO_ENCODER(ADM_ve_png) +INCLUDE(ve_plugin) + +SET(png_SRCS + pngPlugin.cpp + ADM_pngEncoder.cpp +) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + +ADD_VIDEO_ENCODER(ADM_ve_png ${png_SRCS}) +TARGET_LINK_LIBRARIES(ADM_ve_png ${PNG_LIBRARIES}) +INIT_VIDEO_ENCODER(ADM_ve_png) +INSTALL_VIDEO_ENCODER(ADM_ve_png) diff --git a/avidemux_plugins/ADM_videoEncoder/yv12/CMakeLists.txt b/avidemux_plugins/ADM_videoEncoder/yv12/CMakeLists.txt index 92b18963c7..32d08d6b50 100644 --- a/avidemux_plugins/ADM_videoEncoder/yv12/CMakeLists.txt +++ b/avidemux_plugins/ADM_videoEncoder/yv12/CMakeLists.txt @@ -1,12 +1,12 @@ -INCLUDE(ve_plugin) - -SET(YV12_SRCS - yv12Plugin.cpp - ADM_yv12Encoder.cpp -) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) - -ADD_VIDEO_ENCODER(ADM_ve_yv12 ${YV12_SRCS}) - -INIT_VIDEO_ENCODER(ADM_ve_yv12) -INSTALL_VIDEO_ENCODER(ADM_ve_yv12) +INCLUDE(ve_plugin) + +SET(YV12_SRCS + yv12Plugin.cpp + ADM_yv12Encoder.cpp +) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + +ADD_VIDEO_ENCODER(ADM_ve_yv12 ${YV12_SRCS}) + +INIT_VIDEO_ENCODER(ADM_ve_yv12) +INSTALL_VIDEO_ENCODER(ADM_ve_yv12) diff --git a/avidemux_plugins/ADM_videoFilters/CMakeLists.txt b/avidemux_plugins/ADM_videoFilters/CMakeLists.txt index a253c7fd15..5f762e95d7 100644 --- a/avidemux_plugins/ADM_videoFilters/CMakeLists.txt +++ b/avidemux_plugins/ADM_videoFilters/CMakeLists.txt @@ -1,58 +1,58 @@ -ADD_SUBDIRECTORY(AddBorders) -ADD_SUBDIRECTORY(BlendRemover) -ADD_SUBDIRECTORY(Chroma) -ADD_SUBDIRECTORY(Decimate) -ADD_SUBDIRECTORY(DgBob) -ADD_SUBDIRECTORY(Fade) -ADD_SUBDIRECTORY(FastConvolution) -ADD_SUBDIRECTORY(ForcedPP) -ADD_SUBDIRECTORY(LargeMedian) -ADD_SUBDIRECTORY(LumaOnly) -ADD_SUBDIRECTORY(McDeint) -ADD_SUBDIRECTORY(MplayerDenoise3D) -ADD_SUBDIRECTORY(ResampleFps) -ADD_SUBDIRECTORY(Reverse) -ADD_SUBDIRECTORY(SwapUV) -ADD_SUBDIRECTORY(Telecide) -ADD_SUBDIRECTORY(TemporalCleaner) -#ADD_SUBDIRECTORY(Unblend) -ADD_SUBDIRECTORY(VerticalFlip) -ADD_SUBDIRECTORY(Yadif) -ADD_SUBDIRECTORY(Pulldown) -ADD_SUBDIRECTORY(Denoise) -ADD_SUBDIRECTORY(Delta) -ADD_SUBDIRECTORY(DropOut) -ADD_SUBDIRECTORY(AvisynthResize) -ADD_SUBDIRECTORY(MplayerResize) -ADD_SUBDIRECTORY(BlackenBorders) -ADD_SUBDIRECTORY(KernelDeint) -ADD_SUBDIRECTORY(Deinterlace) -ADD_SUBDIRECTORY(KeepField) -ADD_SUBDIRECTORY(FluxSmooth) -ADD_SUBDIRECTORY(Stabilize) -ADD_SUBDIRECTORY(Mosaic) -ADD_SUBDIRECTORY(Whirl) -ADD_SUBDIRECTORY(PalShift) -ADD_SUBDIRECTORY(SwapField) -ADD_SUBDIRECTORY(MSharpen) -ADD_SUBDIRECTORY(MSmooth) -ADD_SUBDIRECTORY(Soften) -ADD_SUBDIRECTORY(lavDeinterlace) -# Dependancy toward codecs ADD_SUBDIRECTORY(Logo) -ADD_SUBDIRECTORY(ChromaShift) -ADD_SUBDIRECTORY(CNR2) -ADD_SUBDIRECTORY(colorYUV) -ADD_SUBDIRECTORY(Equalizer) -ADD_SUBDIRECTORY(MPDelogo) -ADD_SUBDIRECTORY(ASharp) -ADD_SUBDIRECTORY(Contrast) -ADD_SUBDIRECTORY(Eq2) -ADD_SUBDIRECTORY(Hue) -ADD_SUBDIRECTORY(Crop) -ADD_SUBDIRECTORY(Rotate) -ADD_SUBDIRECTORY(Tdeint) -ADD_SUBDIRECTORY(Srt) -ADD_SUBDIRECTORY(Ass) -# Dependancy toward codec & pics ADD_SUBDIRECTORY(Animated) -#ADD_SUBDIRECTORY(leakKernelDeint) -ADD_SUBDIRECTORY(TIsophote) +ADD_SUBDIRECTORY(AddBorders) +ADD_SUBDIRECTORY(BlendRemover) +ADD_SUBDIRECTORY(Chroma) +ADD_SUBDIRECTORY(Decimate) +ADD_SUBDIRECTORY(DgBob) +ADD_SUBDIRECTORY(Fade) +ADD_SUBDIRECTORY(FastConvolution) +ADD_SUBDIRECTORY(ForcedPP) +ADD_SUBDIRECTORY(LargeMedian) +ADD_SUBDIRECTORY(LumaOnly) +ADD_SUBDIRECTORY(McDeint) +ADD_SUBDIRECTORY(MplayerDenoise3D) +ADD_SUBDIRECTORY(ResampleFps) +ADD_SUBDIRECTORY(Reverse) +ADD_SUBDIRECTORY(SwapUV) +ADD_SUBDIRECTORY(Telecide) +ADD_SUBDIRECTORY(TemporalCleaner) +#ADD_SUBDIRECTORY(Unblend) +ADD_SUBDIRECTORY(VerticalFlip) +ADD_SUBDIRECTORY(Yadif) +ADD_SUBDIRECTORY(Pulldown) +ADD_SUBDIRECTORY(Denoise) +ADD_SUBDIRECTORY(Delta) +ADD_SUBDIRECTORY(DropOut) +ADD_SUBDIRECTORY(AvisynthResize) +ADD_SUBDIRECTORY(MplayerResize) +ADD_SUBDIRECTORY(BlackenBorders) +ADD_SUBDIRECTORY(KernelDeint) +ADD_SUBDIRECTORY(Deinterlace) +ADD_SUBDIRECTORY(KeepField) +ADD_SUBDIRECTORY(FluxSmooth) +ADD_SUBDIRECTORY(Stabilize) +ADD_SUBDIRECTORY(Mosaic) +ADD_SUBDIRECTORY(Whirl) +ADD_SUBDIRECTORY(PalShift) +ADD_SUBDIRECTORY(SwapField) +ADD_SUBDIRECTORY(MSharpen) +ADD_SUBDIRECTORY(MSmooth) +ADD_SUBDIRECTORY(Soften) +ADD_SUBDIRECTORY(lavDeinterlace) +# Dependancy toward codecs ADD_SUBDIRECTORY(Logo) +ADD_SUBDIRECTORY(ChromaShift) +ADD_SUBDIRECTORY(CNR2) +ADD_SUBDIRECTORY(colorYUV) +ADD_SUBDIRECTORY(Equalizer) +ADD_SUBDIRECTORY(MPDelogo) +ADD_SUBDIRECTORY(ASharp) +ADD_SUBDIRECTORY(Contrast) +ADD_SUBDIRECTORY(Eq2) +ADD_SUBDIRECTORY(Hue) +ADD_SUBDIRECTORY(Crop) +ADD_SUBDIRECTORY(Rotate) +ADD_SUBDIRECTORY(Tdeint) +ADD_SUBDIRECTORY(Srt) +ADD_SUBDIRECTORY(Ass) +# Dependancy toward codec & pics ADD_SUBDIRECTORY(Animated) +#ADD_SUBDIRECTORY(leakKernelDeint) +ADD_SUBDIRECTORY(TIsophote) diff --git a/avidemux_plugins/ADM_videoFilters/Srt/CMakeLists.txt b/avidemux_plugins/ADM_videoFilters/Srt/CMakeLists.txt index bc56707daf..0d4baab2c8 100644 --- a/avidemux_plugins/ADM_videoFilters/Srt/CMakeLists.txt +++ b/avidemux_plugins/ADM_videoFilters/Srt/CMakeLists.txt @@ -1,38 +1,38 @@ -INCLUDE(admCheckFreeType) -checkFreeType() - -IF(USE_FREETYPE) - INCLUDE(vf_plugin) - - SET(srtCommon_SRCS - ADM_vidFont.cpp ADM_vidSRT.cpp ADM_vidSRTload.cpp ADM_vidSRTRender.cpp DIA_srt.cpp DIA_flySrtPos.cpp - ) - - INCLUDE(vf_plugin_gtk) - INCLUDE(vf_plugin_qt4) - - SET(srtGtk_SRCS gtk/DIA_srt.cpp) - SET(srtQT_SRCS qt4/Q_srt.cpp) - SET(srtQT_HEADERS qt4/Q_srt.h) - SET(srtQT_UI qt4/srt) - - INIT_VIDEOFILTER_PLUGIN_QT4(ADM_vf_sub_qt4 - ${srtQT_SRCS} ${srtQT_HEADERS} ${srtQT_UI} ${srtCommon_SRCS}) - INIT_VIDEOFILTER_PLUGIN_GTK( ADM_vf_sub_gtk - ${srtGtk_SRCS} ${srtCommon_SRCS}) - - ADD_DEFINITIONS(${LIBICONV_DEFINITIONS}) - ADD_SOURCE_CFLAGS(DIA_srt.cpp "${FREETYPE2_CFLAGS}" ) - ADD_SOURCE_CFLAGS(ADM_vidSRT.cpp "${FREETYPE2_CFLAGS}" ) - ADD_SOURCE_CFLAGS(ADM_vidFont.cpp "${FREETYPE2_CFLAGS}" ) - ADD_SOURCE_CFLAGS(ADM_vidSRTload.cpp "${FREETYPE2_CFLAGS} -I${LIBICONV_INCLUDE_DIR} ") - ADD_SOURCE_CFLAGS(ADM_vidSRTRender.cpp "${FREETYPE2_CFLAGS}" ) - - IF (GTK_FOUND AND GTHREAD_FOUND) - target_link_libraries(ADM_vf_sub_gtk "${FREETYPE2_LDFLAGS} ${LIBICONV_LIBRARY_DIR}") - ENDIF (GTK_FOUND AND GTHREAD_FOUND) - - IF (QT4_FOUND) - target_link_libraries(ADM_vf_sub_qt4 "${FREETYPE2_LDFLAGS} ${LIBICONV_LIBRARY_DIR}") - ENDIF (QT4_FOUND) +INCLUDE(admCheckFreeType) +checkFreeType() + +IF(USE_FREETYPE) + INCLUDE(vf_plugin) + + SET(srtCommon_SRCS + ADM_vidFont.cpp ADM_vidSRT.cpp ADM_vidSRTload.cpp ADM_vidSRTRender.cpp DIA_srt.cpp DIA_flySrtPos.cpp + ) + + INCLUDE(vf_plugin_gtk) + INCLUDE(vf_plugin_qt4) + + SET(srtGtk_SRCS gtk/DIA_srt.cpp) + SET(srtQT_SRCS qt4/Q_srt.cpp) + SET(srtQT_HEADERS qt4/Q_srt.h) + SET(srtQT_UI qt4/srt) + + INIT_VIDEOFILTER_PLUGIN_QT4(ADM_vf_sub_qt4 + ${srtQT_SRCS} ${srtQT_HEADERS} ${srtQT_UI} ${srtCommon_SRCS}) + INIT_VIDEOFILTER_PLUGIN_GTK( ADM_vf_sub_gtk + ${srtGtk_SRCS} ${srtCommon_SRCS}) + + ADD_DEFINITIONS(${LIBICONV_DEFINITIONS}) + ADD_SOURCE_CFLAGS(DIA_srt.cpp "${FREETYPE2_CFLAGS}" ) + ADD_SOURCE_CFLAGS(ADM_vidSRT.cpp "${FREETYPE2_CFLAGS}" ) + ADD_SOURCE_CFLAGS(ADM_vidFont.cpp "${FREETYPE2_CFLAGS}" ) + ADD_SOURCE_CFLAGS(ADM_vidSRTload.cpp "${FREETYPE2_CFLAGS} -I${LIBICONV_INCLUDE_DIR} ") + ADD_SOURCE_CFLAGS(ADM_vidSRTRender.cpp "${FREETYPE2_CFLAGS}" ) + + IF (GTK_FOUND AND GTHREAD_FOUND) + target_link_libraries(ADM_vf_sub_gtk "${FREETYPE2_LDFLAGS} ${LIBICONV_LIBRARY_DIR}") + ENDIF (GTK_FOUND AND GTHREAD_FOUND) + + IF (QT4_FOUND) + target_link_libraries(ADM_vf_sub_qt4 "${FREETYPE2_LDFLAGS} ${LIBICONV_LIBRARY_DIR}") + ENDIF (QT4_FOUND) ENDIF(USE_FREETYPE) \ No newline at end of file diff --git a/avidemux_plugins/ADM_videoFilters/TIsophote/HELP FILE.txt b/avidemux_plugins/ADM_videoFilters/TIsophote/HELP FILE.txt index 18d68b733f..e59784f73b 100644 --- a/avidemux_plugins/ADM_videoFilters/TIsophote/HELP FILE.txt +++ b/avidemux_plugins/ADM_videoFilters/TIsophote/HELP FILE.txt @@ -1,118 +1,118 @@ - | - TIsophote for AviSynth v2.5.x | - v0.9.1 (24 July 2004) | - by tritical | - | - HELP FILE | -------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------- - - -INFO: - - - TIsophote is a level-set (isophote) smoothing filter. It does simple unconstrained level-set - smoothing. Basically, it can smooth jagged edges in an image. If over used it will remove jagged - edges as well as object features and eventually completely eliminate all level curves. For a more - in-depth explanation see the technical info towards the bottom of the help file. - - Or for more info (includes information besides simple unconstrained smoothing): - - http://neuron2.net/library/LSImageReconstruction.pdf - - Syntax => TIsophote(int iterations, float tStep, int type, bool chroma) - - - -PARAMETERS: - - - iterations - - Sets the number of iterations used. More iterations will take more processing time. - Increasing the number of iterations while holding tStep constant will result in more and - more shortening of the level curves. Total 'time' of the filter is equal to - - iterations*tStep. iterations must be set to at least 1. - - default - 4 (int) - - - tStep - - Sets the update per iteration. At 1.0, each iteration is a full cycle of the flow equation. - At 0, the original image is always returned. Generally, lower values produce more "stable" - flow but require more iterations. Recommended values are between 0.1 and 0.5, though setting - this to 1.0 is usually ok and simply results in an extra overall smoothing. While this - value can be anything, it really only makes sense when it is 0.0 <= tStep <= 1.0, other values - will generally result in garbage output. This setting could be seen as a strength of smoothing - per iteration setting (1.0 being strongest, 0.0 being nothing). Note: technically for long run - numerical stability this value must be less then 0.25! - - default - 0.2 (float) - - - type - - Sets how the needed derivatives are calculated. - - type 0 - simplest possible estimate of both first and second derivatives - (fastest, probably best clean video) - - type 1 - sobel operator for first derivatives, simple estimate for second - (in-between 0 and 2 speed wise and noise wise) - - type 2 - sobel operator for first and similar inherent denoising operator for second - (slowest, probably best for noisy video) - - default - 2 (int) - - - chroma - - If set to true the chroma planes are processed. If set to false the chroma planes from the - source are simply copied to the output frame. - - default - false (bool) - - - -TECHNICAL INFO: - - - The filter operation is really quite simple, all it does is use the following equation to update the - value of each pixel in the frame after each iteration. - - I(n) = a pixel in the frame at iteration n - - I(n+1) = I(n) + It - - It = ((Ix*Ix*Iyy + 2*Ix*Iy*Ixy + Iy*Iy*Ixx) * tStep) / (Ix*Ix + Iy*Iy + e) - - - e = a very small constant (ex. 10^-10) to prevent division by 0 - - Ix, Iy, Ixy, Iyy, Ixx are the first and second derivatives of - the image at the current pixel location, i.e. - Ix = first derivative in x direction - Iy = first derivative in y direction, etc... - - - -CHANGE LIST: - - 07/24/2004 v0.9.1 - - Changed default values for iterations, type, and chroma parameters - - Fixed incorrect clipping for values below 0. Pixel values were clipped - to 0-255 range but values below 0 were getting clipped to abs(pixel) - instead of 0 which would lead to artifacts. - - 06/25/2004 v0.9 - - Initial Release - - - -TO DO LIST: - - - bug fixes as needed - - - -contact: doom9.org forum (nick = tritical) + | + TIsophote for AviSynth v2.5.x | + v0.9.1 (24 July 2004) | + by tritical | + | + HELP FILE | +------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------------------------- + + +INFO: + + + TIsophote is a level-set (isophote) smoothing filter. It does simple unconstrained level-set + smoothing. Basically, it can smooth jagged edges in an image. If over used it will remove jagged + edges as well as object features and eventually completely eliminate all level curves. For a more + in-depth explanation see the technical info towards the bottom of the help file. + + Or for more info (includes information besides simple unconstrained smoothing): + + http://neuron2.net/library/LSImageReconstruction.pdf + + Syntax => TIsophote(int iterations, float tStep, int type, bool chroma) + + + +PARAMETERS: + + + iterations + + Sets the number of iterations used. More iterations will take more processing time. + Increasing the number of iterations while holding tStep constant will result in more and + more shortening of the level curves. Total 'time' of the filter is equal to - + iterations*tStep. iterations must be set to at least 1. + + default - 4 (int) + + + tStep + + Sets the update per iteration. At 1.0, each iteration is a full cycle of the flow equation. + At 0, the original image is always returned. Generally, lower values produce more "stable" + flow but require more iterations. Recommended values are between 0.1 and 0.5, though setting + this to 1.0 is usually ok and simply results in an extra overall smoothing. While this + value can be anything, it really only makes sense when it is 0.0 <= tStep <= 1.0, other values + will generally result in garbage output. This setting could be seen as a strength of smoothing + per iteration setting (1.0 being strongest, 0.0 being nothing). Note: technically for long run + numerical stability this value must be less then 0.25! + + default - 0.2 (float) + + + type + + Sets how the needed derivatives are calculated. + + type 0 - simplest possible estimate of both first and second derivatives + (fastest, probably best clean video) + + type 1 - sobel operator for first derivatives, simple estimate for second + (in-between 0 and 2 speed wise and noise wise) + + type 2 - sobel operator for first and similar inherent denoising operator for second + (slowest, probably best for noisy video) + + default - 2 (int) + + + chroma + + If set to true the chroma planes are processed. If set to false the chroma planes from the + source are simply copied to the output frame. + + default - false (bool) + + + +TECHNICAL INFO: + + + The filter operation is really quite simple, all it does is use the following equation to update the + value of each pixel in the frame after each iteration. + + I(n) = a pixel in the frame at iteration n + + I(n+1) = I(n) + It + + It = ((Ix*Ix*Iyy + 2*Ix*Iy*Ixy + Iy*Iy*Ixx) * tStep) / (Ix*Ix + Iy*Iy + e) + + - e = a very small constant (ex. 10^-10) to prevent division by 0 + - Ix, Iy, Ixy, Iyy, Ixx are the first and second derivatives of + the image at the current pixel location, i.e. + Ix = first derivative in x direction + Iy = first derivative in y direction, etc... + + + +CHANGE LIST: + + 07/24/2004 v0.9.1 + - Changed default values for iterations, type, and chroma parameters + - Fixed incorrect clipping for values below 0. Pixel values were clipped + to 0-255 range but values below 0 were getting clipped to abs(pixel) + instead of 0 which would lead to artifacts. + + 06/25/2004 v0.9 + - Initial Release + + + +TO DO LIST: + + - bug fixes as needed + + + +contact: doom9.org forum (nick = tritical) diff --git a/avidemux_plugins/ADM_videoFilters/Tdeint/ADM_vidTdeint_util.txt b/avidemux_plugins/ADM_videoFilters/Tdeint/ADM_vidTdeint_util.txt index 18ef25803f..b083c3dfda 100644 --- a/avidemux_plugins/ADM_videoFilters/Tdeint/ADM_vidTdeint_util.txt +++ b/avidemux_plugins/ADM_videoFilters/Tdeint/ADM_vidTdeint_util.txt @@ -1,3144 +1,3144 @@ - - - unsigned char vidTDeint::cubicInt(unsigned char p1, unsigned char p2, unsigned char p3, - unsigned char p4) -{ - int temp = (int)((19*(p2+p3)-3*(p1+p4)+16)>>5); - if (temp>255) temp = 255; - else if (temp<0) temp = 0; - return (unsigned char)temp; -} - -void vidTDeint::createMotionMapYV12(ADMImage *prv2, ADMImage *prv, - ADMImage *src, ADMImage *nxt, ADMImage *nxt2, ADMImage *mask, int n) -{ - const unsigned char *prv2pY = prv2->GetReadPtr(PLANAR_Y); - const unsigned char *prv2pV = prv2->GetReadPtr(PLANAR_V); - const unsigned char *prv2pU = prv2->GetReadPtr(PLANAR_U); - int prv2_pitchY = prv2->GetPitch(PLANAR_Y); - int prv2_pitchUV = prv2->GetPitch(PLANAR_V); - prv2pY += prv2_pitchY*(2-PRM(field)); - prv2pV += prv2_pitchUV*(2-PRM(field)); - prv2pU += prv2_pitchUV*(2-PRM(field)); - prv2_pitchY *= 2; - prv2_pitchUV *= 2; - const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); - const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); - const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); - int prv_pitchY = prv->GetPitch(PLANAR_Y); - int prv_pitchUV = prv->GetPitch(PLANAR_V); - prvpY += prv_pitchY*(2-PRM(field)); - prvpV += prv_pitchUV*(2-PRM(field)); - prvpU += prv_pitchUV*(2-PRM(field)); - const unsigned char *prvppY = prvpY - prv_pitchY; - const unsigned char *prvppV = prvpV - prv_pitchUV; - const unsigned char *prvppU = prvpU - prv_pitchUV; - const unsigned char *prvpnY = prvpY + prv_pitchY; - const unsigned char *prvpnV = prvpV + prv_pitchUV; - const unsigned char *prvpnU = prvpU + prv_pitchUV; - prv_pitchY *= 2; - prv_pitchUV *= 2; - const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); - const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); - const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); - int src_pitchY = src->GetPitch(PLANAR_Y); - int src_pitchUV = src->GetPitch(PLANAR_V); - int WidthY = src->GetRowSize(PLANAR_Y); - int HeightY = src->GetHeight(PLANAR_Y); - int WidthUV = src->GetRowSize(PLANAR_V); - int HeightUV = src->GetHeight(PLANAR_V); - srcpY += src_pitchY*(2-PRM(field)); - srcpV += src_pitchUV*(2-PRM(field)); - srcpU += src_pitchUV*(2-PRM(field)); - const unsigned char *srcppY = srcpY - src_pitchY; - const unsigned char *srcppV = srcpV - src_pitchUV; - const unsigned char *srcppU = srcpU - src_pitchUV; - const unsigned char *srcpnY = srcpY + src_pitchY; - const unsigned char *srcpnV = srcpV + src_pitchUV; - const unsigned char *srcpnU = srcpU + src_pitchUV; - src_pitchY *= 2; - src_pitchUV *= 2; - const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); - const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); - const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); - int nxt_pitchY = nxt->GetPitch(PLANAR_Y); - int nxt_pitchUV = nxt->GetPitch(PLANAR_V); - nxtpY += nxt_pitchY*(2-PRM(field)); - nxtpV += nxt_pitchUV*(2-PRM(field)); - nxtpU += nxt_pitchUV*(2-PRM(field)); - const unsigned char *nxtppY = nxtpY - nxt_pitchY; - const unsigned char *nxtppV = nxtpV - nxt_pitchUV; - const unsigned char *nxtppU = nxtpU - nxt_pitchUV; - const unsigned char *nxtpnY = nxtpY + nxt_pitchY; - const unsigned char *nxtpnV = nxtpV + nxt_pitchUV; - const unsigned char *nxtpnU = nxtpU + nxt_pitchUV; - nxt_pitchY *= 2; - nxt_pitchUV *= 2; - const unsigned char *nxt2pY = nxt2->GetReadPtr(PLANAR_Y); - const unsigned char *nxt2pV = nxt2->GetReadPtr(PLANAR_V); - const unsigned char *nxt2pU = nxt2->GetReadPtr(PLANAR_U); - int nxt2_pitchY = nxt2->GetPitch(PLANAR_Y); - int nxt2_pitchUV = nxt2->GetPitch(PLANAR_V); - nxt2pY += nxt2_pitchY*(2-PRM(field)); - nxt2pV += nxt2_pitchUV*(2-PRM(field)); - nxt2pU += nxt2_pitchUV*(2-PRM(field)); - nxt2_pitchY *= 2; - nxt2_pitchUV *= 2; - unsigned char *maskwY = mask->GetWritePtr(PLANAR_Y); - unsigned char *maskwV = mask->GetWritePtr(PLANAR_V); - unsigned char *maskwU = mask->GetWritePtr(PLANAR_U); - int mask_pitchY = mask->GetPitch(PLANAR_Y); - int mask_pitchUV = mask->GetPitch(PLANAR_V); - memset(maskwY,10,mask_pitchY*HeightY); - memset(maskwU,10,mask_pitchUV*HeightUV); - memset(maskwV,10,mask_pitchUV*HeightUV); - maskwY += mask_pitchY*(2-PRM(field)); - maskwV += mask_pitchUV*(2-PRM(field)); - maskwU += mask_pitchUV*(2-PRM(field)); - mask_pitchY *= 2; - mask_pitchUV *= 2; - int x, y; - unsigned char val1; - bool t1, t2, t3, t4, t5, t6, t7; - if (PRM(field)^PRM(order)) - { - val1 = PRM(mntmode) > 1 ? (accumP <= accumN ? 10 : 30) : 40; - if (n <= 1 || n >= nfrms-1) - { - for (y=1; y= nfrms-1 ? false : (abs(nxtpY[x] - nxt2pY[x]) < mthreshL); - if (t6 && ((t1 && t2) || (t3 && t4) || (t2 && t4 && (t5 || t7)) || (t1 && t3 && (t5 || t7)))) - maskwY[x] = val1; - else if (t1 && t2 && t3 && t4 && t5 && t7) maskwY[x] = val1; - else if (t1 && t5 && t2) maskwY[x] = 10; - else if (t3 && t7 && t4) maskwY[x] = 30; - else if (abs(srcpY[x]-srcppY[x])<4 && abs(srcpY[x]-srcpnY[x])<4) maskwY[x] = 110; - else if (abs(nxtpY[x]-srcppY[x])<4 && abs(nxtpY[x]-srcpnY[x])<4) maskwY[x] = 130; - else maskwY[x] = 60; - } - prvppY += prv_pitchY; - prvpY += prv_pitchY; - prvpnY += prv_pitchY; - srcppY += src_pitchY; - srcpY += src_pitchY; - srcpnY += src_pitchY; - nxtppY += nxt_pitchY; - nxtpY += nxt_pitchY; - nxtpnY += nxt_pitchY; - nxt2pY += nxt2_pitchY; - maskwY += mask_pitchY; - } - for (y=1; y= nfrms-1 ? false : (abs(nxtpV[x] - nxt2pV[x]) < mthreshC); - if (t6 && ((t1 && t2) || (t3 && t4) || (t2 && t4 && (t5 || t7)) || (t1 && t3 && (t5 || t7)))) - maskwV[x] = val1; - else if (t1 && t2 && t3 && t4 && t5 && t7) maskwV[x] = val1; - else if (t1 && t5 && t2) maskwV[x] = 10; - else if (t3 && t7 && t4) maskwV[x] = 30; - else if (abs(srcpV[x]-srcppV[x])<4 && abs(srcpV[x]-srcpnV[x])<4) maskwV[x] = 110; - else if (abs(nxtpV[x]-srcppV[x])<4 && abs(nxtpV[x]-srcpnV[x])<4) maskwV[x] = 130; - else maskwV[x] = 60; - t1 = n == 0 ? false : (abs(srcppU[x] - prvppU[x]) < mthreshC); - t2 = n == 0 ? false : (abs(srcpnU[x] - prvpnU[x]) < mthreshC); - t3 = n == nfrms ? false : (abs(srcppU[x] - nxtppU[x]) < mthreshC); - t4 = n == nfrms ? false : (abs(srcpnU[x] - nxtpnU[x]) < mthreshC); - t5 = n == 0 ? false : (abs(srcpU[x] - prvpU[x]) < mthreshC); - t6 = n == nfrms ? false : (abs(srcpU[x] - nxtpU[x]) < mthreshC); - t7 = n >= nfrms-1 ? false : (abs(nxtpU[x] - nxt2pU[x]) < mthreshC); - if (t6 && ((t1 && t2) || (t3 && t4) || (t2 && t4 && (t5 || t7)) || (t1 && t3 && (t5 || t7)))) - maskwU[x] = val1; - else if (t1 && t2 && t3 && t4 && t5 && t7) maskwU[x] = val1; - else if (t1 && t5 && t2) maskwU[x] = 10; - else if (t3 && t7 && t4) maskwU[x] = 30; - else if (abs(srcpU[x]-srcppU[x])<4 && abs(srcpU[x]-srcpnU[x])<4) maskwU[x] = 110; - else if (abs(nxtpU[x]-srcppU[x])<4 && abs(nxtpU[x]-srcpnU[x])<4) maskwU[x] = 130; - else maskwU[x] = 60; - } - prvppV += prv_pitchUV; - prvpV += prv_pitchUV; - prvpnV += prv_pitchUV; - prvppU += prv_pitchUV; - prvpU += prv_pitchUV; - prvpnU += prv_pitchUV; - srcppV += src_pitchUV; - srcpV += src_pitchUV; - srcpnV += src_pitchUV; - srcppU += src_pitchUV; - srcpU += src_pitchUV; - srcpnU += src_pitchUV; - nxtppV += nxt_pitchUV; - nxtpV += nxt_pitchUV; - nxtpnV += nxt_pitchUV; - nxtppU += nxt_pitchUV; - nxtpU += nxt_pitchUV; - nxtpnU += nxt_pitchUV; - nxt2pV += nxt2_pitchUV; - nxt2pU += nxt2_pitchUV; - maskwV += mask_pitchUV; - maskwU += mask_pitchUV; - } - } - else - { - for (y=1; y 1 ? (accumP < accumN ? 20 : 10) : 50; - if (n <= 1 || n >= nfrms-1) - { - for (y=1; yGetReadPtr(PLANAR_Y); - const unsigned char *prv2pV = prv2->GetReadPtr(PLANAR_V); - const unsigned char *prv2pU = prv2->GetReadPtr(PLANAR_U); - int prv2_pitchY = prv2->GetPitch(PLANAR_Y); - int prv2_pitchUV = prv2->GetPitch(PLANAR_V); - prv2pY += prv2_pitchY*(2-PRM(field)); - prv2pV += prv2_pitchUV*(2-PRM(field)); - prv2pU += prv2_pitchUV*(2-PRM(field)); - const unsigned char *prv2ppY = prv2pY - prv2_pitchY; - const unsigned char *prv2ppV = prv2pV - prv2_pitchUV; - const unsigned char *prv2ppU = prv2pU - prv2_pitchUV; - const unsigned char *prv2pnY = prv2pY + prv2_pitchY; - const unsigned char *prv2pnV = prv2pV + prv2_pitchUV; - const unsigned char *prv2pnU = prv2pU + prv2_pitchUV; - prv2_pitchY *= 2; - prv2_pitchUV *= 2; - const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); - const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); - const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); - int prv_pitchY = prv->GetPitch(PLANAR_Y); - int prv_pitchUV = prv->GetPitch(PLANAR_V); - prvpY += prv_pitchY*(2-PRM(field)); - prvpV += prv_pitchUV*(2-PRM(field)); - prvpU += prv_pitchUV*(2-PRM(field)); - const unsigned char *prvppY = prvpY - prv_pitchY; - const unsigned char *prvppV = prvpV - prv_pitchUV; - const unsigned char *prvppU = prvpU - prv_pitchUV; - const unsigned char *prvpnY = prvpY + prv_pitchY; - const unsigned char *prvpnV = prvpV + prv_pitchUV; - const unsigned char *prvpnU = prvpU + prv_pitchUV; - prv_pitchY *= 2; - prv_pitchUV *= 2; - const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); - const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); - const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); - int src_pitchY = src->GetPitch(PLANAR_Y); - int src_pitchUV = src->GetPitch(PLANAR_V); - int WidthY = src->GetRowSize(PLANAR_Y); - int HeightY = src->GetHeight(PLANAR_Y); - int WidthUV = src->GetRowSize(PLANAR_V); - int HeightUV = src->GetHeight(PLANAR_V); - srcpY += src_pitchY*(2-PRM(field)); - srcpV += src_pitchUV*(2-PRM(field)); - srcpU += src_pitchUV*(2-PRM(field)); - const unsigned char *srcppY = srcpY - src_pitchY; - const unsigned char *srcppV = srcpV - src_pitchUV; - const unsigned char *srcppU = srcpU - src_pitchUV; - const unsigned char *srcpnY = srcpY + src_pitchY; - const unsigned char *srcpnV = srcpV + src_pitchUV; - const unsigned char *srcpnU = srcpU + src_pitchUV; - src_pitchY *= 2; - src_pitchUV *= 2; - const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); - const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); - const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); - int nxt_pitchY = nxt->GetPitch(PLANAR_Y); - int nxt_pitchUV = nxt->GetPitch(PLANAR_V); - nxtpY += nxt_pitchY*(2-PRM(field)); - nxtpV += nxt_pitchUV*(2-PRM(field)); - nxtpU += nxt_pitchUV*(2-PRM(field)); - const unsigned char *nxtppY = nxtpY - nxt_pitchY; - const unsigned char *nxtppV = nxtpV - nxt_pitchUV; - const unsigned char *nxtppU = nxtpU - nxt_pitchUV; - const unsigned char *nxtpnY = nxtpY + nxt_pitchY; - const unsigned char *nxtpnV = nxtpV + nxt_pitchUV; - const unsigned char *nxtpnU = nxtpU + nxt_pitchUV; - nxt_pitchY *= 2; - nxt_pitchUV *= 2; - const unsigned char *nxt2pY = nxt2->GetReadPtr(PLANAR_Y); - const unsigned char *nxt2pV = nxt2->GetReadPtr(PLANAR_V); - const unsigned char *nxt2pU = nxt2->GetReadPtr(PLANAR_U); - int nxt2_pitchY = nxt2->GetPitch(PLANAR_Y); - int nxt2_pitchUV = nxt2->GetPitch(PLANAR_V); - nxt2pY += nxt2_pitchY*(2-PRM(field)); - nxt2pV += nxt2_pitchUV*(2-PRM(field)); - nxt2pU += nxt2_pitchUV*(2-PRM(field)); - const unsigned char *nxt2ppY = nxt2pY - nxt2_pitchY; - const unsigned char *nxt2ppV = nxt2pV - nxt2_pitchUV; - const unsigned char *nxt2ppU = nxt2pU - nxt2_pitchUV; - const unsigned char *nxt2pnY = nxt2pY + nxt2_pitchY; - const unsigned char *nxt2pnV = nxt2pV + nxt2_pitchUV; - const unsigned char *nxt2pnU = nxt2pU + nxt2_pitchUV; - nxt2_pitchY *= 2; - nxt2_pitchUV *= 2; - unsigned char *maskwY = mask->GetWritePtr(PLANAR_Y); - unsigned char *maskwV = mask->GetWritePtr(PLANAR_V); - unsigned char *maskwU = mask->GetWritePtr(PLANAR_U); - int mask_pitchY = mask->GetPitch(PLANAR_Y); - int mask_pitchUV = mask->GetPitch(PLANAR_V); - memset(maskwY,10,mask_pitchY*HeightY); - memset(maskwU,10,mask_pitchUV*HeightUV); - memset(maskwV,10,mask_pitchUV*HeightUV); - maskwY += mask_pitchY*(2-PRM(field)); - maskwV += mask_pitchUV*(2-PRM(field)); - maskwU += mask_pitchUV*(2-PRM(field)); - mask_pitchY *= 2; - mask_pitchUV *= 2; - int x, y; - unsigned char val1; - bool t1, t2, t3, t4, t5, t6, t7, t8, t9, t10; - bool t11, t12, t13, t14, t15, t16, t17, t18, t19; - if (PRM(field)^PRM(order)) - { - val1 = PRM(mntmode) > 1 ? (accumP <= accumN ? 10 : 30) : 40; - if (n <= 1 || n >= nfrms-1) - { - for (y=1; y= nfrms-1 ? false : (abs(nxtpY[x] - nxt2pY[x]) < mthreshL); - t8 = n <= 1 ? false : (abs(prvppY[x] - prv2ppY[x]) < mthreshL); - t9 = n <= 1 ? false : (abs(prvpnY[x] - prv2pnY[x]) < mthreshL); - t10 = n >= nfrms-1 ? false : (abs(nxtppY[x] - nxt2ppY[x]) < mthreshL); - t11 = n >= nfrms-1 ? false : (abs(nxtpnY[x] - nxt2pnY[x]) < mthreshL); - t12 = (abs(srcppY[x] - prv2ppY[x]) < mthreshL); - t13 = (abs(srcpnY[x] - prv2pnY[x]) < mthreshL); - t14 = (abs(nxtppY[x] - prvppY[x]) < mthreshL); - t15 = (abs(nxtpnY[x] - prvpnY[x]) < mthreshL); - t16 = (abs(nxt2ppY[x] - srcppY[x]) < mthreshL); - t17 = (abs(nxt2pnY[x] - srcpnY[x]) < mthreshL); - t18 = (abs(nxtpY[x] - prvpY[x]) < mthreshL); - t19 = (abs(nxt2pY[x] - srcpY[x]) < mthreshL); - if (t6 && ((t1 && t2 && ((t3 && t4 && t14 && t15) || (t5 && t18))) || - (t3 && t4 && t7 && t19) || - (t5 && t18 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t1 && t8 && t12) || (t2 && t9 && t13))) || - (t7 && t19 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t3 && t10 && t16) || (t4 && t11 && t17))))) - maskwY[x] = val1; - else if (t1 && t2 && t3 && t4 && t5 && t7 && t14 && t15) maskwY[x] = val1; - else if (t1 && t5 && t2 && t8 && t9 && t12 && t13) maskwY[x] = 10; - else if (t3 && t7 && t4 && t10 && t11 && t16 && t17) maskwY[x] = 30; - else if (abs(srcpY[x]-srcppY[x])<4 && abs(srcpY[x]-srcpnY[x])<4) maskwY[x] = 110; - else if (abs(nxtpY[x]-srcppY[x])<4 && abs(nxtpY[x]-srcpnY[x])<4) maskwY[x] = 130; - else maskwY[x] = 60; - } - prv2ppY += prv2_pitchY; - prv2pY += prv2_pitchY; - prv2pnY += prv2_pitchY; - prvppY += prv_pitchY; - prvpY += prv_pitchY; - prvpnY += prv_pitchY; - srcppY += src_pitchY; - srcpY += src_pitchY; - srcpnY += src_pitchY; - nxtppY += nxt_pitchY; - nxtpY += nxt_pitchY; - nxtpnY += nxt_pitchY; - nxt2ppY += nxt2_pitchY; - nxt2pY += nxt2_pitchY; - nxt2pnY += nxt2_pitchY; - maskwY += mask_pitchY; - } - for (y=1; y= nfrms-1 ? false : (abs(nxtpV[x] - nxt2pV[x]) < mthreshC); - t8 = n <= 1 ? false : (abs(prvppV[x] - prv2ppV[x]) < mthreshC); - t9 = n <= 1 ? false : (abs(prvpnV[x] - prv2pnV[x]) < mthreshC); - t10 = n >= nfrms-1 ? false : (abs(nxtppV[x] - nxt2ppV[x]) < mthreshC); - t11 = n >= nfrms-1 ? false : (abs(nxtpnV[x] - nxt2pnV[x]) < mthreshC); - t12 = (abs(srcppV[x] - prv2ppV[x]) < mthreshC); - t13 = (abs(srcpnV[x] - prv2pnV[x]) < mthreshC); - t14 = (abs(nxtppV[x] - prvppV[x]) < mthreshC); - t15 = (abs(nxtpnV[x] - prvpnV[x]) < mthreshC); - t16 = (abs(nxt2ppV[x] - srcppV[x]) < mthreshC); - t17 = (abs(nxt2pnV[x] - srcpnV[x]) < mthreshC); - t18 = (abs(nxtpV[x] - prvpV[x]) < mthreshC); - t19 = (abs(nxt2pV[x] - srcpV[x]) < mthreshC); - if (t6 && ((t1 && t2 && ((t3 && t4 && t14 && t15) || (t5 && t18))) || - (t3 && t4 && t7 && t19) || - (t5 && t18 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t1 && t8 && t12) || (t2 && t9 && t13))) || - (t7 && t19 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t3 && t10 && t16) || (t4 && t11 && t17))))) - maskwV[x] = val1; - else if (t1 && t2 && t3 && t4 && t5 && t7 && t14 && t15) maskwV[x] = val1; - else if (t1 && t5 && t2 && t8 && t9 && t12 && t13) maskwV[x] = 10; - else if (t3 && t7 && t4 && t10 && t11 && t16 && t17) maskwV[x] = 30; - else if (abs(srcpV[x]-srcppV[x])<4 && abs(srcpV[x]-srcpnV[x])<4) maskwV[x] = 110; - else if (abs(nxtpV[x]-srcppV[x])<4 && abs(nxtpV[x]-srcpnV[x])<4) maskwV[x] = 130; - else maskwV[x] = 60; - t1 = n == 0 ? false : (abs(srcppU[x] - prvppU[x]) < mthreshC); - t2 = n == 0 ? false : (abs(srcpnU[x] - prvpnU[x]) < mthreshC); - t3 = n == nfrms ? false : (abs(srcppU[x] - nxtppU[x]) < mthreshC); - t4 = n == nfrms ? false : (abs(srcpnU[x] - nxtpnU[x]) < mthreshC); - t5 = n == 0 ? false : (abs(srcpU[x] - prvpU[x]) < mthreshC); - t6 = n == nfrms ? false : (abs(srcpU[x] - nxtpU[x]) < mthreshC); - t7 = n >= nfrms-1 ? false : (abs(nxtpU[x] - nxt2pU[x]) < mthreshC); - t8 = n <= 1 ? false : (abs(prvppU[x] - prv2ppU[x]) < mthreshC); - t9 = n <= 1 ? false : (abs(prvpnU[x] - prv2pnU[x]) < mthreshC); - t10 = n >= nfrms-1 ? false : (abs(nxtppU[x] - nxt2ppU[x]) < mthreshC); - t11 = n >= nfrms-1 ? false : (abs(nxtpnU[x] - nxt2pnU[x]) < mthreshC); - t12 = (abs(srcppU[x] - prv2ppU[x]) < mthreshC); - t13 = (abs(srcpnU[x] - prv2pnU[x]) < mthreshC); - t14 = (abs(nxtppU[x] - prvppU[x]) < mthreshC); - t15 = (abs(nxtpnU[x] - prvpnU[x]) < mthreshC); - t16 = (abs(nxt2ppU[x] - srcppU[x]) < mthreshC); - t17 = (abs(nxt2pnU[x] - srcpnU[x]) < mthreshC); - t18 = (abs(nxtpU[x] - prvpU[x]) < mthreshC); - t19 = (abs(nxt2pU[x] - srcpU[x]) < mthreshC); - if (t6 && ((t1 && t2 && ((t3 && t4 && t14 && t15) || (t5 && t18))) || - (t3 && t4 && t7 && t19) || - (t5 && t18 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t1 && t8 && t12) || (t2 && t9 && t13))) || - (t7 && t19 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t3 && t10 && t16) || (t4 && t11 && t17))))) - maskwU[x] = val1; - else if (t1 && t2 && t3 && t4 && t5 && t7 && t14 && t15) maskwU[x] = val1; - else if (t1 && t5 && t2 && t8 && t9 && t12 && t13) maskwU[x] = 10; - else if (t3 && t7 && t4 && t10 && t11 && t16 && t17) maskwU[x] = 30; - else if (abs(srcpU[x]-srcppU[x])<4 && abs(srcpU[x]-srcpnU[x])<4) maskwU[x] = 110; - else if (abs(nxtpU[x]-srcppU[x])<4 && abs(nxtpU[x]-srcpnU[x])<4) maskwU[x] = 130; - else maskwU[x] = 60; - } - prv2ppV += prv2_pitchUV; - prv2pV += prv2_pitchUV; - prv2pnV += prv2_pitchUV; - prv2ppU += prv2_pitchUV; - prv2pU += prv2_pitchUV; - prv2pnU += prv2_pitchUV; - prvppV += prv_pitchUV; - prvpV += prv_pitchUV; - prvpnV += prv_pitchUV; - prvppU += prv_pitchUV; - prvpU += prv_pitchUV; - prvpnU += prv_pitchUV; - srcppV += src_pitchUV; - srcpV += src_pitchUV; - srcpnV += src_pitchUV; - srcppU += src_pitchUV; - srcpU += src_pitchUV; - srcpnU += src_pitchUV; - nxtppV += nxt_pitchUV; - nxtpV += nxt_pitchUV; - nxtpnV += nxt_pitchUV; - nxtppU += nxt_pitchUV; - nxtpU += nxt_pitchUV; - nxtpnU += nxt_pitchUV; - nxt2ppV += nxt2_pitchUV; - nxt2pV += nxt2_pitchUV; - nxt2pnV += nxt2_pitchUV; - nxt2ppU += nxt2_pitchUV; - nxt2pU += nxt2_pitchUV; - nxt2pnU += nxt2_pitchUV; - maskwV += mask_pitchUV; - maskwU += mask_pitchUV; - } - } - else - { - for (y=1; y 1 ? (accumP < accumN ? 20 : 10) : 50; - if (n <= 1 || n >= nfrms-1) - { - for (y=1; y= nfrms-1 ? false : (abs(nxtppY[x] - nxt2ppY[x]) < mthreshL); - t11 = n >= nfrms-1 ? false : (abs(nxtpnY[x] - nxt2pnY[x]) < mthreshL); - t12 = (abs(srcppY[x] - prv2ppY[x]) < mthreshL); - t13 = (abs(srcpnY[x] - prv2pnY[x]) < mthreshL); - t14 = (abs(nxtppY[x] - prvppY[x]) < mthreshL); - t15 = (abs(nxtpnY[x] - prvpnY[x]) < mthreshL); - t16 = (abs(nxt2ppY[x] - srcppY[x]) < mthreshL); - t17 = (abs(nxt2pnY[x] - srcpnY[x]) < mthreshL); - t18 = (abs(srcpY[x] - prv2pY[x]) < mthreshL); - t19 = (abs(nxtpY[x] - prvpY[x]) < mthreshL); - if (t6 && ((t1 && t2 && ((t3 && t4 && t14 && t15) || (t5 && t18))) || - (t3 && t4 && t7 && t19) || - (t5 && t18 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t1 && t8 && t12) || (t2 && t9 && t13))) || - (t7 && t19 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t3 && t10 && t16) || (t4 && t11 && t17))))) - maskwY[x] = val1; - else if (t1 && t2 && t3 && t4 && t5 && t7 && t14 && t15) maskwY[x] = val1; - else if (t1 && t5 && t2 && t8 && t9 && t12 && t13) maskwY[x] = 20; - else if (t3 && t7 && t4 && t10 && t11 && t16 && t17) maskwY[x] = 10; - else if (abs(prvpY[x]-srcppY[x])<4 && abs(prvpY[x]-srcpnY[x])<4) maskwY[x] = 120; - else if (abs(srcpY[x]-srcppY[x])<4 && abs(srcpY[x]-srcpnY[x])<4) maskwY[x] = 110; - else maskwY[x] = 60; - } - prv2ppY += prv2_pitchY; - prv2pY += prv2_pitchY; - prv2pnY += prv2_pitchY; - prvppY += prv_pitchY; - prvpY += prv_pitchY; - prvpnY += prv_pitchY; - srcppY += src_pitchY; - srcpY += src_pitchY; - srcpnY += src_pitchY; - nxtppY += nxt_pitchY; - nxtpY += nxt_pitchY; - nxtpnY += nxt_pitchY; - nxt2ppY += nxt2_pitchY; - nxt2pY += nxt2_pitchY; - nxt2pnY += nxt2_pitchY; - maskwY += mask_pitchY; - } - for (y=1; y= nfrms-1 ? false : (abs(nxtppV[x] - nxt2ppV[x]) < mthreshC); - t11 = n >= nfrms-1 ? false : (abs(nxtpnV[x] - nxt2pnV[x]) < mthreshC); - t12 = (abs(srcppV[x] - prv2ppV[x]) < mthreshC); - t13 = (abs(srcpnV[x] - prv2pnV[x]) < mthreshC); - t14 = (abs(nxtppV[x] - prvppV[x]) < mthreshC); - t15 = (abs(nxtpnV[x] - prvpnV[x]) < mthreshC); - t16 = (abs(nxt2ppV[x] - srcppV[x]) < mthreshC); - t17 = (abs(nxt2pnV[x] - srcpnV[x]) < mthreshC); - t18 = (abs(srcpV[x] - prv2pV[x]) < mthreshC); - t19 = (abs(nxtpV[x] - prvpV[x]) < mthreshC); - if (t6 && ((t1 && t2 && ((t3 && t4 && t14 && t15) || (t5 && t18))) || - (t3 && t4 && t7 && t19) || - (t5 && t18 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t1 && t8 && t12) || (t2 && t9 && t13))) || - (t7 && t19 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t3 && t10 && t16) || (t4 && t11 && t17))))) - maskwV[x] = val1; - else if (t1 && t2 && t3 && t4 && t5 && t7 && t14 && t15) maskwV[x] = val1; - else if (t1 && t5 && t2 && t8 && t9 && t12 && t13) maskwV[x] = 20; - else if (t3 && t7 && t4 && t10 && t11 && t16 && t17) maskwV[x] = 10; - else if (abs(prvpV[x]-srcppV[x])<4 && abs(prvpV[x]-srcpnV[x])<4) maskwV[x] = 120; - else if (abs(srcpV[x]-srcppV[x])<4 && abs(srcpV[x]-srcpnV[x])<4) maskwV[x] = 110; - else maskwV[x] = 60; - t1 = n == 0 ? false : (abs(srcppU[x] - prvppU[x]) < mthreshC); - t2 = n == 0 ? false : (abs(srcpnU[x] - prvpnU[x]) < mthreshC); - t3 = n == nfrms ? false : (abs(srcppU[x] - nxtppU[x]) < mthreshC); - t4 = n == nfrms ? false : (abs(srcpnU[x] - nxtpnU[x]) < mthreshC); - t5 = n <= 1 ? false : (abs(prvpU[x] - prv2pU[x]) < mthreshC); - t6 = n == 0 ? false : (abs(srcpU[x] - prvpU[x]) < mthreshC); - t7 = n == nfrms ? false : (abs(srcpU[x] - nxtpU[x]) < mthreshC); - t8 = n <= 1 ? false : (abs(prvppU[x] - prv2ppU[x]) < mthreshC); - t9 = n <= 1 ? false : (abs(prvpnU[x] - prv2pnU[x]) < mthreshC); - t10 = n >= nfrms-1 ? false : (abs(nxtppU[x] - nxt2ppU[x]) < mthreshC); - t11 = n >= nfrms-1 ? false : (abs(nxtpnU[x] - nxt2pnU[x]) < mthreshC); - t12 = (abs(srcppU[x] - prv2ppU[x]) < mthreshC); - t13 = (abs(srcpnU[x] - prv2pnU[x]) < mthreshC); - t14 = (abs(nxtppU[x] - prvppU[x]) < mthreshC); - t15 = (abs(nxtpnU[x] - prvpnU[x]) < mthreshC); - t16 = (abs(nxt2ppU[x] - srcppU[x]) < mthreshC); - t17 = (abs(nxt2pnU[x] - srcpnU[x]) < mthreshC); - t18 = (abs(srcpU[x] - prv2pU[x]) < mthreshC); - t19 = (abs(nxtpU[x] - prvpU[x]) < mthreshC); - if (t6 && ((t1 && t2 && ((t3 && t4 && t14 && t15) || (t5 && t18))) || - (t3 && t4 && t7 && t19) || - (t5 && t18 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t1 && t8 && t12) || (t2 && t9 && t13))) || - (t7 && t19 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t3 && t10 && t16) || (t4 && t11 && t17))))) - maskwU[x] = val1; - else if (t1 && t2 && t3 && t4 && t5 && t7 && t14 && t15) maskwU[x] = val1; - else if (t1 && t5 && t2 && t8 && t9 && t12 && t13) maskwU[x] = 20; - else if (t3 && t7 && t4 && t10 && t11 && t16 && t17) maskwU[x] = 10; - else if (abs(prvpU[x]-srcppU[x])<4 && abs(prvpU[x]-srcpnU[x])<4) maskwU[x] = 120; - else if (abs(srcpU[x]-srcppU[x])<4 && abs(srcpU[x]-srcpnU[x])<4) maskwU[x] = 110; - else maskwU[x] = 60; - } - prv2ppV += prv2_pitchUV; - prv2pV += prv2_pitchUV; - prv2pnV += prv2_pitchUV; - prv2ppU += prv2_pitchUV; - prv2pU += prv2_pitchUV; - prv2pnU += prv2_pitchUV; - prvppV += prv_pitchUV; - prvpV += prv_pitchUV; - prvpnV += prv_pitchUV; - prvppU += prv_pitchUV; - prvpU += prv_pitchUV; - prvpnU += prv_pitchUV; - srcppV += src_pitchUV; - srcpV += src_pitchUV; - srcpnV += src_pitchUV; - srcppU += src_pitchUV; - srcpU += src_pitchUV; - srcpnU += src_pitchUV; - nxtppV += nxt_pitchUV; - nxtpV += nxt_pitchUV; - nxtpnV += nxt_pitchUV; - nxtppU += nxt_pitchUV; - nxtpU += nxt_pitchUV; - nxtpnU += nxt_pitchUV; - nxt2ppV += nxt2_pitchUV; - nxt2pV += nxt2_pitchUV; - nxt2pnV += nxt2_pitchUV; - nxt2ppU += nxt2_pitchUV; - nxt2pU += nxt2_pitchUV; - nxt2pnU += nxt2_pitchUV; - maskwV += mask_pitchUV; - maskwU += mask_pitchUV; - } - } - else - { - for (y=1; yGetWritePtr(PLANAR_Y); - unsigned char *maskpV = mask->GetWritePtr(PLANAR_V); - unsigned char *maskpU = mask->GetWritePtr(PLANAR_U); - int mask_pitchY = mask->GetPitch(PLANAR_Y); - int mask_pitchY2 = mask_pitchY<<1; - int mask_pitchY4 = mask_pitchY<<2; - int mask_pitchUV = mask->GetPitch(PLANAR_V); - int mask_pitchUV2 = mask_pitchUV<<1; - int HeightUV = mask->GetHeight(PLANAR_V); - int WidthUV = mask->GetRowSize(PLANAR_V); - maskpY += mask_pitchY*PRM(field); - maskpV += mask_pitchUV*PRM(field); - maskpU += mask_pitchUV*PRM(field); - unsigned char *maskpnY = maskpY + mask_pitchY2; - int x, y; - for (y=PRM(field); yGetWritePtr(PLANAR_Y); - unsigned char *maskpV = mask->GetWritePtr(PLANAR_V); - unsigned char *maskpU = mask->GetWritePtr(PLANAR_U); - int mask_pitchY = mask->GetPitch(PLANAR_Y); - int mask_pitchY2 = mask_pitchY<<1; - int mask_pitchY4 = mask_pitchY<<2; - int mask_pitchUV = mask->GetPitch(PLANAR_V); - int mask_pitchUV2 = mask_pitchUV<<1; - int HeightUV = mask->GetHeight(PLANAR_V); - int WidthUV = mask->GetRowSize(PLANAR_V); - maskpY += mask_pitchY*PRM(field); - maskpV += mask_pitchUV*PRM(field); - maskpU += mask_pitchUV*PRM(field); - unsigned char *maskpnY = maskpY + mask_pitchY2; - int x, y; - for (y=PRM(field); yGetWritePtr(PLANAR_Y); - unsigned char *maskpV = mask->GetWritePtr(PLANAR_V); - unsigned char *maskpU = mask->GetWritePtr(PLANAR_U); - int mask_pitchY = mask->GetPitch(PLANAR_Y); - int mask_pitchY2 = mask_pitchY<<1; - int mask_pitchY4 = mask_pitchY<<2; - int mask_pitchUV = mask->GetPitch(PLANAR_V); - int mask_pitchUV2 = mask_pitchUV<<1; - int HeightUV = mask->GetHeight(PLANAR_V); - int WidthUV = mask->GetRowSize(PLANAR_V); - maskpY += mask_pitchY*PRM(field); - maskpV += mask_pitchUV*PRM(field); - maskpU += mask_pitchUV*PRM(field); - unsigned char *maskpnY = maskpY + mask_pitchY2; - int x, y; - for (y=PRM(field); yGetWritePtr(PLANAR_Y); - unsigned char *maskpV = mask->GetWritePtr(PLANAR_V); - unsigned char *maskpU = mask->GetWritePtr(PLANAR_U); - int mask_pitchY = mask->GetPitch(PLANAR_Y); - int mask_pitchY2 = mask_pitchY<<1; - int mask_pitchUV = mask->GetPitch(PLANAR_V); - int mask_pitchUV2 = mask_pitchUV<<1; - int HeightY = mask->GetHeight(PLANAR_Y); - int HeightUV = mask->GetHeight(PLANAR_V); - int WidthY = mask->GetRowSize(PLANAR_Y); - int WidthUV = mask->GetRowSize(PLANAR_V); - maskpY += mask_pitchY*(2+PRM(field)); - maskpV += mask_pitchUV*(2+PRM(field)); - maskpU += mask_pitchUV*(2+PRM(field)); - unsigned char *maskppY = maskpY - mask_pitchY2; - unsigned char *maskppV = maskpV - mask_pitchUV2; - unsigned char *maskppU = maskpU - mask_pitchUV2; - unsigned char *maskpnY = maskpY + mask_pitchY2; - unsigned char *maskpnV = maskpV + mask_pitchUV2; - unsigned char *maskpnU = maskpU + mask_pitchUV2; - int sum, xhi, v, x, y; - for (y=2; y0; --b) - { - if (b == 3) plane = PLANAR_U; - else if (b == 2) plane = PLANAR_V; - else plane = PLANAR_Y; - srcp = src->GetReadPtr(plane); - src_pitch = src->GetPitch(plane); - Width = src->GetRowSize(plane); - Height = src->GetHeight(plane); - srcpp = srcp - src_pitch; - srcppp = srcpp - src_pitch; - srcpn = srcp + src_pitch; - srcpnn = srcpn + src_pitch; - cmkp = cmask->GetWritePtr(plane); - cmk_pitch = cmask->GetPitch(plane); - memset(cmkp,0,Height*cmk_pitch); - for (x=0; x cthresh || sFirst < -cthresh) - { - sFirst = abs(srcpnn[x]+(srcp[x]<<2)+srcpnn[x]-(3*(srcpn[x]+srcpn[x]))); - if (sFirst > cthresh6) cmkp[x] = 0x3C; - } - } - srcppp += src_pitch; - srcpp += src_pitch; - srcp += src_pitch; - srcpn += src_pitch; - srcpnn += src_pitch; - cmkp += cmk_pitch; - for (x=0; x cthresh && sSecond > cthresh) || (sFirst < -cthresh && sSecond < -cthresh)) - { - sFirst = abs(srcpnn[x]+(srcp[x]<<2)+srcpnn[x]-(3*(srcpp[x]+srcpn[x]))); - if (sFirst > cthresh6) cmkp[x] = 0x3C; - } - } - srcppp += src_pitch; - srcpp += src_pitch; - srcp += src_pitch; - srcpn += src_pitch; - srcpnn += src_pitch; - cmkp += cmk_pitch; - for (y=2; y cthresh && sSecond > cthresh) || (sFirst < -cthresh && sSecond < -cthresh)) - { - sFirst = abs(srcppp[x]+(srcp[x]<<2)+srcpnn[x]-(3*(srcpp[x]+srcpn[x]))); - if (sFirst > cthresh6) cmkp[x] = 0x3C; - } - } - srcppp += src_pitch; - srcpp += src_pitch; - srcp += src_pitch; - srcpn += src_pitch; - srcpnn += src_pitch; - cmkp += cmk_pitch; - } - for (x=0; x cthresh && sSecond > cthresh) || (sFirst < -cthresh && sSecond < -cthresh)) - { - sFirst = abs(srcppp[x]+(srcp[x]<<2)+srcppp[x]-(3*(srcpp[x]+srcpn[x]))); - if (sFirst > cthresh6) cmkp[x] = 0x3C; - } - } - srcppp += src_pitch; - srcpp += src_pitch; - srcp += src_pitch; - srcpn += src_pitch; - srcpnn += src_pitch; - cmkp += cmk_pitch; - for (x=0; x cthresh || sFirst < -cthresh) - { - sFirst = abs(srcppp[x]+(srcp[x]<<2)+srcppp[x]-(3*(srcpp[x]+srcpp[x]))); - if (sFirst > cthresh6) cmkp[x] = 0x3C; - } - } - } - if (chroma) - { - cmkp = cmask->GetWritePtr(PLANAR_Y); - cmkpU = cmask->GetWritePtr(PLANAR_U); - cmkpV = cmask->GetWritePtr(PLANAR_V); - Width = cmask->GetRowSize(PLANAR_V); - Height = cmask->GetHeight(PLANAR_V); - cmk_pitch = cmask->GetPitch(PLANAR_Y); - cmk_pitchUV = cmask->GetPitch(PLANAR_V); - cmkpp = cmkp - cmk_pitch; - cmkpn = cmkp + cmk_pitch; - cmkpnn = cmkpn + cmk_pitch; - cmkppU = cmkpU - cmk_pitchUV; - cmkpnU = cmkpU + cmk_pitchUV; - cmkppV = cmkpV - cmk_pitchUV; - cmkpnV = cmkpV + cmk_pitchUV; - cmk_pitch <<= 1; - for (y=1; yGetPitch(PLANAR_Y); - cmkp = cmask->GetWritePtr(PLANAR_Y) + cmk_pitch; - cmkpp = cmkp - cmk_pitch; - cmkpn = cmkp + cmk_pitch; - Width = cmask->GetRowSize(PLANAR_Y); - Height = cmask->GetHeight(PLANAR_Y); - xblocks = ((Width+xhalf)>>xshift) + 1; - xblocks4 = xblocks<<2; - yblocks = ((Height+yhalf)>>yshift) + 1; - arraysize = (xblocks*yblocks)<<2; - memset(cArray,0,arraysize*sizeof(int)); - for (y=1; y>yshift)*xblocks4; - temp2 = ((y+yhalf)>>yshift)*xblocks4; - for (x=0; x>xshift)<<2; - box2 = ((x+xhalf)>>xshift)<<2; - ++cArray[temp1+box1+0]; - ++cArray[temp1+box2+1]; - ++cArray[temp2+box1+2]; - ++cArray[temp2+box2+3]; - } - } - cmkpp += cmk_pitch; - cmkp += cmk_pitch; - cmkpn += cmk_pitch; - } - for (x=0; x MI) return true; - } - return false; -} - -void vidTDeint::subtractFieldsYV12(ADMImage *prv, ADMImage *src, ADMImage *nxt) -{ - const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); - const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); - const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); - int prv_pitchY = prv->GetPitch(PLANAR_Y); - int prv_pitchUV = prv->GetPitch(PLANAR_V); - const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); - const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); - const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); - int src_pitchY = src->GetPitch(PLANAR_Y); - int src_pitchUV = src->GetPitch(PLANAR_V); - int WidthY = src->GetRowSize(PLANAR_Y)-8; - int HeightY = src->GetHeight(PLANAR_Y); - int WidthUV = src->GetRowSize(PLANAR_V)-4; - int HeightUV = src->GetHeight(PLANAR_V); - const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); - const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); - const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); - const unsigned char *prvpfY, *prvnfY, *nxtpfY, *nxtnfY; - const unsigned char *prvpfU, *prvnfU, *nxtpfU, *nxtnfU; - const unsigned char *prvpfV, *prvnfV, *nxtpfV, *nxtnfV; - const unsigned char *curpfY, *curfY, *curnfY; - const unsigned char *curpfU, *curfU, *curnfU; - const unsigned char *curpfV, *curfV, *curnfV; - int nxt_pitchY = nxt->GetPitch(PLANAR_Y); - int nxt_pitchUV = nxt->GetPitch(PLANAR_V); - int prvf_pitchY, prvf_pitchUV; - int curf_pitchY, curf_pitchUV; - int nxtf_pitchY, nxtf_pitchUV; - int x, y, temp, temp2; - accumP = accumN = 0; - if (PRM(field)^PRM(order)) - { - prvf_pitchY = src_pitchY<<1; - prvf_pitchUV = src_pitchUV<<1; - curf_pitchY = src_pitchY<<1; - curf_pitchUV = src_pitchUV<<1; - nxtf_pitchY = nxt_pitchY<<1; - nxtf_pitchUV = nxt_pitchUV<<1; - prvpfY = srcpY + ((PRM(field) == 1 ? 1 : 2)*src_pitchY); - prvpfU = srcpU + ((PRM(field) == 1 ? 1 : 2)*src_pitchUV); - prvpfV = srcpV + ((PRM(field) == 1 ? 1 : 2)*src_pitchUV); - curfY = srcpY + ((3-PRM(field))*src_pitchY); - curfU = srcpU + ((3-PRM(field))*src_pitchUV); - curfV = srcpV + ((3-PRM(field))*src_pitchUV); - nxtpfY = nxtpY + ((PRM(field) == 1 ? 1 : 2)*nxt_pitchY); - nxtpfU = nxtpU + ((PRM(field) == 1 ? 1 : 2)*nxt_pitchUV); - nxtpfV = nxtpV + ((PRM(field) == 1 ? 1 : 2)*nxt_pitchUV); - } - else - { - prvf_pitchY = prv_pitchY<<1; - prvf_pitchUV = prv_pitchUV<<1; - curf_pitchY = src_pitchY<<1; - curf_pitchUV = src_pitchUV<<1; - nxtf_pitchY = src_pitchY<<1; - nxtf_pitchUV = src_pitchUV<<1; - prvpfY = prvpY + ((PRM(field) == 1 ? 1 : 2)*prv_pitchY); - prvpfU = prvpU + ((PRM(field) == 1 ? 1 : 2)*prv_pitchUV); - prvpfV = prvpV + ((PRM(field) == 1 ? 1 : 2)*prv_pitchUV); - curfY = srcpY + ((3-PRM(field))*src_pitchY); - curfU = srcpU + ((3-PRM(field))*src_pitchUV); - curfV = srcpV + ((3-PRM(field))*src_pitchUV); - nxtpfY = srcpY + ((PRM(field) == 1 ? 1 : 2)*src_pitchY); - nxtpfU = srcpU + ((PRM(field) == 1 ? 1 : 2)*src_pitchUV); - nxtpfV = srcpV + ((PRM(field) == 1 ? 1 : 2)*src_pitchUV); - } - prvnfY = prvpfY + prvf_pitchY; - prvnfU = prvpfU + prvf_pitchUV; - prvnfV = prvpfV + prvf_pitchUV; - curpfY = curfY - curf_pitchY; - curpfU = curfU - curf_pitchUV; - curpfV = curfV - curf_pitchUV; - curnfY = curfY + curf_pitchY; - curnfU = curfU + curf_pitchUV; - curnfV = curfV + curf_pitchUV; - nxtnfY = nxtpfY + nxtf_pitchY; - nxtnfU = nxtpfU + nxtf_pitchUV; - nxtnfV = nxtpfV + nxtf_pitchUV; - for (y=2; y 3 || abs(prvnfY[x]-nxtnfY[x]) > 3) - { - temp = (curpfY[x]+(curfY[x]<<2)+curnfY[x]); - temp2 = abs(3*(prvpfY[x]+prvnfY[x])-temp); - if (temp2 > 23) accumP += temp2; - temp2 = abs(3*(nxtpfY[x]+nxtnfY[x])-temp); - if (temp2 > 23) accumN += temp2; - } - } - prvpfY += prvf_pitchY; - prvnfY += prvf_pitchY; - curpfY += curf_pitchY; - curfY += curf_pitchY; - curnfY += curf_pitchY; - nxtpfY += nxtf_pitchY; - nxtnfY += nxtf_pitchY; - } - for (y=2; y 3 || abs(prvnfU[x]-nxtnfU[x]) > 3) - { - temp = (curpfU[x]+(curfU[x]<<2)+curnfU[x]); - temp2 = abs(3*(prvpfU[x]+prvnfU[x])-temp); - if (temp2 > 23) accumP += temp2; - temp2 = abs(3*(nxtpfU[x]+nxtnfU[x])-temp); - if (temp2 > 23) accumN += temp2; - } - if (abs(prvpfV[x]-nxtpfV[x]) > 3 || abs(prvnfV[x]-nxtnfV[x]) > 3) - { - temp = (curpfV[x]+(curfV[x]<<2)+curnfV[x]); - temp2 = abs(3*(prvpfV[x]+prvnfV[x])-temp); - if (temp2 > 23) accumP += temp2; - temp2 = abs(3*(nxtpfV[x]+nxtnfV[x])-temp); - if (temp2 > 23) accumN += temp2; - } - } - prvpfU += prvf_pitchUV; - prvnfU += prvf_pitchUV; - prvpfV += prvf_pitchUV; - prvnfV += prvf_pitchUV; - curpfU += curf_pitchUV; - curfU += curf_pitchUV; - curnfU += curf_pitchUV; - curpfV += curf_pitchUV; - curfV += curf_pitchUV; - curnfV += curf_pitchUV; - nxtpfU += nxtf_pitchUV; - nxtnfU += nxtf_pitchUV; - nxtpfV += nxtf_pitchUV; - nxtnfV += nxtf_pitchUV; - } -} - -void vidTDeint::mapColorsYV12(ADMImage *dst, ADMImage *mask) -{ - const unsigned char *maskpY = mask->GetReadPtr(PLANAR_Y); - const unsigned char *maskpV = mask->GetReadPtr(PLANAR_V); - const unsigned char *maskpU = mask->GetReadPtr(PLANAR_U); - int mask_pitchY = mask->GetPitch(PLANAR_Y); - int mask_pitchUV = mask->GetPitch(PLANAR_V); - int HeightY = mask->GetHeight(PLANAR_Y); - int HeightUV = mask->GetHeight(PLANAR_V); - int WidthY = mask->GetRowSize(PLANAR_Y); - int WidthUV = mask->GetRowSize(PLANAR_V); - unsigned char *dstpY = dst->GetWritePtr(PLANAR_Y); - unsigned char *dstpV = dst->GetWritePtr(PLANAR_V); - unsigned char *dstpU = dst->GetWritePtr(PLANAR_U); - int dst_pitchY = dst->GetPitch(PLANAR_Y); - int dst_pitchUV = dst->GetPitch(PLANAR_V); - int x, y; - for (y=0; yGetReadPtr(PLANAR_Y); - const unsigned char *maskpV = mask->GetReadPtr(PLANAR_V); - const unsigned char *maskpU = mask->GetReadPtr(PLANAR_U); - int mask_pitchY = mask->GetPitch(PLANAR_Y); - int mask_pitchUV = mask->GetPitch(PLANAR_V); - int HeightY = mask->GetHeight(PLANAR_Y); - int HeightUV = mask->GetHeight(PLANAR_V); - int WidthY = mask->GetRowSize(PLANAR_Y); - int WidthUV = mask->GetRowSize(PLANAR_V); - unsigned char *dstpY = dst->GetWritePtr(PLANAR_Y); - unsigned char *dstpV = dst->GetWritePtr(PLANAR_V); - unsigned char *dstpU = dst->GetWritePtr(PLANAR_U); - int dst_pitchY = dst->GetPitch(PLANAR_Y); - int dst_pitchUV = dst->GetPitch(PLANAR_V); - const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); - const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); - const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); - int prv_pitchY = prv->GetPitch(PLANAR_Y); - int prv_pitchUV = prv->GetPitch(PLANAR_V); - const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); - const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); - const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); - int src_pitchY = src->GetPitch(PLANAR_Y); - int src_pitchUV = src->GetPitch(PLANAR_V); - const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); - const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); - const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); - int nxt_pitchY = nxt->GetPitch(PLANAR_Y); - int nxt_pitchUV = nxt->GetPitch(PLANAR_V); - int x, y; - for (y=0; y>1; - else if (maskpY[x] == 50) dstpY[x] = (srcpY[x]+prvpY[x]+1)>>1; - else if (maskpY[x] == 60) dstpY[x] = 255; - } - prvpY += prv_pitchY; - srcpY += src_pitchY; - nxtpY += nxt_pitchY; - maskpY += mask_pitchY; - dstpY += dst_pitchY; - } - for (y=0; y>1; - else if (maskpV[x] == 50) dstpV[x] = (srcpV[x]+prvpV[x]+1)>>1; - else if (maskpV[x] == 60) dstpV[x] = 255; - if (maskpU[x] == 10 || maskpU[x] == 110) dstpU[x] = srcpU[x]; - else if (maskpU[x] == 20 || maskpU[x] == 120) dstpU[x] = prvpU[x]; - else if (maskpU[x] == 30 || maskpU[x] == 130) dstpU[x] = nxtpU[x]; - else if (maskpU[x] == 40) dstpU[x] = (srcpU[x]+nxtpU[x]+1)>>1; - else if (maskpU[x] == 50) dstpU[x] = (srcpU[x]+prvpU[x]+1)>>1; - else if (maskpU[x] == 60) dstpU[x] = 255; - } - prvpV += prv_pitchUV; - prvpU += prv_pitchUV; - srcpV += src_pitchUV; - srcpU += src_pitchUV; - nxtpV += nxt_pitchUV; - nxtpU += nxt_pitchUV; - maskpV += mask_pitchUV; - maskpU += mask_pitchUV; - dstpV += dst_pitchUV; - dstpU += dst_pitchUV; - } -} - -void vidTDeint::cubicDeintYV12(ADMImage *dst, ADMImage *mask, - ADMImage *prv, ADMImage *src, ADMImage *nxt) -{ - const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); - const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); - const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); - int prv_pitchY = prv->GetPitch(PLANAR_Y); - int prv_pitchUV = prv->GetPitch(PLANAR_V); - const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); - const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); - const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); - int src_pitchY = src->GetPitch(PLANAR_Y); - int src_pitchY2 = src_pitchY<<1; - int src_pitchUV = src->GetPitch(PLANAR_V); - int src_pitchUV2 = src_pitchUV<<1; - int WidthY = src->GetRowSize(PLANAR_Y); - int WidthUV = src->GetRowSize(PLANAR_V); - int HeightY = src->GetHeight(PLANAR_Y); - int HeightUV = src->GetHeight(PLANAR_V); - const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); - const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); - const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); - int nxt_pitchY = nxt->GetPitch(PLANAR_Y); - int nxt_pitchUV = nxt->GetPitch(PLANAR_V); - unsigned char *dstpY = dst->GetWritePtr(PLANAR_Y); - unsigned char *dstpV = dst->GetWritePtr(PLANAR_V); - unsigned char *dstpU = dst->GetWritePtr(PLANAR_U); - int dst_pitchY = dst->GetPitch(PLANAR_Y); - int dst_pitchUV = dst->GetPitch(PLANAR_V); - const unsigned char *maskpY = mask->GetReadPtr(PLANAR_Y); - const unsigned char *maskpV = mask->GetReadPtr(PLANAR_V); - const unsigned char *maskpU = mask->GetReadPtr(PLANAR_U); - int mask_pitchY = mask->GetPitch(PLANAR_Y); - int mask_pitchUV = mask->GetPitch(PLANAR_V); - const unsigned char *srcppY = srcpY - src_pitchY; - const unsigned char *srcpppY = srcppY - src_pitchY2; - const unsigned char *srcpnY = srcpY + src_pitchY; - const unsigned char *srcpnnY = srcpnY + src_pitchY2; - const unsigned char *srcppV = srcpV - src_pitchUV; - const unsigned char *srcpppV = srcppV - src_pitchUV2; - const unsigned char *srcpnV = srcpV + src_pitchUV; - const unsigned char *srcpnnV = srcpnV + src_pitchUV2; - const unsigned char *srcppU = srcpU - src_pitchUV; - const unsigned char *srcpppU = srcppU - src_pitchUV2; - const unsigned char *srcpnU = srcpU + src_pitchUV; - const unsigned char *srcpnnU = srcpnU + src_pitchUV2; - int x, y; - for (y=0; y>1; - else if (maskpY[x] == 50) dstpY[x] = (srcpY[x]+prvpY[x]+1)>>1; - else if (maskpY[x] == 60) - { - if (y<3 || y>HeightY-4) dstpY[x] = (srcpnY[x]+srcppY[x]+1)>>1; - else dstpY[x] = cubicInt(srcpppY[x],srcppY[x],srcpnY[x],srcpnnY[x]); - } - } - prvpY += prv_pitchY; - srcpppY += src_pitchY; - srcppY += src_pitchY; - srcpY += src_pitchY; - srcpnY += src_pitchY; - srcpnnY += src_pitchY; - nxtpY += nxt_pitchY; - maskpY += mask_pitchY; - dstpY += dst_pitchY; - } - for (y=0; y>1; - else if (maskpV[x] == 50) dstpV[x] = (srcpV[x]+prvpV[x]+1)>>1; - else if (maskpV[x] == 60) - { - if (y<3 || y>HeightUV-4) dstpV[x] = (srcpnV[x]+srcppV[x]+1)>>1; - else dstpV[x] = cubicInt(srcpppV[x],srcppV[x],srcpnV[x],srcpnnV[x]); - } - if (maskpU[x] == 10 || maskpU[x] == 110) dstpU[x] = srcpU[x]; - else if (maskpU[x] == 20 || maskpU[x] == 120) dstpU[x] = prvpU[x]; - else if (maskpU[x] == 30 || maskpU[x] == 130) dstpU[x] = nxtpU[x]; - else if (maskpU[x] == 40) dstpU[x] = (srcpU[x]+nxtpU[x]+1)>>1; - else if (maskpU[x] == 50) dstpU[x] = (srcpU[x]+prvpU[x]+1)>>1; - else if (maskpU[x] == 60) - { - if (y<3 || y>HeightUV-4) dstpU[x] = (srcpnU[x]+srcppU[x]+1)>>1; - else dstpU[x] = cubicInt(srcpppU[x],srcppU[x],srcpnU[x],srcpnnU[x]); - } - } - prvpV += prv_pitchUV; - prvpU += prv_pitchUV; - srcpppV += src_pitchUV; - srcppV += src_pitchUV; - srcpV += src_pitchUV; - srcpnV += src_pitchUV; - srcpnnV += src_pitchUV; - srcpppU += src_pitchUV; - srcppU += src_pitchUV; - srcpU += src_pitchUV; - srcpnU += src_pitchUV; - srcpnnU += src_pitchUV; - nxtpV += nxt_pitchUV; - nxtpU += nxt_pitchUV; - maskpV += mask_pitchUV; - maskpU += mask_pitchUV; - dstpV += dst_pitchUV; - dstpU += dst_pitchUV; - } -} - -void vidTDeint::ELADeintYV12(ADMImage *dst, ADMImage *mask, - ADMImage *prv, ADMImage *src, ADMImage *nxt) -{ - const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); - const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); - const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); - int prv_pitchY = prv->GetPitch(PLANAR_Y); - int prv_pitchUV = prv->GetPitch(PLANAR_V); - const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); - const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); - const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); - int src_pitchY = src->GetPitch(PLANAR_Y); - int src_pitchUV = src->GetPitch(PLANAR_V); - int WidthY = src->GetRowSize(PLANAR_Y); - int WidthUV = src->GetRowSize(PLANAR_V); - int HeightY = src->GetHeight(PLANAR_Y); - int HeightUV = src->GetHeight(PLANAR_V); - const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); - const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); - const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); - int nxt_pitchY = nxt->GetPitch(PLANAR_Y); - int nxt_pitchUV = nxt->GetPitch(PLANAR_V); - unsigned char *dstpY = dst->GetWritePtr(PLANAR_Y); - unsigned char *dstpV = dst->GetWritePtr(PLANAR_V); - unsigned char *dstpU = dst->GetWritePtr(PLANAR_U); - int dst_pitchY = dst->GetPitch(PLANAR_Y); - int dst_pitchUV = dst->GetPitch(PLANAR_V); - const unsigned char *maskpY = mask->GetReadPtr(PLANAR_Y); - const unsigned char *maskpV = mask->GetReadPtr(PLANAR_V); - const unsigned char *maskpU = mask->GetReadPtr(PLANAR_U); - int mask_pitchY = mask->GetPitch(PLANAR_Y); - int mask_pitchUV = mask->GetPitch(PLANAR_V); - const unsigned char *srcppY = srcpY - src_pitchY; - const unsigned char *srcpnY = srcpY + src_pitchY; - const unsigned char *srcppV = srcpV - src_pitchUV; - const unsigned char *srcpnV = srcpV + src_pitchUV; - const unsigned char *srcppU = srcpU - src_pitchUV; - const unsigned char *srcpnU = srcpU + src_pitchUV; - int x, y, u, val, stop, temp1, temp2, min, minf, maxf, s1, s2; - for (y=0; y>1; - else if (maskpY[x] == 50) dstpY[x] = (srcpY[x]+prvpY[x]+1)>>1; - else if (maskpY[x] == 60) - { - if (x < 2 || x > WidthY-3 || (abs(srcppY[x]-srcpnY[x]) < 10 && - abs(srcppY[x-2]-srcppY[x+2]) < 10 && abs(srcpnY[x-2]-srcpnY[x+2]) < 10)) - { - dstpY[x] = (srcppY[x]+srcpnY[x]+1)>>1; - } - else - { - stop = min(x-1,min(8,WidthY-2-x)); - minf = min(srcppY[x],srcpnY[x])-2; - maxf = max(srcppY[x],srcpnY[x])+2; - val = (srcppY[x]+srcpnY[x]+1)>>1; - for (min=450, u=0; u<=stop; ++u) - { - s1 = srcppY[x+(u>>1)]+srcppY[x+((u+1)>>1)]; - s2 = srcpnY[x-(u>>1)]+srcpnY[x-((u+1)>>1)]; - temp1 = abs(s1-s2) + abs(srcppY[x-1]-srcpnY[x-1-u]) + - (abs(srcppY[x]-srcpnY[x-u])<<1) + abs(srcppY[x+1]-srcpnY[x+1-u]) + - abs(srcpnY[x-1]-srcppY[x-1+u]) + (abs(srcpnY[x]-srcppY[x+u])<<1) + - abs(srcpnY[x+1]-srcppY[x+1+u]); - temp2 = (s1+s2+2)>>2; - if (temp1 < min && temp2 >= minf && temp2 <= maxf) - { - min = temp1; - val = temp2; - } - s1 = srcppY[x-(u>>1)]+srcppY[x-((u+1)>>1)]; - s2 = srcpnY[x+(u>>1)]+srcpnY[x+((u+1)>>1)]; - temp1 = abs(s1-s2) + abs(srcppY[x-1]-srcpnY[x-1+u]) + - (abs(srcppY[x]-srcpnY[x+u])<<1) + abs(srcppY[x+1]-srcpnY[x+1+u])+ - abs(srcpnY[x-1]-srcppY[x-1-u]) + (abs(srcpnY[x]-srcppY[x-u])<<1) + - abs(srcpnY[x+1]-srcppY[x+1-u]); - temp2 = (s1+s2+2)>>2; - if (temp1 < min && temp2 >= minf && temp2 <= maxf) - { - min = temp1; - val = temp2; - } - } - dstpY[x] = val; - } - } - } - prvpY += prv_pitchY; - srcppY += src_pitchY; - srcpY += src_pitchY; - srcpnY += src_pitchY; - nxtpY += nxt_pitchY; - maskpY += mask_pitchY; - dstpY += dst_pitchY; - } - for (y=0; y>1; - else if (maskpV[x] == 50) dstpV[x] = (srcpV[x]+prvpV[x]+1)>>1; - else if (maskpV[x] == 60) - { - if (x < 2 || x > WidthUV-3 || (abs(srcppV[x]-srcpnV[x]) < 10 && - abs(srcppV[x-2]-srcppV[x+2]) < 10 && abs(srcpnV[x-2]-srcpnV[x+2]) < 10)) - { - dstpV[x] = (srcppV[x]+srcpnV[x]+1)>>1; - } - else - { - stop = min(x-1,min(4,WidthUV-2-x)); - minf = min(srcppV[x],srcpnV[x])-2; - maxf = max(srcppV[x],srcpnV[x])+2; - val = (srcppV[x]+srcpnV[x]+1)>>1; - for (min=450, u=0; u<=stop; ++u) - { - s1 = srcppV[x+(u>>1)]+srcppV[x+((u+1)>>1)]; - s2 = srcpnV[x-(u>>1)]+srcpnV[x-((u+1)>>1)]; - temp1 = abs(s1-s2) + abs(srcppV[x-1]-srcpnV[x-1-u]) + - (abs(srcppV[x]-srcpnV[x-u])<<1) + abs(srcppV[x+1]-srcpnV[x+1-u]) + - abs(srcpnV[x-1]-srcppV[x-1+u]) + (abs(srcpnV[x]-srcppV[x+u])<<1) + - abs(srcpnV[x+1]-srcppV[x+1+u]); - temp2 = (s1+s2+2)>>2; - if (temp1 < min && temp2 >= minf && temp2 <= maxf) - { - min = temp1; - val = temp2; - } - s1 = srcppV[x-(u>>1)]+srcppV[x-((u+1)>>1)]; - s2 = srcpnV[x+(u>>1)]+srcpnV[x+((u+1)>>1)]; - temp1 = abs(s1-s2) + abs(srcppV[x-1]-srcpnV[x-1+u]) + - (abs(srcppV[x]-srcpnV[x+u])<<1) + abs(srcppV[x+1]-srcpnV[x+1+u]) + - abs(srcpnV[x-1]-srcppV[x-1-u]) + (abs(srcpnV[x]-srcppV[x-u])<<1) + - abs(srcpnV[x+1]-srcppV[x+1-u]); - temp2 = (s1+s2+2)>>2; - if (temp1 < min && temp2 >= minf && temp2 <= maxf) - { - min = temp1; - val = temp2; - } - } - dstpV[x] = val; - } - } - if (maskpU[x] == 10 || maskpU[x] == 110) dstpU[x] = srcpU[x]; - else if (maskpU[x] == 20 || maskpU[x] == 120) dstpU[x] = prvpU[x]; - else if (maskpU[x] == 30 || maskpU[x] == 130) dstpU[x] = nxtpU[x]; - else if (maskpU[x] == 40) dstpU[x] = (srcpU[x]+nxtpU[x]+1)>>1; - else if (maskpU[x] == 50) dstpU[x] = (srcpU[x]+prvpU[x]+1)>>1; - else if (maskpU[x] == 60) - { - if (x < 2 || x > WidthUV-3 || (abs(srcppU[x]-srcpnU[x]) < 10 && - abs(srcppU[x-2]-srcppU[x+2]) < 10 && abs(srcpnU[x-2]-srcpnU[x+2]) < 10)) - { - dstpU[x] = (srcppU[x]+srcpnU[x]+1)>>1; - } - else - { - stop = min(x-1,min(4,WidthUV-2-x)); - minf = min(srcppU[x],srcpnU[x])-2; - maxf = max(srcppU[x],srcpnU[x])+2; - val = (srcppU[x]+srcpnU[x]+1)>>1; - for (min=450, u=0; u<=stop; ++u) - { - s1 = srcppU[x+(u>>1)]+srcppU[x+((u+1)>>1)]; - s2 = srcpnU[x-(u>>1)]+srcpnU[x-((u+1)>>1)]; - temp1 = abs(s1-s2) + abs(srcppU[x-1]-srcpnU[x-1-u]) + - (abs(srcppU[x]-srcpnU[x-u])<<1) + abs(srcppU[x+1]-srcpnU[x+1-u]) + - abs(srcpnU[x-1]-srcppU[x-1+u]) + (abs(srcpnU[x]-srcppU[x+u])<<1) + - abs(srcpnU[x+1]-srcppU[x+1+u]); - temp2 = (s1+s2+2)>>2; - if (temp1 < min && temp2 >= minf && temp2 <= maxf) - { - min = temp1; - val = temp2; - } - s1 = srcppU[x-(u>>1)]+srcppU[x-((u+1)>>1)]; - s2 = srcpnU[x+(u>>1)]+srcpnU[x+((u+1)>>1)]; - temp1 = abs(s1-s2) + abs(srcppU[x-1]-srcpnU[x-1+u]) + - (abs(srcppU[x]-srcpnU[x+u])<<1) + abs(srcppU[x+1]-srcpnU[x+1+u]) + - abs(srcpnU[x-1]-srcppU[x-1-u]) + (abs(srcpnU[x]-srcppU[x-u])<<1) + - abs(srcpnU[x+1]-srcppU[x+1-u]); - temp2 = (s1+s2+2)>>2; - if (temp1 < min && temp2 >= minf && temp2 <= maxf) - { - min = temp1; - val = temp2; - } - } - dstpU[x] = val; - } - } - } - prvpV += prv_pitchUV; - prvpU += prv_pitchUV; - srcppV += src_pitchUV; - srcpV += src_pitchUV; - srcpnV += src_pitchUV; - srcppU += src_pitchUV; - srcpU += src_pitchUV; - srcpnU += src_pitchUV; - nxtpV += nxt_pitchUV; - nxtpU += nxt_pitchUV; - maskpV += mask_pitchUV; - maskpU += mask_pitchUV; - dstpV += dst_pitchUV; - dstpU += dst_pitchUV; - } -} - -void vidTDeint::kernelDeintYV12(ADMImage *dst, ADMImage *mask, - ADMImage *prv, ADMImage *src, ADMImage *nxt) -{ - const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); - const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); - const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); - int prv_pitchY = prv->GetPitch(PLANAR_Y); - int prv_pitchY2 = prv_pitchY<<1; - int prv_pitchUV = prv->GetPitch(PLANAR_V); - int prv_pitchUV2 = prv_pitchUV<<1; - const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); - const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); - const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); - int src_pitchY = src->GetPitch(PLANAR_Y); - int src_pitchUV = src->GetPitch(PLANAR_V); - int src_pitchY2 = src_pitchY<<1; - int src_pitchUV2 = src_pitchUV<<1; - int WidthY = src->GetRowSize(PLANAR_Y); - int WidthUV = src->GetRowSize(PLANAR_V); - int HeightY = src->GetHeight(PLANAR_Y); - int HeightUV = src->GetHeight(PLANAR_V); - const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); - const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); - const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); - int nxt_pitchY = nxt->GetPitch(PLANAR_Y); - int nxt_pitchY2 = nxt_pitchY<<1; - int nxt_pitchUV = nxt->GetPitch(PLANAR_V); - int nxt_pitchUV2 = nxt_pitchUV<<1; - unsigned char *dstpY = dst->GetWritePtr(PLANAR_Y); - unsigned char *dstpU = dst->GetWritePtr(PLANAR_U); - unsigned char *dstpV = dst->GetWritePtr(PLANAR_V); - int dst_pitchY = dst->GetPitch(PLANAR_Y); - int dst_pitchUV = dst->GetPitch(PLANAR_V); - const unsigned char *maskpY = mask->GetReadPtr(PLANAR_Y); - const unsigned char *maskpU = mask->GetReadPtr(PLANAR_U); - const unsigned char *maskpV = mask->GetReadPtr(PLANAR_V); - int mask_pitchY = mask->GetPitch(PLANAR_Y); - int mask_pitchUV = mask->GetPitch(PLANAR_V); - const unsigned char *srcppY = srcpY - src_pitchY; - const unsigned char *srcppU = srcpU - src_pitchUV; - const unsigned char *srcppV = srcpV - src_pitchUV; - const unsigned char *srcpppY = srcppY - src_pitchY2; - const unsigned char *srcpppU = srcppU - src_pitchUV2; - const unsigned char *srcpppV = srcppV - src_pitchUV2; - const unsigned char *srcpnY = srcpY + src_pitchY; - const unsigned char *srcpnU = srcpU + src_pitchUV; - const unsigned char *srcpnV = srcpV + src_pitchUV; - const unsigned char *srcpnnY = srcpnY + src_pitchY2; - const unsigned char *srcpnnU = srcpnU + src_pitchUV2; - const unsigned char *srcpnnV = srcpnV + src_pitchUV2; - const unsigned char *kercY, *kerpY, *kerppY, *kernY, *kernnY; - const unsigned char *kercU, *kerpU, *kerppU, *kernU, *kernnU; - const unsigned char *kercV, *kerpV, *kerppV, *kernV, *kernnV; - int ker_pitchY, ker_pitchUV, x, y, temp; - if (accumP <= accumN) - { - if (PRM(field)^PRM(order)) - { - ker_pitchY = src_pitchY; - ker_pitchUV = src_pitchUV; - kerppY = srcpY - (src_pitchY2<<1); - kerppU = srcpU - (src_pitchUV2<<1); - kerppV = srcpV - (src_pitchUV2<<1); - kerpY = srcpY - src_pitchY2; - kerpU = srcpU - src_pitchUV2; - kerpV = srcpV - src_pitchUV2; - kercY = srcpY; - kercU = srcpU; - kercV = srcpV; - kernY = srcpY + src_pitchY2; - kernU = srcpU + src_pitchUV2; - kernV = srcpV + src_pitchUV2; - kernnY = srcpY + (src_pitchY2<<1); - kernnU = srcpU + (src_pitchUV2<<1); - kernnV = srcpV + (src_pitchUV2<<1); - } - else - { - ker_pitchY = prv_pitchY; - ker_pitchUV = prv_pitchUV; - kerppY = prvpY - (prv_pitchY2<<1); - kerppU = prvpU - (prv_pitchUV2<<1); - kerppV = prvpV - (prv_pitchUV2<<1); - kerpY = prvpY - prv_pitchY2; - kerpU = prvpU - prv_pitchUV2; - kerpV = prvpV - prv_pitchUV2; - kercY = prvpY; - kercU = prvpU; - kercV = prvpV; - kernY = prvpY + prv_pitchY2; - kernU = prvpU + prv_pitchUV2; - kernV = prvpV + prv_pitchUV2; - kernnY = prvpY + (prv_pitchY2<<1); - kernnU = prvpU + (prv_pitchUV2<<1); - kernnV = prvpV + (prv_pitchUV2<<1); - } - } - else - { - if (PRM(field)^PRM(order)) - { - ker_pitchY = nxt_pitchY; - ker_pitchUV = nxt_pitchUV; - kerppY = nxtpY - (nxt_pitchY2<<1); - kerppU = nxtpU - (nxt_pitchUV2<<1); - kerppV = nxtpV - (nxt_pitchUV2<<1); - kerpY = nxtpY - nxt_pitchY2; - kerpU = nxtpU - nxt_pitchUV2; - kerpV = nxtpV - nxt_pitchUV2; - kercY = nxtpY; - kercU = nxtpU; - kercV = nxtpV; - kernY = nxtpY + nxt_pitchY2; - kernU = nxtpU + nxt_pitchUV2; - kernV = nxtpV + nxt_pitchUV2; - kernnY = nxtpY + (nxt_pitchY2<<1); - kernnU = nxtpU + (nxt_pitchUV2<<1); - kernnV = nxtpV + (nxt_pitchUV2<<1); - } - else - { - ker_pitchY = src_pitchY; - ker_pitchUV = src_pitchUV; - kerppY = srcpY - (src_pitchY2<<1); - kerppU = srcpU - (src_pitchUV2<<1); - kerppV = srcpV - (src_pitchUV2<<1); - kerpY = srcpY - src_pitchY2; - kerpU = srcpU - src_pitchUV2; - kerpV = srcpV - src_pitchUV2; - kercY = srcpY; - kercU = srcpU; - kercV = srcpV; - kernY = srcpY + src_pitchY2; - kernU = srcpU + src_pitchUV2; - kernV = srcpV + src_pitchUV2; - kernnY = srcpY + (src_pitchY2<<1); - kernnU = srcpU + (src_pitchUV2<<1); - kernnV = srcpV + (src_pitchUV2<<1); - } - } - for (y=0; y>1; - else if (maskpY[x] == 50) dstpY[x] = (srcpY[x]+prvpY[x]+1)>>1; - else if (maskpY[x] == 60) - { - if (sharp && y>3 && y 255) dstpY[x] = 255; - else if (temp < 0) dstpY[x] = 0; - else dstpY[x] = temp; - } - else if (y>1 && y> 4; - if (temp > 255) dstpY[x] = 255; - else if (temp < 0) dstpY[x] = 0; - else dstpY[x] = temp; - } - else dstpY[x] = (srcpnY[x]+srcppY[x]+1)>>1; - } - } - prvpY += prv_pitchY; - srcpppY += src_pitchY; - srcppY += src_pitchY; - srcpY += src_pitchY; - srcpnY += src_pitchY; - srcpnnY += src_pitchY; - kerppY += ker_pitchY; - kerpY += ker_pitchY; - kercY += ker_pitchY; - kernY += ker_pitchY; - kernnY += ker_pitchY; - nxtpY += nxt_pitchY; - maskpY += mask_pitchY; - dstpY += dst_pitchY; - } - for (y=0; y>1; - else if (maskpU[x] == 50) dstpU[x] = (srcpU[x]+prvpU[x]+1)>>1; - else if (maskpU[x] == 60) - { - if (sharp && y>3 && y 255) dstpU[x] = 255; - else if (temp < 0) dstpU[x] = 0; - else dstpU[x] = temp; - } - else if (y>1 && y> 4; - if (temp > 255) dstpU[x] = 255; - else if (temp < 0) dstpU[x] = 0; - else dstpU[x] = temp; - } - else dstpU[x] = (srcpnU[x]+srcppU[x]+1)>>1; - } - if (maskpV[x] == 10 || maskpV[x] == 110) dstpV[x] = srcpV[x]; - else if (maskpV[x] == 20 || maskpV[x] == 120) dstpV[x] = prvpV[x]; - else if (maskpV[x] == 30 || maskpV[x] == 130) dstpV[x] = nxtpV[x]; - else if (maskpV[x] == 40) dstpV[x] = (srcpV[x]+nxtpV[x]+1)>>1; - else if (maskpV[x] == 50) dstpV[x] = (srcpV[x]+prvpV[x]+1)>>1; - else if (maskpV[x] == 60) - { - if (sharp && y>3 && y 255) dstpV[x] = 255; - else if (temp < 0) dstpV[x] = 0; - else dstpV[x] = temp; - } - else if (y>1 && y> 4; - if (temp > 255) dstpV[x] = 255; - else if (temp < 0) dstpV[x] = 0; - else dstpV[x] = temp; - } - else dstpV[x] = (srcpnV[x]+srcppV[x]+1)>>1; - } - - } - prvpU += prv_pitchUV; - prvpV += prv_pitchUV; - srcpppU += src_pitchUV; - srcpppV += src_pitchUV; - srcppU += src_pitchUV; - srcppV += src_pitchUV; - srcpU += src_pitchUV; - srcpV += src_pitchUV; - srcpnU += src_pitchUV; - srcpnV += src_pitchUV; - srcpnnU += src_pitchUV; - srcpnnV += src_pitchUV; - kerppU += ker_pitchUV; - kerppV += ker_pitchUV; - kerpU += ker_pitchUV; - kerpV += ker_pitchUV; - kercU += ker_pitchUV; - kercV += ker_pitchUV; - kernU += ker_pitchUV; - kernV += ker_pitchUV; - kernnU += ker_pitchUV; - kernnV += ker_pitchUV; - nxtpU += nxt_pitchUV; - nxtpV += nxt_pitchUV; - maskpU += mask_pitchUV; - maskpV += mask_pitchUV; - dstpU += dst_pitchUV; - dstpV += dst_pitchUV; - } -} - -void vidTDeint::smartELADeintYV12(ADMImage *dst, ADMImage *mask, - ADMImage *prv, ADMImage *src, ADMImage *nxt) -{ - const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); - const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); - const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); - int prv_pitchY = prv->GetPitch(PLANAR_Y); - int prv_pitchUV = prv->GetPitch(PLANAR_V); - const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); - const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); - const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); - int src_pitchY = src->GetPitch(PLANAR_Y); - int src_pitchY2 = src_pitchY<<1; - int src_pitchUV = src->GetPitch(PLANAR_V); - int src_pitchUV2 = src_pitchUV<<1; - int WidthY = src->GetRowSize(PLANAR_Y); - int WidthUV = src->GetRowSize(PLANAR_V); - int HeightY = src->GetHeight(PLANAR_Y); - int HeightUV = src->GetHeight(PLANAR_V); - const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); - const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); - const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); - int nxt_pitchY = nxt->GetPitch(PLANAR_Y); - int nxt_pitchUV = nxt->GetPitch(PLANAR_V); - unsigned char *dstpY = dst->GetWritePtr(PLANAR_Y); - unsigned char *dstpV = dst->GetWritePtr(PLANAR_V); - unsigned char *dstpU = dst->GetWritePtr(PLANAR_U); - int dst_pitchY = dst->GetPitch(PLANAR_Y); - int dst_pitchUV = dst->GetPitch(PLANAR_V); - const unsigned char *maskpY = mask->GetReadPtr(PLANAR_Y); - const unsigned char *maskpV = mask->GetReadPtr(PLANAR_V); - const unsigned char *maskpU = mask->GetReadPtr(PLANAR_U); - int mask_pitchY = mask->GetPitch(PLANAR_Y); - int mask_pitchUV = mask->GetPitch(PLANAR_V); - const unsigned char *srcppY = srcpY - src_pitchY; - const unsigned char *srcpppY = srcppY - src_pitchY2; - const unsigned char *srcpnY = srcpY + src_pitchY; - const unsigned char *srcpnnY = srcpnY + src_pitchY2; - const unsigned char *srcppV = srcpV - src_pitchUV; - const unsigned char *srcpppV = srcppV - src_pitchUV2; - const unsigned char *srcpnV = srcpV + src_pitchUV; - const unsigned char *srcpnnV = srcpnV + src_pitchUV2; - const unsigned char *srcppU = srcpU - src_pitchUV; - const unsigned char *srcpppU = srcppU - src_pitchUV2; - const unsigned char *srcpnU = srcpU + src_pitchUV; - const unsigned char *srcpnnU = srcpnU + src_pitchUV2; - int x, y, Iy1, Iy2, Iye, Ix1, Ix2, edgeS1, edgeS2; - int sum, sumsq, temp, temp1, temp2, minN, maxN; - double dir1, dir2, dir, dirF; - for (y=0; y>1; - else if (maskpY[x] == 50) dstpY[x] = (srcpY[x]+prvpY[x]+1)>>1; - else if (maskpY[x] == 60) - { - if (y>2 && y3 && x>1; - continue; - } - if (abs(srcppY[x]-srcpnY[x]) < 10 && (edgeS1 < 1600 || edgeS2 < 1600)) - { - dstpY[x] = (srcppY[x]+srcpnY[x]+1)>>1; - continue; - } - sum = srcppY[x-1] + srcppY[x] + srcppY[x+1] + srcpnY[x-1] + srcpnY[x] + srcpnY[x+1]; - sumsq = srcppY[x-1]*srcppY[x-1] + srcppY[x]*srcppY[x] + srcppY[x+1]*srcppY[x+1] + - srcpnY[x-1]*srcpnY[x-1] + srcpnY[x]*srcpnY[x] + srcpnY[x+1]*srcpnY[x+1]; - if ((6*sumsq - sum*sum) < 432) - { - dstpY[x] = (srcppY[x]+srcpnY[x]+1)>>1; - continue; - } - if (Ix1 == 0) dir1 = 3.1415926; - else - { - dir1 = atan(Iy1/(Ix1*2.0f)) + 1.5707963; - if (Iy1 >= 0) { if (Ix1 < 0) dir1 += 3.1415927; } - else { if (Ix1 >= 0) dir1 += 3.1415927; } - if (dir1 >= 3.1415927) dir1 -= 3.1415927; - } - if (Ix2 == 0) dir2 = 3.1415926; - else - { - dir2 = atan(Iy2/(Ix2*2.0f)) + 1.5707963; - if (Iy2 >= 0) { if (Ix2 < 0) dir2 += 3.1415927; } - else { if (Ix2 >= 0) dir2 += 3.1415927; } - if (dir2 >= 3.1415927) dir2 -= 3.1415927; - } - if (fabs(dir1-dir2) < 0.5) - { - if (edgeS1 >= 3600 && edgeS2 >= 3600) dir = (dir1 + dir2) * 0.5f; - else dir = edgeS1 >= edgeS2 ? dir1 : dir2; - } - else - { - if (edgeS1 >= 5000 && edgeS2 >= 5000) - { - Iye = srcppY[x-1]+srcppY[x]+srcppY[x]+srcppY[x+1]-srcpnY[x-1]-srcpnY[x]-srcpnY[x]-srcpnY[x+1]; - if ((Iy1*Iye > 0) && (Iy2*Iye < 0)) dir = dir1; - else if ((Iy1*Iye < 0) && (Iy2*Iye > 0)) dir = dir2; - else - { - if (abs(Iye-Iy1) <= abs(Iye-Iy2)) dir = dir1; - else dir = dir2; - } - } - else dir = edgeS1 >= edgeS2 ? dir1 : dir2; - } - dirF = 0.5f/tan(dir); - if (dirF >= 0.0f) - { - if (dirF >= 0.5f) - { - if (dirF >= 1.0f) - { - if (dirF >= 1.5f) - { - if (dirF >= 2.0f) - { - if (dirF <= 2.50f) - { - temp1 = srcppY[x+4]; - temp2 = srcpnY[x-4]; - temp = (srcppY[x+4]+srcpnY[x-4]+1)>>1; - } - else - { - temp1 = temp2 = srcpnY[x]; - temp = cubicInt(srcpppY[x],srcppY[x],srcpnY[x],srcpnnY[x]); - } - } - else - { - temp1 = (int)((dirF-1.5f)*(srcppY[x+4]) + (2.0f-dirF)*(srcppY[x+3]) + 0.5f); - temp2 = (int)((dirF-1.5f)*(srcpnY[x-4]) + (2.0f-dirF)*(srcpnY[x-3]) + 0.5f); - temp = (int)((dirF-1.5f)*(srcppY[x+4]+srcpnY[x-4]) + (2.0f-dirF)*(srcppY[x+3]+srcpnY[x-3]) + 0.5f); - } - } - else - { - temp1 = (int)((dirF-1.0f)*(srcppY[x+3]) + (1.5f-dirF)*(srcppY[x+2]) + 0.5f); - temp2 = (int)((dirF-1.0f)*(srcpnY[x-3]) + (1.5f-dirF)*(srcpnY[x-2]) + 0.5f); - temp = (int)((dirF-1.0f)*(srcppY[x+3]+srcpnY[x-3]) + (1.5f-dirF)*(srcppY[x+2]+srcpnY[x-2]) + 0.5f); - } - } - else - { - temp1 = (int)((dirF-0.5f)*(srcppY[x+2]) + (1.0f-dirF)*(srcppY[x+1]) + 0.5f); - temp2 = (int)((dirF-0.5f)*(srcpnY[x-2]) + (1.0f-dirF)*(srcpnY[x-1]) + 0.5f); - temp = (int)((dirF-0.5f)*(srcppY[x+2]+srcpnY[x-2]) + (1.0f-dirF)*(srcppY[x+1]+srcpnY[x-1]) + 0.5f); - } - } - else - { - temp1 = (int)(dirF*(srcppY[x+1]) + (0.5f-dirF)*(srcppY[x]) + 0.5f); - temp2 = (int)(dirF*(srcpnY[x-1]) + (0.5f-dirF)*(srcpnY[x]) + 0.5f); - temp = (int)(dirF*(srcppY[x+1]+srcpnY[x-1]) + (0.5f-dirF)*(srcppY[x]+srcpnY[x]) + 0.5f); - } - } - else - { - if (dirF <= -0.5f) - { - if (dirF <= -1.0f) - { - if (dirF <= -1.5f) - { - if (dirF <= -2.0f) - { - if (dirF >= -2.50f) - { - temp1 = srcppY[x-4]; - temp2 = srcpnY[x+4]; - temp = (srcppY[x-4]+srcpnY[x+4]+1)>>1; - } - else - { - temp1 = temp2 = srcpnY[x]; - temp = cubicInt(srcpppY[x],srcppY[x],srcpnY[x],srcpnnY[x]); - } - } - else - { - temp1 = (int)((-dirF-1.5f)*(srcppY[x-4]) + (2.0f+dirF)*(srcppY[x-3]) + 0.5f); - temp2 = (int)((-dirF-1.5f)*(srcpnY[x+4]) + (2.0f+dirF)*(srcpnY[x+3]) + 0.5f); - temp = (int)((-dirF-1.5f)*(srcppY[x-4]+srcpnY[x+4]) + (2.0f+dirF)*(srcppY[x-3]+srcpnY[x+3]) + 0.5f); - } - } - else - { - temp1 = (int)((-dirF-1.0f)*(srcppY[x-3]) + (1.5f+dirF)*(srcppY[x-2]) + 0.5f); - temp2 = (int)((-dirF-1.0f)*(srcpnY[x+3]) + (1.5f+dirF)*(srcpnY[x+2]) + 0.5f); - temp = (int)((-dirF-1.0f)*(srcppY[x-3]+srcpnY[x+3]) + (1.5f+dirF)*(srcppY[x-2]+srcpnY[x+2]) + 0.5f); - } - } - else - { - temp1 = (int)((-dirF-0.5f)*(srcppY[x-2]) + (1.0f+dirF)*(srcppY[x-1]) + 0.5f); - temp2 = (int)((-dirF-0.5f)*(srcpnY[x+2]) + (1.0f+dirF)*(srcpnY[x+1]) + 0.5f); - temp = (int)((-dirF-0.5f)*(srcppY[x-2]+srcpnY[x+2]) + (1.0f+dirF)*(srcppY[x-1]+srcpnY[x+1]) + 0.5f); - } - } - else - { - temp1 = (int)((-dirF)*(srcppY[x-1]) + (0.5f+dirF)*(srcppY[x]) + 0.5f); - temp2 = (int)((-dirF)*(srcpnY[x+1]) + (0.5f+dirF)*(srcpnY[x]) + 0.5f); - temp = (int)((-dirF)*(srcppY[x-1]+srcpnY[x+1]) + (0.5f+dirF)*(srcppY[x]+srcpnY[x]) + 0.5f); - } - } - maxN = max(srcppY[x],srcpnY[x]) + 25; - minN = min(srcppY[x],srcpnY[x]) - 25; - if (abs(temp1-temp2) > 20 || abs(srcppY[x]+srcpnY[x]-temp-temp) > 60 || temp < minN || temp > maxN) - { - temp = cubicInt(srcpppY[x],srcppY[x],srcpnY[x],srcpnnY[x]); - } - if (temp > 255) temp = 255; - else if (temp < 0) temp = 0; - dstpY[x] = temp; - } - else - { - if (y<3 || y>HeightY-4) dstpY[x] = (srcpnY[x]+srcppY[x]+1)>>1; - else dstpY[x] = cubicInt(srcpppY[x],srcppY[x],srcpnY[x],srcpnnY[x]); - } - } - } - prvpY += prv_pitchY; - srcpppY += src_pitchY; - srcppY += src_pitchY; - srcpY += src_pitchY; - srcpnY += src_pitchY; - srcpnnY += src_pitchY; - nxtpY += nxt_pitchY; - maskpY += mask_pitchY; - dstpY += dst_pitchY; - } - for (y=0; y>1; - else if (maskpV[x] == 50) dstpV[x] = (srcpV[x]+prvpV[x]+1)>>1; - else if (maskpV[x] == 60) - { - if (y<3 || y>HeightUV-4) dstpV[x] = (srcpnV[x]+srcppV[x]+1)>>1; - else dstpV[x] = cubicInt(srcpppV[x],srcppV[x],srcpnV[x],srcpnnV[x]); - } - if (maskpU[x] == 10 || maskpU[x] == 110) dstpU[x] = srcpU[x]; - else if (maskpU[x] == 20 || maskpU[x] == 120) dstpU[x] = prvpU[x]; - else if (maskpU[x] == 30 || maskpU[x] == 130) dstpU[x] = nxtpU[x]; - else if (maskpU[x] == 40) dstpU[x] = (srcpU[x]+nxtpU[x]+1)>>1; - else if (maskpU[x] == 50) dstpU[x] = (srcpU[x]+prvpU[x]+1)>>1; - else if (maskpU[x] == 60) - { - if (y<3 || y>HeightUV-4) dstpU[x] = (srcpnU[x]+srcppU[x]+1)>>1; - else dstpU[x] = cubicInt(srcpppU[x],srcppU[x],srcpnU[x],srcpnnU[x]); - } - } - prvpV += prv_pitchUV; - prvpU += prv_pitchUV; - srcpppV += src_pitchUV; - srcppV += src_pitchUV; - srcpV += src_pitchUV; - srcpnV += src_pitchUV; - srcpnnV += src_pitchUV; - srcpppU += src_pitchUV; - srcppU += src_pitchUV; - srcpU += src_pitchUV; - srcpnU += src_pitchUV; - srcpnnU += src_pitchUV; - nxtpV += nxt_pitchUV; - nxtpU += nxt_pitchUV; - maskpV += mask_pitchUV; - maskpU += mask_pitchUV; - dstpV += dst_pitchUV; - dstpU += dst_pitchUV; - } -} - -void vidTDeint::createWeaveFrameYV12(ADMImage *dst, ADMImage *prv, - ADMImage *src, ADMImage *nxt) -{ - int b; - ADM_PLANE plane; - for (b=0; b<3; ++b) - { - if (b == 0) plane = PLANAR_Y; - else if (b == 1) plane = PLANAR_V; - else plane = PLANAR_U; - if (PRM(field)^PRM(order)) - { - if (accumP <= accumN) - { - BitBlit(dst->GetWritePtr(plane), dst->GetPitch(plane), src->GetReadPtr(plane), - src->GetPitch(plane), src->GetRowSize(plane), src->GetHeight(plane)); - } - else - { - BitBlit(dst->GetWritePtr(plane)+(1-PRM(field))*dst->GetPitch(plane), dst->GetPitch(plane)<<1, - src->GetReadPtr(plane)+(1-PRM(field))*src->GetPitch(plane), src->GetPitch(plane)<<1, - src->GetRowSize(plane), src->GetHeight(plane)>>1); - BitBlit(dst->GetWritePtr(plane)+PRM(field)*dst->GetPitch(plane), dst->GetPitch(plane)<<1, - nxt->GetReadPtr(plane)+PRM(field)*nxt->GetPitch(plane), nxt->GetPitch(plane)<<1, nxt->GetRowSize(plane), - nxt->GetHeight(plane)>>1); - } - } - else - { - if (accumN <= accumP) - { - BitBlit(dst->GetWritePtr(plane), dst->GetPitch(plane), src->GetReadPtr(plane), - src->GetPitch(plane), src->GetRowSize(plane), src->GetHeight(plane)); - } - else - { - BitBlit(dst->GetWritePtr(plane)+(1-PRM(field))*dst->GetPitch(plane), dst->GetPitch(plane)<<1, - src->GetReadPtr(plane)+(1-PRM(field))*src->GetPitch(plane), src->GetPitch(plane)<<1, - src->GetRowSize(plane), src->GetHeight(plane)>>1); - BitBlit(dst->GetWritePtr(plane)+PRM(field)*dst->GetPitch(plane), dst->GetPitch(plane)<<1, - prv->GetReadPtr(plane)+PRM(field)*prv->GetPitch(plane), prv->GetPitch(plane)<<1, prv->GetRowSize(plane), - prv->GetHeight(plane)>>1); - } - } - } -} - -//********************************************************* -//********************************************************* -//********************************************************* -//********************************************************* -int vidTDeint::getHint(ADMImage *src, unsigned int &storeHint, int &hintfield) -{ - hintfield = -1; - const unsigned char *p = YPLANE(src); //src->GetReadPtr(PLANAR_Y); - unsigned int i, magic_number = 0, hint = 0; - storeHint = 0xFFFFFFFF; - for (i=0; i<32; ++i) - { - magic_number |= ((*p++ & 1) << i); - } - if (magic_number != 0xdeadbeef && magic_number != 0xdeadfeed) return -1; - for (i=0; i<32; ++i) - { - hint |= ((*p++ & 1) << i); - } - if (magic_number == 0xdeadbeef && hint&0xFFFFFF00) return -1; - if (magic_number == 0xdeadfeed && hint&0xFFFFFF00) return -1; - storeHint = hint; - if (magic_number == 0xdeadbeef) - { - storeHint |= 0x00100000; - if (hint&0x00000001) return 0; - return 1; - } - if (hint&0x00000008) hintfield = 1; - else hintfield = 0; - if (hint&0x00000010) return 1; - return 0; -} - -void vidTDeint::putHint(ADMImage *src, unsigned int hint, int fieldt) -{ - int type = hint&0x00100000 ? 0 : 1; - hint &= ~0x00100000; - if (hint&0xFFFFFF00) return; - if (type == 1) - { - hint &= 0x00000020; - if (fieldt == 1) hint |= 0x0000000E; - else hint |= 0x00000005; - } - unsigned char *p = YPLANE(src); //src->GetWritePtr(PLANAR_Y); - unsigned int i; - for (i=0; i<32; ++i) - { - *p &= ~1; - if (type == 0) *p++ |= ((0xdeadbeef & (1 << i)) >> i); - else *p++ |= ((0xdeadfeed & (1 << i)) >> i); - } - for (i=0; i<32; ++i) - { - *p &= ~1; - *p++ |= ((hint & (1 << i)) >> i); - } -} -/****************************************/ -void vidTDeint::copyFrame(ADMImage *dst,ADMImage *src) -{ - int b, stop = 3 ; - ADM_PLANE plane[3] = { PLANAR_Y, PLANAR_U, PLANAR_V }; - for (b=0; bGetWritePtr(plane[b]),dst->GetPitch(plane[b]),src->GetReadPtr(plane[b]), - src->GetPitch(plane[b]),src->GetRowSize(plane[b]),src->GetHeight(plane[b])); - } -} -/****************************************/ - void vidTDeint::copyForUpsize(ADMImage *dst, ADMImage *src, int np) -{ - int b; - ADM_PLANE plane[3] = { PLANAR_Y, PLANAR_U, PLANAR_V }; - for (b=0; bGetWritePtr(plane[b]),dst->GetPitch(plane[b])*2,src->GetReadPtr(plane[b]), - src->GetPitch(plane[b]),src->GetRowSize(plane[b]),src->GetHeight(plane[b])); - BitBlit(dst->GetWritePtr(plane[b])+(dst->GetPitch(plane[b])*(dst->GetHeight(plane[b])-1)), - dst->GetPitch(plane[b]),src->GetReadPtr(plane[b])+(src->GetPitch(plane[b])*(src->GetHeight(plane[b])-1)), - src->GetPitch(plane[b]),src->GetRowSize(plane[b]),1); - } -} -/****************************************/ -void vidTDeint::setMaskForUpsize(ADMImage *msk, int np) -{ - unsigned char *maskwc, *maskwn; - int msk_pitch, height, width, y; - int b; - ADM_PLANE plane[3] = { PLANAR_Y, PLANAR_U, PLANAR_V }; - for (b=0; bGetWritePtr(plane[b]); - msk_pitch = msk->GetPitch(plane[b]); - height = msk->GetHeight(plane[b])>>1; - width = msk->GetRowSize(plane[b]); - maskwn = maskwc + msk_pitch; - msk_pitch <<= 1; - if (PRM(field) == 1) - { - for (y=0; y 0) - { - maskt = scratch; //_env->NewVideoFrame(vi); - copyFrame(maskt, mask); - } - unsigned char *maskw; - const unsigned char *dstp, *dstpp, *dstpn, *dstppp, *dstpnn, *maskp, *maskpT; - int dst_pitch, dst_pitch2, mask_pitch, mask_pitch2, Width, Height; - int x, y, b, stop =3 , count = 0, maskp_pitch, maskp_pitch2; - int sFirst, sSecond, AP6 = AP*6, moving, neighbors, u, v; - int starty, stopy, startx, stopx, inc; - ADM_PLANE plane; - - for (b=0; bGetReadPtr(plane); - dst_pitch = dst->GetPitch(plane); - dst_pitch2 = dst_pitch<<1; - Width = dst->GetRowSize(plane); - Height = dst->GetHeight(plane); - dstp += (2-PRM(field))*dst_pitch; - dstppp = dstp - dst_pitch2; - dstpp = dstp - dst_pitch; - dstpn = dstp + dst_pitch; - dstpnn = dstp + dst_pitch2; - maskw = mask->GetWritePtr(plane); - mask_pitch = mask->GetPitch(plane); - mask_pitch2 = mask_pitch<<1; - if (APType > 0) - { - maskp = maskt->GetReadPtr(plane); - maskp_pitch = maskt->GetPitch(plane); - maskp_pitch2 = maskp_pitch<<1; - } - maskw += (2-PRM(field))*mask_pitch; - y = 2-PRM(field); - for (x=0; x AP && sSecond > AP) || (sFirst < -AP && sSecond < -AP)) - { - sFirst = abs(dstpnn[x]+(dstp[x]<<2)+dstpnn[x]-(3*(dstpp[x]+dstpn[x]))); - if (sFirst > AP6) - { - if (APType > 0) - { - inc = stop > 1 ? 1 : x&1 ? 4 : 2; - startx = x-(inc<<1) < 0 ? x-inc < 0 ? x : x-inc : x-(inc<<1); - stopx = x+(inc<<1) > Width-1 ? x+inc > Width-1 ? x : x+inc : x+(inc<<1); - starty = y-4 < 0 ? y-2 < 0 ? y : y-2 : y-4; - stopy = y+4 > Height-1 ? y+2 > Height-1 ? y : y+2 : y+4; - neighbors = moving = 0; - maskpT = maskp + starty*maskp_pitch; - for (u=starty; u<=stopy; u+=2) - { - for (v=startx; v<=stopx; v+=inc) - { - if (maskpT[v] >= 60) ++moving; - ++neighbors; - } - maskpT += maskp_pitch2; - } - if ((APType == 1 && (moving<<1) >= neighbors) || - (APType == 2 && (moving*3) >= neighbors)) - { - maskw[x] = 60; - ++count; - } - } - else - { - maskw[x] = 60; - ++count; - } - } - } - } - dstppp += dst_pitch2; - dstpp += dst_pitch2; - dstp += dst_pitch2; - dstpn += dst_pitch2; - dstpnn += dst_pitch2; - maskw += mask_pitch2; - y += 2; - for (; y Height-1 ? y+2 > Height-1 ? y : y+2 : y+4; - for (x=0; x AP && sSecond > AP) || (sFirst < -AP && sSecond < -AP)) - { - sFirst = abs(dstppp[x]+(dstp[x]<<2)+dstpnn[x]-(3*(dstpp[x]+dstpn[x]))); - if (sFirst > AP6) - { - if (APType > 0) - { - inc = stop > 1 ? 1 : x&1 ? 4 : 2; - startx = x-(inc<<1) < 0 ? x-inc < 0 ? x : x-inc : x-(inc<<1); - stopx = x+(inc<<1) > Width-1 ? x+inc > Width-1 ? x : x+inc : x+(inc<<1); - neighbors = moving = 0; - maskpT = maskp + starty*maskp_pitch; - for (u=starty; u<=stopy; u+=2) - { - for (v=startx; v<=stopx; v+=inc) - { - if (maskpT[v] >= 60) ++moving; - ++neighbors; - } - maskpT += maskp_pitch2; - } - if ((APType == 1 && (moving<<1) >= neighbors) || - (APType == 2 && (moving*3) >= neighbors)) - { - maskw[x] = 60; - ++count; - } - } - else - { - maskw[x] = 60; - ++count; - } - } - } - } - dstppp += dst_pitch2; - dstpp += dst_pitch2; - dstp += dst_pitch2; - dstpn += dst_pitch2; - dstpnn += dst_pitch2; - maskw += mask_pitch2; - } - for (x=0; x AP && sSecond > AP) || (sFirst < -AP && sSecond < -AP)) - { - sFirst = abs(dstppp[x]+(dstp[x]<<2)+dstppp[x]-(3*(dstpp[x]+dstpn[x]))); - if (sFirst > AP6) - { - if (APType > 0) - { - inc = stop > 1 ? 1 : x&1 ? 4 : 2; - startx = x-(inc<<1) < 0 ? x-inc < 0 ? x : x-inc : x-(inc<<1); - stopx = x+(inc<<1) > Width-1 ? x+inc > Width-1 ? x : x+inc : x+(inc<<1); - starty = y-4 < 0 ? y-2 < 0 ? y : y-2 : y-4; - stopy = y+4 > Height-1 ? y+2 > Height-1 ? y : y+2 : y+4; - neighbors = moving = 0; - maskpT = maskp + starty*maskp_pitch; - for (u=starty; u<=stopy; u+=2) - { - for (v=startx; v<=stopx; v+=inc) - { - if (maskpT[v] >= 60) ++moving; - ++neighbors; - } - maskpT += maskp_pitch2; - } - if ((APType == 1 && (moving<<1) >= neighbors) || - (APType == 2 && (moving*3) >= neighbors)) - { - maskw[x] = 60; - ++count; - } - } - else - { - maskw[x] = 60; - ++count; - } - } - } - } - } - if (count > 0) - { - //if (vi.IsYV12()) - { - if (type == 0) cubicDeintYV12(dst, mask, dst, dst, dst); - else if (type == 1) smartELADeintYV12(dst, mask, dst, dst, dst); - else if (type == 2) kernelDeintYV12(dst, mask, dst, dst, dst); - else if (type == 3) ELADeintYV12(dst, mask, dst, dst, dst); - } - - } -} - + + + unsigned char vidTDeint::cubicInt(unsigned char p1, unsigned char p2, unsigned char p3, + unsigned char p4) +{ + int temp = (int)((19*(p2+p3)-3*(p1+p4)+16)>>5); + if (temp>255) temp = 255; + else if (temp<0) temp = 0; + return (unsigned char)temp; +} + +void vidTDeint::createMotionMapYV12(ADMImage *prv2, ADMImage *prv, + ADMImage *src, ADMImage *nxt, ADMImage *nxt2, ADMImage *mask, int n) +{ + const unsigned char *prv2pY = prv2->GetReadPtr(PLANAR_Y); + const unsigned char *prv2pV = prv2->GetReadPtr(PLANAR_V); + const unsigned char *prv2pU = prv2->GetReadPtr(PLANAR_U); + int prv2_pitchY = prv2->GetPitch(PLANAR_Y); + int prv2_pitchUV = prv2->GetPitch(PLANAR_V); + prv2pY += prv2_pitchY*(2-PRM(field)); + prv2pV += prv2_pitchUV*(2-PRM(field)); + prv2pU += prv2_pitchUV*(2-PRM(field)); + prv2_pitchY *= 2; + prv2_pitchUV *= 2; + const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); + const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); + const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); + int prv_pitchY = prv->GetPitch(PLANAR_Y); + int prv_pitchUV = prv->GetPitch(PLANAR_V); + prvpY += prv_pitchY*(2-PRM(field)); + prvpV += prv_pitchUV*(2-PRM(field)); + prvpU += prv_pitchUV*(2-PRM(field)); + const unsigned char *prvppY = prvpY - prv_pitchY; + const unsigned char *prvppV = prvpV - prv_pitchUV; + const unsigned char *prvppU = prvpU - prv_pitchUV; + const unsigned char *prvpnY = prvpY + prv_pitchY; + const unsigned char *prvpnV = prvpV + prv_pitchUV; + const unsigned char *prvpnU = prvpU + prv_pitchUV; + prv_pitchY *= 2; + prv_pitchUV *= 2; + const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); + const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); + const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); + int src_pitchY = src->GetPitch(PLANAR_Y); + int src_pitchUV = src->GetPitch(PLANAR_V); + int WidthY = src->GetRowSize(PLANAR_Y); + int HeightY = src->GetHeight(PLANAR_Y); + int WidthUV = src->GetRowSize(PLANAR_V); + int HeightUV = src->GetHeight(PLANAR_V); + srcpY += src_pitchY*(2-PRM(field)); + srcpV += src_pitchUV*(2-PRM(field)); + srcpU += src_pitchUV*(2-PRM(field)); + const unsigned char *srcppY = srcpY - src_pitchY; + const unsigned char *srcppV = srcpV - src_pitchUV; + const unsigned char *srcppU = srcpU - src_pitchUV; + const unsigned char *srcpnY = srcpY + src_pitchY; + const unsigned char *srcpnV = srcpV + src_pitchUV; + const unsigned char *srcpnU = srcpU + src_pitchUV; + src_pitchY *= 2; + src_pitchUV *= 2; + const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); + const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); + const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); + int nxt_pitchY = nxt->GetPitch(PLANAR_Y); + int nxt_pitchUV = nxt->GetPitch(PLANAR_V); + nxtpY += nxt_pitchY*(2-PRM(field)); + nxtpV += nxt_pitchUV*(2-PRM(field)); + nxtpU += nxt_pitchUV*(2-PRM(field)); + const unsigned char *nxtppY = nxtpY - nxt_pitchY; + const unsigned char *nxtppV = nxtpV - nxt_pitchUV; + const unsigned char *nxtppU = nxtpU - nxt_pitchUV; + const unsigned char *nxtpnY = nxtpY + nxt_pitchY; + const unsigned char *nxtpnV = nxtpV + nxt_pitchUV; + const unsigned char *nxtpnU = nxtpU + nxt_pitchUV; + nxt_pitchY *= 2; + nxt_pitchUV *= 2; + const unsigned char *nxt2pY = nxt2->GetReadPtr(PLANAR_Y); + const unsigned char *nxt2pV = nxt2->GetReadPtr(PLANAR_V); + const unsigned char *nxt2pU = nxt2->GetReadPtr(PLANAR_U); + int nxt2_pitchY = nxt2->GetPitch(PLANAR_Y); + int nxt2_pitchUV = nxt2->GetPitch(PLANAR_V); + nxt2pY += nxt2_pitchY*(2-PRM(field)); + nxt2pV += nxt2_pitchUV*(2-PRM(field)); + nxt2pU += nxt2_pitchUV*(2-PRM(field)); + nxt2_pitchY *= 2; + nxt2_pitchUV *= 2; + unsigned char *maskwY = mask->GetWritePtr(PLANAR_Y); + unsigned char *maskwV = mask->GetWritePtr(PLANAR_V); + unsigned char *maskwU = mask->GetWritePtr(PLANAR_U); + int mask_pitchY = mask->GetPitch(PLANAR_Y); + int mask_pitchUV = mask->GetPitch(PLANAR_V); + memset(maskwY,10,mask_pitchY*HeightY); + memset(maskwU,10,mask_pitchUV*HeightUV); + memset(maskwV,10,mask_pitchUV*HeightUV); + maskwY += mask_pitchY*(2-PRM(field)); + maskwV += mask_pitchUV*(2-PRM(field)); + maskwU += mask_pitchUV*(2-PRM(field)); + mask_pitchY *= 2; + mask_pitchUV *= 2; + int x, y; + unsigned char val1; + bool t1, t2, t3, t4, t5, t6, t7; + if (PRM(field)^PRM(order)) + { + val1 = PRM(mntmode) > 1 ? (accumP <= accumN ? 10 : 30) : 40; + if (n <= 1 || n >= nfrms-1) + { + for (y=1; y= nfrms-1 ? false : (abs(nxtpY[x] - nxt2pY[x]) < mthreshL); + if (t6 && ((t1 && t2) || (t3 && t4) || (t2 && t4 && (t5 || t7)) || (t1 && t3 && (t5 || t7)))) + maskwY[x] = val1; + else if (t1 && t2 && t3 && t4 && t5 && t7) maskwY[x] = val1; + else if (t1 && t5 && t2) maskwY[x] = 10; + else if (t3 && t7 && t4) maskwY[x] = 30; + else if (abs(srcpY[x]-srcppY[x])<4 && abs(srcpY[x]-srcpnY[x])<4) maskwY[x] = 110; + else if (abs(nxtpY[x]-srcppY[x])<4 && abs(nxtpY[x]-srcpnY[x])<4) maskwY[x] = 130; + else maskwY[x] = 60; + } + prvppY += prv_pitchY; + prvpY += prv_pitchY; + prvpnY += prv_pitchY; + srcppY += src_pitchY; + srcpY += src_pitchY; + srcpnY += src_pitchY; + nxtppY += nxt_pitchY; + nxtpY += nxt_pitchY; + nxtpnY += nxt_pitchY; + nxt2pY += nxt2_pitchY; + maskwY += mask_pitchY; + } + for (y=1; y= nfrms-1 ? false : (abs(nxtpV[x] - nxt2pV[x]) < mthreshC); + if (t6 && ((t1 && t2) || (t3 && t4) || (t2 && t4 && (t5 || t7)) || (t1 && t3 && (t5 || t7)))) + maskwV[x] = val1; + else if (t1 && t2 && t3 && t4 && t5 && t7) maskwV[x] = val1; + else if (t1 && t5 && t2) maskwV[x] = 10; + else if (t3 && t7 && t4) maskwV[x] = 30; + else if (abs(srcpV[x]-srcppV[x])<4 && abs(srcpV[x]-srcpnV[x])<4) maskwV[x] = 110; + else if (abs(nxtpV[x]-srcppV[x])<4 && abs(nxtpV[x]-srcpnV[x])<4) maskwV[x] = 130; + else maskwV[x] = 60; + t1 = n == 0 ? false : (abs(srcppU[x] - prvppU[x]) < mthreshC); + t2 = n == 0 ? false : (abs(srcpnU[x] - prvpnU[x]) < mthreshC); + t3 = n == nfrms ? false : (abs(srcppU[x] - nxtppU[x]) < mthreshC); + t4 = n == nfrms ? false : (abs(srcpnU[x] - nxtpnU[x]) < mthreshC); + t5 = n == 0 ? false : (abs(srcpU[x] - prvpU[x]) < mthreshC); + t6 = n == nfrms ? false : (abs(srcpU[x] - nxtpU[x]) < mthreshC); + t7 = n >= nfrms-1 ? false : (abs(nxtpU[x] - nxt2pU[x]) < mthreshC); + if (t6 && ((t1 && t2) || (t3 && t4) || (t2 && t4 && (t5 || t7)) || (t1 && t3 && (t5 || t7)))) + maskwU[x] = val1; + else if (t1 && t2 && t3 && t4 && t5 && t7) maskwU[x] = val1; + else if (t1 && t5 && t2) maskwU[x] = 10; + else if (t3 && t7 && t4) maskwU[x] = 30; + else if (abs(srcpU[x]-srcppU[x])<4 && abs(srcpU[x]-srcpnU[x])<4) maskwU[x] = 110; + else if (abs(nxtpU[x]-srcppU[x])<4 && abs(nxtpU[x]-srcpnU[x])<4) maskwU[x] = 130; + else maskwU[x] = 60; + } + prvppV += prv_pitchUV; + prvpV += prv_pitchUV; + prvpnV += prv_pitchUV; + prvppU += prv_pitchUV; + prvpU += prv_pitchUV; + prvpnU += prv_pitchUV; + srcppV += src_pitchUV; + srcpV += src_pitchUV; + srcpnV += src_pitchUV; + srcppU += src_pitchUV; + srcpU += src_pitchUV; + srcpnU += src_pitchUV; + nxtppV += nxt_pitchUV; + nxtpV += nxt_pitchUV; + nxtpnV += nxt_pitchUV; + nxtppU += nxt_pitchUV; + nxtpU += nxt_pitchUV; + nxtpnU += nxt_pitchUV; + nxt2pV += nxt2_pitchUV; + nxt2pU += nxt2_pitchUV; + maskwV += mask_pitchUV; + maskwU += mask_pitchUV; + } + } + else + { + for (y=1; y 1 ? (accumP < accumN ? 20 : 10) : 50; + if (n <= 1 || n >= nfrms-1) + { + for (y=1; yGetReadPtr(PLANAR_Y); + const unsigned char *prv2pV = prv2->GetReadPtr(PLANAR_V); + const unsigned char *prv2pU = prv2->GetReadPtr(PLANAR_U); + int prv2_pitchY = prv2->GetPitch(PLANAR_Y); + int prv2_pitchUV = prv2->GetPitch(PLANAR_V); + prv2pY += prv2_pitchY*(2-PRM(field)); + prv2pV += prv2_pitchUV*(2-PRM(field)); + prv2pU += prv2_pitchUV*(2-PRM(field)); + const unsigned char *prv2ppY = prv2pY - prv2_pitchY; + const unsigned char *prv2ppV = prv2pV - prv2_pitchUV; + const unsigned char *prv2ppU = prv2pU - prv2_pitchUV; + const unsigned char *prv2pnY = prv2pY + prv2_pitchY; + const unsigned char *prv2pnV = prv2pV + prv2_pitchUV; + const unsigned char *prv2pnU = prv2pU + prv2_pitchUV; + prv2_pitchY *= 2; + prv2_pitchUV *= 2; + const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); + const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); + const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); + int prv_pitchY = prv->GetPitch(PLANAR_Y); + int prv_pitchUV = prv->GetPitch(PLANAR_V); + prvpY += prv_pitchY*(2-PRM(field)); + prvpV += prv_pitchUV*(2-PRM(field)); + prvpU += prv_pitchUV*(2-PRM(field)); + const unsigned char *prvppY = prvpY - prv_pitchY; + const unsigned char *prvppV = prvpV - prv_pitchUV; + const unsigned char *prvppU = prvpU - prv_pitchUV; + const unsigned char *prvpnY = prvpY + prv_pitchY; + const unsigned char *prvpnV = prvpV + prv_pitchUV; + const unsigned char *prvpnU = prvpU + prv_pitchUV; + prv_pitchY *= 2; + prv_pitchUV *= 2; + const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); + const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); + const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); + int src_pitchY = src->GetPitch(PLANAR_Y); + int src_pitchUV = src->GetPitch(PLANAR_V); + int WidthY = src->GetRowSize(PLANAR_Y); + int HeightY = src->GetHeight(PLANAR_Y); + int WidthUV = src->GetRowSize(PLANAR_V); + int HeightUV = src->GetHeight(PLANAR_V); + srcpY += src_pitchY*(2-PRM(field)); + srcpV += src_pitchUV*(2-PRM(field)); + srcpU += src_pitchUV*(2-PRM(field)); + const unsigned char *srcppY = srcpY - src_pitchY; + const unsigned char *srcppV = srcpV - src_pitchUV; + const unsigned char *srcppU = srcpU - src_pitchUV; + const unsigned char *srcpnY = srcpY + src_pitchY; + const unsigned char *srcpnV = srcpV + src_pitchUV; + const unsigned char *srcpnU = srcpU + src_pitchUV; + src_pitchY *= 2; + src_pitchUV *= 2; + const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); + const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); + const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); + int nxt_pitchY = nxt->GetPitch(PLANAR_Y); + int nxt_pitchUV = nxt->GetPitch(PLANAR_V); + nxtpY += nxt_pitchY*(2-PRM(field)); + nxtpV += nxt_pitchUV*(2-PRM(field)); + nxtpU += nxt_pitchUV*(2-PRM(field)); + const unsigned char *nxtppY = nxtpY - nxt_pitchY; + const unsigned char *nxtppV = nxtpV - nxt_pitchUV; + const unsigned char *nxtppU = nxtpU - nxt_pitchUV; + const unsigned char *nxtpnY = nxtpY + nxt_pitchY; + const unsigned char *nxtpnV = nxtpV + nxt_pitchUV; + const unsigned char *nxtpnU = nxtpU + nxt_pitchUV; + nxt_pitchY *= 2; + nxt_pitchUV *= 2; + const unsigned char *nxt2pY = nxt2->GetReadPtr(PLANAR_Y); + const unsigned char *nxt2pV = nxt2->GetReadPtr(PLANAR_V); + const unsigned char *nxt2pU = nxt2->GetReadPtr(PLANAR_U); + int nxt2_pitchY = nxt2->GetPitch(PLANAR_Y); + int nxt2_pitchUV = nxt2->GetPitch(PLANAR_V); + nxt2pY += nxt2_pitchY*(2-PRM(field)); + nxt2pV += nxt2_pitchUV*(2-PRM(field)); + nxt2pU += nxt2_pitchUV*(2-PRM(field)); + const unsigned char *nxt2ppY = nxt2pY - nxt2_pitchY; + const unsigned char *nxt2ppV = nxt2pV - nxt2_pitchUV; + const unsigned char *nxt2ppU = nxt2pU - nxt2_pitchUV; + const unsigned char *nxt2pnY = nxt2pY + nxt2_pitchY; + const unsigned char *nxt2pnV = nxt2pV + nxt2_pitchUV; + const unsigned char *nxt2pnU = nxt2pU + nxt2_pitchUV; + nxt2_pitchY *= 2; + nxt2_pitchUV *= 2; + unsigned char *maskwY = mask->GetWritePtr(PLANAR_Y); + unsigned char *maskwV = mask->GetWritePtr(PLANAR_V); + unsigned char *maskwU = mask->GetWritePtr(PLANAR_U); + int mask_pitchY = mask->GetPitch(PLANAR_Y); + int mask_pitchUV = mask->GetPitch(PLANAR_V); + memset(maskwY,10,mask_pitchY*HeightY); + memset(maskwU,10,mask_pitchUV*HeightUV); + memset(maskwV,10,mask_pitchUV*HeightUV); + maskwY += mask_pitchY*(2-PRM(field)); + maskwV += mask_pitchUV*(2-PRM(field)); + maskwU += mask_pitchUV*(2-PRM(field)); + mask_pitchY *= 2; + mask_pitchUV *= 2; + int x, y; + unsigned char val1; + bool t1, t2, t3, t4, t5, t6, t7, t8, t9, t10; + bool t11, t12, t13, t14, t15, t16, t17, t18, t19; + if (PRM(field)^PRM(order)) + { + val1 = PRM(mntmode) > 1 ? (accumP <= accumN ? 10 : 30) : 40; + if (n <= 1 || n >= nfrms-1) + { + for (y=1; y= nfrms-1 ? false : (abs(nxtpY[x] - nxt2pY[x]) < mthreshL); + t8 = n <= 1 ? false : (abs(prvppY[x] - prv2ppY[x]) < mthreshL); + t9 = n <= 1 ? false : (abs(prvpnY[x] - prv2pnY[x]) < mthreshL); + t10 = n >= nfrms-1 ? false : (abs(nxtppY[x] - nxt2ppY[x]) < mthreshL); + t11 = n >= nfrms-1 ? false : (abs(nxtpnY[x] - nxt2pnY[x]) < mthreshL); + t12 = (abs(srcppY[x] - prv2ppY[x]) < mthreshL); + t13 = (abs(srcpnY[x] - prv2pnY[x]) < mthreshL); + t14 = (abs(nxtppY[x] - prvppY[x]) < mthreshL); + t15 = (abs(nxtpnY[x] - prvpnY[x]) < mthreshL); + t16 = (abs(nxt2ppY[x] - srcppY[x]) < mthreshL); + t17 = (abs(nxt2pnY[x] - srcpnY[x]) < mthreshL); + t18 = (abs(nxtpY[x] - prvpY[x]) < mthreshL); + t19 = (abs(nxt2pY[x] - srcpY[x]) < mthreshL); + if (t6 && ((t1 && t2 && ((t3 && t4 && t14 && t15) || (t5 && t18))) || + (t3 && t4 && t7 && t19) || + (t5 && t18 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t1 && t8 && t12) || (t2 && t9 && t13))) || + (t7 && t19 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t3 && t10 && t16) || (t4 && t11 && t17))))) + maskwY[x] = val1; + else if (t1 && t2 && t3 && t4 && t5 && t7 && t14 && t15) maskwY[x] = val1; + else if (t1 && t5 && t2 && t8 && t9 && t12 && t13) maskwY[x] = 10; + else if (t3 && t7 && t4 && t10 && t11 && t16 && t17) maskwY[x] = 30; + else if (abs(srcpY[x]-srcppY[x])<4 && abs(srcpY[x]-srcpnY[x])<4) maskwY[x] = 110; + else if (abs(nxtpY[x]-srcppY[x])<4 && abs(nxtpY[x]-srcpnY[x])<4) maskwY[x] = 130; + else maskwY[x] = 60; + } + prv2ppY += prv2_pitchY; + prv2pY += prv2_pitchY; + prv2pnY += prv2_pitchY; + prvppY += prv_pitchY; + prvpY += prv_pitchY; + prvpnY += prv_pitchY; + srcppY += src_pitchY; + srcpY += src_pitchY; + srcpnY += src_pitchY; + nxtppY += nxt_pitchY; + nxtpY += nxt_pitchY; + nxtpnY += nxt_pitchY; + nxt2ppY += nxt2_pitchY; + nxt2pY += nxt2_pitchY; + nxt2pnY += nxt2_pitchY; + maskwY += mask_pitchY; + } + for (y=1; y= nfrms-1 ? false : (abs(nxtpV[x] - nxt2pV[x]) < mthreshC); + t8 = n <= 1 ? false : (abs(prvppV[x] - prv2ppV[x]) < mthreshC); + t9 = n <= 1 ? false : (abs(prvpnV[x] - prv2pnV[x]) < mthreshC); + t10 = n >= nfrms-1 ? false : (abs(nxtppV[x] - nxt2ppV[x]) < mthreshC); + t11 = n >= nfrms-1 ? false : (abs(nxtpnV[x] - nxt2pnV[x]) < mthreshC); + t12 = (abs(srcppV[x] - prv2ppV[x]) < mthreshC); + t13 = (abs(srcpnV[x] - prv2pnV[x]) < mthreshC); + t14 = (abs(nxtppV[x] - prvppV[x]) < mthreshC); + t15 = (abs(nxtpnV[x] - prvpnV[x]) < mthreshC); + t16 = (abs(nxt2ppV[x] - srcppV[x]) < mthreshC); + t17 = (abs(nxt2pnV[x] - srcpnV[x]) < mthreshC); + t18 = (abs(nxtpV[x] - prvpV[x]) < mthreshC); + t19 = (abs(nxt2pV[x] - srcpV[x]) < mthreshC); + if (t6 && ((t1 && t2 && ((t3 && t4 && t14 && t15) || (t5 && t18))) || + (t3 && t4 && t7 && t19) || + (t5 && t18 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t1 && t8 && t12) || (t2 && t9 && t13))) || + (t7 && t19 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t3 && t10 && t16) || (t4 && t11 && t17))))) + maskwV[x] = val1; + else if (t1 && t2 && t3 && t4 && t5 && t7 && t14 && t15) maskwV[x] = val1; + else if (t1 && t5 && t2 && t8 && t9 && t12 && t13) maskwV[x] = 10; + else if (t3 && t7 && t4 && t10 && t11 && t16 && t17) maskwV[x] = 30; + else if (abs(srcpV[x]-srcppV[x])<4 && abs(srcpV[x]-srcpnV[x])<4) maskwV[x] = 110; + else if (abs(nxtpV[x]-srcppV[x])<4 && abs(nxtpV[x]-srcpnV[x])<4) maskwV[x] = 130; + else maskwV[x] = 60; + t1 = n == 0 ? false : (abs(srcppU[x] - prvppU[x]) < mthreshC); + t2 = n == 0 ? false : (abs(srcpnU[x] - prvpnU[x]) < mthreshC); + t3 = n == nfrms ? false : (abs(srcppU[x] - nxtppU[x]) < mthreshC); + t4 = n == nfrms ? false : (abs(srcpnU[x] - nxtpnU[x]) < mthreshC); + t5 = n == 0 ? false : (abs(srcpU[x] - prvpU[x]) < mthreshC); + t6 = n == nfrms ? false : (abs(srcpU[x] - nxtpU[x]) < mthreshC); + t7 = n >= nfrms-1 ? false : (abs(nxtpU[x] - nxt2pU[x]) < mthreshC); + t8 = n <= 1 ? false : (abs(prvppU[x] - prv2ppU[x]) < mthreshC); + t9 = n <= 1 ? false : (abs(prvpnU[x] - prv2pnU[x]) < mthreshC); + t10 = n >= nfrms-1 ? false : (abs(nxtppU[x] - nxt2ppU[x]) < mthreshC); + t11 = n >= nfrms-1 ? false : (abs(nxtpnU[x] - nxt2pnU[x]) < mthreshC); + t12 = (abs(srcppU[x] - prv2ppU[x]) < mthreshC); + t13 = (abs(srcpnU[x] - prv2pnU[x]) < mthreshC); + t14 = (abs(nxtppU[x] - prvppU[x]) < mthreshC); + t15 = (abs(nxtpnU[x] - prvpnU[x]) < mthreshC); + t16 = (abs(nxt2ppU[x] - srcppU[x]) < mthreshC); + t17 = (abs(nxt2pnU[x] - srcpnU[x]) < mthreshC); + t18 = (abs(nxtpU[x] - prvpU[x]) < mthreshC); + t19 = (abs(nxt2pU[x] - srcpU[x]) < mthreshC); + if (t6 && ((t1 && t2 && ((t3 && t4 && t14 && t15) || (t5 && t18))) || + (t3 && t4 && t7 && t19) || + (t5 && t18 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t1 && t8 && t12) || (t2 && t9 && t13))) || + (t7 && t19 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t3 && t10 && t16) || (t4 && t11 && t17))))) + maskwU[x] = val1; + else if (t1 && t2 && t3 && t4 && t5 && t7 && t14 && t15) maskwU[x] = val1; + else if (t1 && t5 && t2 && t8 && t9 && t12 && t13) maskwU[x] = 10; + else if (t3 && t7 && t4 && t10 && t11 && t16 && t17) maskwU[x] = 30; + else if (abs(srcpU[x]-srcppU[x])<4 && abs(srcpU[x]-srcpnU[x])<4) maskwU[x] = 110; + else if (abs(nxtpU[x]-srcppU[x])<4 && abs(nxtpU[x]-srcpnU[x])<4) maskwU[x] = 130; + else maskwU[x] = 60; + } + prv2ppV += prv2_pitchUV; + prv2pV += prv2_pitchUV; + prv2pnV += prv2_pitchUV; + prv2ppU += prv2_pitchUV; + prv2pU += prv2_pitchUV; + prv2pnU += prv2_pitchUV; + prvppV += prv_pitchUV; + prvpV += prv_pitchUV; + prvpnV += prv_pitchUV; + prvppU += prv_pitchUV; + prvpU += prv_pitchUV; + prvpnU += prv_pitchUV; + srcppV += src_pitchUV; + srcpV += src_pitchUV; + srcpnV += src_pitchUV; + srcppU += src_pitchUV; + srcpU += src_pitchUV; + srcpnU += src_pitchUV; + nxtppV += nxt_pitchUV; + nxtpV += nxt_pitchUV; + nxtpnV += nxt_pitchUV; + nxtppU += nxt_pitchUV; + nxtpU += nxt_pitchUV; + nxtpnU += nxt_pitchUV; + nxt2ppV += nxt2_pitchUV; + nxt2pV += nxt2_pitchUV; + nxt2pnV += nxt2_pitchUV; + nxt2ppU += nxt2_pitchUV; + nxt2pU += nxt2_pitchUV; + nxt2pnU += nxt2_pitchUV; + maskwV += mask_pitchUV; + maskwU += mask_pitchUV; + } + } + else + { + for (y=1; y 1 ? (accumP < accumN ? 20 : 10) : 50; + if (n <= 1 || n >= nfrms-1) + { + for (y=1; y= nfrms-1 ? false : (abs(nxtppY[x] - nxt2ppY[x]) < mthreshL); + t11 = n >= nfrms-1 ? false : (abs(nxtpnY[x] - nxt2pnY[x]) < mthreshL); + t12 = (abs(srcppY[x] - prv2ppY[x]) < mthreshL); + t13 = (abs(srcpnY[x] - prv2pnY[x]) < mthreshL); + t14 = (abs(nxtppY[x] - prvppY[x]) < mthreshL); + t15 = (abs(nxtpnY[x] - prvpnY[x]) < mthreshL); + t16 = (abs(nxt2ppY[x] - srcppY[x]) < mthreshL); + t17 = (abs(nxt2pnY[x] - srcpnY[x]) < mthreshL); + t18 = (abs(srcpY[x] - prv2pY[x]) < mthreshL); + t19 = (abs(nxtpY[x] - prvpY[x]) < mthreshL); + if (t6 && ((t1 && t2 && ((t3 && t4 && t14 && t15) || (t5 && t18))) || + (t3 && t4 && t7 && t19) || + (t5 && t18 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t1 && t8 && t12) || (t2 && t9 && t13))) || + (t7 && t19 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t3 && t10 && t16) || (t4 && t11 && t17))))) + maskwY[x] = val1; + else if (t1 && t2 && t3 && t4 && t5 && t7 && t14 && t15) maskwY[x] = val1; + else if (t1 && t5 && t2 && t8 && t9 && t12 && t13) maskwY[x] = 20; + else if (t3 && t7 && t4 && t10 && t11 && t16 && t17) maskwY[x] = 10; + else if (abs(prvpY[x]-srcppY[x])<4 && abs(prvpY[x]-srcpnY[x])<4) maskwY[x] = 120; + else if (abs(srcpY[x]-srcppY[x])<4 && abs(srcpY[x]-srcpnY[x])<4) maskwY[x] = 110; + else maskwY[x] = 60; + } + prv2ppY += prv2_pitchY; + prv2pY += prv2_pitchY; + prv2pnY += prv2_pitchY; + prvppY += prv_pitchY; + prvpY += prv_pitchY; + prvpnY += prv_pitchY; + srcppY += src_pitchY; + srcpY += src_pitchY; + srcpnY += src_pitchY; + nxtppY += nxt_pitchY; + nxtpY += nxt_pitchY; + nxtpnY += nxt_pitchY; + nxt2ppY += nxt2_pitchY; + nxt2pY += nxt2_pitchY; + nxt2pnY += nxt2_pitchY; + maskwY += mask_pitchY; + } + for (y=1; y= nfrms-1 ? false : (abs(nxtppV[x] - nxt2ppV[x]) < mthreshC); + t11 = n >= nfrms-1 ? false : (abs(nxtpnV[x] - nxt2pnV[x]) < mthreshC); + t12 = (abs(srcppV[x] - prv2ppV[x]) < mthreshC); + t13 = (abs(srcpnV[x] - prv2pnV[x]) < mthreshC); + t14 = (abs(nxtppV[x] - prvppV[x]) < mthreshC); + t15 = (abs(nxtpnV[x] - prvpnV[x]) < mthreshC); + t16 = (abs(nxt2ppV[x] - srcppV[x]) < mthreshC); + t17 = (abs(nxt2pnV[x] - srcpnV[x]) < mthreshC); + t18 = (abs(srcpV[x] - prv2pV[x]) < mthreshC); + t19 = (abs(nxtpV[x] - prvpV[x]) < mthreshC); + if (t6 && ((t1 && t2 && ((t3 && t4 && t14 && t15) || (t5 && t18))) || + (t3 && t4 && t7 && t19) || + (t5 && t18 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t1 && t8 && t12) || (t2 && t9 && t13))) || + (t7 && t19 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t3 && t10 && t16) || (t4 && t11 && t17))))) + maskwV[x] = val1; + else if (t1 && t2 && t3 && t4 && t5 && t7 && t14 && t15) maskwV[x] = val1; + else if (t1 && t5 && t2 && t8 && t9 && t12 && t13) maskwV[x] = 20; + else if (t3 && t7 && t4 && t10 && t11 && t16 && t17) maskwV[x] = 10; + else if (abs(prvpV[x]-srcppV[x])<4 && abs(prvpV[x]-srcpnV[x])<4) maskwV[x] = 120; + else if (abs(srcpV[x]-srcppV[x])<4 && abs(srcpV[x]-srcpnV[x])<4) maskwV[x] = 110; + else maskwV[x] = 60; + t1 = n == 0 ? false : (abs(srcppU[x] - prvppU[x]) < mthreshC); + t2 = n == 0 ? false : (abs(srcpnU[x] - prvpnU[x]) < mthreshC); + t3 = n == nfrms ? false : (abs(srcppU[x] - nxtppU[x]) < mthreshC); + t4 = n == nfrms ? false : (abs(srcpnU[x] - nxtpnU[x]) < mthreshC); + t5 = n <= 1 ? false : (abs(prvpU[x] - prv2pU[x]) < mthreshC); + t6 = n == 0 ? false : (abs(srcpU[x] - prvpU[x]) < mthreshC); + t7 = n == nfrms ? false : (abs(srcpU[x] - nxtpU[x]) < mthreshC); + t8 = n <= 1 ? false : (abs(prvppU[x] - prv2ppU[x]) < mthreshC); + t9 = n <= 1 ? false : (abs(prvpnU[x] - prv2pnU[x]) < mthreshC); + t10 = n >= nfrms-1 ? false : (abs(nxtppU[x] - nxt2ppU[x]) < mthreshC); + t11 = n >= nfrms-1 ? false : (abs(nxtpnU[x] - nxt2pnU[x]) < mthreshC); + t12 = (abs(srcppU[x] - prv2ppU[x]) < mthreshC); + t13 = (abs(srcpnU[x] - prv2pnU[x]) < mthreshC); + t14 = (abs(nxtppU[x] - prvppU[x]) < mthreshC); + t15 = (abs(nxtpnU[x] - prvpnU[x]) < mthreshC); + t16 = (abs(nxt2ppU[x] - srcppU[x]) < mthreshC); + t17 = (abs(nxt2pnU[x] - srcpnU[x]) < mthreshC); + t18 = (abs(srcpU[x] - prv2pU[x]) < mthreshC); + t19 = (abs(nxtpU[x] - prvpU[x]) < mthreshC); + if (t6 && ((t1 && t2 && ((t3 && t4 && t14 && t15) || (t5 && t18))) || + (t3 && t4 && t7 && t19) || + (t5 && t18 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t1 && t8 && t12) || (t2 && t9 && t13))) || + (t7 && t19 && ((t1 && t3 && t14) || (t2 && t4 && t15) || (t3 && t10 && t16) || (t4 && t11 && t17))))) + maskwU[x] = val1; + else if (t1 && t2 && t3 && t4 && t5 && t7 && t14 && t15) maskwU[x] = val1; + else if (t1 && t5 && t2 && t8 && t9 && t12 && t13) maskwU[x] = 20; + else if (t3 && t7 && t4 && t10 && t11 && t16 && t17) maskwU[x] = 10; + else if (abs(prvpU[x]-srcppU[x])<4 && abs(prvpU[x]-srcpnU[x])<4) maskwU[x] = 120; + else if (abs(srcpU[x]-srcppU[x])<4 && abs(srcpU[x]-srcpnU[x])<4) maskwU[x] = 110; + else maskwU[x] = 60; + } + prv2ppV += prv2_pitchUV; + prv2pV += prv2_pitchUV; + prv2pnV += prv2_pitchUV; + prv2ppU += prv2_pitchUV; + prv2pU += prv2_pitchUV; + prv2pnU += prv2_pitchUV; + prvppV += prv_pitchUV; + prvpV += prv_pitchUV; + prvpnV += prv_pitchUV; + prvppU += prv_pitchUV; + prvpU += prv_pitchUV; + prvpnU += prv_pitchUV; + srcppV += src_pitchUV; + srcpV += src_pitchUV; + srcpnV += src_pitchUV; + srcppU += src_pitchUV; + srcpU += src_pitchUV; + srcpnU += src_pitchUV; + nxtppV += nxt_pitchUV; + nxtpV += nxt_pitchUV; + nxtpnV += nxt_pitchUV; + nxtppU += nxt_pitchUV; + nxtpU += nxt_pitchUV; + nxtpnU += nxt_pitchUV; + nxt2ppV += nxt2_pitchUV; + nxt2pV += nxt2_pitchUV; + nxt2pnV += nxt2_pitchUV; + nxt2ppU += nxt2_pitchUV; + nxt2pU += nxt2_pitchUV; + nxt2pnU += nxt2_pitchUV; + maskwV += mask_pitchUV; + maskwU += mask_pitchUV; + } + } + else + { + for (y=1; yGetWritePtr(PLANAR_Y); + unsigned char *maskpV = mask->GetWritePtr(PLANAR_V); + unsigned char *maskpU = mask->GetWritePtr(PLANAR_U); + int mask_pitchY = mask->GetPitch(PLANAR_Y); + int mask_pitchY2 = mask_pitchY<<1; + int mask_pitchY4 = mask_pitchY<<2; + int mask_pitchUV = mask->GetPitch(PLANAR_V); + int mask_pitchUV2 = mask_pitchUV<<1; + int HeightUV = mask->GetHeight(PLANAR_V); + int WidthUV = mask->GetRowSize(PLANAR_V); + maskpY += mask_pitchY*PRM(field); + maskpV += mask_pitchUV*PRM(field); + maskpU += mask_pitchUV*PRM(field); + unsigned char *maskpnY = maskpY + mask_pitchY2; + int x, y; + for (y=PRM(field); yGetWritePtr(PLANAR_Y); + unsigned char *maskpV = mask->GetWritePtr(PLANAR_V); + unsigned char *maskpU = mask->GetWritePtr(PLANAR_U); + int mask_pitchY = mask->GetPitch(PLANAR_Y); + int mask_pitchY2 = mask_pitchY<<1; + int mask_pitchY4 = mask_pitchY<<2; + int mask_pitchUV = mask->GetPitch(PLANAR_V); + int mask_pitchUV2 = mask_pitchUV<<1; + int HeightUV = mask->GetHeight(PLANAR_V); + int WidthUV = mask->GetRowSize(PLANAR_V); + maskpY += mask_pitchY*PRM(field); + maskpV += mask_pitchUV*PRM(field); + maskpU += mask_pitchUV*PRM(field); + unsigned char *maskpnY = maskpY + mask_pitchY2; + int x, y; + for (y=PRM(field); yGetWritePtr(PLANAR_Y); + unsigned char *maskpV = mask->GetWritePtr(PLANAR_V); + unsigned char *maskpU = mask->GetWritePtr(PLANAR_U); + int mask_pitchY = mask->GetPitch(PLANAR_Y); + int mask_pitchY2 = mask_pitchY<<1; + int mask_pitchY4 = mask_pitchY<<2; + int mask_pitchUV = mask->GetPitch(PLANAR_V); + int mask_pitchUV2 = mask_pitchUV<<1; + int HeightUV = mask->GetHeight(PLANAR_V); + int WidthUV = mask->GetRowSize(PLANAR_V); + maskpY += mask_pitchY*PRM(field); + maskpV += mask_pitchUV*PRM(field); + maskpU += mask_pitchUV*PRM(field); + unsigned char *maskpnY = maskpY + mask_pitchY2; + int x, y; + for (y=PRM(field); yGetWritePtr(PLANAR_Y); + unsigned char *maskpV = mask->GetWritePtr(PLANAR_V); + unsigned char *maskpU = mask->GetWritePtr(PLANAR_U); + int mask_pitchY = mask->GetPitch(PLANAR_Y); + int mask_pitchY2 = mask_pitchY<<1; + int mask_pitchUV = mask->GetPitch(PLANAR_V); + int mask_pitchUV2 = mask_pitchUV<<1; + int HeightY = mask->GetHeight(PLANAR_Y); + int HeightUV = mask->GetHeight(PLANAR_V); + int WidthY = mask->GetRowSize(PLANAR_Y); + int WidthUV = mask->GetRowSize(PLANAR_V); + maskpY += mask_pitchY*(2+PRM(field)); + maskpV += mask_pitchUV*(2+PRM(field)); + maskpU += mask_pitchUV*(2+PRM(field)); + unsigned char *maskppY = maskpY - mask_pitchY2; + unsigned char *maskppV = maskpV - mask_pitchUV2; + unsigned char *maskppU = maskpU - mask_pitchUV2; + unsigned char *maskpnY = maskpY + mask_pitchY2; + unsigned char *maskpnV = maskpV + mask_pitchUV2; + unsigned char *maskpnU = maskpU + mask_pitchUV2; + int sum, xhi, v, x, y; + for (y=2; y0; --b) + { + if (b == 3) plane = PLANAR_U; + else if (b == 2) plane = PLANAR_V; + else plane = PLANAR_Y; + srcp = src->GetReadPtr(plane); + src_pitch = src->GetPitch(plane); + Width = src->GetRowSize(plane); + Height = src->GetHeight(plane); + srcpp = srcp - src_pitch; + srcppp = srcpp - src_pitch; + srcpn = srcp + src_pitch; + srcpnn = srcpn + src_pitch; + cmkp = cmask->GetWritePtr(plane); + cmk_pitch = cmask->GetPitch(plane); + memset(cmkp,0,Height*cmk_pitch); + for (x=0; x cthresh || sFirst < -cthresh) + { + sFirst = abs(srcpnn[x]+(srcp[x]<<2)+srcpnn[x]-(3*(srcpn[x]+srcpn[x]))); + if (sFirst > cthresh6) cmkp[x] = 0x3C; + } + } + srcppp += src_pitch; + srcpp += src_pitch; + srcp += src_pitch; + srcpn += src_pitch; + srcpnn += src_pitch; + cmkp += cmk_pitch; + for (x=0; x cthresh && sSecond > cthresh) || (sFirst < -cthresh && sSecond < -cthresh)) + { + sFirst = abs(srcpnn[x]+(srcp[x]<<2)+srcpnn[x]-(3*(srcpp[x]+srcpn[x]))); + if (sFirst > cthresh6) cmkp[x] = 0x3C; + } + } + srcppp += src_pitch; + srcpp += src_pitch; + srcp += src_pitch; + srcpn += src_pitch; + srcpnn += src_pitch; + cmkp += cmk_pitch; + for (y=2; y cthresh && sSecond > cthresh) || (sFirst < -cthresh && sSecond < -cthresh)) + { + sFirst = abs(srcppp[x]+(srcp[x]<<2)+srcpnn[x]-(3*(srcpp[x]+srcpn[x]))); + if (sFirst > cthresh6) cmkp[x] = 0x3C; + } + } + srcppp += src_pitch; + srcpp += src_pitch; + srcp += src_pitch; + srcpn += src_pitch; + srcpnn += src_pitch; + cmkp += cmk_pitch; + } + for (x=0; x cthresh && sSecond > cthresh) || (sFirst < -cthresh && sSecond < -cthresh)) + { + sFirst = abs(srcppp[x]+(srcp[x]<<2)+srcppp[x]-(3*(srcpp[x]+srcpn[x]))); + if (sFirst > cthresh6) cmkp[x] = 0x3C; + } + } + srcppp += src_pitch; + srcpp += src_pitch; + srcp += src_pitch; + srcpn += src_pitch; + srcpnn += src_pitch; + cmkp += cmk_pitch; + for (x=0; x cthresh || sFirst < -cthresh) + { + sFirst = abs(srcppp[x]+(srcp[x]<<2)+srcppp[x]-(3*(srcpp[x]+srcpp[x]))); + if (sFirst > cthresh6) cmkp[x] = 0x3C; + } + } + } + if (chroma) + { + cmkp = cmask->GetWritePtr(PLANAR_Y); + cmkpU = cmask->GetWritePtr(PLANAR_U); + cmkpV = cmask->GetWritePtr(PLANAR_V); + Width = cmask->GetRowSize(PLANAR_V); + Height = cmask->GetHeight(PLANAR_V); + cmk_pitch = cmask->GetPitch(PLANAR_Y); + cmk_pitchUV = cmask->GetPitch(PLANAR_V); + cmkpp = cmkp - cmk_pitch; + cmkpn = cmkp + cmk_pitch; + cmkpnn = cmkpn + cmk_pitch; + cmkppU = cmkpU - cmk_pitchUV; + cmkpnU = cmkpU + cmk_pitchUV; + cmkppV = cmkpV - cmk_pitchUV; + cmkpnV = cmkpV + cmk_pitchUV; + cmk_pitch <<= 1; + for (y=1; yGetPitch(PLANAR_Y); + cmkp = cmask->GetWritePtr(PLANAR_Y) + cmk_pitch; + cmkpp = cmkp - cmk_pitch; + cmkpn = cmkp + cmk_pitch; + Width = cmask->GetRowSize(PLANAR_Y); + Height = cmask->GetHeight(PLANAR_Y); + xblocks = ((Width+xhalf)>>xshift) + 1; + xblocks4 = xblocks<<2; + yblocks = ((Height+yhalf)>>yshift) + 1; + arraysize = (xblocks*yblocks)<<2; + memset(cArray,0,arraysize*sizeof(int)); + for (y=1; y>yshift)*xblocks4; + temp2 = ((y+yhalf)>>yshift)*xblocks4; + for (x=0; x>xshift)<<2; + box2 = ((x+xhalf)>>xshift)<<2; + ++cArray[temp1+box1+0]; + ++cArray[temp1+box2+1]; + ++cArray[temp2+box1+2]; + ++cArray[temp2+box2+3]; + } + } + cmkpp += cmk_pitch; + cmkp += cmk_pitch; + cmkpn += cmk_pitch; + } + for (x=0; x MI) return true; + } + return false; +} + +void vidTDeint::subtractFieldsYV12(ADMImage *prv, ADMImage *src, ADMImage *nxt) +{ + const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); + const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); + const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); + int prv_pitchY = prv->GetPitch(PLANAR_Y); + int prv_pitchUV = prv->GetPitch(PLANAR_V); + const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); + const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); + const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); + int src_pitchY = src->GetPitch(PLANAR_Y); + int src_pitchUV = src->GetPitch(PLANAR_V); + int WidthY = src->GetRowSize(PLANAR_Y)-8; + int HeightY = src->GetHeight(PLANAR_Y); + int WidthUV = src->GetRowSize(PLANAR_V)-4; + int HeightUV = src->GetHeight(PLANAR_V); + const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); + const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); + const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); + const unsigned char *prvpfY, *prvnfY, *nxtpfY, *nxtnfY; + const unsigned char *prvpfU, *prvnfU, *nxtpfU, *nxtnfU; + const unsigned char *prvpfV, *prvnfV, *nxtpfV, *nxtnfV; + const unsigned char *curpfY, *curfY, *curnfY; + const unsigned char *curpfU, *curfU, *curnfU; + const unsigned char *curpfV, *curfV, *curnfV; + int nxt_pitchY = nxt->GetPitch(PLANAR_Y); + int nxt_pitchUV = nxt->GetPitch(PLANAR_V); + int prvf_pitchY, prvf_pitchUV; + int curf_pitchY, curf_pitchUV; + int nxtf_pitchY, nxtf_pitchUV; + int x, y, temp, temp2; + accumP = accumN = 0; + if (PRM(field)^PRM(order)) + { + prvf_pitchY = src_pitchY<<1; + prvf_pitchUV = src_pitchUV<<1; + curf_pitchY = src_pitchY<<1; + curf_pitchUV = src_pitchUV<<1; + nxtf_pitchY = nxt_pitchY<<1; + nxtf_pitchUV = nxt_pitchUV<<1; + prvpfY = srcpY + ((PRM(field) == 1 ? 1 : 2)*src_pitchY); + prvpfU = srcpU + ((PRM(field) == 1 ? 1 : 2)*src_pitchUV); + prvpfV = srcpV + ((PRM(field) == 1 ? 1 : 2)*src_pitchUV); + curfY = srcpY + ((3-PRM(field))*src_pitchY); + curfU = srcpU + ((3-PRM(field))*src_pitchUV); + curfV = srcpV + ((3-PRM(field))*src_pitchUV); + nxtpfY = nxtpY + ((PRM(field) == 1 ? 1 : 2)*nxt_pitchY); + nxtpfU = nxtpU + ((PRM(field) == 1 ? 1 : 2)*nxt_pitchUV); + nxtpfV = nxtpV + ((PRM(field) == 1 ? 1 : 2)*nxt_pitchUV); + } + else + { + prvf_pitchY = prv_pitchY<<1; + prvf_pitchUV = prv_pitchUV<<1; + curf_pitchY = src_pitchY<<1; + curf_pitchUV = src_pitchUV<<1; + nxtf_pitchY = src_pitchY<<1; + nxtf_pitchUV = src_pitchUV<<1; + prvpfY = prvpY + ((PRM(field) == 1 ? 1 : 2)*prv_pitchY); + prvpfU = prvpU + ((PRM(field) == 1 ? 1 : 2)*prv_pitchUV); + prvpfV = prvpV + ((PRM(field) == 1 ? 1 : 2)*prv_pitchUV); + curfY = srcpY + ((3-PRM(field))*src_pitchY); + curfU = srcpU + ((3-PRM(field))*src_pitchUV); + curfV = srcpV + ((3-PRM(field))*src_pitchUV); + nxtpfY = srcpY + ((PRM(field) == 1 ? 1 : 2)*src_pitchY); + nxtpfU = srcpU + ((PRM(field) == 1 ? 1 : 2)*src_pitchUV); + nxtpfV = srcpV + ((PRM(field) == 1 ? 1 : 2)*src_pitchUV); + } + prvnfY = prvpfY + prvf_pitchY; + prvnfU = prvpfU + prvf_pitchUV; + prvnfV = prvpfV + prvf_pitchUV; + curpfY = curfY - curf_pitchY; + curpfU = curfU - curf_pitchUV; + curpfV = curfV - curf_pitchUV; + curnfY = curfY + curf_pitchY; + curnfU = curfU + curf_pitchUV; + curnfV = curfV + curf_pitchUV; + nxtnfY = nxtpfY + nxtf_pitchY; + nxtnfU = nxtpfU + nxtf_pitchUV; + nxtnfV = nxtpfV + nxtf_pitchUV; + for (y=2; y 3 || abs(prvnfY[x]-nxtnfY[x]) > 3) + { + temp = (curpfY[x]+(curfY[x]<<2)+curnfY[x]); + temp2 = abs(3*(prvpfY[x]+prvnfY[x])-temp); + if (temp2 > 23) accumP += temp2; + temp2 = abs(3*(nxtpfY[x]+nxtnfY[x])-temp); + if (temp2 > 23) accumN += temp2; + } + } + prvpfY += prvf_pitchY; + prvnfY += prvf_pitchY; + curpfY += curf_pitchY; + curfY += curf_pitchY; + curnfY += curf_pitchY; + nxtpfY += nxtf_pitchY; + nxtnfY += nxtf_pitchY; + } + for (y=2; y 3 || abs(prvnfU[x]-nxtnfU[x]) > 3) + { + temp = (curpfU[x]+(curfU[x]<<2)+curnfU[x]); + temp2 = abs(3*(prvpfU[x]+prvnfU[x])-temp); + if (temp2 > 23) accumP += temp2; + temp2 = abs(3*(nxtpfU[x]+nxtnfU[x])-temp); + if (temp2 > 23) accumN += temp2; + } + if (abs(prvpfV[x]-nxtpfV[x]) > 3 || abs(prvnfV[x]-nxtnfV[x]) > 3) + { + temp = (curpfV[x]+(curfV[x]<<2)+curnfV[x]); + temp2 = abs(3*(prvpfV[x]+prvnfV[x])-temp); + if (temp2 > 23) accumP += temp2; + temp2 = abs(3*(nxtpfV[x]+nxtnfV[x])-temp); + if (temp2 > 23) accumN += temp2; + } + } + prvpfU += prvf_pitchUV; + prvnfU += prvf_pitchUV; + prvpfV += prvf_pitchUV; + prvnfV += prvf_pitchUV; + curpfU += curf_pitchUV; + curfU += curf_pitchUV; + curnfU += curf_pitchUV; + curpfV += curf_pitchUV; + curfV += curf_pitchUV; + curnfV += curf_pitchUV; + nxtpfU += nxtf_pitchUV; + nxtnfU += nxtf_pitchUV; + nxtpfV += nxtf_pitchUV; + nxtnfV += nxtf_pitchUV; + } +} + +void vidTDeint::mapColorsYV12(ADMImage *dst, ADMImage *mask) +{ + const unsigned char *maskpY = mask->GetReadPtr(PLANAR_Y); + const unsigned char *maskpV = mask->GetReadPtr(PLANAR_V); + const unsigned char *maskpU = mask->GetReadPtr(PLANAR_U); + int mask_pitchY = mask->GetPitch(PLANAR_Y); + int mask_pitchUV = mask->GetPitch(PLANAR_V); + int HeightY = mask->GetHeight(PLANAR_Y); + int HeightUV = mask->GetHeight(PLANAR_V); + int WidthY = mask->GetRowSize(PLANAR_Y); + int WidthUV = mask->GetRowSize(PLANAR_V); + unsigned char *dstpY = dst->GetWritePtr(PLANAR_Y); + unsigned char *dstpV = dst->GetWritePtr(PLANAR_V); + unsigned char *dstpU = dst->GetWritePtr(PLANAR_U); + int dst_pitchY = dst->GetPitch(PLANAR_Y); + int dst_pitchUV = dst->GetPitch(PLANAR_V); + int x, y; + for (y=0; yGetReadPtr(PLANAR_Y); + const unsigned char *maskpV = mask->GetReadPtr(PLANAR_V); + const unsigned char *maskpU = mask->GetReadPtr(PLANAR_U); + int mask_pitchY = mask->GetPitch(PLANAR_Y); + int mask_pitchUV = mask->GetPitch(PLANAR_V); + int HeightY = mask->GetHeight(PLANAR_Y); + int HeightUV = mask->GetHeight(PLANAR_V); + int WidthY = mask->GetRowSize(PLANAR_Y); + int WidthUV = mask->GetRowSize(PLANAR_V); + unsigned char *dstpY = dst->GetWritePtr(PLANAR_Y); + unsigned char *dstpV = dst->GetWritePtr(PLANAR_V); + unsigned char *dstpU = dst->GetWritePtr(PLANAR_U); + int dst_pitchY = dst->GetPitch(PLANAR_Y); + int dst_pitchUV = dst->GetPitch(PLANAR_V); + const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); + const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); + const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); + int prv_pitchY = prv->GetPitch(PLANAR_Y); + int prv_pitchUV = prv->GetPitch(PLANAR_V); + const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); + const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); + const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); + int src_pitchY = src->GetPitch(PLANAR_Y); + int src_pitchUV = src->GetPitch(PLANAR_V); + const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); + const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); + const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); + int nxt_pitchY = nxt->GetPitch(PLANAR_Y); + int nxt_pitchUV = nxt->GetPitch(PLANAR_V); + int x, y; + for (y=0; y>1; + else if (maskpY[x] == 50) dstpY[x] = (srcpY[x]+prvpY[x]+1)>>1; + else if (maskpY[x] == 60) dstpY[x] = 255; + } + prvpY += prv_pitchY; + srcpY += src_pitchY; + nxtpY += nxt_pitchY; + maskpY += mask_pitchY; + dstpY += dst_pitchY; + } + for (y=0; y>1; + else if (maskpV[x] == 50) dstpV[x] = (srcpV[x]+prvpV[x]+1)>>1; + else if (maskpV[x] == 60) dstpV[x] = 255; + if (maskpU[x] == 10 || maskpU[x] == 110) dstpU[x] = srcpU[x]; + else if (maskpU[x] == 20 || maskpU[x] == 120) dstpU[x] = prvpU[x]; + else if (maskpU[x] == 30 || maskpU[x] == 130) dstpU[x] = nxtpU[x]; + else if (maskpU[x] == 40) dstpU[x] = (srcpU[x]+nxtpU[x]+1)>>1; + else if (maskpU[x] == 50) dstpU[x] = (srcpU[x]+prvpU[x]+1)>>1; + else if (maskpU[x] == 60) dstpU[x] = 255; + } + prvpV += prv_pitchUV; + prvpU += prv_pitchUV; + srcpV += src_pitchUV; + srcpU += src_pitchUV; + nxtpV += nxt_pitchUV; + nxtpU += nxt_pitchUV; + maskpV += mask_pitchUV; + maskpU += mask_pitchUV; + dstpV += dst_pitchUV; + dstpU += dst_pitchUV; + } +} + +void vidTDeint::cubicDeintYV12(ADMImage *dst, ADMImage *mask, + ADMImage *prv, ADMImage *src, ADMImage *nxt) +{ + const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); + const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); + const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); + int prv_pitchY = prv->GetPitch(PLANAR_Y); + int prv_pitchUV = prv->GetPitch(PLANAR_V); + const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); + const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); + const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); + int src_pitchY = src->GetPitch(PLANAR_Y); + int src_pitchY2 = src_pitchY<<1; + int src_pitchUV = src->GetPitch(PLANAR_V); + int src_pitchUV2 = src_pitchUV<<1; + int WidthY = src->GetRowSize(PLANAR_Y); + int WidthUV = src->GetRowSize(PLANAR_V); + int HeightY = src->GetHeight(PLANAR_Y); + int HeightUV = src->GetHeight(PLANAR_V); + const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); + const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); + const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); + int nxt_pitchY = nxt->GetPitch(PLANAR_Y); + int nxt_pitchUV = nxt->GetPitch(PLANAR_V); + unsigned char *dstpY = dst->GetWritePtr(PLANAR_Y); + unsigned char *dstpV = dst->GetWritePtr(PLANAR_V); + unsigned char *dstpU = dst->GetWritePtr(PLANAR_U); + int dst_pitchY = dst->GetPitch(PLANAR_Y); + int dst_pitchUV = dst->GetPitch(PLANAR_V); + const unsigned char *maskpY = mask->GetReadPtr(PLANAR_Y); + const unsigned char *maskpV = mask->GetReadPtr(PLANAR_V); + const unsigned char *maskpU = mask->GetReadPtr(PLANAR_U); + int mask_pitchY = mask->GetPitch(PLANAR_Y); + int mask_pitchUV = mask->GetPitch(PLANAR_V); + const unsigned char *srcppY = srcpY - src_pitchY; + const unsigned char *srcpppY = srcppY - src_pitchY2; + const unsigned char *srcpnY = srcpY + src_pitchY; + const unsigned char *srcpnnY = srcpnY + src_pitchY2; + const unsigned char *srcppV = srcpV - src_pitchUV; + const unsigned char *srcpppV = srcppV - src_pitchUV2; + const unsigned char *srcpnV = srcpV + src_pitchUV; + const unsigned char *srcpnnV = srcpnV + src_pitchUV2; + const unsigned char *srcppU = srcpU - src_pitchUV; + const unsigned char *srcpppU = srcppU - src_pitchUV2; + const unsigned char *srcpnU = srcpU + src_pitchUV; + const unsigned char *srcpnnU = srcpnU + src_pitchUV2; + int x, y; + for (y=0; y>1; + else if (maskpY[x] == 50) dstpY[x] = (srcpY[x]+prvpY[x]+1)>>1; + else if (maskpY[x] == 60) + { + if (y<3 || y>HeightY-4) dstpY[x] = (srcpnY[x]+srcppY[x]+1)>>1; + else dstpY[x] = cubicInt(srcpppY[x],srcppY[x],srcpnY[x],srcpnnY[x]); + } + } + prvpY += prv_pitchY; + srcpppY += src_pitchY; + srcppY += src_pitchY; + srcpY += src_pitchY; + srcpnY += src_pitchY; + srcpnnY += src_pitchY; + nxtpY += nxt_pitchY; + maskpY += mask_pitchY; + dstpY += dst_pitchY; + } + for (y=0; y>1; + else if (maskpV[x] == 50) dstpV[x] = (srcpV[x]+prvpV[x]+1)>>1; + else if (maskpV[x] == 60) + { + if (y<3 || y>HeightUV-4) dstpV[x] = (srcpnV[x]+srcppV[x]+1)>>1; + else dstpV[x] = cubicInt(srcpppV[x],srcppV[x],srcpnV[x],srcpnnV[x]); + } + if (maskpU[x] == 10 || maskpU[x] == 110) dstpU[x] = srcpU[x]; + else if (maskpU[x] == 20 || maskpU[x] == 120) dstpU[x] = prvpU[x]; + else if (maskpU[x] == 30 || maskpU[x] == 130) dstpU[x] = nxtpU[x]; + else if (maskpU[x] == 40) dstpU[x] = (srcpU[x]+nxtpU[x]+1)>>1; + else if (maskpU[x] == 50) dstpU[x] = (srcpU[x]+prvpU[x]+1)>>1; + else if (maskpU[x] == 60) + { + if (y<3 || y>HeightUV-4) dstpU[x] = (srcpnU[x]+srcppU[x]+1)>>1; + else dstpU[x] = cubicInt(srcpppU[x],srcppU[x],srcpnU[x],srcpnnU[x]); + } + } + prvpV += prv_pitchUV; + prvpU += prv_pitchUV; + srcpppV += src_pitchUV; + srcppV += src_pitchUV; + srcpV += src_pitchUV; + srcpnV += src_pitchUV; + srcpnnV += src_pitchUV; + srcpppU += src_pitchUV; + srcppU += src_pitchUV; + srcpU += src_pitchUV; + srcpnU += src_pitchUV; + srcpnnU += src_pitchUV; + nxtpV += nxt_pitchUV; + nxtpU += nxt_pitchUV; + maskpV += mask_pitchUV; + maskpU += mask_pitchUV; + dstpV += dst_pitchUV; + dstpU += dst_pitchUV; + } +} + +void vidTDeint::ELADeintYV12(ADMImage *dst, ADMImage *mask, + ADMImage *prv, ADMImage *src, ADMImage *nxt) +{ + const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); + const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); + const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); + int prv_pitchY = prv->GetPitch(PLANAR_Y); + int prv_pitchUV = prv->GetPitch(PLANAR_V); + const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); + const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); + const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); + int src_pitchY = src->GetPitch(PLANAR_Y); + int src_pitchUV = src->GetPitch(PLANAR_V); + int WidthY = src->GetRowSize(PLANAR_Y); + int WidthUV = src->GetRowSize(PLANAR_V); + int HeightY = src->GetHeight(PLANAR_Y); + int HeightUV = src->GetHeight(PLANAR_V); + const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); + const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); + const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); + int nxt_pitchY = nxt->GetPitch(PLANAR_Y); + int nxt_pitchUV = nxt->GetPitch(PLANAR_V); + unsigned char *dstpY = dst->GetWritePtr(PLANAR_Y); + unsigned char *dstpV = dst->GetWritePtr(PLANAR_V); + unsigned char *dstpU = dst->GetWritePtr(PLANAR_U); + int dst_pitchY = dst->GetPitch(PLANAR_Y); + int dst_pitchUV = dst->GetPitch(PLANAR_V); + const unsigned char *maskpY = mask->GetReadPtr(PLANAR_Y); + const unsigned char *maskpV = mask->GetReadPtr(PLANAR_V); + const unsigned char *maskpU = mask->GetReadPtr(PLANAR_U); + int mask_pitchY = mask->GetPitch(PLANAR_Y); + int mask_pitchUV = mask->GetPitch(PLANAR_V); + const unsigned char *srcppY = srcpY - src_pitchY; + const unsigned char *srcpnY = srcpY + src_pitchY; + const unsigned char *srcppV = srcpV - src_pitchUV; + const unsigned char *srcpnV = srcpV + src_pitchUV; + const unsigned char *srcppU = srcpU - src_pitchUV; + const unsigned char *srcpnU = srcpU + src_pitchUV; + int x, y, u, val, stop, temp1, temp2, min, minf, maxf, s1, s2; + for (y=0; y>1; + else if (maskpY[x] == 50) dstpY[x] = (srcpY[x]+prvpY[x]+1)>>1; + else if (maskpY[x] == 60) + { + if (x < 2 || x > WidthY-3 || (abs(srcppY[x]-srcpnY[x]) < 10 && + abs(srcppY[x-2]-srcppY[x+2]) < 10 && abs(srcpnY[x-2]-srcpnY[x+2]) < 10)) + { + dstpY[x] = (srcppY[x]+srcpnY[x]+1)>>1; + } + else + { + stop = min(x-1,min(8,WidthY-2-x)); + minf = min(srcppY[x],srcpnY[x])-2; + maxf = max(srcppY[x],srcpnY[x])+2; + val = (srcppY[x]+srcpnY[x]+1)>>1; + for (min=450, u=0; u<=stop; ++u) + { + s1 = srcppY[x+(u>>1)]+srcppY[x+((u+1)>>1)]; + s2 = srcpnY[x-(u>>1)]+srcpnY[x-((u+1)>>1)]; + temp1 = abs(s1-s2) + abs(srcppY[x-1]-srcpnY[x-1-u]) + + (abs(srcppY[x]-srcpnY[x-u])<<1) + abs(srcppY[x+1]-srcpnY[x+1-u]) + + abs(srcpnY[x-1]-srcppY[x-1+u]) + (abs(srcpnY[x]-srcppY[x+u])<<1) + + abs(srcpnY[x+1]-srcppY[x+1+u]); + temp2 = (s1+s2+2)>>2; + if (temp1 < min && temp2 >= minf && temp2 <= maxf) + { + min = temp1; + val = temp2; + } + s1 = srcppY[x-(u>>1)]+srcppY[x-((u+1)>>1)]; + s2 = srcpnY[x+(u>>1)]+srcpnY[x+((u+1)>>1)]; + temp1 = abs(s1-s2) + abs(srcppY[x-1]-srcpnY[x-1+u]) + + (abs(srcppY[x]-srcpnY[x+u])<<1) + abs(srcppY[x+1]-srcpnY[x+1+u])+ + abs(srcpnY[x-1]-srcppY[x-1-u]) + (abs(srcpnY[x]-srcppY[x-u])<<1) + + abs(srcpnY[x+1]-srcppY[x+1-u]); + temp2 = (s1+s2+2)>>2; + if (temp1 < min && temp2 >= minf && temp2 <= maxf) + { + min = temp1; + val = temp2; + } + } + dstpY[x] = val; + } + } + } + prvpY += prv_pitchY; + srcppY += src_pitchY; + srcpY += src_pitchY; + srcpnY += src_pitchY; + nxtpY += nxt_pitchY; + maskpY += mask_pitchY; + dstpY += dst_pitchY; + } + for (y=0; y>1; + else if (maskpV[x] == 50) dstpV[x] = (srcpV[x]+prvpV[x]+1)>>1; + else if (maskpV[x] == 60) + { + if (x < 2 || x > WidthUV-3 || (abs(srcppV[x]-srcpnV[x]) < 10 && + abs(srcppV[x-2]-srcppV[x+2]) < 10 && abs(srcpnV[x-2]-srcpnV[x+2]) < 10)) + { + dstpV[x] = (srcppV[x]+srcpnV[x]+1)>>1; + } + else + { + stop = min(x-1,min(4,WidthUV-2-x)); + minf = min(srcppV[x],srcpnV[x])-2; + maxf = max(srcppV[x],srcpnV[x])+2; + val = (srcppV[x]+srcpnV[x]+1)>>1; + for (min=450, u=0; u<=stop; ++u) + { + s1 = srcppV[x+(u>>1)]+srcppV[x+((u+1)>>1)]; + s2 = srcpnV[x-(u>>1)]+srcpnV[x-((u+1)>>1)]; + temp1 = abs(s1-s2) + abs(srcppV[x-1]-srcpnV[x-1-u]) + + (abs(srcppV[x]-srcpnV[x-u])<<1) + abs(srcppV[x+1]-srcpnV[x+1-u]) + + abs(srcpnV[x-1]-srcppV[x-1+u]) + (abs(srcpnV[x]-srcppV[x+u])<<1) + + abs(srcpnV[x+1]-srcppV[x+1+u]); + temp2 = (s1+s2+2)>>2; + if (temp1 < min && temp2 >= minf && temp2 <= maxf) + { + min = temp1; + val = temp2; + } + s1 = srcppV[x-(u>>1)]+srcppV[x-((u+1)>>1)]; + s2 = srcpnV[x+(u>>1)]+srcpnV[x+((u+1)>>1)]; + temp1 = abs(s1-s2) + abs(srcppV[x-1]-srcpnV[x-1+u]) + + (abs(srcppV[x]-srcpnV[x+u])<<1) + abs(srcppV[x+1]-srcpnV[x+1+u]) + + abs(srcpnV[x-1]-srcppV[x-1-u]) + (abs(srcpnV[x]-srcppV[x-u])<<1) + + abs(srcpnV[x+1]-srcppV[x+1-u]); + temp2 = (s1+s2+2)>>2; + if (temp1 < min && temp2 >= minf && temp2 <= maxf) + { + min = temp1; + val = temp2; + } + } + dstpV[x] = val; + } + } + if (maskpU[x] == 10 || maskpU[x] == 110) dstpU[x] = srcpU[x]; + else if (maskpU[x] == 20 || maskpU[x] == 120) dstpU[x] = prvpU[x]; + else if (maskpU[x] == 30 || maskpU[x] == 130) dstpU[x] = nxtpU[x]; + else if (maskpU[x] == 40) dstpU[x] = (srcpU[x]+nxtpU[x]+1)>>1; + else if (maskpU[x] == 50) dstpU[x] = (srcpU[x]+prvpU[x]+1)>>1; + else if (maskpU[x] == 60) + { + if (x < 2 || x > WidthUV-3 || (abs(srcppU[x]-srcpnU[x]) < 10 && + abs(srcppU[x-2]-srcppU[x+2]) < 10 && abs(srcpnU[x-2]-srcpnU[x+2]) < 10)) + { + dstpU[x] = (srcppU[x]+srcpnU[x]+1)>>1; + } + else + { + stop = min(x-1,min(4,WidthUV-2-x)); + minf = min(srcppU[x],srcpnU[x])-2; + maxf = max(srcppU[x],srcpnU[x])+2; + val = (srcppU[x]+srcpnU[x]+1)>>1; + for (min=450, u=0; u<=stop; ++u) + { + s1 = srcppU[x+(u>>1)]+srcppU[x+((u+1)>>1)]; + s2 = srcpnU[x-(u>>1)]+srcpnU[x-((u+1)>>1)]; + temp1 = abs(s1-s2) + abs(srcppU[x-1]-srcpnU[x-1-u]) + + (abs(srcppU[x]-srcpnU[x-u])<<1) + abs(srcppU[x+1]-srcpnU[x+1-u]) + + abs(srcpnU[x-1]-srcppU[x-1+u]) + (abs(srcpnU[x]-srcppU[x+u])<<1) + + abs(srcpnU[x+1]-srcppU[x+1+u]); + temp2 = (s1+s2+2)>>2; + if (temp1 < min && temp2 >= minf && temp2 <= maxf) + { + min = temp1; + val = temp2; + } + s1 = srcppU[x-(u>>1)]+srcppU[x-((u+1)>>1)]; + s2 = srcpnU[x+(u>>1)]+srcpnU[x+((u+1)>>1)]; + temp1 = abs(s1-s2) + abs(srcppU[x-1]-srcpnU[x-1+u]) + + (abs(srcppU[x]-srcpnU[x+u])<<1) + abs(srcppU[x+1]-srcpnU[x+1+u]) + + abs(srcpnU[x-1]-srcppU[x-1-u]) + (abs(srcpnU[x]-srcppU[x-u])<<1) + + abs(srcpnU[x+1]-srcppU[x+1-u]); + temp2 = (s1+s2+2)>>2; + if (temp1 < min && temp2 >= minf && temp2 <= maxf) + { + min = temp1; + val = temp2; + } + } + dstpU[x] = val; + } + } + } + prvpV += prv_pitchUV; + prvpU += prv_pitchUV; + srcppV += src_pitchUV; + srcpV += src_pitchUV; + srcpnV += src_pitchUV; + srcppU += src_pitchUV; + srcpU += src_pitchUV; + srcpnU += src_pitchUV; + nxtpV += nxt_pitchUV; + nxtpU += nxt_pitchUV; + maskpV += mask_pitchUV; + maskpU += mask_pitchUV; + dstpV += dst_pitchUV; + dstpU += dst_pitchUV; + } +} + +void vidTDeint::kernelDeintYV12(ADMImage *dst, ADMImage *mask, + ADMImage *prv, ADMImage *src, ADMImage *nxt) +{ + const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); + const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); + const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); + int prv_pitchY = prv->GetPitch(PLANAR_Y); + int prv_pitchY2 = prv_pitchY<<1; + int prv_pitchUV = prv->GetPitch(PLANAR_V); + int prv_pitchUV2 = prv_pitchUV<<1; + const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); + const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); + const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); + int src_pitchY = src->GetPitch(PLANAR_Y); + int src_pitchUV = src->GetPitch(PLANAR_V); + int src_pitchY2 = src_pitchY<<1; + int src_pitchUV2 = src_pitchUV<<1; + int WidthY = src->GetRowSize(PLANAR_Y); + int WidthUV = src->GetRowSize(PLANAR_V); + int HeightY = src->GetHeight(PLANAR_Y); + int HeightUV = src->GetHeight(PLANAR_V); + const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); + const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); + const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); + int nxt_pitchY = nxt->GetPitch(PLANAR_Y); + int nxt_pitchY2 = nxt_pitchY<<1; + int nxt_pitchUV = nxt->GetPitch(PLANAR_V); + int nxt_pitchUV2 = nxt_pitchUV<<1; + unsigned char *dstpY = dst->GetWritePtr(PLANAR_Y); + unsigned char *dstpU = dst->GetWritePtr(PLANAR_U); + unsigned char *dstpV = dst->GetWritePtr(PLANAR_V); + int dst_pitchY = dst->GetPitch(PLANAR_Y); + int dst_pitchUV = dst->GetPitch(PLANAR_V); + const unsigned char *maskpY = mask->GetReadPtr(PLANAR_Y); + const unsigned char *maskpU = mask->GetReadPtr(PLANAR_U); + const unsigned char *maskpV = mask->GetReadPtr(PLANAR_V); + int mask_pitchY = mask->GetPitch(PLANAR_Y); + int mask_pitchUV = mask->GetPitch(PLANAR_V); + const unsigned char *srcppY = srcpY - src_pitchY; + const unsigned char *srcppU = srcpU - src_pitchUV; + const unsigned char *srcppV = srcpV - src_pitchUV; + const unsigned char *srcpppY = srcppY - src_pitchY2; + const unsigned char *srcpppU = srcppU - src_pitchUV2; + const unsigned char *srcpppV = srcppV - src_pitchUV2; + const unsigned char *srcpnY = srcpY + src_pitchY; + const unsigned char *srcpnU = srcpU + src_pitchUV; + const unsigned char *srcpnV = srcpV + src_pitchUV; + const unsigned char *srcpnnY = srcpnY + src_pitchY2; + const unsigned char *srcpnnU = srcpnU + src_pitchUV2; + const unsigned char *srcpnnV = srcpnV + src_pitchUV2; + const unsigned char *kercY, *kerpY, *kerppY, *kernY, *kernnY; + const unsigned char *kercU, *kerpU, *kerppU, *kernU, *kernnU; + const unsigned char *kercV, *kerpV, *kerppV, *kernV, *kernnV; + int ker_pitchY, ker_pitchUV, x, y, temp; + if (accumP <= accumN) + { + if (PRM(field)^PRM(order)) + { + ker_pitchY = src_pitchY; + ker_pitchUV = src_pitchUV; + kerppY = srcpY - (src_pitchY2<<1); + kerppU = srcpU - (src_pitchUV2<<1); + kerppV = srcpV - (src_pitchUV2<<1); + kerpY = srcpY - src_pitchY2; + kerpU = srcpU - src_pitchUV2; + kerpV = srcpV - src_pitchUV2; + kercY = srcpY; + kercU = srcpU; + kercV = srcpV; + kernY = srcpY + src_pitchY2; + kernU = srcpU + src_pitchUV2; + kernV = srcpV + src_pitchUV2; + kernnY = srcpY + (src_pitchY2<<1); + kernnU = srcpU + (src_pitchUV2<<1); + kernnV = srcpV + (src_pitchUV2<<1); + } + else + { + ker_pitchY = prv_pitchY; + ker_pitchUV = prv_pitchUV; + kerppY = prvpY - (prv_pitchY2<<1); + kerppU = prvpU - (prv_pitchUV2<<1); + kerppV = prvpV - (prv_pitchUV2<<1); + kerpY = prvpY - prv_pitchY2; + kerpU = prvpU - prv_pitchUV2; + kerpV = prvpV - prv_pitchUV2; + kercY = prvpY; + kercU = prvpU; + kercV = prvpV; + kernY = prvpY + prv_pitchY2; + kernU = prvpU + prv_pitchUV2; + kernV = prvpV + prv_pitchUV2; + kernnY = prvpY + (prv_pitchY2<<1); + kernnU = prvpU + (prv_pitchUV2<<1); + kernnV = prvpV + (prv_pitchUV2<<1); + } + } + else + { + if (PRM(field)^PRM(order)) + { + ker_pitchY = nxt_pitchY; + ker_pitchUV = nxt_pitchUV; + kerppY = nxtpY - (nxt_pitchY2<<1); + kerppU = nxtpU - (nxt_pitchUV2<<1); + kerppV = nxtpV - (nxt_pitchUV2<<1); + kerpY = nxtpY - nxt_pitchY2; + kerpU = nxtpU - nxt_pitchUV2; + kerpV = nxtpV - nxt_pitchUV2; + kercY = nxtpY; + kercU = nxtpU; + kercV = nxtpV; + kernY = nxtpY + nxt_pitchY2; + kernU = nxtpU + nxt_pitchUV2; + kernV = nxtpV + nxt_pitchUV2; + kernnY = nxtpY + (nxt_pitchY2<<1); + kernnU = nxtpU + (nxt_pitchUV2<<1); + kernnV = nxtpV + (nxt_pitchUV2<<1); + } + else + { + ker_pitchY = src_pitchY; + ker_pitchUV = src_pitchUV; + kerppY = srcpY - (src_pitchY2<<1); + kerppU = srcpU - (src_pitchUV2<<1); + kerppV = srcpV - (src_pitchUV2<<1); + kerpY = srcpY - src_pitchY2; + kerpU = srcpU - src_pitchUV2; + kerpV = srcpV - src_pitchUV2; + kercY = srcpY; + kercU = srcpU; + kercV = srcpV; + kernY = srcpY + src_pitchY2; + kernU = srcpU + src_pitchUV2; + kernV = srcpV + src_pitchUV2; + kernnY = srcpY + (src_pitchY2<<1); + kernnU = srcpU + (src_pitchUV2<<1); + kernnV = srcpV + (src_pitchUV2<<1); + } + } + for (y=0; y>1; + else if (maskpY[x] == 50) dstpY[x] = (srcpY[x]+prvpY[x]+1)>>1; + else if (maskpY[x] == 60) + { + if (sharp && y>3 && y 255) dstpY[x] = 255; + else if (temp < 0) dstpY[x] = 0; + else dstpY[x] = temp; + } + else if (y>1 && y> 4; + if (temp > 255) dstpY[x] = 255; + else if (temp < 0) dstpY[x] = 0; + else dstpY[x] = temp; + } + else dstpY[x] = (srcpnY[x]+srcppY[x]+1)>>1; + } + } + prvpY += prv_pitchY; + srcpppY += src_pitchY; + srcppY += src_pitchY; + srcpY += src_pitchY; + srcpnY += src_pitchY; + srcpnnY += src_pitchY; + kerppY += ker_pitchY; + kerpY += ker_pitchY; + kercY += ker_pitchY; + kernY += ker_pitchY; + kernnY += ker_pitchY; + nxtpY += nxt_pitchY; + maskpY += mask_pitchY; + dstpY += dst_pitchY; + } + for (y=0; y>1; + else if (maskpU[x] == 50) dstpU[x] = (srcpU[x]+prvpU[x]+1)>>1; + else if (maskpU[x] == 60) + { + if (sharp && y>3 && y 255) dstpU[x] = 255; + else if (temp < 0) dstpU[x] = 0; + else dstpU[x] = temp; + } + else if (y>1 && y> 4; + if (temp > 255) dstpU[x] = 255; + else if (temp < 0) dstpU[x] = 0; + else dstpU[x] = temp; + } + else dstpU[x] = (srcpnU[x]+srcppU[x]+1)>>1; + } + if (maskpV[x] == 10 || maskpV[x] == 110) dstpV[x] = srcpV[x]; + else if (maskpV[x] == 20 || maskpV[x] == 120) dstpV[x] = prvpV[x]; + else if (maskpV[x] == 30 || maskpV[x] == 130) dstpV[x] = nxtpV[x]; + else if (maskpV[x] == 40) dstpV[x] = (srcpV[x]+nxtpV[x]+1)>>1; + else if (maskpV[x] == 50) dstpV[x] = (srcpV[x]+prvpV[x]+1)>>1; + else if (maskpV[x] == 60) + { + if (sharp && y>3 && y 255) dstpV[x] = 255; + else if (temp < 0) dstpV[x] = 0; + else dstpV[x] = temp; + } + else if (y>1 && y> 4; + if (temp > 255) dstpV[x] = 255; + else if (temp < 0) dstpV[x] = 0; + else dstpV[x] = temp; + } + else dstpV[x] = (srcpnV[x]+srcppV[x]+1)>>1; + } + + } + prvpU += prv_pitchUV; + prvpV += prv_pitchUV; + srcpppU += src_pitchUV; + srcpppV += src_pitchUV; + srcppU += src_pitchUV; + srcppV += src_pitchUV; + srcpU += src_pitchUV; + srcpV += src_pitchUV; + srcpnU += src_pitchUV; + srcpnV += src_pitchUV; + srcpnnU += src_pitchUV; + srcpnnV += src_pitchUV; + kerppU += ker_pitchUV; + kerppV += ker_pitchUV; + kerpU += ker_pitchUV; + kerpV += ker_pitchUV; + kercU += ker_pitchUV; + kercV += ker_pitchUV; + kernU += ker_pitchUV; + kernV += ker_pitchUV; + kernnU += ker_pitchUV; + kernnV += ker_pitchUV; + nxtpU += nxt_pitchUV; + nxtpV += nxt_pitchUV; + maskpU += mask_pitchUV; + maskpV += mask_pitchUV; + dstpU += dst_pitchUV; + dstpV += dst_pitchUV; + } +} + +void vidTDeint::smartELADeintYV12(ADMImage *dst, ADMImage *mask, + ADMImage *prv, ADMImage *src, ADMImage *nxt) +{ + const unsigned char *prvpY = prv->GetReadPtr(PLANAR_Y); + const unsigned char *prvpV = prv->GetReadPtr(PLANAR_V); + const unsigned char *prvpU = prv->GetReadPtr(PLANAR_U); + int prv_pitchY = prv->GetPitch(PLANAR_Y); + int prv_pitchUV = prv->GetPitch(PLANAR_V); + const unsigned char *srcpY = src->GetReadPtr(PLANAR_Y); + const unsigned char *srcpV = src->GetReadPtr(PLANAR_V); + const unsigned char *srcpU = src->GetReadPtr(PLANAR_U); + int src_pitchY = src->GetPitch(PLANAR_Y); + int src_pitchY2 = src_pitchY<<1; + int src_pitchUV = src->GetPitch(PLANAR_V); + int src_pitchUV2 = src_pitchUV<<1; + int WidthY = src->GetRowSize(PLANAR_Y); + int WidthUV = src->GetRowSize(PLANAR_V); + int HeightY = src->GetHeight(PLANAR_Y); + int HeightUV = src->GetHeight(PLANAR_V); + const unsigned char *nxtpY = nxt->GetReadPtr(PLANAR_Y); + const unsigned char *nxtpV = nxt->GetReadPtr(PLANAR_V); + const unsigned char *nxtpU = nxt->GetReadPtr(PLANAR_U); + int nxt_pitchY = nxt->GetPitch(PLANAR_Y); + int nxt_pitchUV = nxt->GetPitch(PLANAR_V); + unsigned char *dstpY = dst->GetWritePtr(PLANAR_Y); + unsigned char *dstpV = dst->GetWritePtr(PLANAR_V); + unsigned char *dstpU = dst->GetWritePtr(PLANAR_U); + int dst_pitchY = dst->GetPitch(PLANAR_Y); + int dst_pitchUV = dst->GetPitch(PLANAR_V); + const unsigned char *maskpY = mask->GetReadPtr(PLANAR_Y); + const unsigned char *maskpV = mask->GetReadPtr(PLANAR_V); + const unsigned char *maskpU = mask->GetReadPtr(PLANAR_U); + int mask_pitchY = mask->GetPitch(PLANAR_Y); + int mask_pitchUV = mask->GetPitch(PLANAR_V); + const unsigned char *srcppY = srcpY - src_pitchY; + const unsigned char *srcpppY = srcppY - src_pitchY2; + const unsigned char *srcpnY = srcpY + src_pitchY; + const unsigned char *srcpnnY = srcpnY + src_pitchY2; + const unsigned char *srcppV = srcpV - src_pitchUV; + const unsigned char *srcpppV = srcppV - src_pitchUV2; + const unsigned char *srcpnV = srcpV + src_pitchUV; + const unsigned char *srcpnnV = srcpnV + src_pitchUV2; + const unsigned char *srcppU = srcpU - src_pitchUV; + const unsigned char *srcpppU = srcppU - src_pitchUV2; + const unsigned char *srcpnU = srcpU + src_pitchUV; + const unsigned char *srcpnnU = srcpnU + src_pitchUV2; + int x, y, Iy1, Iy2, Iye, Ix1, Ix2, edgeS1, edgeS2; + int sum, sumsq, temp, temp1, temp2, minN, maxN; + double dir1, dir2, dir, dirF; + for (y=0; y>1; + else if (maskpY[x] == 50) dstpY[x] = (srcpY[x]+prvpY[x]+1)>>1; + else if (maskpY[x] == 60) + { + if (y>2 && y3 && x>1; + continue; + } + if (abs(srcppY[x]-srcpnY[x]) < 10 && (edgeS1 < 1600 || edgeS2 < 1600)) + { + dstpY[x] = (srcppY[x]+srcpnY[x]+1)>>1; + continue; + } + sum = srcppY[x-1] + srcppY[x] + srcppY[x+1] + srcpnY[x-1] + srcpnY[x] + srcpnY[x+1]; + sumsq = srcppY[x-1]*srcppY[x-1] + srcppY[x]*srcppY[x] + srcppY[x+1]*srcppY[x+1] + + srcpnY[x-1]*srcpnY[x-1] + srcpnY[x]*srcpnY[x] + srcpnY[x+1]*srcpnY[x+1]; + if ((6*sumsq - sum*sum) < 432) + { + dstpY[x] = (srcppY[x]+srcpnY[x]+1)>>1; + continue; + } + if (Ix1 == 0) dir1 = 3.1415926; + else + { + dir1 = atan(Iy1/(Ix1*2.0f)) + 1.5707963; + if (Iy1 >= 0) { if (Ix1 < 0) dir1 += 3.1415927; } + else { if (Ix1 >= 0) dir1 += 3.1415927; } + if (dir1 >= 3.1415927) dir1 -= 3.1415927; + } + if (Ix2 == 0) dir2 = 3.1415926; + else + { + dir2 = atan(Iy2/(Ix2*2.0f)) + 1.5707963; + if (Iy2 >= 0) { if (Ix2 < 0) dir2 += 3.1415927; } + else { if (Ix2 >= 0) dir2 += 3.1415927; } + if (dir2 >= 3.1415927) dir2 -= 3.1415927; + } + if (fabs(dir1-dir2) < 0.5) + { + if (edgeS1 >= 3600 && edgeS2 >= 3600) dir = (dir1 + dir2) * 0.5f; + else dir = edgeS1 >= edgeS2 ? dir1 : dir2; + } + else + { + if (edgeS1 >= 5000 && edgeS2 >= 5000) + { + Iye = srcppY[x-1]+srcppY[x]+srcppY[x]+srcppY[x+1]-srcpnY[x-1]-srcpnY[x]-srcpnY[x]-srcpnY[x+1]; + if ((Iy1*Iye > 0) && (Iy2*Iye < 0)) dir = dir1; + else if ((Iy1*Iye < 0) && (Iy2*Iye > 0)) dir = dir2; + else + { + if (abs(Iye-Iy1) <= abs(Iye-Iy2)) dir = dir1; + else dir = dir2; + } + } + else dir = edgeS1 >= edgeS2 ? dir1 : dir2; + } + dirF = 0.5f/tan(dir); + if (dirF >= 0.0f) + { + if (dirF >= 0.5f) + { + if (dirF >= 1.0f) + { + if (dirF >= 1.5f) + { + if (dirF >= 2.0f) + { + if (dirF <= 2.50f) + { + temp1 = srcppY[x+4]; + temp2 = srcpnY[x-4]; + temp = (srcppY[x+4]+srcpnY[x-4]+1)>>1; + } + else + { + temp1 = temp2 = srcpnY[x]; + temp = cubicInt(srcpppY[x],srcppY[x],srcpnY[x],srcpnnY[x]); + } + } + else + { + temp1 = (int)((dirF-1.5f)*(srcppY[x+4]) + (2.0f-dirF)*(srcppY[x+3]) + 0.5f); + temp2 = (int)((dirF-1.5f)*(srcpnY[x-4]) + (2.0f-dirF)*(srcpnY[x-3]) + 0.5f); + temp = (int)((dirF-1.5f)*(srcppY[x+4]+srcpnY[x-4]) + (2.0f-dirF)*(srcppY[x+3]+srcpnY[x-3]) + 0.5f); + } + } + else + { + temp1 = (int)((dirF-1.0f)*(srcppY[x+3]) + (1.5f-dirF)*(srcppY[x+2]) + 0.5f); + temp2 = (int)((dirF-1.0f)*(srcpnY[x-3]) + (1.5f-dirF)*(srcpnY[x-2]) + 0.5f); + temp = (int)((dirF-1.0f)*(srcppY[x+3]+srcpnY[x-3]) + (1.5f-dirF)*(srcppY[x+2]+srcpnY[x-2]) + 0.5f); + } + } + else + { + temp1 = (int)((dirF-0.5f)*(srcppY[x+2]) + (1.0f-dirF)*(srcppY[x+1]) + 0.5f); + temp2 = (int)((dirF-0.5f)*(srcpnY[x-2]) + (1.0f-dirF)*(srcpnY[x-1]) + 0.5f); + temp = (int)((dirF-0.5f)*(srcppY[x+2]+srcpnY[x-2]) + (1.0f-dirF)*(srcppY[x+1]+srcpnY[x-1]) + 0.5f); + } + } + else + { + temp1 = (int)(dirF*(srcppY[x+1]) + (0.5f-dirF)*(srcppY[x]) + 0.5f); + temp2 = (int)(dirF*(srcpnY[x-1]) + (0.5f-dirF)*(srcpnY[x]) + 0.5f); + temp = (int)(dirF*(srcppY[x+1]+srcpnY[x-1]) + (0.5f-dirF)*(srcppY[x]+srcpnY[x]) + 0.5f); + } + } + else + { + if (dirF <= -0.5f) + { + if (dirF <= -1.0f) + { + if (dirF <= -1.5f) + { + if (dirF <= -2.0f) + { + if (dirF >= -2.50f) + { + temp1 = srcppY[x-4]; + temp2 = srcpnY[x+4]; + temp = (srcppY[x-4]+srcpnY[x+4]+1)>>1; + } + else + { + temp1 = temp2 = srcpnY[x]; + temp = cubicInt(srcpppY[x],srcppY[x],srcpnY[x],srcpnnY[x]); + } + } + else + { + temp1 = (int)((-dirF-1.5f)*(srcppY[x-4]) + (2.0f+dirF)*(srcppY[x-3]) + 0.5f); + temp2 = (int)((-dirF-1.5f)*(srcpnY[x+4]) + (2.0f+dirF)*(srcpnY[x+3]) + 0.5f); + temp = (int)((-dirF-1.5f)*(srcppY[x-4]+srcpnY[x+4]) + (2.0f+dirF)*(srcppY[x-3]+srcpnY[x+3]) + 0.5f); + } + } + else + { + temp1 = (int)((-dirF-1.0f)*(srcppY[x-3]) + (1.5f+dirF)*(srcppY[x-2]) + 0.5f); + temp2 = (int)((-dirF-1.0f)*(srcpnY[x+3]) + (1.5f+dirF)*(srcpnY[x+2]) + 0.5f); + temp = (int)((-dirF-1.0f)*(srcppY[x-3]+srcpnY[x+3]) + (1.5f+dirF)*(srcppY[x-2]+srcpnY[x+2]) + 0.5f); + } + } + else + { + temp1 = (int)((-dirF-0.5f)*(srcppY[x-2]) + (1.0f+dirF)*(srcppY[x-1]) + 0.5f); + temp2 = (int)((-dirF-0.5f)*(srcpnY[x+2]) + (1.0f+dirF)*(srcpnY[x+1]) + 0.5f); + temp = (int)((-dirF-0.5f)*(srcppY[x-2]+srcpnY[x+2]) + (1.0f+dirF)*(srcppY[x-1]+srcpnY[x+1]) + 0.5f); + } + } + else + { + temp1 = (int)((-dirF)*(srcppY[x-1]) + (0.5f+dirF)*(srcppY[x]) + 0.5f); + temp2 = (int)((-dirF)*(srcpnY[x+1]) + (0.5f+dirF)*(srcpnY[x]) + 0.5f); + temp = (int)((-dirF)*(srcppY[x-1]+srcpnY[x+1]) + (0.5f+dirF)*(srcppY[x]+srcpnY[x]) + 0.5f); + } + } + maxN = max(srcppY[x],srcpnY[x]) + 25; + minN = min(srcppY[x],srcpnY[x]) - 25; + if (abs(temp1-temp2) > 20 || abs(srcppY[x]+srcpnY[x]-temp-temp) > 60 || temp < minN || temp > maxN) + { + temp = cubicInt(srcpppY[x],srcppY[x],srcpnY[x],srcpnnY[x]); + } + if (temp > 255) temp = 255; + else if (temp < 0) temp = 0; + dstpY[x] = temp; + } + else + { + if (y<3 || y>HeightY-4) dstpY[x] = (srcpnY[x]+srcppY[x]+1)>>1; + else dstpY[x] = cubicInt(srcpppY[x],srcppY[x],srcpnY[x],srcpnnY[x]); + } + } + } + prvpY += prv_pitchY; + srcpppY += src_pitchY; + srcppY += src_pitchY; + srcpY += src_pitchY; + srcpnY += src_pitchY; + srcpnnY += src_pitchY; + nxtpY += nxt_pitchY; + maskpY += mask_pitchY; + dstpY += dst_pitchY; + } + for (y=0; y>1; + else if (maskpV[x] == 50) dstpV[x] = (srcpV[x]+prvpV[x]+1)>>1; + else if (maskpV[x] == 60) + { + if (y<3 || y>HeightUV-4) dstpV[x] = (srcpnV[x]+srcppV[x]+1)>>1; + else dstpV[x] = cubicInt(srcpppV[x],srcppV[x],srcpnV[x],srcpnnV[x]); + } + if (maskpU[x] == 10 || maskpU[x] == 110) dstpU[x] = srcpU[x]; + else if (maskpU[x] == 20 || maskpU[x] == 120) dstpU[x] = prvpU[x]; + else if (maskpU[x] == 30 || maskpU[x] == 130) dstpU[x] = nxtpU[x]; + else if (maskpU[x] == 40) dstpU[x] = (srcpU[x]+nxtpU[x]+1)>>1; + else if (maskpU[x] == 50) dstpU[x] = (srcpU[x]+prvpU[x]+1)>>1; + else if (maskpU[x] == 60) + { + if (y<3 || y>HeightUV-4) dstpU[x] = (srcpnU[x]+srcppU[x]+1)>>1; + else dstpU[x] = cubicInt(srcpppU[x],srcppU[x],srcpnU[x],srcpnnU[x]); + } + } + prvpV += prv_pitchUV; + prvpU += prv_pitchUV; + srcpppV += src_pitchUV; + srcppV += src_pitchUV; + srcpV += src_pitchUV; + srcpnV += src_pitchUV; + srcpnnV += src_pitchUV; + srcpppU += src_pitchUV; + srcppU += src_pitchUV; + srcpU += src_pitchUV; + srcpnU += src_pitchUV; + srcpnnU += src_pitchUV; + nxtpV += nxt_pitchUV; + nxtpU += nxt_pitchUV; + maskpV += mask_pitchUV; + maskpU += mask_pitchUV; + dstpV += dst_pitchUV; + dstpU += dst_pitchUV; + } +} + +void vidTDeint::createWeaveFrameYV12(ADMImage *dst, ADMImage *prv, + ADMImage *src, ADMImage *nxt) +{ + int b; + ADM_PLANE plane; + for (b=0; b<3; ++b) + { + if (b == 0) plane = PLANAR_Y; + else if (b == 1) plane = PLANAR_V; + else plane = PLANAR_U; + if (PRM(field)^PRM(order)) + { + if (accumP <= accumN) + { + BitBlit(dst->GetWritePtr(plane), dst->GetPitch(plane), src->GetReadPtr(plane), + src->GetPitch(plane), src->GetRowSize(plane), src->GetHeight(plane)); + } + else + { + BitBlit(dst->GetWritePtr(plane)+(1-PRM(field))*dst->GetPitch(plane), dst->GetPitch(plane)<<1, + src->GetReadPtr(plane)+(1-PRM(field))*src->GetPitch(plane), src->GetPitch(plane)<<1, + src->GetRowSize(plane), src->GetHeight(plane)>>1); + BitBlit(dst->GetWritePtr(plane)+PRM(field)*dst->GetPitch(plane), dst->GetPitch(plane)<<1, + nxt->GetReadPtr(plane)+PRM(field)*nxt->GetPitch(plane), nxt->GetPitch(plane)<<1, nxt->GetRowSize(plane), + nxt->GetHeight(plane)>>1); + } + } + else + { + if (accumN <= accumP) + { + BitBlit(dst->GetWritePtr(plane), dst->GetPitch(plane), src->GetReadPtr(plane), + src->GetPitch(plane), src->GetRowSize(plane), src->GetHeight(plane)); + } + else + { + BitBlit(dst->GetWritePtr(plane)+(1-PRM(field))*dst->GetPitch(plane), dst->GetPitch(plane)<<1, + src->GetReadPtr(plane)+(1-PRM(field))*src->GetPitch(plane), src->GetPitch(plane)<<1, + src->GetRowSize(plane), src->GetHeight(plane)>>1); + BitBlit(dst->GetWritePtr(plane)+PRM(field)*dst->GetPitch(plane), dst->GetPitch(plane)<<1, + prv->GetReadPtr(plane)+PRM(field)*prv->GetPitch(plane), prv->GetPitch(plane)<<1, prv->GetRowSize(plane), + prv->GetHeight(plane)>>1); + } + } + } +} + +//********************************************************* +//********************************************************* +//********************************************************* +//********************************************************* +int vidTDeint::getHint(ADMImage *src, unsigned int &storeHint, int &hintfield) +{ + hintfield = -1; + const unsigned char *p = YPLANE(src); //src->GetReadPtr(PLANAR_Y); + unsigned int i, magic_number = 0, hint = 0; + storeHint = 0xFFFFFFFF; + for (i=0; i<32; ++i) + { + magic_number |= ((*p++ & 1) << i); + } + if (magic_number != 0xdeadbeef && magic_number != 0xdeadfeed) return -1; + for (i=0; i<32; ++i) + { + hint |= ((*p++ & 1) << i); + } + if (magic_number == 0xdeadbeef && hint&0xFFFFFF00) return -1; + if (magic_number == 0xdeadfeed && hint&0xFFFFFF00) return -1; + storeHint = hint; + if (magic_number == 0xdeadbeef) + { + storeHint |= 0x00100000; + if (hint&0x00000001) return 0; + return 1; + } + if (hint&0x00000008) hintfield = 1; + else hintfield = 0; + if (hint&0x00000010) return 1; + return 0; +} + +void vidTDeint::putHint(ADMImage *src, unsigned int hint, int fieldt) +{ + int type = hint&0x00100000 ? 0 : 1; + hint &= ~0x00100000; + if (hint&0xFFFFFF00) return; + if (type == 1) + { + hint &= 0x00000020; + if (fieldt == 1) hint |= 0x0000000E; + else hint |= 0x00000005; + } + unsigned char *p = YPLANE(src); //src->GetWritePtr(PLANAR_Y); + unsigned int i; + for (i=0; i<32; ++i) + { + *p &= ~1; + if (type == 0) *p++ |= ((0xdeadbeef & (1 << i)) >> i); + else *p++ |= ((0xdeadfeed & (1 << i)) >> i); + } + for (i=0; i<32; ++i) + { + *p &= ~1; + *p++ |= ((hint & (1 << i)) >> i); + } +} +/****************************************/ +void vidTDeint::copyFrame(ADMImage *dst,ADMImage *src) +{ + int b, stop = 3 ; + ADM_PLANE plane[3] = { PLANAR_Y, PLANAR_U, PLANAR_V }; + for (b=0; bGetWritePtr(plane[b]),dst->GetPitch(plane[b]),src->GetReadPtr(plane[b]), + src->GetPitch(plane[b]),src->GetRowSize(plane[b]),src->GetHeight(plane[b])); + } +} +/****************************************/ + void vidTDeint::copyForUpsize(ADMImage *dst, ADMImage *src, int np) +{ + int b; + ADM_PLANE plane[3] = { PLANAR_Y, PLANAR_U, PLANAR_V }; + for (b=0; bGetWritePtr(plane[b]),dst->GetPitch(plane[b])*2,src->GetReadPtr(plane[b]), + src->GetPitch(plane[b]),src->GetRowSize(plane[b]),src->GetHeight(plane[b])); + BitBlit(dst->GetWritePtr(plane[b])+(dst->GetPitch(plane[b])*(dst->GetHeight(plane[b])-1)), + dst->GetPitch(plane[b]),src->GetReadPtr(plane[b])+(src->GetPitch(plane[b])*(src->GetHeight(plane[b])-1)), + src->GetPitch(plane[b]),src->GetRowSize(plane[b]),1); + } +} +/****************************************/ +void vidTDeint::setMaskForUpsize(ADMImage *msk, int np) +{ + unsigned char *maskwc, *maskwn; + int msk_pitch, height, width, y; + int b; + ADM_PLANE plane[3] = { PLANAR_Y, PLANAR_U, PLANAR_V }; + for (b=0; bGetWritePtr(plane[b]); + msk_pitch = msk->GetPitch(plane[b]); + height = msk->GetHeight(plane[b])>>1; + width = msk->GetRowSize(plane[b]); + maskwn = maskwc + msk_pitch; + msk_pitch <<= 1; + if (PRM(field) == 1) + { + for (y=0; y 0) + { + maskt = scratch; //_env->NewVideoFrame(vi); + copyFrame(maskt, mask); + } + unsigned char *maskw; + const unsigned char *dstp, *dstpp, *dstpn, *dstppp, *dstpnn, *maskp, *maskpT; + int dst_pitch, dst_pitch2, mask_pitch, mask_pitch2, Width, Height; + int x, y, b, stop =3 , count = 0, maskp_pitch, maskp_pitch2; + int sFirst, sSecond, AP6 = AP*6, moving, neighbors, u, v; + int starty, stopy, startx, stopx, inc; + ADM_PLANE plane; + + for (b=0; bGetReadPtr(plane); + dst_pitch = dst->GetPitch(plane); + dst_pitch2 = dst_pitch<<1; + Width = dst->GetRowSize(plane); + Height = dst->GetHeight(plane); + dstp += (2-PRM(field))*dst_pitch; + dstppp = dstp - dst_pitch2; + dstpp = dstp - dst_pitch; + dstpn = dstp + dst_pitch; + dstpnn = dstp + dst_pitch2; + maskw = mask->GetWritePtr(plane); + mask_pitch = mask->GetPitch(plane); + mask_pitch2 = mask_pitch<<1; + if (APType > 0) + { + maskp = maskt->GetReadPtr(plane); + maskp_pitch = maskt->GetPitch(plane); + maskp_pitch2 = maskp_pitch<<1; + } + maskw += (2-PRM(field))*mask_pitch; + y = 2-PRM(field); + for (x=0; x AP && sSecond > AP) || (sFirst < -AP && sSecond < -AP)) + { + sFirst = abs(dstpnn[x]+(dstp[x]<<2)+dstpnn[x]-(3*(dstpp[x]+dstpn[x]))); + if (sFirst > AP6) + { + if (APType > 0) + { + inc = stop > 1 ? 1 : x&1 ? 4 : 2; + startx = x-(inc<<1) < 0 ? x-inc < 0 ? x : x-inc : x-(inc<<1); + stopx = x+(inc<<1) > Width-1 ? x+inc > Width-1 ? x : x+inc : x+(inc<<1); + starty = y-4 < 0 ? y-2 < 0 ? y : y-2 : y-4; + stopy = y+4 > Height-1 ? y+2 > Height-1 ? y : y+2 : y+4; + neighbors = moving = 0; + maskpT = maskp + starty*maskp_pitch; + for (u=starty; u<=stopy; u+=2) + { + for (v=startx; v<=stopx; v+=inc) + { + if (maskpT[v] >= 60) ++moving; + ++neighbors; + } + maskpT += maskp_pitch2; + } + if ((APType == 1 && (moving<<1) >= neighbors) || + (APType == 2 && (moving*3) >= neighbors)) + { + maskw[x] = 60; + ++count; + } + } + else + { + maskw[x] = 60; + ++count; + } + } + } + } + dstppp += dst_pitch2; + dstpp += dst_pitch2; + dstp += dst_pitch2; + dstpn += dst_pitch2; + dstpnn += dst_pitch2; + maskw += mask_pitch2; + y += 2; + for (; y Height-1 ? y+2 > Height-1 ? y : y+2 : y+4; + for (x=0; x AP && sSecond > AP) || (sFirst < -AP && sSecond < -AP)) + { + sFirst = abs(dstppp[x]+(dstp[x]<<2)+dstpnn[x]-(3*(dstpp[x]+dstpn[x]))); + if (sFirst > AP6) + { + if (APType > 0) + { + inc = stop > 1 ? 1 : x&1 ? 4 : 2; + startx = x-(inc<<1) < 0 ? x-inc < 0 ? x : x-inc : x-(inc<<1); + stopx = x+(inc<<1) > Width-1 ? x+inc > Width-1 ? x : x+inc : x+(inc<<1); + neighbors = moving = 0; + maskpT = maskp + starty*maskp_pitch; + for (u=starty; u<=stopy; u+=2) + { + for (v=startx; v<=stopx; v+=inc) + { + if (maskpT[v] >= 60) ++moving; + ++neighbors; + } + maskpT += maskp_pitch2; + } + if ((APType == 1 && (moving<<1) >= neighbors) || + (APType == 2 && (moving*3) >= neighbors)) + { + maskw[x] = 60; + ++count; + } + } + else + { + maskw[x] = 60; + ++count; + } + } + } + } + dstppp += dst_pitch2; + dstpp += dst_pitch2; + dstp += dst_pitch2; + dstpn += dst_pitch2; + dstpnn += dst_pitch2; + maskw += mask_pitch2; + } + for (x=0; x AP && sSecond > AP) || (sFirst < -AP && sSecond < -AP)) + { + sFirst = abs(dstppp[x]+(dstp[x]<<2)+dstppp[x]-(3*(dstpp[x]+dstpn[x]))); + if (sFirst > AP6) + { + if (APType > 0) + { + inc = stop > 1 ? 1 : x&1 ? 4 : 2; + startx = x-(inc<<1) < 0 ? x-inc < 0 ? x : x-inc : x-(inc<<1); + stopx = x+(inc<<1) > Width-1 ? x+inc > Width-1 ? x : x+inc : x+(inc<<1); + starty = y-4 < 0 ? y-2 < 0 ? y : y-2 : y-4; + stopy = y+4 > Height-1 ? y+2 > Height-1 ? y : y+2 : y+4; + neighbors = moving = 0; + maskpT = maskp + starty*maskp_pitch; + for (u=starty; u<=stopy; u+=2) + { + for (v=startx; v<=stopx; v+=inc) + { + if (maskpT[v] >= 60) ++moving; + ++neighbors; + } + maskpT += maskp_pitch2; + } + if ((APType == 1 && (moving<<1) >= neighbors) || + (APType == 2 && (moving*3) >= neighbors)) + { + maskw[x] = 60; + ++count; + } + } + else + { + maskw[x] = 60; + ++count; + } + } + } + } + } + if (count > 0) + { + //if (vi.IsYV12()) + { + if (type == 0) cubicDeintYV12(dst, mask, dst, dst, dst); + else if (type == 1) smartELADeintYV12(dst, mask, dst, dst, dst); + else if (type == 2) kernelDeintYV12(dst, mask, dst, dst, dst); + else if (type == 3) ELADeintYV12(dst, mask, dst, dst, dst); + } + + } +} + diff --git a/avidemux_plugins/ADM_videoFilters6/CMakeLists.txt b/avidemux_plugins/ADM_videoFilters6/CMakeLists.txt index ea5939190e..696961d22b 100644 --- a/avidemux_plugins/ADM_videoFilters6/CMakeLists.txt +++ b/avidemux_plugins/ADM_videoFilters6/CMakeLists.txt @@ -1,91 +1,91 @@ -IF(NOT MSVC) - ADD_SUBDIRECTORY(fluxSmooth) - ADD_SUBDIRECTORY(telecide) -ENDIF(NOT MSVC) - - -ADD_SUBDIRECTORY(asciiView) -ADD_SUBDIRECTORY(addBorder) -ADD_SUBDIRECTORY(admIvtc) -ADD_SUBDIRECTORY(analyzer) -ADD_SUBDIRECTORY(asharp) -ADD_SUBDIRECTORY(ass) -ADD_SUBDIRECTORY(avsfilter) -ADD_SUBDIRECTORY(black) -ADD_SUBDIRECTORY(blackenBorder) -ADD_SUBDIRECTORY(blend) -ADD_SUBDIRECTORY(blur) -ADD_SUBDIRECTORY(changeFps) -ADD_SUBDIRECTORY(colorBalance) -ADD_SUBDIRECTORY(colorTemp) -ADD_SUBDIRECTORY(colorYUV) -ADD_SUBDIRECTORY(contrast) -ADD_SUBDIRECTORY(chromaShift) -ADD_SUBDIRECTORY(crop) -#ADD_SUBDIRECTORY(decimate) -ADD_SUBDIRECTORY(delogoHQ) -ADD_SUBDIRECTORY(dgBob) -ADD_SUBDIRECTORY(dummy) -ADD_SUBDIRECTORY(eq2) -ADD_SUBDIRECTORY(fadeToBlack) -ADD_SUBDIRECTORY(fadeTo) -ADD_SUBDIRECTORY(fastConvolution) -ADD_SUBDIRECTORY(fields) -ADD_SUBDIRECTORY(fitToSize) -#ADD_SUBDIRECTORY(horizontalFlip) -ADD_SUBDIRECTORY(hue) -ADD_SUBDIRECTORY(ivtcDupeRemover) -ADD_SUBDIRECTORY(kernelDeint) -ADD_SUBDIRECTORY(largeMedian) -ADD_SUBDIRECTORY(lavDeint) -ADD_SUBDIRECTORY(logo) -ADD_SUBDIRECTORY(lumaOnly) -ADD_SUBDIRECTORY(lumaStab) -#ADD_SUBDIRECTORY(mcDeint) Does not work ??? -ADD_SUBDIRECTORY(mplayerDenoise3D) -ADD_SUBDIRECTORY(mplayerDelogo) -ADD_SUBDIRECTORY(mSharpen) -ADD_SUBDIRECTORY(negative) -ADD_SUBDIRECTORY(printInfo) -ADD_SUBDIRECTORY(removePlane) -ADD_SUBDIRECTORY(resampleFps) -ADD_SUBDIRECTORY(resize) -ADD_SUBDIRECTORY(rotate) -ADD_SUBDIRECTORY(rotateSimple) -ADD_SUBDIRECTORY(stackField) -ADD_SUBDIRECTORY(stillimage) -ADD_SUBDIRECTORY(swapUV) -ADD_SUBDIRECTORY(yadif) -IF(USE_LIBVA AND DO_COMMON) - ADD_SUBDIRECTORY(vaapiFilters) -ENDIF(USE_LIBVA AND DO_COMMON) -ADD_SUBDIRECTORY(vdpauFilters) -#ADD_SUBDIRECTORY(verticalFlip) -ADD_SUBDIRECTORY(waveletDenoise) -ADD_SUBDIRECTORY(waveletSharp) -ADD_SUBDIRECTORY(artCartoon) -ADD_SUBDIRECTORY(artCharcoal) -ADD_SUBDIRECTORY(artChromaHold) -ADD_SUBDIRECTORY(artChromaKey) -ADD_SUBDIRECTORY(artColorEffect) -ADD_SUBDIRECTORY(artDynThreshold) -ADD_SUBDIRECTORY(artGrid) -ADD_SUBDIRECTORY(artMirror) -ADD_SUBDIRECTORY(artPixelize) -ADD_SUBDIRECTORY(artPosterize) -ADD_SUBDIRECTORY(artVHS) -ADD_SUBDIRECTORY(artVignette) -ADD_SUBDIRECTORY(flip) -ADD_SUBDIRECTORY(quadTrans) -ADD_SUBDIRECTORY(imageStab) -ADD_SUBDIRECTORY(zoom) -ADD_SUBDIRECTORY(fadeFromImage) -#ADD_SUBDIRECTORY(fadeInOut) -ADD_SUBDIRECTORY(fadeThrough) -ADD_SUBDIRECTORY(deband) -ADD_SUBDIRECTORY(cubicLUT) -ADD_SUBDIRECTORY(decimateFrame) -ADD_SUBDIRECTORY(aiEnhance) -ADD_SUBDIRECTORY(fieldsAlign) -ADD_SUBDIRECTORY(grain) -ADD_SUBDIRECTORY(flat360) +IF(NOT MSVC) + ADD_SUBDIRECTORY(fluxSmooth) + ADD_SUBDIRECTORY(telecide) +ENDIF(NOT MSVC) + + +ADD_SUBDIRECTORY(asciiView) +ADD_SUBDIRECTORY(addBorder) +ADD_SUBDIRECTORY(admIvtc) +ADD_SUBDIRECTORY(analyzer) +ADD_SUBDIRECTORY(asharp) +ADD_SUBDIRECTORY(ass) +ADD_SUBDIRECTORY(avsfilter) +ADD_SUBDIRECTORY(black) +ADD_SUBDIRECTORY(blackenBorder) +ADD_SUBDIRECTORY(blend) +ADD_SUBDIRECTORY(blur) +ADD_SUBDIRECTORY(changeFps) +ADD_SUBDIRECTORY(colorBalance) +ADD_SUBDIRECTORY(colorTemp) +ADD_SUBDIRECTORY(colorYUV) +ADD_SUBDIRECTORY(contrast) +ADD_SUBDIRECTORY(chromaShift) +ADD_SUBDIRECTORY(crop) +#ADD_SUBDIRECTORY(decimate) +ADD_SUBDIRECTORY(delogoHQ) +ADD_SUBDIRECTORY(dgBob) +ADD_SUBDIRECTORY(dummy) +ADD_SUBDIRECTORY(eq2) +ADD_SUBDIRECTORY(fadeToBlack) +ADD_SUBDIRECTORY(fadeTo) +ADD_SUBDIRECTORY(fastConvolution) +ADD_SUBDIRECTORY(fields) +ADD_SUBDIRECTORY(fitToSize) +#ADD_SUBDIRECTORY(horizontalFlip) +ADD_SUBDIRECTORY(hue) +ADD_SUBDIRECTORY(ivtcDupeRemover) +ADD_SUBDIRECTORY(kernelDeint) +ADD_SUBDIRECTORY(largeMedian) +ADD_SUBDIRECTORY(lavDeint) +ADD_SUBDIRECTORY(logo) +ADD_SUBDIRECTORY(lumaOnly) +ADD_SUBDIRECTORY(lumaStab) +#ADD_SUBDIRECTORY(mcDeint) Does not work ??? +ADD_SUBDIRECTORY(mplayerDenoise3D) +ADD_SUBDIRECTORY(mplayerDelogo) +ADD_SUBDIRECTORY(mSharpen) +ADD_SUBDIRECTORY(negative) +ADD_SUBDIRECTORY(printInfo) +ADD_SUBDIRECTORY(removePlane) +ADD_SUBDIRECTORY(resampleFps) +ADD_SUBDIRECTORY(resize) +ADD_SUBDIRECTORY(rotate) +ADD_SUBDIRECTORY(rotateSimple) +ADD_SUBDIRECTORY(stackField) +ADD_SUBDIRECTORY(stillimage) +ADD_SUBDIRECTORY(swapUV) +ADD_SUBDIRECTORY(yadif) +IF(USE_LIBVA AND DO_COMMON) + ADD_SUBDIRECTORY(vaapiFilters) +ENDIF(USE_LIBVA AND DO_COMMON) +ADD_SUBDIRECTORY(vdpauFilters) +#ADD_SUBDIRECTORY(verticalFlip) +ADD_SUBDIRECTORY(waveletDenoise) +ADD_SUBDIRECTORY(waveletSharp) +ADD_SUBDIRECTORY(artCartoon) +ADD_SUBDIRECTORY(artCharcoal) +ADD_SUBDIRECTORY(artChromaHold) +ADD_SUBDIRECTORY(artChromaKey) +ADD_SUBDIRECTORY(artColorEffect) +ADD_SUBDIRECTORY(artDynThreshold) +ADD_SUBDIRECTORY(artGrid) +ADD_SUBDIRECTORY(artMirror) +ADD_SUBDIRECTORY(artPixelize) +ADD_SUBDIRECTORY(artPosterize) +ADD_SUBDIRECTORY(artVHS) +ADD_SUBDIRECTORY(artVignette) +ADD_SUBDIRECTORY(flip) +ADD_SUBDIRECTORY(quadTrans) +ADD_SUBDIRECTORY(imageStab) +ADD_SUBDIRECTORY(zoom) +ADD_SUBDIRECTORY(fadeFromImage) +#ADD_SUBDIRECTORY(fadeInOut) +ADD_SUBDIRECTORY(fadeThrough) +ADD_SUBDIRECTORY(deband) +ADD_SUBDIRECTORY(cubicLUT) +ADD_SUBDIRECTORY(decimateFrame) +ADD_SUBDIRECTORY(aiEnhance) +ADD_SUBDIRECTORY(fieldsAlign) +ADD_SUBDIRECTORY(grain) +ADD_SUBDIRECTORY(flat360) diff --git a/avidemux_plugins/ADM_videoFilters6/ass/ADM_libass/CMakeLists.txt b/avidemux_plugins/ADM_videoFilters6/ass/ADM_libass/CMakeLists.txt index b81fe53bcf..c67d044cee 100644 --- a/avidemux_plugins/ADM_videoFilters6/ass/ADM_libass/CMakeLists.txt +++ b/avidemux_plugins/ADM_videoFilters6/ass/ADM_libass/CMakeLists.txt @@ -1,57 +1,57 @@ -INCLUDE(admCheckFontConfig) -checkFontConfig() - -#CONFIG_FONTCONFIG -#CONFIG_ENCA -#CONFIG_ICONV -# -# CONFIG_ASM -# CONFIG_RASTERIZER -# CONFIG_HARFBUZZ => -# CONFIG_FRIBIDI -# -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -SET(ADM_LIB ADM_libass) -file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/x86) -SET(Asm_srcs x86/blend_bitmaps - x86/blur - x86/cpuid - x86/rasterizer - x86/utils - x86/x86inc -) -IF(ADM_CPU_X86_64) - SET(Asm_srcs ${Asm_srcs} x86/be_blur ) -ENDIF(ADM_CPU_X86_64) -IF(ADM_CPU_X86) - ADD_DEFINITIONS(-DCONFIG_ASM) -ENDIF(ADM_CPU_X86) -# -YASMIFY(asmFiles ${Asm_srcs}) -# -SET(${ADM_LIB}_SRCS -ass_bitmap.c ass.c ass_cache.c ass_fontconfig.c ass_library.c ass_render.c ass_utils.c -ass_font.c ass_parse.c ass_drawing.c ass_render_api.c ass_strtod.c ass_shaper.c -ass_rasterizer_c.c ass_blur.c ass_font.c ass_rasterizer.c -) - -ADD_DEFINITIONS(" -std=gnu99 ") -# -ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS} ${asmFiles}) -ADD_DEFINITIONS(${FREETYPE2_CFLAGS} ${FRIBIDI_CFLAGS}) -INCLUDE_DIRECTORIES(${LIBICONV_INCLUDE_DIR}) - -IF (FONTCONFIG_FOUND) - ADD_DEFINITIONS(${FONTCONFIG_CFLAGS} "-DCONFIG_FONTCONFIG=1") -ENDIF (FONTCONFIG_FOUND) - -# ? -ADD_DEFINITIONS(${FONTCONFIG_CFLAGS} -DCONFIG_ICONV=1 -DCONFIG_FREETYPE=1 -DCONFIG_RASTERIZER=1 -DCONFIG_FRIBIDI=1) -TARGET_LINK_LIBRARIES(${ADM_LIB} ${LIBICONV_LIBRARY_DIR}) - -IF(MSVC) - TARGET_LINK_LIBRARIES(${ADM_LIB} libiconv) -ENDIF(MSVC) -IF (UNIX) - ADD_TARGET_CFLAGS(${ADM_LIB} -fPIC) -ENDIF (UNIX) +INCLUDE(admCheckFontConfig) +checkFontConfig() + +#CONFIG_FONTCONFIG +#CONFIG_ENCA +#CONFIG_ICONV +# +# CONFIG_ASM +# CONFIG_RASTERIZER +# CONFIG_HARFBUZZ => +# CONFIG_FRIBIDI +# +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +SET(ADM_LIB ADM_libass) +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/x86) +SET(Asm_srcs x86/blend_bitmaps + x86/blur + x86/cpuid + x86/rasterizer + x86/utils + x86/x86inc +) +IF(ADM_CPU_X86_64) + SET(Asm_srcs ${Asm_srcs} x86/be_blur ) +ENDIF(ADM_CPU_X86_64) +IF(ADM_CPU_X86) + ADD_DEFINITIONS(-DCONFIG_ASM) +ENDIF(ADM_CPU_X86) +# +YASMIFY(asmFiles ${Asm_srcs}) +# +SET(${ADM_LIB}_SRCS +ass_bitmap.c ass.c ass_cache.c ass_fontconfig.c ass_library.c ass_render.c ass_utils.c +ass_font.c ass_parse.c ass_drawing.c ass_render_api.c ass_strtod.c ass_shaper.c +ass_rasterizer_c.c ass_blur.c ass_font.c ass_rasterizer.c +) + +ADD_DEFINITIONS(" -std=gnu99 ") +# +ADD_LIBRARY(${ADM_LIB} STATIC ${${ADM_LIB}_SRCS} ${asmFiles}) +ADD_DEFINITIONS(${FREETYPE2_CFLAGS} ${FRIBIDI_CFLAGS}) +INCLUDE_DIRECTORIES(${LIBICONV_INCLUDE_DIR}) + +IF (FONTCONFIG_FOUND) + ADD_DEFINITIONS(${FONTCONFIG_CFLAGS} "-DCONFIG_FONTCONFIG=1") +ENDIF (FONTCONFIG_FOUND) + +# ? +ADD_DEFINITIONS(${FONTCONFIG_CFLAGS} -DCONFIG_ICONV=1 -DCONFIG_FREETYPE=1 -DCONFIG_RASTERIZER=1 -DCONFIG_FRIBIDI=1) +TARGET_LINK_LIBRARIES(${ADM_LIB} ${LIBICONV_LIBRARY_DIR}) + +IF(MSVC) + TARGET_LINK_LIBRARIES(${ADM_LIB} libiconv) +ENDIF(MSVC) +IF (UNIX) + ADD_TARGET_CFLAGS(${ADM_LIB} -fPIC) +ENDIF (UNIX) diff --git a/avidemux_plugins/ADM_videoFilters6/blend/ADM_vidBlendFrames.cpp b/avidemux_plugins/ADM_videoFilters6/blend/ADM_vidBlendFrames.cpp index 644d23abb1..ea76b34b32 100644 --- a/avidemux_plugins/ADM_videoFilters6/blend/ADM_vidBlendFrames.cpp +++ b/avidemux_plugins/ADM_videoFilters6/blend/ADM_vidBlendFrames.cpp @@ -1,225 +1,225 @@ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include -#include -#include "ADM_default.h" -#include "ADM_coreVideoFilter.h" -#include "DIA_coreToolkit.h" -#include "DIA_factory.h" -#include "ADM_vidMisc.h" -#include "blend.h" -#include "blend_desc.cpp" -/** - \class AVDM_BlendFrames - * \brief fade video plugin - */ -class AVDM_BlendFrames : public ADM_coreVideoFilter -{ -protected: - blend param; - uint32_t **buffer; - uint32_t accumulated; - //void AccumulateFrame(ADMImage *buffer,ADMImage *frame); - //void WriteFrameAndClearBuffer(ADMImage *buffer,ADMImage *frame,uint32_t N); -public: - AVDM_BlendFrames(ADM_coreVideoFilter *previous,CONFcouple *conf); - ~AVDM_BlendFrames(); - - virtual const char *getConfiguration(void); /// Return current configuration as a human readable string - virtual bool getNextFrame(uint32_t *fn,ADMImage *image); /// Return the next image - // virtual FilterInfo *getInfo(void); /// Return picture parameters after this filter - virtual bool getCoupledConf(CONFcouple **couples); /// Return the current filter configuration - virtual void setCoupledConf(CONFcouple *couples); - virtual bool configure(void); /// Start graphical user interface - -}; - -// Add the hook to make it valid plugin -DECLARE_VIDEO_FILTER(AVDM_BlendFrames, - 1,0,0, // Version - ADM_UI_ALL, // UI - VF_TRANSFORM, // Category - "blend", // internal name (must be uniq!) - QT_TRANSLATE_NOOP("blend","Blend Frames"),// Display name - QT_TRANSLATE_NOOP("blend","Blend groups of N frames into a single frame. Useful for speeding up slow motion footage or creating timelapses.") // Description -); -/** - * \fn configure - * \brief UI configuration - * @param - * @return - */ -bool AVDM_BlendFrames::configure() -{ -#define MAX_BLEND_FRAMES 16777216//2^32/2^8 This is the in-all-cases limit, but on average it should be able to support probably 25% more. However, no frames will be exported unless the number of frames in the video is equal or greater. - diaElemUInteger N(&(param.N),QT_TRANSLATE_NOOP("blend","Frames"),1,MAX_BLEND_FRAMES); - diaElem *elems[1]={&N}; - if(diaFactoryRun(QT_TRANSLATE_NOOP("blend","Blend"),1,elems)){ - info.totalDuration=previousFilter->getInfo()->totalDuration/((uint64_t)param.N);//This bad boy reports the proper duration to the loading bar - info.markerA=previousFilter->getInfo()->markerA/((uint64_t)param.N); - info.markerB=previousFilter->getInfo()->markerB/((uint64_t)param.N); - return 1; - }else - return 0; -} -/** - * \fn getConfiguration - * - */ -const char *AVDM_BlendFrames::getConfiguration(void) -{ - static char conf[12]; - snprintf(conf,12," N:%d ",param.N); - return conf; -} - -/** - * \fn ctor - * @param in - * @param couples - */ -AVDM_BlendFrames::AVDM_BlendFrames(ADM_coreVideoFilter *in,CONFcouple *setup) : ADM_coreVideoFilter(in,setup) -{ - if(!setup || !ADM_paramLoad(setup,blend_param,¶m)) - { - // Default value - param.N=1; - } - accumulated=0; - buffer=NULL; - info.totalDuration=previousFilter->getInfo()->totalDuration/((uint64_t)param.N); - info.markerA=previousFilter->getInfo()->markerA/((uint64_t)param.N); - info.markerB=previousFilter->getInfo()->markerB/((uint64_t)param.N); -} -/** - * \fn setCoupledConf - * \brief save current setup from couples - * @param couples - */ -void AVDM_BlendFrames::setCoupledConf(CONFcouple *couples) -{ - ADM_paramLoad(couples, blend_param, ¶m); -} - -/** - * \fn getCoupledConf - * @param couples - * @return setup as couples - */ -bool AVDM_BlendFrames::getCoupledConf(CONFcouple **couples) -{ - return ADM_paramSave(couples, blend_param,¶m); -} - -/** - * \fn dtor - */ -AVDM_BlendFrames::~AVDM_BlendFrames(void) -{ - if(buffer) - { - for(int i=0;i<1;i++) - delete [] buffer[i]; - delete [] buffer; - buffer=NULL; - } -} -/** - * - * @param source - * @param source2 - * @param dest - * @param offset - * @return - */ - -/** - * \fn getNextFrame - * @param fn - * @param image - * @return - */ -bool AVDM_BlendFrames::getNextFrame(uint32_t *fn,ADMImage *image) -{ - while(true){ - if(previousFilter->getNextFrame(fn,image)==false) - return false; - - if(buffer==NULL){ - //Create new 32 bit accumulation buffer - buffer = new uint32_t*[3]; - for(int i=0;i<3;i++) - { - int w=(int)image->GetWidth((ADM_PLANE)i); - int h=(int)image->GetHeight((ADM_PLANE)i); - buffer[i] = new uint32_t[w*h]; - //I know that there is some way to initialize this with zeroes more efficiently, but I don't know how to do it. - for(int y=0;yGetReadPlanes(fplanes); - image->GetPitches(fpitches); - for(int i=0;i<3;i++) - { - int w=(int)image->GetWidth((ADM_PLANE)i); - int h=(int)image->GetHeight((ADM_PLANE)i); - uint8_t *f=fplanes[i]; - for(int y=0;yGetWidth(PLANAR_Y),frame->GetHeight(PLANAR_Y)); - //image->copyInfo(frame);//Who knows what crazy info the frame has - if(image->Pts!=ADM_NO_PTS) - image->Pts=image->Pts/param.N; - uint8_t *iplanes[3]; - image->GetWritePlanes(iplanes); - for(int i=0;i<3;i++) - { - int w=(int)image->GetWidth((ADM_PLANE)i); - int h=(int)image->GetHeight((ADM_PLANE)i); - uint8_t *ip=iplanes[i]; - for(int y=0;y +#include +#include "ADM_default.h" +#include "ADM_coreVideoFilter.h" +#include "DIA_coreToolkit.h" +#include "DIA_factory.h" +#include "ADM_vidMisc.h" +#include "blend.h" +#include "blend_desc.cpp" +/** + \class AVDM_BlendFrames + * \brief fade video plugin + */ +class AVDM_BlendFrames : public ADM_coreVideoFilter +{ +protected: + blend param; + uint32_t **buffer; + uint32_t accumulated; + //void AccumulateFrame(ADMImage *buffer,ADMImage *frame); + //void WriteFrameAndClearBuffer(ADMImage *buffer,ADMImage *frame,uint32_t N); +public: + AVDM_BlendFrames(ADM_coreVideoFilter *previous,CONFcouple *conf); + ~AVDM_BlendFrames(); + + virtual const char *getConfiguration(void); /// Return current configuration as a human readable string + virtual bool getNextFrame(uint32_t *fn,ADMImage *image); /// Return the next image + // virtual FilterInfo *getInfo(void); /// Return picture parameters after this filter + virtual bool getCoupledConf(CONFcouple **couples); /// Return the current filter configuration + virtual void setCoupledConf(CONFcouple *couples); + virtual bool configure(void); /// Start graphical user interface + +}; + +// Add the hook to make it valid plugin +DECLARE_VIDEO_FILTER(AVDM_BlendFrames, + 1,0,0, // Version + ADM_UI_ALL, // UI + VF_TRANSFORM, // Category + "blend", // internal name (must be uniq!) + QT_TRANSLATE_NOOP("blend","Blend Frames"),// Display name + QT_TRANSLATE_NOOP("blend","Blend groups of N frames into a single frame. Useful for speeding up slow motion footage or creating timelapses.") // Description +); +/** + * \fn configure + * \brief UI configuration + * @param + * @return + */ +bool AVDM_BlendFrames::configure() +{ +#define MAX_BLEND_FRAMES 16777216//2^32/2^8 This is the in-all-cases limit, but on average it should be able to support probably 25% more. However, no frames will be exported unless the number of frames in the video is equal or greater. + diaElemUInteger N(&(param.N),QT_TRANSLATE_NOOP("blend","Frames"),1,MAX_BLEND_FRAMES); + diaElem *elems[1]={&N}; + if(diaFactoryRun(QT_TRANSLATE_NOOP("blend","Blend"),1,elems)){ + info.totalDuration=previousFilter->getInfo()->totalDuration/((uint64_t)param.N);//This bad boy reports the proper duration to the loading bar + info.markerA=previousFilter->getInfo()->markerA/((uint64_t)param.N); + info.markerB=previousFilter->getInfo()->markerB/((uint64_t)param.N); + return 1; + }else + return 0; +} +/** + * \fn getConfiguration + * + */ +const char *AVDM_BlendFrames::getConfiguration(void) +{ + static char conf[12]; + snprintf(conf,12," N:%d ",param.N); + return conf; +} + +/** + * \fn ctor + * @param in + * @param couples + */ +AVDM_BlendFrames::AVDM_BlendFrames(ADM_coreVideoFilter *in,CONFcouple *setup) : ADM_coreVideoFilter(in,setup) +{ + if(!setup || !ADM_paramLoad(setup,blend_param,¶m)) + { + // Default value + param.N=1; + } + accumulated=0; + buffer=NULL; + info.totalDuration=previousFilter->getInfo()->totalDuration/((uint64_t)param.N); + info.markerA=previousFilter->getInfo()->markerA/((uint64_t)param.N); + info.markerB=previousFilter->getInfo()->markerB/((uint64_t)param.N); +} +/** + * \fn setCoupledConf + * \brief save current setup from couples + * @param couples + */ +void AVDM_BlendFrames::setCoupledConf(CONFcouple *couples) +{ + ADM_paramLoad(couples, blend_param, ¶m); +} + +/** + * \fn getCoupledConf + * @param couples + * @return setup as couples + */ +bool AVDM_BlendFrames::getCoupledConf(CONFcouple **couples) +{ + return ADM_paramSave(couples, blend_param,¶m); +} + +/** + * \fn dtor + */ +AVDM_BlendFrames::~AVDM_BlendFrames(void) +{ + if(buffer) + { + for(int i=0;i<1;i++) + delete [] buffer[i]; + delete [] buffer; + buffer=NULL; + } +} +/** + * + * @param source + * @param source2 + * @param dest + * @param offset + * @return + */ + +/** + * \fn getNextFrame + * @param fn + * @param image + * @return + */ +bool AVDM_BlendFrames::getNextFrame(uint32_t *fn,ADMImage *image) +{ + while(true){ + if(previousFilter->getNextFrame(fn,image)==false) + return false; + + if(buffer==NULL){ + //Create new 32 bit accumulation buffer + buffer = new uint32_t*[3]; + for(int i=0;i<3;i++) + { + int w=(int)image->GetWidth((ADM_PLANE)i); + int h=(int)image->GetHeight((ADM_PLANE)i); + buffer[i] = new uint32_t[w*h]; + //I know that there is some way to initialize this with zeroes more efficiently, but I don't know how to do it. + for(int y=0;yGetReadPlanes(fplanes); + image->GetPitches(fpitches); + for(int i=0;i<3;i++) + { + int w=(int)image->GetWidth((ADM_PLANE)i); + int h=(int)image->GetHeight((ADM_PLANE)i); + uint8_t *f=fplanes[i]; + for(int y=0;yGetWidth(PLANAR_Y),frame->GetHeight(PLANAR_Y)); + //image->copyInfo(frame);//Who knows what crazy info the frame has + if(image->Pts!=ADM_NO_PTS) + image->Pts=image->Pts/param.N; + uint8_t *iplanes[3]; + image->GetWritePlanes(iplanes); + for(int i=0;i<3;i++) + { + int w=(int)image->GetWidth((ADM_PLANE)i); + int h=(int)image->GetHeight((ADM_PLANE)i); + uint8_t *ip=iplanes[i]; + for(int y=0;y") - #MESSAGE(STATUS "COMMAND ${GIT_EXECUTABLE} log --format=oneline -1 ${topdir}") - EXECUTE_PROCESS( - COMMAND echo log --format=oneline --no-abbrev -1 ${topdir} - COMMAND xargs ${GIT_EXECUTABLE} - COMMAND head -c 11 - WORKING_DIRECTORY ${_dir} - RESULT_VARIABLE result - OUTPUT_VARIABLE output - ) - - #MESSAGE(STATUS "git last entry is ${output} -- ${result}") - ADM_TIMESTAMP(date) - STRING(STRIP "${output}" output) - SET( ${_rev} "${date}_${output}") - MESSAGE(STATUS "<${output}><${date}>==> ${${_rev}}") - -ELSE(GIT_EXECUTABLE) - SET(ADM_GIT_SVN_REVISION 0) - ENDIF(GIT_EXECUTABLE) - -ENDMACRO(admGetGitRevision _dir _rev) - -# FindSubversion.cmake ends here. +# - Extract information from a subversion working copy +include(admTimeStamp) +################################################################### +# +# Look for git-svn-id in the logs to detect if it is git-svn +# +################################################################### +MACRO(admIsGitSvn _dir _isSvn) + #MESSAGE(STATUS "Git on folder ${_dir}") + EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} log -n 50 ${_dir} + COMMAND grep "git-svn-id" + COMMAND wc -l + WORKING_DIRECTORY ${_dir} + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ) + if(${output} EQUAL 0) + MESSAGE(STATUS "This is not git-svn") + SET(${_isSvn} 0) + else(${output} EQUAL 0) + MESSAGE(STATUS "This is git-svn") + SET(${_isSvn} 1) + endif(${output} EQUAL 0) + #MESSAGE(STATUS "Dir : ${_dir} Output : ${output} result:${result} svn:${${_isSvn}}") +ENDMACRO(admIsGitSvn _dir _svn) +# +# +# +MACRO(admGetGitRevision _dir _rev) + + FIND_PROGRAM(GIT_EXECUTABLE git + DOC "git command line client") + MARK_AS_ADVANCED(GIT_EXECUTABLE) + + IF(GIT_EXECUTABLE) + + #SET(EXE "cd ${_dir}&& ${GIT_EXECUTABLE} svn log | head -2 | grep '^r' | sed 's/ .*$//g'" ) + set(svn 0) + MESSAGE(STATUS "Getting git-svn version from ${_dir}") + EXECUTE_PROCESS( + COMMAND ${GIT_EXECUTABLE} rev-parse --show-toplevel ${_dir} + WORKING_DIRECTORY ${_dir} + RESULT_VARIABLE result + OUTPUT_VARIABLE topdir + ) + STRING(STRIP "${topdir}" topdir) + MESSAGE(STATUS "Top dir is <${topdir}>") + #MESSAGE(STATUS "COMMAND ${GIT_EXECUTABLE} log --format=oneline -1 ${topdir}") + EXECUTE_PROCESS( + COMMAND echo log --format=oneline --no-abbrev -1 ${topdir} + COMMAND xargs ${GIT_EXECUTABLE} + COMMAND head -c 11 + WORKING_DIRECTORY ${_dir} + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ) + + #MESSAGE(STATUS "git last entry is ${output} -- ${result}") + ADM_TIMESTAMP(date) + STRING(STRIP "${output}" output) + SET( ${_rev} "${date}_${output}") + MESSAGE(STATUS "<${output}><${date}>==> ${${_rev}}") + +ELSE(GIT_EXECUTABLE) + SET(ADM_GIT_SVN_REVISION 0) + ENDIF(GIT_EXECUTABLE) + +ENDMACRO(admGetGitRevision _dir _rev) + +# FindSubversion.cmake ends here. diff --git a/cmake/FindGnuMake.cmake b/cmake/FindGnuMake.cmake index 4f51d0c372..94cf025927 100644 --- a/cmake/FindGnuMake.cmake +++ b/cmake/FindGnuMake.cmake @@ -1,25 +1,25 @@ -if (NOT GNUMAKE_EXECUTABLE) - message(STATUS "Checking for GNU Make") - message(STATUS "*********************") - - find_program(GNUMAKE_EXECUTABLE - make - ${GNUMAKE_DIR} - /bin - /usr/bin - /usr/local/bin - /sbin) - set(GNUMAKE_EXECUTABLE ${GNUMAKE_EXECUTABLE} CACHE STRING "") - - if (GNUMAKE_EXECUTABLE) - message(STATUS "Found GNU Make") - - if (VERBOSE) - message(STATUS "Path: ${GNUMAKE_EXECUTABLE}") - endif (VERBOSE) - else (GNUMAKE_EXECUTABLE) - message(FATAL_ERROR "GNU Make not found") - endif (GNUMAKE_EXECUTABLE) - - message("") +if (NOT GNUMAKE_EXECUTABLE) + message(STATUS "Checking for GNU Make") + message(STATUS "*********************") + + find_program(GNUMAKE_EXECUTABLE + make + ${GNUMAKE_DIR} + /bin + /usr/bin + /usr/local/bin + /sbin) + set(GNUMAKE_EXECUTABLE ${GNUMAKE_EXECUTABLE} CACHE STRING "") + + if (GNUMAKE_EXECUTABLE) + message(STATUS "Found GNU Make") + + if (VERBOSE) + message(STATUS "Path: ${GNUMAKE_EXECUTABLE}") + endif (VERBOSE) + else (GNUMAKE_EXECUTABLE) + message(FATAL_ERROR "GNU Make not found") + endif (GNUMAKE_EXECUTABLE) + + message("") endif (NOT GNUMAKE_EXECUTABLE) \ No newline at end of file diff --git a/cmake/FindPatch.cmake b/cmake/FindPatch.cmake index 6d12b081ce..b00399c163 100644 --- a/cmake/FindPatch.cmake +++ b/cmake/FindPatch.cmake @@ -1,39 +1,39 @@ -if (NOT PATCH_EXECUTABLE) - message(STATUS "Checking for patch") - message(STATUS "******************") - - find_program(PATCH_EXECUTABLE patch) - set(PATCH_EXECUTABLE ${PATCH_EXECUTABLE} CACHE STRING "") - - if (PATCH_EXECUTABLE) - message(STATUS "Found patch") - - if (VERBOSE) - message(STATUS "Path: ${PATCH_EXECUTABLE}") - endif (VERBOSE) - else (PATCH_EXECUTABLE) - message(FATAL_ERROR "patch not found") - endif (PATCH_EXECUTABLE) - - message("") -endif (NOT PATCH_EXECUTABLE) - -macro(patch_file baseDir patchFile) - execute_process(COMMAND ${PATCH_EXECUTABLE} -p0 -i "${patchFile}" - WORKING_DIRECTORY "${baseDir}" - RESULT_VARIABLE res - ) - if(res) - MESSAGE(FATAL_ERROR "Patch failed") - endif(res) -endmacro(patch_file) - -macro(patch_file_p1 baseDir patchFile) - execute_process(COMMAND ${PATCH_EXECUTABLE} -p1 -i "${patchFile}" - WORKING_DIRECTORY "${baseDir}" - RESULT_VARIABLE res - ) - if(res) - MESSAGE(FATAL_ERROR "Patch failed") - endif(res) -endmacro(patch_file_p1) +if (NOT PATCH_EXECUTABLE) + message(STATUS "Checking for patch") + message(STATUS "******************") + + find_program(PATCH_EXECUTABLE patch) + set(PATCH_EXECUTABLE ${PATCH_EXECUTABLE} CACHE STRING "") + + if (PATCH_EXECUTABLE) + message(STATUS "Found patch") + + if (VERBOSE) + message(STATUS "Path: ${PATCH_EXECUTABLE}") + endif (VERBOSE) + else (PATCH_EXECUTABLE) + message(FATAL_ERROR "patch not found") + endif (PATCH_EXECUTABLE) + + message("") +endif (NOT PATCH_EXECUTABLE) + +macro(patch_file baseDir patchFile) + execute_process(COMMAND ${PATCH_EXECUTABLE} -p0 -i "${patchFile}" + WORKING_DIRECTORY "${baseDir}" + RESULT_VARIABLE res + ) + if(res) + MESSAGE(FATAL_ERROR "Patch failed") + endif(res) +endmacro(patch_file) + +macro(patch_file_p1 baseDir patchFile) + execute_process(COMMAND ${PATCH_EXECUTABLE} -p1 -i "${patchFile}" + WORKING_DIRECTORY "${baseDir}" + RESULT_VARIABLE res + ) + if(res) + MESSAGE(FATAL_ERROR "Patch failed") + endif(res) +endmacro(patch_file_p1) diff --git a/cmake/FindSDL.cmake b/cmake/FindSDL.cmake index 3576b9ea79..ee5fe9dba7 100644 --- a/cmake/FindSDL.cmake +++ b/cmake/FindSDL.cmake @@ -1,163 +1,163 @@ -# - Locate the SDL library -# This module defines -# SDL_LIBRARY, the library to link against -# SDL_FOUND, if false, do not try to link to SDL -# SDL_INCLUDE_DIR, where to find SDL.h -# -# Don't forget to include SDLmain.h and SDLmain.m your project for the -# OS X framework based version. (Other versions link to -lSDLmain which -# this module will try to find on your behalf.) Also for OS X, this -# module will automatically add the -framework Cocoa on your behalf. -# $SDLDIR is an environment variable that would -# correspond to the ./configure --prefix=$SDLDIR -# used in building SDL. -# l.e.galup 9-20-02 -# -# Modified by Eric Wing. -# Added new modifications to recognize OS X frameworks and -# additional Unix paths (FreeBSD, etc). -# Also corrected the header search path to follow "proper" SDL guidelines. -# Added a search for SDLmain which is needed by some platforms. -# Added a search for threads which is needed by some platforms. -# Added needed compile switches for MinGW. -# -# On OSX, this will prefer the Framework version (if found) over others. -# People will have to manually change the cache values of -# SDL_LIBRARY to override this selection. -# -# Note that the header path has changed from SDL/SDL.h to just SDL.h -# This needed to change because "proper" SDL convention -# is #include "SDL.h", not . This is done for portability -# reasons because not all systems place things in SDL/ (see FreeBSD). -FIND_PATH(SDL_INCLUDE_DIR SDL.h - $ENV{SDLDIR}/include - $ENV{SDLDIR}/include/SDL - ~/Library/Frameworks/SDL.framework/Headers - /Library/Frameworks/SDL.framework/Headers - /usr/local/include/SDL - /usr/include/SDL - /usr/local/include/SDL12 - /usr/local/include/SDL11 # FreeBSD ports - /usr/include/SDL12 - /usr/include/SDL11 - /usr/local/include - /usr/include - /sw/include/SDL # Fink - /sw/include - /opt/local/include/SDL # DarwinPorts - /opt/local/include - /opt/csw/include/SDL # Blastwave - /opt/csw/include - /opt/include/SDL - /opt/include - ) -# I'm not sure if I should do a special casing for Apple. It is -# unlikely that other Unix systems will find the framework path. -# But if they do ([Next|Open|GNU]Step?), -# do they want the -framework option also? -IF(${SDL_INCLUDE_DIR} MATCHES ".framework") - # The Cocoa framework must be linked into SDL because SDL is Cocoa based. - # Remember that the OS X framework version expects you to drop in - # SDLmain.h and SDLmain.m directly into your project. - # (Cocoa link moved to bottom of this script.) - # SET (SDL_LIBRARY "-framework SDL -framework Cocoa" CACHE STRING "SDL framework for OSX") - # SET(SDL_LIBRARY "-framework SDL" CACHE STRING "SDL framework for OSX") - # Extract the path the framework resides in so we can use it for the -F flag - STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" SDL_FRAMEWORK_PATH_TEMP ${SDL_INCLUDE_DIR}) - IF("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks" - OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks" - ) - # String is in default search path, don't need to use -F - SET(SDL_LIBRARY_TEMP "-framework SDL") - ELSE("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks" - OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks" - ) - # String is not /Library/Frameworks, need to use -F - SET(SDL_LIBRARY_TEMP "-F${SDL_FRAMEWORK_PATH_TEMP} -framework SDL") - ENDIF("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks" - OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks" - ) - # Clear the temp variable so nobody can see it - SET(SDL_FRAMEWORK_PATH_TEMP "" CACHE INTERNAL "") - -ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework") - # SDL-1.1 is the name used by FreeBSD ports... - # don't confuse it for the version number. - FIND_LIBRARY(SDL_LIBRARY_TEMP - NAMES SDL SDL-1.1 - PATHS - $ENV{SDLDIR}/lib - /usr/local/lib - /usr/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - ) - # Non-OS X framework versions expect you to also dynamically link to - # SDLmain. This is mainly for Windows and OS X. Other platforms - # seem to provide SDLmain for compatibility even though they don't - # necessarily need it. - FIND_LIBRARY(SDLMAIN_LIBRARY - NAMES SDLmain SDLmain-1.1 - PATHS - $ENV{SDLDIR}/lib - /usr/local/lib - /usr/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - ) -ENDIF(${SDL_INCLUDE_DIR} MATCHES ".framework") - -# SDL may require threads on your system. -# The Apple build may not need an explicit flag because one of the -# frameworks may already provide it. -# But for non-OSX systems, I will use the CMake Threads package. -IF(NOT APPLE) - FIND_PACKAGE(Threads) -ENDIF(NOT APPLE) - -# MinGW needs an additional library, mwindows -# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows -# (Actually on second look, I think it only needs one of the m* libraries.) -IF(MINGW) - SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") -ENDIF(MINGW) - -SET(SDL_FOUND "NO") -IF(SDL_LIBRARY_TEMP) - # For SDLmain - IF(SDLMAIN_LIBRARY) - SET(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP}) - ENDIF(SDLMAIN_LIBRARY) - - # For OS X, SDL uses Cocoa as a backend so it must link to Cocoa. - # CMake doesn't display the -framework Cocoa string in the UI even - # though it actually is there. I think it has something to do - # with the CACHE STRING. Maybe somebody else knows how to fix this. - # The problem is mainly cosmetic, and not a functional issue. - IF(APPLE) - SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa") - ENDIF(APPLE) - - # For threads, as mentioned Apple doesn't need this. - # In fact, there seems to be a problem if Find the threads package - # and try using this line, so I'm just skipping it entirely for OS X. - IF(NOT APPLE) - SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT}) - ENDIF(NOT APPLE) - - # For MinGW library - IF(MINGW) - SET(SDL_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL_LIBRARY_TEMP}) - ENDIF(MINGW) - - # Set the final string here so the GUI reflects the final state. - SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found") - - SET(SDL_FOUND "YES") -ENDIF(SDL_LIBRARY_TEMP) - -MARK_AS_ADVANCED(SDL_LIBRARY_TEMP) +# - Locate the SDL library +# This module defines +# SDL_LIBRARY, the library to link against +# SDL_FOUND, if false, do not try to link to SDL +# SDL_INCLUDE_DIR, where to find SDL.h +# +# Don't forget to include SDLmain.h and SDLmain.m your project for the +# OS X framework based version. (Other versions link to -lSDLmain which +# this module will try to find on your behalf.) Also for OS X, this +# module will automatically add the -framework Cocoa on your behalf. +# $SDLDIR is an environment variable that would +# correspond to the ./configure --prefix=$SDLDIR +# used in building SDL. +# l.e.galup 9-20-02 +# +# Modified by Eric Wing. +# Added new modifications to recognize OS X frameworks and +# additional Unix paths (FreeBSD, etc). +# Also corrected the header search path to follow "proper" SDL guidelines. +# Added a search for SDLmain which is needed by some platforms. +# Added a search for threads which is needed by some platforms. +# Added needed compile switches for MinGW. +# +# On OSX, this will prefer the Framework version (if found) over others. +# People will have to manually change the cache values of +# SDL_LIBRARY to override this selection. +# +# Note that the header path has changed from SDL/SDL.h to just SDL.h +# This needed to change because "proper" SDL convention +# is #include "SDL.h", not . This is done for portability +# reasons because not all systems place things in SDL/ (see FreeBSD). +FIND_PATH(SDL_INCLUDE_DIR SDL.h + $ENV{SDLDIR}/include + $ENV{SDLDIR}/include/SDL + ~/Library/Frameworks/SDL.framework/Headers + /Library/Frameworks/SDL.framework/Headers + /usr/local/include/SDL + /usr/include/SDL + /usr/local/include/SDL12 + /usr/local/include/SDL11 # FreeBSD ports + /usr/include/SDL12 + /usr/include/SDL11 + /usr/local/include + /usr/include + /sw/include/SDL # Fink + /sw/include + /opt/local/include/SDL # DarwinPorts + /opt/local/include + /opt/csw/include/SDL # Blastwave + /opt/csw/include + /opt/include/SDL + /opt/include + ) +# I'm not sure if I should do a special casing for Apple. It is +# unlikely that other Unix systems will find the framework path. +# But if they do ([Next|Open|GNU]Step?), +# do they want the -framework option also? +IF(${SDL_INCLUDE_DIR} MATCHES ".framework") + # The Cocoa framework must be linked into SDL because SDL is Cocoa based. + # Remember that the OS X framework version expects you to drop in + # SDLmain.h and SDLmain.m directly into your project. + # (Cocoa link moved to bottom of this script.) + # SET (SDL_LIBRARY "-framework SDL -framework Cocoa" CACHE STRING "SDL framework for OSX") + # SET(SDL_LIBRARY "-framework SDL" CACHE STRING "SDL framework for OSX") + # Extract the path the framework resides in so we can use it for the -F flag + STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" SDL_FRAMEWORK_PATH_TEMP ${SDL_INCLUDE_DIR}) + IF("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks" + OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks" + ) + # String is in default search path, don't need to use -F + SET(SDL_LIBRARY_TEMP "-framework SDL") + ELSE("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks" + OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks" + ) + # String is not /Library/Frameworks, need to use -F + SET(SDL_LIBRARY_TEMP "-F${SDL_FRAMEWORK_PATH_TEMP} -framework SDL") + ENDIF("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks" + OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks" + ) + # Clear the temp variable so nobody can see it + SET(SDL_FRAMEWORK_PATH_TEMP "" CACHE INTERNAL "") + +ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework") + # SDL-1.1 is the name used by FreeBSD ports... + # don't confuse it for the version number. + FIND_LIBRARY(SDL_LIBRARY_TEMP + NAMES SDL SDL-1.1 + PATHS + $ENV{SDLDIR}/lib + /usr/local/lib + /usr/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + ) + # Non-OS X framework versions expect you to also dynamically link to + # SDLmain. This is mainly for Windows and OS X. Other platforms + # seem to provide SDLmain for compatibility even though they don't + # necessarily need it. + FIND_LIBRARY(SDLMAIN_LIBRARY + NAMES SDLmain SDLmain-1.1 + PATHS + $ENV{SDLDIR}/lib + /usr/local/lib + /usr/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + ) +ENDIF(${SDL_INCLUDE_DIR} MATCHES ".framework") + +# SDL may require threads on your system. +# The Apple build may not need an explicit flag because one of the +# frameworks may already provide it. +# But for non-OSX systems, I will use the CMake Threads package. +IF(NOT APPLE) + FIND_PACKAGE(Threads) +ENDIF(NOT APPLE) + +# MinGW needs an additional library, mwindows +# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows +# (Actually on second look, I think it only needs one of the m* libraries.) +IF(MINGW) + SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") +ENDIF(MINGW) + +SET(SDL_FOUND "NO") +IF(SDL_LIBRARY_TEMP) + # For SDLmain + IF(SDLMAIN_LIBRARY) + SET(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP}) + ENDIF(SDLMAIN_LIBRARY) + + # For OS X, SDL uses Cocoa as a backend so it must link to Cocoa. + # CMake doesn't display the -framework Cocoa string in the UI even + # though it actually is there. I think it has something to do + # with the CACHE STRING. Maybe somebody else knows how to fix this. + # The problem is mainly cosmetic, and not a functional issue. + IF(APPLE) + SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa") + ENDIF(APPLE) + + # For threads, as mentioned Apple doesn't need this. + # In fact, there seems to be a problem if Find the threads package + # and try using this line, so I'm just skipping it entirely for OS X. + IF(NOT APPLE) + SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT}) + ENDIF(NOT APPLE) + + # For MinGW library + IF(MINGW) + SET(SDL_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL_LIBRARY_TEMP}) + ENDIF(MINGW) + + # Set the final string here so the GUI reflects the final state. + SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found") + + SET(SDL_FOUND "YES") +ENDIF(SDL_LIBRARY_TEMP) + +MARK_AS_ADVANCED(SDL_LIBRARY_TEMP) diff --git a/cmake/FindSubversion.cmake b/cmake/FindSubversion.cmake index a7e73fbd33..37ddaa70b9 100644 --- a/cmake/FindSubversion.cmake +++ b/cmake/FindSubversion.cmake @@ -1,114 +1,114 @@ -# - Extract information from a subversion working copy -# The module defines the following variables: -# Subversion_SVN_EXECUTABLE - path to svn command line client -# Subversion_VERSION_SVN - version of svn command line client -# Subversion_FOUND - true if the command line client was found -# If the command line client executable is found the macro -# Subversion_WC_INFO( ) -# is defined to extract information of a subversion working copy at -# a given location. The macro defines the following variables: -# _WC_URL - url of the repository (at ) -# _WC_ROOT - root url of the repository -# _WC_REVISION - current revision -# _WC_LAST_CHANGED_AUTHOR - author of last commit -# _WC_LAST_CHANGED_DATE - date of last commit -# _WC_LAST_CHANGED_REV - revision of last commit -# _WC_LAST_CHANGED_LOG - last log of base revision -# _WC_INFO - output of command `svn info ' -# Example usage: -# FIND_PACKAGE(Subversion) -# IF(Subversion_FOUND) -# Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project) -# MESSAGE("Current revision is ${Project_WC_REVISION}") -# ENDIF(Subversion_FOUND) - -# Copyright (c) 2006, Tristan Carel -# All rights reserved. -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the University of California, Berkeley nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# $Id: FindSubversion.cmake,v 1.1.2.1 2006/11/13 17:59:54 hoffman Exp $ - -SET(Subversion_FOUND FALSE) -SET(Subversion_SVN_FOUND FALSE) - -FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn - DOC "subversion command line client") -MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE) - -IF(Subversion_SVN_EXECUTABLE) - SET(Subversion_SVN_FOUND TRUE) - SET(Subversion_FOUND TRUE) - - MACRO(Subversion_WC_INFO dir prefix) - EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - OUTPUT_VARIABLE Subversion_VERSION_SVN - OUTPUT_STRIP_TRAILING_WHITESPACE) - MESSAGE(STATUS "Getting svn version from ${dir}") - - EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} info --xml . - WORKING_DIRECTORY ${dir} - OUTPUT_VARIABLE ${prefix}_WC_INFO - ERROR_VARIABLE Subversion_svn_info_error - RESULT_VARIABLE Subversion_svn_info_result - OUTPUT_STRIP_TRAILING_WHITESPACE) - - IF(NOT ${Subversion_svn_info_result} EQUAL 0) - MESSAGE(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}") - ELSE(NOT ${Subversion_svn_info_result} EQUAL 0) - STRING(REPLACE "\n" "" ${prefix}_WC_INFO "${${prefix}_WC_INFO}") - STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*" "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}") - STRING(REGEX REPLACE ".*([^<]+).*" "\\1" ${prefix}_WC_URL "${${prefix}_WC_INFO}") - STRING(REGEX REPLACE ".*]+revision=\"([0-9]+)\">.*" "\\1" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}") - STRING(REGEX REPLACE ".*([^<]+).*" "\\1" ${prefix}_WC_LAST_CHANGED_AUTHOR "${${prefix}_WC_INFO}") - STRING(REGEX REPLACE ".*([^<]+).*" "\\1" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}") - ENDIF(NOT ${Subversion_svn_info_result} EQUAL 0) - - EXECUTE_PROCESS(COMMAND - ${Subversion_SVN_EXECUTABLE} log -r BASE ${dir} - WORKING_DIRECTORY ${dir} - OUTPUT_VARIABLE Subversion_LAST_CHANGED_LOG - ERROR_VARIABLE Subversion_svn_log_error - RESULT_VARIABLE Subversion_svn_log_result - OUTPUT_STRIP_TRAILING_WHITESPACE) - - IF(NOT ${Subversion_svn_log_result} EQUAL 0) - MESSAGE(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} log -r BASE ${dir}\" failed with output:\n${Subversion_svn_log_error}") - ENDIF(NOT ${Subversion_svn_log_result} EQUAL 0) - ENDMACRO(Subversion_WC_INFO) - -ENDIF(Subversion_SVN_EXECUTABLE) - -IF(NOT Subversion_FOUND) - IF(NOT Subversion_FIND_QUIETLY) - MESSAGE(STATUS "Subversion was not found.") - ELSE(NOT Subversion_FIND_QUIETLY) - IF(Subversion_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Subversion was not found.") - ENDIF(Subversion_FIND_REQUIRED) - ENDIF(NOT Subversion_FIND_QUIETLY) -ENDIF(NOT Subversion_FOUND) - -# FindSubversion.cmake ends here. +# - Extract information from a subversion working copy +# The module defines the following variables: +# Subversion_SVN_EXECUTABLE - path to svn command line client +# Subversion_VERSION_SVN - version of svn command line client +# Subversion_FOUND - true if the command line client was found +# If the command line client executable is found the macro +# Subversion_WC_INFO( ) +# is defined to extract information of a subversion working copy at +# a given location. The macro defines the following variables: +# _WC_URL - url of the repository (at ) +# _WC_ROOT - root url of the repository +# _WC_REVISION - current revision +# _WC_LAST_CHANGED_AUTHOR - author of last commit +# _WC_LAST_CHANGED_DATE - date of last commit +# _WC_LAST_CHANGED_REV - revision of last commit +# _WC_LAST_CHANGED_LOG - last log of base revision +# _WC_INFO - output of command `svn info ' +# Example usage: +# FIND_PACKAGE(Subversion) +# IF(Subversion_FOUND) +# Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project) +# MESSAGE("Current revision is ${Project_WC_REVISION}") +# ENDIF(Subversion_FOUND) + +# Copyright (c) 2006, Tristan Carel +# All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the University of California, Berkeley nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# $Id: FindSubversion.cmake,v 1.1.2.1 2006/11/13 17:59:54 hoffman Exp $ + +SET(Subversion_FOUND FALSE) +SET(Subversion_SVN_FOUND FALSE) + +FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn + DOC "subversion command line client") +MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE) + +IF(Subversion_SVN_EXECUTABLE) + SET(Subversion_SVN_FOUND TRUE) + SET(Subversion_FOUND TRUE) + + MACRO(Subversion_WC_INFO dir prefix) + EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE Subversion_VERSION_SVN + OUTPUT_STRIP_TRAILING_WHITESPACE) + MESSAGE(STATUS "Getting svn version from ${dir}") + + EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} info --xml . + WORKING_DIRECTORY ${dir} + OUTPUT_VARIABLE ${prefix}_WC_INFO + ERROR_VARIABLE Subversion_svn_info_error + RESULT_VARIABLE Subversion_svn_info_result + OUTPUT_STRIP_TRAILING_WHITESPACE) + + IF(NOT ${Subversion_svn_info_result} EQUAL 0) + MESSAGE(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}") + ELSE(NOT ${Subversion_svn_info_result} EQUAL 0) + STRING(REPLACE "\n" "" ${prefix}_WC_INFO "${${prefix}_WC_INFO}") + STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*" "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}") + STRING(REGEX REPLACE ".*([^<]+).*" "\\1" ${prefix}_WC_URL "${${prefix}_WC_INFO}") + STRING(REGEX REPLACE ".*]+revision=\"([0-9]+)\">.*" "\\1" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}") + STRING(REGEX REPLACE ".*([^<]+).*" "\\1" ${prefix}_WC_LAST_CHANGED_AUTHOR "${${prefix}_WC_INFO}") + STRING(REGEX REPLACE ".*([^<]+).*" "\\1" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}") + ENDIF(NOT ${Subversion_svn_info_result} EQUAL 0) + + EXECUTE_PROCESS(COMMAND + ${Subversion_SVN_EXECUTABLE} log -r BASE ${dir} + WORKING_DIRECTORY ${dir} + OUTPUT_VARIABLE Subversion_LAST_CHANGED_LOG + ERROR_VARIABLE Subversion_svn_log_error + RESULT_VARIABLE Subversion_svn_log_result + OUTPUT_STRIP_TRAILING_WHITESPACE) + + IF(NOT ${Subversion_svn_log_result} EQUAL 0) + MESSAGE(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} log -r BASE ${dir}\" failed with output:\n${Subversion_svn_log_error}") + ENDIF(NOT ${Subversion_svn_log_result} EQUAL 0) + ENDMACRO(Subversion_WC_INFO) + +ENDIF(Subversion_SVN_EXECUTABLE) + +IF(NOT Subversion_FOUND) + IF(NOT Subversion_FIND_QUIETLY) + MESSAGE(STATUS "Subversion was not found.") + ELSE(NOT Subversion_FIND_QUIETLY) + IF(Subversion_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Subversion was not found.") + ENDIF(Subversion_FIND_REQUIRED) + ENDIF(NOT Subversion_FIND_QUIETLY) +ENDIF(NOT Subversion_FOUND) + +# FindSubversion.cmake ends here. diff --git a/cmake/FindTar.cmake b/cmake/FindTar.cmake index 5353d2fb82..2a69c2f9a7 100644 --- a/cmake/FindTar.cmake +++ b/cmake/FindTar.cmake @@ -1,19 +1,19 @@ -if (NOT TAR_EXECUTABLE) - message(STATUS "Checking for tar") - message(STATUS "****************") - - find_program(TAR_EXECUTABLE tar) - set(TAR_EXECUTABLE ${TAR_EXECUTABLE} CACHE STRING "") - - if (TAR_EXECUTABLE) - message(STATUS "Found tar") - - if (VERBOSE) - message(STATUS "Path: ${TAR_EXECUTABLE}") - endif (VERBOSE) - else (TAR_EXECUTABLE) - message(FATAL_ERROR "tar not found") - endif (TAR_EXECUTABLE) - - message("") +if (NOT TAR_EXECUTABLE) + message(STATUS "Checking for tar") + message(STATUS "****************") + + find_program(TAR_EXECUTABLE tar) + set(TAR_EXECUTABLE ${TAR_EXECUTABLE} CACHE STRING "") + + if (TAR_EXECUTABLE) + message(STATUS "Found tar") + + if (VERBOSE) + message(STATUS "Path: ${TAR_EXECUTABLE}") + endif (VERBOSE) + else (TAR_EXECUTABLE) + message(FATAL_ERROR "tar not found") + endif (TAR_EXECUTABLE) + + message("") endif (NOT TAR_EXECUTABLE) \ No newline at end of file diff --git a/cmake/Po.cmake b/cmake/Po.cmake index 9bfa3a765d..b3180c1b5f 100644 --- a/cmake/Po.cmake +++ b/cmake/Po.cmake @@ -1,46 +1,46 @@ -# a small macro to create mo files out of po's -# Taken from sim-im.org - -MACRO(FIND_MSGFMT) - IF(NOT MSGFMT_EXECUTABLE) - IF(NOT MSGFMT_NOT_FOUND) - SET(MSGFMT_NAME "msgfmt") - FIND_PROGRAM(MSGFMT_EXECUTABLE ${MSGFMT_NAME}) - - IF (NOT MSGFMT_EXECUTABLE) - MESSAGE(STATUS "WARNING: ${MSGFMT_NAME} not found - po files can't be processed") - SET(MSGFMT_NOT_FOUND "1") # to avoid double checking in one cmake run - ENDIF (NOT MSGFMT_EXECUTABLE) - - MARK_AS_ADVANCED(MSGFMT_EXECUTABLE) - ENDIF(NOT MSGFMT_NOT_FOUND) - ENDIF(NOT MSGFMT_EXECUTABLE) -ENDMACRO(FIND_MSGFMT) - -MACRO(COMPILE_PO_FILES po_subdir _sources) - FIND_MSGFMT() - - IF(MSGFMT_EXECUTABLE) - FILE(GLOB po_files ${po_subdir}/*.po) - - FOREACH(po_input ${po_files}) - GET_FILENAME_COMPONENT(_in ${po_input} ABSOLUTE) - GET_FILENAME_COMPONENT(_basename ${po_input} NAME_WE) - - FILE(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_basename}") - GET_FILENAME_COMPONENT(_out "${CMAKE_CURRENT_BINARY_DIR}/${_basename}/avidemux.mo" ABSOLUTE) - - ADD_CUSTOM_COMMAND( - OUTPUT ${_out} - COMMAND ${CMAKE_COMMAND} -E echo "Generating" ${_out} "from" ${_in} - COMMAND ${MSGFMT_EXECUTABLE} ${_in} -o ${_out} - DEPENDS ${_in}) - - SET(mo_files ${mo_files} ${_out}) - - INSTALL(FILES ${_out} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/locale/${_basename}/LC_MESSAGES") - ENDFOREACH(po_input ${po_files}) - - SET(${_sources} ${${_sources}} ${mo_files}) - ENDIF(MSGFMT_EXECUTABLE) -ENDMACRO(COMPILE_PO_FILES) +# a small macro to create mo files out of po's +# Taken from sim-im.org + +MACRO(FIND_MSGFMT) + IF(NOT MSGFMT_EXECUTABLE) + IF(NOT MSGFMT_NOT_FOUND) + SET(MSGFMT_NAME "msgfmt") + FIND_PROGRAM(MSGFMT_EXECUTABLE ${MSGFMT_NAME}) + + IF (NOT MSGFMT_EXECUTABLE) + MESSAGE(STATUS "WARNING: ${MSGFMT_NAME} not found - po files can't be processed") + SET(MSGFMT_NOT_FOUND "1") # to avoid double checking in one cmake run + ENDIF (NOT MSGFMT_EXECUTABLE) + + MARK_AS_ADVANCED(MSGFMT_EXECUTABLE) + ENDIF(NOT MSGFMT_NOT_FOUND) + ENDIF(NOT MSGFMT_EXECUTABLE) +ENDMACRO(FIND_MSGFMT) + +MACRO(COMPILE_PO_FILES po_subdir _sources) + FIND_MSGFMT() + + IF(MSGFMT_EXECUTABLE) + FILE(GLOB po_files ${po_subdir}/*.po) + + FOREACH(po_input ${po_files}) + GET_FILENAME_COMPONENT(_in ${po_input} ABSOLUTE) + GET_FILENAME_COMPONENT(_basename ${po_input} NAME_WE) + + FILE(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_basename}") + GET_FILENAME_COMPONENT(_out "${CMAKE_CURRENT_BINARY_DIR}/${_basename}/avidemux.mo" ABSOLUTE) + + ADD_CUSTOM_COMMAND( + OUTPUT ${_out} + COMMAND ${CMAKE_COMMAND} -E echo "Generating" ${_out} "from" ${_in} + COMMAND ${MSGFMT_EXECUTABLE} ${_in} -o ${_out} + DEPENDS ${_in}) + + SET(mo_files ${mo_files} ${_out}) + + INSTALL(FILES ${_out} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/locale/${_basename}/LC_MESSAGES") + ENDFOREACH(po_input ${po_files}) + + SET(${_sources} ${${_sources}} ${mo_files}) + ENDIF(MSGFMT_EXECUTABLE) +ENDMACRO(COMPILE_PO_FILES) diff --git a/cmake/_CMakeParseArguments.cmake b/cmake/_CMakeParseArguments.cmake index cc63604908..7ce4c49ae5 100644 --- a/cmake/_CMakeParseArguments.cmake +++ b/cmake/_CMakeParseArguments.cmake @@ -1,138 +1,138 @@ -# CMAKE_PARSE_ARGUMENTS( args...) -# -# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for -# parsing the arguments given to that macro or function. -# It processes the arguments and defines a set of variables which hold the -# values of the respective options. -# -# The argument contains all options for the respective macro, -# i.e. keywords which can be used when calling the macro without any value -# following, like e.g. the OPTIONAL keyword of the install() command. -# -# The argument contains all keywords for this macro -# which are followed by one value, like e.g. DESTINATION keyword of the -# install() command. -# -# The argument contains all keywords for this macro -# which can be followed by more than one value, like e.g. the TARGETS or -# FILES keywords of the install() command. -# -# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the -# keywords listed in , and -# a variable composed of the given -# followed by "_" and the name of the respective keyword. -# These variables will then hold the respective value from the argument list. -# For the keywords this will be TRUE or FALSE. -# -# All remaining arguments are collected in a variable -# _UNPARSED_ARGUMENTS, this can be checked afterwards to see whether -# your macro was called with unrecognized parameters. -# -# As an example here a my_install() macro, which takes similar arguments as the -# real install() command: -# -# function(MY_INSTALL) -# set(options OPTIONAL FAST) -# set(oneValueArgs DESTINATION RENAME) -# set(multiValueArgs TARGETS CONFIGURATIONS) -# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) -# ... -# -# Assume my_install() has been called like this: -# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub) -# -# After the cmake_parse_arguments() call the macro will have set the following -# variables: -# MY_INSTALL_OPTIONAL = TRUE -# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install() -# MY_INSTALL_DESTINATION = "bin" -# MY_INSTALL_RENAME = "" (was not used) -# MY_INSTALL_TARGETS = "foo;bar" -# MY_INSTALL_CONFIGURATIONS = "" (was not used) -# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL" -# -# You can the continue and process these variables. -# -# Keywords terminate lists of values, e.g. if directly after a one_value_keyword -# another recognized keyword follows, this is interpreted as the beginning of -# the new option. -# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in -# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would -# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor. - -#============================================================================= -# Copyright 2010 Alexander Neundorf -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - - -if(__CMAKE_PARSE_ARGUMENTS_INCLUDED) - return() -endif() -set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE) - - -function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames) - # first set all result variables to empty/FALSE - foreach(arg_name ${_singleArgNames} ${_multiArgNames}) - set(${prefix}_${arg_name}) - endforeach(arg_name) - - foreach(option ${_optionNames}) - set(${prefix}_${option} FALSE) - endforeach(option) - - set(${prefix}_UNPARSED_ARGUMENTS) - - set(insideValues FALSE) - set(currentArgName) - - # now iterate over all arguments and fill the result variables - foreach(currentArg ${ARGN}) - list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword - list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword - list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword - - if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1) - if(insideValues) - if("${insideValues}" STREQUAL "SINGLE") - set(${prefix}_${currentArgName} ${currentArg}) - set(insideValues FALSE) - elseif("${insideValues}" STREQUAL "MULTI") - list(APPEND ${prefix}_${currentArgName} ${currentArg}) - endif() - else(insideValues) - list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg}) - endif(insideValues) - else() - if(NOT ${optionIndex} EQUAL -1) - set(${prefix}_${currentArg} TRUE) - set(insideValues FALSE) - elseif(NOT ${singleArgIndex} EQUAL -1) - set(currentArgName ${currentArg}) - set(${prefix}_${currentArgName}) - set(insideValues "SINGLE") - elseif(NOT ${multiArgIndex} EQUAL -1) - set(currentArgName ${currentArg}) - set(${prefix}_${currentArgName}) - set(insideValues "MULTI") - endif() - endif() - - endforeach(currentArg) - - # propagate the result variables to the caller: - foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames}) - set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE) - endforeach(arg_name) - set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE) - -endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs) +# CMAKE_PARSE_ARGUMENTS( args...) +# +# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for +# parsing the arguments given to that macro or function. +# It processes the arguments and defines a set of variables which hold the +# values of the respective options. +# +# The argument contains all options for the respective macro, +# i.e. keywords which can be used when calling the macro without any value +# following, like e.g. the OPTIONAL keyword of the install() command. +# +# The argument contains all keywords for this macro +# which are followed by one value, like e.g. DESTINATION keyword of the +# install() command. +# +# The argument contains all keywords for this macro +# which can be followed by more than one value, like e.g. the TARGETS or +# FILES keywords of the install() command. +# +# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the +# keywords listed in , and +# a variable composed of the given +# followed by "_" and the name of the respective keyword. +# These variables will then hold the respective value from the argument list. +# For the keywords this will be TRUE or FALSE. +# +# All remaining arguments are collected in a variable +# _UNPARSED_ARGUMENTS, this can be checked afterwards to see whether +# your macro was called with unrecognized parameters. +# +# As an example here a my_install() macro, which takes similar arguments as the +# real install() command: +# +# function(MY_INSTALL) +# set(options OPTIONAL FAST) +# set(oneValueArgs DESTINATION RENAME) +# set(multiValueArgs TARGETS CONFIGURATIONS) +# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) +# ... +# +# Assume my_install() has been called like this: +# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub) +# +# After the cmake_parse_arguments() call the macro will have set the following +# variables: +# MY_INSTALL_OPTIONAL = TRUE +# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install() +# MY_INSTALL_DESTINATION = "bin" +# MY_INSTALL_RENAME = "" (was not used) +# MY_INSTALL_TARGETS = "foo;bar" +# MY_INSTALL_CONFIGURATIONS = "" (was not used) +# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL" +# +# You can the continue and process these variables. +# +# Keywords terminate lists of values, e.g. if directly after a one_value_keyword +# another recognized keyword follows, this is interpreted as the beginning of +# the new option. +# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in +# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would +# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor. + +#============================================================================= +# Copyright 2010 Alexander Neundorf +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + + +if(__CMAKE_PARSE_ARGUMENTS_INCLUDED) + return() +endif() +set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE) + + +function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames) + # first set all result variables to empty/FALSE + foreach(arg_name ${_singleArgNames} ${_multiArgNames}) + set(${prefix}_${arg_name}) + endforeach(arg_name) + + foreach(option ${_optionNames}) + set(${prefix}_${option} FALSE) + endforeach(option) + + set(${prefix}_UNPARSED_ARGUMENTS) + + set(insideValues FALSE) + set(currentArgName) + + # now iterate over all arguments and fill the result variables + foreach(currentArg ${ARGN}) + list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword + list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword + list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword + + if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1) + if(insideValues) + if("${insideValues}" STREQUAL "SINGLE") + set(${prefix}_${currentArgName} ${currentArg}) + set(insideValues FALSE) + elseif("${insideValues}" STREQUAL "MULTI") + list(APPEND ${prefix}_${currentArgName} ${currentArg}) + endif() + else(insideValues) + list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg}) + endif(insideValues) + else() + if(NOT ${optionIndex} EQUAL -1) + set(${prefix}_${currentArg} TRUE) + set(insideValues FALSE) + elseif(NOT ${singleArgIndex} EQUAL -1) + set(currentArgName ${currentArg}) + set(${prefix}_${currentArgName}) + set(insideValues "SINGLE") + elseif(NOT ${multiArgIndex} EQUAL -1) + set(currentArgName ${currentArg}) + set(${prefix}_${currentArgName}) + set(insideValues "MULTI") + endif() + endif() + + endforeach(currentArg) + + # propagate the result variables to the caller: + foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames}) + set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE) + endforeach(arg_name) + set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE) + +endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs) diff --git a/cmake/admCheckAudioEncoderLibs.cmake b/cmake/admCheckAudioEncoderLibs.cmake index f36bbe1796..a8bfc501ce 100644 --- a/cmake/admCheckAudioEncoderLibs.cmake +++ b/cmake/admCheckAudioEncoderLibs.cmake @@ -1,209 +1,209 @@ -######################################## -# Aften -######################################## -OPTION(AFTEN "" ON) - -MESSAGE(STATUS "Checking for Aften") -MESSAGE(STATUS "******************") - -IF (AFTEN) - FIND_HEADER_AND_LIB(AFTEN aften/aften.h aften aften_encode_init) - PRINT_LIBRARY_INFO("Aften" AFTEN_FOUND "${AFTEN_INCLUDE_DIR}" "${AFTEN_LIBRARY_DIR}") - - IF (AFTEN_FOUND) - SET(USE_AFTEN True CACHE BOOL "") - SET(TMP_LIBS "${AFTEN_LIBRARY_DIR}") - IF(CROSS) - MESSAGE(WARNING " Cross compiling mode used. Let's assume aften is recent, it might fail at compile time!") - SET(USE_AFTEN True CACHE BOOL "") - ELSE(CROSS) - - IF (NOT DEFINED AFTEN_TEST_RUN_RESULT) - TRY_RUN(AFTEN_TEST_RUN_RESULT - AFTEN_TEST_COMPILE_RESULT - ${CMAKE_BINARY_DIR} - "${CMAKE_CURRENT_SOURCE_DIR}/aften/aften_check.cpp" - CMAKE_FLAGS -DINCLUDE_DIRECTORIES:PATH=${AFTEN_INCLUDE_DIR} -DLINK_LIBRARIES:STRING=${TMP_LIBS} - OUTPUT_VARIABLE AFTEN_OUTPUT) - ENDIF (NOT DEFINED AFTEN_TEST_RUN_RESULT) - #MESSAGE(STATUS " Compile ${AFTEN_TEST_COMPILE_RESULT}, TMP_LIBS=${TMP_LIBS},OUTPUT=${AFTEN_OUTPUT}") - IF( AFTEN_TEST_COMPILE_RESULT ) - IF(AFTEN_TEST_RUN_RESULT EQUAL 99) - MESSAGE(STATUS " version: SVN") - MESSAGE(WARNING " This is a svn version of Aften. We will assume it is compatible with 0.0.8, build may fail") - SET(USE_AFTEN True CACHE BOOL "") - ELSEIF (AFTEN_TEST_RUN_RESULT EQUAL 8) - MESSAGE(STATUS " This is version 0.8 of aften") - SET(USE_AFTEN True CACHE BOOL "") - SET(USE_AFTEN_08 1) - ENDIF(AFTEN_TEST_RUN_RESULT EQUAL 99) - ELSE( AFTEN_TEST_COMPILE_RESULT ) - MESSAGE(STATUS " Cannot compile test program to determine Aften version") - SET(USE_AFTEN 0) - ENDIF( AFTEN_TEST_COMPILE_RESULT ) - ENDIF(CROSS) - ENDIF (AFTEN_FOUND) -ELSE (AFTEN) - MESSAGE("${MSG_DISABLE_OPTION}") -ENDIF (AFTEN) - -APPEND_SUMMARY_LIST("Audio Encoder" "Aften" "${USE_AFTEN}") -MESSAGE("") -######################################## -# TWOLAME -######################################## -OPTION(TWOLAME "" ON) - -MESSAGE(STATUS "Checking for TWOLAME") -MESSAGE(STATUS "*****************") - -IF (TWOLAME) - IF (UNIX) - SET(TWOLAME_REQUIRED_FLAGS "-lm") - ENDIF (UNIX) - - FIND_HEADER_AND_LIB(TWOLAME twolame.h twolame twolame_close ${TWOLAME_REQUIRED_FLAGS}) - PRINT_LIBRARY_INFO("TWOLAME" TWOLAME_FOUND "${TWOLAME_INCLUDE_DIR}" "${TWOLAME_LIBRARY_DIR}") - - IF (TWOLAME_FOUND) - SET(USE_TWOLAME True CACHE BOOL "") - ENDIF (TWOLAME_FOUND) -ELSE (TWOLAME) - MESSAGE("${MSG_DISABLE_OPTION}") -ENDIF (TWOLAME) - -APPEND_SUMMARY_LIST("Audio Encoder" "TWOLAME" "${USE_TWOLAME}") -MESSAGE("") - - -######################################## -# LAME -######################################## -OPTION(LAME "" ON) - -MESSAGE(STATUS "Checking for LAME") -MESSAGE(STATUS "*****************") - -IF (LAME) - IF (UNIX) - SET(LAME_REQUIRED_FLAGS "-lm") - ENDIF (UNIX) - - FIND_HEADER_AND_LIB(LAME lame/lame.h mp3lame lame_init ${LAME_REQUIRED_FLAGS}) - PRINT_LIBRARY_INFO("LAME" LAME_FOUND "${LAME_INCLUDE_DIR}" "${LAME_LIBRARY_DIR}") - - IF (LAME_FOUND) - SET(USE_LAME True CACHE BOOL "") - ENDIF (LAME_FOUND) -ELSE (LAME) - MESSAGE("${MSG_DISABLE_OPTION}") -ENDIF (LAME) - -APPEND_SUMMARY_LIST("Audio Encoder" "LAME" "${USE_LAME}") -MESSAGE("") - -######################################## -# DCAENC -######################################## -OPTION(DCAENC "" ON) - -MESSAGE(STATUS "Checking for DCAENC") -MESSAGE(STATUS "*******************") - -IF (DCAENC) - IF (UNIX) - SET(DCAENC_REQUIRED_FLAGS "-lm") - ENDIF (UNIX) - - FIND_HEADER_AND_LIB(DCAENC dcaenc.h dcaenc dcaenc_create ${DCAENC_REQUIRED_FLAGS}) - PRINT_LIBRARY_INFO("DCAENC" DCAENC_FOUND "${DCAENC_INCLUDE_DIR}" "${DCAENC_LIBRARY_DIR}") - - IF (DCAENC_FOUND) - SET(USE_DCAENC True CACHE BOOL "") - ENDIF (DCAENC_FOUND) -ELSE (DCAENC) - MESSAGE("${MSG_DISABLE_OPTION}") -ENDIF (DCAENC) - -APPEND_SUMMARY_LIST("Audio Encoder" "DCAENC" "${USE_DCAENC}") -MESSAGE("") - - - - -######################################## -# OPUS_ENCODER -######################################## -OPTION(OPUS_ENCODER "" ON) - -MESSAGE(STATUS "Checking for Opus Encoder") -MESSAGE(STATUS "*************************") - -IF (OPUS_ENCODER) - FIND_HEADER_AND_LIB(OPUS_ENC opus/opus.h opus opus_encoder_create) - PRINT_LIBRARY_INFO("OPUS_ENCODER" OPUS_ENC_FOUND "${OPUS_ENC_INCLUDE_DIR}" "${OPUS_ENC_LIBRARY_DIR}") - - IF (OPUS_ENC_FOUND) - SET(USE_OPUS_ENCODER True CACHE BOOL "") - ENDIF (OPUS_ENC_FOUND) -ELSE (OPUS_ENCODER) - MESSAGE("${MSG_DISABLE_OPTION}") -ENDIF (OPUS_ENCODER) - -APPEND_SUMMARY_LIST("Audio Encoder" "Opus" "${USE_OPUS_ENCODER}") -MESSAGE("") - - -######################################## -# FAAC -######################################## -OPTION(FAAC "" ON) - -MESSAGE(STATUS "Checking for FAAC") -MESSAGE(STATUS "*****************") - -IF (FAAC) - FIND_HEADER_AND_LIB(FAAC faac.h faac faacEncClose) - PRINT_LIBRARY_INFO("FAAC" FAAC_FOUND "${FAAC_INCLUDE_DIR}" "${FAAC_LIBRARY_DIR}") - - IF (FAAC_FOUND) - SET(USE_FAAC True CACHE BOOL "") - ENDIF (FAAC_FOUND) -ELSE (FAAC) - MESSAGE("${MSG_DISABLE_OPTION}") -ENDIF (FAAC) - -APPEND_SUMMARY_LIST("Audio Encoder" "FAAC" "${USE_FAAC}") -MESSAGE("") -######################################## -# FDK-AAC -######################################## -include(admCheckFdkAac) -checkFdkAAC() -MESSAGE("") - -######################################## -# Vorbis -######################################## -OPTION(VORBIS "" ON) - -MESSAGE(STATUS "Checking for Vorbis") -MESSAGE(STATUS "*******************") - -IF (VORBIS) - FIND_HEADER_AND_LIB(VORBIS vorbis/vorbisenc.h vorbis vorbis_info_init) - FIND_HEADER_AND_LIB(VORBISENC "" vorbisenc vorbis_encode_init) - - IF (VORBIS_FOUND AND VORBISENC_FOUND) - SET(USE_VORBIS True CACHE BOOL "") - ELSE (VORBIS_FOUND AND VORBISENC_FOUND) - SET(VORBIS_FOUND 0 CACHE INTERNAL "") - ENDIF (VORBIS_FOUND AND VORBISENC_FOUND) - - PRINT_LIBRARY_INFO("Vorbis" VORBIS_FOUND "${VORBIS_INCLUDE_DIR}" "${VORBIS_LIBRARY_DIR} ${VORBISENC_LIBRARY_DIR}") -ELSE (VORBIS) - MESSAGE("${MSG_DISABLE_OPTION}") -ENDIF (VORBIS) - -APPEND_SUMMARY_LIST("Audio Encoder" "Vorbis" "${USE_VORBIS}") -MESSAGE ("") +######################################## +# Aften +######################################## +OPTION(AFTEN "" ON) + +MESSAGE(STATUS "Checking for Aften") +MESSAGE(STATUS "******************") + +IF (AFTEN) + FIND_HEADER_AND_LIB(AFTEN aften/aften.h aften aften_encode_init) + PRINT_LIBRARY_INFO("Aften" AFTEN_FOUND "${AFTEN_INCLUDE_DIR}" "${AFTEN_LIBRARY_DIR}") + + IF (AFTEN_FOUND) + SET(USE_AFTEN True CACHE BOOL "") + SET(TMP_LIBS "${AFTEN_LIBRARY_DIR}") + IF(CROSS) + MESSAGE(WARNING " Cross compiling mode used. Let's assume aften is recent, it might fail at compile time!") + SET(USE_AFTEN True CACHE BOOL "") + ELSE(CROSS) + + IF (NOT DEFINED AFTEN_TEST_RUN_RESULT) + TRY_RUN(AFTEN_TEST_RUN_RESULT + AFTEN_TEST_COMPILE_RESULT + ${CMAKE_BINARY_DIR} + "${CMAKE_CURRENT_SOURCE_DIR}/aften/aften_check.cpp" + CMAKE_FLAGS -DINCLUDE_DIRECTORIES:PATH=${AFTEN_INCLUDE_DIR} -DLINK_LIBRARIES:STRING=${TMP_LIBS} + OUTPUT_VARIABLE AFTEN_OUTPUT) + ENDIF (NOT DEFINED AFTEN_TEST_RUN_RESULT) + #MESSAGE(STATUS " Compile ${AFTEN_TEST_COMPILE_RESULT}, TMP_LIBS=${TMP_LIBS},OUTPUT=${AFTEN_OUTPUT}") + IF( AFTEN_TEST_COMPILE_RESULT ) + IF(AFTEN_TEST_RUN_RESULT EQUAL 99) + MESSAGE(STATUS " version: SVN") + MESSAGE(WARNING " This is a svn version of Aften. We will assume it is compatible with 0.0.8, build may fail") + SET(USE_AFTEN True CACHE BOOL "") + ELSEIF (AFTEN_TEST_RUN_RESULT EQUAL 8) + MESSAGE(STATUS " This is version 0.8 of aften") + SET(USE_AFTEN True CACHE BOOL "") + SET(USE_AFTEN_08 1) + ENDIF(AFTEN_TEST_RUN_RESULT EQUAL 99) + ELSE( AFTEN_TEST_COMPILE_RESULT ) + MESSAGE(STATUS " Cannot compile test program to determine Aften version") + SET(USE_AFTEN 0) + ENDIF( AFTEN_TEST_COMPILE_RESULT ) + ENDIF(CROSS) + ENDIF (AFTEN_FOUND) +ELSE (AFTEN) + MESSAGE("${MSG_DISABLE_OPTION}") +ENDIF (AFTEN) + +APPEND_SUMMARY_LIST("Audio Encoder" "Aften" "${USE_AFTEN}") +MESSAGE("") +######################################## +# TWOLAME +######################################## +OPTION(TWOLAME "" ON) + +MESSAGE(STATUS "Checking for TWOLAME") +MESSAGE(STATUS "*****************") + +IF (TWOLAME) + IF (UNIX) + SET(TWOLAME_REQUIRED_FLAGS "-lm") + ENDIF (UNIX) + + FIND_HEADER_AND_LIB(TWOLAME twolame.h twolame twolame_close ${TWOLAME_REQUIRED_FLAGS}) + PRINT_LIBRARY_INFO("TWOLAME" TWOLAME_FOUND "${TWOLAME_INCLUDE_DIR}" "${TWOLAME_LIBRARY_DIR}") + + IF (TWOLAME_FOUND) + SET(USE_TWOLAME True CACHE BOOL "") + ENDIF (TWOLAME_FOUND) +ELSE (TWOLAME) + MESSAGE("${MSG_DISABLE_OPTION}") +ENDIF (TWOLAME) + +APPEND_SUMMARY_LIST("Audio Encoder" "TWOLAME" "${USE_TWOLAME}") +MESSAGE("") + + +######################################## +# LAME +######################################## +OPTION(LAME "" ON) + +MESSAGE(STATUS "Checking for LAME") +MESSAGE(STATUS "*****************") + +IF (LAME) + IF (UNIX) + SET(LAME_REQUIRED_FLAGS "-lm") + ENDIF (UNIX) + + FIND_HEADER_AND_LIB(LAME lame/lame.h mp3lame lame_init ${LAME_REQUIRED_FLAGS}) + PRINT_LIBRARY_INFO("LAME" LAME_FOUND "${LAME_INCLUDE_DIR}" "${LAME_LIBRARY_DIR}") + + IF (LAME_FOUND) + SET(USE_LAME True CACHE BOOL "") + ENDIF (LAME_FOUND) +ELSE (LAME) + MESSAGE("${MSG_DISABLE_OPTION}") +ENDIF (LAME) + +APPEND_SUMMARY_LIST("Audio Encoder" "LAME" "${USE_LAME}") +MESSAGE("") + +######################################## +# DCAENC +######################################## +OPTION(DCAENC "" ON) + +MESSAGE(STATUS "Checking for DCAENC") +MESSAGE(STATUS "*******************") + +IF (DCAENC) + IF (UNIX) + SET(DCAENC_REQUIRED_FLAGS "-lm") + ENDIF (UNIX) + + FIND_HEADER_AND_LIB(DCAENC dcaenc.h dcaenc dcaenc_create ${DCAENC_REQUIRED_FLAGS}) + PRINT_LIBRARY_INFO("DCAENC" DCAENC_FOUND "${DCAENC_INCLUDE_DIR}" "${DCAENC_LIBRARY_DIR}") + + IF (DCAENC_FOUND) + SET(USE_DCAENC True CACHE BOOL "") + ENDIF (DCAENC_FOUND) +ELSE (DCAENC) + MESSAGE("${MSG_DISABLE_OPTION}") +ENDIF (DCAENC) + +APPEND_SUMMARY_LIST("Audio Encoder" "DCAENC" "${USE_DCAENC}") +MESSAGE("") + + + + +######################################## +# OPUS_ENCODER +######################################## +OPTION(OPUS_ENCODER "" ON) + +MESSAGE(STATUS "Checking for Opus Encoder") +MESSAGE(STATUS "*************************") + +IF (OPUS_ENCODER) + FIND_HEADER_AND_LIB(OPUS_ENC opus/opus.h opus opus_encoder_create) + PRINT_LIBRARY_INFO("OPUS_ENCODER" OPUS_ENC_FOUND "${OPUS_ENC_INCLUDE_DIR}" "${OPUS_ENC_LIBRARY_DIR}") + + IF (OPUS_ENC_FOUND) + SET(USE_OPUS_ENCODER True CACHE BOOL "") + ENDIF (OPUS_ENC_FOUND) +ELSE (OPUS_ENCODER) + MESSAGE("${MSG_DISABLE_OPTION}") +ENDIF (OPUS_ENCODER) + +APPEND_SUMMARY_LIST("Audio Encoder" "Opus" "${USE_OPUS_ENCODER}") +MESSAGE("") + + +######################################## +# FAAC +######################################## +OPTION(FAAC "" ON) + +MESSAGE(STATUS "Checking for FAAC") +MESSAGE(STATUS "*****************") + +IF (FAAC) + FIND_HEADER_AND_LIB(FAAC faac.h faac faacEncClose) + PRINT_LIBRARY_INFO("FAAC" FAAC_FOUND "${FAAC_INCLUDE_DIR}" "${FAAC_LIBRARY_DIR}") + + IF (FAAC_FOUND) + SET(USE_FAAC True CACHE BOOL "") + ENDIF (FAAC_FOUND) +ELSE (FAAC) + MESSAGE("${MSG_DISABLE_OPTION}") +ENDIF (FAAC) + +APPEND_SUMMARY_LIST("Audio Encoder" "FAAC" "${USE_FAAC}") +MESSAGE("") +######################################## +# FDK-AAC +######################################## +include(admCheckFdkAac) +checkFdkAAC() +MESSAGE("") + +######################################## +# Vorbis +######################################## +OPTION(VORBIS "" ON) + +MESSAGE(STATUS "Checking for Vorbis") +MESSAGE(STATUS "*******************") + +IF (VORBIS) + FIND_HEADER_AND_LIB(VORBIS vorbis/vorbisenc.h vorbis vorbis_info_init) + FIND_HEADER_AND_LIB(VORBISENC "" vorbisenc vorbis_encode_init) + + IF (VORBIS_FOUND AND VORBISENC_FOUND) + SET(USE_VORBIS True CACHE BOOL "") + ELSE (VORBIS_FOUND AND VORBISENC_FOUND) + SET(VORBIS_FOUND 0 CACHE INTERNAL "") + ENDIF (VORBIS_FOUND AND VORBISENC_FOUND) + + PRINT_LIBRARY_INFO("Vorbis" VORBIS_FOUND "${VORBIS_INCLUDE_DIR}" "${VORBIS_LIBRARY_DIR} ${VORBISENC_LIBRARY_DIR}") +ELSE (VORBIS) + MESSAGE("${MSG_DISABLE_OPTION}") +ENDIF (VORBIS) + +APPEND_SUMMARY_LIST("Audio Encoder" "Vorbis" "${USE_VORBIS}") +MESSAGE ("") diff --git a/cmake/admCheckFaad.cmake b/cmake/admCheckFaad.cmake index 48194d3c21..15ca186a79 100644 --- a/cmake/admCheckFaad.cmake +++ b/cmake/admCheckFaad.cmake @@ -1,48 +1,48 @@ -# Outputs: -# FAAD_INCLUDE_DIR -# FAAD_LIBRARY_DIR -# FAAD_OLD_PROTOTYPE -# ENV{ADM_HAVE_FAAD} - -MACRO(checkFaad) - IF (NOT FAAD_CHECKED) - OPTION (FAAD "" ON) - - MESSAGE(STATUS "Checking for FAAD") - MESSAGE(STATUS "*****************") - - IF (FAAD) - FIND_HEADER_AND_LIB(FAAD faad.h faad) - - IF (FAAD_FOUND) - ADM_CHECK_FUNCTION_EXISTS(faacDecInit "${FAAD_LIBRARY_DIR}" FAACDEC_FUNCTION_FOUND "" -I"${FAAD_INCLUDE_DIR}") - - IF (NOT FAACDEC_FUNCTION_FOUND) - ADM_CHECK_FUNCTION_EXISTS(NeAACDecInit "${FAAD_LIBRARY_DIR}" NEAACDEC_FUNCTION_FOUND "" -I"${FAAD_INCLUDE_DIR}") - - IF (NOT NEAACDEC_FUNCTION_FOUND) - SET(FAAD_FOUND 0) - ENDIF (NOT NEAACDEC_FUNCTION_FOUND) - ENDIF (NOT FAACDEC_FUNCTION_FOUND) - ENDIF (FAAD_FOUND) - - PRINT_LIBRARY_INFO("FAAD" FAAD_FOUND "${FAAD_INCLUDE_DIR}" "${FAAD_LIBRARY_DIR}") - - IF (FAAD_FOUND) - CHECK_CFLAGS_REQUIRED(faad_check.cpp "-DOLD_FAAD_PROTO" "${FAAD_INCLUDE_DIR}" "${FAAD_LIBRARY_DIR}" FAAD_CFLAGS_REQUIRED) - SET(USE_FAAD True CACHE BOOL "") - IF (FAAD_CFLAGS_REQUIRED) - SET(FAAD_OLD_PROTOTYPE 1) - ENDIF (FAAD_CFLAGS_REQUIRED) - ENDIF (FAAD_FOUND) - ELSE (FAAD) - MESSAGE("${MSG_DISABLE_OPTION}") - ENDIF (FAAD) - - SET(FAAD_CHECKED 1) - - MESSAGE("") - ENDIF (NOT FAAD_CHECKED) - - APPEND_SUMMARY_LIST("Audio Decoder" "FAAD" "${FAAD_FOUND}") -ENDMACRO(checkFaad) +# Outputs: +# FAAD_INCLUDE_DIR +# FAAD_LIBRARY_DIR +# FAAD_OLD_PROTOTYPE +# ENV{ADM_HAVE_FAAD} + +MACRO(checkFaad) + IF (NOT FAAD_CHECKED) + OPTION (FAAD "" ON) + + MESSAGE(STATUS "Checking for FAAD") + MESSAGE(STATUS "*****************") + + IF (FAAD) + FIND_HEADER_AND_LIB(FAAD faad.h faad) + + IF (FAAD_FOUND) + ADM_CHECK_FUNCTION_EXISTS(faacDecInit "${FAAD_LIBRARY_DIR}" FAACDEC_FUNCTION_FOUND "" -I"${FAAD_INCLUDE_DIR}") + + IF (NOT FAACDEC_FUNCTION_FOUND) + ADM_CHECK_FUNCTION_EXISTS(NeAACDecInit "${FAAD_LIBRARY_DIR}" NEAACDEC_FUNCTION_FOUND "" -I"${FAAD_INCLUDE_DIR}") + + IF (NOT NEAACDEC_FUNCTION_FOUND) + SET(FAAD_FOUND 0) + ENDIF (NOT NEAACDEC_FUNCTION_FOUND) + ENDIF (NOT FAACDEC_FUNCTION_FOUND) + ENDIF (FAAD_FOUND) + + PRINT_LIBRARY_INFO("FAAD" FAAD_FOUND "${FAAD_INCLUDE_DIR}" "${FAAD_LIBRARY_DIR}") + + IF (FAAD_FOUND) + CHECK_CFLAGS_REQUIRED(faad_check.cpp "-DOLD_FAAD_PROTO" "${FAAD_INCLUDE_DIR}" "${FAAD_LIBRARY_DIR}" FAAD_CFLAGS_REQUIRED) + SET(USE_FAAD True CACHE BOOL "") + IF (FAAD_CFLAGS_REQUIRED) + SET(FAAD_OLD_PROTOTYPE 1) + ENDIF (FAAD_CFLAGS_REQUIRED) + ENDIF (FAAD_FOUND) + ELSE (FAAD) + MESSAGE("${MSG_DISABLE_OPTION}") + ENDIF (FAAD) + + SET(FAAD_CHECKED 1) + + MESSAGE("") + ENDIF (NOT FAAD_CHECKED) + + APPEND_SUMMARY_LIST("Audio Decoder" "FAAD" "${FAAD_FOUND}") +ENDMACRO(checkFaad) diff --git a/cmake/admCheckFdkAac.cmake b/cmake/admCheckFdkAac.cmake index 35d5e3c6ee..6b5eb9e51b 100644 --- a/cmake/admCheckFdkAac.cmake +++ b/cmake/admCheckFdkAac.cmake @@ -1,36 +1,36 @@ -# Outputs: -# FDK_AAC_INCLUDEDIR -# FDK_AAC_LINK_LIBRARIES -# ENV{ADM_HAVE_FDK_AAC} - -MACRO(checkFdkAAC) - IF (NOT FDK_AAC_CHECKED) - OPTION (FDK_AAC "" ON) - - MESSAGE(STATUS "Checking for FDK_AAC") - MESSAGE(STATUS "*****************") - - IF (FDK_AAC) - #FIND_HEADER_AND_LIB(FDK_AAC fdk-aac/aacenc_lib.h fdk-aac) # Use pkg config ? - PKG_CHECK_MODULES(FDK_AAC fdk-aac) -# DUMP_ALL_VARS() - - IF (FDK_AAC_FOUND) - PRINT_LIBRARY_INFO("FDK_AAC" FDK_AAC_FOUND "${FDK_AAC_INCLUDEDIR}" "${FDK_AAC_LDFLAGS}") - ADM_CHECK_FUNCTION_EXISTS(aacEncOpen "${FDK_AAC_LDFLAGS}" FDK_OPEN_FUNCTION_FOUND "" -I"${FDK_AAC_INCLUDEDIR}") - IF (FDK_OPEN_FUNCTION_FOUND) - SET(FDK_AAC_FOUND 1) - SET(USE_FDK_AAC 1) - ENDIF (FDK_OPEN_FUNCTION_FOUND) - ENDIF (FDK_AAC_FOUND) - ELSE (FDK_AAC) - MESSAGE("${MSG_DISABLE_OPTION}") - ENDIF (FDK_AAC) - - SET(FDK_AAC_CHECKED 1) - - MESSAGE("") - ENDIF (NOT FDK_AAC_CHECKED) - - APPEND_SUMMARY_LIST("Audio Encoder" "FDK_AAC" "${FDK_AAC_FOUND}") -ENDMACRO(checkFdkAAC) +# Outputs: +# FDK_AAC_INCLUDEDIR +# FDK_AAC_LINK_LIBRARIES +# ENV{ADM_HAVE_FDK_AAC} + +MACRO(checkFdkAAC) + IF (NOT FDK_AAC_CHECKED) + OPTION (FDK_AAC "" ON) + + MESSAGE(STATUS "Checking for FDK_AAC") + MESSAGE(STATUS "*****************") + + IF (FDK_AAC) + #FIND_HEADER_AND_LIB(FDK_AAC fdk-aac/aacenc_lib.h fdk-aac) # Use pkg config ? + PKG_CHECK_MODULES(FDK_AAC fdk-aac) +# DUMP_ALL_VARS() + + IF (FDK_AAC_FOUND) + PRINT_LIBRARY_INFO("FDK_AAC" FDK_AAC_FOUND "${FDK_AAC_INCLUDEDIR}" "${FDK_AAC_LDFLAGS}") + ADM_CHECK_FUNCTION_EXISTS(aacEncOpen "${FDK_AAC_LDFLAGS}" FDK_OPEN_FUNCTION_FOUND "" -I"${FDK_AAC_INCLUDEDIR}") + IF (FDK_OPEN_FUNCTION_FOUND) + SET(FDK_AAC_FOUND 1) + SET(USE_FDK_AAC 1) + ENDIF (FDK_OPEN_FUNCTION_FOUND) + ENDIF (FDK_AAC_FOUND) + ELSE (FDK_AAC) + MESSAGE("${MSG_DISABLE_OPTION}") + ENDIF (FDK_AAC) + + SET(FDK_AAC_CHECKED 1) + + MESSAGE("") + ENDIF (NOT FDK_AAC_CHECKED) + + APPEND_SUMMARY_LIST("Audio Encoder" "FDK_AAC" "${FDK_AAC_FOUND}") +ENDMACRO(checkFdkAAC) diff --git a/cmake/admCheckFontConfig.cmake b/cmake/admCheckFontConfig.cmake index 89214150e2..9448c3ce09 100644 --- a/cmake/admCheckFontConfig.cmake +++ b/cmake/admCheckFontConfig.cmake @@ -1,25 +1,25 @@ -MACRO(checkFontConfig) - IF (NOT FONTCONFIG_CHECKED) - OPTION(FONTCONFIG "" ON) - - MESSAGE(STATUS "Checking for FontConfig") - MESSAGE(STATUS "***********************") - - IF (FONTCONFIG) - PKG_CHECK_MODULES(FONTCONFIG fontconfig) - PRINT_LIBRARY_INFO("FontConfig" FONTCONFIG_FOUND "${FONTCONFIG_CFLAGS}" "${FONTCONFIG_LDFLAGS}") - - IF (FONTCONFIG_FOUND) - SET(HAVE_FONTCONFIG 1) - ENDIF (FONTCONFIG_FOUND) - ELSE (FONTCONFIG) - MESSAGE("${MSG_DISABLE_OPTION}") - ENDIF (FONTCONFIG) - - SET(FONTCONFIG_CHECKED 1) - - MESSAGE("") - ENDIF (NOT FONTCONFIG_CHECKED) - - APPEND_SUMMARY_LIST("Miscellaneous" "FontConfig" "${FONTCONFIG_FOUND}") +MACRO(checkFontConfig) + IF (NOT FONTCONFIG_CHECKED) + OPTION(FONTCONFIG "" ON) + + MESSAGE(STATUS "Checking for FontConfig") + MESSAGE(STATUS "***********************") + + IF (FONTCONFIG) + PKG_CHECK_MODULES(FONTCONFIG fontconfig) + PRINT_LIBRARY_INFO("FontConfig" FONTCONFIG_FOUND "${FONTCONFIG_CFLAGS}" "${FONTCONFIG_LDFLAGS}") + + IF (FONTCONFIG_FOUND) + SET(HAVE_FONTCONFIG 1) + ENDIF (FONTCONFIG_FOUND) + ELSE (FONTCONFIG) + MESSAGE("${MSG_DISABLE_OPTION}") + ENDIF (FONTCONFIG) + + SET(FONTCONFIG_CHECKED 1) + + MESSAGE("") + ENDIF (NOT FONTCONFIG_CHECKED) + + APPEND_SUMMARY_LIST("Miscellaneous" "FontConfig" "${FONTCONFIG_FOUND}") ENDMACRO(checkFontConfig) \ No newline at end of file diff --git a/cmake/admCheckFreeType.cmake b/cmake/admCheckFreeType.cmake index 69352f1d56..e118e50698 100644 --- a/cmake/admCheckFreeType.cmake +++ b/cmake/admCheckFreeType.cmake @@ -1,59 +1,59 @@ -MACRO(checkFreeType) -######################################## -# FreeType2 -######################################## -OPTION(FREETYPE2 "" ON) - -MESSAGE(STATUS "Checking for FreeType2") -MESSAGE(STATUS "**********************") - -IF (FREETYPE2) - PKG_CHECK_MODULES(FREETYPE2 freetype2) - PRINT_LIBRARY_INFO("FreeType2" FREETYPE2_FOUND "${FREETYPE2_CFLAGS}" "${FREETYPE2_LDFLAGS}") - - IF (FREETYPE2_FOUND) - SET(USE_FREETYPE 1) - ENDIF (FREETYPE2_FOUND) -ELSE (FREETYPE2) - MESSAGE("${MSG_DISABLE_OPTION}") -ENDIF (FREETYPE2) - -APPEND_SUMMARY_LIST("Miscellaneous" "FreeType2" "${FREETYPE2_FOUND}") - -MESSAGE("") - -######################################## -# libiconv -######################################## -IF (USE_FREETYPE) - MESSAGE(STATUS "Checking for libiconv") - MESSAGE(STATUS "*********************") - - FIND_HEADER_AND_LIB(LIBICONV iconv.h iconv) - PRINT_LIBRARY_INFO("libiconv" LIBICONV_FOUND "${LIBICONV_INCLUDE_DIR}" "${LIBICONV_LIBRARY_DIR}") - - IF (NOT LIBICONV_INCLUDE_DIR) - MESSAGE(STATUS "iconv.h not found, disabling FreeType2") - SET(USE_FREETYPE) - ELSE (NOT LIBICONV_INCLUDE_DIR) - IF (LIBICONV_LIBRARY_DIR) - MESSAGE(STATUS "libiconv is probably needed") - - CHECK_CFLAGS_REQUIRED(iconv_check.cpp "-DICONV_NEED_CONST" "${LIBICONV_INCLUDE_DIR}" "${LIBICONV_LIBRARY_DIR}" LIBICONV_CFLAGS_REQUIRED) - ELSE (LIBICONV_LIBRARY_DIR) - SET(LIBICONV_LIBRARY_DIR "") - MESSAGE(STATUS "libiconv is probably not needed") - - ADM_COMPILE(iconv_check.cpp "-DICONV_NEED_CONST" "${LIBICONV_INCLUDE_DIR}" "" LIBICONV_CFLAGS_REQUIRED LIBICONV_COMPILE_OUTPUT) - ENDIF (LIBICONV_LIBRARY_DIR) - - IF (LIBICONV_CFLAGS_REQUIRED) - SET(LIBICONV_DEFINITIONS "-DICONV_NEED_CONST") - SET(ICONV_NEED_CONST 1) - ENDIF(LIBICONV_CFLAGS_REQUIRED) - ENDIF (NOT LIBICONV_INCLUDE_DIR) - - MESSAGE("") -ENDIF (USE_FREETYPE) - -ENDMACRO(checkFreeType) +MACRO(checkFreeType) +######################################## +# FreeType2 +######################################## +OPTION(FREETYPE2 "" ON) + +MESSAGE(STATUS "Checking for FreeType2") +MESSAGE(STATUS "**********************") + +IF (FREETYPE2) + PKG_CHECK_MODULES(FREETYPE2 freetype2) + PRINT_LIBRARY_INFO("FreeType2" FREETYPE2_FOUND "${FREETYPE2_CFLAGS}" "${FREETYPE2_LDFLAGS}") + + IF (FREETYPE2_FOUND) + SET(USE_FREETYPE 1) + ENDIF (FREETYPE2_FOUND) +ELSE (FREETYPE2) + MESSAGE("${MSG_DISABLE_OPTION}") +ENDIF (FREETYPE2) + +APPEND_SUMMARY_LIST("Miscellaneous" "FreeType2" "${FREETYPE2_FOUND}") + +MESSAGE("") + +######################################## +# libiconv +######################################## +IF (USE_FREETYPE) + MESSAGE(STATUS "Checking for libiconv") + MESSAGE(STATUS "*********************") + + FIND_HEADER_AND_LIB(LIBICONV iconv.h iconv) + PRINT_LIBRARY_INFO("libiconv" LIBICONV_FOUND "${LIBICONV_INCLUDE_DIR}" "${LIBICONV_LIBRARY_DIR}") + + IF (NOT LIBICONV_INCLUDE_DIR) + MESSAGE(STATUS "iconv.h not found, disabling FreeType2") + SET(USE_FREETYPE) + ELSE (NOT LIBICONV_INCLUDE_DIR) + IF (LIBICONV_LIBRARY_DIR) + MESSAGE(STATUS "libiconv is probably needed") + + CHECK_CFLAGS_REQUIRED(iconv_check.cpp "-DICONV_NEED_CONST" "${LIBICONV_INCLUDE_DIR}" "${LIBICONV_LIBRARY_DIR}" LIBICONV_CFLAGS_REQUIRED) + ELSE (LIBICONV_LIBRARY_DIR) + SET(LIBICONV_LIBRARY_DIR "") + MESSAGE(STATUS "libiconv is probably not needed") + + ADM_COMPILE(iconv_check.cpp "-DICONV_NEED_CONST" "${LIBICONV_INCLUDE_DIR}" "" LIBICONV_CFLAGS_REQUIRED LIBICONV_COMPILE_OUTPUT) + ENDIF (LIBICONV_LIBRARY_DIR) + + IF (LIBICONV_CFLAGS_REQUIRED) + SET(LIBICONV_DEFINITIONS "-DICONV_NEED_CONST") + SET(ICONV_NEED_CONST 1) + ENDIF(LIBICONV_CFLAGS_REQUIRED) + ENDIF (NOT LIBICONV_INCLUDE_DIR) + + MESSAGE("") +ENDIF (USE_FREETYPE) + +ENDMACRO(checkFreeType) diff --git a/cmake/admCheckFtello.cmake b/cmake/admCheckFtello.cmake index f8b5b3ed08..6c8ea04390 100644 --- a/cmake/admCheckFtello.cmake +++ b/cmake/admCheckFtello.cmake @@ -1,24 +1,24 @@ -MACRO(checkFtello) - IF (NOT FTELLO_CHECKED) - OPTION(FTELLO "" ON) - - MESSAGE(STATUS "Checking for ftello ") - MESSAGE(STATUS "********************") - - IF (FTELLO) - ADM_COMPILE(ftello.cpp "" "" "" GOT_FTELLO outputWithoutLibintl) - - IF (GOT_FTELLO) - SET(USE_FTELLO 1) - MESSAGE(STATUS "ftello present") - ELSE (GOT_FTELLO) - SET(USE_FTELLO 0) - MESSAGE(STATUS "ftello NOT present") - ENDIF (GOT_FTELLO) - ELSE (FTELLO) - MESSAGE("${MSG_DISABLE_OPTION}") - ENDIF (FTELLO) - SET(FTELLO_CHECKED 1) - MESSAGE("") - ENDIF (NOT FTELLO_CHECKED) -ENDMACRO(checkFtello) +MACRO(checkFtello) + IF (NOT FTELLO_CHECKED) + OPTION(FTELLO "" ON) + + MESSAGE(STATUS "Checking for ftello ") + MESSAGE(STATUS "********************") + + IF (FTELLO) + ADM_COMPILE(ftello.cpp "" "" "" GOT_FTELLO outputWithoutLibintl) + + IF (GOT_FTELLO) + SET(USE_FTELLO 1) + MESSAGE(STATUS "ftello present") + ELSE (GOT_FTELLO) + SET(USE_FTELLO 0) + MESSAGE(STATUS "ftello NOT present") + ENDIF (GOT_FTELLO) + ELSE (FTELLO) + MESSAGE("${MSG_DISABLE_OPTION}") + ENDIF (FTELLO) + SET(FTELLO_CHECKED 1) + MESSAGE("") + ENDIF (NOT FTELLO_CHECKED) +ENDMACRO(checkFtello) diff --git a/cmake/admCheckGettext.cmake b/cmake/admCheckGettext.cmake index 8939292514..70055818d6 100644 --- a/cmake/admCheckGettext.cmake +++ b/cmake/admCheckGettext.cmake @@ -1,52 +1,52 @@ -MACRO(checkGettext) - IF (NOT GETTEXT_CHECKED) - OPTION(GETTEXT "" ON) - - MESSAGE(STATUS "Checking for gettext") - MESSAGE(STATUS "********************") - - IF (GETTEXT) - FIND_HEADER_AND_LIB(GETTEXT libintl.h intl) - PRINT_LIBRARY_INFO("Gettext" GETTEXT_FOUND "${GETTEXT_INCLUDE_DIR}" "${GETTEXT_LIBRARY_DIR}") - - IF (GETTEXT_INCLUDE_DIR) - # Try linking without -lintl - ADM_COMPILE(gettext.cpp "" "${GETTEXT_INCLUDE_DIR}" "" LIBINTL_NOT_REQUIRED outputWithoutLibintl) - - IF (LIBINTL_NOT_REQUIRED) - SET(GETTEXT_LIBRARY_DIR "") - SET(HAVE_GETTEXT 1) - - MESSAGE(STATUS "libintl not required for gettext support") - ELSE (LIBINTL_NOT_REQUIRED) - ADM_COMPILE(gettext.cpp "" "${GETTEXT_INCLUDE_DIR}" "${GETTEXT_LIBRARY_DIR}" LIBINTL_REQUIRED outputWithLibintl) - - IF (LIBINTL_REQUIRED) - SET(HAVE_GETTEXT 1) - - MESSAGE(STATUS "libintl required for gettext support") - ELSE (LIBINTL_REQUIRED) - SET(GETTEXT_FOUND 0 CACHE INTERNAL "") - - MESSAGE("gettext support failed with or without libintl") - - IF (VERBOSE) - MESSAGE(STATUS "Compilation error with libintl:") - MESSAGE(STATUS ${outputWithLibintl}) - - MESSAGE(STATUS "Compilation error without libintl:") - MESSAGE(STATUS ${outputWithoutLibintl}) - ENDIF (VERBOSE) - ENDIF (LIBINTL_REQUIRED) - ENDIF (LIBINTL_NOT_REQUIRED) - ENDIF (GETTEXT_INCLUDE_DIR) - ELSE (GETTEXT) - MESSAGE("${MSG_DISABLE_OPTION}") - ENDIF (GETTEXT) - - SET(GETTEXT_CHECKED 1) - MESSAGE("") - ENDIF (NOT GETTEXT_CHECKED) - - APPEND_SUMMARY_LIST("Miscellaneous" "gettext" "${HAVE_GETTEXT}") +MACRO(checkGettext) + IF (NOT GETTEXT_CHECKED) + OPTION(GETTEXT "" ON) + + MESSAGE(STATUS "Checking for gettext") + MESSAGE(STATUS "********************") + + IF (GETTEXT) + FIND_HEADER_AND_LIB(GETTEXT libintl.h intl) + PRINT_LIBRARY_INFO("Gettext" GETTEXT_FOUND "${GETTEXT_INCLUDE_DIR}" "${GETTEXT_LIBRARY_DIR}") + + IF (GETTEXT_INCLUDE_DIR) + # Try linking without -lintl + ADM_COMPILE(gettext.cpp "" "${GETTEXT_INCLUDE_DIR}" "" LIBINTL_NOT_REQUIRED outputWithoutLibintl) + + IF (LIBINTL_NOT_REQUIRED) + SET(GETTEXT_LIBRARY_DIR "") + SET(HAVE_GETTEXT 1) + + MESSAGE(STATUS "libintl not required for gettext support") + ELSE (LIBINTL_NOT_REQUIRED) + ADM_COMPILE(gettext.cpp "" "${GETTEXT_INCLUDE_DIR}" "${GETTEXT_LIBRARY_DIR}" LIBINTL_REQUIRED outputWithLibintl) + + IF (LIBINTL_REQUIRED) + SET(HAVE_GETTEXT 1) + + MESSAGE(STATUS "libintl required for gettext support") + ELSE (LIBINTL_REQUIRED) + SET(GETTEXT_FOUND 0 CACHE INTERNAL "") + + MESSAGE("gettext support failed with or without libintl") + + IF (VERBOSE) + MESSAGE(STATUS "Compilation error with libintl:") + MESSAGE(STATUS ${outputWithLibintl}) + + MESSAGE(STATUS "Compilation error without libintl:") + MESSAGE(STATUS ${outputWithoutLibintl}) + ENDIF (VERBOSE) + ENDIF (LIBINTL_REQUIRED) + ENDIF (LIBINTL_NOT_REQUIRED) + ENDIF (GETTEXT_INCLUDE_DIR) + ELSE (GETTEXT) + MESSAGE("${MSG_DISABLE_OPTION}") + ENDIF (GETTEXT) + + SET(GETTEXT_CHECKED 1) + MESSAGE("") + ENDIF (NOT GETTEXT_CHECKED) + + APPEND_SUMMARY_LIST("Miscellaneous" "gettext" "${HAVE_GETTEXT}") ENDMACRO(checkGettext) \ No newline at end of file diff --git a/cmake/admCheckGtk.cmake b/cmake/admCheckGtk.cmake index c471aa579d..83ded22fd8 100644 --- a/cmake/admCheckGtk.cmake +++ b/cmake/admCheckGtk.cmake @@ -1,63 +1,63 @@ -MACRO(checkGtk) - IF (NOT GTK_CHECKED) - OPTION(GTK "" ON) - - MESSAGE(STATUS "Checking for GTK+") - MESSAGE(STATUS "*****************") - - IF (GTK) - PKG_CHECK_MODULES(PIXBUF gdk-pixbuf-2.0) - PRINT_LIBRARY_INFO("GdkPixBuf" PIXBUF_FOUND "${PIXBUF_CFLAGS}" "${PIXBUF_LDFLAGS}") - - if (NOT PIXBUF_FOUND) - MESSAGE(STATUS "gdk-pixbuf not found") - set(GTK_FOUND false) - endif (NOT PIXBUF_FOUND) - - PKG_CHECK_MODULES(GTK gtk+-3.0) - PRINT_LIBRARY_INFO("GTK+" GTK_FOUND "${GTK_CFLAGS}" "${GTK_LDFLAGS}") - MESSAGE("") - - IF (GTK_FOUND) - ADM_COMPILE(gtk_x11_check.cpp "${GTK_CFLAGS}" "" "${GTK_LDFLAGS}" GTK_X11_SUPPORTED outputGtkX11Test) - - IF (GTK_X11_SUPPORTED) - SET(HAVE_GTK_X11 1) - - MESSAGE(STATUS "GTK+ uses X11") - ELSE (GTK_X11_SUPPORTED) - MESSAGE(STATUS "GTK+ doesn't use X11") - - IF (VERBOSE) - MESSAGE("Error Message: ${outputGtkX11Test}") - ENDIF (VERBOSE) - ENDIF (GTK_X11_SUPPORTED) - - SET(GTK_CFLAGS ${GTK_CFLAGS} ${PIXBUF_CFLAGS}) - SET(GTK_LDFLAGS ${GTK_LDFLAGS} ${PIXBUF_LDFLAGS}) - MESSAGE("") - ENDIF (GTK_FOUND) - ELSE (GTK) - MESSAGE("${MSG_DISABLE_OPTION}") - MESSAGE("") - ENDIF (GTK) - - MESSAGE(STATUS "Checking for GThread") - MESSAGE(STATUS "********************") - - IF (GTK) - PKG_CHECK_MODULES(GTHREAD gthread-2.0) - PRINT_LIBRARY_INFO("GThread" GTHREAD_FOUND "${GTHREAD_CFLAGS}" "${GTHREAD_LDFLAGS}") - - IF (NOT GTHREAD_FOUND) - MESSAGE(STATUS "Could not find GThread") - ENDIF(NOT GTHREAD_FOUND) - ELSE (GTK) - MESSAGE("${MSG_DISABLE_OPTION}") - ENDIF (GTK) - - SET(GTK_CHECKED 1) - - MESSAGE("") - ENDIF (NOT GTK_CHECKED) +MACRO(checkGtk) + IF (NOT GTK_CHECKED) + OPTION(GTK "" ON) + + MESSAGE(STATUS "Checking for GTK+") + MESSAGE(STATUS "*****************") + + IF (GTK) + PKG_CHECK_MODULES(PIXBUF gdk-pixbuf-2.0) + PRINT_LIBRARY_INFO("GdkPixBuf" PIXBUF_FOUND "${PIXBUF_CFLAGS}" "${PIXBUF_LDFLAGS}") + + if (NOT PIXBUF_FOUND) + MESSAGE(STATUS "gdk-pixbuf not found") + set(GTK_FOUND false) + endif (NOT PIXBUF_FOUND) + + PKG_CHECK_MODULES(GTK gtk+-3.0) + PRINT_LIBRARY_INFO("GTK+" GTK_FOUND "${GTK_CFLAGS}" "${GTK_LDFLAGS}") + MESSAGE("") + + IF (GTK_FOUND) + ADM_COMPILE(gtk_x11_check.cpp "${GTK_CFLAGS}" "" "${GTK_LDFLAGS}" GTK_X11_SUPPORTED outputGtkX11Test) + + IF (GTK_X11_SUPPORTED) + SET(HAVE_GTK_X11 1) + + MESSAGE(STATUS "GTK+ uses X11") + ELSE (GTK_X11_SUPPORTED) + MESSAGE(STATUS "GTK+ doesn't use X11") + + IF (VERBOSE) + MESSAGE("Error Message: ${outputGtkX11Test}") + ENDIF (VERBOSE) + ENDIF (GTK_X11_SUPPORTED) + + SET(GTK_CFLAGS ${GTK_CFLAGS} ${PIXBUF_CFLAGS}) + SET(GTK_LDFLAGS ${GTK_LDFLAGS} ${PIXBUF_LDFLAGS}) + MESSAGE("") + ENDIF (GTK_FOUND) + ELSE (GTK) + MESSAGE("${MSG_DISABLE_OPTION}") + MESSAGE("") + ENDIF (GTK) + + MESSAGE(STATUS "Checking for GThread") + MESSAGE(STATUS "********************") + + IF (GTK) + PKG_CHECK_MODULES(GTHREAD gthread-2.0) + PRINT_LIBRARY_INFO("GThread" GTHREAD_FOUND "${GTHREAD_CFLAGS}" "${GTHREAD_LDFLAGS}") + + IF (NOT GTHREAD_FOUND) + MESSAGE(STATUS "Could not find GThread") + ENDIF(NOT GTHREAD_FOUND) + ELSE (GTK) + MESSAGE("${MSG_DISABLE_OPTION}") + ENDIF (GTK) + + SET(GTK_CHECKED 1) + + MESSAGE("") + ENDIF (NOT GTK_CHECKED) ENDMACRO(checkGtk) \ No newline at end of file diff --git a/cmake/admCheckLibxml2.cmake b/cmake/admCheckLibxml2.cmake index bbeae833bc..ce928b3341 100644 --- a/cmake/admCheckLibxml2.cmake +++ b/cmake/admCheckLibxml2.cmake @@ -1,27 +1,27 @@ -MACRO(checkLibxml2) - IF (NOT LIBXML2_CHECKED) - MESSAGE(STATUS "Checking for Libxml2") - MESSAGE(STATUS "********************") - - SET(LibXml2_FIND_QUIETLY TRUE) - - if(CROSS) - MESSAGE(STATUS "Xml2: Cross compilation override") - SET(WIN32 0) - endif(CROSS) - - FIND_PACKAGE(LibXml2) - - if(CROSS) - MESSAGE(STATUS "Cross : Xml2: ${LIBXML2_FOUND} lib:${LIBXML2_LIBRARIES} inc:${LIBXML2_INCLUDE_DIR} ") - SET(LIBXML2_LIBRARIES "-lxml2 -L${CROSS}/lib") - SET(WIN32 1) - endif(CROSS) - - PRINT_LIBRARY_INFO("Libxml2" LIBXML2_FOUND "${LIBXML2_INCLUDE_DIR} ${LIBXML2_DEFINITIONS}" "${LIBXML2_LIBRARIES}") - - SET(LIBXML2_CHECKED 1) - - MESSAGE("") - ENDIF (NOT LIBXML2_CHECKED) -ENDMACRO(checkLibxml2) +MACRO(checkLibxml2) + IF (NOT LIBXML2_CHECKED) + MESSAGE(STATUS "Checking for Libxml2") + MESSAGE(STATUS "********************") + + SET(LibXml2_FIND_QUIETLY TRUE) + + if(CROSS) + MESSAGE(STATUS "Xml2: Cross compilation override") + SET(WIN32 0) + endif(CROSS) + + FIND_PACKAGE(LibXml2) + + if(CROSS) + MESSAGE(STATUS "Cross : Xml2: ${LIBXML2_FOUND} lib:${LIBXML2_LIBRARIES} inc:${LIBXML2_INCLUDE_DIR} ") + SET(LIBXML2_LIBRARIES "-lxml2 -L${CROSS}/lib") + SET(WIN32 1) + endif(CROSS) + + PRINT_LIBRARY_INFO("Libxml2" LIBXML2_FOUND "${LIBXML2_INCLUDE_DIR} ${LIBXML2_DEFINITIONS}" "${LIBXML2_LIBRARIES}") + + SET(LIBXML2_CHECKED 1) + + MESSAGE("") + ENDIF (NOT LIBXML2_CHECKED) +ENDMACRO(checkLibxml2) diff --git a/cmake/admCheckMiscLibs.cmake b/cmake/admCheckMiscLibs.cmake index 4dcdc649c9..01a0539590 100644 --- a/cmake/admCheckMiscLibs.cmake +++ b/cmake/admCheckMiscLibs.cmake @@ -1,98 +1,98 @@ -######################################## -# gettext -######################################## -INCLUDE(admCheckGettext) - -if (NOT CROSS) - checkGettext() -endif (NOT CROSS) - -SET(ADM_LOCALE "${CMAKE_INSTALL_PREFIX}/share/locale") - -######################################## -# SDL -######################################## -OPTION(SDL "" ON) - -MESSAGE(STATUS "Checking for SDL>=2 (only for windows)") -MESSAGE(STATUS "**************************************") - -IF (SDL AND WIN32) - FIND_PACKAGE(SDL2) - PRINT_LIBRARY_INFO("SDL2" SDL2_FOUND "${SDL2_INCLUDE_DIR}" "${SDL2_LIBRARY}") - - MARK_AS_ADVANCED(SDLMAIN_LIBRARY) - MARK_AS_ADVANCED(SDL2_INCLUDE_DIR) - MARK_AS_ADVANCED(SDL2_LIBRARY) - - IF (SDL2_FOUND) - SET(USE_SDL 1) - ENDIF (SDL2_FOUND) -ELSE (SDL AND WIN32) - MESSAGE("${MSG_DISABLE_OPTION}") -ENDIF (SDL AND WIN32) - -APPEND_SUMMARY_LIST("Miscellaneous" "SDL" "${USE_SDL}") - -MESSAGE("") - -######################################## -# XVideo -######################################## -IF (UNIX AND NOT APPLE) - OPTION(XVIDEO "" ON) - - IF (XVIDEO) - MESSAGE(STATUS "Checking for XVideo") - MESSAGE(STATUS "*******************") - - FIND_HEADER_AND_LIB(XVIDEO X11/extensions/Xvlib.h Xv XvShmPutImage) - FIND_HEADER_AND_LIB(XEXT X11/extensions/XShm.h Xext XShmAttach) - PRINT_LIBRARY_INFO("XVideo" XVIDEO_FOUND "${XVIDEO_INCLUDE_DIR}" "${XVIDEO_LIBRARY_DIR}") - PRINT_LIBRARY_INFO("Xext" XEXT_FOUND "${XEXT_INCLUDE_DIR}" "${XEXT_LIBRARY_DIR}") - - IF (XVIDEO_FOUND AND XEXT_FOUND) - SET(USE_XV 1) - ENDIF (XVIDEO_FOUND AND XEXT_FOUND) - - MESSAGE("") - ENDIF (XVIDEO) - - APPEND_SUMMARY_LIST("Miscellaneous" "XVideo" "${XVIDEO_FOUND}") -ELSE (UNIX AND NOT APPLE) - SET(XVIDEO_CAPABLE FALSE) -ENDIF (UNIX AND NOT APPLE) - -######################################## -# Execinfo -######################################## -MESSAGE(STATUS "Checking for execinfo") -MESSAGE(STATUS "*********************") - -FIND_HEADER_AND_LIB(EXECINFO execinfo.h c backtrace_symbols) -PRINT_LIBRARY_INFO("execinfo" EXECINFO_FOUND "${EXECINFO_INCLUDE_DIR}" "${EXECINFO_LIBRARY_DIR}") - -IF (EXECINFO_INCLUDE_DIR) - # Try linking without -lexecinfo - ADM_COMPILE(execinfo.cpp "" ${EXECINFO_INCLUDE_DIR} "" WITHOUT_LIBEXECINFO outputWithoutLibexecinfo) - - IF (WITHOUT_LIBEXECINFO) - SET(EXECINFO_LIBRARY_DIR "") - SET(HAVE_EXECINFO 1) - - MESSAGE(STATUS "execinfo not required") - ELSE (WITHOUT_LIBEXECINFO) - ADM_COMPILE(execinfo.cpp "" ${EXECINFO_INCLUDE_DIR} ${EXECINFO_LIBRARY_DIR} WITH_LIBEXECINFO outputWithLibexecinfo) - - IF (WITH_LIBEXECINFO) - SET(HAVE_EXECINFO 1) - - MESSAGE(STATUS "execinfo is required") - ELSE (WITH_LIBEXECINFO) - MESSAGE(STATUS "Does not work, without ${outputWithoutLibexecinfo}") - MESSAGE(STATUS "Does not work, with ${outputWithLibexecinfo}") - ENDIF (WITH_LIBEXECINFO) - ENDIF (WITHOUT_LIBEXECINFO) -ENDIF (EXECINFO_INCLUDE_DIR) - -MESSAGE("") +######################################## +# gettext +######################################## +INCLUDE(admCheckGettext) + +if (NOT CROSS) + checkGettext() +endif (NOT CROSS) + +SET(ADM_LOCALE "${CMAKE_INSTALL_PREFIX}/share/locale") + +######################################## +# SDL +######################################## +OPTION(SDL "" ON) + +MESSAGE(STATUS "Checking for SDL>=2 (only for windows)") +MESSAGE(STATUS "**************************************") + +IF (SDL AND WIN32) + FIND_PACKAGE(SDL2) + PRINT_LIBRARY_INFO("SDL2" SDL2_FOUND "${SDL2_INCLUDE_DIR}" "${SDL2_LIBRARY}") + + MARK_AS_ADVANCED(SDLMAIN_LIBRARY) + MARK_AS_ADVANCED(SDL2_INCLUDE_DIR) + MARK_AS_ADVANCED(SDL2_LIBRARY) + + IF (SDL2_FOUND) + SET(USE_SDL 1) + ENDIF (SDL2_FOUND) +ELSE (SDL AND WIN32) + MESSAGE("${MSG_DISABLE_OPTION}") +ENDIF (SDL AND WIN32) + +APPEND_SUMMARY_LIST("Miscellaneous" "SDL" "${USE_SDL}") + +MESSAGE("") + +######################################## +# XVideo +######################################## +IF (UNIX AND NOT APPLE) + OPTION(XVIDEO "" ON) + + IF (XVIDEO) + MESSAGE(STATUS "Checking for XVideo") + MESSAGE(STATUS "*******************") + + FIND_HEADER_AND_LIB(XVIDEO X11/extensions/Xvlib.h Xv XvShmPutImage) + FIND_HEADER_AND_LIB(XEXT X11/extensions/XShm.h Xext XShmAttach) + PRINT_LIBRARY_INFO("XVideo" XVIDEO_FOUND "${XVIDEO_INCLUDE_DIR}" "${XVIDEO_LIBRARY_DIR}") + PRINT_LIBRARY_INFO("Xext" XEXT_FOUND "${XEXT_INCLUDE_DIR}" "${XEXT_LIBRARY_DIR}") + + IF (XVIDEO_FOUND AND XEXT_FOUND) + SET(USE_XV 1) + ENDIF (XVIDEO_FOUND AND XEXT_FOUND) + + MESSAGE("") + ENDIF (XVIDEO) + + APPEND_SUMMARY_LIST("Miscellaneous" "XVideo" "${XVIDEO_FOUND}") +ELSE (UNIX AND NOT APPLE) + SET(XVIDEO_CAPABLE FALSE) +ENDIF (UNIX AND NOT APPLE) + +######################################## +# Execinfo +######################################## +MESSAGE(STATUS "Checking for execinfo") +MESSAGE(STATUS "*********************") + +FIND_HEADER_AND_LIB(EXECINFO execinfo.h c backtrace_symbols) +PRINT_LIBRARY_INFO("execinfo" EXECINFO_FOUND "${EXECINFO_INCLUDE_DIR}" "${EXECINFO_LIBRARY_DIR}") + +IF (EXECINFO_INCLUDE_DIR) + # Try linking without -lexecinfo + ADM_COMPILE(execinfo.cpp "" ${EXECINFO_INCLUDE_DIR} "" WITHOUT_LIBEXECINFO outputWithoutLibexecinfo) + + IF (WITHOUT_LIBEXECINFO) + SET(EXECINFO_LIBRARY_DIR "") + SET(HAVE_EXECINFO 1) + + MESSAGE(STATUS "execinfo not required") + ELSE (WITHOUT_LIBEXECINFO) + ADM_COMPILE(execinfo.cpp "" ${EXECINFO_INCLUDE_DIR} ${EXECINFO_LIBRARY_DIR} WITH_LIBEXECINFO outputWithLibexecinfo) + + IF (WITH_LIBEXECINFO) + SET(HAVE_EXECINFO 1) + + MESSAGE(STATUS "execinfo is required") + ELSE (WITH_LIBEXECINFO) + MESSAGE(STATUS "Does not work, without ${outputWithoutLibexecinfo}") + MESSAGE(STATUS "Does not work, with ${outputWithLibexecinfo}") + ENDIF (WITH_LIBEXECINFO) + ENDIF (WITHOUT_LIBEXECINFO) +ENDIF (EXECINFO_INCLUDE_DIR) + +MESSAGE("") diff --git a/cmake/admCheckOpus.cmake b/cmake/admCheckOpus.cmake index 937f20d0bd..911c8fbe2c 100644 --- a/cmake/admCheckOpus.cmake +++ b/cmake/admCheckOpus.cmake @@ -1,23 +1,23 @@ -MACRO(checkOpusDec) - IF (NOT OPUS_CHECKED) - OPTION(OPUS "" ON) - - MESSAGE(STATUS "Checking for OPUS") - MESSAGE(STATUS "*****************") - - IF (OPUS) - FIND_HEADER_AND_LIB(LIBOPUS opus/opus_multistream.h opus opus_multistream_decoder_init ${LIBOPUS_REQUIRED_FLAGS}) - IF (LIBOPUS_FOUND) - SET(LIBOPUS_FOUND 1) - SET(USE_LIBOPUS True CACHE BOOL "") - SET(LIBOPUS_INCLUDE_DIR "${LIBOPUS_INCLUDE_DIR}") - SET(LIBOPUS_LIBRARY_DIR "${LIBOPUS_LIBRARY_DIR}") - ENDIF (LIBOPUS_FOUND) - - PRINT_LIBRARY_INFO("LIBOPUS" LIBOPUS_FOUND "${LIBOPUS_INCLUDE_DIR}" "${LIBOPUS_LIBRARY_DIR}") - ELSE (OPUS) - MESSAGE("${MSG_DISABLE_OPTION}") - ENDIF (OPUS) - ENDIF (NOT OPUS_CHECKED) - APPEND_SUMMARY_LIST("Audio Decoder" "Opus" "${LIBOPUS_FOUND}") -ENDMACRO(checkOpusDec) +MACRO(checkOpusDec) + IF (NOT OPUS_CHECKED) + OPTION(OPUS "" ON) + + MESSAGE(STATUS "Checking for OPUS") + MESSAGE(STATUS "*****************") + + IF (OPUS) + FIND_HEADER_AND_LIB(LIBOPUS opus/opus_multistream.h opus opus_multistream_decoder_init ${LIBOPUS_REQUIRED_FLAGS}) + IF (LIBOPUS_FOUND) + SET(LIBOPUS_FOUND 1) + SET(USE_LIBOPUS True CACHE BOOL "") + SET(LIBOPUS_INCLUDE_DIR "${LIBOPUS_INCLUDE_DIR}") + SET(LIBOPUS_LIBRARY_DIR "${LIBOPUS_LIBRARY_DIR}") + ENDIF (LIBOPUS_FOUND) + + PRINT_LIBRARY_INFO("LIBOPUS" LIBOPUS_FOUND "${LIBOPUS_INCLUDE_DIR}" "${LIBOPUS_LIBRARY_DIR}") + ELSE (OPUS) + MESSAGE("${MSG_DISABLE_OPTION}") + ENDIF (OPUS) + ENDIF (NOT OPUS_CHECKED) + APPEND_SUMMARY_LIST("Audio Decoder" "Opus" "${LIBOPUS_FOUND}") +ENDMACRO(checkOpusDec) diff --git a/cmake/admCheckQt4.cmake b/cmake/admCheckQt4.cmake index 2aa383c15e..47bb098630 100644 --- a/cmake/admCheckQt4.cmake +++ b/cmake/admCheckQt4.cmake @@ -1,89 +1,89 @@ -MACRO(checkQt4) - IF (NOT QT4_CHECKED) - OPTION(QT4 "" ON) - - MESSAGE(STATUS "Checking for Qt 4") - MESSAGE(STATUS "*****************") - IF(CROSS) - MESSAGE(STATUS "Cross compiling override for QT4") - IF(APPLE) - SET(QT_VERSION_MINOR 6) - SET(QT_INCLUDE_DIR "/opt/mac/SDKs/MacOSX10.6.sdk/Library/Frameworks/") - SET(QT_INCLUDE_DIR ${QT_INCLUDE_DIR} ${QT_INCLUDE_DIR}/QtGui) - SET(QT_INCLUDES ${QT_INCLUDES} ${QT_INCLUDES}/QtGui) - SET(OPENGL_INCLUDE_DIR "/opt/mac/SDKs/MacOSX10.6.sdk/Library/Frameworks/") - SET(QT_HEADERS_DIR "${QT_INCLUDE_DIR}") - SET(QT_INCLUDES "-I${QT_INCLUDE_DIR}") - SET(QT_LIBRARY_DIR ${QT_HOME}/lib) - - SET(QT_QTCORE_LIBRARY "-framework QtCore") - SET(QT_QTGUI_LIBRARY "-framework QtGui -framework Cocoa") - - MESSAGE(STATUS "[QT4IncludeDir] ${QT_INCLUDE_DIR}") - ELSE(APPLE) # WIN32/64 cross - SET(QT_VERSION_MINOR 7) - SET(QT_HEADERS_DIR ${QT_HOME}/include/ ${QT_HOME}/include/QtGui) - SET(QT_INCLUDES -I${QT_HOME}/include -I${QT_HOME}/include/QtGui) - SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR}) - SET(QT_BINARY_DIR ${QT_HOME}/bin) - SET(QT_LIBRARY_DIR ${QT_HOME}/lib) - SET(QT_QTCORE_LIBRARY ${QT_HOME}/lib/libQtCore4.a) - SET(QT_QTGUI_LIBRARY ${QT_HOME}/lib/libQtGui4.a) - ENDIF(APPLE) - SET(QT4_FOUND 1) - SET(QT_RCC_EXECUTABLE rcc) - SET(QT_MOC_EXECUTABLE moc-qt4) - SET(QT_UIC_EXECUTABLE uic-qt4) - MESSAGE(STATUS "[QT4Include] ${QT_INCLUDES}") - MESSAGE(STATUS "[QT4IncludeDir] ${QT_INCLUDE_DIR}") - SET(QT_EXTENSION qt4) - SET(QT_LIBRARY_EXTENSION QT4) - SET(ADM_QT_VERSION 4) - include(admCrossQt4) - - - - ELSE(CROSS) - IF (QT4) - FIND_PACKAGE(Qt4) - SET(QT_INCLUDES ${QT_INCLUDES} ) - SET(QT_INCLUDE_DIR ${QT_INCLUDE_DIR} ) - - FOREACH(i ${QT_INCLUDES}) - LIST(APPEND ONE ${i}) - IF(IS_DIRECTORY ${i}/QtGui) - LIST(APPEND ONE ${i}/QtGui) - ENDIF(IS_DIRECTORY ${i}/QtGui) - ENDFOREACH(i ${QT_INCLUDES}) - SET(QT_INCLUDES ${ONE}) - - FOREACH(i ${QT_INCLUDE_DIR}) - LIST(APPEND TWO ${i} ) - IF(IS_DIRECTORY ${i}/QtGui) - LIST(APPEND TWO ${i}/QtGui) - ENDIF(IS_DIRECTORY ${i}/QtGui) - ENDFOREACH(i ${QT_INCLUDE_DIR}) - SET(QT_INCLUDE_DIR ${TWO}) - - STRING(REGEX REPLACE "[\\]" "/" QT_INCLUDES "${QT_INCLUDES}") # backslashes aren't taken care of properly on Windows - PRINT_LIBRARY_INFO("Qt 4" QT4_FOUND "${QT_INCLUDES} ${QT_DEFINITIONS}" "${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}") - - MESSAGE(STATUS " QT_INCLUDE_DIR <${QT_INCLUDE_DIR}>, QT_INCLUDES <${QT_INCLUDES}>") - - MARK_AS_ADVANCED(LRELEASE_EXECUTABLE) - MARK_AS_ADVANCED(QT_MKSPECS_DIR) - MARK_AS_ADVANCED(QT_PLUGINS_DIR) - MARK_AS_ADVANCED(QT_QMAKE_EXECUTABLE) - SET(QT_EXTENSION qt4) - SET(QT_LIBRARY_EXTENSION QT4) - SET(ADM_QT_VERSION 4) - ELSE (QT4) - MESSAGE("${MSG_DISABLE_OPTION}") - ENDIF (QT4) - ENDIF(CROSS) - - SET(QT4_CHECKED 1) - - MESSAGE("") - ENDIF (NOT QT4_CHECKED) -ENDMACRO(checkQt4) +MACRO(checkQt4) + IF (NOT QT4_CHECKED) + OPTION(QT4 "" ON) + + MESSAGE(STATUS "Checking for Qt 4") + MESSAGE(STATUS "*****************") + IF(CROSS) + MESSAGE(STATUS "Cross compiling override for QT4") + IF(APPLE) + SET(QT_VERSION_MINOR 6) + SET(QT_INCLUDE_DIR "/opt/mac/SDKs/MacOSX10.6.sdk/Library/Frameworks/") + SET(QT_INCLUDE_DIR ${QT_INCLUDE_DIR} ${QT_INCLUDE_DIR}/QtGui) + SET(QT_INCLUDES ${QT_INCLUDES} ${QT_INCLUDES}/QtGui) + SET(OPENGL_INCLUDE_DIR "/opt/mac/SDKs/MacOSX10.6.sdk/Library/Frameworks/") + SET(QT_HEADERS_DIR "${QT_INCLUDE_DIR}") + SET(QT_INCLUDES "-I${QT_INCLUDE_DIR}") + SET(QT_LIBRARY_DIR ${QT_HOME}/lib) + + SET(QT_QTCORE_LIBRARY "-framework QtCore") + SET(QT_QTGUI_LIBRARY "-framework QtGui -framework Cocoa") + + MESSAGE(STATUS "[QT4IncludeDir] ${QT_INCLUDE_DIR}") + ELSE(APPLE) # WIN32/64 cross + SET(QT_VERSION_MINOR 7) + SET(QT_HEADERS_DIR ${QT_HOME}/include/ ${QT_HOME}/include/QtGui) + SET(QT_INCLUDES -I${QT_HOME}/include -I${QT_HOME}/include/QtGui) + SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR}) + SET(QT_BINARY_DIR ${QT_HOME}/bin) + SET(QT_LIBRARY_DIR ${QT_HOME}/lib) + SET(QT_QTCORE_LIBRARY ${QT_HOME}/lib/libQtCore4.a) + SET(QT_QTGUI_LIBRARY ${QT_HOME}/lib/libQtGui4.a) + ENDIF(APPLE) + SET(QT4_FOUND 1) + SET(QT_RCC_EXECUTABLE rcc) + SET(QT_MOC_EXECUTABLE moc-qt4) + SET(QT_UIC_EXECUTABLE uic-qt4) + MESSAGE(STATUS "[QT4Include] ${QT_INCLUDES}") + MESSAGE(STATUS "[QT4IncludeDir] ${QT_INCLUDE_DIR}") + SET(QT_EXTENSION qt4) + SET(QT_LIBRARY_EXTENSION QT4) + SET(ADM_QT_VERSION 4) + include(admCrossQt4) + + + + ELSE(CROSS) + IF (QT4) + FIND_PACKAGE(Qt4) + SET(QT_INCLUDES ${QT_INCLUDES} ) + SET(QT_INCLUDE_DIR ${QT_INCLUDE_DIR} ) + + FOREACH(i ${QT_INCLUDES}) + LIST(APPEND ONE ${i}) + IF(IS_DIRECTORY ${i}/QtGui) + LIST(APPEND ONE ${i}/QtGui) + ENDIF(IS_DIRECTORY ${i}/QtGui) + ENDFOREACH(i ${QT_INCLUDES}) + SET(QT_INCLUDES ${ONE}) + + FOREACH(i ${QT_INCLUDE_DIR}) + LIST(APPEND TWO ${i} ) + IF(IS_DIRECTORY ${i}/QtGui) + LIST(APPEND TWO ${i}/QtGui) + ENDIF(IS_DIRECTORY ${i}/QtGui) + ENDFOREACH(i ${QT_INCLUDE_DIR}) + SET(QT_INCLUDE_DIR ${TWO}) + + STRING(REGEX REPLACE "[\\]" "/" QT_INCLUDES "${QT_INCLUDES}") # backslashes aren't taken care of properly on Windows + PRINT_LIBRARY_INFO("Qt 4" QT4_FOUND "${QT_INCLUDES} ${QT_DEFINITIONS}" "${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}") + + MESSAGE(STATUS " QT_INCLUDE_DIR <${QT_INCLUDE_DIR}>, QT_INCLUDES <${QT_INCLUDES}>") + + MARK_AS_ADVANCED(LRELEASE_EXECUTABLE) + MARK_AS_ADVANCED(QT_MKSPECS_DIR) + MARK_AS_ADVANCED(QT_PLUGINS_DIR) + MARK_AS_ADVANCED(QT_QMAKE_EXECUTABLE) + SET(QT_EXTENSION qt4) + SET(QT_LIBRARY_EXTENSION QT4) + SET(ADM_QT_VERSION 4) + ELSE (QT4) + MESSAGE("${MSG_DISABLE_OPTION}") + ENDIF (QT4) + ENDIF(CROSS) + + SET(QT4_CHECKED 1) + + MESSAGE("") + ENDIF (NOT QT4_CHECKED) +ENDMACRO(checkQt4) diff --git a/cmake/admCheckRequiredLibs.cmake b/cmake/admCheckRequiredLibs.cmake index c14052dcdb..b7db27ec4a 100644 --- a/cmake/admCheckRequiredLibs.cmake +++ b/cmake/admCheckRequiredLibs.cmake @@ -1,62 +1,62 @@ -# -# -# -######################################## -# pkg-config -######################################## -MESSAGE(STATUS "Checking for pkg-config") -MESSAGE(STATUS "***********************") - -FIND_PACKAGE(PkgConfig) - -if (${CMAKE_VERSION} VERSION_EQUAL 2.8.8) - # workaround for bug in CMake 2.8.8 (http://www.cmake.org/Bug/view.php?id=13125) - if (DEFINED PKGCONFIG_FOUND) - set(PKG_CONFIG_FOUND ${PKGCONFIG_FOUND}) - endif (DEFINED PKGCONFIG_FOUND) -endif (${CMAKE_VERSION} VERSION_EQUAL 2.8.8) - -IF (NOT PKG_CONFIG_FOUND) - MESSAGE(FATAL_ERROR "Could not find pkg-config") -ENDIF (NOT PKG_CONFIG_FOUND) - -MESSAGE(STATUS "Found pkg-config") - -IF (VERBOSE) - MESSAGE(STATUS "Path: ${PKG_CONFIG_EXECUTABLE}") -ENDIF (VERBOSE) - -MESSAGE("") - - -######################################## -# pthreads -######################################## -MESSAGE(STATUS "Checking for pthreads") -MESSAGE(STATUS "*********************") - -include(admCheckThreads) - -IF(NOT PTHREAD_FOUND) # Can happen with VS - FIND_LIBRARY(PTHREAD_LIBRARIES "winpthread" PATH ${VS_ROOT}/lib) - IF(PTHREAD_LIBRARIES) - MESSAGE(STATUS "Found winpthread as ${PTHREAD_LIBRARIES}") - SET(PTHREAD_FOUND 1) - ENDIF(PTHREAD_LIBRARIES) -ENDIF(NOT PTHREAD_FOUND) - - -PRINT_LIBRARY_INFO("pthreads" PTHREAD_FOUND "<${PTHREAD_INCLUDE_DIR}>" "<${PTHREAD_LIBRARIES}>" FATAL_ERROR) - -MESSAGE("") - -######################################## -# zlib -######################################## -MESSAGE(STATUS "Checking for zlib") -MESSAGE(STATUS "*****************") - -FIND_PACKAGE(ZLIB) -PRINT_LIBRARY_INFO("zlib" ZLIB_FOUND "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARY}" FATAL_ERROR) - -MESSAGE("") +# +# +# +######################################## +# pkg-config +######################################## +MESSAGE(STATUS "Checking for pkg-config") +MESSAGE(STATUS "***********************") + +FIND_PACKAGE(PkgConfig) + +if (${CMAKE_VERSION} VERSION_EQUAL 2.8.8) + # workaround for bug in CMake 2.8.8 (http://www.cmake.org/Bug/view.php?id=13125) + if (DEFINED PKGCONFIG_FOUND) + set(PKG_CONFIG_FOUND ${PKGCONFIG_FOUND}) + endif (DEFINED PKGCONFIG_FOUND) +endif (${CMAKE_VERSION} VERSION_EQUAL 2.8.8) + +IF (NOT PKG_CONFIG_FOUND) + MESSAGE(FATAL_ERROR "Could not find pkg-config") +ENDIF (NOT PKG_CONFIG_FOUND) + +MESSAGE(STATUS "Found pkg-config") + +IF (VERBOSE) + MESSAGE(STATUS "Path: ${PKG_CONFIG_EXECUTABLE}") +ENDIF (VERBOSE) + +MESSAGE("") + + +######################################## +# pthreads +######################################## +MESSAGE(STATUS "Checking for pthreads") +MESSAGE(STATUS "*********************") + +include(admCheckThreads) + +IF(NOT PTHREAD_FOUND) # Can happen with VS + FIND_LIBRARY(PTHREAD_LIBRARIES "winpthread" PATH ${VS_ROOT}/lib) + IF(PTHREAD_LIBRARIES) + MESSAGE(STATUS "Found winpthread as ${PTHREAD_LIBRARIES}") + SET(PTHREAD_FOUND 1) + ENDIF(PTHREAD_LIBRARIES) +ENDIF(NOT PTHREAD_FOUND) + + +PRINT_LIBRARY_INFO("pthreads" PTHREAD_FOUND "<${PTHREAD_INCLUDE_DIR}>" "<${PTHREAD_LIBRARIES}>" FATAL_ERROR) + +MESSAGE("") + +######################################## +# zlib +######################################## +MESSAGE(STATUS "Checking for zlib") +MESSAGE(STATUS "*****************") + +FIND_PACKAGE(ZLIB) +PRINT_LIBRARY_INFO("zlib" ZLIB_FOUND "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARY}" FATAL_ERROR) + +MESSAGE("") diff --git a/cmake/admCheckSpiderMonkey.cmake b/cmake/admCheckSpiderMonkey.cmake index 63b4268c35..938b1e041c 100644 --- a/cmake/admCheckSpiderMonkey.cmake +++ b/cmake/admCheckSpiderMonkey.cmake @@ -1,13 +1,13 @@ -OPTION(USE_SYSTEM_SPIDERMONKEY "" OFF) - -MESSAGE(STATUS "Checking for SpiderMonkey") -MESSAGE(STATUS "*************************") - -IF (USE_SYSTEM_SPIDERMONKEY) - FIND_HEADER_AND_LIB(SPIDERMONKEY jsapi.h js JS_InitStandardClasses) - PRINT_LIBRARY_INFO("SpiderMonkey" SPIDERMONKEY_FOUND "${SPIDERMONKEY_INCLUDE_DIR}" "${SPIDERMONKEY_LIBRARY_DIR}" FATAL_ERROR) -ELSE (USE_SYSTEM_SPIDERMONKEY) - MESSAGE("Skipping check and using bundled version.") -ENDIF (USE_SYSTEM_SPIDERMONKEY) - +OPTION(USE_SYSTEM_SPIDERMONKEY "" OFF) + +MESSAGE(STATUS "Checking for SpiderMonkey") +MESSAGE(STATUS "*************************") + +IF (USE_SYSTEM_SPIDERMONKEY) + FIND_HEADER_AND_LIB(SPIDERMONKEY jsapi.h js JS_InitStandardClasses) + PRINT_LIBRARY_INFO("SpiderMonkey" SPIDERMONKEY_FOUND "${SPIDERMONKEY_INCLUDE_DIR}" "${SPIDERMONKEY_LIBRARY_DIR}" FATAL_ERROR) +ELSE (USE_SYSTEM_SPIDERMONKEY) + MESSAGE("Skipping check and using bundled version.") +ENDIF (USE_SYSTEM_SPIDERMONKEY) + MESSAGE("") \ No newline at end of file diff --git a/cmake/admCheckSqlLite.cmake b/cmake/admCheckSqlLite.cmake index 1f322f1883..b47080ce6b 100644 --- a/cmake/admCheckSqlLite.cmake +++ b/cmake/admCheckSqlLite.cmake @@ -1,27 +1,27 @@ -# Outputs: -# SQLITE3_INCLUDEDIR -# SQLITE3_LINK_LIBRARIES - -MACRO(checkSqlite3) - IF (NOT SQLITE3_CHECKED) - - MESSAGE(STATUS "Checking for Sqlite3") - MESSAGE(STATUS "********************") - - PKG_CHECK_MODULES(SQLITE3 REQUIRED sqlite3) - PRINT_LIBRARY_INFO("Sqlite3" SQLITE3_FOUND "${SQLITE3_INCLUDEDIR}" "${SQLITE3_LDFLAGS}") - -# IF (SQLITE3_FOUND) -# ADM_CHECK_FUNCTION_EXISTS(sqlite3_close "${SQLITE3_LDFLAGS}" SQLITE3_CLOSE_FUNCTION_FOUND "" -I"${SQLITE3_INCLUDEDIR}") - #IF (SQLITE3_CLOSE_FUNCTION_FOUND) -# SET(SQLITE3_FOUND 1) - #ELSE() - #MESSAGE(FATAL_ERROR "Working SQLITE3 library not found") - #ENDIF (SQLITE3_CLOSE_FUNCTION_FOUND) -# ENDIF (SQLITE3_FOUND) - - SET(SQLITE3_CHECKED 1) - MESSAGE("") - ENDIF (NOT SQLITE3_CHECKED) - -ENDMACRO(checkSqlite3) +# Outputs: +# SQLITE3_INCLUDEDIR +# SQLITE3_LINK_LIBRARIES + +MACRO(checkSqlite3) + IF (NOT SQLITE3_CHECKED) + + MESSAGE(STATUS "Checking for Sqlite3") + MESSAGE(STATUS "********************") + + PKG_CHECK_MODULES(SQLITE3 REQUIRED sqlite3) + PRINT_LIBRARY_INFO("Sqlite3" SQLITE3_FOUND "${SQLITE3_INCLUDEDIR}" "${SQLITE3_LDFLAGS}") + +# IF (SQLITE3_FOUND) +# ADM_CHECK_FUNCTION_EXISTS(sqlite3_close "${SQLITE3_LDFLAGS}" SQLITE3_CLOSE_FUNCTION_FOUND "" -I"${SQLITE3_INCLUDEDIR}") + #IF (SQLITE3_CLOSE_FUNCTION_FOUND) +# SET(SQLITE3_FOUND 1) + #ELSE() + #MESSAGE(FATAL_ERROR "Working SQLITE3 library not found") + #ENDIF (SQLITE3_CLOSE_FUNCTION_FOUND) +# ENDIF (SQLITE3_FOUND) + + SET(SQLITE3_CHECKED 1) + MESSAGE("") + ENDIF (NOT SQLITE3_CHECKED) + +ENDMACRO(checkSqlite3) diff --git a/cmake/admCheckVapourSynth.cmake b/cmake/admCheckVapourSynth.cmake index 0027db9c46..7d613b2a3e 100644 --- a/cmake/admCheckVapourSynth.cmake +++ b/cmake/admCheckVapourSynth.cmake @@ -1,47 +1,47 @@ -include(GetPrerequisites) - - -MACRO(checkVapourSynth) - macro(GET_VAPOURSYNTH_PYTHON lib result) - set(${result} "NOTFOUND") - GET_PREREQUISITES(${lib} xoutput 0 0 "" "") - foreach(dep ${xoutput}) - if(dep MATCHES ".*libpython3.*") - # path looks like /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0 - STRING(REGEX REPLACE "^.*libpython3" "libpython3" shortened "${dep}" ) - STRING(REGEX REPLACE "so.*$" "so" shortened "${shortened}" ) - # Now it looks like this libpython3.6m.so - set(${result} ${shortened}) - MESSAGE(STATUS "Got python lib : ${${result}}") - endif(dep MATCHES ".*libpython3.*") - endforeach(dep ${xoutput}) - endmacro(GET_VAPOURSYNTH_PYTHON lib) - - IF (NOT VAPOURSYNTH_CHECKED) - OPTION(VAPOURSYNTH "" ON) - - MESSAGE(STATUS "Checking for VAPOURSYNTH") - MESSAGE(STATUS "***********************") - - IF (VAPOURSYNTH) - PKG_CHECK_MODULES(VAPOURSYNTHSCRIPT vapoursynth-script) - IF (VAPOURSYNTHSCRIPT_FOUND) - MESSAGE(STATUS "VSSCRIPT<${VAPOURSYNTHSCRIPT_CFLAGS}> < ${VAPOURSYNTHSCRIPT_LDFLAGS}> <${VAPOURSYNTHSCRIPT_LIBRARIES}>") - IF(NOT APPLE AND NOT WIN32) - LIST(GET VAPOURSYNTHSCRIPT_LIBRARIES 0 xfirst) - GET_VAPOURSYNTH_PYTHON( "${VAPOURSYNTHSCRIPT_LIBDIR}/lib${xfirst}.so" VAPOURSYNTH_PYTHONLIB) - SET(VAPOURSYNTHSCRIPT_CFLAGS "${VAPOURSYNTHSCRIPT_CFLAGS} -DVAPOURSYNTH_PYTHONLIB='\"${VAPOURSYNTH_PYTHONLIB}\"'") - ENDIF(NOT APPLE AND NOT WIN32) - SET(USE_VAPOURSYNTH 1) - ENDIF (VAPOURSYNTHSCRIPT_FOUND) - ELSE (VAPOURSYNTH) - MESSAGE("${MSG_DISABLE_OPTION}") - ENDIF (VAPOURSYNTH) - - SET(VAPOURSYNTH_CHECKED 1) - - MESSAGE("") - ENDIF (NOT VAPOURSYNTH_CHECKED) - - APPEND_SUMMARY_LIST("Miscellaneous" "VapourSynth" "${VAPOURSYNTHSCRIPT_FOUND}") -ENDMACRO(checkVapourSynth) +include(GetPrerequisites) + + +MACRO(checkVapourSynth) + macro(GET_VAPOURSYNTH_PYTHON lib result) + set(${result} "NOTFOUND") + GET_PREREQUISITES(${lib} xoutput 0 0 "" "") + foreach(dep ${xoutput}) + if(dep MATCHES ".*libpython3.*") + # path looks like /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0 + STRING(REGEX REPLACE "^.*libpython3" "libpython3" shortened "${dep}" ) + STRING(REGEX REPLACE "so.*$" "so" shortened "${shortened}" ) + # Now it looks like this libpython3.6m.so + set(${result} ${shortened}) + MESSAGE(STATUS "Got python lib : ${${result}}") + endif(dep MATCHES ".*libpython3.*") + endforeach(dep ${xoutput}) + endmacro(GET_VAPOURSYNTH_PYTHON lib) + + IF (NOT VAPOURSYNTH_CHECKED) + OPTION(VAPOURSYNTH "" ON) + + MESSAGE(STATUS "Checking for VAPOURSYNTH") + MESSAGE(STATUS "***********************") + + IF (VAPOURSYNTH) + PKG_CHECK_MODULES(VAPOURSYNTHSCRIPT vapoursynth-script) + IF (VAPOURSYNTHSCRIPT_FOUND) + MESSAGE(STATUS "VSSCRIPT<${VAPOURSYNTHSCRIPT_CFLAGS}> < ${VAPOURSYNTHSCRIPT_LDFLAGS}> <${VAPOURSYNTHSCRIPT_LIBRARIES}>") + IF(NOT APPLE AND NOT WIN32) + LIST(GET VAPOURSYNTHSCRIPT_LIBRARIES 0 xfirst) + GET_VAPOURSYNTH_PYTHON( "${VAPOURSYNTHSCRIPT_LIBDIR}/lib${xfirst}.so" VAPOURSYNTH_PYTHONLIB) + SET(VAPOURSYNTHSCRIPT_CFLAGS "${VAPOURSYNTHSCRIPT_CFLAGS} -DVAPOURSYNTH_PYTHONLIB='\"${VAPOURSYNTH_PYTHONLIB}\"'") + ENDIF(NOT APPLE AND NOT WIN32) + SET(USE_VAPOURSYNTH 1) + ENDIF (VAPOURSYNTHSCRIPT_FOUND) + ELSE (VAPOURSYNTH) + MESSAGE("${MSG_DISABLE_OPTION}") + ENDIF (VAPOURSYNTH) + + SET(VAPOURSYNTH_CHECKED 1) + + MESSAGE("") + ENDIF (NOT VAPOURSYNTH_CHECKED) + + APPEND_SUMMARY_LIST("Miscellaneous" "VapourSynth" "${VAPOURSYNTHSCRIPT_FOUND}") +ENDMACRO(checkVapourSynth) diff --git a/cmake/admCheckVpx.cmake b/cmake/admCheckVpx.cmake index 7897b59e56..37a1140a69 100644 --- a/cmake/admCheckVpx.cmake +++ b/cmake/admCheckVpx.cmake @@ -1,48 +1,48 @@ -MACRO(checkVpxDec) - OPTION(VPXDEC "" ON) - - MESSAGE(STATUS "Checking for Vpx (decoding)") - MESSAGE(STATUS "***************************") - - IF (VPXDEC) - PKG_CHECK_MODULES(VPX vpx) - IF (VPX_FOUND) - PRINT_LIBRARY_INFO("VPX" VPX_FOUND "${VPX_INCLUDEDIR}" "${VPX_LDFLAGS}") - ADM_CHECK_FUNCTION_EXISTS(vpx_codec_dec_init_ver "${VPX_LDFLAGS}" VPX_DEC_INIT_FOUND "" "-I${VPX_INCLUDEDIR}") - IF(VPX_DEC_INIT_FOUND) - SET(USE_VPX_DEC 1) - MESSAGE(STATUS "Linking to vpx decoder library ") - ENDIF(VPX_DEC_INIT_FOUND) - ENDIF (VPX_FOUND) - ELSE (VPXDEC) - MESSAGE("${MSG_DISABLE_OPTION}") - ENDIF (VPXDEC) - MESSAGE("") - - APPEND_SUMMARY_LIST("Video Decoder" "libvpx" "${USE_VPX_DEC}") -ENDMACRO(checkVpxDec) - -MACRO(checkVpxEnc) - OPTION(VPXENC "" ON) - - MESSAGE(STATUS "Checking for Vpx encoding capability") - MESSAGE(STATUS "*****************") - IF (VPXENC) - PKG_CHECK_MODULES(VPX vpx) - IF (VPX_FOUND) - PRINT_LIBRARY_INFO("VPX" VPX_FOUND "${VPX_INCLUDEDIR}" "${VPX_LDFLAGS}") - ADM_CHECK_FUNCTION_EXISTS(vpx_codec_enc_init_ver "${VPX_LDFLAGS}" VPX_ENC_INIT_FOUND "" "-I${VPX_INCLUDEDIR}") - IF(VPX_ENC_INIT_FOUND) - SET(USE_VP9_ENC 1) - SET(VPX_ENC_LIBRARY_DIR "${VPX_LDFLAGS}") - SET(VPX_ENC_INCLUDE_DIR "${VPX_INCLUDEDIR}") - MESSAGE(STATUS "Linking to vpx encoder library ") - ENDIF(VPX_ENC_INIT_FOUND) - ENDIF (VPX_FOUND) - ELSE (VPXENC) - MESSAGE("${MSG_DISABLE_OPTION}") - ENDIF (VPXENC) - MESSAGE("") - - APPEND_SUMMARY_LIST("Video Encoder" "libvpx" "${USE_VP9_ENC}") -ENDMACRO(checkVpxEnc) +MACRO(checkVpxDec) + OPTION(VPXDEC "" ON) + + MESSAGE(STATUS "Checking for Vpx (decoding)") + MESSAGE(STATUS "***************************") + + IF (VPXDEC) + PKG_CHECK_MODULES(VPX vpx) + IF (VPX_FOUND) + PRINT_LIBRARY_INFO("VPX" VPX_FOUND "${VPX_INCLUDEDIR}" "${VPX_LDFLAGS}") + ADM_CHECK_FUNCTION_EXISTS(vpx_codec_dec_init_ver "${VPX_LDFLAGS}" VPX_DEC_INIT_FOUND "" "-I${VPX_INCLUDEDIR}") + IF(VPX_DEC_INIT_FOUND) + SET(USE_VPX_DEC 1) + MESSAGE(STATUS "Linking to vpx decoder library ") + ENDIF(VPX_DEC_INIT_FOUND) + ENDIF (VPX_FOUND) + ELSE (VPXDEC) + MESSAGE("${MSG_DISABLE_OPTION}") + ENDIF (VPXDEC) + MESSAGE("") + + APPEND_SUMMARY_LIST("Video Decoder" "libvpx" "${USE_VPX_DEC}") +ENDMACRO(checkVpxDec) + +MACRO(checkVpxEnc) + OPTION(VPXENC "" ON) + + MESSAGE(STATUS "Checking for Vpx encoding capability") + MESSAGE(STATUS "*****************") + IF (VPXENC) + PKG_CHECK_MODULES(VPX vpx) + IF (VPX_FOUND) + PRINT_LIBRARY_INFO("VPX" VPX_FOUND "${VPX_INCLUDEDIR}" "${VPX_LDFLAGS}") + ADM_CHECK_FUNCTION_EXISTS(vpx_codec_enc_init_ver "${VPX_LDFLAGS}" VPX_ENC_INIT_FOUND "" "-I${VPX_INCLUDEDIR}") + IF(VPX_ENC_INIT_FOUND) + SET(USE_VP9_ENC 1) + SET(VPX_ENC_LIBRARY_DIR "${VPX_LDFLAGS}") + SET(VPX_ENC_INCLUDE_DIR "${VPX_INCLUDEDIR}") + MESSAGE(STATUS "Linking to vpx encoder library ") + ENDIF(VPX_ENC_INIT_FOUND) + ENDIF (VPX_FOUND) + ELSE (VPXENC) + MESSAGE("${MSG_DISABLE_OPTION}") + ENDIF (VPXENC) + MESSAGE("") + + APPEND_SUMMARY_LIST("Video Encoder" "libvpx" "${USE_VP9_ENC}") +ENDMACRO(checkVpxEnc) diff --git a/cmake/admCheckX264.cmake b/cmake/admCheckX264.cmake index c845fd4c09..faaabcbc3d 100644 --- a/cmake/admCheckX264.cmake +++ b/cmake/admCheckX264.cmake @@ -1,40 +1,40 @@ -MACRO(checkX264) - IF (NOT X264_CHECKED) - OPTION(X264 "" ON) - - MESSAGE(STATUS "Checking for x264") - MESSAGE(STATUS "*****************") - - IF (X264) - FIND_HEADER_AND_LIB(_X264 x264.h) - - IF (_X264_FOUND) - FILE(READ ${_X264_INCLUDE_DIR}/x264.h X264_H) - STRING(REGEX MATCH "#define[ ]+X264_BUILD[ ]+([0-9]+)" X264_H "${X264_H}") - STRING(REGEX REPLACE ".*[ ]([0-9]+).*" "\\1" x264_version "${X264_H}") - MESSAGE(STATUS " core version: ${x264_version}") - IF (x264_version LESS 144) - MESSAGE("WARNING: x264 core version is too old. At least version 144 is required.") - SET(X264_FOUND 0) - ELSE (x264_version LESS 144) - FIND_HEADER_AND_LIB(X264 x264.h x264 x264_encoder_open_${x264_version}) - ENDIF (x264_version LESS 144) - IF (X264_FOUND) - SET(USE_X264 True CACHE BOOL "") - ENDIF(X264_FOUND) - ELSE (_X264_FOUND) - SET(X264_FOUND 0) - ENDIF (_X264_FOUND) - - PRINT_LIBRARY_INFO("x264" X264_FOUND "${X264_INCLUDE_DIR}" "${X264_LIBRARY_DIR}") - ELSE (X264) - MESSAGE("${MSG_DISABLE_OPTION}") - ENDIF (X264) - - SET(X264_CHECKED 1) - - MESSAGE("") - ENDIF (NOT X264_CHECKED) - - APPEND_SUMMARY_LIST("Video Encoder" "x264" "${USE_X264}") -ENDMACRO(checkX264) +MACRO(checkX264) + IF (NOT X264_CHECKED) + OPTION(X264 "" ON) + + MESSAGE(STATUS "Checking for x264") + MESSAGE(STATUS "*****************") + + IF (X264) + FIND_HEADER_AND_LIB(_X264 x264.h) + + IF (_X264_FOUND) + FILE(READ ${_X264_INCLUDE_DIR}/x264.h X264_H) + STRING(REGEX MATCH "#define[ ]+X264_BUILD[ ]+([0-9]+)" X264_H "${X264_H}") + STRING(REGEX REPLACE ".*[ ]([0-9]+).*" "\\1" x264_version "${X264_H}") + MESSAGE(STATUS " core version: ${x264_version}") + IF (x264_version LESS 144) + MESSAGE("WARNING: x264 core version is too old. At least version 144 is required.") + SET(X264_FOUND 0) + ELSE (x264_version LESS 144) + FIND_HEADER_AND_LIB(X264 x264.h x264 x264_encoder_open_${x264_version}) + ENDIF (x264_version LESS 144) + IF (X264_FOUND) + SET(USE_X264 True CACHE BOOL "") + ENDIF(X264_FOUND) + ELSE (_X264_FOUND) + SET(X264_FOUND 0) + ENDIF (_X264_FOUND) + + PRINT_LIBRARY_INFO("x264" X264_FOUND "${X264_INCLUDE_DIR}" "${X264_LIBRARY_DIR}") + ELSE (X264) + MESSAGE("${MSG_DISABLE_OPTION}") + ENDIF (X264) + + SET(X264_CHECKED 1) + + MESSAGE("") + ENDIF (NOT X264_CHECKED) + + APPEND_SUMMARY_LIST("Video Encoder" "x264" "${USE_X264}") +ENDMACRO(checkX264) diff --git a/cmake/admCheckXvid.cmake b/cmake/admCheckXvid.cmake index 70e1a86ce5..230f3d1f8d 100644 --- a/cmake/admCheckXvid.cmake +++ b/cmake/admCheckXvid.cmake @@ -1,19 +1,19 @@ -MACRO(checkXvid) - OPTION(XVID "" ON) - - MESSAGE(STATUS "Checking for Xvid") - MESSAGE(STATUS "*****************") - - IF (XVID) - FIND_HEADER_AND_LIB(XVID xvid.h xvidcore xvid_plugin_single) - PRINT_LIBRARY_INFO("Xvid" XVID_FOUND "${XVID_INCLUDE_DIR}" "${XVID_LIBRARY_DIR}") - IF(XVID_FOUND) - SET(USE_XVID True CACHE BOOL "") - ENDIF(XVID_FOUND) - ELSE (XVID) - MESSAGE("${MSG_DISABLE_OPTION}") - ENDIF (XVID) - MESSAGE("") - - APPEND_SUMMARY_LIST("Video Encoder" "Xvid" "${XVID_FOUND}") -ENDMACRO(checkXvid) +MACRO(checkXvid) + OPTION(XVID "" ON) + + MESSAGE(STATUS "Checking for Xvid") + MESSAGE(STATUS "*****************") + + IF (XVID) + FIND_HEADER_AND_LIB(XVID xvid.h xvidcore xvid_plugin_single) + PRINT_LIBRARY_INFO("Xvid" XVID_FOUND "${XVID_INCLUDE_DIR}" "${XVID_LIBRARY_DIR}") + IF(XVID_FOUND) + SET(USE_XVID True CACHE BOOL "") + ENDIF(XVID_FOUND) + ELSE (XVID) + MESSAGE("${MSG_DISABLE_OPTION}") + ENDIF (XVID) + MESSAGE("") + + APPEND_SUMMARY_LIST("Video Encoder" "Xvid" "${XVID_FOUND}") +ENDMACRO(checkXvid) diff --git a/cmake/admConfigHelper.cmake b/cmake/admConfigHelper.cmake index c6ea6f70ff..0018c74b10 100644 --- a/cmake/admConfigHelper.cmake +++ b/cmake/admConfigHelper.cmake @@ -1,204 +1,204 @@ -MACRO(PRINT_LIBRARY_INFO libraryName libraryDetected compilerFlags linkerFlags) - IF (${libraryDetected}) - MESSAGE(STATUS "Found ${libraryName}") - - IF (VERBOSE) - SET(_compilerFlags "") - APPEND_FLAGS(_compilerFlags ${compilerFlags}) - - SET(_linkerFlags "") - APPEND_FLAGS(_linkerFlags ${linkerFlags}) - - MESSAGE(STATUS "Compiler Flags:${_compilerFlags}") - MESSAGE(STATUS "Linker Flags :${_linkerFlags}") - ENDIF (VERBOSE) - ELSE (${libraryDetected}) - MESSAGE(STATUS ${ARGV4} "Could not find ${libraryName}") - ENDIF (${libraryDetected}) -ENDMACRO(PRINT_LIBRARY_INFO) - - -MACRO(SDLify _source) - IF (SDL2_FOUND) - SET_SOURCE_FILES_PROPERTIES(${_source} PROPERTIES COMPILE_FLAGS "-I${SDL2_INCLUDE_DIR} ${SDL2_CFLAGS}") - ENDIF (SDL2_FOUND) -ENDMACRO(SDLify) - - -# ARGV2 = library to check -# ARGV3 = function to check -# ARVG4 = extra required libs -MACRO(FIND_HEADER_AND_LIB prefix headerFile) - IF (NOT DEFINED ${prefix}_FOUND) - SET(${prefix}_FOUND 0 CACHE INTERNAL "") - SET(_proceed 1) - - IF (NOT ${headerFile} STREQUAL "") - FIND_PATH(${prefix}_INCLUDE_DIR ${headerFile} - PATHS /usr/include/x86_64-linux-gnu) # Needed for 64 bits linux - MARK_AS_ADVANCED(${prefix}_INCLUDE_DIR) - - IF (${prefix}_INCLUDE_DIR) - MESSAGE(STATUS "Found ${headerFile}") - ELSE (${prefix}_INCLUDE_DIR) - SET(_proceed 0) - MESSAGE(STATUS "Could not find ${headerFile}") - ENDIF (${prefix}_INCLUDE_DIR) - ENDIF (NOT ${headerFile} STREQUAL "") - - IF (_proceed AND NOT ${ARGV2} STREQUAL "") - # On Mac, search firts in port libs, else we might use an older lib coming from the system (e.g. iconv) - IF(APPLE) - FIND_LIBRARY(${prefix}_LIBRARY_DIR ${ARGV2} PATHS /opt/local/lib NO_DEFAULT_PATH) # needed for port stuff - ENDIF(APPLE) - FIND_LIBRARY(${prefix}_LIBRARY_DIR ${ARGV2}) - MARK_AS_ADVANCED(${prefix}_LIBRARY_DIR) - - IF (${prefix}_LIBRARY_DIR) - MESSAGE(STATUS "Found ${ARGV2} library") - - IF (NOT ${ARGV3} STREQUAL "") - ADM_CHECK_FUNCTION_EXISTS(${ARGV3} "${${prefix}_LIBRARY_DIR}" ${prefix}_FUNCTION_FOUND "${ARGV4}") - - IF (${prefix}_FUNCTION_FOUND) - SET(${prefix}_FOUND 1 CACHE INTERNAL "") - ENDIF (${prefix}_FUNCTION_FOUND) - ELSE (NOT ${ARGV3} STREQUAL "") - SET(${prefix}_FOUND 1 CACHE INTERNAL "") - ENDIF (NOT ${ARGV3} STREQUAL "") - ELSE (${prefix}_LIBRARY_DIR) - MESSAGE(STATUS "Cound not find ${ARGV2} library") - ENDIF (${prefix}_LIBRARY_DIR) - ELSE (_proceed AND NOT ${ARGV2} STREQUAL "") - SET(${prefix}_FOUND ${_proceed} CACHE INTERNAL "") - ENDIF (_proceed AND NOT ${ARGV2} STREQUAL "") - ENDIF (NOT DEFINED ${prefix}_FOUND) -ENDMACRO(FIND_HEADER_AND_LIB) - - -MACRO (ADM_COMPILE _file _def _include _lib _varToSet _output) - #MESSAGE(STATUS " ADM_compile <${_file}>") - IF(AVIDEMUX_THIS_IS_CORE) - SET(src ${AVIDEMUX_TOP_SOURCE_DIR}/cmake/cmake_compile_check/${_file}) - ELSE() - SET(src ${ADM_CMAKE_DIR}/cmake_compile_check/${_file}) - ENDIF() - #MESSAGE(STATUS " Compiling <${src}>") - IF (NOT DEFINED ${_varToSet}_COMPILED) - SET(${_varToSet}_COMPILED 1 CACHE INTERNAL "") - TRY_COMPILE(${_varToSet} - ${CMAKE_BINARY_DIR} - ${src} - CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${_include}" "-DLINK_LIBRARIES:STRING=${_lib}" - COMPILE_DEFINITIONS ${_def} - OUTPUT_VARIABLE ${_output}) - #MESSAGE(STATUS "output=${output}") - ENDIF (NOT DEFINED ${_varToSet}_COMPILED) -ENDMACRO (ADM_COMPILE) - - -#ARGV3 = extra libraries -#ARGV4 = extra compile flags -MACRO (ADM_CHECK_FUNCTION_EXISTS _function _lib _varToSet) - SET(CHECK_FUNCTION_DEFINE "-DCHECK_FUNCTION_EXISTS=${_function}" ${ARGV4}) - SET(CHECK_FUNCTION_LIB ${_lib} ${ARGV3}) - - ADM_COMPILE(CheckFunctionExists.c "${CHECK_FUNCTION_DEFINE}" "" "${CHECK_FUNCTION_LIB}" ${_varToSet} OUTPUT) - - IF (${_varToSet}) - MESSAGE(STATUS "Found ${_function} in ${_lib}") - ELSE (${_varToSet}) - MESSAGE(STATUS "Could not find ${_function} in ${_lib}") - - IF (VERBOSE) - MESSAGE(STATUS ${OUTPUT}) - ENDIF (VERBOSE) - ENDIF (${_varToSet}) -ENDMACRO (ADM_CHECK_FUNCTION_EXISTS) - - -MACRO (CHECK_CFLAGS_REQUIRED _file _cflags _include _lib _varToSet) - IF (NOT DEFINED ${_varToSet}_CFLAGS_CHECKED) - SET(${_varToSet}_CFLAGS_CHECKED 1 CACHE INTERNAL "") - - ADM_COMPILE(${_file} ${_cflags} ${_include} ${_lib} ${_varToSet}_COMPILE_WITH logwith) - ADM_COMPILE(${_file} "" ${_include} ${_lib} ${_varToSet}_COMPILE_WITHOUT logwithout) - - IF (${_varToSet}_COMPILE_WITH AND NOT ${_varToSet}_COMPILE_WITHOUT) - SET(${_varToSet} 1 CACHE INTERNAL "") - - IF (VERBOSE) - MESSAGE(STATUS "(${_cflags}) required") - ENDIF (VERBOSE) - ELSE (${_varToSet}_COMPILE_WITH AND NOT ${_varToSet}_COMPILE_WITHOUT) - IF (NOT ${_varToSet}_COMPILE_WITH AND ${_varToSet}_COMPILE_WITHOUT) - IF (VERBOSE) - MESSAGE (STATUS "(${_cflags}) not required") - ENDIF (VERBOSE) - ELSE (NOT ${_varToSet}_COMPILE_WITH AND ${_varToSet}_COMPILE_WITHOUT) - MESSAGE(STATUS "Inconsistent compiler output with: ${${_varToSet}_COMPILE_WITH}, without: ${${_varToSet}_COMPILE_WITHOUT}") - MESSAGE(STATUS "${logwith}") - MESSAGE(STATUS "") - MESSAGE(STATUS "${logwithout}") - endif(NOT ${_varToSet}_COMPILE_WITH AND ${_varToSet}_COMPILE_WITHOUT) - ENDIF (${_varToSet}_COMPILE_WITH AND NOT ${_varToSet}_COMPILE_WITHOUT) - ENDIF (NOT DEFINED ${_varToSet}_CFLAGS_CHECKED) -ENDMACRO (CHECK_CFLAGS_REQUIRED) - - -MACRO (APPEND_FLAGS _flags) - IF (NOT ${_flags}) - SET(${_flags} "") - ENDIF (NOT ${_flags}) - - FOREACH (_flag ${ARGN}) - SET(${_flags} "${${_flags}} ${_flag}") - ENDFOREACH (_flag ${ARGN}) - - IF (${firstChar} AND ${firstChar} STREQUAL " ") - STRING(LENGTH "${${_flags}}" stringLength) - MATH(EXPR stringLength "${stringLength} - 1") - STRING(SUBSTRING "${${_flags}}" 1 ${stringLength} ${_flags}) - ENDIF (${firstChar} AND ${firstChar} STREQUAL " ") -ENDMACRO (APPEND_FLAGS) - - -#ARGV1 = flags -MACRO (ADD_SOURCE_CFLAGS _target) - GET_SOURCE_FILE_PROPERTY(_flags ${_target} COMPILE_FLAGS) - APPEND_FLAGS(_flags ${ARGN}) - SET_SOURCE_FILES_PROPERTIES(${_target} PROPERTIES COMPILE_FLAGS "${_flags}") -ENDMACRO (ADD_SOURCE_CFLAGS) - - -MACRO (ADD_TARGET_CFLAGS _target) - GET_TARGET_PROPERTY(_flags ${_target} COMPILE_FLAGS) - APPEND_FLAGS(_flags ${ARGN}) - SET_TARGET_PROPERTIES(${_target} PROPERTIES COMPILE_FLAGS "${_flags}") -ENDMACRO (ADD_TARGET_CFLAGS) - - -MACRO (ADD_TARGET_DEFINITIONS _target) - SET(newflag) - GET_TARGET_PROPERTY(_flags ${_target} COMPILE_FLAGS) - - FOREACH (_def ${ARGN}) - IF (${_def}) - APPEND_FLAGS(_flags "-D${_def}") - SET(newflag 1) - ENDIF (${_def}) - ENDFOREACH (_def ${ARGN}) - - IF (newflag) - SET_TARGET_PROPERTIES(${_target} PROPERTIES COMPILE_FLAGS "${_flags}") - ENDIF (newflag) -ENDMACRO (ADD_TARGET_DEFINITIONS) - -MACRO(DUMP_ALL_VARS) - get_cmake_property(_variableNames VARIABLES) - list (SORT _variableNames) - foreach (_variableName ${_variableNames}) - message(STATUS "${_variableName}=${${_variableName}}") - endforeach() -ENDMACRO(DUMP_ALL_VARS) - +MACRO(PRINT_LIBRARY_INFO libraryName libraryDetected compilerFlags linkerFlags) + IF (${libraryDetected}) + MESSAGE(STATUS "Found ${libraryName}") + + IF (VERBOSE) + SET(_compilerFlags "") + APPEND_FLAGS(_compilerFlags ${compilerFlags}) + + SET(_linkerFlags "") + APPEND_FLAGS(_linkerFlags ${linkerFlags}) + + MESSAGE(STATUS "Compiler Flags:${_compilerFlags}") + MESSAGE(STATUS "Linker Flags :${_linkerFlags}") + ENDIF (VERBOSE) + ELSE (${libraryDetected}) + MESSAGE(STATUS ${ARGV4} "Could not find ${libraryName}") + ENDIF (${libraryDetected}) +ENDMACRO(PRINT_LIBRARY_INFO) + + +MACRO(SDLify _source) + IF (SDL2_FOUND) + SET_SOURCE_FILES_PROPERTIES(${_source} PROPERTIES COMPILE_FLAGS "-I${SDL2_INCLUDE_DIR} ${SDL2_CFLAGS}") + ENDIF (SDL2_FOUND) +ENDMACRO(SDLify) + + +# ARGV2 = library to check +# ARGV3 = function to check +# ARVG4 = extra required libs +MACRO(FIND_HEADER_AND_LIB prefix headerFile) + IF (NOT DEFINED ${prefix}_FOUND) + SET(${prefix}_FOUND 0 CACHE INTERNAL "") + SET(_proceed 1) + + IF (NOT ${headerFile} STREQUAL "") + FIND_PATH(${prefix}_INCLUDE_DIR ${headerFile} + PATHS /usr/include/x86_64-linux-gnu) # Needed for 64 bits linux + MARK_AS_ADVANCED(${prefix}_INCLUDE_DIR) + + IF (${prefix}_INCLUDE_DIR) + MESSAGE(STATUS "Found ${headerFile}") + ELSE (${prefix}_INCLUDE_DIR) + SET(_proceed 0) + MESSAGE(STATUS "Could not find ${headerFile}") + ENDIF (${prefix}_INCLUDE_DIR) + ENDIF (NOT ${headerFile} STREQUAL "") + + IF (_proceed AND NOT ${ARGV2} STREQUAL "") + # On Mac, search firts in port libs, else we might use an older lib coming from the system (e.g. iconv) + IF(APPLE) + FIND_LIBRARY(${prefix}_LIBRARY_DIR ${ARGV2} PATHS /opt/local/lib NO_DEFAULT_PATH) # needed for port stuff + ENDIF(APPLE) + FIND_LIBRARY(${prefix}_LIBRARY_DIR ${ARGV2}) + MARK_AS_ADVANCED(${prefix}_LIBRARY_DIR) + + IF (${prefix}_LIBRARY_DIR) + MESSAGE(STATUS "Found ${ARGV2} library") + + IF (NOT ${ARGV3} STREQUAL "") + ADM_CHECK_FUNCTION_EXISTS(${ARGV3} "${${prefix}_LIBRARY_DIR}" ${prefix}_FUNCTION_FOUND "${ARGV4}") + + IF (${prefix}_FUNCTION_FOUND) + SET(${prefix}_FOUND 1 CACHE INTERNAL "") + ENDIF (${prefix}_FUNCTION_FOUND) + ELSE (NOT ${ARGV3} STREQUAL "") + SET(${prefix}_FOUND 1 CACHE INTERNAL "") + ENDIF (NOT ${ARGV3} STREQUAL "") + ELSE (${prefix}_LIBRARY_DIR) + MESSAGE(STATUS "Cound not find ${ARGV2} library") + ENDIF (${prefix}_LIBRARY_DIR) + ELSE (_proceed AND NOT ${ARGV2} STREQUAL "") + SET(${prefix}_FOUND ${_proceed} CACHE INTERNAL "") + ENDIF (_proceed AND NOT ${ARGV2} STREQUAL "") + ENDIF (NOT DEFINED ${prefix}_FOUND) +ENDMACRO(FIND_HEADER_AND_LIB) + + +MACRO (ADM_COMPILE _file _def _include _lib _varToSet _output) + #MESSAGE(STATUS " ADM_compile <${_file}>") + IF(AVIDEMUX_THIS_IS_CORE) + SET(src ${AVIDEMUX_TOP_SOURCE_DIR}/cmake/cmake_compile_check/${_file}) + ELSE() + SET(src ${ADM_CMAKE_DIR}/cmake_compile_check/${_file}) + ENDIF() + #MESSAGE(STATUS " Compiling <${src}>") + IF (NOT DEFINED ${_varToSet}_COMPILED) + SET(${_varToSet}_COMPILED 1 CACHE INTERNAL "") + TRY_COMPILE(${_varToSet} + ${CMAKE_BINARY_DIR} + ${src} + CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${_include}" "-DLINK_LIBRARIES:STRING=${_lib}" + COMPILE_DEFINITIONS ${_def} + OUTPUT_VARIABLE ${_output}) + #MESSAGE(STATUS "output=${output}") + ENDIF (NOT DEFINED ${_varToSet}_COMPILED) +ENDMACRO (ADM_COMPILE) + + +#ARGV3 = extra libraries +#ARGV4 = extra compile flags +MACRO (ADM_CHECK_FUNCTION_EXISTS _function _lib _varToSet) + SET(CHECK_FUNCTION_DEFINE "-DCHECK_FUNCTION_EXISTS=${_function}" ${ARGV4}) + SET(CHECK_FUNCTION_LIB ${_lib} ${ARGV3}) + + ADM_COMPILE(CheckFunctionExists.c "${CHECK_FUNCTION_DEFINE}" "" "${CHECK_FUNCTION_LIB}" ${_varToSet} OUTPUT) + + IF (${_varToSet}) + MESSAGE(STATUS "Found ${_function} in ${_lib}") + ELSE (${_varToSet}) + MESSAGE(STATUS "Could not find ${_function} in ${_lib}") + + IF (VERBOSE) + MESSAGE(STATUS ${OUTPUT}) + ENDIF (VERBOSE) + ENDIF (${_varToSet}) +ENDMACRO (ADM_CHECK_FUNCTION_EXISTS) + + +MACRO (CHECK_CFLAGS_REQUIRED _file _cflags _include _lib _varToSet) + IF (NOT DEFINED ${_varToSet}_CFLAGS_CHECKED) + SET(${_varToSet}_CFLAGS_CHECKED 1 CACHE INTERNAL "") + + ADM_COMPILE(${_file} ${_cflags} ${_include} ${_lib} ${_varToSet}_COMPILE_WITH logwith) + ADM_COMPILE(${_file} "" ${_include} ${_lib} ${_varToSet}_COMPILE_WITHOUT logwithout) + + IF (${_varToSet}_COMPILE_WITH AND NOT ${_varToSet}_COMPILE_WITHOUT) + SET(${_varToSet} 1 CACHE INTERNAL "") + + IF (VERBOSE) + MESSAGE(STATUS "(${_cflags}) required") + ENDIF (VERBOSE) + ELSE (${_varToSet}_COMPILE_WITH AND NOT ${_varToSet}_COMPILE_WITHOUT) + IF (NOT ${_varToSet}_COMPILE_WITH AND ${_varToSet}_COMPILE_WITHOUT) + IF (VERBOSE) + MESSAGE (STATUS "(${_cflags}) not required") + ENDIF (VERBOSE) + ELSE (NOT ${_varToSet}_COMPILE_WITH AND ${_varToSet}_COMPILE_WITHOUT) + MESSAGE(STATUS "Inconsistent compiler output with: ${${_varToSet}_COMPILE_WITH}, without: ${${_varToSet}_COMPILE_WITHOUT}") + MESSAGE(STATUS "${logwith}") + MESSAGE(STATUS "") + MESSAGE(STATUS "${logwithout}") + endif(NOT ${_varToSet}_COMPILE_WITH AND ${_varToSet}_COMPILE_WITHOUT) + ENDIF (${_varToSet}_COMPILE_WITH AND NOT ${_varToSet}_COMPILE_WITHOUT) + ENDIF (NOT DEFINED ${_varToSet}_CFLAGS_CHECKED) +ENDMACRO (CHECK_CFLAGS_REQUIRED) + + +MACRO (APPEND_FLAGS _flags) + IF (NOT ${_flags}) + SET(${_flags} "") + ENDIF (NOT ${_flags}) + + FOREACH (_flag ${ARGN}) + SET(${_flags} "${${_flags}} ${_flag}") + ENDFOREACH (_flag ${ARGN}) + + IF (${firstChar} AND ${firstChar} STREQUAL " ") + STRING(LENGTH "${${_flags}}" stringLength) + MATH(EXPR stringLength "${stringLength} - 1") + STRING(SUBSTRING "${${_flags}}" 1 ${stringLength} ${_flags}) + ENDIF (${firstChar} AND ${firstChar} STREQUAL " ") +ENDMACRO (APPEND_FLAGS) + + +#ARGV1 = flags +MACRO (ADD_SOURCE_CFLAGS _target) + GET_SOURCE_FILE_PROPERTY(_flags ${_target} COMPILE_FLAGS) + APPEND_FLAGS(_flags ${ARGN}) + SET_SOURCE_FILES_PROPERTIES(${_target} PROPERTIES COMPILE_FLAGS "${_flags}") +ENDMACRO (ADD_SOURCE_CFLAGS) + + +MACRO (ADD_TARGET_CFLAGS _target) + GET_TARGET_PROPERTY(_flags ${_target} COMPILE_FLAGS) + APPEND_FLAGS(_flags ${ARGN}) + SET_TARGET_PROPERTIES(${_target} PROPERTIES COMPILE_FLAGS "${_flags}") +ENDMACRO (ADD_TARGET_CFLAGS) + + +MACRO (ADD_TARGET_DEFINITIONS _target) + SET(newflag) + GET_TARGET_PROPERTY(_flags ${_target} COMPILE_FLAGS) + + FOREACH (_def ${ARGN}) + IF (${_def}) + APPEND_FLAGS(_flags "-D${_def}") + SET(newflag 1) + ENDIF (${_def}) + ENDFOREACH (_def ${ARGN}) + + IF (newflag) + SET_TARGET_PROPERTIES(${_target} PROPERTIES COMPILE_FLAGS "${_flags}") + ENDIF (newflag) +ENDMACRO (ADD_TARGET_DEFINITIONS) + +MACRO(DUMP_ALL_VARS) + get_cmake_property(_variableNames VARIABLES) + list (SORT _variableNames) + foreach (_variableName ${_variableNames}) + message(STATUS "${_variableName}=${${_variableName}}") + endforeach() +ENDMACRO(DUMP_ALL_VARS) + diff --git a/cmake/admConfigSummary.cmake b/cmake/admConfigSummary.cmake index baa215727a..0b27c4bb19 100644 --- a/cmake/admConfigSummary.cmake +++ b/cmake/admConfigSummary.cmake @@ -1,95 +1,95 @@ -macro(INITIALISE_SUMMARY_LISTS) - foreach(componentType ${SUMMARY_LIST}) - GET_SUMMARY_LIST_NAME(listName ${componentType}) - unset(${listName} CACHE) - endforeach(componentType) - - set(SUMMARY_LIST "" CACHE INTERNAL "") -endmacro(INITIALISE_SUMMARY_LISTS) - -macro(GET_SUMMARY_LIST_NAME outVariable componentType) - string(REPLACE " " "_" safeComponentType "${componentType}") - set(${outVariable} "SUMMARY_${safeComponentType}") -endmacro(GET_SUMMARY_LIST_NAME) - -macro(APPEND_SUMMARY_LIST componentType componentName componentFound) - GET_SUMMARY_LIST_NAME(listName ${componentType}) - - if (${listName}) - set(${listName} ${${listName}} "${componentName}=${componentFound}" CACHE INTERNAL "") - else (${listName}) - if (SUMMARY_LIST) - set(SUMMARY_LIST ${componentType} ${SUMMARY_LIST} CACHE INTERNAL "") - else (SUMMARY_LIST) - set(SUMMARY_LIST ${componentType} CACHE INTERNAL "") - endif (SUMMARY_LIST) - - set(${listName} "${componentName}=${componentFound}" CACHE INTERNAL "") - endif (${listName}) -endmacro(APPEND_SUMMARY_LIST) - -function(padString outVariable length padCharacter value) - string(LENGTH "${value}" valueLength) - math(EXPR padLength "${length} - ${valueLength} - 1") - set(paddedValue ${value}) - - if (padLength GREATER -1) - foreach(dummy RANGE ${padLength}) - set(paddedValue "${paddedValue}${padCharacter}") - endforeach(dummy) - endif (padLength GREATER -1) - - set(${outVariable} "${paddedValue}" PARENT_SCOPE) -endfunction(padString) - -macro(COMPONENT_YESNO incoming componentName outgoing) - set(tmp ${incoming}) - string(REGEX REPLACE "=.*$" "" tmp2 ${tmp} ) - string(COMPARE EQUAL ${tmp} ${tmp2} match) - if(${match}) - set(${componentName} ${incoming}) - set(${outgoing} "No") - else(${match}) - set(${componentName} "${tmp2}") - string(REGEX REPLACE "^.*=" "" tmp3 ${tmp}) - string(COMPARE EQUAL "${tmp3}" "1" match) - string(COMPARE EQUAL "${tmp3}" "True" match2) - if(${match} OR ${match2}) - set(${outgoing} "Yes") - else(${match} OR ${match2}) - set(${outgoing} "No") - endif(${match} OR ${match2}) - endif(${match}) -endmacro(COMPONENT_YESNO incoming componentName outgoing) - -macro(DISPLAY_SUMMARY_LIST) - message("") - message("**************************") - message("*** Optional Library ***") - message("*** Summary ***") - message("**************************") - - foreach(componentType ${SUMMARY_LIST}) - GET_SUMMARY_LIST_NAME(listName ${componentType}) - - padString(componentType 18 " " "${componentType}") - message("*** ${componentType} ***") - - foreach(component ${${listName}}) - COMPONENT_YESNO( ${component} componentName componentSummary) - padString(componentName 14 " " "${componentName}") - message(" ${componentName} ${componentSummary}") - endforeach(component) - endforeach(componentType) - - message("**************************") - - if (CMAKE_BUILD_TYPE STREQUAL "Debug") - message("*** Debug Build ***") - else (CMAKE_BUILD_TYPE STREQUAL "Debug") - message("*** Release Build ***") - endif(CMAKE_BUILD_TYPE STREQUAL "Debug") - - message("**************************") - message("") -endmacro(DISPLAY_SUMMARY_LIST) +macro(INITIALISE_SUMMARY_LISTS) + foreach(componentType ${SUMMARY_LIST}) + GET_SUMMARY_LIST_NAME(listName ${componentType}) + unset(${listName} CACHE) + endforeach(componentType) + + set(SUMMARY_LIST "" CACHE INTERNAL "") +endmacro(INITIALISE_SUMMARY_LISTS) + +macro(GET_SUMMARY_LIST_NAME outVariable componentType) + string(REPLACE " " "_" safeComponentType "${componentType}") + set(${outVariable} "SUMMARY_${safeComponentType}") +endmacro(GET_SUMMARY_LIST_NAME) + +macro(APPEND_SUMMARY_LIST componentType componentName componentFound) + GET_SUMMARY_LIST_NAME(listName ${componentType}) + + if (${listName}) + set(${listName} ${${listName}} "${componentName}=${componentFound}" CACHE INTERNAL "") + else (${listName}) + if (SUMMARY_LIST) + set(SUMMARY_LIST ${componentType} ${SUMMARY_LIST} CACHE INTERNAL "") + else (SUMMARY_LIST) + set(SUMMARY_LIST ${componentType} CACHE INTERNAL "") + endif (SUMMARY_LIST) + + set(${listName} "${componentName}=${componentFound}" CACHE INTERNAL "") + endif (${listName}) +endmacro(APPEND_SUMMARY_LIST) + +function(padString outVariable length padCharacter value) + string(LENGTH "${value}" valueLength) + math(EXPR padLength "${length} - ${valueLength} - 1") + set(paddedValue ${value}) + + if (padLength GREATER -1) + foreach(dummy RANGE ${padLength}) + set(paddedValue "${paddedValue}${padCharacter}") + endforeach(dummy) + endif (padLength GREATER -1) + + set(${outVariable} "${paddedValue}" PARENT_SCOPE) +endfunction(padString) + +macro(COMPONENT_YESNO incoming componentName outgoing) + set(tmp ${incoming}) + string(REGEX REPLACE "=.*$" "" tmp2 ${tmp} ) + string(COMPARE EQUAL ${tmp} ${tmp2} match) + if(${match}) + set(${componentName} ${incoming}) + set(${outgoing} "No") + else(${match}) + set(${componentName} "${tmp2}") + string(REGEX REPLACE "^.*=" "" tmp3 ${tmp}) + string(COMPARE EQUAL "${tmp3}" "1" match) + string(COMPARE EQUAL "${tmp3}" "True" match2) + if(${match} OR ${match2}) + set(${outgoing} "Yes") + else(${match} OR ${match2}) + set(${outgoing} "No") + endif(${match} OR ${match2}) + endif(${match}) +endmacro(COMPONENT_YESNO incoming componentName outgoing) + +macro(DISPLAY_SUMMARY_LIST) + message("") + message("**************************") + message("*** Optional Library ***") + message("*** Summary ***") + message("**************************") + + foreach(componentType ${SUMMARY_LIST}) + GET_SUMMARY_LIST_NAME(listName ${componentType}) + + padString(componentType 18 " " "${componentType}") + message("*** ${componentType} ***") + + foreach(component ${${listName}}) + COMPONENT_YESNO( ${component} componentName componentSummary) + padString(componentName 14 " " "${componentName}") + message(" ${componentName} ${componentSummary}") + endforeach(component) + endforeach(componentType) + + message("**************************") + + if (CMAKE_BUILD_TYPE STREQUAL "Debug") + message("*** Debug Build ***") + else (CMAKE_BUILD_TYPE STREQUAL "Debug") + message("*** Release Build ***") + endif(CMAKE_BUILD_TYPE STREQUAL "Debug") + + message("**************************") + message("") +endmacro(DISPLAY_SUMMARY_LIST) diff --git a/cmake/admDetermineSystem.cmake b/cmake/admDetermineSystem.cmake index 9c5694758e..8e70eec6d3 100644 --- a/cmake/admDetermineSystem.cmake +++ b/cmake/admDetermineSystem.cmake @@ -1,111 +1,111 @@ -# Determine CPU and Operating System for GCC -# ADM_BIG_ENDIAN - big endian CPU detected -# ADM_BSD_FAMILY - BSD family operating system was detected -# ADM_CPU_ARMEL - ARM (min ARCH5) el -# ADM_CPU_ARM64 - ARM v8 CPU was detected -# ADM_CPU_64BIT - 64-bit CPU was detected -# ADM_CPU_X86 - x86 CPU architecture was detected -# ADM_CPU_X86_32 - x86 32-bit CPU architecture was detected -# ADM_CPU_X86_64 - x86 64-bit CPU architecture was detected - -MACRO (PERFORM_SYSTEM_TEST testFile testName testSupportedVarName) - IF (${ARGC} EQUAL 4) - SET (testFlags ${ARGV3}) - ELSE (${ARGC} EQUAL 4) - SET (testFlags "") - ENDIF (${ARGC} EQUAL 4) - - ADM_COMPILE(${testFile} "${testFlags}" "" "" ${testSupportedVarName} outputTest) - - IF (${testSupportedVarName}) - SET(testResult "Yes") - ELSE (${testSupportedVarName}) - SET(testResult "No") - ENDIF (${testSupportedVarName}) - - IF (${testSupportedVarName} OR VERBOSE) - MESSAGE(STATUS "Checking if compiler supports ${testName} - ${testResult}") - ENDIF (${testSupportedVarName} OR VERBOSE) - - IF (NOT ${testSupportedVarName} AND VERBOSE) - MESSAGE("Error Message: ${outputTest}") - ENDIF (NOT ${testSupportedVarName} AND VERBOSE) -ENDMACRO (PERFORM_SYSTEM_TEST) - -INCLUDE(TestBigEndian) - -MESSAGE(STATUS "Checking Compiler support") -MESSAGE(STATUS "*************************") - -######################################## -# Check OS support -######################################## -IF (UNIX) - PERFORM_SYSTEM_TEST(os_bsd_check.cpp "BSD family" BSD_SUPPORTED) - - IF (BSD_SUPPORTED) - SET(ADM_BSD_FAMILY 1) - ENDIF (BSD_SUPPORTED) -ENDIF (UNIX) - -######################################## -# Check CPU support -######################################## -IF(NOT MSVC) - PERFORM_SYSTEM_TEST(cpu_x86-64_check.cpp "x86 64-bit" X86_64_SUPPORTED) - - IF (CMAKE_SIZEOF_VOID_P EQUAL 8) - SET(ADM_CPU_64BIT 1) - ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 8) - - IF (X86_64_SUPPORTED) - SET(ADM_CPU_X86 1) - SET(ADM_CPU_X86_64 1) - ELSE (X86_64_SUPPORTED) - PERFORM_SYSTEM_TEST(cpu_x86_check.cpp "x86 32-bit" X86_32_SUPPORTED) - - IF (X86_32_SUPPORTED) - SET(ADM_CPU_X86 1) - SET(ADM_CPU_X86_32 1) - ELSE (X86_32_SUPPORTED) - PERFORM_SYSTEM_TEST(cpu_armel_check.cpp "ARM EL" ARMEL_SUPPORTED) - IF(ARMEL_SUPPORTED) - SET(ADM_CPU_ARMEL 1) - ELSE (ARMEL_SUPPORTED) - PERFORM_SYSTEM_TEST(cpu_arm64_check.cpp "ARM64" ARM64_SUPPORTED) - IF(ARM64_SUPPORTED) - SET(ADM_CPU_ARM64 1) - ELSE (ARM64_SUPPORTED) - PERFORM_SYSTEM_TEST(cpu_riscv_check.cpp "RISCV" RISCV_SUPPORTED) - IF(RISCV_SUPPORTED) - SET(ADM_CPU_RISCV 1) - SET(ADM_CPU_RISCV_64 1) - ELSE(RISCV_SUPPORTED) - PERFORM_SYSTEM_TEST(cpu_loong64_check.cpp "LOONGARCH64" LOONG64_SUPPORTED) - IF(LOONG64_SUPPORTED) - SET(ADM_CPU_LOONGARCH64 1) - ENDIF(LOONG64_SUPPORTED) - ENDIF(RISCV_SUPPORTED) - ENDIF(ARM64_SUPPORTED) - ENDIF(ARMEL_SUPPORTED) - ENDIF (X86_32_SUPPORTED) - ENDIF (X86_64_SUPPORTED) - - IF (NOT ADM_CPU_X86_32 AND NOT ADM_CPU_X86_64 AND NOT ADM_CPU_ARMEL AND NOT ADM_CPU_ARM64 AND NOT ADM_CPU_RISCV AND NOT ADM_CPU_RISCV_64 AND NOT ADM_CPU_LOONGARCH64) - MESSAGE(FATAL_ERROR "CPU not supported") - ENDIF (NOT ADM_CPU_X86_32 AND NOT ADM_CPU_X86_64 AND NOT ADM_CPU_ARMEL AND NOT ADM_CPU_ARM64 AND NOT ADM_CPU_RISCV AND NOT ADM_CPU_RISCV_64 AND NOT ADM_CPU_LOONGARCH64) - - TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN) - - IF (CMAKE_WORDS_BIGENDIAN) - SET(ADM_BIG_ENDIAN 1) - ENDIF (CMAKE_WORDS_BIGENDIAN) -ELSE(NOT MSVC) - MESSAGE(STATUS "Microsoft compiler, assuming 64 bits x86") - SET(ADM_CPU_64BIT 1) - SET(ADM_CPU_X86 1) - SET(ADM_CPU_X86_64 1) - ADD_DEFINITIONS("/F40000000 -D__STDC_LIMIT_MACROS") # increase stack size to 4M, linux32 is 2 MB by default, MS is 1MB by default -ENDIF(NOT MSVC) - -MESSAGE("") +# Determine CPU and Operating System for GCC +# ADM_BIG_ENDIAN - big endian CPU detected +# ADM_BSD_FAMILY - BSD family operating system was detected +# ADM_CPU_ARMEL - ARM (min ARCH5) el +# ADM_CPU_ARM64 - ARM v8 CPU was detected +# ADM_CPU_64BIT - 64-bit CPU was detected +# ADM_CPU_X86 - x86 CPU architecture was detected +# ADM_CPU_X86_32 - x86 32-bit CPU architecture was detected +# ADM_CPU_X86_64 - x86 64-bit CPU architecture was detected + +MACRO (PERFORM_SYSTEM_TEST testFile testName testSupportedVarName) + IF (${ARGC} EQUAL 4) + SET (testFlags ${ARGV3}) + ELSE (${ARGC} EQUAL 4) + SET (testFlags "") + ENDIF (${ARGC} EQUAL 4) + + ADM_COMPILE(${testFile} "${testFlags}" "" "" ${testSupportedVarName} outputTest) + + IF (${testSupportedVarName}) + SET(testResult "Yes") + ELSE (${testSupportedVarName}) + SET(testResult "No") + ENDIF (${testSupportedVarName}) + + IF (${testSupportedVarName} OR VERBOSE) + MESSAGE(STATUS "Checking if compiler supports ${testName} - ${testResult}") + ENDIF (${testSupportedVarName} OR VERBOSE) + + IF (NOT ${testSupportedVarName} AND VERBOSE) + MESSAGE("Error Message: ${outputTest}") + ENDIF (NOT ${testSupportedVarName} AND VERBOSE) +ENDMACRO (PERFORM_SYSTEM_TEST) + +INCLUDE(TestBigEndian) + +MESSAGE(STATUS "Checking Compiler support") +MESSAGE(STATUS "*************************") + +######################################## +# Check OS support +######################################## +IF (UNIX) + PERFORM_SYSTEM_TEST(os_bsd_check.cpp "BSD family" BSD_SUPPORTED) + + IF (BSD_SUPPORTED) + SET(ADM_BSD_FAMILY 1) + ENDIF (BSD_SUPPORTED) +ENDIF (UNIX) + +######################################## +# Check CPU support +######################################## +IF(NOT MSVC) + PERFORM_SYSTEM_TEST(cpu_x86-64_check.cpp "x86 64-bit" X86_64_SUPPORTED) + + IF (CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(ADM_CPU_64BIT 1) + ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 8) + + IF (X86_64_SUPPORTED) + SET(ADM_CPU_X86 1) + SET(ADM_CPU_X86_64 1) + ELSE (X86_64_SUPPORTED) + PERFORM_SYSTEM_TEST(cpu_x86_check.cpp "x86 32-bit" X86_32_SUPPORTED) + + IF (X86_32_SUPPORTED) + SET(ADM_CPU_X86 1) + SET(ADM_CPU_X86_32 1) + ELSE (X86_32_SUPPORTED) + PERFORM_SYSTEM_TEST(cpu_armel_check.cpp "ARM EL" ARMEL_SUPPORTED) + IF(ARMEL_SUPPORTED) + SET(ADM_CPU_ARMEL 1) + ELSE (ARMEL_SUPPORTED) + PERFORM_SYSTEM_TEST(cpu_arm64_check.cpp "ARM64" ARM64_SUPPORTED) + IF(ARM64_SUPPORTED) + SET(ADM_CPU_ARM64 1) + ELSE (ARM64_SUPPORTED) + PERFORM_SYSTEM_TEST(cpu_riscv_check.cpp "RISCV" RISCV_SUPPORTED) + IF(RISCV_SUPPORTED) + SET(ADM_CPU_RISCV 1) + SET(ADM_CPU_RISCV_64 1) + ELSE(RISCV_SUPPORTED) + PERFORM_SYSTEM_TEST(cpu_loong64_check.cpp "LOONGARCH64" LOONG64_SUPPORTED) + IF(LOONG64_SUPPORTED) + SET(ADM_CPU_LOONGARCH64 1) + ENDIF(LOONG64_SUPPORTED) + ENDIF(RISCV_SUPPORTED) + ENDIF(ARM64_SUPPORTED) + ENDIF(ARMEL_SUPPORTED) + ENDIF (X86_32_SUPPORTED) + ENDIF (X86_64_SUPPORTED) + + IF (NOT ADM_CPU_X86_32 AND NOT ADM_CPU_X86_64 AND NOT ADM_CPU_ARMEL AND NOT ADM_CPU_ARM64 AND NOT ADM_CPU_RISCV AND NOT ADM_CPU_RISCV_64 AND NOT ADM_CPU_LOONGARCH64) + MESSAGE(FATAL_ERROR "CPU not supported") + ENDIF (NOT ADM_CPU_X86_32 AND NOT ADM_CPU_X86_64 AND NOT ADM_CPU_ARMEL AND NOT ADM_CPU_ARM64 AND NOT ADM_CPU_RISCV AND NOT ADM_CPU_RISCV_64 AND NOT ADM_CPU_LOONGARCH64) + + TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN) + + IF (CMAKE_WORDS_BIGENDIAN) + SET(ADM_BIG_ENDIAN 1) + ENDIF (CMAKE_WORDS_BIGENDIAN) +ELSE(NOT MSVC) + MESSAGE(STATUS "Microsoft compiler, assuming 64 bits x86") + SET(ADM_CPU_64BIT 1) + SET(ADM_CPU_X86 1) + SET(ADM_CPU_X86_64 1) + ADD_DEFINITIONS("/F40000000 -D__STDC_LIMIT_MACROS") # increase stack size to 4M, linux32 is 2 MB by default, MS is 1MB by default +ENDIF(NOT MSVC) + +MESSAGE("") diff --git a/cmake/admFFmpegBuild.cmake b/cmake/admFFmpegBuild.cmake index 2a400e8ba1..0f24921605 100644 --- a/cmake/admFFmpegBuild.cmake +++ b/cmake/admFFmpegBuild.cmake @@ -1,17 +1,17 @@ -include(avidemuxVersion) -IF(WIN32) - IF(CROSS) - MESSAGE(STATUS "Using mingw Cross compiler setup") - include(admFFmpegBuild_crossMingw) - ELSE(CROSS) - IF(NOT VS_IMPORT) - include(admFFmpegBuild_vs) - ELSE(NOT VS_IMPORT) - include(admFFmpegBuild_vs_import) - ENDIF(NOT VS_IMPORT) - ENDIF(CROSS) - -ELSE(WIN32) - MESSAGE(STATUS "Using native unix setup") - include(admFFmpegBuild_native) -ENDIF(WIN32) +include(avidemuxVersion) +IF(WIN32) + IF(CROSS) + MESSAGE(STATUS "Using mingw Cross compiler setup") + include(admFFmpegBuild_crossMingw) + ELSE(CROSS) + IF(NOT VS_IMPORT) + include(admFFmpegBuild_vs) + ELSE(NOT VS_IMPORT) + include(admFFmpegBuild_vs_import) + ENDIF(NOT VS_IMPORT) + ENDIF(CROSS) + +ELSE(WIN32) + MESSAGE(STATUS "Using native unix setup") + include(admFFmpegBuild_native) +ENDIF(WIN32) diff --git a/cmake/admFFmpegBuild.cmake.original b/cmake/admFFmpegBuild.cmake.original index 43a135ceb5..fdec7b5acd 100644 --- a/cmake/admFFmpegBuild.cmake.original +++ b/cmake/admFFmpegBuild.cmake.original @@ -1,418 +1,418 @@ -MACRO (xadd opt) - if ("${ARGV1}" STREQUAL "") - set(FFMPEG_FLAGS "${FFMPEG_FLAGS} ${opt}") - else ("${ARGV1}" STREQUAL "") - string(STRIP ${ARGV1} arg) - set(FFMPEG_FLAGS "${FFMPEG_FLAGS} ${opt}=\"${arg}\"") - endif ("${ARGV1}" STREQUAL "") -ENDMACRO (xadd) - -option(FF_INHERIT_BUILD_ENV "" ON) - -set(FFMPEG_VERSION "3.0.3") -set(FFMPEG_ROOT_DIR "${AVIDEMUX_TOP_SOURCE_DIR}/avidemux_core/ffmpeg_package") -set(FFMPEG_PATCH_DIR "${FFMPEG_ROOT_DIR}/patches/") -set(FFMPEG_SOURCE_ARCHIVE "ffmpeg-${FFMPEG_VERSION}.tar.bz2") -set(FFMPEG_SOURCE_ARCHIVE_DIR "ffmpeg-${FFMPEG_VERSION}") -set(FFMPEG_EXTRACT_DIR "${CMAKE_BINARY_DIR}") -set(FFMPEG_BASE_DIR "${FFMPEG_EXTRACT_DIR}/ffmpeg") -set(FFMPEG_SOURCE_DIR "${FFMPEG_BASE_DIR}/source") -set(FFMPEG_BINARY_DIR "${FFMPEG_BASE_DIR}/build") - -set(FFMPEG_DECODERS aac ac3 eac3 adpcm_ima_amv amv bmp cinepak cyuv dca dvbsub dvvideo ffv1 ffvhuff flv fraps h263 h264 - hevc huffyuv mjpeg - mjpegb mpeg2video mpeg4 msmpeg4v2 msmpeg4v3 msvideo1 nellymoser png qdm2 rawvideo snow - svq3 theora tscc mp2 mp3 mp2_float mp3_float - vc1 vp3 vp6 vp6a vp6f vp8 vp9 wmapro wmav2 wmv1 wmv2 wmv3 cscd lagarith flac vorbis) -set(FFMPEG_ENCODERS ac3 ac3_float dvvideo ffv1 ffvhuff flv h263 huffyuv mjpeg mp2 mpeg1video mpeg2video mpeg4 snow aac dca flac) -set(FFMPEG_MUXERS flv matroska mpeg1vcd mpeg2dvd mpeg2svcd mpegts mov mp4 psp webm) -set(FFMPEG_PARSERS ac3 h263 h264 hevc mpeg4video) -set(FFMPEG_PROTOCOLS file) -set(FFMPEG_BSFS h264_mp4toannexb aac_adtstoasc) -xadd("--enable-shared --disable-static --disable-everything --disable-avfilter --enable-hwaccels --enable-postproc --enable-gpl") -xadd("--enable-runtime-cpudetect --disable-network ") -xadd("--enable-swscale --disable-swresample") -xadd("--disable-doc --disable-programs") - -FIND_HEADER_AND_LIB(_X265 x265.h) -FIND_HEADER_AND_LIB(_X265_CONFIG x265_config.h) - -IF (_X265_FOUND AND _X265_CONFIG_FOUND) -# xadd("--enable-libx265") -# message("adding --enable-libx265 to ffmpeg protocols") -ENDIF (_X265_FOUND AND _X265_CONFIG_FOUND) -xadd("--disable-libx265") -xadd("--disable-libx264") -IF(USE_NVENC) - SET(FFMPEG_ENCODERS ${FFMPEG_ENCODERS} nvenc) - xadd("--enable-nonfree") - xadd("--enable-nvenc") - set(FFMPEG_ENCODERS ${FFMPEG_ENCODERS} nvenc_h264 nvenc_hevc) -ENDIF(USE_NVENC) - -if (NOT CROSS) - xadd(--prefix ${CMAKE_INSTALL_PREFIX}) -endif (NOT CROSS) - -# Clean FFmpeg -set_directory_properties(${CMAKE_CURRENT_BINARY_DIR} ADDITIONAL_MAKE_CLEAN_FILES "${FFMPEG_BASE_DIR}") - -# Prepare FFmpeg source -include(admFFmpegUtil) -include(admFFmpegPrepareTar) - -if (NOT FFMPEG_PREPARED) - include(admFFmpegPrepareGit) -endif (NOT FFMPEG_PREPARED) - -message("") - -if (FFMPEG_PERFORM_PATCH) - find_package(Patch) - - # my patches - file(GLOB patchFiles "${FFMPEG_PATCH_DIR}/*.patch") - - foreach(patchFile ${patchFiles}) - get_filename_component(short ${patchFile} NAME) - MESSAGE(STATUS "-- Mine, Applying patch <${short}> --") - patch_file("${FFMPEG_SOURCE_DIR}" "${patchFile}") - endforeach(patchFile) - # XVBA patch from xbmc_dxva - IF(XVBA_NOT_ENABLED_FOR_NOW) #<------------------- - file(GLOB patchFilesXvba "${FFMPEG_PATCH_DIR}/xvba/*.patch") - - foreach(patchFileXvba ${patchFilesXvba}) - get_filename_component(short ${patchFileXvba} NAME) - MESSAGE(STATUS "-- DXVA, Applying patch <${short}> --") - patch_file_p1("${FFMPEG_SOURCE_DIR}" "${patchFileXvba}") - endforeach(patchFileXvba) - ENDIF(XVBA_NOT_ENABLED_FOR_NOW) #<------------------- - - # - if (UNIX ) - MESSAGE(STATUS "Patching Linux common.mak") - patch_file("${FFMPEG_SOURCE_DIR}" "${FFMPEG_PATCH_DIR}/common.mak.diff") - endif (UNIX ) - IF(WIN32) - IF("${CROSS_C_COMPILER}" STREQUAL "clang") - patch_file("${FFMPEG_SOURCE_DIR}" "${FFMPEG_PATCH_DIR}/clang_win32_workaround.diff") - ENDIF("${CROSS_C_COMPILER}" STREQUAL "clang") - ENDIF(WIN32) - - message("") -endif (FFMPEG_PERFORM_PATCH) - -if (USE_VDPAU) - xadd(--enable-vdpau) - set(FFMPEG_DECODERS ${FFMPEG_DECODERS} h264_vdpau vc1_vdpau mpeg1_vdpau mpeg_vdpau wmv3_vdpau) -endif (USE_VDPAU) - -if (USE_LIBVA) - xadd(--enable-vaapi) - set(FFMPEG_DECODERS ${FFMPEG_DECODERS} h264_vaapi hevc_vaapi) -endif (USE_LIBVA) - - -#if(USE_XVBA) - #xadd(--enable-xvba) -#else(USE_XVBA) - #xadd(--disable-xvba) -#endif(USE_XVBA) - - - -# Configure FFmpeg, if required -foreach (decoder ${FFMPEG_DECODERS}) - xadd(--enable-decoder ${decoder}) -endforeach (decoder) - -foreach (encoder ${FFMPEG_ENCODERS}) - xadd(--enable-encoder ${encoder}) -endforeach (encoder) - -foreach (muxer ${FFMPEG_MUXERS}) - xadd(--enable-muxer ${muxer}) -endforeach (muxer) - -foreach (parser ${FFMPEG_PARSERS}) - xadd(--enable-parser ${parser}) -endforeach (parser) - -foreach (protocol ${FFMPEG_PROTOCOLS}) - xadd(--enable-protocol ${protocol}) -endforeach (protocol) - -foreach (bistream ${FFMPEG_BSFS}) - xadd(--enable-bsf ${bistream}) -endforeach (bistream) - -if (WIN32) - if (ADM_CPU_X86_32) - IF("${CROSS_C_COMPILER}" STREQUAL "clang") - # With clang we use the -mstackrealign -mstack-alignment=16 - ELSE("${CROSS_C_COMPILER}" STREQUAL "clang") - # Old win32, for hack, not sure it really works with recent gcc - xadd(--enable-memalign-hack) - ENDIF("${CROSS_C_COMPILER}" STREQUAL "clang") - endif (ADM_CPU_X86_32) - - xadd(--enable-w32threads) -else (WIN32) - xadd(--enable-pthreads) -endif (WIN32) - -if (NOT ADM_DEBUG) - xadd(--disable-debug) -endif (NOT ADM_DEBUG) - -# Cross compiler override (win32 & win64) -if (CROSS) - if(APPLE) - xadd(--prefix /opt/mac) - xadd(--host-cc gcc) - xadd(--nm ${CMAKE_CROSS_PREFIX}-nm) - xadd(--strip ${CMAKE_CROSS_PREFIX}-strip) - - set(CROSS_OS darwin) - set(CROSS_ARCH i386) - else(APPLE) - xadd(--prefix ${CROSS}) - xadd(--host-cc gcc) - xadd(--nm ${CMAKE_CROSS_PREFIX}-nm) - xadd(--extra-cflags -I${CROSS}/include) - if (CMAKE_C_FLAGS) - xadd(--extra-cflags ${CMAKE_C_FLAGS}) - xadd(--extra-ldflags ${CMAKE_C_FLAGS}) - endif (CMAKE_C_FLAGS) - - set(CROSS_OS mingw32) - - if (ADM_CPU_64BIT) - set(CROSS_ARCH x86_64) - else (ADM_CPU_64BIT) - set(CROSS_ARCH i386) - endif (ADM_CPU_64BIT) - endif(APPLE) - - message(STATUS "Using cross compilation flag: ${FFMPEG_FLAGS}") -endif (CROSS) - -if (FF_INHERIT_BUILD_ENV) - xadd(--cc "${CMAKE_C_COMPILER}") - xadd(--ld "${CMAKE_C_COMPILER}") - xadd(--ar "${CMAKE_AR}") - # nm should be ok if we do not cross compile - if(CMAKE_LD_FLAGS) - xadd(--extra-ldflags ${CMAKE_LD_FLAGS}) - endif(CMAKE_LD_FLAGS) - if (CMAKE_C_FLAGS) - xadd(--extra-cflags ${CMAKE_C_FLAGS}) - endif (CMAKE_C_FLAGS) - - if (CMAKE_SHARED_LINKER_FLAGS) - xadd(--extra-ldflags ${CMAKE_SHARED_LINKER_FLAGS}) - endif (CMAKE_SHARED_LINKER_FLAGS) - - if (VERBOSE) - # for ffmpeg to use the same compiler as others - MESSAGE(STATUS "Building ffmpeg with CC=${CMAKE_C_COMPILER}") - MESSAGE(STATUS "Building ffmpeg with LD=${CMAKE_C_COMPILER}") - MESSAGE(STATUS "Building ffmpeg with AR=${CMAKE_AR}") - MESSAGE(STATUS "Building ffmpeg with CMAKE_C_FLAGS=${CMAKE_C_FLAGS}") - MESSAGE(STATUS "Building ffmpeg with CFLAGS=${FF_FLAGS}") - MESSAGE(STATUS "Building ffmpeg with CFLAGS2=${FFMPEG_FLAGS}") - message("") - endif (VERBOSE) -endif (FF_INHERIT_BUILD_ENV) - -if (CROSS_ARCH OR CROSS_OS) - xadd(--enable-cross-compile) -endif (CROSS_ARCH OR CROSS_OS) - -if (CROSS_ARCH) - set(CROSS_ARCH "${CROSS_ARCH}" CACHE STRING "") - xadd(--arch ${CROSS_ARCH}) -endif (CROSS_ARCH) - -if (CROSS_OS) - set(CROSS_OS "${CROSS_OS}" CACHE STRING "") - xadd(--target-os ${CROSS_OS}) -endif (CROSS_OS) - -if (FF_FLAGS) - set(FF_FLAGS "${FF_FLAGS}" CACHE STRING "") - xadd(${FF_FLAGS}) -endif (FF_FLAGS) -IF(WIN32) - IF(USE_DXVA2) - xadd(--enable-dxva2) - set(FFMPEG_DECODERS ${FFMPEG_DECODERS} h264_dxva2 hevc_dxva2) - ENDIF(USE_DXVA2) -ENDIF(WIN32) - -if (NOT "${LAST_FFMPEG_FLAGS}" STREQUAL "${FFMPEG_FLAGS}") - set(FFMPEG_PERFORM_BUILD 1) -endif (NOT "${LAST_FFMPEG_FLAGS}" STREQUAL "${FFMPEG_FLAGS}") - -if (NOT EXISTS "${FFMPEG_BINARY_DIR}/Makefile") - set(FFMPEG_PERFORM_BUILD 1) -endif (NOT EXISTS "${FFMPEG_BINARY_DIR}/Makefile") - -if (FFMPEG_PERFORM_BUILD) - find_package(Bourne) - find_package(GnuMake) - - message(STATUS "Configuring FFmpeg") - set(LAST_FFMPEG_FLAGS "${FFMPEG_FLAGS}" CACHE STRING "" FORCE) - - file(MAKE_DIRECTORY "${FFMPEG_BINARY_DIR}") - file(REMOVE "${FFMPEG_BINARY_DIR}/ffmpeg${CMAKE_EXECUTABLE_SUFFIX}") - file(REMOVE "${FFMPEG_BINARY_DIR}/ffmpeg_g${CMAKE_EXECUTABLE_SUFFIX}") - - set(ffmpeg_bash_directory ${BASH_EXECUTABLE}) - convertPathToUnix(ffmpeg_bash_directory ${BASH_EXECUTABLE}) - get_filename_component(ffmpeg_bash_directory ${ffmpeg_bash_directory} PATH) - configure_file("${AVIDEMUX_TOP_SOURCE_DIR}/cmake/ffmpeg_configure.sh.cmake" "${FFMPEG_BINARY_DIR}/ffmpeg_configure.sh") - - execute_process(COMMAND ${BASH_EXECUTABLE} ffmpeg_configure.sh WORKING_DIRECTORY "${FFMPEG_BINARY_DIR}" - OUTPUT_VARIABLE FFMPEG_CONFIGURE_OUTPUT RESULT_VARIABLE FFMPEG_CONFIGURE_RESULT) - - if (NOT (FFMPEG_CONFIGURE_RESULT EQUAL 0)) - MESSAGE(ERROR "configure returned <${FFMPEG_CONFIGURE_RESULT}>") - MESSAGE(ERROR "configure output is <${FFMPEG_CONFIGURE_OUTPUT}>") - MESSAGE(FATAL_ERROR "An error occured ") - endif (NOT (FFMPEG_CONFIGURE_RESULT EQUAL 0)) - - MESSAGE(STATUS "Configuring done, processing") - - if (ADM_CPU_X86) - file(READ ${FFMPEG_BINARY_DIR}/config.h FF_CONFIG_H) - string(REGEX MATCH "#define[ ]+HAVE_YASM[ ]+1" FF_YASM "${FF_CONFIG_H}") - - if (NOT FF_YASM) - message(FATAL_ERROR "Yasm was not found.") - endif (NOT FF_YASM) - endif (ADM_CPU_X86) - - execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "libavutil" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/config") - - execute_process(COMMAND ${CMAKE_COMMAND} -E copy "./libavutil/avconfig.h" "${CMAKE_BINARY_DIR}/config/libavutil" - WORKING_DIRECTORY "${FFMPEG_BINARY_DIR}") - - if (UNIX) - find_package(Patch) - IF(APPLE) - MESSAGE(STATUS "Patching config.mak - mac(2)") - patch_file("${FFMPEG_BINARY_DIR}" "${FFMPEG_PATCH_DIR}/config.mak.mac.diff") - ELSE(APPLE) - MESSAGE(STATUS "Patching config.mak - linux (2)") - patch_file("${FFMPEG_BINARY_DIR}" "${FFMPEG_PATCH_DIR}/config.mak.diff") - ENDIF(APPLE) - endif (UNIX) - - message("") -endif (FFMPEG_PERFORM_BUILD) - -# Build FFmpeg -getFfmpegLibNames("${FFMPEG_SOURCE_DIR}") - -set(ffmpeg_gnumake_executable ${GNUMAKE_EXECUTABLE}) -convertPathToUnix(ffmpeg_gnumake_executable ${BASH_EXECUTABLE}) -configure_file("${AVIDEMUX_TOP_SOURCE_DIR}/cmake/ffmpeg_make.sh.cmake" "${FFMPEG_BINARY_DIR}/ffmpeg_make.sh") -registerFFmpeg("${FFMPEG_SOURCE_DIR}" "${FFMPEG_BINARY_DIR}" 0) - -if(CMAKE_HOST_UNIX) - add_custom_target( libavutil_dummy - COMMAND ${CMAKE_BUILD_TOOL} -j 4 # We assume make or gnumake when host is unix - WORKING_DIRECTORY "${FFMPEG_BINARY_DIR}") -else(CMAKE_HOST_UNIX) - add_custom_target( libavutil_dummy - COMMAND ${BASH_EXECUTABLE} ffmpeg_make.sh # Host is win32, wrap - WORKING_DIRECTORY "${FFMPEG_BINARY_DIR}") -endif(CMAKE_HOST_UNIX) - - -MACRO(FF_ADD_SUBLIB lib) - add_custom_command( - OUTPUT "${lib}" - DEPENDS libavutil_dummy - COMMAND ${BASH_EXECUTABLE} -c echo "placeHolder") - -ENDMACRO(FF_ADD_SUBLIB lib) - -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavutil/${LIBAVUTIL_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavcodec/${LIBAVCODEC_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavformat/${LIBAVFORMAT_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libpostproc/${LIBPOSTPROC_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libswscale/${LIBSWSCALE_LIB}" ) - - -MACRO(FF_ADD_SUBLIB lib) - add_custom_command( - OUTPUT "${lib}" - DEPENDS "${FFMPEG_BINARY_DIR}/libavcodec/${LIBAVCODEC_LIB}" - COMMAND ${BASH_EXECUTABLE} -c echo "placeHolder") - -ENDMACRO(FF_ADD_SUBLIB lib) - -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavutil/${LIBAVUTIL_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavformat/${LIBAVFORMAT_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libpostproc/${LIBPOSTPROC_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libswscale/${LIBSWSCALE_LIB}" ) - - -# Add and INSTALL libraries -include_directories("${FFMPEG_SOURCE_DIR}") -include_directories("${FFMPEG_BINARY_DIR}") - -ADM_INSTALL_LIB_FILES("${FFMPEG_BINARY_DIR}/libswscale/${LIBSWSCALE_LIB}") -ADM_INSTALL_LIB_FILES("${FFMPEG_BINARY_DIR}/libpostproc/${LIBPOSTPROC_LIB}") -ADM_INSTALL_LIB_FILES("${FFMPEG_BINARY_DIR}/libavutil/${LIBAVUTIL_LIB}") -ADM_INSTALL_LIB_FILES("${FFMPEG_BINARY_DIR}/libavcodec/${LIBAVCODEC_LIB}") -ADM_INSTALL_LIB_FILES("${FFMPEG_BINARY_DIR}/libavformat/${LIBAVFORMAT_LIB}") - -INSTALL(FILES "${FFMPEG_BINARY_DIR}/libavutil/avconfig.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavutil" COMPONENT dev) -IF(USE_LIBVA) - INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/vaapi.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) - INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/vaapi_internal.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) -ENDIF(USE_LIBVA) - -IF(USE_DXVA2) - INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/dxva2.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) - INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/dxva2_internal.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) -ENDIF(USE_DXVA2) -IF(USE_XVBA) - INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/xvba.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) - INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/xvba_internal.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) -ENDIF(USE_XVBA) -INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/avcodec.h" "${FFMPEG_SOURCE_DIR}/libavcodec/vdpau.h" - "${FFMPEG_SOURCE_DIR}/libavcodec/version.h" - "${FFMPEG_SOURCE_DIR}/libavcodec/audioconvert.h" - #"${FFMPEG_SOURCE_DIR}/libavcodec/internal.h" - DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) -INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavformat/avformat.h" "${FFMPEG_SOURCE_DIR}/libavformat/avio.h" - "${FFMPEG_SOURCE_DIR}/libavformat/version.h" - "${FFMPEG_SOURCE_DIR}/libavformat/flv.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavformat" COMPONENT dev) -INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavutil/attributes.h" "${FFMPEG_SOURCE_DIR}/libavutil/avutil.h" - "${FFMPEG_SOURCE_DIR}/libavutil/buffer.h" - "${FFMPEG_SOURCE_DIR}/libavutil/bswap.h" "${FFMPEG_SOURCE_DIR}/libavutil/common.h" - "${FFMPEG_SOURCE_DIR}/libavutil/cpu.h" "${FFMPEG_SOURCE_DIR}/libavutil/frame.h" - "${FFMPEG_SOURCE_DIR}/libavutil/log.h" "${FFMPEG_SOURCE_DIR}/libavutil/mathematics.h" - "${FFMPEG_SOURCE_DIR}/libavutil/mem.h" "${FFMPEG_SOURCE_DIR}/libavutil/pixfmt.h" - "${FFMPEG_SOURCE_DIR}/libavutil/pixdesc.h" - "${FFMPEG_SOURCE_DIR}/libavutil/channel_layout.h" - "${FFMPEG_SOURCE_DIR}/libavutil/error.h" - "${FFMPEG_SOURCE_DIR}/libavutil/dict.h" - "${FFMPEG_SOURCE_DIR}/libavutil/version.h" - "${FFMPEG_SOURCE_DIR}/libavutil/time.h" - "${FFMPEG_SOURCE_DIR}/libavutil/opt.h" - "${FFMPEG_SOURCE_DIR}/libavutil/intfloat.h" - "${FFMPEG_SOURCE_DIR}/libavutil/macros.h" - "${FFMPEG_SOURCE_DIR}/libavutil/samplefmt.h" - "${FFMPEG_SOURCE_DIR}/libavutil/rational.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavutil" COMPONENT dev) -INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libpostproc/postprocess.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libpostproc" COMPONENT dev) -INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libpostproc/version.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libpostproc" COMPONENT dev) -INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libswscale/swscale.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libswscale" COMPONENT dev) -INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libswscale/version.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libswscale" COMPONENT dev) +MACRO (xadd opt) + if ("${ARGV1}" STREQUAL "") + set(FFMPEG_FLAGS "${FFMPEG_FLAGS} ${opt}") + else ("${ARGV1}" STREQUAL "") + string(STRIP ${ARGV1} arg) + set(FFMPEG_FLAGS "${FFMPEG_FLAGS} ${opt}=\"${arg}\"") + endif ("${ARGV1}" STREQUAL "") +ENDMACRO (xadd) + +option(FF_INHERIT_BUILD_ENV "" ON) + +set(FFMPEG_VERSION "3.0.3") +set(FFMPEG_ROOT_DIR "${AVIDEMUX_TOP_SOURCE_DIR}/avidemux_core/ffmpeg_package") +set(FFMPEG_PATCH_DIR "${FFMPEG_ROOT_DIR}/patches/") +set(FFMPEG_SOURCE_ARCHIVE "ffmpeg-${FFMPEG_VERSION}.tar.bz2") +set(FFMPEG_SOURCE_ARCHIVE_DIR "ffmpeg-${FFMPEG_VERSION}") +set(FFMPEG_EXTRACT_DIR "${CMAKE_BINARY_DIR}") +set(FFMPEG_BASE_DIR "${FFMPEG_EXTRACT_DIR}/ffmpeg") +set(FFMPEG_SOURCE_DIR "${FFMPEG_BASE_DIR}/source") +set(FFMPEG_BINARY_DIR "${FFMPEG_BASE_DIR}/build") + +set(FFMPEG_DECODERS aac ac3 eac3 adpcm_ima_amv amv bmp cinepak cyuv dca dvbsub dvvideo ffv1 ffvhuff flv fraps h263 h264 + hevc huffyuv mjpeg + mjpegb mpeg2video mpeg4 msmpeg4v2 msmpeg4v3 msvideo1 nellymoser png qdm2 rawvideo snow + svq3 theora tscc mp2 mp3 mp2_float mp3_float + vc1 vp3 vp6 vp6a vp6f vp8 vp9 wmapro wmav2 wmv1 wmv2 wmv3 cscd lagarith flac vorbis) +set(FFMPEG_ENCODERS ac3 ac3_float dvvideo ffv1 ffvhuff flv h263 huffyuv mjpeg mp2 mpeg1video mpeg2video mpeg4 snow aac dca flac) +set(FFMPEG_MUXERS flv matroska mpeg1vcd mpeg2dvd mpeg2svcd mpegts mov mp4 psp webm) +set(FFMPEG_PARSERS ac3 h263 h264 hevc mpeg4video) +set(FFMPEG_PROTOCOLS file) +set(FFMPEG_BSFS h264_mp4toannexb aac_adtstoasc) +xadd("--enable-shared --disable-static --disable-everything --disable-avfilter --enable-hwaccels --enable-postproc --enable-gpl") +xadd("--enable-runtime-cpudetect --disable-network ") +xadd("--enable-swscale --disable-swresample") +xadd("--disable-doc --disable-programs") + +FIND_HEADER_AND_LIB(_X265 x265.h) +FIND_HEADER_AND_LIB(_X265_CONFIG x265_config.h) + +IF (_X265_FOUND AND _X265_CONFIG_FOUND) +# xadd("--enable-libx265") +# message("adding --enable-libx265 to ffmpeg protocols") +ENDIF (_X265_FOUND AND _X265_CONFIG_FOUND) +xadd("--disable-libx265") +xadd("--disable-libx264") +IF(USE_NVENC) + SET(FFMPEG_ENCODERS ${FFMPEG_ENCODERS} nvenc) + xadd("--enable-nonfree") + xadd("--enable-nvenc") + set(FFMPEG_ENCODERS ${FFMPEG_ENCODERS} nvenc_h264 nvenc_hevc) +ENDIF(USE_NVENC) + +if (NOT CROSS) + xadd(--prefix ${CMAKE_INSTALL_PREFIX}) +endif (NOT CROSS) + +# Clean FFmpeg +set_directory_properties(${CMAKE_CURRENT_BINARY_DIR} ADDITIONAL_MAKE_CLEAN_FILES "${FFMPEG_BASE_DIR}") + +# Prepare FFmpeg source +include(admFFmpegUtil) +include(admFFmpegPrepareTar) + +if (NOT FFMPEG_PREPARED) + include(admFFmpegPrepareGit) +endif (NOT FFMPEG_PREPARED) + +message("") + +if (FFMPEG_PERFORM_PATCH) + find_package(Patch) + + # my patches + file(GLOB patchFiles "${FFMPEG_PATCH_DIR}/*.patch") + + foreach(patchFile ${patchFiles}) + get_filename_component(short ${patchFile} NAME) + MESSAGE(STATUS "-- Mine, Applying patch <${short}> --") + patch_file("${FFMPEG_SOURCE_DIR}" "${patchFile}") + endforeach(patchFile) + # XVBA patch from xbmc_dxva + IF(XVBA_NOT_ENABLED_FOR_NOW) #<------------------- + file(GLOB patchFilesXvba "${FFMPEG_PATCH_DIR}/xvba/*.patch") + + foreach(patchFileXvba ${patchFilesXvba}) + get_filename_component(short ${patchFileXvba} NAME) + MESSAGE(STATUS "-- DXVA, Applying patch <${short}> --") + patch_file_p1("${FFMPEG_SOURCE_DIR}" "${patchFileXvba}") + endforeach(patchFileXvba) + ENDIF(XVBA_NOT_ENABLED_FOR_NOW) #<------------------- + + # + if (UNIX ) + MESSAGE(STATUS "Patching Linux common.mak") + patch_file("${FFMPEG_SOURCE_DIR}" "${FFMPEG_PATCH_DIR}/common.mak.diff") + endif (UNIX ) + IF(WIN32) + IF("${CROSS_C_COMPILER}" STREQUAL "clang") + patch_file("${FFMPEG_SOURCE_DIR}" "${FFMPEG_PATCH_DIR}/clang_win32_workaround.diff") + ENDIF("${CROSS_C_COMPILER}" STREQUAL "clang") + ENDIF(WIN32) + + message("") +endif (FFMPEG_PERFORM_PATCH) + +if (USE_VDPAU) + xadd(--enable-vdpau) + set(FFMPEG_DECODERS ${FFMPEG_DECODERS} h264_vdpau vc1_vdpau mpeg1_vdpau mpeg_vdpau wmv3_vdpau) +endif (USE_VDPAU) + +if (USE_LIBVA) + xadd(--enable-vaapi) + set(FFMPEG_DECODERS ${FFMPEG_DECODERS} h264_vaapi hevc_vaapi) +endif (USE_LIBVA) + + +#if(USE_XVBA) + #xadd(--enable-xvba) +#else(USE_XVBA) + #xadd(--disable-xvba) +#endif(USE_XVBA) + + + +# Configure FFmpeg, if required +foreach (decoder ${FFMPEG_DECODERS}) + xadd(--enable-decoder ${decoder}) +endforeach (decoder) + +foreach (encoder ${FFMPEG_ENCODERS}) + xadd(--enable-encoder ${encoder}) +endforeach (encoder) + +foreach (muxer ${FFMPEG_MUXERS}) + xadd(--enable-muxer ${muxer}) +endforeach (muxer) + +foreach (parser ${FFMPEG_PARSERS}) + xadd(--enable-parser ${parser}) +endforeach (parser) + +foreach (protocol ${FFMPEG_PROTOCOLS}) + xadd(--enable-protocol ${protocol}) +endforeach (protocol) + +foreach (bistream ${FFMPEG_BSFS}) + xadd(--enable-bsf ${bistream}) +endforeach (bistream) + +if (WIN32) + if (ADM_CPU_X86_32) + IF("${CROSS_C_COMPILER}" STREQUAL "clang") + # With clang we use the -mstackrealign -mstack-alignment=16 + ELSE("${CROSS_C_COMPILER}" STREQUAL "clang") + # Old win32, for hack, not sure it really works with recent gcc + xadd(--enable-memalign-hack) + ENDIF("${CROSS_C_COMPILER}" STREQUAL "clang") + endif (ADM_CPU_X86_32) + + xadd(--enable-w32threads) +else (WIN32) + xadd(--enable-pthreads) +endif (WIN32) + +if (NOT ADM_DEBUG) + xadd(--disable-debug) +endif (NOT ADM_DEBUG) + +# Cross compiler override (win32 & win64) +if (CROSS) + if(APPLE) + xadd(--prefix /opt/mac) + xadd(--host-cc gcc) + xadd(--nm ${CMAKE_CROSS_PREFIX}-nm) + xadd(--strip ${CMAKE_CROSS_PREFIX}-strip) + + set(CROSS_OS darwin) + set(CROSS_ARCH i386) + else(APPLE) + xadd(--prefix ${CROSS}) + xadd(--host-cc gcc) + xadd(--nm ${CMAKE_CROSS_PREFIX}-nm) + xadd(--extra-cflags -I${CROSS}/include) + if (CMAKE_C_FLAGS) + xadd(--extra-cflags ${CMAKE_C_FLAGS}) + xadd(--extra-ldflags ${CMAKE_C_FLAGS}) + endif (CMAKE_C_FLAGS) + + set(CROSS_OS mingw32) + + if (ADM_CPU_64BIT) + set(CROSS_ARCH x86_64) + else (ADM_CPU_64BIT) + set(CROSS_ARCH i386) + endif (ADM_CPU_64BIT) + endif(APPLE) + + message(STATUS "Using cross compilation flag: ${FFMPEG_FLAGS}") +endif (CROSS) + +if (FF_INHERIT_BUILD_ENV) + xadd(--cc "${CMAKE_C_COMPILER}") + xadd(--ld "${CMAKE_C_COMPILER}") + xadd(--ar "${CMAKE_AR}") + # nm should be ok if we do not cross compile + if(CMAKE_LD_FLAGS) + xadd(--extra-ldflags ${CMAKE_LD_FLAGS}) + endif(CMAKE_LD_FLAGS) + if (CMAKE_C_FLAGS) + xadd(--extra-cflags ${CMAKE_C_FLAGS}) + endif (CMAKE_C_FLAGS) + + if (CMAKE_SHARED_LINKER_FLAGS) + xadd(--extra-ldflags ${CMAKE_SHARED_LINKER_FLAGS}) + endif (CMAKE_SHARED_LINKER_FLAGS) + + if (VERBOSE) + # for ffmpeg to use the same compiler as others + MESSAGE(STATUS "Building ffmpeg with CC=${CMAKE_C_COMPILER}") + MESSAGE(STATUS "Building ffmpeg with LD=${CMAKE_C_COMPILER}") + MESSAGE(STATUS "Building ffmpeg with AR=${CMAKE_AR}") + MESSAGE(STATUS "Building ffmpeg with CMAKE_C_FLAGS=${CMAKE_C_FLAGS}") + MESSAGE(STATUS "Building ffmpeg with CFLAGS=${FF_FLAGS}") + MESSAGE(STATUS "Building ffmpeg with CFLAGS2=${FFMPEG_FLAGS}") + message("") + endif (VERBOSE) +endif (FF_INHERIT_BUILD_ENV) + +if (CROSS_ARCH OR CROSS_OS) + xadd(--enable-cross-compile) +endif (CROSS_ARCH OR CROSS_OS) + +if (CROSS_ARCH) + set(CROSS_ARCH "${CROSS_ARCH}" CACHE STRING "") + xadd(--arch ${CROSS_ARCH}) +endif (CROSS_ARCH) + +if (CROSS_OS) + set(CROSS_OS "${CROSS_OS}" CACHE STRING "") + xadd(--target-os ${CROSS_OS}) +endif (CROSS_OS) + +if (FF_FLAGS) + set(FF_FLAGS "${FF_FLAGS}" CACHE STRING "") + xadd(${FF_FLAGS}) +endif (FF_FLAGS) +IF(WIN32) + IF(USE_DXVA2) + xadd(--enable-dxva2) + set(FFMPEG_DECODERS ${FFMPEG_DECODERS} h264_dxva2 hevc_dxva2) + ENDIF(USE_DXVA2) +ENDIF(WIN32) + +if (NOT "${LAST_FFMPEG_FLAGS}" STREQUAL "${FFMPEG_FLAGS}") + set(FFMPEG_PERFORM_BUILD 1) +endif (NOT "${LAST_FFMPEG_FLAGS}" STREQUAL "${FFMPEG_FLAGS}") + +if (NOT EXISTS "${FFMPEG_BINARY_DIR}/Makefile") + set(FFMPEG_PERFORM_BUILD 1) +endif (NOT EXISTS "${FFMPEG_BINARY_DIR}/Makefile") + +if (FFMPEG_PERFORM_BUILD) + find_package(Bourne) + find_package(GnuMake) + + message(STATUS "Configuring FFmpeg") + set(LAST_FFMPEG_FLAGS "${FFMPEG_FLAGS}" CACHE STRING "" FORCE) + + file(MAKE_DIRECTORY "${FFMPEG_BINARY_DIR}") + file(REMOVE "${FFMPEG_BINARY_DIR}/ffmpeg${CMAKE_EXECUTABLE_SUFFIX}") + file(REMOVE "${FFMPEG_BINARY_DIR}/ffmpeg_g${CMAKE_EXECUTABLE_SUFFIX}") + + set(ffmpeg_bash_directory ${BASH_EXECUTABLE}) + convertPathToUnix(ffmpeg_bash_directory ${BASH_EXECUTABLE}) + get_filename_component(ffmpeg_bash_directory ${ffmpeg_bash_directory} PATH) + configure_file("${AVIDEMUX_TOP_SOURCE_DIR}/cmake/ffmpeg_configure.sh.cmake" "${FFMPEG_BINARY_DIR}/ffmpeg_configure.sh") + + execute_process(COMMAND ${BASH_EXECUTABLE} ffmpeg_configure.sh WORKING_DIRECTORY "${FFMPEG_BINARY_DIR}" + OUTPUT_VARIABLE FFMPEG_CONFIGURE_OUTPUT RESULT_VARIABLE FFMPEG_CONFIGURE_RESULT) + + if (NOT (FFMPEG_CONFIGURE_RESULT EQUAL 0)) + MESSAGE(ERROR "configure returned <${FFMPEG_CONFIGURE_RESULT}>") + MESSAGE(ERROR "configure output is <${FFMPEG_CONFIGURE_OUTPUT}>") + MESSAGE(FATAL_ERROR "An error occured ") + endif (NOT (FFMPEG_CONFIGURE_RESULT EQUAL 0)) + + MESSAGE(STATUS "Configuring done, processing") + + if (ADM_CPU_X86) + file(READ ${FFMPEG_BINARY_DIR}/config.h FF_CONFIG_H) + string(REGEX MATCH "#define[ ]+HAVE_YASM[ ]+1" FF_YASM "${FF_CONFIG_H}") + + if (NOT FF_YASM) + message(FATAL_ERROR "Yasm was not found.") + endif (NOT FF_YASM) + endif (ADM_CPU_X86) + + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "libavutil" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/config") + + execute_process(COMMAND ${CMAKE_COMMAND} -E copy "./libavutil/avconfig.h" "${CMAKE_BINARY_DIR}/config/libavutil" + WORKING_DIRECTORY "${FFMPEG_BINARY_DIR}") + + if (UNIX) + find_package(Patch) + IF(APPLE) + MESSAGE(STATUS "Patching config.mak - mac(2)") + patch_file("${FFMPEG_BINARY_DIR}" "${FFMPEG_PATCH_DIR}/config.mak.mac.diff") + ELSE(APPLE) + MESSAGE(STATUS "Patching config.mak - linux (2)") + patch_file("${FFMPEG_BINARY_DIR}" "${FFMPEG_PATCH_DIR}/config.mak.diff") + ENDIF(APPLE) + endif (UNIX) + + message("") +endif (FFMPEG_PERFORM_BUILD) + +# Build FFmpeg +getFfmpegLibNames("${FFMPEG_SOURCE_DIR}") + +set(ffmpeg_gnumake_executable ${GNUMAKE_EXECUTABLE}) +convertPathToUnix(ffmpeg_gnumake_executable ${BASH_EXECUTABLE}) +configure_file("${AVIDEMUX_TOP_SOURCE_DIR}/cmake/ffmpeg_make.sh.cmake" "${FFMPEG_BINARY_DIR}/ffmpeg_make.sh") +registerFFmpeg("${FFMPEG_SOURCE_DIR}" "${FFMPEG_BINARY_DIR}" 0) + +if(CMAKE_HOST_UNIX) + add_custom_target( libavutil_dummy + COMMAND ${CMAKE_BUILD_TOOL} -j 4 # We assume make or gnumake when host is unix + WORKING_DIRECTORY "${FFMPEG_BINARY_DIR}") +else(CMAKE_HOST_UNIX) + add_custom_target( libavutil_dummy + COMMAND ${BASH_EXECUTABLE} ffmpeg_make.sh # Host is win32, wrap + WORKING_DIRECTORY "${FFMPEG_BINARY_DIR}") +endif(CMAKE_HOST_UNIX) + + +MACRO(FF_ADD_SUBLIB lib) + add_custom_command( + OUTPUT "${lib}" + DEPENDS libavutil_dummy + COMMAND ${BASH_EXECUTABLE} -c echo "placeHolder") + +ENDMACRO(FF_ADD_SUBLIB lib) + +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavutil/${LIBAVUTIL_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavcodec/${LIBAVCODEC_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavformat/${LIBAVFORMAT_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libpostproc/${LIBPOSTPROC_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libswscale/${LIBSWSCALE_LIB}" ) + + +MACRO(FF_ADD_SUBLIB lib) + add_custom_command( + OUTPUT "${lib}" + DEPENDS "${FFMPEG_BINARY_DIR}/libavcodec/${LIBAVCODEC_LIB}" + COMMAND ${BASH_EXECUTABLE} -c echo "placeHolder") + +ENDMACRO(FF_ADD_SUBLIB lib) + +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavutil/${LIBAVUTIL_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavformat/${LIBAVFORMAT_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libpostproc/${LIBPOSTPROC_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libswscale/${LIBSWSCALE_LIB}" ) + + +# Add and INSTALL libraries +include_directories("${FFMPEG_SOURCE_DIR}") +include_directories("${FFMPEG_BINARY_DIR}") + +ADM_INSTALL_LIB_FILES("${FFMPEG_BINARY_DIR}/libswscale/${LIBSWSCALE_LIB}") +ADM_INSTALL_LIB_FILES("${FFMPEG_BINARY_DIR}/libpostproc/${LIBPOSTPROC_LIB}") +ADM_INSTALL_LIB_FILES("${FFMPEG_BINARY_DIR}/libavutil/${LIBAVUTIL_LIB}") +ADM_INSTALL_LIB_FILES("${FFMPEG_BINARY_DIR}/libavcodec/${LIBAVCODEC_LIB}") +ADM_INSTALL_LIB_FILES("${FFMPEG_BINARY_DIR}/libavformat/${LIBAVFORMAT_LIB}") + +INSTALL(FILES "${FFMPEG_BINARY_DIR}/libavutil/avconfig.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavutil" COMPONENT dev) +IF(USE_LIBVA) + INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/vaapi.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) + INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/vaapi_internal.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) +ENDIF(USE_LIBVA) + +IF(USE_DXVA2) + INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/dxva2.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) + INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/dxva2_internal.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) +ENDIF(USE_DXVA2) +IF(USE_XVBA) + INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/xvba.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) + INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/xvba_internal.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) +ENDIF(USE_XVBA) +INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/avcodec.h" "${FFMPEG_SOURCE_DIR}/libavcodec/vdpau.h" + "${FFMPEG_SOURCE_DIR}/libavcodec/version.h" + "${FFMPEG_SOURCE_DIR}/libavcodec/audioconvert.h" + #"${FFMPEG_SOURCE_DIR}/libavcodec/internal.h" + DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavcodec" COMPONENT dev) +INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavformat/avformat.h" "${FFMPEG_SOURCE_DIR}/libavformat/avio.h" + "${FFMPEG_SOURCE_DIR}/libavformat/version.h" + "${FFMPEG_SOURCE_DIR}/libavformat/flv.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavformat" COMPONENT dev) +INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavutil/attributes.h" "${FFMPEG_SOURCE_DIR}/libavutil/avutil.h" + "${FFMPEG_SOURCE_DIR}/libavutil/buffer.h" + "${FFMPEG_SOURCE_DIR}/libavutil/bswap.h" "${FFMPEG_SOURCE_DIR}/libavutil/common.h" + "${FFMPEG_SOURCE_DIR}/libavutil/cpu.h" "${FFMPEG_SOURCE_DIR}/libavutil/frame.h" + "${FFMPEG_SOURCE_DIR}/libavutil/log.h" "${FFMPEG_SOURCE_DIR}/libavutil/mathematics.h" + "${FFMPEG_SOURCE_DIR}/libavutil/mem.h" "${FFMPEG_SOURCE_DIR}/libavutil/pixfmt.h" + "${FFMPEG_SOURCE_DIR}/libavutil/pixdesc.h" + "${FFMPEG_SOURCE_DIR}/libavutil/channel_layout.h" + "${FFMPEG_SOURCE_DIR}/libavutil/error.h" + "${FFMPEG_SOURCE_DIR}/libavutil/dict.h" + "${FFMPEG_SOURCE_DIR}/libavutil/version.h" + "${FFMPEG_SOURCE_DIR}/libavutil/time.h" + "${FFMPEG_SOURCE_DIR}/libavutil/opt.h" + "${FFMPEG_SOURCE_DIR}/libavutil/intfloat.h" + "${FFMPEG_SOURCE_DIR}/libavutil/macros.h" + "${FFMPEG_SOURCE_DIR}/libavutil/samplefmt.h" + "${FFMPEG_SOURCE_DIR}/libavutil/rational.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libavutil" COMPONENT dev) +INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libpostproc/postprocess.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libpostproc" COMPONENT dev) +INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libpostproc/version.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libpostproc" COMPONENT dev) +INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libswscale/swscale.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libswscale" COMPONENT dev) +INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libswscale/version.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/2.6/libswscale" COMPONENT dev) diff --git a/cmake/admFFmpegBuild_crossMingw.cmake b/cmake/admFFmpegBuild_crossMingw.cmake index 6c0c3801c8..4f196764d8 100644 --- a/cmake/admFFmpegBuild_crossMingw.cmake +++ b/cmake/admFFmpegBuild_crossMingw.cmake @@ -1,116 +1,116 @@ -include(admFFmpegBuild_helpers) - -#@@ -ADM_FF_SET_DEFAULT() - -IF(USE_NVENC) - set(FFMPEG_ENCODERS ${FFMPEG_ENCODERS} h264_nvenc hevc_nvenc) - set(FFMPEG_DECODERS ${FFMPEG_DECODERS} nvdec) -ENDIF(USE_NVENC) - - - -#@@ -ADM_FF_PATCH_IF_NEEDED() - -IF("${CROSS_C_COMPILER}" STREQUAL "clang") - patch_file("${FFMPEG_SOURCE_DIR}" "${FFMPEG_PATCH_DIR}/clang_win32_workaround.diff") -ENDIF("${CROSS_C_COMPILER}" STREQUAL "clang") - -if (ADM_CPU_X86_32) - IF("${CROSS_C_COMPILER}" STREQUAL "clang") - # With clang we use the -mstackrealign -mstack-alignment=16 - ELSE("${CROSS_C_COMPILER}" STREQUAL "clang") - # Old win32, for hack, not sure it really works with recent gcc - # Not anymore xadd(--enable-memalign-hack) - ENDIF("${CROSS_C_COMPILER}" STREQUAL "clang") -endif (ADM_CPU_X86_32) - -xadd(--enable-w32threads) - -# Cross compiler override (win32 & win64) -xadd(--host-cc gcc) -xadd(--nm ${CMAKE_CROSS_PREFIX}-nm) -xadd(--extra-cflags -I${CROSS}/include) -if (CMAKE_C_FLAGS) - xadd(--extra-cflags ${CMAKE_C_FLAGS}) - xadd(--extra-ldflags ${CMAKE_C_FLAGS}) -endif (CMAKE_C_FLAGS) - -set(CROSS_OS mingw32) - -if (ADM_CPU_64BIT) - set(CROSS_ARCH x86_64) -else (ADM_CPU_64BIT) - set(CROSS_ARCH i386) -endif (ADM_CPU_64BIT) - -message(STATUS "Using cross compilation flag: ${FFMPEG_FLAGS}") - -ADM_FF_ADD_OPTIONS() - - - xadd(--cc "${CMAKE_C_COMPILER}") - xadd(--ld "${CMAKE_C_COMPILER}") - xadd(--ar "${CMAKE_AR}") - -ADM_FF_SET_EXTRA_FLAGS() -xadd(--enable-cross-compile) - -set(CROSS_ARCH "${CROSS_ARCH}" CACHE STRING "") -xadd(--arch ${CROSS_ARCH}) - -set(CROSS_OS "${CROSS_OS}" CACHE STRING "") -xadd(--target-os ${CROSS_OS}) - -ADM_FF_SET_EXTRA_FLAGS() - -IF(USE_DXVA2) - xadd(--enable-dxva2) - # We assume 32 bits mean windows XP; disable d3d11 - IF(NOT ADM_CPU_X86_64) - xadd(--disable-d3d11va) - ENDIF(NOT ADM_CPU_X86_64) -ENDIF(USE_DXVA2) - -#@@ -ADM_FF_BUILD_UNIX_STYLE() -ADM_FF_ADD_DUMMY_TARGET() -MACRO(FF_ADD_SUBLIB lib) - add_custom_command( - OUTPUT "${lib}" - DEPENDS libavutil_dummy - COMMAND ${BASH_EXECUTABLE} -c echo "placeHolder") - -ENDMACRO(FF_ADD_SUBLIB lib) - -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavutil/${LIBAVUTIL_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavcodec/${LIBAVCODEC_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavformat/${LIBAVFORMAT_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libpostproc/${LIBPOSTPROC_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libswscale/${LIBSWSCALE_LIB}" ) - - -MACRO(FF_ADD_SUBLIB lib) - add_custom_command( - OUTPUT "${lib}" - DEPENDS "${FFMPEG_BINARY_DIR}/libavcodec/${LIBAVCODEC_LIB}" - COMMAND ${BASH_EXECUTABLE} -c echo "placeHolder") - -ENDMACRO(FF_ADD_SUBLIB lib) - -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavutil/${LIBAVUTIL_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavformat/${LIBAVFORMAT_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libpostproc/${LIBPOSTPROC_LIB}" ) -FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libswscale/${LIBSWSCALE_LIB}" ) - -ADM_FF_INSTALL_LIBS_AND_HEADERS() - -IF(USE_DXVA2) - INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/dxva2.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavcodec" COMPONENT dev) - INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/dxva2_internal.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavcodec" COMPONENT dev) -ENDIF(USE_DXVA2) - -# -# -# +include(admFFmpegBuild_helpers) + +#@@ +ADM_FF_SET_DEFAULT() + +IF(USE_NVENC) + set(FFMPEG_ENCODERS ${FFMPEG_ENCODERS} h264_nvenc hevc_nvenc) + set(FFMPEG_DECODERS ${FFMPEG_DECODERS} nvdec) +ENDIF(USE_NVENC) + + + +#@@ +ADM_FF_PATCH_IF_NEEDED() + +IF("${CROSS_C_COMPILER}" STREQUAL "clang") + patch_file("${FFMPEG_SOURCE_DIR}" "${FFMPEG_PATCH_DIR}/clang_win32_workaround.diff") +ENDIF("${CROSS_C_COMPILER}" STREQUAL "clang") + +if (ADM_CPU_X86_32) + IF("${CROSS_C_COMPILER}" STREQUAL "clang") + # With clang we use the -mstackrealign -mstack-alignment=16 + ELSE("${CROSS_C_COMPILER}" STREQUAL "clang") + # Old win32, for hack, not sure it really works with recent gcc + # Not anymore xadd(--enable-memalign-hack) + ENDIF("${CROSS_C_COMPILER}" STREQUAL "clang") +endif (ADM_CPU_X86_32) + +xadd(--enable-w32threads) + +# Cross compiler override (win32 & win64) +xadd(--host-cc gcc) +xadd(--nm ${CMAKE_CROSS_PREFIX}-nm) +xadd(--extra-cflags -I${CROSS}/include) +if (CMAKE_C_FLAGS) + xadd(--extra-cflags ${CMAKE_C_FLAGS}) + xadd(--extra-ldflags ${CMAKE_C_FLAGS}) +endif (CMAKE_C_FLAGS) + +set(CROSS_OS mingw32) + +if (ADM_CPU_64BIT) + set(CROSS_ARCH x86_64) +else (ADM_CPU_64BIT) + set(CROSS_ARCH i386) +endif (ADM_CPU_64BIT) + +message(STATUS "Using cross compilation flag: ${FFMPEG_FLAGS}") + +ADM_FF_ADD_OPTIONS() + + + xadd(--cc "${CMAKE_C_COMPILER}") + xadd(--ld "${CMAKE_C_COMPILER}") + xadd(--ar "${CMAKE_AR}") + +ADM_FF_SET_EXTRA_FLAGS() +xadd(--enable-cross-compile) + +set(CROSS_ARCH "${CROSS_ARCH}" CACHE STRING "") +xadd(--arch ${CROSS_ARCH}) + +set(CROSS_OS "${CROSS_OS}" CACHE STRING "") +xadd(--target-os ${CROSS_OS}) + +ADM_FF_SET_EXTRA_FLAGS() + +IF(USE_DXVA2) + xadd(--enable-dxva2) + # We assume 32 bits mean windows XP; disable d3d11 + IF(NOT ADM_CPU_X86_64) + xadd(--disable-d3d11va) + ENDIF(NOT ADM_CPU_X86_64) +ENDIF(USE_DXVA2) + +#@@ +ADM_FF_BUILD_UNIX_STYLE() +ADM_FF_ADD_DUMMY_TARGET() +MACRO(FF_ADD_SUBLIB lib) + add_custom_command( + OUTPUT "${lib}" + DEPENDS libavutil_dummy + COMMAND ${BASH_EXECUTABLE} -c echo "placeHolder") + +ENDMACRO(FF_ADD_SUBLIB lib) + +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavutil/${LIBAVUTIL_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavcodec/${LIBAVCODEC_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavformat/${LIBAVFORMAT_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libpostproc/${LIBPOSTPROC_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libswscale/${LIBSWSCALE_LIB}" ) + + +MACRO(FF_ADD_SUBLIB lib) + add_custom_command( + OUTPUT "${lib}" + DEPENDS "${FFMPEG_BINARY_DIR}/libavcodec/${LIBAVCODEC_LIB}" + COMMAND ${BASH_EXECUTABLE} -c echo "placeHolder") + +ENDMACRO(FF_ADD_SUBLIB lib) + +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavutil/${LIBAVUTIL_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libavformat/${LIBAVFORMAT_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libpostproc/${LIBPOSTPROC_LIB}" ) +FF_ADD_SUBLIB( "${FFMPEG_BINARY_DIR}/libswscale/${LIBSWSCALE_LIB}" ) + +ADM_FF_INSTALL_LIBS_AND_HEADERS() + +IF(USE_DXVA2) + INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/dxva2.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavcodec" COMPONENT dev) + INSTALL(FILES "${FFMPEG_SOURCE_DIR}/libavcodec/dxva2_internal.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavcodec" COMPONENT dev) +ENDIF(USE_DXVA2) + +# +# +# diff --git a/cmake/admFFmpegBuild_vs_import.cmake b/cmake/admFFmpegBuild_vs_import.cmake index ae9b9ae092..911839ce51 100755 --- a/cmake/admFFmpegBuild_vs_import.cmake +++ b/cmake/admFFmpegBuild_vs_import.cmake @@ -1,107 +1,107 @@ -##########################################################################################" -# VS Style management of ffmpeg libs -# We raw import binaries from somewhere else as they have been compiled with mingw -# -# Add -DIMPORT_FOLDER=foobar on cmake -# -# -##########################################################################################" -IF(NOT IMPORT_FOLDER) - SET(IMPORT_FOLDER "d://import//") #Default value -ENDIF(NOT IMPORT_FOLDER) -MESSAGE(STATUS "Importing ffmpeg binaries from ${IMPORT_FOLDER}") - -SET(LIB_IMPORT_FOLDER "${IMPORT_FOLDER}\\lib") -INCLUDE_DIRECTORIES(${IMPORT_FOLDER}/include) -LINK_DIRECTORIES(${IMPORT_FOLDER}/lib) -set(LIBAVCODEC_LIB ${IMPORT_FOLDER}/lib/avcodec.lib) -set(LIBAVFORMAT_LIB ${IMPORT_FOLDER}/lib/avformat.lib) -set(LIBAVUTIL_LIB ${IMPORT_FOLDER}/lib/avutil.lib) -set(LIBPOSTPROC_LIB ${IMPORT_FOLDER}/lib/postproc.lib) -set(LIBSWSCALE_LIB ${IMPORT_FOLDER}/lib/swscale.lib) - -# Actual lib - -add_library(ADM_libswscale UNKNOWN IMPORTED) -add_library(ADM_libpostproc UNKNOWN IMPORTED) -add_library(ADM_libavutil UNKNOWN IMPORTED) -add_library(ADM_libavcodec UNKNOWN IMPORTED) -add_library(ADM_libavformat UNKNOWN IMPORTED) - - -set_property(TARGET ADM_libswscale PROPERTY IMPORTED_LOCATION "${LIBSWSCALE_LIB}") -set_property(TARGET ADM_libpostproc PROPERTY IMPORTED_LOCATION "${LIBPOSTPROC_LIB}") -set_property(TARGET ADM_libavutil PROPERTY IMPORTED_LOCATION "${LIBAVUTIL_LIB}") -set_property(TARGET ADM_libavcodec PROPERTY IMPORTED_LOCATION "${LIBAVCODEC_LIB}") -set_property(TARGET ADM_libavformat PROPERTY IMPORTED_LOCATION "${LIBAVFORMAT_LIB}") - -# install .dll.a -ADM_INSTALL_LIB_FILES("${LIBAVCODEC_LIB}") -ADM_INSTALL_LIB_FILES("${LIBAVFORMAT_LIB}") -ADM_INSTALL_LIB_FILES("${LIBAVUTIL_LIB}") -ADM_INSTALL_LIB_FILES("${LIBPOSTPROC_LIB}") -ADM_INSTALL_LIB_FILES("${LIBSWSCALE_LIB}") -#INSTALL .dll => TODO - -# install header -INSTALL(FILES "${IMPORT_FOLDER}/include/libavutil/avconfig.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavutil" COMPONENT dev) - -INSTALL(FILES "${IMPORT_FOLDER}/include/libavcodec/avcodec.h" "${IMPORT_FOLDER}/include/libavcodec/vdpau.h" - "${IMPORT_FOLDER}/include/libavcodec/version.h" - #"${IMPORT_FOLDER}/include/libavcodec/audioconvert.h" - - DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavcodec" COMPONENT dev) - -INSTALL(FILES "${IMPORT_FOLDER}/include/libavformat/avformat.h" "${IMPORT_FOLDER}/include/libavformat/avio.h" - "${IMPORT_FOLDER}/include/libavformat/version.h" - "${IMPORT_FOLDER}/include/libavformat/flv.h" - DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavformat" COMPONENT dev) - -INSTALL(FILES "${IMPORT_FOLDER}/include/libavutil/attributes.h" - "${IMPORT_FOLDER}/include/libavutil/avutil.h" - "${IMPORT_FOLDER}/include/libavutil/buffer.h" - "${IMPORT_FOLDER}/include/libavutil/bswap.h" - "${IMPORT_FOLDER}/include/libavutil/common.h" - "${IMPORT_FOLDER}/include/libavutil/cpu.h" - "${IMPORT_FOLDER}/include/libavutil/frame.h" - "${IMPORT_FOLDER}/include/libavutil/log.h" - "${IMPORT_FOLDER}/include/libavutil/mathematics.h" - "${IMPORT_FOLDER}/include/libavutil/mem.h" - "${IMPORT_FOLDER}/include/libavutil/pixfmt.h" - "${IMPORT_FOLDER}/include/libavutil/pixdesc.h" - "${IMPORT_FOLDER}/include/libavutil/channel_layout.h" - "${IMPORT_FOLDER}/include/libavutil/error.h" - "${IMPORT_FOLDER}/include/libavutil/dict.h" - "${IMPORT_FOLDER}/include/libavutil/version.h" - "${IMPORT_FOLDER}/include/libavutil/time.h" - "${IMPORT_FOLDER}/include/libavutil/opt.h" - "${IMPORT_FOLDER}/include/libavutil/intfloat.h" - "${IMPORT_FOLDER}/include/libavutil/macros.h" - "${IMPORT_FOLDER}/include/libavutil/samplefmt.h" - "${IMPORT_FOLDER}/include/libavutil/rational.h" - "${IMPORT_FOLDER}/include/libavutil/hwcontext_dxva2.h" - "${IMPORT_FOLDER}/include/libavutil/hwcontext.h" - "${IMPORT_FOLDER}/include/libavutil/mastering_display_metadata.h" - "${IMPORT_FOLDER}/include/libavutil/hdr_dynamic_metadata.h" - DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavutil" COMPONENT dev) - -INSTALL(FILES "${IMPORT_FOLDER}/include/libpostproc/postprocess.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libpostproc" COMPONENT dev) -INSTALL(FILES "${IMPORT_FOLDER}/include/libpostproc/version.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libpostproc" COMPONENT dev) -INSTALL(FILES "${IMPORT_FOLDER}/include/libswscale/swscale.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libswscale" COMPONENT dev) -INSTALL(FILES "${IMPORT_FOLDER}/include/libswscale/version.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libswscale" COMPONENT dev) - - -IF(USE_DXVA2) - INSTALL(FILES "${IMPORT_FOLDER}/include/libavcodec/dxva2.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavcodec" COMPONENT dev) - INSTALL(FILES "${IMPORT_FOLDER}/include/libavcodec/d3d11va.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavcodec" COMPONENT dev) - INSTALL(FILES "${IMPORT_FOLDER}/include/libavcodec/dxva2_internal.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavcodec" COMPONENT dev) -ENDIF(USE_DXVA2) - -#The above install the .libs -# also install the .dll manually - -FILE(GLOB ffmpegDll "${IMPORT_FOLDER}/lib/*-*.dll") -FOREACH(one ${ffmpegDll}) - ADM_INSTALL_LIB_FILES(${one}) -ENDFOREACH(one ${ffmpegDll}) -# EOF +##########################################################################################" +# VS Style management of ffmpeg libs +# We raw import binaries from somewhere else as they have been compiled with mingw +# +# Add -DIMPORT_FOLDER=foobar on cmake +# +# +##########################################################################################" +IF(NOT IMPORT_FOLDER) + SET(IMPORT_FOLDER "d://import//") #Default value +ENDIF(NOT IMPORT_FOLDER) +MESSAGE(STATUS "Importing ffmpeg binaries from ${IMPORT_FOLDER}") + +SET(LIB_IMPORT_FOLDER "${IMPORT_FOLDER}\\lib") +INCLUDE_DIRECTORIES(${IMPORT_FOLDER}/include) +LINK_DIRECTORIES(${IMPORT_FOLDER}/lib) +set(LIBAVCODEC_LIB ${IMPORT_FOLDER}/lib/avcodec.lib) +set(LIBAVFORMAT_LIB ${IMPORT_FOLDER}/lib/avformat.lib) +set(LIBAVUTIL_LIB ${IMPORT_FOLDER}/lib/avutil.lib) +set(LIBPOSTPROC_LIB ${IMPORT_FOLDER}/lib/postproc.lib) +set(LIBSWSCALE_LIB ${IMPORT_FOLDER}/lib/swscale.lib) + +# Actual lib + +add_library(ADM_libswscale UNKNOWN IMPORTED) +add_library(ADM_libpostproc UNKNOWN IMPORTED) +add_library(ADM_libavutil UNKNOWN IMPORTED) +add_library(ADM_libavcodec UNKNOWN IMPORTED) +add_library(ADM_libavformat UNKNOWN IMPORTED) + + +set_property(TARGET ADM_libswscale PROPERTY IMPORTED_LOCATION "${LIBSWSCALE_LIB}") +set_property(TARGET ADM_libpostproc PROPERTY IMPORTED_LOCATION "${LIBPOSTPROC_LIB}") +set_property(TARGET ADM_libavutil PROPERTY IMPORTED_LOCATION "${LIBAVUTIL_LIB}") +set_property(TARGET ADM_libavcodec PROPERTY IMPORTED_LOCATION "${LIBAVCODEC_LIB}") +set_property(TARGET ADM_libavformat PROPERTY IMPORTED_LOCATION "${LIBAVFORMAT_LIB}") + +# install .dll.a +ADM_INSTALL_LIB_FILES("${LIBAVCODEC_LIB}") +ADM_INSTALL_LIB_FILES("${LIBAVFORMAT_LIB}") +ADM_INSTALL_LIB_FILES("${LIBAVUTIL_LIB}") +ADM_INSTALL_LIB_FILES("${LIBPOSTPROC_LIB}") +ADM_INSTALL_LIB_FILES("${LIBSWSCALE_LIB}") +#INSTALL .dll => TODO + +# install header +INSTALL(FILES "${IMPORT_FOLDER}/include/libavutil/avconfig.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavutil" COMPONENT dev) + +INSTALL(FILES "${IMPORT_FOLDER}/include/libavcodec/avcodec.h" "${IMPORT_FOLDER}/include/libavcodec/vdpau.h" + "${IMPORT_FOLDER}/include/libavcodec/version.h" + #"${IMPORT_FOLDER}/include/libavcodec/audioconvert.h" + + DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavcodec" COMPONENT dev) + +INSTALL(FILES "${IMPORT_FOLDER}/include/libavformat/avformat.h" "${IMPORT_FOLDER}/include/libavformat/avio.h" + "${IMPORT_FOLDER}/include/libavformat/version.h" + "${IMPORT_FOLDER}/include/libavformat/flv.h" + DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavformat" COMPONENT dev) + +INSTALL(FILES "${IMPORT_FOLDER}/include/libavutil/attributes.h" + "${IMPORT_FOLDER}/include/libavutil/avutil.h" + "${IMPORT_FOLDER}/include/libavutil/buffer.h" + "${IMPORT_FOLDER}/include/libavutil/bswap.h" + "${IMPORT_FOLDER}/include/libavutil/common.h" + "${IMPORT_FOLDER}/include/libavutil/cpu.h" + "${IMPORT_FOLDER}/include/libavutil/frame.h" + "${IMPORT_FOLDER}/include/libavutil/log.h" + "${IMPORT_FOLDER}/include/libavutil/mathematics.h" + "${IMPORT_FOLDER}/include/libavutil/mem.h" + "${IMPORT_FOLDER}/include/libavutil/pixfmt.h" + "${IMPORT_FOLDER}/include/libavutil/pixdesc.h" + "${IMPORT_FOLDER}/include/libavutil/channel_layout.h" + "${IMPORT_FOLDER}/include/libavutil/error.h" + "${IMPORT_FOLDER}/include/libavutil/dict.h" + "${IMPORT_FOLDER}/include/libavutil/version.h" + "${IMPORT_FOLDER}/include/libavutil/time.h" + "${IMPORT_FOLDER}/include/libavutil/opt.h" + "${IMPORT_FOLDER}/include/libavutil/intfloat.h" + "${IMPORT_FOLDER}/include/libavutil/macros.h" + "${IMPORT_FOLDER}/include/libavutil/samplefmt.h" + "${IMPORT_FOLDER}/include/libavutil/rational.h" + "${IMPORT_FOLDER}/include/libavutil/hwcontext_dxva2.h" + "${IMPORT_FOLDER}/include/libavutil/hwcontext.h" + "${IMPORT_FOLDER}/include/libavutil/mastering_display_metadata.h" + "${IMPORT_FOLDER}/include/libavutil/hdr_dynamic_metadata.h" + DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavutil" COMPONENT dev) + +INSTALL(FILES "${IMPORT_FOLDER}/include/libpostproc/postprocess.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libpostproc" COMPONENT dev) +INSTALL(FILES "${IMPORT_FOLDER}/include/libpostproc/version.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libpostproc" COMPONENT dev) +INSTALL(FILES "${IMPORT_FOLDER}/include/libswscale/swscale.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libswscale" COMPONENT dev) +INSTALL(FILES "${IMPORT_FOLDER}/include/libswscale/version.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libswscale" COMPONENT dev) + + +IF(USE_DXVA2) + INSTALL(FILES "${IMPORT_FOLDER}/include/libavcodec/dxva2.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavcodec" COMPONENT dev) + INSTALL(FILES "${IMPORT_FOLDER}/include/libavcodec/d3d11va.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavcodec" COMPONENT dev) + INSTALL(FILES "${IMPORT_FOLDER}/include/libavcodec/dxva2_internal.h" DESTINATION "${AVIDEMUX_INCLUDE_DIR}/avidemux/${AVIDEMUX_MAJOR_MINOR}/libavcodec" COMPONENT dev) +ENDIF(USE_DXVA2) + +#The above install the .libs +# also install the .dll manually + +FILE(GLOB ffmpegDll "${IMPORT_FOLDER}/lib/*-*.dll") +FOREACH(one ${ffmpegDll}) + ADM_INSTALL_LIB_FILES(${one}) +ENDFOREACH(one ${ffmpegDll}) +# EOF diff --git a/cmake/admFFmpegPrepareGit.cmake b/cmake/admFFmpegPrepareGit.cmake index f5bd978fa7..270d059e4b 100644 --- a/cmake/admFFmpegPrepareGit.cmake +++ b/cmake/admFFmpegPrepareGit.cmake @@ -1,32 +1,32 @@ -find_package(Git) -find_package(Tar) - -if (NOT VERBOSE) - set(ffmpegGitOutput OUTPUT_VARIABLE FFMPEG_GIT_OUTPUT) - set(swscaleGitOutput OUTPUT_VARIABLE SWSCALE_GIT_OUTPUT) -endif (NOT VERBOSE) - -# Checkout FFmpeg source and patch it -if (NOT EXISTS "${FFMPEG_SOURCE_DIR}/${FFMPEG_VERSION}") - message(STATUS "Checking out FFmpeg from git repository") - execute_process(COMMAND ${GIT_EXECUTABLE} clone git://git.videolan.org/ffmpeg.git "${FFMPEG_SOURCE_DIR}" - ${ffmpegGitOutput}) - MESSAGE(STATUS "Going to revision ${FFMPEG_VERSION}") - execute_process(COMMAND ${GIT_EXECUTABLE} checkout tags/n${FFMPEG_VERSION} -b ${FFMPEG_VERSION} - WORKING_DIRECTORY "${FFMPEG_SOURCE_DIR}" - ${ffmpegSvnOutput}) - execute_process(COMMAND touch "${FFMPEG_SOURCE_DIR}/${FFMPEG_VERSION}") - MESSAGE(STATUS "Archiving ffmpeg ${FFMPEG_VERSION}") - MESSAGE(STATUS "${TAR_EXECUTABLE} cjf ${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE} --exclude .git source; DIR=${FFMPEG_BASE_DIR}") - execute_process(COMMAND ${TAR_EXECUTABLE} cjf "${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE}" --exclude .git source - WORKING_DIRECTORY "${FFMPEG_BASE_DIR}" - ) - set(FFMPEG_PERFORM_PATCH 1) -endif (NOT EXISTS "${FFMPEG_SOURCE_DIR}/${FFMPEG_VERSION}") - -# Check version -IF(IS_DIRECTORY ${FFMPEG_SOURCE_DIR}/.git) - admGetRevision( ${FFMPEG_SOURCE_DIR} ffmpeg_WC_REVISION) - MESSAGE(STATUS "Current revision ${ffmpeg_WC_REVISION}") -ENDIF(IS_DIRECTORY ${FFMPEG_SOURCE_DIR}/.git) -message("") +find_package(Git) +find_package(Tar) + +if (NOT VERBOSE) + set(ffmpegGitOutput OUTPUT_VARIABLE FFMPEG_GIT_OUTPUT) + set(swscaleGitOutput OUTPUT_VARIABLE SWSCALE_GIT_OUTPUT) +endif (NOT VERBOSE) + +# Checkout FFmpeg source and patch it +if (NOT EXISTS "${FFMPEG_SOURCE_DIR}/${FFMPEG_VERSION}") + message(STATUS "Checking out FFmpeg from git repository") + execute_process(COMMAND ${GIT_EXECUTABLE} clone git://git.videolan.org/ffmpeg.git "${FFMPEG_SOURCE_DIR}" + ${ffmpegGitOutput}) + MESSAGE(STATUS "Going to revision ${FFMPEG_VERSION}") + execute_process(COMMAND ${GIT_EXECUTABLE} checkout tags/n${FFMPEG_VERSION} -b ${FFMPEG_VERSION} + WORKING_DIRECTORY "${FFMPEG_SOURCE_DIR}" + ${ffmpegSvnOutput}) + execute_process(COMMAND touch "${FFMPEG_SOURCE_DIR}/${FFMPEG_VERSION}") + MESSAGE(STATUS "Archiving ffmpeg ${FFMPEG_VERSION}") + MESSAGE(STATUS "${TAR_EXECUTABLE} cjf ${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE} --exclude .git source; DIR=${FFMPEG_BASE_DIR}") + execute_process(COMMAND ${TAR_EXECUTABLE} cjf "${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE}" --exclude .git source + WORKING_DIRECTORY "${FFMPEG_BASE_DIR}" + ) + set(FFMPEG_PERFORM_PATCH 1) +endif (NOT EXISTS "${FFMPEG_SOURCE_DIR}/${FFMPEG_VERSION}") + +# Check version +IF(IS_DIRECTORY ${FFMPEG_SOURCE_DIR}/.git) + admGetRevision( ${FFMPEG_SOURCE_DIR} ffmpeg_WC_REVISION) + MESSAGE(STATUS "Current revision ${ffmpeg_WC_REVISION}") +ENDIF(IS_DIRECTORY ${FFMPEG_SOURCE_DIR}/.git) +message("") diff --git a/cmake/admFFmpegPrepareSvn.cmake b/cmake/admFFmpegPrepareSvn.cmake index 45cde72953..b5bc3dc847 100644 --- a/cmake/admFFmpegPrepareSvn.cmake +++ b/cmake/admFFmpegPrepareSvn.cmake @@ -1,61 +1,61 @@ -find_package(Subversion) - -if (NOT VERBOSE) - set(ffmpegSvnOutput OUTPUT_VARIABLE FFMPEG_SVN_OUTPUT) - set(swscaleSvnOutput OUTPUT_VARIABLE SWSCALE_SVN_OUTPUT) -endif (NOT VERBOSE) - -# Checkout FFmpeg source and patch it -if (NOT IS_DIRECTORY "${FFMPEG_SOURCE_DIR}/.svn") - message(STATUS "Checking out FFmpeg") - execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} co svn://svn.ffmpeg.org/ffmpeg/trunk -r ${FFMPEG_VERSION} --ignore-externals "${FFMPEG_SOURCE_DIR}" - ${ffmpegSvnOutput}) - MESSAGE(STATUS "Archiving ffmpeg ${FFMPEG_VERSION}") - MESSAGE(STATUS "${TAR_EXECUTABLE} czf ${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE} ffmpeg, DIR=${FFMPEG_SOURCE_DIR}/..") - execute_process(COMMAND ${TAR_EXECUTABLE} czf "${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE}" source - WORKING_DIRECTORY "${FFMPEG_BASE_DIR}" - ) - - message(STATUS "Checking out libswscale") - execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} co svn://svn.ffmpeg.org/mplayer/trunk/libswscale -r ${SWSCALE_VERSION} "${FFMPEG_SOURCE_DIR}/libswscale" - ${swscaleSvnOutput}) - MESSAGE(STATUS "Archiving libswscale ${SWSCALE_VERSION}") - MESSAGE(STATUS " ${TAR_EXECUTABLE} czf ${FFMPEG_ROOT_DIR}/${SWSCALE_SOURCE_ARCHIVE} libswscale, DIR=${FFMPEG_SOURCE_DIR}/" ) - execute_process(COMMAND ${TAR_EXECUTABLE} czf "${FFMPEG_ROOT_DIR}/${SWSCALE_SOURCE_ARCHIVE}" libswscale - WORKING_DIRECTORY "${FFMPEG_SOURCE_DIR}/" - ) - - set(FFMPEG_PERFORM_PATCH 1) -endif (NOT IS_DIRECTORY "${FFMPEG_SOURCE_DIR}/.svn") - -# Check version -admGetRevision( ${FFMPEG_SOURCE_DIR} ffmpeg_WC_REVISION) -message(STATUS "FFmpeg revision: ${ffmpeg_WC_REVISION}") - -if (NOT ${ffmpeg_WC_REVISION} EQUAL ${FFMPEG_VERSION}) - MESSAGE(STATUS "Updating to revision ${FFMPEG_VERSION}") - set(FFMPEG_PERFORM_BUILD 1) - set(FFMPEG_PERFORM_PATCH 1) - - execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} revert -R "${FFMPEG_SOURCE_DIR}" - ${ffmpegSvnOutput}) - execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} up -r ${FFMPEG_VERSION} --ignore-externals "${FFMPEG_SOURCE_DIR}" - ${ffmpegSvnOutput}) - - message("") -endif (NOT ${ffmpeg_WC_REVISION} EQUAL ${FFMPEG_VERSION}) - -message("") -admGetRevision( ${FFMPEG_SOURCE_DIR}/libswscale swscale_WC_REVISION) -message(STATUS "libswscale revision: ${swscale_WC_REVISION}") - -if (NOT ${swscale_WC_REVISION} EQUAL ${SWSCALE_VERSION}) - message(STATUS "Updating to revision ${SWSCALE_VERSION}") - set(FFMPEG_PERFORM_BUILD 1) - set(FFMPEG_PERFORM_PATCH 1) - - execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} revert -R "${FFMPEG_SOURCE_DIR}/libswscale" - ${swscaleSvnOutput}) - execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} up -r ${SWSCALE_VERSION} "${FFMPEG_SOURCE_DIR}/libswscale" - ${swscaleSvnOutput}) -endif (NOT ${swscale_WC_REVISION} EQUAL ${SWSCALE_VERSION}) +find_package(Subversion) + +if (NOT VERBOSE) + set(ffmpegSvnOutput OUTPUT_VARIABLE FFMPEG_SVN_OUTPUT) + set(swscaleSvnOutput OUTPUT_VARIABLE SWSCALE_SVN_OUTPUT) +endif (NOT VERBOSE) + +# Checkout FFmpeg source and patch it +if (NOT IS_DIRECTORY "${FFMPEG_SOURCE_DIR}/.svn") + message(STATUS "Checking out FFmpeg") + execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} co svn://svn.ffmpeg.org/ffmpeg/trunk -r ${FFMPEG_VERSION} --ignore-externals "${FFMPEG_SOURCE_DIR}" + ${ffmpegSvnOutput}) + MESSAGE(STATUS "Archiving ffmpeg ${FFMPEG_VERSION}") + MESSAGE(STATUS "${TAR_EXECUTABLE} czf ${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE} ffmpeg, DIR=${FFMPEG_SOURCE_DIR}/..") + execute_process(COMMAND ${TAR_EXECUTABLE} czf "${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE}" source + WORKING_DIRECTORY "${FFMPEG_BASE_DIR}" + ) + + message(STATUS "Checking out libswscale") + execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} co svn://svn.ffmpeg.org/mplayer/trunk/libswscale -r ${SWSCALE_VERSION} "${FFMPEG_SOURCE_DIR}/libswscale" + ${swscaleSvnOutput}) + MESSAGE(STATUS "Archiving libswscale ${SWSCALE_VERSION}") + MESSAGE(STATUS " ${TAR_EXECUTABLE} czf ${FFMPEG_ROOT_DIR}/${SWSCALE_SOURCE_ARCHIVE} libswscale, DIR=${FFMPEG_SOURCE_DIR}/" ) + execute_process(COMMAND ${TAR_EXECUTABLE} czf "${FFMPEG_ROOT_DIR}/${SWSCALE_SOURCE_ARCHIVE}" libswscale + WORKING_DIRECTORY "${FFMPEG_SOURCE_DIR}/" + ) + + set(FFMPEG_PERFORM_PATCH 1) +endif (NOT IS_DIRECTORY "${FFMPEG_SOURCE_DIR}/.svn") + +# Check version +admGetRevision( ${FFMPEG_SOURCE_DIR} ffmpeg_WC_REVISION) +message(STATUS "FFmpeg revision: ${ffmpeg_WC_REVISION}") + +if (NOT ${ffmpeg_WC_REVISION} EQUAL ${FFMPEG_VERSION}) + MESSAGE(STATUS "Updating to revision ${FFMPEG_VERSION}") + set(FFMPEG_PERFORM_BUILD 1) + set(FFMPEG_PERFORM_PATCH 1) + + execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} revert -R "${FFMPEG_SOURCE_DIR}" + ${ffmpegSvnOutput}) + execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} up -r ${FFMPEG_VERSION} --ignore-externals "${FFMPEG_SOURCE_DIR}" + ${ffmpegSvnOutput}) + + message("") +endif (NOT ${ffmpeg_WC_REVISION} EQUAL ${FFMPEG_VERSION}) + +message("") +admGetRevision( ${FFMPEG_SOURCE_DIR}/libswscale swscale_WC_REVISION) +message(STATUS "libswscale revision: ${swscale_WC_REVISION}") + +if (NOT ${swscale_WC_REVISION} EQUAL ${SWSCALE_VERSION}) + message(STATUS "Updating to revision ${SWSCALE_VERSION}") + set(FFMPEG_PERFORM_BUILD 1) + set(FFMPEG_PERFORM_PATCH 1) + + execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} revert -R "${FFMPEG_SOURCE_DIR}/libswscale" + ${swscaleSvnOutput}) + execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} up -r ${SWSCALE_VERSION} "${FFMPEG_SOURCE_DIR}/libswscale" + ${swscaleSvnOutput}) +endif (NOT ${swscale_WC_REVISION} EQUAL ${SWSCALE_VERSION}) diff --git a/cmake/admFFmpegPrepareTar.cmake b/cmake/admFFmpegPrepareTar.cmake index 9ac73c2830..53480285c3 100644 --- a/cmake/admFFmpegPrepareTar.cmake +++ b/cmake/admFFmpegPrepareTar.cmake @@ -1,31 +1,31 @@ -if (NOT VERBOSE) - set(ffmpegExtractOutput OUTPUT_VARIABLE FFMPEG_EXTRACT_OUTPUT) -endif (NOT VERBOSE) - -if (EXISTS "${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE}") - MESSAGE(STATUS "Creating ${FFMPEG_BASE_DIR}") - file(MAKE_DIRECTORY "${FFMPEG_BASE_DIR}") - if (NOT EXISTS "${FFMPEG_SOURCE_DIR}/fftools/ffmpeg.c" OR NOT "${LAST_FFMPEG_VERSION}" STREQUAL "${FFMPEG_VERSION}") - find_package(Tar) - MESSAGE(STATUS "Unpacking ffmpeg from ${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE} to ${FFMPEG_BASE_DIR}") - - execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE}" "${FFMPEG_BASE_DIR}") - if (VERBOSE) - set(TAR_OPTS "xvfj") - else (VERBOSE) - set(TAR_OPTS "xfj") - endif (VERBOSE) - execute_process(COMMAND ${TAR_EXECUTABLE} ${TAR_OPTS} "${FFMPEG_SOURCE_ARCHIVE}" - WORKING_DIRECTORY "${FFMPEG_BASE_DIR}" - ${ffmpegExtractOutput}) - - execute_process(COMMAND ${CMAKE_COMMAND} -E rename "${FFMPEG_SOURCE_ARCHIVE_DIR}" "source" - WORKING_DIRECTORY "${FFMPEG_BASE_DIR}") - - set(FFMPEG_PERFORM_PATCH 1) - set(FFMPEG_PERFORM_BUILD 1) - endif (NOT EXISTS "${FFMPEG_SOURCE_DIR}/fftools/ffmpeg.c" OR NOT "${LAST_FFMPEG_VERSION}" STREQUAL "${FFMPEG_VERSION}") - - set(FFMPEG_PREPARED 1) - set(LAST_FFMPEG_VERSION "${FFMPEG_VERSION}" CACHE STRING "" FORCE) -endif (EXISTS "${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE}") +if (NOT VERBOSE) + set(ffmpegExtractOutput OUTPUT_VARIABLE FFMPEG_EXTRACT_OUTPUT) +endif (NOT VERBOSE) + +if (EXISTS "${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE}") + MESSAGE(STATUS "Creating ${FFMPEG_BASE_DIR}") + file(MAKE_DIRECTORY "${FFMPEG_BASE_DIR}") + if (NOT EXISTS "${FFMPEG_SOURCE_DIR}/fftools/ffmpeg.c" OR NOT "${LAST_FFMPEG_VERSION}" STREQUAL "${FFMPEG_VERSION}") + find_package(Tar) + MESSAGE(STATUS "Unpacking ffmpeg from ${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE} to ${FFMPEG_BASE_DIR}") + + execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE}" "${FFMPEG_BASE_DIR}") + if (VERBOSE) + set(TAR_OPTS "xvfj") + else (VERBOSE) + set(TAR_OPTS "xfj") + endif (VERBOSE) + execute_process(COMMAND ${TAR_EXECUTABLE} ${TAR_OPTS} "${FFMPEG_SOURCE_ARCHIVE}" + WORKING_DIRECTORY "${FFMPEG_BASE_DIR}" + ${ffmpegExtractOutput}) + + execute_process(COMMAND ${CMAKE_COMMAND} -E rename "${FFMPEG_SOURCE_ARCHIVE_DIR}" "source" + WORKING_DIRECTORY "${FFMPEG_BASE_DIR}") + + set(FFMPEG_PERFORM_PATCH 1) + set(FFMPEG_PERFORM_BUILD 1) + endif (NOT EXISTS "${FFMPEG_SOURCE_DIR}/fftools/ffmpeg.c" OR NOT "${LAST_FFMPEG_VERSION}" STREQUAL "${FFMPEG_VERSION}") + + set(FFMPEG_PREPARED 1) + set(LAST_FFMPEG_VERSION "${FFMPEG_VERSION}" CACHE STRING "" FORCE) +endif (EXISTS "${FFMPEG_ROOT_DIR}/${FFMPEG_SOURCE_ARCHIVE}") diff --git a/cmake/admFFmpegUtil.cmake b/cmake/admFFmpegUtil.cmake index 3405c8c518..33e2c389f1 100755 --- a/cmake/admFFmpegUtil.cmake +++ b/cmake/admFFmpegUtil.cmake @@ -1,104 +1,104 @@ -MACRO (getFfmpegVersionFromHeader description headerFile definition ffmpegVersion) - FILE(READ "${headerFile}" FFMPEG_H) - STRING(REGEX MATCH "#define[ ]+${definition}[ ]+([0-9]+)" FFMPEG_H "${FFMPEG_H}") - STRING(REGEX REPLACE ".*[ ]([0-9]+).*" "\\1" ${ffmpegVersion} "${FFMPEG_H}") -ENDMACRO (getFfmpegVersionFromHeader) - -MACRO (getFfmpegLibNames sourceDir) - getFfmpegVersionFromHeader("libavcodec" "${sourceDir}/libavcodec/version_major.h" LIBAVCODEC_VERSION_MAJOR LIBAVCODEC_VERSION) - getFfmpegVersionFromHeader("libavformat" "${sourceDir}/libavformat/version_major.h" LIBAVFORMAT_VERSION_MAJOR LIBAVFORMAT_VERSION) - getFfmpegVersionFromHeader("libavutil" "${sourceDir}/libavutil/version.h" LIBAVUTIL_VERSION_MAJOR LIBAVUTIL_VERSION) - getFfmpegVersionFromHeader("libpostproc" "${sourceDir}/libpostproc/version_major.h" LIBPOSTPROC_VERSION_MAJOR LIBPOSTPROC_VERSION) - getFfmpegVersionFromHeader("libswscale" "${sourceDir}/libswscale/version_major.h" LIBSWSCALE_VERSION_MAJOR LIBSWSCALE_VERSION) - SET(VERBOSE 1) - if (VERBOSE) - MESSAGE(STATUS "AVFORMAT : ${LIBAVFORMAT_VERSION}, Major : ${LIBAVFORMAT_VERSION_MAJOR}") - MESSAGE(STATUS "AVCODEC : ${LIBAVCODEC_VERSION}, Major : ${LIBAVCODEC_VERSION_MAJOR}") - MESSAGE(STATUS "AVUTIL : ${LIBAVUTIL_VERSION}, Major : ${LIBAVUTIL_VERSION_MAJOR}") - MESSAGE(STATUS "POSTPRC : ${LIBPOSTPROC_VERSION}, Major : ${LIBPOSTPROC_VERSION_MAJOR}") - MESSAGE(STATUS "SWSCALE : ${LIBSWSCALE_VERSION}, Major : ${LIBSWSCALE_VERSION_MAJOR}") - message("") - endif (VERBOSE) - - if (UNIX) - set(LIBAVCODEC_ADM ADM6) - endif (UNIX) - - if (APPLE) - set(LIBAVCODEC_LIB lib${LIBAVCODEC_ADM}avcodec.${LIBAVCODEC_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(LIBAVFORMAT_LIB lib${LIBAVCODEC_ADM}avformat.${LIBAVFORMAT_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(LIBAVUTIL_LIB lib${LIBAVCODEC_ADM}avutil.${LIBAVUTIL_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(LIBPOSTPROC_LIB lib${LIBAVCODEC_ADM}postproc.${LIBPOSTPROC_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(LIBSWSCALE_LIB lib${LIBAVCODEC_ADM}swscale.${LIBSWSCALE_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) - elseif (UNIX) - set(LIBAVCODEC_LIB lib${LIBAVCODEC_ADM}avcodec${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBAVCODEC_VERSION}) - set(LIBAVFORMAT_LIB lib${LIBAVCODEC_ADM}avformat${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBAVFORMAT_VERSION}) - set(LIBAVUTIL_LIB lib${LIBAVCODEC_ADM}avutil${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBAVUTIL_VERSION}) - set(LIBPOSTPROC_LIB lib${LIBAVCODEC_ADM}postproc${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBPOSTPROC_VERSION}) - set(LIBSWSCALE_LIB lib${LIBAVCODEC_ADM}swscale${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBSWSCALE_VERSION}) - elseif (MINGW) - set(LIBAVCODEC_LIB ${LIBAVCODEC_ADM}avcodec-${LIBAVCODEC_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(LIBAVFORMAT_LIB ${LIBAVCODEC_ADM}avformat-${LIBAVFORMAT_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(LIBAVUTIL_LIB ${LIBAVCODEC_ADM}avutil-${LIBAVUTIL_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(LIBPOSTPROC_LIB ${LIBAVCODEC_ADM}postproc-${LIBPOSTPROC_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(LIBSWSCALE_LIB ${LIBAVCODEC_ADM}swscale-${LIBSWSCALE_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) - elseif (MSVC) - set(LIBAVCODEC_LIB avcodec.lib) - set(LIBAVFORMAT_LIB avformat.lib) - set(LIBAVUTIL_LIB avutil.lib) - set(LIBPOSTPROC_LIB postproc.lib) - set(LIBSWSCALE_LIB swscale.lib) - endif (APPLE) -ENDMACRO (getFfmpegLibNames) - -MACRO (registerFFmpeg sourceDir binaryDir installed) - getFfmpegLibNames("${sourceDir}") - - add_library(ADM_libswscale UNKNOWN IMPORTED) - add_library(ADM_libpostproc UNKNOWN IMPORTED) - add_library(ADM_libavutil UNKNOWN IMPORTED) - add_library(ADM_libavcodec UNKNOWN IMPORTED) - add_library(ADM_libavformat UNKNOWN IMPORTED) - - if (${installed}) - set_property(TARGET ADM_libswscale PROPERTY IMPORTED_LOCATION "${binaryDir}/${LIBSWSCALE_LIB}") - set_property(TARGET ADM_libpostproc PROPERTY IMPORTED_LOCATION "${binaryDir}/${LIBPOSTPROC_LIB}") - set_property(TARGET ADM_libavutil PROPERTY IMPORTED_LOCATION "${binaryDir}/${LIBAVUTIL_LIB}") - set_property(TARGET ADM_libavcodec PROPERTY IMPORTED_LOCATION "${binaryDir}/${LIBAVCODEC_LIB}") - set_property(TARGET ADM_libavformat PROPERTY IMPORTED_LOCATION "${binaryDir}/${LIBAVFORMAT_LIB}") - else (${installed}) - set_property(TARGET ADM_libswscale PROPERTY IMPORTED_LOCATION "${binaryDir}/libswscale/${LIBSWSCALE_LIB}") - set_property(TARGET ADM_libpostproc PROPERTY IMPORTED_LOCATION "${binaryDir}/libpostproc/${LIBPOSTPROC_LIB}") - set_property(TARGET ADM_libavutil PROPERTY IMPORTED_LOCATION "${binaryDir}/libavutil/${LIBAVUTIL_LIB}") - set_property(TARGET ADM_libavcodec PROPERTY IMPORTED_LOCATION "${binaryDir}/libavcodec/${LIBAVCODEC_LIB}") - set_property(TARGET ADM_libavformat PROPERTY IMPORTED_LOCATION "${binaryDir}/libavformat/${LIBAVFORMAT_LIB}") - - add_custom_target(libavcodec DEPENDS "${binaryDir}/libavcodec/${LIBAVCODEC_LIB}") - add_custom_target(libavformat DEPENDS "${binaryDir}/libavformat/${LIBAVFORMAT_LIB}") - add_custom_target(libavutil DEPENDS "${binaryDir}/libavutil/${LIBAVUTIL_LIB}") - add_custom_target(libpostproc DEPENDS "${binaryDir}/libpostproc/${LIBPOSTPROC_LIB}") - add_custom_target(libswscale DEPENDS "${binaryDir}/libswscale/${LIBSWSCALE_LIB}") - add_custom_target(ffmpeg DEPENDS "${binaryDir}/ffmpeg${CMAKE_EXECUTABLE_SUFFIX}") - - if (${CMAKE_VERSION} VERSION_GREATER 2.8.3) - add_dependencies(ADM_libavcodec libavcodec) - add_dependencies(ADM_libavformat libavformat) - add_dependencies(ADM_libavutil libavutil) - add_dependencies(ADM_libpostproc libpostproc) - add_dependencies(ADM_libswscale libswscale) - endif (${CMAKE_VERSION} VERSION_GREATER 2.8.3) - endif (${installed}) -ENDMACRO (registerFFmpeg) - -MACRO (convertPathToUnix pathVariableName bashExecutable) - if (WIN32) - get_filename_component(directory ${${pathVariableName}} PATH) - get_filename_component(fileName ${${pathVariableName}} NAME) - - execute_process(COMMAND ${bashExecutable} -c "echo $PWD" WORKING_DIRECTORY "${directory}" - OUTPUT_VARIABLE ${pathVariableName}) - - string(REGEX REPLACE "(\r?\n)+$" "" ${pathVariableName} "${${pathVariableName}}") - set(${pathVariableName} "${${pathVariableName}}/${fileName}") - endif (WIN32) -ENDMACRO (convertPathToUnix) +MACRO (getFfmpegVersionFromHeader description headerFile definition ffmpegVersion) + FILE(READ "${headerFile}" FFMPEG_H) + STRING(REGEX MATCH "#define[ ]+${definition}[ ]+([0-9]+)" FFMPEG_H "${FFMPEG_H}") + STRING(REGEX REPLACE ".*[ ]([0-9]+).*" "\\1" ${ffmpegVersion} "${FFMPEG_H}") +ENDMACRO (getFfmpegVersionFromHeader) + +MACRO (getFfmpegLibNames sourceDir) + getFfmpegVersionFromHeader("libavcodec" "${sourceDir}/libavcodec/version_major.h" LIBAVCODEC_VERSION_MAJOR LIBAVCODEC_VERSION) + getFfmpegVersionFromHeader("libavformat" "${sourceDir}/libavformat/version_major.h" LIBAVFORMAT_VERSION_MAJOR LIBAVFORMAT_VERSION) + getFfmpegVersionFromHeader("libavutil" "${sourceDir}/libavutil/version.h" LIBAVUTIL_VERSION_MAJOR LIBAVUTIL_VERSION) + getFfmpegVersionFromHeader("libpostproc" "${sourceDir}/libpostproc/version_major.h" LIBPOSTPROC_VERSION_MAJOR LIBPOSTPROC_VERSION) + getFfmpegVersionFromHeader("libswscale" "${sourceDir}/libswscale/version_major.h" LIBSWSCALE_VERSION_MAJOR LIBSWSCALE_VERSION) + SET(VERBOSE 1) + if (VERBOSE) + MESSAGE(STATUS "AVFORMAT : ${LIBAVFORMAT_VERSION}, Major : ${LIBAVFORMAT_VERSION_MAJOR}") + MESSAGE(STATUS "AVCODEC : ${LIBAVCODEC_VERSION}, Major : ${LIBAVCODEC_VERSION_MAJOR}") + MESSAGE(STATUS "AVUTIL : ${LIBAVUTIL_VERSION}, Major : ${LIBAVUTIL_VERSION_MAJOR}") + MESSAGE(STATUS "POSTPRC : ${LIBPOSTPROC_VERSION}, Major : ${LIBPOSTPROC_VERSION_MAJOR}") + MESSAGE(STATUS "SWSCALE : ${LIBSWSCALE_VERSION}, Major : ${LIBSWSCALE_VERSION_MAJOR}") + message("") + endif (VERBOSE) + + if (UNIX) + set(LIBAVCODEC_ADM ADM6) + endif (UNIX) + + if (APPLE) + set(LIBAVCODEC_LIB lib${LIBAVCODEC_ADM}avcodec.${LIBAVCODEC_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(LIBAVFORMAT_LIB lib${LIBAVCODEC_ADM}avformat.${LIBAVFORMAT_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(LIBAVUTIL_LIB lib${LIBAVCODEC_ADM}avutil.${LIBAVUTIL_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(LIBPOSTPROC_LIB lib${LIBAVCODEC_ADM}postproc.${LIBPOSTPROC_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(LIBSWSCALE_LIB lib${LIBAVCODEC_ADM}swscale.${LIBSWSCALE_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) + elseif (UNIX) + set(LIBAVCODEC_LIB lib${LIBAVCODEC_ADM}avcodec${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBAVCODEC_VERSION}) + set(LIBAVFORMAT_LIB lib${LIBAVCODEC_ADM}avformat${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBAVFORMAT_VERSION}) + set(LIBAVUTIL_LIB lib${LIBAVCODEC_ADM}avutil${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBAVUTIL_VERSION}) + set(LIBPOSTPROC_LIB lib${LIBAVCODEC_ADM}postproc${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBPOSTPROC_VERSION}) + set(LIBSWSCALE_LIB lib${LIBAVCODEC_ADM}swscale${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBSWSCALE_VERSION}) + elseif (MINGW) + set(LIBAVCODEC_LIB ${LIBAVCODEC_ADM}avcodec-${LIBAVCODEC_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(LIBAVFORMAT_LIB ${LIBAVCODEC_ADM}avformat-${LIBAVFORMAT_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(LIBAVUTIL_LIB ${LIBAVCODEC_ADM}avutil-${LIBAVUTIL_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(LIBPOSTPROC_LIB ${LIBAVCODEC_ADM}postproc-${LIBPOSTPROC_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(LIBSWSCALE_LIB ${LIBAVCODEC_ADM}swscale-${LIBSWSCALE_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}) + elseif (MSVC) + set(LIBAVCODEC_LIB avcodec.lib) + set(LIBAVFORMAT_LIB avformat.lib) + set(LIBAVUTIL_LIB avutil.lib) + set(LIBPOSTPROC_LIB postproc.lib) + set(LIBSWSCALE_LIB swscale.lib) + endif (APPLE) +ENDMACRO (getFfmpegLibNames) + +MACRO (registerFFmpeg sourceDir binaryDir installed) + getFfmpegLibNames("${sourceDir}") + + add_library(ADM_libswscale UNKNOWN IMPORTED) + add_library(ADM_libpostproc UNKNOWN IMPORTED) + add_library(ADM_libavutil UNKNOWN IMPORTED) + add_library(ADM_libavcodec UNKNOWN IMPORTED) + add_library(ADM_libavformat UNKNOWN IMPORTED) + + if (${installed}) + set_property(TARGET ADM_libswscale PROPERTY IMPORTED_LOCATION "${binaryDir}/${LIBSWSCALE_LIB}") + set_property(TARGET ADM_libpostproc PROPERTY IMPORTED_LOCATION "${binaryDir}/${LIBPOSTPROC_LIB}") + set_property(TARGET ADM_libavutil PROPERTY IMPORTED_LOCATION "${binaryDir}/${LIBAVUTIL_LIB}") + set_property(TARGET ADM_libavcodec PROPERTY IMPORTED_LOCATION "${binaryDir}/${LIBAVCODEC_LIB}") + set_property(TARGET ADM_libavformat PROPERTY IMPORTED_LOCATION "${binaryDir}/${LIBAVFORMAT_LIB}") + else (${installed}) + set_property(TARGET ADM_libswscale PROPERTY IMPORTED_LOCATION "${binaryDir}/libswscale/${LIBSWSCALE_LIB}") + set_property(TARGET ADM_libpostproc PROPERTY IMPORTED_LOCATION "${binaryDir}/libpostproc/${LIBPOSTPROC_LIB}") + set_property(TARGET ADM_libavutil PROPERTY IMPORTED_LOCATION "${binaryDir}/libavutil/${LIBAVUTIL_LIB}") + set_property(TARGET ADM_libavcodec PROPERTY IMPORTED_LOCATION "${binaryDir}/libavcodec/${LIBAVCODEC_LIB}") + set_property(TARGET ADM_libavformat PROPERTY IMPORTED_LOCATION "${binaryDir}/libavformat/${LIBAVFORMAT_LIB}") + + add_custom_target(libavcodec DEPENDS "${binaryDir}/libavcodec/${LIBAVCODEC_LIB}") + add_custom_target(libavformat DEPENDS "${binaryDir}/libavformat/${LIBAVFORMAT_LIB}") + add_custom_target(libavutil DEPENDS "${binaryDir}/libavutil/${LIBAVUTIL_LIB}") + add_custom_target(libpostproc DEPENDS "${binaryDir}/libpostproc/${LIBPOSTPROC_LIB}") + add_custom_target(libswscale DEPENDS "${binaryDir}/libswscale/${LIBSWSCALE_LIB}") + add_custom_target(ffmpeg DEPENDS "${binaryDir}/ffmpeg${CMAKE_EXECUTABLE_SUFFIX}") + + if (${CMAKE_VERSION} VERSION_GREATER 2.8.3) + add_dependencies(ADM_libavcodec libavcodec) + add_dependencies(ADM_libavformat libavformat) + add_dependencies(ADM_libavutil libavutil) + add_dependencies(ADM_libpostproc libpostproc) + add_dependencies(ADM_libswscale libswscale) + endif (${CMAKE_VERSION} VERSION_GREATER 2.8.3) + endif (${installed}) +ENDMACRO (registerFFmpeg) + +MACRO (convertPathToUnix pathVariableName bashExecutable) + if (WIN32) + get_filename_component(directory ${${pathVariableName}} PATH) + get_filename_component(fileName ${${pathVariableName}} NAME) + + execute_process(COMMAND ${bashExecutable} -c "echo $PWD" WORKING_DIRECTORY "${directory}" + OUTPUT_VARIABLE ${pathVariableName}) + + string(REGEX REPLACE "(\r?\n)+$" "" ${pathVariableName} "${${pathVariableName}}") + set(${pathVariableName} "${${pathVariableName}}/${fileName}") + endif (WIN32) +ENDMACRO (convertPathToUnix) diff --git a/cmake/admOpenGl.cmake b/cmake/admOpenGl.cmake index 53e14765c9..1a7e75aa3e 100644 --- a/cmake/admOpenGl.cmake +++ b/cmake/admOpenGl.cmake @@ -1,9 +1,9 @@ -MACRO(ADM_OPEN_GL target) - IF(USE_OPENGL) - INCLUDE_DIRECTORIES(${QT_HEADERS_DIR}) - INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) - INCLUDE_DIRECTORIES(${QT_QTOPENGL_INCLUDE_DIR}) - INCLUDE_DIRECTORIES(${AVIDEMUX_TOP_SOURCE_DIR}/avidemux/qt4/ADM_openGL/include/) - TARGET_LINK_LIBRARIES(${target} ${OPENGL_LIBRARIES} ${QT_QTOPENGL_LIBRARIES} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ADM_openGL${QT_LIBRARY_EXTENSION}6) - ENDIF(USE_OPENGL) -ENDMACRO(ADM_OPEN_GL target) +MACRO(ADM_OPEN_GL target) + IF(USE_OPENGL) + INCLUDE_DIRECTORIES(${QT_HEADERS_DIR}) + INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(${QT_QTOPENGL_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(${AVIDEMUX_TOP_SOURCE_DIR}/avidemux/qt4/ADM_openGL/include/) + TARGET_LINK_LIBRARIES(${target} ${OPENGL_LIBRARIES} ${QT_QTOPENGL_LIBRARIES} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ADM_openGL${QT_LIBRARY_EXTENSION}6) + ENDIF(USE_OPENGL) +ENDMACRO(ADM_OPEN_GL target) diff --git a/cmake/attic/FindThreads.cmake b/cmake/attic/FindThreads.cmake index 6c635ee01d..61aea7895b 100644 --- a/cmake/attic/FindThreads.cmake +++ b/cmake/attic/FindThreads.cmake @@ -1,80 +1,80 @@ -# - This module determines the thread library of the system. -# The following variables are set -# PTHREAD_FOUND - system has pthreads -# PTHREAD_INCLUDE_DIR - the pthreads include directory -# PTHREAD_LIBRARIES - the libraries needed to use pthreads - -INCLUDE (CheckIncludeFile) -INCLUDE (CheckIncludeFiles) -INCLUDE (CheckLibraryExists) - -# Do we have pthreads? -FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h) -MARK_AS_ADVANCED(PTHREAD_INCLUDE_DIR) - -IF(PTHREAD_INCLUDE_DIR) - # We have pthread.h - # Let's check for the library now. - - # Do we have -lpthreads - FIND_LIBRARY(PTHREAD_LIBRARIES "pthreads") - - IF (NOT PTHREAD_LIBRARIES) - FIND_LIBRARY(PTHREAD_LIBRARIES "pthread") - ENDIF (NOT PTHREAD_LIBRARIES) - - IF (NOT PTHREAD_LIBRARIES AND (WIN32 OR WIN64)) - FIND_LIBRARY(PTHREAD_LIBRARIES "libwinpthread") - ENDIF (NOT PTHREAD_LIBRARIES AND (WIN32 OR WIN64)) - - IF (NOT PTHREAD_LIBRARIES AND WIN32) - FIND_LIBRARY(PTHREAD_LIBRARIES "pthreadGC2") - ENDIF (NOT PTHREAD_LIBRARIES AND WIN32) - - IF (NOT PTHREAD_LIBRARIES) - MESSAGE(STATUS "Check if compiler accepts -pthread") - - TRY_RUN(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG - ${CMAKE_BINARY_DIR} - ${CMAKE_ROOT}/Modules/CheckForPthreads.c - CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread - OUTPUT_VARIABLE OUTPUT) - - IF (THREADS_HAVE_PTHREAD_ARG) - IF(THREADS_PTHREAD_ARG MATCHES "^2$") - MESSAGE(STATUS "Check if compiler accepts -pthread - yes") - ELSE (THREADS_PTHREAD_ARG MATCHES "^2$") - MESSAGE(STATUS "Check if compiler accepts -pthread - no") - - FILE(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if compiler accepts -pthread returned ${THREADS_PTHREAD_ARG} instead of 2. The compiler had the following output:\n${OUTPUT}\n\n") - ENDIF (THREADS_PTHREAD_ARG MATCHES "^2$") - ELSE (THREADS_HAVE_PTHREAD_ARG) - MESSAGE(STATUS "Check if compiler accepts -pthread - no") - - FILE(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n") - ENDIF (THREADS_HAVE_PTHREAD_ARG) - - IF (THREADS_HAVE_PTHREAD_ARG) - SET(PTHREAD_LIBRARIES "-pthread") - ENDIF (THREADS_HAVE_PTHREAD_ARG) - ENDIF (NOT PTHREAD_LIBRARIES) - - MARK_AS_ADVANCED(PTHREAD_LIBRARIES) - - IF (PTHREAD_LIBRARIES) - SET(PTHREAD_FOUND 1) - ENDIF (PTHREAD_LIBRARIES) -ENDIF(PTHREAD_INCLUDE_DIR) - -MACRO(ADM_LINK_THREAD target) - IF (WIN32) - TARGET_LINK_LIBRARIES(${target} "${PTHREAD_LIBRARIES}") - ENDIF (WIN32) - IF (UNIX AND PTHREAD_FOUND) - TARGET_LINK_LIBRARIES(${target} ${PTHREAD_LIBRARIES}) - ENDIF (UNIX AND PTHREAD_FOUND) -ENDMACRO(ADM_LINK_THREAD ) +# - This module determines the thread library of the system. +# The following variables are set +# PTHREAD_FOUND - system has pthreads +# PTHREAD_INCLUDE_DIR - the pthreads include directory +# PTHREAD_LIBRARIES - the libraries needed to use pthreads + +INCLUDE (CheckIncludeFile) +INCLUDE (CheckIncludeFiles) +INCLUDE (CheckLibraryExists) + +# Do we have pthreads? +FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h) +MARK_AS_ADVANCED(PTHREAD_INCLUDE_DIR) + +IF(PTHREAD_INCLUDE_DIR) + # We have pthread.h + # Let's check for the library now. + + # Do we have -lpthreads + FIND_LIBRARY(PTHREAD_LIBRARIES "pthreads") + + IF (NOT PTHREAD_LIBRARIES) + FIND_LIBRARY(PTHREAD_LIBRARIES "pthread") + ENDIF (NOT PTHREAD_LIBRARIES) + + IF (NOT PTHREAD_LIBRARIES AND (WIN32 OR WIN64)) + FIND_LIBRARY(PTHREAD_LIBRARIES "libwinpthread") + ENDIF (NOT PTHREAD_LIBRARIES AND (WIN32 OR WIN64)) + + IF (NOT PTHREAD_LIBRARIES AND WIN32) + FIND_LIBRARY(PTHREAD_LIBRARIES "pthreadGC2") + ENDIF (NOT PTHREAD_LIBRARIES AND WIN32) + + IF (NOT PTHREAD_LIBRARIES) + MESSAGE(STATUS "Check if compiler accepts -pthread") + + TRY_RUN(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG + ${CMAKE_BINARY_DIR} + ${CMAKE_ROOT}/Modules/CheckForPthreads.c + CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread + OUTPUT_VARIABLE OUTPUT) + + IF (THREADS_HAVE_PTHREAD_ARG) + IF(THREADS_PTHREAD_ARG MATCHES "^2$") + MESSAGE(STATUS "Check if compiler accepts -pthread - yes") + ELSE (THREADS_PTHREAD_ARG MATCHES "^2$") + MESSAGE(STATUS "Check if compiler accepts -pthread - no") + + FILE(APPEND + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining if compiler accepts -pthread returned ${THREADS_PTHREAD_ARG} instead of 2. The compiler had the following output:\n${OUTPUT}\n\n") + ENDIF (THREADS_PTHREAD_ARG MATCHES "^2$") + ELSE (THREADS_HAVE_PTHREAD_ARG) + MESSAGE(STATUS "Check if compiler accepts -pthread - no") + + FILE(APPEND + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n") + ENDIF (THREADS_HAVE_PTHREAD_ARG) + + IF (THREADS_HAVE_PTHREAD_ARG) + SET(PTHREAD_LIBRARIES "-pthread") + ENDIF (THREADS_HAVE_PTHREAD_ARG) + ENDIF (NOT PTHREAD_LIBRARIES) + + MARK_AS_ADVANCED(PTHREAD_LIBRARIES) + + IF (PTHREAD_LIBRARIES) + SET(PTHREAD_FOUND 1) + ENDIF (PTHREAD_LIBRARIES) +ENDIF(PTHREAD_INCLUDE_DIR) + +MACRO(ADM_LINK_THREAD target) + IF (WIN32) + TARGET_LINK_LIBRARIES(${target} "${PTHREAD_LIBRARIES}") + ENDIF (WIN32) + IF (UNIX AND PTHREAD_FOUND) + TARGET_LINK_LIBRARIES(${target} ${PTHREAD_LIBRARIES}) + ENDIF (UNIX AND PTHREAD_FOUND) +ENDMACRO(ADM_LINK_THREAD ) diff --git a/cmake/cmake_compile_check/CheckFunctionExists.c b/cmake/cmake_compile_check/CheckFunctionExists.c index 5a94804f82..607b3e8c6a 100644 --- a/cmake/cmake_compile_check/CheckFunctionExists.c +++ b/cmake/cmake_compile_check/CheckFunctionExists.c @@ -1,23 +1,23 @@ -#ifdef CHECK_FUNCTION_EXISTS - -char CHECK_FUNCTION_EXISTS(); -#ifdef __CLASSIC_C__ -int main(){ - int ac; - char*av[]; -#else -int main(int ac, char*av[]){ -#endif - CHECK_FUNCTION_EXISTS(); - if(ac > 1000) - { - return *av[0]; - } - return 0; -} - -#else /* CHECK_FUNCTION_EXISTS */ - -# error "CHECK_FUNCTION_EXISTS has to specify the function" - -#endif /* CHECK_FUNCTION_EXISTS */ +#ifdef CHECK_FUNCTION_EXISTS + +char CHECK_FUNCTION_EXISTS(); +#ifdef __CLASSIC_C__ +int main(){ + int ac; + char*av[]; +#else +int main(int ac, char*av[]){ +#endif + CHECK_FUNCTION_EXISTS(); + if(ac > 1000) + { + return *av[0]; + } + return 0; +} + +#else /* CHECK_FUNCTION_EXISTS */ + +# error "CHECK_FUNCTION_EXISTS has to specify the function" + +#endif /* CHECK_FUNCTION_EXISTS */ diff --git a/cmake/cmake_win32_rc/VersionInfo.in b/cmake/cmake_win32_rc/VersionInfo.in index e929aa03d5..c77180f2d5 100644 --- a/cmake/cmake_win32_rc/VersionInfo.in +++ b/cmake/cmake_win32_rc/VersionInfo.in @@ -1,82 +1,82 @@ -#pragma once - -#ifndef PRODUCT_VERSION_MAJOR -#define PRODUCT_VERSION_MAJOR @PRODUCT_VERSION_MAJOR@ -#endif - -#ifndef PRODUCT_VERSION_MINOR -#define PRODUCT_VERSION_MINOR @PRODUCT_VERSION_MINOR@ -#endif - -#ifndef PRODUCT_VERSION_PATCH -#define PRODUCT_VERSION_PATCH @PRODUCT_VERSION_PATCH@ -#endif - -#ifndef PRODUCT_VERSION_BUILD -#define PRODUCT_VERSION_BUILD @PRODUCT_VERSION_REVISION@ -#endif - -#ifndef FILE_VERSION_MAJOR -#define FILE_VERSION_MAJOR @PRODUCT_VERSION_MAJOR@ -#endif - -#ifndef FILE_VERSION_MINOR -#define FILE_VERSION_MINOR @PRODUCT_VERSION_MINOR@ -#endif - -#ifndef FILE_VERSION_PATCH -#define FILE_VERSION_PATCH @PRODUCT_VERSION_PATCH@ -#endif - -#ifndef FILE_VERSION_BUILD -#define FILE_VERSION_BUILD @PRODUCT_VERSION_REVISION@ -#endif - -#ifndef __TO_STRING -#define __TO_STRING_IMPL(x) #x -#define __TO_STRING(x) __TO_STRING_IMPL(x) -#endif - -#define PRODUCT_VERSION_MAJOR_MINOR_STR __TO_STRING(PRODUCT_VERSION_MAJOR) "." __TO_STRING(PRODUCT_VERSION_MINOR) -#define PRODUCT_VERSION_MAJOR_MINOR_PATCH_STR PRODUCT_VERSION_MAJOR_MINOR_STR "." __TO_STRING(PRODUCT_VERSION_PATCH) -#define PRODUCT_VERSION_FULL_STR PRODUCT_VERSION_MAJOR_MINOR_PATCH_STR "." __TO_STRING(PRODUCT_VERSION_BUILD) -#define PRODUCT_VERSION_RESOURCE PRODUCT_VERSION_MAJOR,PRODUCT_VERSION_MINOR,PRODUCT_VERSION_PATCH,PRODUCT_VERSION_BUILD -#define PRODUCT_VERSION_RESOURCE_STR PRODUCT_VERSION_FULL_STR "\0" - -#define FILE_VERSION_MAJOR_MINOR_STR __TO_STRING(FILE_VERSION_MAJOR) "." __TO_STRING(FILE_VERSION_MINOR) -#define FILE_VERSION_MAJOR_MINOR_PATCH_STR FILE_VERSION_MAJOR_MINOR_STR "." __TO_STRING(FILE_VERSION_PATCH) -#define FILE_VERSION_FULL_STR FILE_VERSION_MAJOR_MINOR_PATCH_STR "." __TO_STRING(FILE_VERSION_BUILD) -#define FILE_VERSION_RESOURCE FILE_VERSION_MAJOR,FILE_VERSION_MINOR,FILE_VERSION_PATCH,FILE_VERSION_BUILD -#define FILE_VERSION_RESOURCE_STR FILE_VERSION_FULL_STR "\0" - -#ifndef PRODUCT_ICON -#define PRODUCT_ICON "@PRODUCT_ICON@" -#endif - -#ifndef PRODUCT_COMMENTS -#define PRODUCT_COMMENTS "@PRODUCT_COMMENTS@\0" -#endif - -#ifndef PRODUCT_COMPANY_NAME -#define PRODUCT_COMPANY_NAME "@PRODUCT_COMPANY_NAME@\0" -#endif - -#ifndef PRODUCT_COMPANY_COPYRIGHT -#define PRODUCT_COMPANY_COPYRIGHT "@PRODUCT_COMPANY_COPYRIGHT@\0" -#endif - -#ifndef PRODUCT_FILE_DESCRIPTION -#define PRODUCT_FILE_DESCRIPTION "@PRODUCT_FILE_DESCRIPTION@\0" -#endif - -#ifndef PRODUCT_INTERNAL_NAME -#define PRODUCT_INTERNAL_NAME "@PRODUCT_NAME@\0" -#endif - -#ifndef PRODUCT_ORIGINAL_FILENAME -#define PRODUCT_ORIGINAL_FILENAME "@PRODUCT_ORIGINAL_FILENAME@\0" -#endif - -#ifndef PRODUCT_BUNDLE -#define PRODUCT_BUNDLE "@PRODUCT_BUNDLE@\0" -#endif +#pragma once + +#ifndef PRODUCT_VERSION_MAJOR +#define PRODUCT_VERSION_MAJOR @PRODUCT_VERSION_MAJOR@ +#endif + +#ifndef PRODUCT_VERSION_MINOR +#define PRODUCT_VERSION_MINOR @PRODUCT_VERSION_MINOR@ +#endif + +#ifndef PRODUCT_VERSION_PATCH +#define PRODUCT_VERSION_PATCH @PRODUCT_VERSION_PATCH@ +#endif + +#ifndef PRODUCT_VERSION_BUILD +#define PRODUCT_VERSION_BUILD @PRODUCT_VERSION_REVISION@ +#endif + +#ifndef FILE_VERSION_MAJOR +#define FILE_VERSION_MAJOR @PRODUCT_VERSION_MAJOR@ +#endif + +#ifndef FILE_VERSION_MINOR +#define FILE_VERSION_MINOR @PRODUCT_VERSION_MINOR@ +#endif + +#ifndef FILE_VERSION_PATCH +#define FILE_VERSION_PATCH @PRODUCT_VERSION_PATCH@ +#endif + +#ifndef FILE_VERSION_BUILD +#define FILE_VERSION_BUILD @PRODUCT_VERSION_REVISION@ +#endif + +#ifndef __TO_STRING +#define __TO_STRING_IMPL(x) #x +#define __TO_STRING(x) __TO_STRING_IMPL(x) +#endif + +#define PRODUCT_VERSION_MAJOR_MINOR_STR __TO_STRING(PRODUCT_VERSION_MAJOR) "." __TO_STRING(PRODUCT_VERSION_MINOR) +#define PRODUCT_VERSION_MAJOR_MINOR_PATCH_STR PRODUCT_VERSION_MAJOR_MINOR_STR "." __TO_STRING(PRODUCT_VERSION_PATCH) +#define PRODUCT_VERSION_FULL_STR PRODUCT_VERSION_MAJOR_MINOR_PATCH_STR "." __TO_STRING(PRODUCT_VERSION_BUILD) +#define PRODUCT_VERSION_RESOURCE PRODUCT_VERSION_MAJOR,PRODUCT_VERSION_MINOR,PRODUCT_VERSION_PATCH,PRODUCT_VERSION_BUILD +#define PRODUCT_VERSION_RESOURCE_STR PRODUCT_VERSION_FULL_STR "\0" + +#define FILE_VERSION_MAJOR_MINOR_STR __TO_STRING(FILE_VERSION_MAJOR) "." __TO_STRING(FILE_VERSION_MINOR) +#define FILE_VERSION_MAJOR_MINOR_PATCH_STR FILE_VERSION_MAJOR_MINOR_STR "." __TO_STRING(FILE_VERSION_PATCH) +#define FILE_VERSION_FULL_STR FILE_VERSION_MAJOR_MINOR_PATCH_STR "." __TO_STRING(FILE_VERSION_BUILD) +#define FILE_VERSION_RESOURCE FILE_VERSION_MAJOR,FILE_VERSION_MINOR,FILE_VERSION_PATCH,FILE_VERSION_BUILD +#define FILE_VERSION_RESOURCE_STR FILE_VERSION_FULL_STR "\0" + +#ifndef PRODUCT_ICON +#define PRODUCT_ICON "@PRODUCT_ICON@" +#endif + +#ifndef PRODUCT_COMMENTS +#define PRODUCT_COMMENTS "@PRODUCT_COMMENTS@\0" +#endif + +#ifndef PRODUCT_COMPANY_NAME +#define PRODUCT_COMPANY_NAME "@PRODUCT_COMPANY_NAME@\0" +#endif + +#ifndef PRODUCT_COMPANY_COPYRIGHT +#define PRODUCT_COMPANY_COPYRIGHT "@PRODUCT_COMPANY_COPYRIGHT@\0" +#endif + +#ifndef PRODUCT_FILE_DESCRIPTION +#define PRODUCT_FILE_DESCRIPTION "@PRODUCT_FILE_DESCRIPTION@\0" +#endif + +#ifndef PRODUCT_INTERNAL_NAME +#define PRODUCT_INTERNAL_NAME "@PRODUCT_NAME@\0" +#endif + +#ifndef PRODUCT_ORIGINAL_FILENAME +#define PRODUCT_ORIGINAL_FILENAME "@PRODUCT_ORIGINAL_FILENAME@\0" +#endif + +#ifndef PRODUCT_BUNDLE +#define PRODUCT_BUNDLE "@PRODUCT_BUNDLE@\0" +#endif diff --git a/cmake/cmake_win32_rc/VersionResource.rc b/cmake/cmake_win32_rc/VersionResource.rc index 5493922d44..d506075da2 100644 --- a/cmake/cmake_win32_rc/VersionResource.rc +++ b/cmake/cmake_win32_rc/VersionResource.rc @@ -1,52 +1,52 @@ -#pragma code_page(65001) // UTF-8 - -#include "VersionInfo.h" - -#if defined(__MINGW64__) || defined(__MINGW32__) - // MinGW-w64, MinGW - #if defined(__has_include) && __has_include() - #include - #else - #include - #include - #endif -#else - // MSVC, Windows SDK - #include -#endif - -IDI_ICON1 ICON PRODUCT_ICON - -VS_VERSION_INFO VERSIONINFO - FILEVERSION FILE_VERSION_RESOURCE - PRODUCTVERSION PRODUCT_VERSION_RESOURCE - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "Comments", PRODUCT_COMMENTS - VALUE "CompanyName", PRODUCT_COMPANY_NAME - VALUE "FileDescription", PRODUCT_FILE_DESCRIPTION - VALUE "FileVersion", FILE_VERSION_RESOURCE_STR - VALUE "InternalName", PRODUCT_INTERNAL_NAME - VALUE "LegalCopyright", PRODUCT_COMPANY_COPYRIGHT - VALUE "OriginalFilename", PRODUCT_ORIGINAL_FILENAME - VALUE "ProductName", PRODUCT_BUNDLE - VALUE "ProductVersion", PRODUCT_VERSION_RESOURCE_STR - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END +#pragma code_page(65001) // UTF-8 + +#include "VersionInfo.h" + +#if defined(__MINGW64__) || defined(__MINGW32__) + // MinGW-w64, MinGW + #if defined(__has_include) && __has_include() + #include + #else + #include + #include + #endif +#else + // MSVC, Windows SDK + #include +#endif + +IDI_ICON1 ICON PRODUCT_ICON + +VS_VERSION_INFO VERSIONINFO + FILEVERSION FILE_VERSION_RESOURCE + PRODUCTVERSION PRODUCT_VERSION_RESOURCE + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "Comments", PRODUCT_COMMENTS + VALUE "CompanyName", PRODUCT_COMPANY_NAME + VALUE "FileDescription", PRODUCT_FILE_DESCRIPTION + VALUE "FileVersion", FILE_VERSION_RESOURCE_STR + VALUE "InternalName", PRODUCT_INTERNAL_NAME + VALUE "LegalCopyright", PRODUCT_COMPANY_COPYRIGHT + VALUE "OriginalFilename", PRODUCT_ORIGINAL_FILENAME + VALUE "ProductName", PRODUCT_BUNDLE + VALUE "ProductVersion", PRODUCT_VERSION_RESOURCE_STR + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/cmake/cmake_win32_rc/generate_product_version.cmake b/cmake/cmake_win32_rc/generate_product_version.cmake index 5e992ddc39..bc395d4481 100644 --- a/cmake/cmake_win32_rc/generate_product_version.cmake +++ b/cmake/cmake_win32_rc/generate_product_version.cmake @@ -1,107 +1,107 @@ -include (CMakeParseArguments) - -set (GenerateProductVersionCurrentDir ${CMAKE_CURRENT_LIST_DIR}) - -# generate_product_version() function -# -# This function uses VersionInfo.in template file and VersionResource.rc file -# to generate WIN32 resource with version information and general resource strings. -# -# Usage: -# generate_product_version( -# SomeOutputResourceVariable -# NAME MyGreatProject -# ICON ${PATH_TO_APP_ICON} -# VERSION_MAJOR 2 -# VERSION_MINOR 3 -# VERSION_PATCH ${BUILD_COUNTER} -# VERSION_REVISION ${BUILD_REVISION} -# ) -# where BUILD_COUNTER and BUILD_REVISION could be values from your CI server. -# -# You can use generated resource for your executable targets: -# add_executable(target-name ${target-files} ${SomeOutputResourceVariable}) -# -# You can specify resource strings in arguments: -# NAME - name of executable (no defaults, ex: Microsoft Word) -# BUNDLE - bundle (${NAME} is default, ex: Microsoft Office) -# ICON - path to application icon (${CMAKE_SOURCE_DIR}/product.ico by default) -# VERSION_MAJOR - 1 is default -# VERSION_MINOR - 0 is default -# VERSION_PATCH - 0 is default -# VERSION_REVISION - 0 is default -# COMPANY_NAME - your company name (no defaults) -# COMPANY_COPYRIGHT - ${COMPANY_NAME} (C) Copyright ${CURRENT_YEAR} is default -# COMMENTS - ${NAME} v${VERSION_MAJOR}.${VERSION_MINOR} is default -# ORIGINAL_FILENAME - ${NAME} is default -# INTERNAL_NAME - ${NAME} is default -# FILE_DESCRIPTION - ${NAME} is default -function(generate_product_version outfiles) - set (options) - set (oneValueArgs - NAME - BUNDLE - ICON - VERSION_MAJOR - VERSION_MINOR - VERSION_PATCH - VERSION_REVISION - COMPANY_NAME - COMPANY_COPYRIGHT - COMMENTS - ORIGINAL_FILENAME - INTERNAL_NAME - FILE_DESCRIPTION) - set (multiValueArgs) - cmake_parse_arguments(PRODUCT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - - if (NOT PRODUCT_BUNDLE OR "${PRODUCT_BUNDLE}" STREQUAL "") - set(PRODUCT_BUNDLE "${PRODUCT_NAME}") - endif() - if (NOT PRODUCT_ICON OR "${PRODUCT_ICON}" STREQUAL "") - set(PRODUCT_ICON "${CMAKE_SOURCE_DIR}/product.ico") - endif() - - if (NOT PRODUCT_VERSION_MAJOR EQUAL 0 AND (NOT PRODUCT_VERSION_MAJOR OR "${PRODUCT_VERSION_MAJOR}" STREQUAL "")) - set(PRODUCT_VERSION_MAJOR 1) - endif() - if (NOT PRODUCT_VERSION_MINOR EQUAL 0 AND (NOT PRODUCT_VERSION_MINOR OR "${PRODUCT_VERSION_MINOR}" STREQUAL "")) - set(PRODUCT_VERSION_MINOR 0) - endif() - if (NOT PRODUCT_VERSION_PATCH EQUAL 0 AND (NOT PRODUCT_VERSION_PATCH OR "${PRODUCT_VERSION_PATCH}" STREQUAL "")) - set(PRODUCT_VERSION_PATCH 0) - endif() - if (NOT PRODUCT_VERSION_REVISION EQUAL 0 AND (NOT PRODUCT_VERSION_REVISION OR "${PRODUCT_VERSION_REVISION}" STREQUAL "")) - set(PRODUCT_VERSION_REVISION 0) - endif() - - if (NOT PRODUCT_COMPANY_COPYRIGHT OR "${PRODUCT_COMPANY_COPYRIGHT}" STREQUAL "") - string(TIMESTAMP PRODUCT_CURRENT_YEAR "%Y") - set(PRODUCT_COMPANY_COPYRIGHT "${PRODUCT_COMPANY_NAME} (C) Copyright ${PRODUCT_CURRENT_YEAR}") - endif() - if (NOT PRODUCT_COMMENTS OR "${PRODUCT_COMMENTS}" STREQUAL "") - set(PRODUCT_COMMENTS "${PRODUCT_NAME} v${PRODUCT_VERSION_MAJOR}.${PRODUCT_VERSION_MINOR}") - endif() - if (NOT PRODUCT_ORIGINAL_FILENAME OR "${PRODUCT_ORIGINAL_FILENAME}" STREQUAL "") - set(PRODUCT_ORIGINAL_FILENAME "${PRODUCT_NAME}") - endif() - if (NOT PRODUCT_INTERNAL_NAME OR "${PRODUCT_INTERNAL_NAME}" STREQUAL "") - set(PRODUCT_INTERNAL_NAME "${PRODUCT_NAME}") - endif() - if (NOT PRODUCT_FILE_DESCRIPTION OR "${PRODUCT_FILE_DESCRIPTION}" STREQUAL "") - set(PRODUCT_FILE_DESCRIPTION "${PRODUCT_NAME}") - endif() - - set (_VersionInfoFile ${CMAKE_CURRENT_BINARY_DIR}/VersionInfo.h) - set (_VersionResourceFile ${CMAKE_CURRENT_BINARY_DIR}/VersionResource.rc) - configure_file( - ${GenerateProductVersionCurrentDir}/VersionInfo.in - ${_VersionInfoFile} - @ONLY) - configure_file( - ${GenerateProductVersionCurrentDir}/VersionResource.rc - ${_VersionResourceFile} - COPYONLY) - list(APPEND ${outfiles} ${_VersionInfoFile} ${_VersionResourceFile}) - set (${outfiles} ${${outfiles}} PARENT_SCOPE) -endfunction() +include (CMakeParseArguments) + +set (GenerateProductVersionCurrentDir ${CMAKE_CURRENT_LIST_DIR}) + +# generate_product_version() function +# +# This function uses VersionInfo.in template file and VersionResource.rc file +# to generate WIN32 resource with version information and general resource strings. +# +# Usage: +# generate_product_version( +# SomeOutputResourceVariable +# NAME MyGreatProject +# ICON ${PATH_TO_APP_ICON} +# VERSION_MAJOR 2 +# VERSION_MINOR 3 +# VERSION_PATCH ${BUILD_COUNTER} +# VERSION_REVISION ${BUILD_REVISION} +# ) +# where BUILD_COUNTER and BUILD_REVISION could be values from your CI server. +# +# You can use generated resource for your executable targets: +# add_executable(target-name ${target-files} ${SomeOutputResourceVariable}) +# +# You can specify resource strings in arguments: +# NAME - name of executable (no defaults, ex: Microsoft Word) +# BUNDLE - bundle (${NAME} is default, ex: Microsoft Office) +# ICON - path to application icon (${CMAKE_SOURCE_DIR}/product.ico by default) +# VERSION_MAJOR - 1 is default +# VERSION_MINOR - 0 is default +# VERSION_PATCH - 0 is default +# VERSION_REVISION - 0 is default +# COMPANY_NAME - your company name (no defaults) +# COMPANY_COPYRIGHT - ${COMPANY_NAME} (C) Copyright ${CURRENT_YEAR} is default +# COMMENTS - ${NAME} v${VERSION_MAJOR}.${VERSION_MINOR} is default +# ORIGINAL_FILENAME - ${NAME} is default +# INTERNAL_NAME - ${NAME} is default +# FILE_DESCRIPTION - ${NAME} is default +function(generate_product_version outfiles) + set (options) + set (oneValueArgs + NAME + BUNDLE + ICON + VERSION_MAJOR + VERSION_MINOR + VERSION_PATCH + VERSION_REVISION + COMPANY_NAME + COMPANY_COPYRIGHT + COMMENTS + ORIGINAL_FILENAME + INTERNAL_NAME + FILE_DESCRIPTION) + set (multiValueArgs) + cmake_parse_arguments(PRODUCT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if (NOT PRODUCT_BUNDLE OR "${PRODUCT_BUNDLE}" STREQUAL "") + set(PRODUCT_BUNDLE "${PRODUCT_NAME}") + endif() + if (NOT PRODUCT_ICON OR "${PRODUCT_ICON}" STREQUAL "") + set(PRODUCT_ICON "${CMAKE_SOURCE_DIR}/product.ico") + endif() + + if (NOT PRODUCT_VERSION_MAJOR EQUAL 0 AND (NOT PRODUCT_VERSION_MAJOR OR "${PRODUCT_VERSION_MAJOR}" STREQUAL "")) + set(PRODUCT_VERSION_MAJOR 1) + endif() + if (NOT PRODUCT_VERSION_MINOR EQUAL 0 AND (NOT PRODUCT_VERSION_MINOR OR "${PRODUCT_VERSION_MINOR}" STREQUAL "")) + set(PRODUCT_VERSION_MINOR 0) + endif() + if (NOT PRODUCT_VERSION_PATCH EQUAL 0 AND (NOT PRODUCT_VERSION_PATCH OR "${PRODUCT_VERSION_PATCH}" STREQUAL "")) + set(PRODUCT_VERSION_PATCH 0) + endif() + if (NOT PRODUCT_VERSION_REVISION EQUAL 0 AND (NOT PRODUCT_VERSION_REVISION OR "${PRODUCT_VERSION_REVISION}" STREQUAL "")) + set(PRODUCT_VERSION_REVISION 0) + endif() + + if (NOT PRODUCT_COMPANY_COPYRIGHT OR "${PRODUCT_COMPANY_COPYRIGHT}" STREQUAL "") + string(TIMESTAMP PRODUCT_CURRENT_YEAR "%Y") + set(PRODUCT_COMPANY_COPYRIGHT "${PRODUCT_COMPANY_NAME} (C) Copyright ${PRODUCT_CURRENT_YEAR}") + endif() + if (NOT PRODUCT_COMMENTS OR "${PRODUCT_COMMENTS}" STREQUAL "") + set(PRODUCT_COMMENTS "${PRODUCT_NAME} v${PRODUCT_VERSION_MAJOR}.${PRODUCT_VERSION_MINOR}") + endif() + if (NOT PRODUCT_ORIGINAL_FILENAME OR "${PRODUCT_ORIGINAL_FILENAME}" STREQUAL "") + set(PRODUCT_ORIGINAL_FILENAME "${PRODUCT_NAME}") + endif() + if (NOT PRODUCT_INTERNAL_NAME OR "${PRODUCT_INTERNAL_NAME}" STREQUAL "") + set(PRODUCT_INTERNAL_NAME "${PRODUCT_NAME}") + endif() + if (NOT PRODUCT_FILE_DESCRIPTION OR "${PRODUCT_FILE_DESCRIPTION}" STREQUAL "") + set(PRODUCT_FILE_DESCRIPTION "${PRODUCT_NAME}") + endif() + + set (_VersionInfoFile ${CMAKE_CURRENT_BINARY_DIR}/VersionInfo.h) + set (_VersionResourceFile ${CMAKE_CURRENT_BINARY_DIR}/VersionResource.rc) + configure_file( + ${GenerateProductVersionCurrentDir}/VersionInfo.in + ${_VersionInfoFile} + @ONLY) + configure_file( + ${GenerateProductVersionCurrentDir}/VersionResource.rc + ${_VersionResourceFile} + COPYONLY) + list(APPEND ${outfiles} ${_VersionInfoFile} ${_VersionResourceFile}) + set (${outfiles} ${${outfiles}} PARENT_SCOPE) +endfunction() diff --git a/cmake/cmake_win32_rc/language_utf8.patch b/cmake/cmake_win32_rc/language_utf8.patch index 9980286cdc..6c7bd237bb 100644 --- a/cmake/cmake_win32_rc/language_utf8.patch +++ b/cmake/cmake_win32_rc/language_utf8.patch @@ -3,34 +3,34 @@ index d2b0772..5493922 100644 --- a/VersionResource.rc +++ b/VersionResource.rc @@ -1,3 +1,5 @@ -+#pragma code_page(65001) // UTF-8 -+ - #include "VersionInfo.h" - - #if defined(__MINGW64__) || defined(__MINGW32__) ++#pragma code_page(65001) // UTF-8 ++ + #include "VersionInfo.h" + + #if defined(__MINGW64__) || defined(__MINGW32__) @@ -15,8 +17,6 @@ - - IDI_ICON1 ICON PRODUCT_ICON - --LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT -- - VS_VERSION_INFO VERSIONINFO - FILEVERSION FILE_VERSION_RESOURCE - PRODUCTVERSION PRODUCT_VERSION_RESOURCE + + IDI_ICON1 ICON PRODUCT_ICON + +-LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT +- + VS_VERSION_INFO VERSIONINFO + FILEVERSION FILE_VERSION_RESOURCE + PRODUCTVERSION PRODUCT_VERSION_RESOURCE @@ -32,7 +32,7 @@ VS_VERSION_INFO VERSIONINFO - BEGIN - BLOCK "StringFileInfo" - BEGIN -- BLOCK "000904b0" -+ BLOCK "040904B0" - BEGIN - VALUE "Comments", PRODUCT_COMMENTS - VALUE "CompanyName", PRODUCT_COMPANY_NAME + BEGIN + BLOCK "StringFileInfo" + BEGIN +- BLOCK "000904b0" ++ BLOCK "040904B0" + BEGIN + VALUE "Comments", PRODUCT_COMMENTS + VALUE "CompanyName", PRODUCT_COMPANY_NAME @@ -47,6 +47,6 @@ BEGIN - END - BLOCK "VarFileInfo" - BEGIN -- VALUE "Translation", 0x9, 1200 -+ VALUE "Translation", 0x409, 1200 - END - END + END + BLOCK "VarFileInfo" + BEGIN +- VALUE "Translation", 0x9, 1200 ++ VALUE "Translation", 0x409, 1200 + END + END diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index 3ff12100cb..d0380fde91 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -1,67 +1,67 @@ -#ifndef ADM_CONFIG_H -#define ADM_CONFIG_H - -#include "ADM_coreConfig.h" - -#define ADM_BUILD_CLI 1 -#define ADM_BUILD_GTK 2 -#define ADM_BUILD_QT4 3 - -/* Jog Shuttle */ -#cmakedefine USE_JOG - -#define PACKAGE "avidemux" -#define ADMLOCALE "${ADM_LOCALE}" - - -#if ${CONFIG_HEADER_TYPE} == ADM_BUILD_CLI || ${CONFIG_HEADER_TYPE} == ADM_BUILD_GTK -/* Define if the GNU gettext() function is already present or preinstalled. */ -#cmakedefine HAVE_GETTEXT -#endif - -// GTK+ uses X11 framework -#cmakedefine HAVE_GTK_X11 - -/* stricter prototyping */ -#cmakedefine ICONV_NEED_CONST - -/* FFmpeg */ -#define USE_FFMPEG - -/* FreeType2 detected */ -#cmakedefine USE_FREETYPE - -/* libvpx is available */ -#cmakedefine USE_VPX - -/* use libsamplerate */ -#cmakedefine USE_SRC - -#if ${CONFIG_HEADER_TYPE} == ADM_BUILD_GTK || ${CONFIG_HEADER_TYPE} == ADM_BUILD_QT4 -/* SDL detected */ -#cmakedefine USE_SDL -#endif - -#if ${CONFIG_HEADER_TYPE} == ADM_BUILD_GTK || ${CONFIG_HEADER_TYPE} == ADM_BUILD_QT4 -/* XVideo detected */ -#cmakedefine USE_XV -#endif - -/* Version number of package */ -#define VERSION "${VERSION}" - -// FIXME - start -#ifdef HAVE_GETTEXT -# include -# undef _ -#endif - - -/// FIXME - end -#if ${CONFIG_HEADER_TYPE} == ADM_BUILD_QT4 -/* OpenGL detected */ -#cmakedefine USE_OPENGL -#endif - - -#endif +#ifndef ADM_CONFIG_H +#define ADM_CONFIG_H + +#include "ADM_coreConfig.h" + +#define ADM_BUILD_CLI 1 +#define ADM_BUILD_GTK 2 +#define ADM_BUILD_QT4 3 + +/* Jog Shuttle */ +#cmakedefine USE_JOG + +#define PACKAGE "avidemux" +#define ADMLOCALE "${ADM_LOCALE}" + + +#if ${CONFIG_HEADER_TYPE} == ADM_BUILD_CLI || ${CONFIG_HEADER_TYPE} == ADM_BUILD_GTK +/* Define if the GNU gettext() function is already present or preinstalled. */ +#cmakedefine HAVE_GETTEXT +#endif + +// GTK+ uses X11 framework +#cmakedefine HAVE_GTK_X11 + +/* stricter prototyping */ +#cmakedefine ICONV_NEED_CONST + +/* FFmpeg */ +#define USE_FFMPEG + +/* FreeType2 detected */ +#cmakedefine USE_FREETYPE + +/* libvpx is available */ +#cmakedefine USE_VPX + +/* use libsamplerate */ +#cmakedefine USE_SRC + +#if ${CONFIG_HEADER_TYPE} == ADM_BUILD_GTK || ${CONFIG_HEADER_TYPE} == ADM_BUILD_QT4 +/* SDL detected */ +#cmakedefine USE_SDL +#endif + +#if ${CONFIG_HEADER_TYPE} == ADM_BUILD_GTK || ${CONFIG_HEADER_TYPE} == ADM_BUILD_QT4 +/* XVideo detected */ +#cmakedefine USE_XV +#endif + +/* Version number of package */ +#define VERSION "${VERSION}" + +// FIXME - start +#ifdef HAVE_GETTEXT +# include +# undef _ +#endif + + +/// FIXME - end +#if ${CONFIG_HEADER_TYPE} == ADM_BUILD_QT4 +/* OpenGL detected */ +#cmakedefine USE_OPENGL +#endif + + +#endif diff --git a/cmake/ffmpeg_configure.sh.cmake b/cmake/ffmpeg_configure.sh.cmake index 2c5b6f3c65..a90ffc2cd9 100644 --- a/cmake/ffmpeg_configure.sh.cmake +++ b/cmake/ffmpeg_configure.sh.cmake @@ -1,2 +1,2 @@ -export PATH=${FF_ENV_PATH}:$PATH +export PATH=${FF_ENV_PATH}:$PATH ${FFMPEG_SOURCE_DIR}/configure ${FFMPEG_FLAGS} \ No newline at end of file diff --git a/cmake/ffmpeg_make.sh.cmake b/cmake/ffmpeg_make.sh.cmake index d6dde2100c..0e3f19f4d3 100644 --- a/cmake/ffmpeg_make.sh.cmake +++ b/cmake/ffmpeg_make.sh.cmake @@ -1,2 +1,2 @@ -export PATH=${FF_ENV_PATH}:$PATH -"${ffmpeg_gnumake_executable}" V=1 +export PATH=${FF_ENV_PATH}:$PATH +"${ffmpeg_gnumake_executable}" V=1 diff --git a/foreignBuilds/mswin/Set Common Environment Variables.bat b/foreignBuilds/mswin/Set Common Environment Variables.bat index e7849e8b5f..99bc3e5df5 100644 --- a/foreignBuilds/mswin/Set Common Environment Variables.bat +++ b/foreignBuilds/mswin/Set Common Environment Variables.bat @@ -1,80 +1,80 @@ -set ProgramFiles32=%ProgramFiles% -if "%PROCESSOR_ARCHITECTURE%" == "AMD64" for /D %%d in ("%ProgramFiles(x86)%") do set ProgramFiles32=%%~fsd -set nsisDir=%ProgramFiles32%\NSIS - -set devDir=%~d0/Dev -set msysDir=%~d0/Dev/MSYS - -if "%BuildBits%" == "32" goto :setVars -if "%BuildBits%" == "64" goto :setVars - -echo Error - BuildBits variable not set -goto error - -:setVars -set mingwDir=%devDir%/mingw -set usrLocalDir=%msysDir%/local%BuildBits% -set qtDir=%devDir%/Qt%BuildBits% -set CMAKE_INCLUDE_PATH=%usrLocalDir%/include;%mingwDir%/i686-w64-mingw32/include;%mingwDir%/include -set CMAKE_LIBRARY_PATH=%usrLocalDir%/lib -set PKG_CONFIG_PATH=%usrLocalDir%\lib\pkgconfig -set SDLDIR=%usrLocalDir% -set CFLAGS=%CFLAGS% -I%CMAKE_INCLUDE_PATH:;= -I% -L%CMAKE_LIBRARY_PATH:;= -L% -set CXXFLAGS=%CXXFLAGS% -I%CMAKE_INCLUDE_PATH:;= -I% -L%CMAKE_LIBRARY_PATH:;= -L% -set LDFLAGS=%LDFLAGS% -shared-libgcc -L%CMAKE_LIBRARY_PATH:;= -L% - -if "%Debug%" EQU "1" ( - set admBuildDir=%devDir%\avidemux_2.6_build%BuildBits%-dbg - set admSdkBuildDir=%devDir%\avidemux_2.6_build%BuildBits%-dbg_sdk - set qtDir=%qtDir%-dbg -) else ( - set admBuildDir=%devDir%\avidemux_2.6_build%BuildBits% - set admSdkBuildDir=%devDir%\avidemux_2.6_build%BuildBits%_sdk -) - -set CFLAGS=%CFLAGS% -m%BuildBits% -set CXXFLAGS=%CXXFLAGS% -m%BuildBits% -set LDFLAGS=%LDFLAGS% -m%BuildBits% - -if exist "%qtDir%" ( - for /f %%d in ('dir /b /ad /on "%qtDir%"') do set qtVer=%%d -) else ( - echo Qt 4 could not be found at "%qtDir%". Please download from http://www.trolltech.com - goto error -) - -set qtDir=%qtDir%\%qtVer% - -if exist "%devDir%\CMake 2.8\bin" ( - set cmakeDir=%devDir%\CMake 2.8\bin - goto foundCMake -) - -if exist "%ProgramFiles32%\CMake 2.8\bin" ( - set cmakeDir=%ProgramFiles32%\CMake 2.8\bin -) else ( - echo CMake could not be found. Please download from http://www.cmake.org - goto error -) - -:foundCMake -if not exist "%mingwDir%" ( - echo MinGW could not be found at "%mingwDir%". Please download from http://www.mingw.org - goto error -) - -if not exist "%nsisDir%" ( - echo NSIS could not be found at "%nsisDir%". Please download from http://nsis.sourceforge.net - goto error -) - -set PATH=%cmakeDir%;%mingwDir%\bin;%usrLocalDir%\bin;%msysDir%\local-shared\bin;%qtDir%\bin;%devDir%\strawberry\perl\bin;%PATH% - -if "%BuildBits%" == "64" set PATH=%mingwDir%\i686-w64-mingw32\lib64;%PATH% - -goto end - -:error -exit /b 1 - +set ProgramFiles32=%ProgramFiles% +if "%PROCESSOR_ARCHITECTURE%" == "AMD64" for /D %%d in ("%ProgramFiles(x86)%") do set ProgramFiles32=%%~fsd +set nsisDir=%ProgramFiles32%\NSIS + +set devDir=%~d0/Dev +set msysDir=%~d0/Dev/MSYS + +if "%BuildBits%" == "32" goto :setVars +if "%BuildBits%" == "64" goto :setVars + +echo Error - BuildBits variable not set +goto error + +:setVars +set mingwDir=%devDir%/mingw +set usrLocalDir=%msysDir%/local%BuildBits% +set qtDir=%devDir%/Qt%BuildBits% +set CMAKE_INCLUDE_PATH=%usrLocalDir%/include;%mingwDir%/i686-w64-mingw32/include;%mingwDir%/include +set CMAKE_LIBRARY_PATH=%usrLocalDir%/lib +set PKG_CONFIG_PATH=%usrLocalDir%\lib\pkgconfig +set SDLDIR=%usrLocalDir% +set CFLAGS=%CFLAGS% -I%CMAKE_INCLUDE_PATH:;= -I% -L%CMAKE_LIBRARY_PATH:;= -L% +set CXXFLAGS=%CXXFLAGS% -I%CMAKE_INCLUDE_PATH:;= -I% -L%CMAKE_LIBRARY_PATH:;= -L% +set LDFLAGS=%LDFLAGS% -shared-libgcc -L%CMAKE_LIBRARY_PATH:;= -L% + +if "%Debug%" EQU "1" ( + set admBuildDir=%devDir%\avidemux_2.6_build%BuildBits%-dbg + set admSdkBuildDir=%devDir%\avidemux_2.6_build%BuildBits%-dbg_sdk + set qtDir=%qtDir%-dbg +) else ( + set admBuildDir=%devDir%\avidemux_2.6_build%BuildBits% + set admSdkBuildDir=%devDir%\avidemux_2.6_build%BuildBits%_sdk +) + +set CFLAGS=%CFLAGS% -m%BuildBits% +set CXXFLAGS=%CXXFLAGS% -m%BuildBits% +set LDFLAGS=%LDFLAGS% -m%BuildBits% + +if exist "%qtDir%" ( + for /f %%d in ('dir /b /ad /on "%qtDir%"') do set qtVer=%%d +) else ( + echo Qt 4 could not be found at "%qtDir%". Please download from http://www.trolltech.com + goto error +) + +set qtDir=%qtDir%\%qtVer% + +if exist "%devDir%\CMake 2.8\bin" ( + set cmakeDir=%devDir%\CMake 2.8\bin + goto foundCMake +) + +if exist "%ProgramFiles32%\CMake 2.8\bin" ( + set cmakeDir=%ProgramFiles32%\CMake 2.8\bin +) else ( + echo CMake could not be found. Please download from http://www.cmake.org + goto error +) + +:foundCMake +if not exist "%mingwDir%" ( + echo MinGW could not be found at "%mingwDir%". Please download from http://www.mingw.org + goto error +) + +if not exist "%nsisDir%" ( + echo NSIS could not be found at "%nsisDir%". Please download from http://nsis.sourceforge.net + goto error +) + +set PATH=%cmakeDir%;%mingwDir%\bin;%usrLocalDir%\bin;%msysDir%\local-shared\bin;%qtDir%\bin;%devDir%\strawberry\perl\bin;%PATH% + +if "%BuildBits%" == "64" set PATH=%mingwDir%\i686-w64-mingw32\lib64;%PATH% + +goto end + +:error +exit /b 1 + :end \ No newline at end of file diff --git a/foreignBuilds/mswin/aften/Perform Build.bat b/foreignBuilds/mswin/aften/Perform Build.bat index 4a6b128343..977f392c8f 100644 --- a/foreignBuilds/mswin/aften/Perform Build.bat +++ b/foreignBuilds/mswin/aften/Perform Build.bat @@ -1,59 +1,59 @@ -@echo off - -echo MSVC build for Aften -echo ==================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 ( - set BuildBits=32 - set VcvarFlags=x86 ) -if errorlevel 2 ( - set BuildBits=64 - set VcvarFlags=x86_amd64 ) -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set curDir=%CD% -set PATH=%PATH%;%msysdir%\bin;%devDir%\Git\bin -set CFLAGS= -set CXXFLAGS= -set LDFLAGS= - -call "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" %VcvarFlags% -echo. - -set sourceFolder=%devDir%/aften-%BuildBits% -rm -r -f %sourceFolder% -if errorlevel 1 goto end - -echo Downloading from git -call git clone git://aften.git.sourceforge.net/gitroot/aften/aften %sourceFolder% -if errorlevel 1 goto end - -cd "%sourceFolder%" -call git checkout 89aee3d496bb2a89f046025402626ee12a12969f -if errorlevel 1 goto end - -mkdir build%BuildBits% -if errorlevel 1 goto end - -cd build%BuildBits% -cmake -G"NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%usrLocalDir% -DSHARED=ON -DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /D NDEBUG" .. -if errorlevel 1 goto end - -nmake install -if errorlevel 1 goto end - -del "%usrLocalDir%\lib\aften.lib" -copy "%usrLocalDir%\bin\aften.dll" "%admBuildDir%" - -:end +@echo off + +echo MSVC build for Aften +echo ==================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 ( + set BuildBits=32 + set VcvarFlags=x86 ) +if errorlevel 2 ( + set BuildBits=64 + set VcvarFlags=x86_amd64 ) +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set curDir=%CD% +set PATH=%PATH%;%msysdir%\bin;%devDir%\Git\bin +set CFLAGS= +set CXXFLAGS= +set LDFLAGS= + +call "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" %VcvarFlags% +echo. + +set sourceFolder=%devDir%/aften-%BuildBits% +rm -r -f %sourceFolder% +if errorlevel 1 goto end + +echo Downloading from git +call git clone git://aften.git.sourceforge.net/gitroot/aften/aften %sourceFolder% +if errorlevel 1 goto end + +cd "%sourceFolder%" +call git checkout 89aee3d496bb2a89f046025402626ee12a12969f +if errorlevel 1 goto end + +mkdir build%BuildBits% +if errorlevel 1 goto end + +cd build%BuildBits% +cmake -G"NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%usrLocalDir% -DSHARED=ON -DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /D NDEBUG" .. +if errorlevel 1 goto end + +nmake install +if errorlevel 1 goto end + +del "%usrLocalDir%\lib\aften.lib" +copy "%usrLocalDir%\bin\aften.dll" "%admBuildDir%" + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/avidemux/1. Build.bat b/foreignBuilds/mswin/avidemux/1. Build.bat index 183497ac56..da3a3cc9b5 100644 --- a/foreignBuilds/mswin/avidemux/1. Build.bat +++ b/foreignBuilds/mswin/avidemux/1. Build.bat @@ -1,55 +1,55 @@ -@echo off - -set BuildGenerator=MinGW Makefiles - -:start -echo MinGW build for Avidemux -echo ======================== -echo 1. 32-bit build -echo 2. 64-bit build -echo 3. Debug build -echo X. Exit -echo. - -choice /c 123x - -if errorlevel 4 goto end -if errorlevel 3 ( - set Debug=1 - set DebugFlags=-DCMAKE_BUILD_TYPE=Debug - echo. - echo -- Debug mode set -- - echo. - goto :start ) -if errorlevel 2 ( - set BuildBits=64 - goto :begin ) -if errorlevel 1 ( - set BuildBits=32 - goto :begin ) - -:begin -verify >nul -echo. - -set curDir=%CD% - -call "Set Avidemux Environment Variables" -if errorlevel 1 goto end - -cd "%curDir%" -call "1a. Pre-build" -if errorlevel 1 goto end - -cd "%curDir%" -call "1b. Perform Build" -if errorlevel 1 goto end - -cd "%curDir%" -call "1c. Post-build" -if errorlevel 1 goto end - -echo Finished! - -:end +@echo off + +set BuildGenerator=MinGW Makefiles + +:start +echo MinGW build for Avidemux +echo ======================== +echo 1. 32-bit build +echo 2. 64-bit build +echo 3. Debug build +echo X. Exit +echo. + +choice /c 123x + +if errorlevel 4 goto end +if errorlevel 3 ( + set Debug=1 + set DebugFlags=-DCMAKE_BUILD_TYPE=Debug + echo. + echo -- Debug mode set -- + echo. + goto :start ) +if errorlevel 2 ( + set BuildBits=64 + goto :begin ) +if errorlevel 1 ( + set BuildBits=32 + goto :begin ) + +:begin +verify >nul +echo. + +set curDir=%CD% + +call "Set Avidemux Environment Variables" +if errorlevel 1 goto end + +cd "%curDir%" +call "1a. Pre-build" +if errorlevel 1 goto end + +cd "%curDir%" +call "1b. Perform Build" +if errorlevel 1 goto end + +cd "%curDir%" +call "1c. Post-build" +if errorlevel 1 goto end + +echo Finished! + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/avidemux/1a. Pre-build.bat b/foreignBuilds/mswin/avidemux/1a. Pre-build.bat index 0c5281f1be..9579f8d99f 100644 --- a/foreignBuilds/mswin/avidemux/1a. Pre-build.bat +++ b/foreignBuilds/mswin/avidemux/1a. Pre-build.bat @@ -1,31 +1,31 @@ -cd "%sourceDir%" -echo Cleaning build directory (%CD%\%buildFolder%) -rmdir /s /q "%buildFolder%" 2> NUL - -echo Cleaning SDK directory (%sdkBuildDir%) -rmdir /s /q "%sdkBuildDir%" 2> NUL - -if exist "%buildFolder%" goto removalFailure -if exist "%sdkBuildDir%" goto removalFailure - -mkdir "%buildCoreFolder%" -mkdir "%buildCliFolder%" -mkdir "%buildGtkFolder%" -mkdir "%buildQtFolder%" -mkdir "%buildPluginFolder%" -mkdir "%sdkBuildDir%" - -echo. -echo Performing Subversion update -svn up . -echo. - -goto :EOF - -:removalFailure -echo. -echo ERROR - build directories could not be fully deleted. -echo Aborting. - -:error +cd "%sourceDir%" +echo Cleaning build directory (%CD%\%buildFolder%) +rmdir /s /q "%buildFolder%" 2> NUL + +echo Cleaning SDK directory (%sdkBuildDir%) +rmdir /s /q "%sdkBuildDir%" 2> NUL + +if exist "%buildFolder%" goto removalFailure +if exist "%sdkBuildDir%" goto removalFailure + +mkdir "%buildCoreFolder%" +mkdir "%buildCliFolder%" +mkdir "%buildGtkFolder%" +mkdir "%buildQtFolder%" +mkdir "%buildPluginFolder%" +mkdir "%sdkBuildDir%" + +echo. +echo Performing Subversion update +svn up . +echo. + +goto :EOF + +:removalFailure +echo. +echo ERROR - build directories could not be fully deleted. +echo Aborting. + +:error exit /b 1 \ No newline at end of file diff --git a/foreignBuilds/mswin/avidemux/1b. Perform Build.bat b/foreignBuilds/mswin/avidemux/1b. Perform Build.bat index 07769dff84..14b9846a59 100644 --- a/foreignBuilds/mswin/avidemux/1b. Perform Build.bat +++ b/foreignBuilds/mswin/avidemux/1b. Perform Build.bat @@ -1,80 +1,80 @@ -set INCLUDE_MSYS_PATH=false -set BuildGenerator=CodeBlocks - MinGW Makefiles - -if "%BuildGenerator%" == "CodeBlocks - MinGW Makefiles" copy "%curDir%\Tools\avidemux.workspace" "%SourceDir%\%buildFolder%" - -rem ## Core ## -if "%Debug%" EQU "1" ( - set LeakFlags=-DFIND_LEAKS=ON ) - -cd "%sourceDir%\%buildCoreFolder%" -cmake -G"%BuildGenerator%" -DCMAKE_INSTALL_PREFIX="%buildDir%" -DBASH_DIR="%msysDir%\bin" -DGNUMAKE_DIR="%msysDir%\bin" -DFF_ENV_PATH="/usr/bin" %DebugFlags% %LeakFlags% ../../avidemux_core - -if errorlevel 1 goto error -if "%BuildGenerator%" == "CodeBlocks - MinGW Makefiles" copy "%curDir%\Tools\avidemux.layout" admCore.layout -pause - -rmdir /s /q "%buildDir%\help" 2> NUL -mingw32-make install -if errorlevel 1 goto error - -rem ## Qt4 ## -cd "%sourceDir%\%buildQtFolder%" -cmake -G"%BuildGenerator%" -DCMAKE_INSTALL_PREFIX="%buildDir%" %DebugFlags% ../../avidemux/qt4 - -if errorlevel 1 goto error -if "%BuildGenerator%" == "CodeBlocks - MinGW Makefiles" ( - copy "%curDir%\Tools\avidemux.layout" Avidemux_qt4.layout - patch -p0 -i "%curDir%\Tools\Avidemux_qt4.cbp.patch" ) -pause - -rem ## CLI ## -cd "%sourceDir%\%buildCliFolder%" -cmake -G"%BuildGenerator%" -DCMAKE_INSTALL_PREFIX="%buildDir%" %DebugFlags% ../../avidemux/cli - -if errorlevel 1 goto error -if "%BuildGenerator%" == "CodeBlocks - MinGW Makefiles" copy "%curDir%\Tools\avidemux.layout" Avidemux_cli.layout -pause - -rem ## GTK ## -rem cd "%sourceDir%\%buildGtkFolder%" -rem cmake -G"%BuildGenerator%" -DCMAKE_INSTALL_PREFIX="%buildDir%" %DebugFlags% ../../avidemux/gtk - -rem if errorlevel 1 goto error -rem if "%BuildGenerator%" == "CodeBlocks - MinGW Makefiles" copy "%curDir%\Tools\avidemux.layout" Avidemux_gtk.layout -rem pause - -rem ## Qt4 ## -cd "%sourceDir%\%buildQtFolder%" -mingw32-make install -if errorlevel 1 goto error - -rem ## CLI ## -cd "%sourceDir%\%buildCliFolder%" -mingw32-make install -if errorlevel 1 goto error - -rem ## GTK ## -rem cd "%sourceDir%\%buildGtkFolder%" -rem mingw32-make install -rem if errorlevel 1 goto error - -rem ## Plugins ## -set msysSourceDir=%sourceDir:\=/% -cd "%sourceDir%\%buildPluginFolder%" -cmake -G"%BuildGenerator%" -DCMAKE_INSTALL_PREFIX="%buildDir%" -DAVIDEMUX_SOURCE_DIR="%msysSourceDir%" -DPLUGIN_UI=ALL -DUSE_SYSTEM_SPIDERMONKEY=ON -DCMAKE_INCLUDE_PATH="%SpiderMonkeySourceDir%" -DCMAKE_LIBRARY_PATH="%SpiderMonkeyLibDir%" %DebugFlags% ../../avidemux_plugins - -if errorlevel 1 goto error -if "%BuildGenerator%" == "CodeBlocks - MinGW Makefiles" copy "%curDir%\Tools\avidemux.layout" "%sourceDir%\%buildPluginFolder%\AdmPlugins.layout" -pause - -rem ## Plugins ## -cd "%sourceDir%\%buildPluginFolder%" -rmdir /s /q "%buildDir%\plugins" 2> NUL -mingw32-make install -if errorlevel 1 goto error - -goto :EOF - -:error +set INCLUDE_MSYS_PATH=false +set BuildGenerator=CodeBlocks - MinGW Makefiles + +if "%BuildGenerator%" == "CodeBlocks - MinGW Makefiles" copy "%curDir%\Tools\avidemux.workspace" "%SourceDir%\%buildFolder%" + +rem ## Core ## +if "%Debug%" EQU "1" ( + set LeakFlags=-DFIND_LEAKS=ON ) + +cd "%sourceDir%\%buildCoreFolder%" +cmake -G"%BuildGenerator%" -DCMAKE_INSTALL_PREFIX="%buildDir%" -DBASH_DIR="%msysDir%\bin" -DGNUMAKE_DIR="%msysDir%\bin" -DFF_ENV_PATH="/usr/bin" %DebugFlags% %LeakFlags% ../../avidemux_core + +if errorlevel 1 goto error +if "%BuildGenerator%" == "CodeBlocks - MinGW Makefiles" copy "%curDir%\Tools\avidemux.layout" admCore.layout +pause + +rmdir /s /q "%buildDir%\help" 2> NUL +mingw32-make install +if errorlevel 1 goto error + +rem ## Qt4 ## +cd "%sourceDir%\%buildQtFolder%" +cmake -G"%BuildGenerator%" -DCMAKE_INSTALL_PREFIX="%buildDir%" %DebugFlags% ../../avidemux/qt4 + +if errorlevel 1 goto error +if "%BuildGenerator%" == "CodeBlocks - MinGW Makefiles" ( + copy "%curDir%\Tools\avidemux.layout" Avidemux_qt4.layout + patch -p0 -i "%curDir%\Tools\Avidemux_qt4.cbp.patch" ) +pause + +rem ## CLI ## +cd "%sourceDir%\%buildCliFolder%" +cmake -G"%BuildGenerator%" -DCMAKE_INSTALL_PREFIX="%buildDir%" %DebugFlags% ../../avidemux/cli + +if errorlevel 1 goto error +if "%BuildGenerator%" == "CodeBlocks - MinGW Makefiles" copy "%curDir%\Tools\avidemux.layout" Avidemux_cli.layout +pause + +rem ## GTK ## +rem cd "%sourceDir%\%buildGtkFolder%" +rem cmake -G"%BuildGenerator%" -DCMAKE_INSTALL_PREFIX="%buildDir%" %DebugFlags% ../../avidemux/gtk + +rem if errorlevel 1 goto error +rem if "%BuildGenerator%" == "CodeBlocks - MinGW Makefiles" copy "%curDir%\Tools\avidemux.layout" Avidemux_gtk.layout +rem pause + +rem ## Qt4 ## +cd "%sourceDir%\%buildQtFolder%" +mingw32-make install +if errorlevel 1 goto error + +rem ## CLI ## +cd "%sourceDir%\%buildCliFolder%" +mingw32-make install +if errorlevel 1 goto error + +rem ## GTK ## +rem cd "%sourceDir%\%buildGtkFolder%" +rem mingw32-make install +rem if errorlevel 1 goto error + +rem ## Plugins ## +set msysSourceDir=%sourceDir:\=/% +cd "%sourceDir%\%buildPluginFolder%" +cmake -G"%BuildGenerator%" -DCMAKE_INSTALL_PREFIX="%buildDir%" -DAVIDEMUX_SOURCE_DIR="%msysSourceDir%" -DPLUGIN_UI=ALL -DUSE_SYSTEM_SPIDERMONKEY=ON -DCMAKE_INCLUDE_PATH="%SpiderMonkeySourceDir%" -DCMAKE_LIBRARY_PATH="%SpiderMonkeyLibDir%" %DebugFlags% ../../avidemux_plugins + +if errorlevel 1 goto error +if "%BuildGenerator%" == "CodeBlocks - MinGW Makefiles" copy "%curDir%\Tools\avidemux.layout" "%sourceDir%\%buildPluginFolder%\AdmPlugins.layout" +pause + +rem ## Plugins ## +cd "%sourceDir%\%buildPluginFolder%" +rmdir /s /q "%buildDir%\plugins" 2> NUL +mingw32-make install +if errorlevel 1 goto error + +goto :EOF + +:error exit /b 1 \ No newline at end of file diff --git a/foreignBuilds/mswin/avidemux/1c. Post-build.bat b/foreignBuilds/mswin/avidemux/1c. Post-build.bat index 2b679207ec..beb9b2edb4 100644 --- a/foreignBuilds/mswin/avidemux/1c. Post-build.bat +++ b/foreignBuilds/mswin/avidemux/1c. Post-build.bat @@ -1,99 +1,99 @@ -mkdir "%sdkBuildDir%\lib%BuildBits%" -rem move "%buildDir%\*.a" "%sdkBuildDir%\lib%BuildBits%" -rem del /s "%buildDir%\*.a" - -if "%BuildBits%" == "x" ( - mkdir "%sdkBuildDir%\plugin-examples" - cd "%sdkBuildDir%\plugin-examples" - copy "%curDir%\Tools\Build Plugins.bat" "%sdkBuildDir%\plugin-examples" - - mkdir "audioDecoders" - mkdir "audioDecoders\ac3" - xcopy /s "%sourceDir%\plugins\ADM_audioDecoders\ADM_ad_ac3" "audioDecoders\ac3" - - mkdir "audioDevices" - mkdir "audioDevices\win32" - xcopy /s "%sourceDir%\plugins\ADM_audioDevices\Win32" "audioDevices\win32" - - mkdir "audioEncoders" - mkdir "audioEncoders\pcm" - xcopy /s "%sourceDir%\plugins\ADM_audioEncoders\pcm" "audioEncoders\pcm" - - mkdir "videoEncoders" - mkdir "videoEncoders\mpeg2enc" - mkdir "videoEncoders\mpeg2enc\common" - xcopy /s "%sourceDir%\plugins\ADM_videoEncoder\ADM_vidEnc_mpeg2enc" "videoEncoders\mpeg2enc" - xcopy /s "%sourceDir%\plugins\ADM_videoEncoder\common" "videoEncoders\mpeg2enc\common" - xcopy /s "%usrLocalDir%\lib\libxml2.dll.a" "videoEncoders\mpeg2enc" - xcopy /s "%usrLocalDir%\include\libxml2" "videoEncoders\mpeg2enc" - rmdir /s/q "videoEncoders\mpeg2enc\mpeg2enc\altivec" - - mkdir "videoFilters" - mkdir "videoFilters\fade" - xcopy /s "%sourceDir%\plugins\ADM_videoFilters\Fade" "videoFilters\fade" - - del /s CMakeLists.txt - - mkdir "%sdkBuildDir%\include" - mkdir "%sdkBuildDir%\include\ADM_encoder" - mkdir "%sdkBuildDir%\include\libavutil" - cd "%sdkBuildDir%\include" - - copy "%sourceDir%\%buildFolder%\config\ADM_coreConfig.h" - copy "%sourceDir%\%buildFolder%\config\libavutil\avconfig.h" libavutil - copy "%sourceDir%\avidemux\ADM_audiocodec\ADM_ad_plugin.h" - copy "%sourceDir%\avidemux\ADM_audiocodec\ADM_audiocodec.h" - copy "%sourceDir%\avidemux\ADM_audiodevice\ADM_audiodevice.h" - copy "%sourceDir%\avidemux\ADM_audiodevice\ADM_audioDeviceInternal.h" - copy "%sourceDir%\avidemux\ADM_core\include\ADM_assert.h" - copy "%sourceDir%\avidemux\ADM_core\include\ADM_clock.h" - copy "%sourceDir%\avidemux\ADM_core\include\ADM_cpucap.h" - copy "%sourceDir%\avidemux\ADM_core\include\ADM_default.h" - copy "%sourceDir%\avidemux\ADM_core\include\ADM_dynamicLoading.h" - copy "%sourceDir%\avidemux\ADM_core\include\ADM_files.h" - copy "%sourceDir%\avidemux\ADM_core\include\ADM_inttype.h" - copy "%sourceDir%\avidemux\ADM_core\include\ADM_mangle.h" - copy "%sourceDir%\avidemux\ADM_core\include\ADM_misc.h" - copy "%sourceDir%\avidemux\ADM_coreAudio\include\ADM_audioCodecEnum.h" - copy "%sourceDir%\avidemux\ADM_coreAudio\include\ADM_audiodef.h" - copy "%sourceDir%\avidemux\ADM_coreAudio\include\ADM_audioFilter.h" - copy "%sourceDir%\avidemux\ADM_coreAudio\include\ADM_coreAudio.h" - copy "%sourceDir%\avidemux\ADM_coreAudio\include\audioencoder.h" - copy "%sourceDir%\avidemux\ADM_coreAudio\include\audioencoderInternal.h" - copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_confCouple.h" - copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_image.h" - copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_rgb.h" - copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_videoFilter.h" - copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_videoFilterCache.h" - copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_videoFilterDynamic.h" - copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_videoFilter_iface.h" - copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_videoFilter_internal.h" - copy "%sourceDir%\avidemux\ADM_coreUI\include\DIA_coreToolkit.h" - copy "%sourceDir%\avidemux\ADM_coreUI\include\DIA_factory.h" - copy "%sourceDir%\avidemux\ADM_coreUI\include\DIA_uiTypes.h" - copy "%sourceDir%\avidemux\ADM_encoder\ADM_vidEncode.hxx" ADM_encoder - copy "%sourceDir%\avidemux\ADM_libraries\ffmpeg\libavutil\pixfmt.h" libavutil - copy "%sourceDir%\avidemux\ADM_plugin\ADM_vidEnc_plugin.h" - copy "%sourceDir%\avidemux\ADM_plugin\ADM_plugin_translate.h" - - cd "%sourceDir%\po" - svn revert -R . - sh qt_update_pro.sh - echo ./avidemux_blank.ts >> avidemux.pro - lupdate avidemux.pro - - mkdir "%sdkBuildDir%\i18n" - mkdir "%sdkBuildDir%\i18n\qt4" - mkdir "%sdkBuildDir%\i18n\gtk" - - copy *.ts "%sdkBuildDir%\i18n\qt4" - copy "%curDir%\Tools\Build Qt Translations.bat" "%sdkBuildDir%\i18n\qt4\Build Translations.bat" - - del avidemux_blank.ts - - sh update_pot.bash - copy avidemux.pot "%sdkBuildDir%\i18n\gtk" - for %%A in (*.po) do msgmerge %%A avidemux.pot -o "%sdkBuildDir%\i18n\gtk\%%A" - - svn revert -R . +mkdir "%sdkBuildDir%\lib%BuildBits%" +rem move "%buildDir%\*.a" "%sdkBuildDir%\lib%BuildBits%" +rem del /s "%buildDir%\*.a" + +if "%BuildBits%" == "x" ( + mkdir "%sdkBuildDir%\plugin-examples" + cd "%sdkBuildDir%\plugin-examples" + copy "%curDir%\Tools\Build Plugins.bat" "%sdkBuildDir%\plugin-examples" + + mkdir "audioDecoders" + mkdir "audioDecoders\ac3" + xcopy /s "%sourceDir%\plugins\ADM_audioDecoders\ADM_ad_ac3" "audioDecoders\ac3" + + mkdir "audioDevices" + mkdir "audioDevices\win32" + xcopy /s "%sourceDir%\plugins\ADM_audioDevices\Win32" "audioDevices\win32" + + mkdir "audioEncoders" + mkdir "audioEncoders\pcm" + xcopy /s "%sourceDir%\plugins\ADM_audioEncoders\pcm" "audioEncoders\pcm" + + mkdir "videoEncoders" + mkdir "videoEncoders\mpeg2enc" + mkdir "videoEncoders\mpeg2enc\common" + xcopy /s "%sourceDir%\plugins\ADM_videoEncoder\ADM_vidEnc_mpeg2enc" "videoEncoders\mpeg2enc" + xcopy /s "%sourceDir%\plugins\ADM_videoEncoder\common" "videoEncoders\mpeg2enc\common" + xcopy /s "%usrLocalDir%\lib\libxml2.dll.a" "videoEncoders\mpeg2enc" + xcopy /s "%usrLocalDir%\include\libxml2" "videoEncoders\mpeg2enc" + rmdir /s/q "videoEncoders\mpeg2enc\mpeg2enc\altivec" + + mkdir "videoFilters" + mkdir "videoFilters\fade" + xcopy /s "%sourceDir%\plugins\ADM_videoFilters\Fade" "videoFilters\fade" + + del /s CMakeLists.txt + + mkdir "%sdkBuildDir%\include" + mkdir "%sdkBuildDir%\include\ADM_encoder" + mkdir "%sdkBuildDir%\include\libavutil" + cd "%sdkBuildDir%\include" + + copy "%sourceDir%\%buildFolder%\config\ADM_coreConfig.h" + copy "%sourceDir%\%buildFolder%\config\libavutil\avconfig.h" libavutil + copy "%sourceDir%\avidemux\ADM_audiocodec\ADM_ad_plugin.h" + copy "%sourceDir%\avidemux\ADM_audiocodec\ADM_audiocodec.h" + copy "%sourceDir%\avidemux\ADM_audiodevice\ADM_audiodevice.h" + copy "%sourceDir%\avidemux\ADM_audiodevice\ADM_audioDeviceInternal.h" + copy "%sourceDir%\avidemux\ADM_core\include\ADM_assert.h" + copy "%sourceDir%\avidemux\ADM_core\include\ADM_clock.h" + copy "%sourceDir%\avidemux\ADM_core\include\ADM_cpucap.h" + copy "%sourceDir%\avidemux\ADM_core\include\ADM_default.h" + copy "%sourceDir%\avidemux\ADM_core\include\ADM_dynamicLoading.h" + copy "%sourceDir%\avidemux\ADM_core\include\ADM_files.h" + copy "%sourceDir%\avidemux\ADM_core\include\ADM_inttype.h" + copy "%sourceDir%\avidemux\ADM_core\include\ADM_mangle.h" + copy "%sourceDir%\avidemux\ADM_core\include\ADM_misc.h" + copy "%sourceDir%\avidemux\ADM_coreAudio\include\ADM_audioCodecEnum.h" + copy "%sourceDir%\avidemux\ADM_coreAudio\include\ADM_audiodef.h" + copy "%sourceDir%\avidemux\ADM_coreAudio\include\ADM_audioFilter.h" + copy "%sourceDir%\avidemux\ADM_coreAudio\include\ADM_coreAudio.h" + copy "%sourceDir%\avidemux\ADM_coreAudio\include\audioencoder.h" + copy "%sourceDir%\avidemux\ADM_coreAudio\include\audioencoderInternal.h" + copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_confCouple.h" + copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_image.h" + copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_rgb.h" + copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_videoFilter.h" + copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_videoFilterCache.h" + copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_videoFilterDynamic.h" + copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_videoFilter_iface.h" + copy "%sourceDir%\avidemux\ADM_coreImage\include\ADM_videoFilter_internal.h" + copy "%sourceDir%\avidemux\ADM_coreUI\include\DIA_coreToolkit.h" + copy "%sourceDir%\avidemux\ADM_coreUI\include\DIA_factory.h" + copy "%sourceDir%\avidemux\ADM_coreUI\include\DIA_uiTypes.h" + copy "%sourceDir%\avidemux\ADM_encoder\ADM_vidEncode.hxx" ADM_encoder + copy "%sourceDir%\avidemux\ADM_libraries\ffmpeg\libavutil\pixfmt.h" libavutil + copy "%sourceDir%\avidemux\ADM_plugin\ADM_vidEnc_plugin.h" + copy "%sourceDir%\avidemux\ADM_plugin\ADM_plugin_translate.h" + + cd "%sourceDir%\po" + svn revert -R . + sh qt_update_pro.sh + echo ./avidemux_blank.ts >> avidemux.pro + lupdate avidemux.pro + + mkdir "%sdkBuildDir%\i18n" + mkdir "%sdkBuildDir%\i18n\qt4" + mkdir "%sdkBuildDir%\i18n\gtk" + + copy *.ts "%sdkBuildDir%\i18n\qt4" + copy "%curDir%\Tools\Build Qt Translations.bat" "%sdkBuildDir%\i18n\qt4\Build Translations.bat" + + del avidemux_blank.ts + + sh update_pot.bash + copy avidemux.pot "%sdkBuildDir%\i18n\gtk" + for %%A in (*.po) do msgmerge %%A avidemux.pot -o "%sdkBuildDir%\i18n\gtk\%%A" + + svn revert -R . ) \ No newline at end of file diff --git a/foreignBuilds/mswin/avidemux/2. Create Packages.bat b/foreignBuilds/mswin/avidemux/2. Create Packages.bat index dd47fd3f7f..49c7417d9d 100644 --- a/foreignBuilds/mswin/avidemux/2. Create Packages.bat +++ b/foreignBuilds/mswin/avidemux/2. Create Packages.bat @@ -1,47 +1,47 @@ -@echo off - -echo Package Avidemux -echo ================ -echo 1. 32-bit package -echo 2. 64-bit package -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto end - -verify >nul -echo. - -set curDir=%CD% - -call "Set Avidemux Environment Variables" -if errorlevel 1 goto error - -cd "%curDir%" -call "2a. Update Notes.bat" -if errorlevel 1 goto error - -cd "%curDir%\Tools" -call "Get Revision Number" -cd .. - -set packageDir=%CD%\%revisionNo% [%BuildBits%-bit] -mkdir "%packageDir%" - -cd "%curDir%" -rem call "2b. Package SDK.bat" -if errorlevel 1 goto error - -cd "%curDir%" -call "2c. Package Build.bat" -if errorlevel 1 goto error - -goto end - -:error -:end +@echo off + +echo Package Avidemux +echo ================ +echo 1. 32-bit package +echo 2. 64-bit package +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto end + +verify >nul +echo. + +set curDir=%CD% + +call "Set Avidemux Environment Variables" +if errorlevel 1 goto error + +cd "%curDir%" +call "2a. Update Notes.bat" +if errorlevel 1 goto error + +cd "%curDir%\Tools" +call "Get Revision Number" +cd .. + +set packageDir=%CD%\%revisionNo% [%BuildBits%-bit] +mkdir "%packageDir%" + +cd "%curDir%" +rem call "2b. Package SDK.bat" +if errorlevel 1 goto error + +cd "%curDir%" +call "2c. Package Build.bat" +if errorlevel 1 goto error + +goto end + +:error +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/avidemux/2a. Update Notes.bat b/foreignBuilds/mswin/avidemux/2a. Update Notes.bat index 88dcbf318e..100b61950d 100644 --- a/foreignBuilds/mswin/avidemux/2a. Update Notes.bat +++ b/foreignBuilds/mswin/avidemux/2a. Update Notes.bat @@ -1,20 +1,20 @@ -set PATH=%msysDir%\bin;%PATH% - -echo -- Generating Change Log.html -- -cd "..\..\..\avidemux\wininstaller" -sh genlog.sh - -echo -- Generating Package Notes.html -- -cd "%curDir%\Tools" -sh gennotes.sh - -echo -- Generating Touch Files.html -- -sh gentouch.sh - -goto end - -:error -exit /b 1 - -:end +set PATH=%msysDir%\bin;%PATH% + +echo -- Generating Change Log.html -- +cd "..\..\..\avidemux\wininstaller" +sh genlog.sh + +echo -- Generating Package Notes.html -- +cd "%curDir%\Tools" +sh gennotes.sh + +echo -- Generating Touch Files.html -- +sh gentouch.sh + +goto end + +:error +exit /b 1 + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/avidemux/2b. Package SDK.bat b/foreignBuilds/mswin/avidemux/2b. Package SDK.bat index d4bf3d729a..bce57c2228 100644 --- a/foreignBuilds/mswin/avidemux/2b. Package SDK.bat +++ b/foreignBuilds/mswin/avidemux/2b. Package SDK.bat @@ -1,19 +1,19 @@ -set zipFile=avidemux_sdk_2.6_r%revisionNo%_win.zip - -if "%BuildBits%" == "32" ( - set sdk32BuildDir=%sdkBuildDir% - set sdk64BuildDir=%sdkBuildDir:build32=build64% -) - -if "%BuildBits%" == "64" ( - set sdk32BuildDir=%sdkBuildDir:build64=build32% - set sdk64BuildDir=%sdkBuildDir% -) - -cd "%sdk32BuildDir%" -zip -r "%packageDir%\%zipFile%" * - -cd "%sdk64BuildDir%" -zip -r "%packageDir%\%zipFile%" * - +set zipFile=avidemux_sdk_2.6_r%revisionNo%_win.zip + +if "%BuildBits%" == "32" ( + set sdk32BuildDir=%sdkBuildDir% + set sdk64BuildDir=%sdkBuildDir:build32=build64% +) + +if "%BuildBits%" == "64" ( + set sdk32BuildDir=%sdkBuildDir:build64=build32% + set sdk64BuildDir=%sdkBuildDir% +) + +cd "%sdk32BuildDir%" +zip -r "%packageDir%\%zipFile%" * + +cd "%sdk64BuildDir%" +zip -r "%packageDir%\%zipFile%" * + advzip -z -4 "%packageDir%\%zipFile%" \ No newline at end of file diff --git a/foreignBuilds/mswin/avidemux/2c. Package Build.bat b/foreignBuilds/mswin/avidemux/2c. Package Build.bat index 1729e6c900..553aeca6ee 100644 --- a/foreignBuilds/mswin/avidemux/2c. Package Build.bat +++ b/foreignBuilds/mswin/avidemux/2c. Package Build.bat @@ -1,35 +1,35 @@ -set baseFile=avidemux_2.6_r%revisionNo%_win%BuildBits% -set zipFile=%baseFile%.zip - -copy "%buildDir%\Change Log.html" "%packageDir%" -move "Tools\Package Notes [%BuildBits%].html" "%packageDir%\Package Notes.html" - -cd %buildDir% -rem if "%BuildBits%" == "32" ( -rem echo -- Generating GTK+ Installer -- -rem "%nsisDir%\makensis" /V2 /NOCD /DINST_GTK /DBUILD_BITS=%BuildBits% /DNSIDIR="%curDir%\..\..\..\avidemux\wininstaller" /DEXEDIR="%packageDir%" "%curDir%\..\..\..\avidemux\wininstaller\avidemux.nsi" -rem ) - -echo -- Generating Qt Installer -- -"%nsisDir%\makensis" /V2 /NOCD /DINST_QT /DBUILD_BITS=%BuildBits% /DNSIDIR="%curDir%\..\..\..\avidemux\wininstaller" /DEXEDIR="%packageDir%" "%curDir%\..\..\..\avidemux\wininstaller\avidemux.nsi" - -mkdir "%packageDir%\temp" -cd "%packageDir%\temp" -"%SevenZipDir%\7z" x "%packageDir%\%baseFile%.exe" -rmdir /s/q $PLUGINSDIR - -mkdir etc\fonts\conf.d -copy "%buildDir%\etc\fonts\conf.d" etc\fonts\conf.d\ -move $_OUTDIR\conf.avail etc\fonts - -move $_OUTDIR\search help\QtScript -move $_OUTDIR\lib plugins\autoScripts - -mkdir plugins\pluginSettings\x264 -move $_OUTDIR\1 plugins\pluginSettings\x264 - -rmdir /s/q $_OUTDIR -zip -r "%packageDir%\%zipFile%" * -cd %curDir% -advzip -z -4 "%packageDir%\%zipFile%" +set baseFile=avidemux_2.6_r%revisionNo%_win%BuildBits% +set zipFile=%baseFile%.zip + +copy "%buildDir%\Change Log.html" "%packageDir%" +move "Tools\Package Notes [%BuildBits%].html" "%packageDir%\Package Notes.html" + +cd %buildDir% +rem if "%BuildBits%" == "32" ( +rem echo -- Generating GTK+ Installer -- +rem "%nsisDir%\makensis" /V2 /NOCD /DINST_GTK /DBUILD_BITS=%BuildBits% /DNSIDIR="%curDir%\..\..\..\avidemux\wininstaller" /DEXEDIR="%packageDir%" "%curDir%\..\..\..\avidemux\wininstaller\avidemux.nsi" +rem ) + +echo -- Generating Qt Installer -- +"%nsisDir%\makensis" /V2 /NOCD /DINST_QT /DBUILD_BITS=%BuildBits% /DNSIDIR="%curDir%\..\..\..\avidemux\wininstaller" /DEXEDIR="%packageDir%" "%curDir%\..\..\..\avidemux\wininstaller\avidemux.nsi" + +mkdir "%packageDir%\temp" +cd "%packageDir%\temp" +"%SevenZipDir%\7z" x "%packageDir%\%baseFile%.exe" +rmdir /s/q $PLUGINSDIR + +mkdir etc\fonts\conf.d +copy "%buildDir%\etc\fonts\conf.d" etc\fonts\conf.d\ +move $_OUTDIR\conf.avail etc\fonts + +move $_OUTDIR\search help\QtScript +move $_OUTDIR\lib plugins\autoScripts + +mkdir plugins\pluginSettings\x264 +move $_OUTDIR\1 plugins\pluginSettings\x264 + +rmdir /s/q $_OUTDIR +zip -r "%packageDir%\%zipFile%" * +cd %curDir% +advzip -z -4 "%packageDir%\%zipFile%" rmdir /s/q "%packageDir%\temp" \ No newline at end of file diff --git a/foreignBuilds/mswin/avidemux/Set Avidemux Environment Variables.bat b/foreignBuilds/mswin/avidemux/Set Avidemux Environment Variables.bat index bd3de25fc8..2b7785a402 100644 --- a/foreignBuilds/mswin/avidemux/Set Avidemux Environment Variables.bat +++ b/foreignBuilds/mswin/avidemux/Set Avidemux Environment Variables.bat @@ -1,68 +1,68 @@ -call "..\Set Common Environment Variables" - -if errorlevel 1 goto error - -zip > NUL 2> NUL -if errorlevel 1 ( - echo Info-ZIP could not be found in the PATH. Please download from http://www.info-zip.org - goto error -) - -advzip > NUL 2> NUL -if errorlevel 1 ( - echo AdvanceCOMP could not be found in the PATH. Please download from http://advancemame.sourceforge.net - goto error -) - -svn help > NUL 2> NUL -if errorlevel 1 ( - echo Subversion could not be found in the PATH. Please download from http://subversion.tigris.org/ - goto error -) - -xsltproc --version > NUL 2> NUL -if errorlevel 1 ( - echo xsltproc could not be found in the PATH. Please download from http://www.zlatkovic.com - goto error -) - -if exist "%ProgramFiles%\7-zip" ( - set SevenZipDir=%ProgramFiles%\7-zip -) else ( - echo 7-zip could not be found. Please download from http://www.7-zip.org - goto error -) - -set buildFolder=build%BuildBits% - -if "%Debug%" == "1" set buildFolder=%buildFolder%-dbg - -set buildCoreFolder=%buildFolder%\core -set buildCliFolder=%buildFolder%\cli -set buildGtkFolder=%buildFolder%\gtk -set buildQtFolder=%buildFolder%\qt -set buildPluginFolder=%buildFolder%\plugins - -set buildDir=%admBuildDir% -set sdkBuildDir=%admSdkBuildDir% - -set curDir=%CD% -cd ..\..\.. -set sourceDir=%CD% -cd "%curDir%" - -if not exist "%sourceDir%" ( - echo Source directory could not be found at "%sourceDir%". - goto error -) - -set jsFolder=js-1.7.0-%BuildBits% -set SpiderMonkeySourceDir=%devDir%\%jsFolder%\src -set SpiderMonkeyLibDir=%devDir%\%jsFolder%\src\WINNT6.1_OPT.OBJ - -goto end - -:error -exit /b 1 - +call "..\Set Common Environment Variables" + +if errorlevel 1 goto error + +zip > NUL 2> NUL +if errorlevel 1 ( + echo Info-ZIP could not be found in the PATH. Please download from http://www.info-zip.org + goto error +) + +advzip > NUL 2> NUL +if errorlevel 1 ( + echo AdvanceCOMP could not be found in the PATH. Please download from http://advancemame.sourceforge.net + goto error +) + +svn help > NUL 2> NUL +if errorlevel 1 ( + echo Subversion could not be found in the PATH. Please download from http://subversion.tigris.org/ + goto error +) + +xsltproc --version > NUL 2> NUL +if errorlevel 1 ( + echo xsltproc could not be found in the PATH. Please download from http://www.zlatkovic.com + goto error +) + +if exist "%ProgramFiles%\7-zip" ( + set SevenZipDir=%ProgramFiles%\7-zip +) else ( + echo 7-zip could not be found. Please download from http://www.7-zip.org + goto error +) + +set buildFolder=build%BuildBits% + +if "%Debug%" == "1" set buildFolder=%buildFolder%-dbg + +set buildCoreFolder=%buildFolder%\core +set buildCliFolder=%buildFolder%\cli +set buildGtkFolder=%buildFolder%\gtk +set buildQtFolder=%buildFolder%\qt +set buildPluginFolder=%buildFolder%\plugins + +set buildDir=%admBuildDir% +set sdkBuildDir=%admSdkBuildDir% + +set curDir=%CD% +cd ..\..\.. +set sourceDir=%CD% +cd "%curDir%" + +if not exist "%sourceDir%" ( + echo Source directory could not be found at "%sourceDir%". + goto error +) + +set jsFolder=js-1.7.0-%BuildBits% +set SpiderMonkeySourceDir=%devDir%\%jsFolder%\src +set SpiderMonkeyLibDir=%devDir%\%jsFolder%\src\WINNT6.1_OPT.OBJ + +goto end + +:error +exit /b 1 + :end \ No newline at end of file diff --git a/foreignBuilds/mswin/avidemux/Tools/Build Plugins.bat b/foreignBuilds/mswin/avidemux/Tools/Build Plugins.bat index 4d0881e6de..83b0295a1e 100644 --- a/foreignBuilds/mswin/avidemux/Tools/Build Plugins.bat +++ b/foreignBuilds/mswin/avidemux/Tools/Build Plugins.bat @@ -1,59 +1,59 @@ -@echo off - -if "%1" == "" goto displayUsage -if "%2" == "" goto displayUsage - -set curDir=%CD% -set includeDir="%curDir%\..\include" -set libDir="%curDir%\..\lib%1" -set ar="%2\bin\ar" -set gcc="%2\bin\gcc" -O3 -DNDEBUG -set gxx="%2\bin\g++" -O3 -DNDEBUG -Wl,-enable-auto-import -Wl,-s - -echo ** AC-3 Audio Decoder ** - -cd audioDecoders\ac3\ADM_liba52 -%gcc% -c *.c -I%includeDir% -L%libDir% -lADM_core.dll -%ar% rs libADM_liba52.a *.o -cd .. -%gxx% -shared *.cpp -o libADM_ad_a52.dll -I%includeDir% -LADM_liba52 -lADM_liba52 -L%libDir% -lADM_core.dll -cd %curDir% - -echo. -echo ** Win32 Audio Device ** - -cd audioDevices\win32 -%gxx% -shared *.cpp -o libADM_av_win32.dll -I%includeDir% -L%libDir% -lADM_core.dll -lADM_coreAudio.dll -lwinmm -cd %curDir% - -echo. -echo ** PCM Audio Encoder ** - -cd audioEncoders\pcm -%gxx% -shared *.cpp -o libADM_ae_pcm.dll -I%includeDir% -L%libDir% -lADM_core.dll -lADM_coreAudio.dll -cd %curDir% - -echo. -echo ** mpeg2enc Video Encoder ** - -cd videoEncoders\mpeg2enc\mpeg2enc -%gcc% -c *.c *.cc -I. -I%includeDir% -DHAVE_CONFIG_H -DHAVE_X86CPU -%ar% rs libmpeg2enc.a *.o -cd .. -%gcc% -c *.c -I%includeDir% -%gxx% -shared *.o *.cpp common\pluginOptions\*.cpp common\xvidRateCtl\*.cpp -o libADM_vidEnc_mpeg2enc.dll -I%includeDir% -I. -I.\mpeg2enc -I.\common\pluginOptions -I.\common\xvidRateCtl -DMPEG1_PLUGIN_CONFIG_DIR=\"mpeg2enc/mpeg-1\" -DMPEG2_PLUGIN_CONFIG_DIR=\"mpeg2enc/mpeg-2\" -L. -lxml2.dll -Lmpeg2enc -lmpeg2enc -L%libDir% -lADM_coreUI.dll -lADM_core.dll -cd %curDir% - -echo. -echo ** Fade Video Filter ** - -cd videoFilters\fade -%gxx% -shared *.cpp -o libADM_vf_fade.dll -I%includeDir% -L%libDir% -lADM_coreImage.dll -lADM_core.dll -lADM_coreUI.dll -cd %curDir% - -goto :EOF - -:displayUsage - echo Usage: "Build Plugins.bat" [Bitness] [MinGW directory] - echo e.g. "Build Plugins.bat" 32 C:\MinGW +@echo off + +if "%1" == "" goto displayUsage +if "%2" == "" goto displayUsage + +set curDir=%CD% +set includeDir="%curDir%\..\include" +set libDir="%curDir%\..\lib%1" +set ar="%2\bin\ar" +set gcc="%2\bin\gcc" -O3 -DNDEBUG +set gxx="%2\bin\g++" -O3 -DNDEBUG -Wl,-enable-auto-import -Wl,-s + +echo ** AC-3 Audio Decoder ** + +cd audioDecoders\ac3\ADM_liba52 +%gcc% -c *.c -I%includeDir% -L%libDir% -lADM_core.dll +%ar% rs libADM_liba52.a *.o +cd .. +%gxx% -shared *.cpp -o libADM_ad_a52.dll -I%includeDir% -LADM_liba52 -lADM_liba52 -L%libDir% -lADM_core.dll +cd %curDir% + +echo. +echo ** Win32 Audio Device ** + +cd audioDevices\win32 +%gxx% -shared *.cpp -o libADM_av_win32.dll -I%includeDir% -L%libDir% -lADM_core.dll -lADM_coreAudio.dll -lwinmm +cd %curDir% + +echo. +echo ** PCM Audio Encoder ** + +cd audioEncoders\pcm +%gxx% -shared *.cpp -o libADM_ae_pcm.dll -I%includeDir% -L%libDir% -lADM_core.dll -lADM_coreAudio.dll +cd %curDir% + +echo. +echo ** mpeg2enc Video Encoder ** + +cd videoEncoders\mpeg2enc\mpeg2enc +%gcc% -c *.c *.cc -I. -I%includeDir% -DHAVE_CONFIG_H -DHAVE_X86CPU +%ar% rs libmpeg2enc.a *.o +cd .. +%gcc% -c *.c -I%includeDir% +%gxx% -shared *.o *.cpp common\pluginOptions\*.cpp common\xvidRateCtl\*.cpp -o libADM_vidEnc_mpeg2enc.dll -I%includeDir% -I. -I.\mpeg2enc -I.\common\pluginOptions -I.\common\xvidRateCtl -DMPEG1_PLUGIN_CONFIG_DIR=\"mpeg2enc/mpeg-1\" -DMPEG2_PLUGIN_CONFIG_DIR=\"mpeg2enc/mpeg-2\" -L. -lxml2.dll -Lmpeg2enc -lmpeg2enc -L%libDir% -lADM_coreUI.dll -lADM_core.dll +cd %curDir% + +echo. +echo ** Fade Video Filter ** + +cd videoFilters\fade +%gxx% -shared *.cpp -o libADM_vf_fade.dll -I%includeDir% -L%libDir% -lADM_coreImage.dll -lADM_core.dll -lADM_coreUI.dll +cd %curDir% + +goto :EOF + +:displayUsage + echo Usage: "Build Plugins.bat" [Bitness] [MinGW directory] + echo e.g. "Build Plugins.bat" 32 C:\MinGW goto :EOF \ No newline at end of file diff --git a/foreignBuilds/mswin/avidemux/Tools/Build Qt Translations.bat b/foreignBuilds/mswin/avidemux/Tools/Build Qt Translations.bat index 923a487dcd..3d7ed54ab6 100644 --- a/foreignBuilds/mswin/avidemux/Tools/Build Qt Translations.bat +++ b/foreignBuilds/mswin/avidemux/Tools/Build Qt Translations.bat @@ -1,22 +1,22 @@ -@echo off - -if "%1" == "" ( - echo Usage: "Build Translations.bat" [Qt directory] - echo e.g. "Build Translations.bat" C:\Qt\4.5.3 - goto :EOF -) - -for %%A in (avidemux*.ts) do ( - echo. - echo Building %%~nA - echo. - "%1\bin\lrelease" "%%A" -qm "%%~nA.qm" - del "%%~nA.xml" -) - -for %%A in (qt*.ts) do ( - echo. - echo Building %%~nA - echo. - "%1\bin\lrelease" "%%A" -) +@echo off + +if "%1" == "" ( + echo Usage: "Build Translations.bat" [Qt directory] + echo e.g. "Build Translations.bat" C:\Qt\4.5.3 + goto :EOF +) + +for %%A in (avidemux*.ts) do ( + echo. + echo Building %%~nA + echo. + "%1\bin\lrelease" "%%A" -qm "%%~nA.qm" + del "%%~nA.xml" +) + +for %%A in (qt*.ts) do ( + echo. + echo Building %%~nA + echo. + "%1\bin\lrelease" "%%A" +) diff --git a/foreignBuilds/mswin/avidemux/Tools/Get Revision Number.bat b/foreignBuilds/mswin/avidemux/Tools/Get Revision Number.bat index 2242b4c352..21484c7168 100644 --- a/foreignBuilds/mswin/avidemux/Tools/Get Revision Number.bat +++ b/foreignBuilds/mswin/avidemux/Tools/Get Revision Number.bat @@ -1,10 +1,10 @@ -if not exist "..\..\..\..\avidemux\wininstaller\revision.nsh" goto end - -copy "Revision No template.bat" + "..\..\..\..\avidemux\wininstaller\revision.nsh" temp.bat > NUL - -call temp.bat -del temp.bat - -set revisionNo=%revisionNo:~17,4% - +if not exist "..\..\..\..\avidemux\wininstaller\revision.nsh" goto end + +copy "Revision No template.bat" + "..\..\..\..\avidemux\wininstaller\revision.nsh" temp.bat > NUL + +call temp.bat +del temp.bat + +set revisionNo=%revisionNo:~17,4% + :end \ No newline at end of file diff --git a/foreignBuilds/mswin/avidemux/Tools/package_notes.xslt b/foreignBuilds/mswin/avidemux/Tools/package_notes.xslt index f4316eed30..371cbfbc55 100644 --- a/foreignBuilds/mswin/avidemux/Tools/package_notes.xslt +++ b/foreignBuilds/mswin/avidemux/Tools/package_notes.xslt @@ -1,127 +1,127 @@ - - - - - - - - - - - Avidemux 2.6 Windows Package Notes - - -

Avidemux 2.6 Windows Package Notes

-
- -
- - -
- - -

- - Revision  - - -  ( - - - - ) -
- - -

  • - -
  • - -

    -
    - - - - - - -   - - - - - -   - - - - - - - - - - - - - Jan - Feb - Mar - Apr - May - Jun - Jul - Aug - Sep - Oct - Nov - Dec - - + + + + + + + + + + + Avidemux 2.6 Windows Package Notes + + +

    Avidemux 2.6 Windows Package Notes

    +
    + +
    + + +
    + + +

    + + Revision  + + +  ( + + + + ) +
    + + +

  • + +
  • + +

    +
    + + + + + + +   + + + + + +   + + + + + + + + + + + + + Jan + Feb + Mar + Apr + May + Jun + Jul + Aug + Sep + Oct + Nov + Dec + +
    \ No newline at end of file diff --git a/foreignBuilds/mswin/avidemux/Tools/touch_files.xslt b/foreignBuilds/mswin/avidemux/Tools/touch_files.xslt index 771290707a..a8b2f1005c 100644 --- a/foreignBuilds/mswin/avidemux/Tools/touch_files.xslt +++ b/foreignBuilds/mswin/avidemux/Tools/touch_files.xslt @@ -1,152 +1,152 @@ - - - - - <?php - function touchDirContents($path, $time) - { - $dirHandle = opendir($path); - - while (($resource = readdir($dirHandle)) != false) - { - if (is_file($path . "/" . $resource)) - { - touch($path . "/" . $resource, $time); - } - } - - closedir($dirHandle); - } - - - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - touch(" - - ", mktime(0, 0, 0, - - , - - , - - )); - - touchDirContents(" - - ", mktime(0, 0, 0, - - , - - , - - )); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2.5/ - - - - Milestone/ - - - _( - - ) - - - SVN/ - - - - - - _ - - - - - - - _r - - - - - - - - - - - - - - abcdefghijklmnopqrstuvwxyz - ABCDEFGHIJKLMNOPQRSTUVWXYZ - - + + + + + <?php + function touchDirContents($path, $time) + { + $dirHandle = opendir($path); + + while (($resource = readdir($dirHandle)) != false) + { + if (is_file($path . "/" . $resource)) + { + touch($path . "/" . $resource, $time); + } + } + + closedir($dirHandle); + } + + + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + touch(" + + ", mktime(0, 0, 0, + + , + + , + + )); + + touchDirContents(" + + ", mktime(0, 0, 0, + + , + + , + + )); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2.5/ + + + + Milestone/ + + + _( + + ) + + + SVN/ + + + + + + _ + + + + + + + _r + + + + + + + + + + + + + + abcdefghijklmnopqrstuvwxyz + ABCDEFGHIJKLMNOPQRSTUVWXYZ + + \ No newline at end of file diff --git a/foreignBuilds/mswin/avsproxy/Perform Build.bat b/foreignBuilds/mswin/avsproxy/Perform Build.bat index a2c094cea6..0f77d3a68b 100644 --- a/foreignBuilds/mswin/avsproxy/Perform Build.bat +++ b/foreignBuilds/mswin/avsproxy/Perform Build.bat @@ -1,31 +1,31 @@ -@echo off - -echo MSVC build for avsproxy -echo ======================= -echo. - -set curDir=%CD% - -call "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 -echo. - -cd ..\..\..\addons\avisynthproxy -if errorlevel 1 goto end - -vcupgrade -overwrite -nologo avsproxy.vcproj -if errorlevel 1 goto end - -echo. -msbuild avsproxy.vcxproj /p:Configuration=Release /t:rebuild -if errorlevel 1 goto end - -set BuildBits=32 -call "%curDir%\..\Set Common Environment Variables" -copy "avsproxy.exe" "%admBuildDir%" - -set BuildBits=64 -call "%curDir%\..\Set Common Environment Variables" -copy "avsproxy.exe" "%admBuildDir%" - -:end +@echo off + +echo MSVC build for avsproxy +echo ======================= +echo. + +set curDir=%CD% + +call "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 +echo. + +cd ..\..\..\addons\avisynthproxy +if errorlevel 1 goto end + +vcupgrade -overwrite -nologo avsproxy.vcproj +if errorlevel 1 goto end + +echo. +msbuild avsproxy.vcxproj /p:Configuration=Release /t:rebuild +if errorlevel 1 goto end + +set BuildBits=32 +call "%curDir%\..\Set Common Environment Variables" +copy "avsproxy.exe" "%admBuildDir%" + +set BuildBits=64 +call "%curDir%\..\Set Common Environment Variables" +copy "avsproxy.exe" "%admBuildDir%" + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/dcaenc/Perform Build.bat b/foreignBuilds/mswin/dcaenc/Perform Build.bat index 52a52a1247..384d4cd157 100644 --- a/foreignBuilds/mswin/dcaenc/Perform Build.bat +++ b/foreignBuilds/mswin/dcaenc/Perform Build.bat @@ -1,75 +1,75 @@ -@echo off - -echo MSYS build for dcaenc -echo ===================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set version=2 -set package=dcaenc-%version%.tar.gz -set sourceFolder=dcaenc-%version%-%BuildBits% -set tarFolder=dcaenc-%version% -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://aepatrakov.narod.ru/dcaenc/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%\%sourceFolder%" -if errorlevel 1 goto end -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Patching -patch -p0 -i "%curDir%\Makefile.in.patch" - -echo. -echo Configuring - -sh ./configure --prefix="%usrLocalDir%" --disable-static CFLAGS="%CFLAGS% -O3" - -if errorlevel 1 goto end -echo. -pause - -make install-strip -if errorlevel 1 goto end - -copy "%usrLocalDir%\bin\libdcaenc-0.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for dcaenc +echo ===================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set version=2 +set package=dcaenc-%version%.tar.gz +set sourceFolder=dcaenc-%version%-%BuildBits% +set tarFolder=dcaenc-%version% +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://aepatrakov.narod.ru/dcaenc/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%\%sourceFolder%" +if errorlevel 1 goto end +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Patching +patch -p0 -i "%curDir%\Makefile.in.patch" + +echo. +echo Configuring + +sh ./configure --prefix="%usrLocalDir%" --disable-static CFLAGS="%CFLAGS% -O3" + +if errorlevel 1 goto end +echo. +pause + +make install-strip +if errorlevel 1 goto end + +copy "%usrLocalDir%\bin\libdcaenc-0.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/expat/Perform Build.bat b/foreignBuilds/mswin/expat/Perform Build.bat index 439a6c63b4..aea86116ed 100644 --- a/foreignBuilds/mswin/expat/Perform Build.bat +++ b/foreignBuilds/mswin/expat/Perform Build.bat @@ -1,72 +1,72 @@ -@echo off - -echo MSYS build for expat -echo ==================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set version=2.1.0 -set package=expat-%version%.tar.gz -set sourceFolder=expat-%version%-%BuildBits% -set tarFolder=expat-%version% -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://sourceforge.net/projects/expat/files/expat/%version%/%package%/download -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%\\%sourceFolder%" -if errorlevel 1 goto end -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Configuring - -sh ./configure --prefix="%usrLocalDir%" --disable-static - -if errorlevel 1 goto end -echo. -pause - -make CFLAGS="%CFLAGS% -O3" install -if errorlevel 1 goto end - -strip "%usrLocalDir%\bin\libexpat-1.dll" -copy "%usrLocalDir%\bin\libexpat-1.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for expat +echo ==================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set version=2.1.0 +set package=expat-%version%.tar.gz +set sourceFolder=expat-%version%-%BuildBits% +set tarFolder=expat-%version% +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://sourceforge.net/projects/expat/files/expat/%version%/%package%/download +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%\\%sourceFolder%" +if errorlevel 1 goto end +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Configuring + +sh ./configure --prefix="%usrLocalDir%" --disable-static + +if errorlevel 1 goto end +echo. +pause + +make CFLAGS="%CFLAGS% -O3" install +if errorlevel 1 goto end + +strip "%usrLocalDir%\bin\libexpat-1.dll" +copy "%usrLocalDir%\bin\libexpat-1.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/faac/Perform Build.bat b/foreignBuilds/mswin/faac/Perform Build.bat index ae66db216f..f9b2c4027d 100644 --- a/foreignBuilds/mswin/faac/Perform Build.bat +++ b/foreignBuilds/mswin/faac/Perform Build.bat @@ -1,68 +1,68 @@ -@echo off - -echo MSYS build for FAAC -echo =================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set package=faac-1.28.tar.gz -set sourceFolder=faac-1.28-%BuildBits% -set tarFolder=faac-1.28 -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://downloads.sourceforge.net/faac/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%/%sourceFolder%" -if errorlevel 1 goto end - -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -copy ".\include\*.h" "%usrLocalDir%\include" -cd libfaac -copy "%curDir%\makefile." - -make -if errorlevel 1 goto end - -copy libfaac.dll "%usrLocalDir%/bin" -copy libfaac.a "%usrLocalDir%/lib" -copy "%usrLocalDir%\bin\libfaac.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for FAAC +echo =================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set package=faac-1.28.tar.gz +set sourceFolder=faac-1.28-%BuildBits% +set tarFolder=faac-1.28 +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://downloads.sourceforge.net/faac/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%/%sourceFolder%" +if errorlevel 1 goto end + +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +copy ".\include\*.h" "%usrLocalDir%\include" +cd libfaac +copy "%curDir%\makefile." + +make +if errorlevel 1 goto end + +copy libfaac.dll "%usrLocalDir%/bin" +copy libfaac.a "%usrLocalDir%/lib" +copy "%usrLocalDir%\bin\libfaac.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/faac/makefile b/foreignBuilds/mswin/faac/makefile index 6d5357f37e..7bf35d624f 100644 --- a/foreignBuilds/mswin/faac/makefile +++ b/foreignBuilds/mswin/faac/makefile @@ -1,5 +1,5 @@ -CFLAGS =-s -O3 -shared -I../include -Wl,--out-implib,libfaac.a -SRC=$(wildcard *.c) - -libfaac.dll: $(SRC) +CFLAGS =-s -O3 -shared -I../include -Wl,--out-implib,libfaac.a +SRC=$(wildcard *.c) + +libfaac.dll: $(SRC) gcc -o $@ $^ $(CFLAGS) $(LDFLAGS) \ No newline at end of file diff --git a/foreignBuilds/mswin/faad/Perform Build.bat b/foreignBuilds/mswin/faad/Perform Build.bat index a3d996d3e6..098681f481 100644 --- a/foreignBuilds/mswin/faad/Perform Build.bat +++ b/foreignBuilds/mswin/faad/Perform Build.bat @@ -1,68 +1,68 @@ -@echo off - -echo MSYS build for FAAD -echo =================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set package=faad2-2.7.tar.gz -set sourceFolder=faac-2.7-%BuildBits% -set tarFolder=faad2-2.7 -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://downloads.sourceforge.net/faac/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%/%sourceFolder%" -if errorlevel 1 goto end - -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -copy ".\include\*.h" "%usrLocalDir%\include" -cd libfaad -copy "%curDir%\makefile." - -make -if errorlevel 1 goto end - -copy libfaad2.dll "%usrLocalDir%/bin" -copy libfaad.a "%usrLocalDir%/lib" -copy "%usrLocalDir%\bin\libfaad2.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for FAAD +echo =================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set package=faad2-2.7.tar.gz +set sourceFolder=faac-2.7-%BuildBits% +set tarFolder=faad2-2.7 +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://downloads.sourceforge.net/faac/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%/%sourceFolder%" +if errorlevel 1 goto end + +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +copy ".\include\*.h" "%usrLocalDir%\include" +cd libfaad +copy "%curDir%\makefile." + +make +if errorlevel 1 goto end + +copy libfaad2.dll "%usrLocalDir%/bin" +copy libfaad.a "%usrLocalDir%/lib" +copy "%usrLocalDir%\bin\libfaad2.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/faad/makefile b/foreignBuilds/mswin/faad/makefile index d7772c1363..dd9a9987a7 100644 --- a/foreignBuilds/mswin/faad/makefile +++ b/foreignBuilds/mswin/faad/makefile @@ -1,5 +1,5 @@ -CFLAGS =-s -O3 -shared -DHAVE_MEMCPY=1 -DHAVE_STRING_H=1 -DHAVE_STDINT_H=1 -I../include -I"." -Wl,--out-implib,libfaad.a -SRC=$(wildcard *.c) - -libfaad2.dll: $(SRC) +CFLAGS =-s -O3 -shared -DHAVE_MEMCPY=1 -DHAVE_STRING_H=1 -DHAVE_STDINT_H=1 -I../include -I"." -Wl,--out-implib,libfaad.a +SRC=$(wildcard *.c) + +libfaad2.dll: $(SRC) gcc -o $@ $^ $(CFLAGS) $(LDFLAGS) \ No newline at end of file diff --git a/foreignBuilds/mswin/fontconfig/Perform Build.bat b/foreignBuilds/mswin/fontconfig/Perform Build.bat index 48e4d1323a..239313bcaa 100644 --- a/foreignBuilds/mswin/fontconfig/Perform Build.bat +++ b/foreignBuilds/mswin/fontconfig/Perform Build.bat @@ -1,73 +1,73 @@ -@echo off - -echo MSYS build for fontconfig -echo ========================= -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set version=2.10.2 -set package=fontconfig-%version%.tar.gz -set sourceFolder=fontconfig-%version%-%BuildBits% -set tarFolder=fontconfig-%version% -set curDir=%CD% -set PATH=%msysDir%\bin;%PATH% - -if not exist %package% ( - echo. - echo Downloading - wget http://fontconfig.org/release/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%/%sourceFolder%" -if errorlevel 1 goto end - -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Configuring -sh ./configure --prefix="%usrLocalDir%" --disable-static --disable-docs - -if errorlevel 1 goto end -echo. -pause - -make install-strip -if errorlevel 1 goto end - -del "%usrLocalDir%\etc\fonts\fonts.conf.bak" -copy "%usrLocalDir%\bin\libfontconfig-1.dll" "%admBuildDir%" -xcopy /s/y "%usrLocalDir%\etc\fonts\*.*" "%admBuildDir%\etc\fonts\" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for fontconfig +echo ========================= +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set version=2.10.2 +set package=fontconfig-%version%.tar.gz +set sourceFolder=fontconfig-%version%-%BuildBits% +set tarFolder=fontconfig-%version% +set curDir=%CD% +set PATH=%msysDir%\bin;%PATH% + +if not exist %package% ( + echo. + echo Downloading + wget http://fontconfig.org/release/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%/%sourceFolder%" +if errorlevel 1 goto end + +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Configuring +sh ./configure --prefix="%usrLocalDir%" --disable-static --disable-docs + +if errorlevel 1 goto end +echo. +pause + +make install-strip +if errorlevel 1 goto end + +del "%usrLocalDir%\etc\fonts\fonts.conf.bak" +copy "%usrLocalDir%\bin\libfontconfig-1.dll" "%admBuildDir%" +xcopy /s/y "%usrLocalDir%\etc\fonts\*.*" "%admBuildDir%\etc\fonts\" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/freetype/Perform Build.bat b/foreignBuilds/mswin/freetype/Perform Build.bat index 44eea99b06..f0ec7a92fb 100644 --- a/foreignBuilds/mswin/freetype/Perform Build.bat +++ b/foreignBuilds/mswin/freetype/Perform Build.bat @@ -1,73 +1,73 @@ -@echo off - -echo MSYS build for FreeType -echo ======================= -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set version=2.4.10 -set package=freetype-%version%.tar.gz -set sourceFolder=freetype-%version%-%BuildBits% -set tarFolder=freetype-%version% -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://sourceforge.net/projects/freetype/files/freetype2/%version%/%package%/download -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%\\%sourceFolder%" -if errorlevel 1 goto end -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Configuring - -set CFLAGS=%CFLAGS% -O3 -sh ./configure --prefix="%usrLocalDir%" --disable-static - -if errorlevel 1 goto end -echo. -pause - -make install -if errorlevel 1 goto end - -strip "%usrLocalDir%\bin\libfreetype-6.dll" -copy "%usrLocalDir%\bin\libfreetype-6.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for FreeType +echo ======================= +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set version=2.4.10 +set package=freetype-%version%.tar.gz +set sourceFolder=freetype-%version%-%BuildBits% +set tarFolder=freetype-%version% +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://sourceforge.net/projects/freetype/files/freetype2/%version%/%package%/download +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%\\%sourceFolder%" +if errorlevel 1 goto end +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Configuring + +set CFLAGS=%CFLAGS% -O3 +sh ./configure --prefix="%usrLocalDir%" --disable-static + +if errorlevel 1 goto end +echo. +pause + +make install +if errorlevel 1 goto end + +strip "%usrLocalDir%\bin\libfreetype-6.dll" +copy "%usrLocalDir%\bin\libfreetype-6.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/fribidi/Perform Build.bat b/foreignBuilds/mswin/fribidi/Perform Build.bat index e8c5ad08e2..c128e917d4 100644 --- a/foreignBuilds/mswin/fribidi/Perform Build.bat +++ b/foreignBuilds/mswin/fribidi/Perform Build.bat @@ -1,80 +1,80 @@ -@echo off - -echo MSYS build for FriBidi -echo ====================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set package=fribidi-0.19.5.tar.bz2 -set sourceFolder=fribidi-0.19.5-%BuildBits% -set tarFolder=fribidi-0.19.5 -set curDir=%CD% -set PATH=%msysDir%\bin;%PATH% - -if not exist %package% ( - echo. - echo Downloading - wget http://fribidi.org/download/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -cd "%devDir%\%sourceFolder%" - -set SevenZipDir=%ProgramFiles%\7-zip - -"%SevenZipDir%"\7z x "%curDir%\%package%" -if errorlevel 1 goto end - -"%SevenZipDir%"\7z x "%tarFolder%.tar" -if errorlevel 1 goto end - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Patching -patch -p0 -i "%curDir%\Makefile.in.patch" - -echo. -echo Configuring -sh ./configure --prefix="%usrLocalDir%" --disable-static - -if errorlevel 1 goto end -echo. -pause - -make install -if errorlevel 1 goto end - -strip "%usrLocalDir%\bin\libfribidi-0.dll" -copy "%usrLocalDir%\bin\libfribidi-0.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for FriBidi +echo ====================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set package=fribidi-0.19.5.tar.bz2 +set sourceFolder=fribidi-0.19.5-%BuildBits% +set tarFolder=fribidi-0.19.5 +set curDir=%CD% +set PATH=%msysDir%\bin;%PATH% + +if not exist %package% ( + echo. + echo Downloading + wget http://fribidi.org/download/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +cd "%devDir%\%sourceFolder%" + +set SevenZipDir=%ProgramFiles%\7-zip + +"%SevenZipDir%"\7z x "%curDir%\%package%" +if errorlevel 1 goto end + +"%SevenZipDir%"\7z x "%tarFolder%.tar" +if errorlevel 1 goto end + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Patching +patch -p0 -i "%curDir%\Makefile.in.patch" + +echo. +echo Configuring +sh ./configure --prefix="%usrLocalDir%" --disable-static + +if errorlevel 1 goto end +echo. +pause + +make install +if errorlevel 1 goto end + +strip "%usrLocalDir%\bin\libfribidi-0.dll" +copy "%usrLocalDir%\bin\libfribidi-0.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/js/Perform Build.bat b/foreignBuilds/mswin/js/Perform Build.bat index 7c095292af..e41d94a88f 100644 --- a/foreignBuilds/mswin/js/Perform Build.bat +++ b/foreignBuilds/mswin/js/Perform Build.bat @@ -1,80 +1,80 @@ -@echo off - -%~d0 -cd "%~dp0" - -echo MSYS build for SpiderMonkey -echo =========================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set package=js-1.7.0.tar.gz -set sourceFolder=js-1.7.0-%BuildBits% -set tarFolder=js -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://ftp.mozilla.org/pub/mozilla.org/js/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%/%sourceFolder%" -if errorlevel 1 goto end - -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Patching -copy "%curDir%\WINNT6.1.mk" .\src\config -patch -p0 -i "%curDir%\Makefile.ref.patch" -patch -p0 -i "%curDir%\jsnum.c.patch" - -echo. -cd src -if "%BuildBits%" == "32" windres -i js3240.rc -o jsres.o -O coff -F pe-i386 -if "%BuildBits%" == "64" windres -i js3240.rc -o jsres.o -O coff -F pe-x86-64 - -set CFLAGS=%CFLAGS% -I"%usrLocalDir%/include/nspr" -make -f Makefile.ref JS_DIST="%usrLocalDir%" BUILD_OPT=1 JS_HAS_FILE_OBJECT=1 XLDFLAGS="%LDFLAGS% jsres.o -L%usrLocalDir%/lib -lnspr4" -if errorlevel 1 goto end -echo. - -strip "WINNT6.1_OPT.OBJ\libjs.dll" -copy "WINNT6.1_OPT.OBJ\libjs.dll" "%usrLocalDir%\bin" -copy "%usrLocalDir%\bin\libjs.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +%~d0 +cd "%~dp0" + +echo MSYS build for SpiderMonkey +echo =========================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set package=js-1.7.0.tar.gz +set sourceFolder=js-1.7.0-%BuildBits% +set tarFolder=js +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://ftp.mozilla.org/pub/mozilla.org/js/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%/%sourceFolder%" +if errorlevel 1 goto end + +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Patching +copy "%curDir%\WINNT6.1.mk" .\src\config +patch -p0 -i "%curDir%\Makefile.ref.patch" +patch -p0 -i "%curDir%\jsnum.c.patch" + +echo. +cd src +if "%BuildBits%" == "32" windres -i js3240.rc -o jsres.o -O coff -F pe-i386 +if "%BuildBits%" == "64" windres -i js3240.rc -o jsres.o -O coff -F pe-x86-64 + +set CFLAGS=%CFLAGS% -I"%usrLocalDir%/include/nspr" +make -f Makefile.ref JS_DIST="%usrLocalDir%" BUILD_OPT=1 JS_HAS_FILE_OBJECT=1 XLDFLAGS="%LDFLAGS% jsres.o -L%usrLocalDir%/lib -lnspr4" +if errorlevel 1 goto end +echo. + +strip "WINNT6.1_OPT.OBJ\libjs.dll" +copy "WINNT6.1_OPT.OBJ\libjs.dll" "%usrLocalDir%\bin" +copy "%usrLocalDir%\bin\libjs.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/js/WINNT6.1.mk b/foreignBuilds/mswin/js/WINNT6.1.mk index ee6e96c64f..99f5600dc7 100644 --- a/foreignBuilds/mswin/js/WINNT6.1.mk +++ b/foreignBuilds/mswin/js/WINNT6.1.mk @@ -1,26 +1,26 @@ -CC = gcc -CCC = g++ -LD = g++ - -CFLAGS += -Wall -Wno-format -OS_CFLAGS = -D_X86_=1 -DXP_WIN -DXP_WIN32 -DWIN32 -D_WINDOWS -D_WIN32 -DWINVER=0x500 -D_WIN32_WINNT=0x500 -D_MINGW -DEXPORT_JS_API - -XMKSHLIBOPTS += -Wl,--out-implib=$(OBJDIR)/libjs.dll.a -RANLIB = ranlib -MKSHLIB = $(LD) -shared $(XMKSHLIBOPTS) - -ifdef BUILD_OPT -OS_CFLAGS += -O2 -s -endif - -#.c.o: -# $(CC) -c -MD $*.d $(CFLAGS) $< - -CPU_ARCH = x86 -GFX_ARCH = win32 - -JSDLL_CFLAGS = -DEXPORT_JS_API -OS_LIBS = -lm -lc - -PREBUILT_CPUCFG = 1 +CC = gcc +CCC = g++ +LD = g++ + +CFLAGS += -Wall -Wno-format +OS_CFLAGS = -D_X86_=1 -DXP_WIN -DXP_WIN32 -DWIN32 -D_WINDOWS -D_WIN32 -DWINVER=0x500 -D_WIN32_WINNT=0x500 -D_MINGW -DEXPORT_JS_API + +XMKSHLIBOPTS += -Wl,--out-implib=$(OBJDIR)/libjs.dll.a +RANLIB = ranlib +MKSHLIB = $(LD) -shared $(XMKSHLIBOPTS) + +ifdef BUILD_OPT +OS_CFLAGS += -O2 -s +endif + +#.c.o: +# $(CC) -c -MD $*.d $(CFLAGS) $< + +CPU_ARCH = x86 +GFX_ARCH = win32 + +JSDLL_CFLAGS = -DEXPORT_JS_API +OS_LIBS = -lm -lc + +PREBUILT_CPUCFG = 1 SO_SUFFIX=dll \ No newline at end of file diff --git a/foreignBuilds/mswin/lame/Perform Build.bat b/foreignBuilds/mswin/lame/Perform Build.bat index 76a78ebdac..59e89dd058 100644 --- a/foreignBuilds/mswin/lame/Perform Build.bat +++ b/foreignBuilds/mswin/lame/Perform Build.bat @@ -1,75 +1,75 @@ -@echo off - -echo MSYS build for LAME -echo =================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set version=3.99 -set package=lame-%version%.5.tar.gz -set sourceFolder=lame-%version%-%BuildBits% -set tarFolder=lame-%version%.5 -set curDir=%CD% -set PATH=%PATH%;%~d0\Dev\MSYS\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://sourceforge.net/projects/lame/files/lame/%version%/%package%/download/ -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Configuring -set CFLAGS=%CFLAGS% -O3 - -if "%BuildBits%" == "32" sh ./configure --prefix="%usrLocalDir%" --disable-static --enable-nasm -if "%BuildBits%" == "64" sh ./configure --prefix="%usrLocalDir%" --disable-static - -if errorlevel 1 goto end -echo. -pause - -make install -if errorlevel 1 goto end - -strip "%usrLocalDir%\bin\libmp3lame-0.dll" -copy "%usrLocalDir%\bin\libmp3lame-0.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for LAME +echo =================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set version=3.99 +set package=lame-%version%.5.tar.gz +set sourceFolder=lame-%version%-%BuildBits% +set tarFolder=lame-%version%.5 +set curDir=%CD% +set PATH=%PATH%;%~d0\Dev\MSYS\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://sourceforge.net/projects/lame/files/lame/%version%/%package%/download/ +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Configuring +set CFLAGS=%CFLAGS% -O3 + +if "%BuildBits%" == "32" sh ./configure --prefix="%usrLocalDir%" --disable-static --enable-nasm +if "%BuildBits%" == "64" sh ./configure --prefix="%usrLocalDir%" --disable-static + +if errorlevel 1 goto end +echo. +pause + +make install +if errorlevel 1 goto end + +strip "%usrLocalDir%\bin\libmp3lame-0.dll" +copy "%usrLocalDir%\bin\libmp3lame-0.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/libogg/Perform Build.bat b/foreignBuilds/mswin/libogg/Perform Build.bat index 1fa326390b..43cac028e1 100644 --- a/foreignBuilds/mswin/libogg/Perform Build.bat +++ b/foreignBuilds/mswin/libogg/Perform Build.bat @@ -1,71 +1,71 @@ -@echo off - -echo MSYS build for libogg -echo ===================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set package=libogg-1.3.0.tar.gz -set sourceFolder=libogg-1.3.0-%BuildBits% -set tarFolder=libogg-1.3.0 -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://downloads.xiph.org/releases/ogg/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Configuring - -sh ./configure --prefix="%usrLocalDir%" --disable-static - -if errorlevel 1 goto end -echo. -pause - -make install-strip -if errorlevel 1 goto end - -copy "%usrLocalDir%\bin\libogg-0.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for libogg +echo ===================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set package=libogg-1.3.0.tar.gz +set sourceFolder=libogg-1.3.0-%BuildBits% +set tarFolder=libogg-1.3.0 +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://downloads.xiph.org/releases/ogg/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Configuring + +sh ./configure --prefix="%usrLocalDir%" --disable-static + +if errorlevel 1 goto end +echo. +pause + +make install-strip +if errorlevel 1 goto end + +copy "%usrLocalDir%\bin\libogg-0.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/libvorbis/Perform Build.bat b/foreignBuilds/mswin/libvorbis/Perform Build.bat index cba9d13f9b..4e47983b86 100644 --- a/foreignBuilds/mswin/libvorbis/Perform Build.bat +++ b/foreignBuilds/mswin/libvorbis/Perform Build.bat @@ -1,72 +1,72 @@ -@echo off - -echo MSYS build for libvorbis -echo ======================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set package=libvorbis-1.3.3.tar.gz -set sourceFolder=libvorbis-1.3.3-%BuildBits% -set tarFolder=libvorbis-1.3.3 -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://downloads.xiph.org/releases/vorbis/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Configuring - -sh ./configure --prefix="%usrLocalDir%" --disable-static --disable-examples --disable-docs - -if errorlevel 1 goto end -echo. -pause - -make install-strip -if errorlevel 1 goto end - -copy "%usrLocalDir%\bin\libvorbis-0.dll" "%admBuildDir%" -copy "%usrLocalDir%\bin\libvorbisenc-2.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for libvorbis +echo ======================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set package=libvorbis-1.3.3.tar.gz +set sourceFolder=libvorbis-1.3.3-%BuildBits% +set tarFolder=libvorbis-1.3.3 +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://downloads.xiph.org/releases/vorbis/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Configuring + +sh ./configure --prefix="%usrLocalDir%" --disable-static --disable-examples --disable-docs + +if errorlevel 1 goto end +echo. +pause + +make install-strip +if errorlevel 1 goto end + +copy "%usrLocalDir%\bin\libvorbis-0.dll" "%admBuildDir%" +copy "%usrLocalDir%\bin\libvorbisenc-2.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/libvpx/Perform Build.bat b/foreignBuilds/mswin/libvpx/Perform Build.bat index dc54879416..e30262de13 100644 --- a/foreignBuilds/mswin/libvpx/Perform Build.bat +++ b/foreignBuilds/mswin/libvpx/Perform Build.bat @@ -1,70 +1,70 @@ -@echo off - -echo MSYS build for libvpx -echo ===================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set package=libvpx-v1.1.0.tar.bz2 -set sourceFolder=libvpx-1.1.0-%BuildBits% -set tarFolder=libvpx-v1.1.0 -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://webm.googlecode.com/files/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfj "%package%" -C "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Configuring - -if "%BuildBits%" == "32" sh ./configure --prefix="%usrLocalDir%" --disable-vp8-encoder --target=x86-win32-gcc --disable-examples -if "%BuildBits%" == "64" sh ./configure --prefix="%usrLocalDir%" --disable-vp8-encoder --target=x86_64-win64-gcc --disable-examples - -if errorlevel 1 goto end -echo. -pause - -make install -if errorlevel 1 goto end - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for libvpx +echo ===================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set package=libvpx-v1.1.0.tar.bz2 +set sourceFolder=libvpx-1.1.0-%BuildBits% +set tarFolder=libvpx-v1.1.0 +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://webm.googlecode.com/files/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfj "%package%" -C "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Configuring + +if "%BuildBits%" == "32" sh ./configure --prefix="%usrLocalDir%" --disable-vp8-encoder --target=x86-win32-gcc --disable-examples +if "%BuildBits%" == "64" sh ./configure --prefix="%usrLocalDir%" --disable-vp8-encoder --target=x86_64-win64-gcc --disable-examples + +if errorlevel 1 goto end +echo. +pause + +make install +if errorlevel 1 goto end + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/nspr/Perform Build.bat b/foreignBuilds/mswin/nspr/Perform Build.bat index e4e897b1df..49a6560db6 100644 --- a/foreignBuilds/mswin/nspr/Perform Build.bat +++ b/foreignBuilds/mswin/nspr/Perform Build.bat @@ -1,86 +1,86 @@ -@echo off - -%~d0 -cd "%~dp0" - -echo MSYS build for nspr -echo =================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set version=4.9.4 -set package=nspr-%version%.tar.gz -set sourceFolder=nspr-%version%-%BuildBits% -set tarFolder=nspr-%version% -set PATH=%PATH%;%~d0\Dev\MSYS\bin -set curDir=%CD% - -if not exist %package% ( - echo. - echo Downloading - wget ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v%version%/src/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%/%sourceFolder%" -if errorlevel 1 goto end - -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Configuring -cd mozilla\nsprpub -set LDFLAGS=-shared-libgcc -sh ./configure --prefix="%usrLocalDir%" --enable-strip --enable-win32-target=WIN95 --enable-optimize="-O3 %CFLAGS%" --disable-debug - -if errorlevel 1 goto end -echo. -pause - -if "%BuildBits%" == "32" set RC=RC="windres -F pe-i386" CC="gcc -m32" -if "%BuildBits%" == "64" set RC=RC="windres -F pe-x86-64" CC="gcc -m64" -make %RC% -if errorlevel 1 goto end - -make install -if errorlevel 1 goto end - -move "%usrLocalDir%\lib\nspr4.dll" "%usrLocalDir%\bin" -copy "%usrLocalDir%\bin\nspr4.dll" "%admBuildDir%" - -pexports "%usrLocalDir%/bin/nspr4.dll" > nspr4.def -if "%BuildBits%" == "32" dlltool -d nspr4.def -l "%usrLocalDir%/lib/nspr4.dll.a" -m i386 --as-flags=--32 -if "%BuildBits%" == "64" dlltool -d nspr4.def -l "%usrLocalDir%/lib/nspr4.dll.a" -m i386:x86-64 --as-flags=--64 - -goto end - -:error -echo Error - -:end +@echo off + +%~d0 +cd "%~dp0" + +echo MSYS build for nspr +echo =================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set version=4.9.4 +set package=nspr-%version%.tar.gz +set sourceFolder=nspr-%version%-%BuildBits% +set tarFolder=nspr-%version% +set PATH=%PATH%;%~d0\Dev\MSYS\bin +set curDir=%CD% + +if not exist %package% ( + echo. + echo Downloading + wget ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v%version%/src/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%/%sourceFolder%" +if errorlevel 1 goto end + +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Configuring +cd mozilla\nsprpub +set LDFLAGS=-shared-libgcc +sh ./configure --prefix="%usrLocalDir%" --enable-strip --enable-win32-target=WIN95 --enable-optimize="-O3 %CFLAGS%" --disable-debug + +if errorlevel 1 goto end +echo. +pause + +if "%BuildBits%" == "32" set RC=RC="windres -F pe-i386" CC="gcc -m32" +if "%BuildBits%" == "64" set RC=RC="windres -F pe-x86-64" CC="gcc -m64" +make %RC% +if errorlevel 1 goto end + +make install +if errorlevel 1 goto end + +move "%usrLocalDir%\lib\nspr4.dll" "%usrLocalDir%\bin" +copy "%usrLocalDir%\bin\nspr4.dll" "%admBuildDir%" + +pexports "%usrLocalDir%/bin/nspr4.dll" > nspr4.def +if "%BuildBits%" == "32" dlltool -d nspr4.def -l "%usrLocalDir%/lib/nspr4.dll.a" -m i386 --as-flags=--32 +if "%BuildBits%" == "64" dlltool -d nspr4.def -l "%usrLocalDir%/lib/nspr4.dll.a" -m i386:x86-64 --as-flags=--64 + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/opencore-amr/Perform Build.bat b/foreignBuilds/mswin/opencore-amr/Perform Build.bat index 3bc8dd4de4..d7061d28f6 100644 --- a/foreignBuilds/mswin/opencore-amr/Perform Build.bat +++ b/foreignBuilds/mswin/opencore-amr/Perform Build.bat @@ -1,71 +1,71 @@ -@echo off - -echo MSYS build for opencore-amr -echo =========================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set package=opencore-amr-0.1.3.tar.gz -set sourceFolder=opencore-amr-0.1.3-%BuildBits% -set tarFolder=opencore-amr-0.1.3 -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://sourceforge.net/projects/opencore-amr/files/opencore-amr/%package%/download -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%\%sourceFolder%" -if errorlevel 1 goto end -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Configuring - -sh ./configure --prefix="%usrLocalDir%" --disable-static - -if errorlevel 1 goto end -echo. -pause - -make install-strip -if errorlevel 1 goto end - -copy "%usrLocalDir%\bin\libopencore-amrnb-0.dll" "%admBuildDir%" -copy "%usrLocalDir%\bin\libopencore-amrwb-0.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for opencore-amr +echo =========================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set package=opencore-amr-0.1.3.tar.gz +set sourceFolder=opencore-amr-0.1.3-%BuildBits% +set tarFolder=opencore-amr-0.1.3 +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://sourceforge.net/projects/opencore-amr/files/opencore-amr/%package%/download +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%\%sourceFolder%" +if errorlevel 1 goto end +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Configuring + +sh ./configure --prefix="%usrLocalDir%" --disable-static + +if errorlevel 1 goto end +echo. +pause + +make install-strip +if errorlevel 1 goto end + +copy "%usrLocalDir%\bin\libopencore-amrnb-0.dll" "%admBuildDir%" +copy "%usrLocalDir%\bin\libopencore-amrwb-0.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/qt/Perform Build.bat b/foreignBuilds/mswin/qt/Perform Build.bat index 0f7b9f10f2..4a7c940061 100644 --- a/foreignBuilds/mswin/qt/Perform Build.bat +++ b/foreignBuilds/mswin/qt/Perform Build.bat @@ -1,111 +1,111 @@ -@echo off - -:start -echo MSYS build for Qt -echo ================= -echo 1. 32-bit build -echo 2. 64-bit build -echo 3. Debug build -echo X. Exit -echo. - -choice /c 123x - -if errorlevel 4 goto :eof -if errorlevel 3 ( - set Debug=1 - echo. - echo -- Debug mode set -- - echo. - goto :start ) -if errorlevel 2 ( - set BuildBits=64 - goto :begin ) -if errorlevel 1 ( - set BuildBits=32 - goto :begin ) - -:begin -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set version=4.8.4 -set package=qt-everywhere-opensource-src-%version%.tar.gz -set sourceBaseFolder=Qt%BuildBits% - -if "%Debug%" == "1" ( - set sourceBaseFolder=%sourceBaseFolder%-dbg - set LeakFlags=-L %admBuildDir% -l ADM_core6 - set BuildType=release -) else ( - set BuildType=release -) - -set sourceFolder=%sourceBaseFolder%\\%version% -set tarFolder=qt-everywhere-opensource-src-%version% -set curDir=%CD% - -if not exist %package% ( - echo. - echo Downloading - wget http://releases.qt-project.org/qt4/source/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rmdir /s /q "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -if not exist "%devDir%\%sourceBaseFolder%" mkdir "%devDir%\%sourceBaseFolder%" -if errorlevel 1 goto end -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" - if errorlevel 1 goto end -) - -if "%Debug%" == "1" ( - copy %admBuildDir:/=\%\libADM_core6.dll bin\ - if errorlevel 1 goto end -) - -echo. -echo Patching -patch -p0 -i "%curDir%\qmake%BuildBits%.conf.patch" - -echo. -echo Configuring -configure -confirm-license -opensource -%BuildType% -system-zlib -no-stl -no-qt3support -no-phonon -no-webkit -no-multimedia -no-declarative -no-style-cleanlooks -no-style-plastique -no-style-motif -no-style-cde -qt-style-windowsxp -qt-style-windowsvista -no-xmlpatterns -nomake demos -nomake examples -platform win32-g++-4.6 -mmx -sse -sse2 -3dnow -I %CMAKE_INCLUDE_PATH:;= -I % -L %CMAKE_LIBRARY_PATH:;= -L % %LeakFlags% - -if errorlevel 1 goto end -echo. -pause - -mingw32-make -if errorlevel 1 goto end - -if "%BuildType%" == "debug" set d=d - -copy "%devDir%\%sourceFolder%\bin\QtCore%d%4.dll" "%admBuildDir%" -copy "%devDir%\%sourceFolder%\bin\QtGui%d%4.dll" "%admBuildDir%" -copy "%devDir%\%sourceFolder%\bin\QtOpenGL%d%4.dll" "%admBuildDir%" -copy "%devDir%\%sourceFolder%\bin\QtScript%d%4.dll" "%admBuildDir%" -copy "%devDir%\%sourceFolder%\bin\QtScriptTools%d%4.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +:start +echo MSYS build for Qt +echo ================= +echo 1. 32-bit build +echo 2. 64-bit build +echo 3. Debug build +echo X. Exit +echo. + +choice /c 123x + +if errorlevel 4 goto :eof +if errorlevel 3 ( + set Debug=1 + echo. + echo -- Debug mode set -- + echo. + goto :start ) +if errorlevel 2 ( + set BuildBits=64 + goto :begin ) +if errorlevel 1 ( + set BuildBits=32 + goto :begin ) + +:begin +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set version=4.8.4 +set package=qt-everywhere-opensource-src-%version%.tar.gz +set sourceBaseFolder=Qt%BuildBits% + +if "%Debug%" == "1" ( + set sourceBaseFolder=%sourceBaseFolder%-dbg + set LeakFlags=-L %admBuildDir% -l ADM_core6 + set BuildType=release +) else ( + set BuildType=release +) + +set sourceFolder=%sourceBaseFolder%\\%version% +set tarFolder=qt-everywhere-opensource-src-%version% +set curDir=%CD% + +if not exist %package% ( + echo. + echo Downloading + wget http://releases.qt-project.org/qt4/source/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rmdir /s /q "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +if not exist "%devDir%\%sourceBaseFolder%" mkdir "%devDir%\%sourceBaseFolder%" +if errorlevel 1 goto end +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" + if errorlevel 1 goto end +) + +if "%Debug%" == "1" ( + copy %admBuildDir:/=\%\libADM_core6.dll bin\ + if errorlevel 1 goto end +) + +echo. +echo Patching +patch -p0 -i "%curDir%\qmake%BuildBits%.conf.patch" + +echo. +echo Configuring +configure -confirm-license -opensource -%BuildType% -system-zlib -no-stl -no-qt3support -no-phonon -no-webkit -no-multimedia -no-declarative -no-style-cleanlooks -no-style-plastique -no-style-motif -no-style-cde -qt-style-windowsxp -qt-style-windowsvista -no-xmlpatterns -nomake demos -nomake examples -platform win32-g++-4.6 -mmx -sse -sse2 -3dnow -I %CMAKE_INCLUDE_PATH:;= -I % -L %CMAKE_LIBRARY_PATH:;= -L % %LeakFlags% + +if errorlevel 1 goto end +echo. +pause + +mingw32-make +if errorlevel 1 goto end + +if "%BuildType%" == "debug" set d=d + +copy "%devDir%\%sourceFolder%\bin\QtCore%d%4.dll" "%admBuildDir%" +copy "%devDir%\%sourceFolder%\bin\QtGui%d%4.dll" "%admBuildDir%" +copy "%devDir%\%sourceFolder%\bin\QtOpenGL%d%4.dll" "%admBuildDir%" +copy "%devDir%\%sourceFolder%\bin\QtScript%d%4.dll" "%admBuildDir%" +copy "%devDir%\%sourceFolder%\bin\QtScriptTools%d%4.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/sqlite/Perform Build.bat b/foreignBuilds/mswin/sqlite/Perform Build.bat index f9dba2c85a..6657f7db17 100644 --- a/foreignBuilds/mswin/sqlite/Perform Build.bat +++ b/foreignBuilds/mswin/sqlite/Perform Build.bat @@ -1,72 +1,72 @@ -@echo off - -echo MSYS build for sqlite -echo ===================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set version=3.7.15.0 -set package=sqlite-autoconf-3071500.tar.gz -set sourceFolder=sqlite-%version%-%BuildBits% -set tarFolder=sqlite-autoconf-3071500 -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://www.sqlite.org/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%\\%sourceFolder%" -if errorlevel 1 goto end -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Configuring - -sh ./configure --prefix="%usrLocalDir%" --disable-static - -if errorlevel 1 goto end -echo. -pause - -make install -if errorlevel 1 goto end - -strip "%usrLocalDir%\bin\libsqlite3-0.dll" -copy "%usrLocalDir%\bin\libsqlite3-0.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for sqlite +echo ===================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set version=3.7.15.0 +set package=sqlite-autoconf-3071500.tar.gz +set sourceFolder=sqlite-%version%-%BuildBits% +set tarFolder=sqlite-autoconf-3071500 +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://www.sqlite.org/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%\\%sourceFolder%" +if errorlevel 1 goto end +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Configuring + +sh ./configure --prefix="%usrLocalDir%" --disable-static + +if errorlevel 1 goto end +echo. +pause + +make install +if errorlevel 1 goto end + +strip "%usrLocalDir%\bin\libsqlite3-0.dll" +copy "%usrLocalDir%\bin\libsqlite3-0.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/twolame/Perform Build.bat b/foreignBuilds/mswin/twolame/Perform Build.bat index e3e0ad5a62..21b681d068 100644 --- a/foreignBuilds/mswin/twolame/Perform Build.bat +++ b/foreignBuilds/mswin/twolame/Perform Build.bat @@ -1,71 +1,71 @@ -@echo off - -echo MSYS build for twolame -echo ====================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set version=0.3.13 -set package=twolame-%version%.tar.gz -set sourceFolder=twolame-%version%-%BuildBits% -set tarFolder=twolame-%version% -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://sourceforge.net/projects/twolame/files/twolame/%version%/%package%/download -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%\\%sourceFolder%" -if errorlevel 1 goto end -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -echo. -echo Configuring - -sh ./configure --prefix="%usrLocalDir%" --disable-static - -if errorlevel 1 goto end -echo. -pause - -make CFLAGS="%CFLAGS% -O3 -DLIBTWOLAME_DLL_EXPORTS" LDFLAGS="%LDFLAGS% -no-undefined" install-strip -if errorlevel 1 goto end - -copy "%usrLocalDir%\bin\libtwolame-0.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for twolame +echo ====================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set version=0.3.13 +set package=twolame-%version%.tar.gz +set sourceFolder=twolame-%version%-%BuildBits% +set tarFolder=twolame-%version% +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://sourceforge.net/projects/twolame/files/twolame/%version%/%package%/download +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%\\%sourceFolder%" +if errorlevel 1 goto end +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +echo. +echo Configuring + +sh ./configure --prefix="%usrLocalDir%" --disable-static + +if errorlevel 1 goto end +echo. +pause + +make CFLAGS="%CFLAGS% -O3 -DLIBTWOLAME_DLL_EXPORTS" LDFLAGS="%LDFLAGS% -no-undefined" install-strip +if errorlevel 1 goto end + +copy "%usrLocalDir%\bin\libtwolame-0.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/win-iconv/Perform Build.bat b/foreignBuilds/mswin/win-iconv/Perform Build.bat index 13b5b015cd..37d6ba0aaa 100644 --- a/foreignBuilds/mswin/win-iconv/Perform Build.bat +++ b/foreignBuilds/mswin/win-iconv/Perform Build.bat @@ -1,61 +1,61 @@ -@echo off - -echo MSYS build for win-iconv -echo ======================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set version=20100912 -set package=win-iconv-dev_tml-%version%_win64.zip -set sourceFolder=win-iconv-%version%-%BuildBits% -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/%package% -) - -if errorlevel 1 goto error - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto error - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto error - -cd "%devDir%\%sourceFolder%" -unzip "%curDir%\%package%" -if errorlevel 1 goto error - -gcc %CFLAGS% -O3 -o win_iconv.win64.o -c src/tml/win_iconv/win_iconv.c -if errorlevel 1 goto error - -ar crv "%usrLocalDir%/lib/libiconv.a" win_iconv.win64.o -if errorlevel 1 goto error - -copy src\tml\win_iconv\iconv.h "%usrLocalDir%/include" -if errorlevel 1 goto error - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for win-iconv +echo ======================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set version=20100912 +set package=win-iconv-dev_tml-%version%_win64.zip +set sourceFolder=win-iconv-%version%-%BuildBits% +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/%package% +) + +if errorlevel 1 goto error + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto error + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto error + +cd "%devDir%\%sourceFolder%" +unzip "%curDir%\%package%" +if errorlevel 1 goto error + +gcc %CFLAGS% -O3 -o win_iconv.win64.o -c src/tml/win_iconv/win_iconv.c +if errorlevel 1 goto error + +ar crv "%usrLocalDir%/lib/libiconv.a" win_iconv.win64.o +if errorlevel 1 goto error + +copy src\tml\win_iconv\iconv.h "%usrLocalDir%/include" +if errorlevel 1 goto error + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/x264/Perform Build.bat b/foreignBuilds/mswin/x264/Perform Build.bat index 6428a69d53..d367bea73a 100644 --- a/foreignBuilds/mswin/x264/Perform Build.bat +++ b/foreignBuilds/mswin/x264/Perform Build.bat @@ -1,53 +1,53 @@ -@echo off - -echo MSYS build for x264 -echo =================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" - -if errorlevel 1 goto end - -set PATH=%PATH%;%msysdir%\bin;%devDir%\Git\bin -set curDir=%CD% - -del "%usrLocalDir%\bin\libx264-*.dll" -del "%usrLocalDir%\include\x264.h" -cd "%devDir%" - -set sourceFolder=x264-%BuildBits% -rm -r -f %sourceFolder% -if errorlevel 1 goto end - -echo Downloading from git -call git clone git://git.videolan.org/x264.git %sourceFolder% -if errorlevel 1 goto end - -cd "%devDir%/%sourceFolder%" - -echo. -echo Configuring -if "%BuildBits%" == "32" set CFLAGS=%CFLAGS% -mfpmath=387 -if "%BuildBits%" == "32" sh ./configure --prefix=%usrLocalDir% --enable-shared --enable-win32thread -if "%BuildBits%" == "64" sh ./configure --prefix=%usrLocalDir% --enable-shared --enable-win32thread --host=x86_64-pc-mingw32 - -if errorlevel 1 goto end - -make install -if errorlevel 1 goto end - -del "%admBuildDir%\libx264-*.dll" -copy "%usrLocalDir%/bin/libx264-*.dll" "%admBuildDir%" - -:end +@echo off + +echo MSYS build for x264 +echo =================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" + +if errorlevel 1 goto end + +set PATH=%PATH%;%msysdir%\bin;%devDir%\Git\bin +set curDir=%CD% + +del "%usrLocalDir%\bin\libx264-*.dll" +del "%usrLocalDir%\include\x264.h" +cd "%devDir%" + +set sourceFolder=x264-%BuildBits% +rm -r -f %sourceFolder% +if errorlevel 1 goto end + +echo Downloading from git +call git clone git://git.videolan.org/x264.git %sourceFolder% +if errorlevel 1 goto end + +cd "%devDir%/%sourceFolder%" + +echo. +echo Configuring +if "%BuildBits%" == "32" set CFLAGS=%CFLAGS% -mfpmath=387 +if "%BuildBits%" == "32" sh ./configure --prefix=%usrLocalDir% --enable-shared --enable-win32thread +if "%BuildBits%" == "64" sh ./configure --prefix=%usrLocalDir% --enable-shared --enable-win32thread --host=x86_64-pc-mingw32 + +if errorlevel 1 goto end + +make install +if errorlevel 1 goto end + +del "%admBuildDir%\libx264-*.dll" +copy "%usrLocalDir%/bin/libx264-*.dll" "%admBuildDir%" + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/xvid/Perform Build.bat b/foreignBuilds/mswin/xvid/Perform Build.bat index 9e58cd8025..b61badd5ec 100644 --- a/foreignBuilds/mswin/xvid/Perform Build.bat +++ b/foreignBuilds/mswin/xvid/Perform Build.bat @@ -1,80 +1,80 @@ -@echo off - -echo MSYS build for Xvid -echo =================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set package=xvidcore-1.3.2.tar.gz -set sourceFolder=xvidcore-1.3.2-%BuildBits% -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://downloads.xvid.org/downloads/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b xvidcore') do ( - move "%CD%\xvidcore\%%a" "%CD%" -) - -echo. -echo Patching -patch -p0 -i "%curDir%\configure.patch" -patch -p0 -i "%curDir%\nasm.inc.patch" - -echo. -echo Configuring -cd build\generic - -if "%BuildBits%" == "32" sh ./configure --prefix="%usrLocalDir%" -if "%BuildBits%" == "64" sh ./configure --prefix="%usrLocalDir%" --build=x86_64-pc-mingw32 -if errorlevel 1 goto end -echo. -pause - -make LDFLAGS="%LDFLAGS% -Wl,-s" -if errorlevel 1 goto end - -make install -if errorlevel 1 goto end - -move "%usrLocalDir%\lib\xvidcore.dll" "%usrLocalDir%\bin" -copy "%usrLocalDir%\bin\xvidcore.dll" "%admBuildDir%" -copy ".\=build\xvidcore.dll.a" "%usrLocalDir%\lib" -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for Xvid +echo =================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set package=xvidcore-1.3.2.tar.gz +set sourceFolder=xvidcore-1.3.2-%BuildBits% +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://downloads.xvid.org/downloads/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b xvidcore') do ( + move "%CD%\xvidcore\%%a" "%CD%" +) + +echo. +echo Patching +patch -p0 -i "%curDir%\configure.patch" +patch -p0 -i "%curDir%\nasm.inc.patch" + +echo. +echo Configuring +cd build\generic + +if "%BuildBits%" == "32" sh ./configure --prefix="%usrLocalDir%" +if "%BuildBits%" == "64" sh ./configure --prefix="%usrLocalDir%" --build=x86_64-pc-mingw32 +if errorlevel 1 goto end +echo. +pause + +make LDFLAGS="%LDFLAGS% -Wl,-s" +if errorlevel 1 goto end + +make install +if errorlevel 1 goto end + +move "%usrLocalDir%\lib\xvidcore.dll" "%usrLocalDir%\bin" +copy "%usrLocalDir%\bin\xvidcore.dll" "%admBuildDir%" +copy ".\=build\xvidcore.dll.a" "%usrLocalDir%\lib" +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/foreignBuilds/mswin/xvid/configure.patch b/foreignBuilds/mswin/xvid/configure.patch index ed6662ea7f..e73bc18205 100644 --- a/foreignBuilds/mswin/xvid/configure.patch +++ b/foreignBuilds/mswin/xvid/configure.patch @@ -1,12 +1,12 @@ --- build/generic/configure.orig 2011-03-17 14:31:52 +0000 +++ build/generic/configure 2011-05-21 16:22:55 +0100 @@ -4325,8 +4325,7 @@ - $as_echo "ok" >&6; } - STATIC_LIB="xvidcore.\$(STATIC_EXTENSION)" - SHARED_LIB="xvidcore.\$(SHARED_EXTENSION)" -- SPECIFIC_LDFLAGS="-mno-cygwin -shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" -- SPECIFIC_CFLAGS="-mno-cygwin" -+ SPECIFIC_LDFLAGS="-shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" - ;; - darwin*|raphsody*) - STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" + $as_echo "ok" >&6; } + STATIC_LIB="xvidcore.\$(STATIC_EXTENSION)" + SHARED_LIB="xvidcore.\$(SHARED_EXTENSION)" +- SPECIFIC_LDFLAGS="-mno-cygwin -shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" +- SPECIFIC_CFLAGS="-mno-cygwin" ++ SPECIFIC_LDFLAGS="-shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" + ;; + darwin*|raphsody*) + STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" diff --git a/foreignBuilds/mswin/zlib/Perform Build.bat b/foreignBuilds/mswin/zlib/Perform Build.bat index 0e1f99dde2..7948335a33 100644 --- a/foreignBuilds/mswin/zlib/Perform Build.bat +++ b/foreignBuilds/mswin/zlib/Perform Build.bat @@ -1,70 +1,70 @@ -@echo off - -echo MSYS build for zlib -echo =================== -echo 1. 32-bit build -echo 2. 64-bit build -echo X. Exit -echo. - -choice /c 12x - -if errorlevel 1 set BuildBits=32 -if errorlevel 2 set BuildBits=64 -if errorlevel 3 goto :eof - -verify >nul -call "../Set Common Environment Variables" -if errorlevel 1 goto end - -set version=1.2.7 -set package=zlib-%version%.tar.gz -set sourceFolder=zlib-%version%-%BuildBits% -set tarFolder=zlib-%version% -set curDir=%CD% -set PATH=%PATH%;%msysDir%\bin - -if not exist %package% ( - echo. - echo Downloading - wget http://zlib.net/%package% -) - -if errorlevel 1 goto end - -echo. -echo Preparing -rm -r -f "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -mkdir "%devDir%\%sourceFolder%" -if errorlevel 1 goto end - -tar xfz "%package%" -C "%devDir%\\%sourceFolder%" -if errorlevel 1 goto end -cd "%devDir%\%sourceFolder%" - -for /f "delims=" %%a in ('dir /b %tarFolder%') do ( - move "%CD%\%tarFolder%\%%a" "%CD%" -) - -if "%BuildBits%" == "32" set RC=RC="windres -F pe-i386" -if "%BuildBits%" == "64" set RC=RC="windres -F pe-x86-64" -mingw32-make -f win32/Makefile.gcc CFLAGS="%CFLAGS%" LDFLAGS="%LDFLAGS%" %RC% -if errorlevel 1 goto end - -copy zlib1.dll "%usrLocalDir%\bin" -copy zconf.h "%usrLocalDir%\include" -copy zlib.h "%usrLocalDir%\include" -copy libz.a "%usrLocalDir%\lib" -copy libz.dll.a "%usrLocalDir%\lib" - -copy "%usrLocalDir%\bin\zlib1.dll" "%admBuildDir%" - -goto end - -:error -echo Error - -:end +@echo off + +echo MSYS build for zlib +echo =================== +echo 1. 32-bit build +echo 2. 64-bit build +echo X. Exit +echo. + +choice /c 12x + +if errorlevel 1 set BuildBits=32 +if errorlevel 2 set BuildBits=64 +if errorlevel 3 goto :eof + +verify >nul +call "../Set Common Environment Variables" +if errorlevel 1 goto end + +set version=1.2.7 +set package=zlib-%version%.tar.gz +set sourceFolder=zlib-%version%-%BuildBits% +set tarFolder=zlib-%version% +set curDir=%CD% +set PATH=%PATH%;%msysDir%\bin + +if not exist %package% ( + echo. + echo Downloading + wget http://zlib.net/%package% +) + +if errorlevel 1 goto end + +echo. +echo Preparing +rm -r -f "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +mkdir "%devDir%\%sourceFolder%" +if errorlevel 1 goto end + +tar xfz "%package%" -C "%devDir%\\%sourceFolder%" +if errorlevel 1 goto end +cd "%devDir%\%sourceFolder%" + +for /f "delims=" %%a in ('dir /b %tarFolder%') do ( + move "%CD%\%tarFolder%\%%a" "%CD%" +) + +if "%BuildBits%" == "32" set RC=RC="windres -F pe-i386" +if "%BuildBits%" == "64" set RC=RC="windres -F pe-x86-64" +mingw32-make -f win32/Makefile.gcc CFLAGS="%CFLAGS%" LDFLAGS="%LDFLAGS%" %RC% +if errorlevel 1 goto end + +copy zlib1.dll "%usrLocalDir%\bin" +copy zconf.h "%usrLocalDir%\include" +copy zlib.h "%usrLocalDir%\include" +copy libz.a "%usrLocalDir%\lib" +copy libz.dll.a "%usrLocalDir%\lib" + +copy "%usrLocalDir%\bin\zlib1.dll" "%admBuildDir%" + +goto end + +:error +echo Error + +:end pause \ No newline at end of file diff --git a/myOwnPlugins/demuxer/CMakeLists.txt b/myOwnPlugins/demuxer/CMakeLists.txt index fb26d6ee17..23bd480c15 100644 --- a/myOwnPlugins/demuxer/CMakeLists.txt +++ b/myOwnPlugins/demuxer/CMakeLists.txt @@ -1,82 +1,82 @@ -#################################################### -# -# -################################################### -MESSAGE("#####################################") -MESSAGE("Own plugin demuxer Started") -MESSAGE("#####################################") -MESSAGE("") - -SET(ADM_PROJECT AdmAsfDemuxer) -SET(PLUGINS TRUE) -SET(DO_COMMON TRUE) -SET(AVIDEMUX_VERSION 2.8) # important ! -SET(AVIDEMUX_EXTERNAL_BUILD True) # important ! -CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0 FATAL_ERROR) -###################################################### -# Try to locate & setup avidemux development files -###################################################### - -MESSAGE(STATUS "Checking for avidemux development files ..") - -SET(ADM_HEADER_DIR ${CMAKE_INSTALL_PREFIX}/include/avidemux/${AVIDEMUX_VERSION}) -SET(ADM_CMAKE_DIR ${ADM_HEADER_DIR}/cmake) - -# Common definitions... -SET(CMAKE_MODULE_PATH "${ADM_CMAKE_DIR}" "${CMAKE_MODULE_PATH}") -MESSAGE(STATUS "Checking for avidemux include folder (i.e. CMAKE_INSTALL_PREFIX/include/avidemux/${AVIDEMUX_VERSION}") -if(NOT EXISTS "${ADM_HEADER_DIR}") - MESSAGE(STATUS "Make sure you installed all the files.\n i cannot find avidemux include folder.cmake .\nSet CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") - MESSAGE(FATAL_ERROR "Aborting") -endif(NOT EXISTS "${ADM_HEADER_DIR}") - -MESSAGE(STATUS "Found avidemux include folder. good.") -MESSAGE(STATUS "Checking for cmake subfolder") - -if(NOT EXISTS "${ADM_CMAKE_DIR}/admCoreIncludesExternalBuild.cmake") - MESSAGE(STATUS "Make sure you installed all the files.\n I cannot find content of the cmake subfolder .\n") - MESSAGE(STATUS "Set CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") - MESSAGE(STATUS "I was looking for admCoreIncludesExternalBuild.cmake in ${ADM_CMAKE_DIR}") - MESSAGE(FATAL_ERROR "Aborting") -endif(NOT EXISTS "${ADM_CMAKE_DIR}/admCoreIncludesExternalBuild.cmake") -MESSAGE(STATUS "Found cmake subfolder.good.") - - -include(${ADM_CMAKE_DIR}/admCoreIncludesExternalBuild.cmake) -include(${ADM_CMAKE_DIR}/admConfigHelper.cmake) -######################################## -# Add include dirs -######################################## -SET(AVIDEMUX_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}") -MARK_AS_ADVANCED(AVIDEMUX_INSTALL_DIR) -include(admInstallDir) -######################################### -# Get regular stuff from main app -######################################### -LINK_DIRECTORIES("${AVIDEMUX_SEARCH_LIB_DIR}") -INCLUDE_DIRECTORIES(${AVIDEMUX_SEARCH_INCLUDE_DIR}/avidemux/${AVIDEMUX_VERSION}/) - -IF (FRESH_BUILD) - MESSAGE("") -ENDIF (FRESH_BUILD) - -######################################## -# Global options -######################################## -OPTION(VERBOSE "" OFF) - -################################################ -# Now really define our plugin... -############################################### - -include(dm_plugin) -SET(ADM_wtv_SRCS - ADM_wtvAudio.cpp - ADM_wtv.cpp - ADM_wtvPlugin.cpp -) - -ADD_DEMUXER(ADM_dm_wtv ${ADM_wtv_SRCS}) - -INIT_DEMUXER(ADM_dm_wtv) -INSTALL_DEMUXER(ADM_dm_wtv) +#################################################### +# +# +################################################### +MESSAGE("#####################################") +MESSAGE("Own plugin demuxer Started") +MESSAGE("#####################################") +MESSAGE("") + +SET(ADM_PROJECT AdmAsfDemuxer) +SET(PLUGINS TRUE) +SET(DO_COMMON TRUE) +SET(AVIDEMUX_VERSION 2.8) # important ! +SET(AVIDEMUX_EXTERNAL_BUILD True) # important ! +CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0 FATAL_ERROR) +###################################################### +# Try to locate & setup avidemux development files +###################################################### + +MESSAGE(STATUS "Checking for avidemux development files ..") + +SET(ADM_HEADER_DIR ${CMAKE_INSTALL_PREFIX}/include/avidemux/${AVIDEMUX_VERSION}) +SET(ADM_CMAKE_DIR ${ADM_HEADER_DIR}/cmake) + +# Common definitions... +SET(CMAKE_MODULE_PATH "${ADM_CMAKE_DIR}" "${CMAKE_MODULE_PATH}") +MESSAGE(STATUS "Checking for avidemux include folder (i.e. CMAKE_INSTALL_PREFIX/include/avidemux/${AVIDEMUX_VERSION}") +if(NOT EXISTS "${ADM_HEADER_DIR}") + MESSAGE(STATUS "Make sure you installed all the files.\n i cannot find avidemux include folder.cmake .\nSet CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") + MESSAGE(FATAL_ERROR "Aborting") +endif(NOT EXISTS "${ADM_HEADER_DIR}") + +MESSAGE(STATUS "Found avidemux include folder. good.") +MESSAGE(STATUS "Checking for cmake subfolder") + +if(NOT EXISTS "${ADM_CMAKE_DIR}/admCoreIncludesExternalBuild.cmake") + MESSAGE(STATUS "Make sure you installed all the files.\n I cannot find content of the cmake subfolder .\n") + MESSAGE(STATUS "Set CMAKE_INSTALL_PREFIX to the install folder, current value is ${CMAKE_INSTALL_PREFIX}") + MESSAGE(STATUS "I was looking for admCoreIncludesExternalBuild.cmake in ${ADM_CMAKE_DIR}") + MESSAGE(FATAL_ERROR "Aborting") +endif(NOT EXISTS "${ADM_CMAKE_DIR}/admCoreIncludesExternalBuild.cmake") +MESSAGE(STATUS "Found cmake subfolder.good.") + + +include(${ADM_CMAKE_DIR}/admCoreIncludesExternalBuild.cmake) +include(${ADM_CMAKE_DIR}/admConfigHelper.cmake) +######################################## +# Add include dirs +######################################## +SET(AVIDEMUX_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}") +MARK_AS_ADVANCED(AVIDEMUX_INSTALL_DIR) +include(admInstallDir) +######################################### +# Get regular stuff from main app +######################################### +LINK_DIRECTORIES("${AVIDEMUX_SEARCH_LIB_DIR}") +INCLUDE_DIRECTORIES(${AVIDEMUX_SEARCH_INCLUDE_DIR}/avidemux/${AVIDEMUX_VERSION}/) + +IF (FRESH_BUILD) + MESSAGE("") +ENDIF (FRESH_BUILD) + +######################################## +# Global options +######################################## +OPTION(VERBOSE "" OFF) + +################################################ +# Now really define our plugin... +############################################### + +include(dm_plugin) +SET(ADM_wtv_SRCS + ADM_wtvAudio.cpp + ADM_wtv.cpp + ADM_wtvPlugin.cpp +) + +ADD_DEMUXER(ADM_dm_wtv ${ADM_wtv_SRCS}) + +INIT_DEMUXER(ADM_dm_wtv) +INSTALL_DEMUXER(ADM_dm_wtv)