From 038cf29a83cabd64214c231a2129c7ea17151efc Mon Sep 17 00:00:00 2001 From: stax76 Date: Fri, 27 May 2016 15:20:35 +0200 Subject: [PATCH] - --- Encoding/NVIDIAEncoder.vb | 28 +++++--- Encoding/VideoEncoder.vb | 1 + Encoding/x264.vb | 2 +- Encoding/x265.vb | 38 +++++++--- Forms/AppsForm.vb | 18 +++-- Forms/MainForm.vb | 122 +++++++++++++++----------------- General/ApplicationSettings.vb | 2 +- General/Demux.vb | 2 +- General/Extensions.vb | 25 +++++++ General/General.vb | 6 +- General/GlobalCommands.vb | 2 +- General/Help.vb | 39 +++-------- General/Misc.vb | 2 +- General/Package.vb | 123 ++++++++++++++------------------- General/Project.vb | 48 +++++++++++-- General/Strings.vb | 2 +- General/VideoScript.vb | 59 +++++++--------- My Project/AssemblyInfo.vb | 2 +- UI/TaskDialog.vb | 2 +- md/test-build.md | 13 ++-- x265/param.cpp | 13 +++- x265/x265cli.h | 3 + 22 files changed, 304 insertions(+), 248 deletions(-) diff --git a/Encoding/NVIDIAEncoder.vb b/Encoding/NVIDIAEncoder.vb index 2c91eadb..565c51ce 100644 --- a/Encoding/NVIDIAEncoder.vb +++ b/Encoding/NVIDIAEncoder.vb @@ -115,8 +115,13 @@ Public Class NVIDIAEncoder Property Decoder As New OptionParam With { .Text = "Decoder:", - .Options = {"AviSynth/VapourSynth", "NVEncC (NVIDIA CUVID)", "QSVEncC (Intel)", "ffmpeg (Intel)", "ffmpeg (DXVA2)"}, - .Values = {"avs", "nv", "qs", "ffqsv", "ffdxva"}} + .Options = {"AviSynth/VapourSynth", + "NVEncC (avcuvid native)", + "NVEncC (avcuvid cuda)", + "QSVEncC (Intel)", + "ffmpeg (Intel)", + "ffmpeg (DXVA2)"}, + .Values = {"avs", "nvnative", "nvcuda", "qs", "ffqsv", "ffdxva"}} Property Mode As New OptionParam With { .Text = "Mode:", @@ -126,13 +131,13 @@ Public Class NVIDIAEncoder .ArgsFunc = Function() As String Select Case Mode.OptionText Case "CBR" - Return " --cbr " & p.VideoBitrate + Return "--cbr " & p.VideoBitrate Case "VBR" - Return " --vbr " & p.VideoBitrate + Return "--vbr " & p.VideoBitrate Case "VBR2" - Return " --vbr2 " & p.VideoBitrate + Return "--vbr2 " & p.VideoBitrate Case "CQP" - Return " --cqp " & QPI.Value & ":" & QPP.Value & ":" & QPB.Value + Return "--cqp " & QPI.Value & ":" & QPP.Value & ":" & QPB.Value End Select End Function} @@ -234,21 +239,22 @@ Public Class NVIDIAEncoder End Sub Overrides Function GetCommandLine(includePaths As Boolean, - includeExecutable As Boolean, + includeExe As Boolean, Optional pass As Integer = 1) As String Dim ret As String Dim sourcePath As String Dim targetPath = p.VideoEncoder.OutputPath.ChangeExt(p.VideoEncoder.OutputFileType) - If includePaths AndAlso includeExecutable Then - ret = Package.NVEncC.Path.Quotes - End If + If includePaths AndAlso includeExe Then ret = Package.NVEncC.Path.Quotes Select Case Decoder.ValueText Case "avs" sourcePath = p.Script.Path - Case "nv" + Case "nvnative" sourcePath = p.LastOriginalSourceFile + Case "nvcuda" + sourcePath = p.LastOriginalSourceFile + ret += " --avcuvid cuda" Case "qs" sourcePath = "-" If includePaths Then ret = If(includePaths, Package.QSVEncC.Path.Quotes, "QSVEncC") + " -o - -c raw" + " -i " + If(includePaths, p.SourceFile.Quotes, "path") + " | " + If(includePaths, Package.NVEncC.Path.Quotes, "NVEncC") diff --git a/Encoding/VideoEncoder.vb b/Encoding/VideoEncoder.vb index e6223230..da32e614 100644 --- a/Encoding/VideoEncoder.vb +++ b/Encoding/VideoEncoder.vb @@ -493,6 +493,7 @@ Class BatchEncoder End Function Overrides Sub Encode() + p.Script.Synchronize() Dim commands = Macro.Solve(CommandLines).Trim If commands.Contains("|") OrElse commands.Contains(BR) Then diff --git a/Encoding/x264.vb b/Encoding/x264.vb index 38e4124f..4118b824 100644 --- a/Encoding/x264.vb +++ b/Encoding/x264.vb @@ -125,7 +125,7 @@ Public Class x264Encoder g.MainForm.Assistant() Log.WriteLine("Quality: " & CInt(Calc.GetPercent).ToString() + " %") - Log.WriteLine("Compressibility: " + p.Compressibility.ToString("f3")) + Log.WriteLine("Compressibility: " + p.Compressibility.ToString("f3") + BR) Log.Save() ProcessForm.CloseProcessForm() diff --git a/Encoding/x265.vb b/Encoding/x265.vb index 7e0f5f6c..0a946060 100644 --- a/Encoding/x265.vb +++ b/Encoding/x265.vb @@ -98,15 +98,16 @@ Public Class x265Encoder code = "SelectRangeEvery(" + every + ",14)" Else code = "fpsnum = clip.fps_num" + BR + "fpsden = clip.fps_den" + BR + - "clip = core.std.SelectEvery(clip = clip, cycle = " + every + ", offsets = range(14))" + BR + - "clip = core.std.AssumeFPS(clip = clip, fpsnum = fpsnum, fpsden = fpsden)" + "clip = core.std.SelectEvery(clip = clip, cycle = " + every + ", offsets = range(14))" + BR + + "clip = core.std.AssumeFPS(clip = clip, fpsnum = fpsnum, fpsden = fpsden)" End If - Log.WriteLine(code + BR2) script.Filters.Add(New VideoFilter("aaa", "aaa", code)) script.Path = p.TempDir + p.Name + "_CompCheck." + script.FileType script.Synchronize() + Log.WriteLine(BR + script.GetFullScript + BR) + Dim commandLine = enc.Params.GetArgs(0, script, p.TempDir + p.Name + "_CompCheck." + OutputFileType, True, True) Try @@ -606,9 +607,9 @@ Public Class x265Params Property SlowFirstpass As New BoolParam With { .Switch = "--slow-firstpass", + .NoSwitch = "--no-slow-firstpass", .Text = "Slow Firstpass", - .Value = False, - .DefaultValue = False} + .InitValue = True} Property StrictCBR As New BoolParam With { .Switch = "--strict-cbr", @@ -762,6 +763,12 @@ Public Class x265Params .Text = "Write encoding results to a comma separated value log file", .ArgsFunc = Function() If(CSV.Value, "--csv """ + Filepath.GetDirAndBase(p.TargetFile) + ".csv""", Nothing)} + Property RecursionSkip As New BoolParam With { + .Switch = "--recursion-skip", + .NoSwitch = "--no-recursion-skip", + .Text = "Recursion Skip", + .InitValue = True} + Property csvloglevel As New OptionParam With { .Switch = "--csv-log-level", .Text = "CSV Log Level:", @@ -784,7 +791,8 @@ Public Class x265Params MinCuSize, MaxCuSize, MaxTuSize, LimitRefs, TUintra, TUinter, rdoqLevel) Add("Analysis 2", Rect, AMP, EarlySkip, FastIntra, BIntra, CUlossless, Tskip, TskipFast, LimitModes, RdRefine, - New BoolParam With {.Switch = "--cu-stats", .Text = "CU Stats"}) + New BoolParam With {.Switch = "--cu-stats", .Text = "CU Stats"}, + RecursionSkip) Add("Rate Control 1", AQmode, qgSize, AQStrength, QComp, CBQPoffs, QBlur, Cplxblur, CUtree, Lossless, StrictCBR, rcGrain) Add("Rate Control 2", New StringParam With {.Switch = "--zones", .Text = "Zones:"}, @@ -988,6 +996,7 @@ Public Class x265Params PsyRDOQ.Value = 1 QComp.Value = 0.6 LookaheadSlices.Value = 8 + RecursionSkip.Value = True Select Case Preset.Value Case 0 'ultrafast @@ -1216,11 +1225,14 @@ Public Class x265Params EarlySkip.Value = False FastIntra.Value = False LimitModes.Value = True + LookaheadSlices.Value = 4 MaxMerge.Value = 4 MErange.Value = 57 RCLookahead.Value = 40 RD.Value = 6 + rdoqLevel.Value = 2 Rect.Value = True + RecursionSkip.Value = False Ref.Value = 5 SAO.Value = True Scenecut.Value = 40 @@ -1230,8 +1242,6 @@ Public Class x265Params TUintra.Value = 3 Weightb.Value = True Weightp.Value = True - rdoqLevel.Value = 2 - LookaheadSlices.Value = 4 Case 9 'placebo [Me].Value = 3 AMP.Value = True @@ -1250,6 +1260,7 @@ Public Class x265Params RD.Value = 6 rdoqLevel.Value = 2 Rect.Value = True + RecursionSkip.Value = False Ref.Value = 5 SAO.Value = True Scenecut.Value = 40 @@ -1276,6 +1287,7 @@ Public Class x265Params PsyRDOQ.DefaultValue = 1 QComp.DefaultValue = 0.6 LookaheadSlices.DefaultValue = 8 + RecursionSkip.DefaultValue = True Select Case Preset.Value Case 0 'ultrafast @@ -1511,6 +1523,7 @@ Public Class x265Params RD.DefaultValue = 6 rdoqLevel.DefaultValue = 2 Rect.DefaultValue = True + RecursionSkip.DefaultValue = False Ref.DefaultValue = 5 SAO.DefaultValue = True Scenecut.DefaultValue = 40 @@ -1538,6 +1551,7 @@ Public Class x265Params RD.DefaultValue = 6 rdoqLevel.DefaultValue = 2 Rect.DefaultValue = True + RecursionSkip.DefaultValue = False Ref.DefaultValue = 5 SAO.DefaultValue = True Scenecut.DefaultValue = 40 @@ -1567,6 +1581,10 @@ Public Class x265Params AQmode.Value = 0 qpstep.Value = 1 rcGrain.Value = True + RecursionSkip.Value = False + PsyRD.Value = 4 + PsyRDOQ.Value = 10 + SAO.Value = False Case 4 '"fastdecode" Deblock.Value = False SAO.Value = False @@ -1600,6 +1618,10 @@ Public Class x265Params AQmode.DefaultValue = 0 qpstep.DefaultValue = 1 rcGrain.DefaultValue = True + RecursionSkip.DefaultValue = False + PsyRD.DefaultValue = 4 + PsyRDOQ.DefaultValue = 10 + SAO.DefaultValue = False Case 4 '"fastdecode" Deblock.DefaultValue = False SAO.DefaultValue = False diff --git a/Forms/AppsForm.vb b/Forms/AppsForm.vb index 14061749..353b3329 100644 --- a/Forms/AppsForm.vb +++ b/Forms/AppsForm.vb @@ -369,17 +369,25 @@ Class AppsForm ActivePackage.Version = input ActivePackage.VersionDate = File.GetLastWriteTimeUtc(ActivePackage.Path) - Dim textContent As String + Dim txt = Application.ProductVersion + BR2 For Each i In Package.Items.Values If i.Version <> "" Then - textContent += i.ID + " = " + i.Version + "; " + - i.VersionDate.ToString("yyyy-MM-dd", - CultureInfo.InvariantCulture) + BR 'persian calendar + txt += i.ID + " = " + i.VersionDate.ToString("yyyy-MM-dd", + CultureInfo.InvariantCulture) + "; " + i.Version + BR 'persian calendar End If Next - File.WriteAllText(CommonDirs.Startup + "Apps\Versions.txt", textContent.FormatColumn("=")) + Try + txt.FormatColumn("=").WriteUTF8File(CommonDirs.Startup + "Apps\Versions.txt") + Catch + End Try + + Try + txt.FormatColumn("=").WriteUTF8File(Paths.SettingsDir + "Versions.txt") + Catch ex As Exception + g.ShowException(ex) + End Try End If End Select diff --git a/Forms/MainForm.vb b/Forms/MainForm.vb index bb371cff..936c4076 100644 --- a/Forms/MainForm.vb +++ b/Forms/MainForm.vb @@ -8,7 +8,6 @@ Imports System.Text.RegularExpressions Imports System.Threading.Tasks Imports Microsoft.Win32 Imports StaxRip.UI -Imports SWF = System.Windows.Forms Imports VB6 = Microsoft.VisualBasic Public Class MainForm @@ -1027,8 +1026,8 @@ Public Class MainForm End Sub Function IsSaveCanceled() As Boolean - 'ObjectHelp.GetCompareString(g.SavedProject).WriteFile(CommonDirs.UserDesktop + "test1.txt") - 'ObjectHelp.GetCompareString(p).WriteFile(CommonDirs.UserDesktop + "test2.txt") + 'ObjectHelp.GetCompareString(g.SavedProject).WriteFile(Environment.GetFolderPath(SpecialFolder.DesktopDirectory) + "\test1.txt", Encoding.ASCII) + 'ObjectHelp.GetCompareString(p).WriteFile(Environment.GetFolderPath(SpecialFolder.DesktopDirectory) + "\test2.txt", Encoding.ASCII) If ObjectHelp.GetCompareString(g.SavedProject) <> ObjectHelp.GetCompareString(p) Then Using td As New TaskDialog(Of DialogResult) @@ -1231,7 +1230,7 @@ Public Class MainForm End Sub Function OpenSaveDialog() As Boolean - Using d As New SWF.SaveFileDialog + Using d As New SaveFileDialog d.SetInitDir(p.TempDir) If p.SourceFile <> "" Then @@ -1257,11 +1256,35 @@ Public Class MainForm Return OpenProject(path, True) End Function + Sub SetBindings(proj As Project, add As Boolean) + SetTextBoxBinding(tbTargetFile, proj, NameOf(Project.TargetFile), add) + + If add Then + AddHandler proj.PropertyChanged, AddressOf ProjectPropertyChanged + Else + RemoveHandler proj.PropertyChanged, AddressOf ProjectPropertyChanged + End If + End Sub + + Sub ProjectPropertyChanged(sender As Object, e As PropertyChangedEventArgs) + Assistant() + End Sub + + Sub SetTextBoxBinding(tb As TextBox, obj As Object, prop As String, add As Boolean) + If add Then + tbTargetFile.DataBindings.Add(New Binding(NameOf(TextBox.Text), obj, prop, False, DataSourceUpdateMode.OnPropertyChanged)) + Else + tbTargetFile.DataBindings.Clear() + End If + End Sub + Function OpenProject(path As String, saveCurrent As Boolean) As Boolean If Not IsLoading AndAlso saveCurrent AndAlso IsSaveCanceled() Then Return False End If + SetBindings(p, False) + If Not File.Exists(path) Then path = Paths.StartupTemplatePath Dim safeInstance = New Project @@ -1271,9 +1294,12 @@ Public Class MainForm p = DirectCast(SafeSerialization.Deserialize(safeInstance, path, New LegacySerializationBinder), Project) Catch ex As Exception g.ShowException(ex) - Exit Function + p = New Project + p.Init() End Try + SetBindings(p, True) + Text = Application.ProductName + " x64 - " + Filepath.GetBase(path) SkipAssistant = True @@ -1325,7 +1351,6 @@ Public Class MainForm tbTargetWidth.Text = width.ToString tbTargetHeight.Text = height.ToString - tbTargetFile.Text = targetPath SetSavedProject() @@ -1388,7 +1413,7 @@ Public Class MainForm Dim td As New TaskDialog(Of String) td.MainInstruction = "Choose a preferred source filter" - td.Content = "A description of the available source filters can be found [https://stax76.gitbooks.io/staxrip-handbook/content/avisynth+vapoursynth.html here]." + td.Content = "A description of the available source filters can be found in the [https://stax76.gitbooks.io/staxrip-handbook/content/ online documentation]." td.AddCommandLink("Automatic AviSynth+", "avs") td.AddCommandLink("Automatic VapourSynth", "vs") @@ -1490,6 +1515,7 @@ Public Class MainForm Dim recoverText = Text SafeSerialization.Serialize(p, recoverProjectPath) + AddHandler g.MainForm.Disposed, Sub() FileHelp.Delete(recoverProjectPath) Try @@ -2949,7 +2975,7 @@ Public Class MainForm Sub ShowFileBrowserToOpenProject() - Using d As New SWF.OpenFileDialog + Using d As New OpenFileDialog d.Filter = "Project Files|*.srip" If d.ShowDialog() = DialogResult.OK Then @@ -3569,9 +3595,9 @@ Public Class MainForm Using form As New SimpleSettingsForm( "Project Options", "In order to save project options go to:", - "Main Menu > Project > Save As Template", + "Project > Save As Template", "In order to choose a template to be loaded on program startup go to:", - "Main Menu > Tools > Settings > General > Templates > Default Template") + "Tools > Settings > General > Templates > Default Template") Dim ui = form.SimpleUI @@ -4293,7 +4319,7 @@ Public Class MainForm Sub ShowHardcodedSubtitleDialog() - Using d As New SWF.OpenFileDialog + Using d As New OpenFileDialog d.SetFilter(FileTypes.SubtitleIncludingContainers) d.SetInitDir(s.LastSourceDir) @@ -5014,7 +5040,7 @@ Public Class MainForm End Sub Sub tbSource_DoubleClick() Handles tbSourceFile.DoubleClick - Using d As New SWF.OpenFileDialog + Using d As New OpenFileDialog d.SetFilter(FileTypes.Video) d.Multiselect = True d.SetInitDir(s.LastSourceDir) @@ -5090,15 +5116,11 @@ Public Class MainForm sb.AddItem(i) Next - If sb.Show = DialogResult.OK Then - Return sb.SelectedItem - End If - - Return Nothing + If sb.Show = DialogResult.OK Then Return sb.SelectedItem End Function Sub tbAudioFile0_DoubleClick() Handles tbAudioFile0.DoubleClick - Using d As New SWF.OpenFileDialog + Using d As New OpenFileDialog Dim filter = FileTypes.Audio.ToList filter.Insert(0, "avs") d.SetFilter(filter) @@ -5108,7 +5130,7 @@ Public Class MainForm End Sub Sub tbAudioFile1_DoubleClick() Handles tbAudioFile1.DoubleClick - Using d As New SWF.OpenFileDialog + Using d As New OpenFileDialog Dim filter = FileTypes.Audio.ToList filter.Insert(0, "avs") d.SetFilter(filter) @@ -5239,46 +5261,6 @@ Public Class MainForm If g.IsValidSource(False) Then UpdateTargetParameters(p.Script.GetSeconds, p.Script.GetFramerate) End Sub - Private Sub tbTargetFile_Validating(sender As Object, e As CancelEventArgs) Handles tbTargetFile.Validating - Assistant() 'script path is based on target path - End Sub - - Sub tbTargetPath_TextChanged() Handles tbTargetFile.TextChanged - If tbTargetFile.Text <> "" AndAlso Not Filepath.IsValidFileSystemName( - Filepath.GetName(tbTargetFile.Text)) Then - - MsgWarn("Filename contains invalid characters.") - tbTargetFile.Text = p.TargetFile - End If - - If tbTargetFile.Text.ContainsUnicode AndAlso p.Script.Engine = ScriptEngine.AviSynth Then - MsgWarn(Strings.NoUnicode) - tbTargetFile.Text = p.TargetFile - End If - - p.Name = tbTargetFile.Text.Base - p.TargetFile = tbTargetFile.Text - End Sub - - Sub tbTargetPath_DoubleClick() Handles tbTargetFile.DoubleClick - Using d As New SWF.SaveFileDialog - d.FileName = Filepath.GetBase(p.TargetFile) - d.SetInitDir(Filepath.GetDir(p.TargetFile)) - - If d.ShowDialog() = DialogResult.OK Then - Dim ext = p.VideoEncoder.Muxer.GetExtension - - If d.FileName.ToLower.EndsWith(ext) Then - tbTargetFile.Text = d.FileName - Else - tbTargetFile.Text = d.FileName + ext - End If - - Assistant() - End If - End Using - End Sub - Private Sub AviSynthListView_DoubleClick() Handles AviSynthListView.DoubleClick AviSynthListView.ShowEditor() End Sub @@ -5480,16 +5462,24 @@ Public Class MainForm End If End Sub + Sub tbTargetFile_DoubleClick() Handles tbTargetFile.DoubleClick + Using d As New SaveFileDialog + d.FileName = p.TargetFile.Base + d.SetInitDir(p.TargetFile.Dir) + + If d.ShowDialog() = DialogResult.OK Then + Dim ext = p.VideoEncoder.Muxer.GetExtension + p.TargetFile = If(d.FileName.Ext = ext, d.FileName, d.FileName + ext) + End If + End Using + End Sub + Private Sub tbTargetFile_MouseDown(sender As Object, e As MouseEventArgs) Handles tbTargetFile.MouseDown - If e.Button = MouseButtons.Right Then - UpdateTargetFileMenu() - End If + If e.Button = MouseButtons.Right Then UpdateTargetFileMenu() End Sub Private Sub tbSourceFile_MouseDown(sender As Object, e As MouseEventArgs) Handles tbSourceFile.MouseDown - If e.Button = MouseButtons.Right Then - UpdateSourceFileMenu() - End If + If e.Button = MouseButtons.Right Then UpdateSourceFileMenu() End Sub Private Sub tbAudioFile0_MouseDown(sender As Object, e As MouseEventArgs) Handles tbAudioFile0.MouseDown @@ -5577,7 +5567,7 @@ Public Class MainForm Sub UpdateTargetFileMenu() TargetFileMenu.Items.Clear() - TargetFileMenu.Items.Add(New ActionMenuItem("Edit...", AddressOf tbTargetPath_DoubleClick, "Change the path of the target file.")) + TargetFileMenu.Items.Add(New ActionMenuItem("Edit...", AddressOf tbTargetFile_DoubleClick, "Change the path of the target file.")) TargetFileMenu.Items.Add(New ActionMenuItem("Play...", Sub() g.Play(p.TargetFile), "Play the target file.", File.Exists(p.TargetFile))) TargetFileMenu.Items.Add(New ActionMenuItem("MediaInfo...", Sub() g.DefaultCommands.ShowMediaInfo(p.TargetFile), "Show MediaInfo for the target file.", File.Exists(p.TargetFile))) TargetFileMenu.Items.Add(New ActionMenuItem("Explore...", Sub() g.OpenDirAndSelectFile(p.TargetFile, Handle), "Open the target file directory with File Explorer.", Directory.Exists(Filepath.GetDir(p.TargetFile)))) diff --git a/General/ApplicationSettings.vb b/General/ApplicationSettings.vb index eadd2452..67a7ec28 100644 --- a/General/ApplicationSettings.vb +++ b/General/ApplicationSettings.vb @@ -73,7 +73,7 @@ Public Class ApplicationSettings If Versions Is Nothing Then Versions = New Dictionary(Of String, Integer) If Check(Storage, "Misc", 2) Then Storage = New ObjectStorage - If Check(VideoEncoderProfiles, "Video Encoder Profiles", 189) Then + If Check(VideoEncoderProfiles, "Video Encoder Profiles", 190) Then If VideoEncoderProfiles Is Nothing Then VideoEncoderProfiles = VideoEncoder.GetDefaults() Else diff --git a/General/Demux.vb b/General/Demux.vb index c8cfeb46..b79021e1 100644 --- a/General/Demux.vb +++ b/General/Demux.vb @@ -231,7 +231,7 @@ Class MP4BoxDemuxer args += i.ID & " -out """ + outpath + """ """ + p.SourceFile + """" Using proc As New Proc - proc.Init("Demux subtitle using MP4Box " + Package.MP4Box.Version, {"Media Export: |", "File Export: |", "ISO File Writing: |", "VobSub Export: |"}) + proc.Init("Demux subtitle using MP4Box " + Package.MP4Box.Version, {"Media Export: |", "File Export: |", "ISO File Writing: |", "VobSub Export: |", "SRT Extract: |"}) proc.File = Package.MP4Box.Path proc.Arguments = args proc.Process.StartInfo.EnvironmentVariables("TEMP") = p.TempDir diff --git a/General/Extensions.vb b/General/Extensions.vb index d4264899..8f404276 100644 --- a/General/Extensions.vb +++ b/General/Extensions.vb @@ -19,6 +19,19 @@ Module StringExtensions Return sb.ToString() End Function + + Function IsValidFileName(instance As String) As Boolean + If instance = "" Then Return False + Dim chars = """*/:<>?\|" + + For Each i In instance + If chars.Contains(i) Then Return False + If Convert.ToInt32(i) < 32 Then Return False + Next + + Return True + End Function + Function FileName(instance As String) As String If instance = "" Then Return "" @@ -62,6 +75,11 @@ Module StringExtensions Return Filepath.GetBase(instance) End Function + + Function Dir(instance As String) As String + Return Filepath.GetDir(instance) + End Function + Function ContainsAll(instance As String, all As IEnumerable(Of String)) As Boolean If instance <> "" Then Return all.All(Function(arg) instance.Contains(arg)) @@ -99,6 +117,8 @@ Module StringExtensions Function ContainsUnicode(value As String) As Boolean + If value = "" Then Return False + For Each i In value If Convert.ToInt32(i) > 255 Then Return True Next @@ -218,6 +238,11 @@ Module StringExtensions WriteFile(instance, path, Encoding.Default) End Sub + + Sub WriteUTF8File(instance As String, path As String) + WriteFile(instance, path, Encoding.UTF8) + End Sub + Sub WriteFile(value As String, path As String, encoding As Encoding) Try diff --git a/General/General.vb b/General/General.vb index 86a8ac07..d6aa12a2 100644 --- a/General/General.vb +++ b/General/General.vb @@ -392,11 +392,7 @@ Class SafeSerialization Private Shared Function GetObjectInstance(ba As Byte(), binder As SerializationBinder) As Object Using ms As New MemoryStream(ba) Dim bf As New BinaryFormatter - - If Not binder Is Nothing Then - bf.Binder = binder - End If - + If Not binder Is Nothing Then bf.Binder = binder Return bf.Deserialize(ms) End Using End Function diff --git a/General/GlobalCommands.vb b/General/GlobalCommands.vb index d35a2836..9881cfac 100644 --- a/General/GlobalCommands.vb +++ b/General/GlobalCommands.vb @@ -223,7 +223,7 @@ Public Class GlobalCommands Dim nvexcept = "--help --version --check-device --check-avversion --check-codecs --check-encoders --check-decoders --check-formats --check-protocols ---check-filters --device --input --output --raw --avs --vpy --vpy-mt --avcuvid --avcuvid-analyze +--check-filters --device --input --output --raw --avs --vpy --vpy-mt --avcuvid-analyze --audio-source --audio-file --seek --format --audio-copy --audio-copy --audio-codec --audio-bitrate --audio-ignore --audio-ignore --audio-samplerate --audio-resampler --audio-stream --audio-stream --audio-stream --audio-stream --audio-filter --chapter-copy --chapter --sub-copy diff --git a/General/Help.vb b/General/Help.vb index 769fd91a..6caa5c2e 100644 --- a/General/Help.vb +++ b/General/Help.vb @@ -17,7 +17,7 @@ Class ObjectHelp Shared Sub ParseCompareString(obj As Object, declaringObj As Object, sb As StringBuilder) If TypeOf obj Is ICollection Then - For Each i As Object In DirectCast(obj, ICollection) + For Each i In DirectCast(obj, ICollection) If IsGoodType(i) Then If IsToString(i) Then sb.Append(i.ToString) @@ -55,38 +55,21 @@ Class ObjectHelp End Sub Private Shared Function IsGoodType(o As Object) As Boolean - If o Is Nothing Then - Return False - End If - - If TypeOf o Is Pointer Then - Return False - End If - - If Not o.GetType.IsSerializable Then - Return False - End If - + If o Is Nothing Then Return False + If TypeOf o Is Pointer Then Return False + If TypeOf o Is PropertyChangedEventHandler Then Return False + If Not o.GetType.IsSerializable Then Return False Return True End Function Private Shared Function IsToString(o As Object) As Boolean If Not o Is Nothing Then - If o.GetType.IsPrimitive Then - Return True - End If - - If TypeOf o Is String Then - Return True - End If - - If TypeOf o Is CultureInfo Then 'some fields change here - Return True - End If - - If TypeOf o Is StringBuilder Then 'some fields change here - Return True - End If + If o.GetType.IsPrimitive Then Return True + If TypeOf o Is String Then Return True + 'some fields change here + If TypeOf o Is CultureInfo Then Return True + 'some fields change here + If TypeOf o Is StringBuilder Then Return True End If End Function diff --git a/General/Misc.vb b/General/Misc.vb index b10a6fd9..363dc8c0 100644 --- a/General/Misc.vb +++ b/General/Misc.vb @@ -723,7 +723,7 @@ Public Class GlobalClass If TypeOf e Is ErrorAbortException Then td.MainInstruction = DirectCast(e, ErrorAbortException).Title Else - td.MainInstruction = "Exception" + td.MainInstruction = e.GetType.Name End If Else td.MainInstruction = msg diff --git a/General/Package.vb b/General/Package.vb index 5e176067..d2c05dff 100644 --- a/General/Package.vb +++ b/General/Package.vb @@ -29,12 +29,10 @@ Public Class Package Shared Property DGIndexNV As New DGIndexNVPackage Shared Property DivX265 As New DivX265Package Shared Property dsmux As New dsmuxPackage - Shared Property DSS2mod As New DSS2modPackage Shared Property eac3to As New eac3toPackage Shared Property ffmpeg As New ffmpegPackage Shared Property Haali As New HaaliSplitter Shared Property Java As New JavaPackage - Shared Property lsmashWorks As New LSmashWorksAviSynthPackage Shared Property MediaInfo As New MediaInfoPackage Shared Property MP4Box As New MP4BoxPackage Shared Property MPC As New MPCPackage @@ -56,7 +54,6 @@ Public Class Package Shared Property Python As New PythonPackage Shared Property scenechange As New scenechangePackage Shared Property temporalsoften As New temporalsoftenPackage - Shared Property LSmashWorksVapourSynth As New vslsmashsourcePackage Shared Property x265 As New Package With { .Name = "x265", @@ -154,9 +151,11 @@ Public Class Package .Filename = "ffms2.dll", .WebURL = "https://github.com/FFMS/ffms2", .Description = "AviSynth+ and VapourSynth source filter supporting various input formats.", + .HelpFile = "ffms2-avisynth.html", .AviSynthFilterNames = {"FFVideoSource", "FFAudioSource"}, + .AviSynthFiltersFunc = Function() {New VideoFilter("Source", "FFVideoSource", "FFVideoSource(""%source_file%"", cachefile = ""%temp_file%.ffindex"")")}, .VapourSynthFilterNames = {"ffms2"}, - .HelpFile = "ffms2-avisynth.html"} + .VapourSynthFiltersFunc = Function() {New VideoFilter("Source", "ffms2", "clip = core.ffms2.Source(r""%source_file%"", cachefile = r""%temp_file%.ffindex"")")}} Shared Sub Add(pack As Package) Items(pack.ID) = pack @@ -164,7 +163,6 @@ Public Class Package Shared Sub New() Add(VCEEncC) - Add(LSmashWorksVapourSynth) Add(temporalsoften) Add(scenechange) Add(Python) @@ -183,12 +181,10 @@ Public Class Package Add(DGIndexNV) Add(DivX265) Add(dsmux) - Add(DSS2mod) Add(eac3to) Add(ffmpeg) Add(Haali) Add(Java) - Add(lsmashWorks) Add(MediaInfo) Add(mkvmerge) Add(mkvextract) @@ -270,6 +266,17 @@ Public Class Package #Region "VapourSynth" + Add(New PluginPackage With { + .Name = "vslsmashsource", + .Filename = "vslsmashsource.dll", + .Description = "VapourSynth source filter based on Libav supporting a wide range of input formats.", + .HelpFile = "README.txt", + .WebURL = "http://avisynth.nl/index.php/LSMASHSource", + .VapourSynthFilterNames = {"lsmas.LibavSMASHSource", "lsmas.LWLibavSource"}, + .VapourSynthFiltersFunc = Function() { + New VideoFilter("Source", "LibavSMASHSource", "clip = core.lsmas.LibavSMASHSource(r""%source_file%"")"), + New VideoFilter("Source", "LWLibavSource", "clip = core.lsmas.LWLibavSource(r""%source_file%"")")}}) + Add(New PluginPackage With { .Name = "nnedi3", .Filename = "libnnedi3.dll", @@ -330,10 +337,10 @@ Public Class Package Add(New PluginPackage With { .Name = "d2vsource", .Filename = "d2vsource.dll", - .VapourSynthFilterNames = {"d2v.Source"}, .Description = "D2V parser and decoder for VapourSynth.", .WebURL = "https://github.com/dwbuiten/d2vsource", .HelpURL = "https://github.com/dwbuiten/d2vsource", + .VapourSynthFilterNames = {"d2v.Source"}, .VapourSynthFiltersFunc = Function() { New VideoFilter("Source", "d2vsource", "clip = core.d2v.Source(r""%source_file%"")")}}) @@ -378,6 +385,25 @@ Public Class Package #Region "AviSynth" + Add(New PluginPackage With { + .Name = "DSS2mod", + .Filename = "DSS2.dll", + .WebURL = "http://code.google.com/p/xvid4psp/downloads/detail?name=DSS2%20mod%20%2B%20LAVFilters.7z&can=2&q=", + .Description = "Direct Show source filter", + .AviSynthFilterNames = {"DSS2"}, + .AviSynthFiltersFunc = Function() {New VideoFilter("Source", "DSS2", "DSS2(""%source_file%"")")}}) + + Add(New PluginPackage With { + .Name = "L-SMASH-Works", + .Filename = "LSMASHSource.dll", + .WebURL = "http://avisynth.nl/index.php/LSMASHSource", + .Description = "AviSynth and VapourSynth source filter based on Libav supporting a wide range of input formats.", + .HelpFile = "README.txt", + .AviSynthFilterNames = {"LSMASHVideoSource", "LSMASHAudioSource", "LWLibavVideoSource", "LWLibavAudioSource"}, + .AviSynthFiltersFunc = Function() { + New VideoFilter("Source", "LSMASHVideoSource", "LSMASHVideoSource(""%source_file%"", format = ""YUV420P8"")"), + New VideoFilter("Source", "LWLibavVideoSource", "LWLibavVideoSource(""%source_file%"", format = ""YUV420P8"")")}}) + Add(New PluginPackage With { .Name = "MSharpen", .Filename = "msharpen.dll", @@ -482,23 +508,30 @@ Public Class Package #End Region - Dim fp = CommonDirs.Startup + "Apps\Versions.txt" + Dim fp = Paths.SettingsDir + "Versions.txt" - If File.Exists(fp) Then - For Each i In File.ReadAllLines(CommonDirs.Startup + "Apps\Versions.txt") - For Each i2 In Items.Values - If i Like "*=*;*" Then - Dim name = i.Left("=").Trim + Try + If Not File.Exists(fp) OrElse Not File.ReadAllText(fp).Contains(Application.ProductVersion + BR2) Then + FileHelp.Delete(fp) + fp = CommonDirs.Startup + "Apps\Versions.txt" + End If - If name = i2.ID Then - i2.Version = i.Right("=").Left(";").Trim - Dim a = i.Right("=").Right(";").Trim.Split("-"c) - i2.VersionDate = New DateTime(CInt(a(0)), CInt(a(1)), CInt(a(2))) + For Each line In File.ReadAllLines(fp) + For Each pack In Items.Values + If line Like "*=*;*" Then + Dim name = line.Left("=").Trim + + If name = pack.ID Then + pack.Version = line.Right("=").Right(";").Trim + Dim a = line.Right("=").Left(";").Trim.Split("-"c) + pack.VersionDate = New DateTime(CInt(a(0)), CInt(a(1)), CInt(a(2))) End If End If Next Next - End If + Catch ex As Exception + g.ShowException(ex) + End Try End Sub ReadOnly Property ID As String @@ -1047,46 +1080,6 @@ Public Class eac3toPackage End Sub End Class -Public Class LSmashWorksAviSynthPackage - Inherits PluginPackage - - Sub New() - Name = "L-SMASH-Works" - Filename = "LSMASHSource.dll" - WebURL = "http://avisynth.nl/index.php/LSMASHSource" - Description = "AviSynth and VapourSynth source filter based on Libav supporting a wide range of input formats." - HelpFile = "README.txt" - AviSynthFilterNames = {"LSMASHVideoSource", "LSMASHAudioSource", "LWLibavVideoSource", "LWLibavAudioSource"} - End Sub - - Overrides ReadOnly Property IsRequired As Boolean - Get - Return p.Script.GetFilter("Source").Script.Contains("LSMASHVideoSource") OrElse - p.Script.GetFilter("Source").Script.Contains("LWLibavVideoSource") - End Get - End Property -End Class - -Public Class vslsmashsourcePackage - Inherits PluginPackage - - Sub New() - Name = "vslsmashsource" - Filename = "vslsmashsource.dll" - Description = "VapourSynth source filter based on Libav supporting a wide range of input formats." - VapourSynthFilterNames = {"lsmas.LibavSMASHSource", "lsmas.LWLibavSource"} - HelpFile = "README.txt" - WebURL = "http://avisynth.nl/index.php/LSMASHSource" - End Sub - - Overrides ReadOnly Property IsRequired As Boolean - Get - Return p.Script.GetFilter("Source").Script.Contains("lsmas.LibavSMASHSource") OrElse - p.Script.GetFilter("Source").Script.Contains("lsmas.LWLibavSource") - End Get - End Property -End Class - Public Class qaacPackage Inherits Package @@ -1140,18 +1133,6 @@ Public Class SangNom2Package End Sub End Class -Public Class DSS2modPackage - Inherits PluginPackage - - Sub New() - Name = "DSS2mod" - Filename = "DSS2.dll" - WebURL = "http://code.google.com/p/xvid4psp/downloads/detail?name=DSS2%20mod%20%2B%20LAVFilters.7z&can=2&q=" - Description = "Direct Show source filter" - AviSynthFilterNames = {"DSS2"} - End Sub -End Class - Public Class vinversePackage Inherits PluginPackage diff --git a/General/Project.vb b/General/Project.vb index 7cf5d21c..ccedfeb2 100644 --- a/General/Project.vb +++ b/General/Project.vb @@ -1,9 +1,14 @@ +Imports System.ComponentModel Imports System.Globalization +Imports System.Runtime.CompilerServices Imports System.Text Public Class Project - Implements ISafeSerialization + Implements ISafeSerialization, INotifyPropertyChanged + + + Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged Private Storage As ObjectStorage @@ -46,7 +51,6 @@ Public Class Project Public LastOriginalSourceFile As String Public Log As StringBuilder Public MaxAspectRatioError As Integer = 2 - Public Name As String Public NoDialogs As Boolean Public PreferredAudio As String Public PreferredSubtitles As String @@ -75,7 +79,6 @@ Public Class Project Public SourceSeconds As Integer Public SourceSize As Long Public SourceWidth As Integer = 720 - Public TargetFile As String Public TargetFrameRate As Double Public TargetHeight As Integer = 576 Public TargetSeconds As Integer = 5400 @@ -107,9 +110,8 @@ Public Class Project If Log Is Nothing Then Log = New StringBuilder If Storage Is Nothing Then Storage = New ObjectStorage If Ranges Is Nothing Then Ranges = New List(Of Range) - If TargetFile Is Nothing Then TargetFile = "" - If Name Is Nothing Then Name = "" If SourceFile Is Nothing Then SourceFile = "" + If TargetFile Is Nothing Then TargetFile = "" If Check(PreferredSubtitles, "Automatically Included Subtitles", 2) Then If Language.CurrentCulture.TwoLetterCode = "en" Then @@ -205,4 +207,40 @@ Public Class Project Return ret End Function + + Private Sub NotifyPropertyChanged( + Optional ByVal propertyName As String = Nothing) + + RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName)) + End Sub + + Private TargetFileValue As String + + Public Property TargetFile As String + Get + Return TargetFileValue + End Get + Set(ByVal value As String) + If value <> TargetFileValue Then + If value <> "" AndAlso Not value.FileName.IsValidFileName Then + MsgWarn("Filename contains invalid characters.") + Exit Property + End If + + If value.ContainsUnicode AndAlso Script.Engine = ScriptEngine.AviSynth Then + MsgWarn(Strings.NoUnicode) + Exit Property + End If + + TargetFileValue = value + NotifyPropertyChanged() + End If + End Set + End Property + + ReadOnly Property Name As String + Get + Return TargetFile.Base + End Get + End Property End Class \ No newline at end of file diff --git a/General/Strings.vb b/General/Strings.vb index 659f39a4..ccd99ad7 100644 --- a/General/Strings.vb +++ b/General/Strings.vb @@ -6,7 +6,7 @@ Friend Class Strings Public Shared TaskDialogFooter As String = "[copymsg: Copy Message]" Public Shared ParRegexPattern As String = "^([1-9]+\d*)(/|:)([1-9]+\d*)$" Public Shared VisitForum As String = "Please copy the message and post it to the support forum or mail it." - Public Shared NoUnicode As String = $"Unicode filenames are not supported by AviSynth.{BR2}VapourSynth supports unicode.{BR2}Filters > Filters Setup > VaourSynth" + Public Shared NoUnicode As String = $"Unicode filenames are not supported by AviSynth.{BR2}VapourSynth supports unicode, it can be enabled at:{BR2}Filters > Filter Setup > VapourSynth" Public Shared ProjectX As String = "ProjectX demuxes MPEG-2 DVD and DVB sources, H.264/AVC and H.265/HEVC are not supported. ProjectX can be enabled or disabled in the settings on the Demuxing tab." Public Shared dsmux As String = "dsmux is installed by the Haali Splitter and is used to mux TS containing AVC into MKV in order to fix av sync problems, dsmux handles av sync much better then many other TS tools. dsmux can be enabled or disabled in the settings on the Demuxing tab, if no audio is present or DGDecNV/DGDecIM is used, dsmux is not necessary and skipped automatically. LAV Filters and Haali Splitter overrite each other, most people prefer LAV Filters, therefore it's recommended to install Haali first and LAV Filters last." Public Shared Muxer As String = "A muxer merges different video, audio and subtitle files into a single container file which is the actual output file. Using x264 or subtitles MKV or MP4 is required as container." diff --git a/General/VideoScript.vb b/General/VideoScript.vb index 1460f416..858f4b80 100644 --- a/General/VideoScript.vb +++ b/General/VideoScript.vb @@ -10,8 +10,6 @@ Public Class VideoScript Private Size As Size Private ErrorMessage As String - Public LastSync As String - Property Filters As New List(Of VideoFilter) Overridable Property Engine As ScriptEngine = ScriptEngine.AviSynth @@ -147,44 +145,45 @@ Public Class VideoScript Next End Function - Sub Synchronize(Optional convertToRGB As Boolean = False) + Public LastCode As String + Public LastPath As String + + Sub Synchronize(Optional convertToRGB As Boolean = False, + Optional comparePath As Boolean = True) + If Path <> "" Then - Dim script = Macro.Solve(GetScript()) + Dim code = Macro.Solve(GetScript()) If convertToRGB Then If Engine = ScriptEngine.AviSynth Then If p.SourceHeight > 576 Then - script += BR + "ConvertToRGB(matrix=""Rec709"")" + code += BR + "ConvertToRGB(matrix=""Rec709"")" Else - script += BR + "ConvertToRGB(matrix=""Rec601"")" + code += BR + "ConvertToRGB(matrix=""Rec601"")" End If Else If p.SourceHeight > 576 Then - If script.Contains(".set_output()") Then - script = script.Replace(".set_output()", ".resize.Bicubic(matrix_in_s = '709', format = vs.COMPATBGR32).set_output()") + If code.Contains(".set_output()") Then + code = code.Replace(".set_output()", ".resize.Bicubic(matrix_in_s = '709', format = vs.COMPATBGR32).set_output()") Else - script += BR + "clip = clip.resize.Bicubic(matrix_in_s = '709', format = vs.COMPATBGR32)" + code += BR + "clip = clip.resize.Bicubic(matrix_in_s = '709', format = vs.COMPATBGR32)" End If Else - If script.Contains(".set_output()") Then - script = script.Replace(".set_output()", ".resize.Bicubic(matrix_in_s = '470bg', format = vs.COMPATBGR32).set_output()") + If code.Contains(".set_output()") Then + code = code.Replace(".set_output()", ".resize.Bicubic(matrix_in_s = '470bg', format = vs.COMPATBGR32).set_output()") Else - script += BR + "clip = clip.resize.Bicubic(matrix_in_s = '470bg', format = vs.COMPATBGR32)" + code += BR + "clip = clip.resize.Bicubic(matrix_in_s = '470bg', format = vs.COMPATBGR32)" End If End If End If End If - Dim current = Path + script - - If Frames = 240 OrElse current <> LastSync Then + If Frames = 240 OrElse code <> LastCode OrElse (comparePath AndAlso Path <> LastPath) Then If Directory.Exists(Filepath.GetDir(Path)) Then - script = ModifyScript(script, Engine) - If Engine = ScriptEngine.VapourSynth Then - script.WriteFile(Path, Encoding.UTF8) + ModifyScript(code, Engine).WriteFile(Path, Encoding.UTF8) Else - script.WriteANSIFile(Path) + ModifyScript(code, Engine).WriteANSIFile(Path) End If If p.SourceFile <> "" Then @@ -212,7 +211,8 @@ Public Class VideoScript End If End Using - LastSync = current + LastCode = code + LastPath = Path End If End If End If @@ -304,16 +304,14 @@ Public Class VideoScript End Function Function GetErrorMessage() As String - Synchronize() + Synchronize(False, False) Return ErrorMessage End Function Function GetSeconds() As Integer Dim fr = GetFramerate() - If fr = 0 Then fr = p.SourceFrameRate If fr = 0 Then fr = 25 - Return CInt(GetFrames() / fr) End Function @@ -538,13 +536,9 @@ Public Class FilterCategory Dim src As New FilterCategory("Source") src.Filters.AddRange( {New VideoFilter("Source", "Manual", "# shows the filter selection dialog"), - New VideoFilter("Source", "Automatic", "# can be configured at main menu > Tools > Settings > Source Filters"), + New VideoFilter("Source", "Automatic", "# can be configured at: Tools > Settings > Source Filters"), New VideoFilter("Source", "AviSource", "AviSource(""%source_file%"", Audio = False)"), - New VideoFilter("Source", "DirectShowSource", "DirectShowSource(""%source_file%"", audio = False)"), - New VideoFilter("Source", "DSS2", "DSS2(""%source_file%"")"), - New VideoFilter("Source", "FFVideoSource", "FFVideoSource(""%source_file%"", cachefile = ""%temp_file%.ffindex"")"), - New VideoFilter("Source", "LSMASHVideoSource", "LSMASHVideoSource(""%source_file%"", format = ""YUV420P8"")"), - New VideoFilter("Source", "LWLibavVideoSource", "LWLibavVideoSource(""%source_file%"", format = ""YUV420P8"")")}) + New VideoFilter("Source", "DirectShowSource", "DirectShowSource(""%source_file%"", audio = False)")}) ret.Add(src) Dim misc As New FilterCategory("Misc") @@ -608,11 +602,8 @@ Public Class FilterCategory Dim src As New FilterCategory("Source") src.Filters.AddRange( {New VideoFilter("Source", "Manual", "# shows filter selection dialog"), - New VideoFilter("Source", "Automatic", "# can be configured at main menu > Tools > Settings > Source Filters"), - New VideoFilter("Source", "AVISource", "clip = core.avisource.AVISource(r""%source_file%"")"), - New VideoFilter("Source", "ffms2", "clip = core.ffms2.Source(r""%source_file%"", cachefile = r""%temp_file%.ffindex"")"), - New VideoFilter("Source", "LibavSMASHSource", "clip = core.lsmas.LibavSMASHSource(r""%source_file%"")"), - New VideoFilter("Source", "LWLibavSource", "clip = core.lsmas.LWLibavSource(r""%source_file%"")")}) + New VideoFilter("Source", "Automatic", "# can be configured at: Tools > Settings > Source Filters"), + New VideoFilter("Source", "AVISource", "clip = core.avisource.AVISource(r""%source_file%"")")}) ret.Add(src) Dim crop As New FilterCategory("Crop") diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index e94d00ae..892171dd 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -8,4 +8,4 @@ Imports System.Runtime.InteropServices - \ No newline at end of file + \ No newline at end of file diff --git a/UI/TaskDialog.vb b/UI/TaskDialog.vb index 4e007c18..d6984237 100644 --- a/UI/TaskDialog.vb +++ b/UI/TaskDialog.vb @@ -333,7 +333,7 @@ Class TaskDialog(Of T) g.ShellExecute(url) ElseIf url = "copymsg:" Then Clipboard.SetText(MainInstruction + BR2 + Content + BR2 + ExpandedInformation) - MessageBox.Show("Message was copied to clipboard.") + MsgInfo("Message was copied to clipboard.") End If Case TDN_CREATED For Each i In CommandLinkShieldList diff --git a/md/test-build.md b/md/test-build.md index 4f15a592..79997639 100644 --- a/md/test-build.md +++ b/md/test-build.md @@ -11,8 +11,8 @@ http://1drv.ms/1OqPDOe - added subtitle formats column to MediaInfo Folder View - added all missing x265 switches - added hardware decoding methods to x265 'Other' tab, this will bypass AviSynth though -- added new standalone mkvextract GUI (Main Menu > Apps > Demux) -- added new QSVEncC switches for hordcoded subtitles +- added new standalone mkvextract GUI (Apps > Demux) +- added new QSVEncC switches for hardcoded subtitles - added MP4 support to standalone demux app - added -avsinfo starting AVSMeter without a source opened - added support for unicode filenames using VapourSynth, AviSynth don't support it @@ -23,6 +23,7 @@ http://1drv.ms/1OqPDOe - added codec help menu to ffmpeg options dialog which shows help for the currently selected codec, it displayes the output queried with 'ffmpeg -h encoder=name' - added option to define preferred audio languages - added audio and subtitle demuxing modes 'Show Dialog', 'Preferred', 'All', 'None' +- added x265 changes for v1.9 183 ### Fixed Bugs @@ -40,6 +41,7 @@ http://1drv.ms/1OqPDOe - log file improvements - filters list view did not accept drag and drop with source files - enabled posibility to remux mov to mp4 +- the apps dialog writes the customized versions now to the settings folder so it don't matter if the startup folder has no write access ### Updated Tools @@ -49,8 +51,9 @@ http://1drv.ms/1OqPDOe - mkvtoolnix 9.1.0 - MP4Box 0.6.2 - mvsfunc 7 +- mvtools2 2.7.0.22 - nnedi3 0.9.4.21 -- QSVEncC 2.46 +- NVEncC 2.06 +- QSVEncC 2.47 - StaxRip Toolbox Demux 1.1 -- x265 1.9 144 -- mvtools2 2.7.0.22 \ No newline at end of file +- x265 1.9 183 \ No newline at end of file diff --git a/x265/param.cpp b/x265/param.cpp index 1cdec2c8..fee12ac1 100644 --- a/x265/param.cpp +++ b/x265/param.cpp @@ -164,6 +164,7 @@ void x265_param_default(x265_param* param) param->bEnableWeightedPred = 1; param->bEnableWeightedBiPred = 0; param->bEnableEarlySkip = 0; + param->bEnableRecursionSkip = 1; param->bEnableAMP = 0; param->bEnableRectInter = 0; param->rdLevel = 3; @@ -220,7 +221,7 @@ void x265_param_default(x265_param* param) param->rc.qblur = 0.5; param->rc.zoneCount = 0; param->rc.zones = NULL; - param->rc.bEnableSlowFirstPass = 0; + param->rc.bEnableSlowFirstPass = 1; param->rc.bStrictCbr = 0; param->rc.bEnableGrain = 0; @@ -388,6 +389,7 @@ int x265_param_default_preset(x265_param* param, const char* preset, const char* param->maxNumMergeCand = 4; param->searchMethod = X265_STAR_SEARCH; param->maxNumReferences = 5; + param->bEnableRecursionSkip = 0; param->limitReferences = 1; param->limitModes = 1; param->bIntraInBFrames = 1; @@ -410,9 +412,9 @@ int x265_param_default_preset(x265_param* param, const char* preset, const char* param->maxNumMergeCand = 5; param->searchMethod = X265_STAR_SEARCH; param->bEnableTransformSkip = 1; + param->bEnableRecursionSkip = 0; param->maxNumReferences = 5; param->limitReferences = 0; - param->rc.bEnableSlowFirstPass = 1; param->bIntraInBFrames = 1; param->lookaheadSlices = 0; // disabled for best quality // TODO: optimized esa @@ -461,6 +463,10 @@ int x265_param_default_preset(x265_param* param, const char* preset, const char* param->rc.aqMode = 0; param->rc.qpStep = 1; param->rc.bEnableGrain = 1; + param->bEnableRecursionSkip = 0; + param->psyRd = 4.0; + param->psyRdoq = 10.0; + param->bEnableSAO = 0; } else return -1; @@ -614,6 +620,7 @@ int x265_param_parse(x265_param* p, const char* name, const char* value) OPT("max-merge") p->maxNumMergeCand = (uint32_t)atoi(value); OPT("temporal-mvp") p->bEnableTemporalMvp = atobool(value); OPT("early-skip") p->bEnableEarlySkip = atobool(value); + OPT("recursion-skip") p->bEnableRecursionSkip = atobool(value); OPT("rdpenalty") p->rdPenalty = atoi(value); OPT("tskip") p->bEnableTransformSkip = atobool(value); OPT("no-tskip-fast") p->bEnableTSkipFast = atobool(value); @@ -1344,6 +1351,7 @@ void x265_print_params(x265_param* param) TOOLVAL(param->psyRdoq, "psy-rdoq=%.2lf"); TOOLOPT(param->bEnableRdRefine, "rd-refine"); TOOLOPT(param->bEnableEarlySkip, "early-skip"); + TOOLOPT(param->bEnableRecursionSkip, "recursion-skip"); TOOLVAL(param->noiseReductionIntra, "nr-intra=%d"); TOOLVAL(param->noiseReductionInter, "nr-inter=%d"); TOOLOPT(param->bEnableTSkipFast, "tskip-fast"); @@ -1402,6 +1410,7 @@ char *x265_param2string(x265_param* p) s += sprintf(s, " max-merge=%d", p->maxNumMergeCand); BOOL(p->bEnableTemporalMvp, "temporal-mvp"); BOOL(p->bEnableEarlySkip, "early-skip"); + BOOL(p->bEnableRecursionSkip, "recursion-skip"); s += sprintf(s, " rdpenalty=%d", p->rdPenalty); BOOL(p->bEnableTransformSkip, "tskip"); BOOL(p->bEnableTSkipFast, "tskip-fast"); diff --git a/x265/x265cli.h b/x265/x265cli.h index df4094ed..ec2a9384 100644 --- a/x265/x265cli.h +++ b/x265/x265cli.h @@ -97,6 +97,8 @@ static const struct option long_options[] = { "amp", no_argument, NULL, 0 }, { "no-early-skip", no_argument, NULL, 0 }, { "early-skip", no_argument, NULL, 0 }, + { "no-recursion-skip", no_argument, NULL, 0 }, + { "recursion-skip", no_argument, NULL, 0 }, { "no-fast-cbf", no_argument, NULL, 0 }, { "fast-cbf", no_argument, NULL, 0 }, { "no-tskip", no_argument, NULL, 0 }, @@ -312,6 +314,7 @@ static void showHelp(x265_param *param) H0(" --[no-]psy-rdoq <0..50.0> Strength of psycho-visual optimization in RDO quantization, 0 to disable. Default %.1f\n", param->psyRdoq); H0(" --[no-]rd-refine Enable QP based RD refinement for rd levels 5 and 6. Default %s\n", OPT(param->bEnableRdRefine)); H0(" --[no-]early-skip Enable early SKIP detection. Default %s\n", OPT(param->bEnableEarlySkip)); + H0(" --[no-]recursion-skip Enable early exit from recursion. Default %s\n", OPT(param->bEnableRecursionSkip)); H1(" --[no-]tskip-fast Enable fast intra transform skipping. Default %s\n", OPT(param->bEnableTSkipFast)); H1(" --nr-intra An integer value in range of 0 to 2000, which denotes strength of noise reduction in intra CUs. Default 0\n"); H1(" --nr-inter An integer value in range of 0 to 2000, which denotes strength of noise reduction in inter CUs. Default 0\n");