Permalink
Browse files

-

  • Loading branch information...
stax76
stax76 committed Feb 22, 2017
1 parent 88da5f0 commit 92288c5501af6127652055f7846a900399456486
View
@@ -12,6 +12,12 @@ Class AMDEncoder
Property ParamsStore As New PrimitiveStore
Public Overrides ReadOnly Property DefaultName As String
Get
Return "AMD " + Params.Codec.OptionText
End Get
End Property
<NonSerialized>
Private ParamsValue As EncoderParams
@@ -46,7 +52,8 @@ Class AMDEncoder
End Sub
f.cms.Items.Add(New ActionMenuItem("Save Profile...", saveProfileAction))
f.cms.Items.Add(New ActionMenuItem("Check VCE Support", Sub() MsgInfo(ProcessHelp.GetStdOut(Package.NVEncC.Path, "--check-vce"))))
f.cms.Items.Add(New ActionMenuItem("Check Features", Sub() g.ShowCode("Check Features", ProcessHelp.GetStdOut(Package.VCEEncC.Path, "--check-features"))))
f.cms.Items.Add(New ActionMenuItem("Check VCE Support", Sub() MsgInfo(ProcessHelp.GetStdOut(Package.VCEEncC.Path, "--check-vce"))))
If f.ShowDialog() = DialogResult.OK Then
Params = params1
@@ -58,7 +65,7 @@ Class AMDEncoder
Overrides ReadOnly Property OutputExt() As String
Get
Return "h264"
Return Params.Codec.ValueText
End Get
End Property
@@ -112,6 +119,12 @@ Class AMDEncoder
.Text = "Mode:",
.Options = {"CBR", "VBR", "CQP"}}
Property Codec As New OptionParam With {
.Switch = "--codec",
.Text = "Codec:",
.Options = {"H.264", "H.265"},
.Values = {"h264", "hevc"}}
Property Decoder As New OptionParam With {
.Text = "Decoder:",
.Options = {"AviSynth/VapourSynth", "QSVEncC (Intel)", "ffmpeg (Intel)", "ffmpeg (DXVA2)"},
@@ -145,30 +158,39 @@ Class AMDEncoder
Get
If ItemsValue Is Nothing Then
ItemsValue = New List(Of CommandLineParam)
Add("Basic", Decoder, Mode,
Add("Basic", Decoder, Mode, Codec,
New OptionParam With {.Switch = "--quality", .Text = "Quality:", .Options = {"fast", "balanced", "slow"}, .InitValue = 1},
New OptionParam With {.Switch = "--profile", .Text = "Profile:", .Options = {"Baseline", "Main", "High"}},
New OptionParam With {.Switch = "--tier", .Text = "Tier:", .Options = {"main", "high"}, .VisibleFunc = Function() Codec.ValueText = "hevc"},
New OptionParam With {.Switch = "--level", .Text = "Level:", .Options = {"Automatic", "1", "1b", "1.1", "1.2", "1.3", "2", "2.1", "2.2", "3", "3.1", "3.2", "4", "4.1", "4.2", "5", "5.1", "5.2"}},
QPI, QPP, QPB)
Add("Slice Decision",
New NumParam With {.Switch = "--slices", .Text = "Slices:", .InitValue = 1},
New NumParam With {.Switch = "--bframes", .Text = "B-Frames:", .MinMaxStep = {0, 16, 1}},
New NumParam With {.Switch = "--ref", .Text = "Ref Frames:", .InitValue = 2, .MinMaxStep = {0, 16, 1}},
New NumParam With {.Switch = "--gop-len", .Text = "GOP Length:", .MinMaxStep = {0, Integer.MaxValue, 1}},
New NumParam With {.Switch = "--ltr", .Text = "LTR Frames:", .MinMaxStep = {0, Integer.MaxValue, 1}},
New BoolParam With {.Switch = "--b-pyramid", .Text = "B-Pyramid"})
Add("Rate Control",
New NumParam With {.Switch = "--max-bitrate", .Text = "Max Bitrate:", .InitValue = 20000, .MinMaxStep = {0, Integer.MaxValue, 1}},
New NumParam With {.Switch = "--vbv-bufsize", .Text = "VBV Bufsize:", .MinMaxStep = {0, 1000000, 1}, .InitValue = 20000},
New NumParam With {.Switch = "--qp-min", .Text = "QP Min:", .MinMaxStep = {0, 100, 1}},
New NumParam With {.Switch = "--qp-max", .Text = "QP Max:", .MinMaxStep = {0, 100, 1}, .InitValue = 100},
New NumParam With {.Switch = "--b-deltaqp", .Text = "Non-ref bframe QP offset:"},
New NumParam With {.Switch = "--bref-deltaqp", .Text = "Ref bframe QP offset:"})
New NumParam With {.Switch = "--bref-deltaqp", .Text = "Ref bframe QP offset:"},
New BoolParam With {.Switch = "--vbaq", .Text = "VBAQ"})
Add("Other",
New StringParam With {.Switch = "--chapter", .Text = "Chapters:", .Quotes = True, .BrowseFileFilter = "*.*|*.*"},
New StringParam With {.Switch = "--log", .Text = "Log File:", .Quotes = True, .BrowseFileFilter = "*.*|*.*"},
New OptionParam With {.Switch = "--log-level", .Text = "Log Level:", .Options = {"info", "debug", "warn", "error"}},
New OptionParam With {.Switch = "--motion-est", .Text = "Motion Estimation:", .Options = {"q-pel", "full-pel", "half-pel"}},
New OptionParam With {.Switch = "--pre-analysis", .Name = "pre-analysis-h264", .Text = "Pre Analysis:", .Options = {"none", "full", "half", "quarter"}, .VisibleFunc = Function() Codec.ValueText = "h264"},
New OptionParam With {.Switch = "--pre-analysis", .Name = "pre-analysis-h265", .Text = "Pre Analysis:", .Options = {"none", "auto"}, .VisibleFunc = Function() Codec.ValueText = "hevc"},
New OptionParam With {.Switches = {"--tff", "--bff"}, .Text = "Interlaced:", .Options = {"Progressive ", "Top Field First", "Bottom Field First"}, .Values = {"", "--tff", "--bff"}},
New BoolParam With {.Switch = "--chapter-copy", .Text = "Copy Chapters"},
New BoolParam With {.Switch = "--filler", .Text = "Use filler data"},
New BoolParam With {.Switch = "--fullrange", .Text = "Set yuv to fullrange", .VisibleFunc = Function() Codec.ValueText = "h264"},
New BoolParam With {.Switch = "--enforce-hrd", .Text = "Enforce HRD compatibility"},
Custom)
End If
View
@@ -1,4 +1,4 @@
Imports System.Text
Imports System.Globalization
Imports StaxRip.CommandLine
Imports StaxRip.UI
@@ -123,17 +123,19 @@ Public Class NVIDIAEncoder
Property Mode As New OptionParam With {
.Text = "Mode:",
.Switches = {"--cbr", "--vbr", "--vbr2", "--cqp"},
.Options = {"CBR", "VBR", "VBR2", "CQP"},
.Switches = {"--cbr", "--cbrhq", "--vbr", "--vbrhq", "--cqp"},
.Options = {"CBR", "CBRHQ", "VBR", "VBRHQ", "CQP"},
.VisibleFunc = Function() Not Lossless.Value,
.ArgsFunc = Function() As String
Select Case Mode.OptionText
Case "CBR"
Return "--cbr " & p.VideoBitrate
Case "CBRHQ"
Return "--cbrhq " & p.VideoBitrate
Case "VBR"
Return "--vbr " & p.VideoBitrate
Case "VBR2"
Return "--vbr2 " & p.VideoBitrate
Case "VBRHQ"
Return "--vbrhq " & p.VideoBitrate
Case "CQP"
Return "--cqp " & QPI.Value & ":" & QPP.Value & ":" & QPB.Value
End Select
@@ -180,25 +182,78 @@ Public Class NVIDIAEncoder
.Value = False,
.DefaultValue = False}
Property KNN As New BoolParam With {
.Switch = "--vpp-knn",
.Text = "Denoise using K-nearest neighbor",
.ArgsFunc = AddressOf GetKnnArgs}
Property KnnRadius As New NumParam With {
.Text = " Radius:",
.InitValue = 3}
Property KnnStrength As New NumParam With {
.Text = " Strength:",
.InitValue = 0.08,
.MinMaxStepDec = {0, 1, 0.02D, 2}}
Property KnnLerp As New NumParam With {
.Text = " Lerp:",
.InitValue = 0.2,
.MinMaxStepDec = {0, Integer.MaxValue, 0.1D, 1}}
Property KnnThLerp As New NumParam With {
.Text = " TH Lerp:",
.InitValue = 0.8,
.MinMaxStepDec = {0, 1, 0.1D, 1}}
Property PMD As New BoolParam With {
.Switch = "--vpp-pmd",
.Text = "Denoise using PMD",
.ArgsFunc = AddressOf GetPmdArgs}
Property PmdApplyCount As New NumParam With {
.Text = " Apply Count:",
.InitValue = 2}
Property PmdStrength As New NumParam With {
.Text = " Strength:",
.Name = "PmdStrength",
.InitValue = 100.0,
.MinMaxStepDec = {0, 100, 1, 1}}
Property PmdThreshold As New NumParam With {
.Text = " Threshold:",
.InitValue = 100.0,
.MinMaxStepDec = {0, 255, 1, 1}}
Private ItemsValue As List(Of CommandLineParam)
Overrides ReadOnly Property Items As List(Of CommandLineParam)
Get
If ItemsValue Is Nothing Then
ItemsValue = New List(Of CommandLineParam)
Add("Basic", Decoder, Mode, Codec, QPI, QPP, QPB)
Add("Basic", Decoder, Mode, Codec,
New OptionParam() With {.Switch = "--output-depth", .Text = "Depth:", .Options = {"8", "10"}},
QPI, QPP, QPB)
Add("Slice Decision",
New NumParam With {.Switch = "--bframes", .Text = "B-Frames:", .InitValue = 3, .MinMaxStep = {0, 16, 1}},
New NumParam With {.Switch = "--ref", .Text = "Ref Frames:", .InitValue = 3, .MinMaxStep = {0, 16, 1}},
New NumParam With {.Switch = "--gop-len", .Text = "GOP Length:", .MinMaxStep = {0, Integer.MaxValue, 1}},
New NumParam With {.Switch = "--lookahead", .Text = "Lookahead:", .MinMaxStep = {0, 32, 1}, .InitValue = 16})
New NumParam With {.Switch = "--lookahead", .Text = "Lookahead:", .MinMaxStep = {0, 32, 1}, .InitValue = 16},
New BoolParam With {.Switch = "--strict-gop", .Text = "Strict GOP"},
New BoolParam With {.NoSwitch = "--no-b-adapt", .Text = "B-Adapt", .InitValue = True},
New BoolParam With {.NoSwitch = "--no-i-adapt", .Text = "I-Adapt", .InitValue = True},
New BoolParam With {.Switch = "--enable-ltr", .Text = "LTR (Long Term Reference pictures)"})
Add("Rate Control",
New NumParam With {.Switch = "--qp-init", .Text = "Initial QP:", .MinMaxStep = {0, Integer.MaxValue, 1}},
New NumParam With {.Switch = "--qp-max", .Text = "Max QP:", .MinMaxStep = {0, Integer.MaxValue, 1}},
New NumParam With {.Switch = "--qp-min", .Text = "Min QP:", .MinMaxStep = {0, Integer.MaxValue, 1}},
New NumParam With {.Switch = "--max-bitrate", .Text = "Max Bitrate:", .InitValue = 17500, .MinMaxStep = {0, Integer.MaxValue, 1}},
New NumParam With {.Switch = "--vbv-bufsize", .Text = "VBV Bufsize:", .MinMaxStep = {0, Integer.MaxValue, 1}},
New BoolParam With {.Switch = "--aq", .Text = "Adaptive Quantization", .Value = False, .DefaultValue = False},
New NumParam With {.Switch = "--aq-strength", .Text = "AQ Strength:", .MinMaxStep = {0, 15, 1}, .VisibleFunc = Function() Codec.ValueText = "h264"},
New NumParam With {.Switch = "--vbr-quality", .Text = "VBR Quality:", .MinMaxStep = {0, 51, 1}},
New BoolParam With {.Switch = "--aq", .Text = "Adaptive Quantization"},
New BoolParam With {.Switch = "--aq-temporal", .Text = "AQ Temporal"},
Lossless)
Add("Profile",
New OptionParam With {.Name = "LevelH264", .Switch = "--level", .Text = "Level:", .VisibleFunc = Function() Codec.ValueText = "h264", .Options = {"Unrestricted", "1", "1.1", "1.2", "1.3", "2", "2.1", "2.2", "3", "3.1", "3.2", "4", "4.1", "4.2", "5", "5.1", "5.2"}},
@@ -215,10 +270,15 @@ Public Class NVIDIAEncoder
New OptionParam With {.Switch = "--colorprim", .Text = "Colorprim:", .Options = {"undef", "auto", "bt709", "smpte170m", "bt470m", "bt470bg", "smpte240m", "film", "bt2020"}},
New OptionParam With {.Switch = "--transfer", .Text = "Transfer:", .Options = {"undef", "auto", "bt709", "smpte170m", "bt470m", "bt470bg", "smpte240m", "linear", "log100", "log316", "iec61966-2-4", "bt1361e", "iec61966-2-1", "bt2020-10", "bt2020-12", "smpte-st-2084", "smpte-st-428", "arib-srd-b67"}},
New BoolParam With {.Switch = "--fullrange", .Text = "Full Range", .VisibleFunc = Function() Codec.ValueText = "h264"})
Add("VPP",
New OptionParam With {.Switch = "--vpp-resize", .Text = "Resize:", .Options = {"Disabled", "default", "bilinear", "cubic", "cubic_b05c03", "cubic_bspline", "cubic_catmull", "lanczos", "nn", "npp_linear", "spline36", "super"}},
New OptionParam With {.Switch = "--vpp-deinterlace", .Text = "Deinterlace:", .VisibleFunc = Function() Decoder.ValueText = "nv", .Options = {"none", "adaptive", "bob"}},
New OptionParam With {.Switch = "--vpp-gauss", .Text = "Gauss:", .Options = {"Disabled", "3", "5", "7"}},
KNN, KnnRadius, KnnStrength, KnnLerp, KnnThLerp,
PMD, PmdApplyCount, PmdStrength, PmdThreshold)
Add("Other",
New OptionParam With {.Switch = "--mv-precision", .Text = "MV Precision:", .Options = {"Q-pel", "half-pel", "full-pel"}, .Values = {"Q-pel", "half-pel", "full-pel"}},
New OptionParam With {.Switches = {"--cabac", "--cavlc"}, .Text = "Cabac/Cavlc:", .Options = {"Disabled", "Cabac", "Cavlc"}, .Values = {"", "--cabac", "--cavlc"}},
New OptionParam With {.Switch = "--vpp-deinterlace", .Text = "Deinterlace:", .VisibleFunc = Function() Decoder.ValueText = "nv", .Options = {"none", "adaptive", "bob"}},
New OptionParam With {.Switch = "--interlaced", .Switches = {"--tff", "--bff"}, .Text = "Interlaced:", .VisibleFunc = Function() Codec.ValueText = "h264", .Options = {"Progressive ", "Top Field First", "Bottom Field First"}, .Values = {"", "--tff", "--bff"}},
New OptionParam With {.Switch = "--log-level", .Text = "Log Level:", .Options = {"info", "debug", "warn", "error"}},
New NumParam With {.Switch = "--cu-max", .Text = "Max CU Size:", .MinMaxStep = {0, 64, 16}},
@@ -231,6 +291,71 @@ Public Class NVIDIAEncoder
End Get
End Property
Protected Overrides Sub OnValueChanged(item As CommandLineParam)
KnnRadius.NumEdit.Enabled = KNN.Value
KnnStrength.NumEdit.Enabled = KNN.Value
KnnLerp.NumEdit.Enabled = KNN.Value
KnnThLerp.NumEdit.Enabled = KNN.Value
PmdApplyCount.NumEdit.Enabled = PMD.Value
PmdStrength.NumEdit.Enabled = PMD.Value
PmdThreshold.NumEdit.Enabled = PMD.Value
MyBase.OnValueChanged(item)
End Sub
Function GetPmdArgs() As String
If PMD.Value Then
Dim ret = ""
If PmdApplyCount.Value <> PmdApplyCount.DefaultValue Then
ret += ",apply_count=" & PmdApplyCount.Value
End If
If PmdStrength.Value <> PmdStrength.DefaultValue Then
ret += ",strength=" & PmdStrength.Value
End If
If PmdThreshold.Value <> PmdThreshold.DefaultValue Then
ret += ",threshold=" & PmdThreshold.Value
End If
If ret <> "" Then
Return "--vpp-pmd " + ret.TrimStart(","c)
Else
Return "--vpp-pmd"
End If
End If
End Function
Function GetKnnArgs() As String
If KNN.Value Then
Dim ret = ""
If KnnRadius.Value <> KnnRadius.DefaultValue Then
ret += ",radius=" & KnnRadius.Value
End If
If KnnStrength.Value <> KnnStrength.DefaultValue Then
ret += ",strength=" & KnnStrength.Value.ToString(CultureInfo.InvariantCulture)
End If
If KnnLerp.Value <> KnnLerp.DefaultValue Then
ret += ",lerp=" & KnnLerp.Value.ToString(CultureInfo.InvariantCulture)
End If
If KnnThLerp.Value <> KnnThLerp.DefaultValue Then
ret += ",th_lerp=" & KnnThLerp.Value.ToString(CultureInfo.InvariantCulture)
End If
If ret <> "" Then
Return "--vpp-knn " + ret.TrimStart(","c)
Else
Return "--vpp-knn"
End If
End If
End Function
Private Sub Add(path As String, ParamArray items As CommandLineParam())
For Each i In items
i.Path = path
View
@@ -262,6 +262,11 @@ Public MustInherit Class VideoEncoder
amd264.Params.Mode.Value = 2
ret.Add(amd264)
Dim amd265 As New AMDEncoder()
amd265.Params.Mode.Value = 2
amd265.Params.Codec.Value = 1
ret.Add(amd265)
Dim xvid As New BatchEncoder()
xvid.OutputFileTypeValue = "avi"
xvid.Name = "XviD"
View
@@ -762,7 +762,7 @@ Public Class x265Params
Property LimitTU As New OptionParam With {
.Switch = "--limit-tu",
.Text = "Limit TU:",
.Options = {"0", "Level 1", "Level 2"}}
.Options = {"0", "1", "2"}}
Property CSV As New BoolParam With {
.Switch = "--csv",
View
@@ -43,7 +43,7 @@ Class HelpForm
Sub New()
InitializeComponent()
Icon = My.Resources.MainIcon
Icon = My.Resources.RipIcon
End Sub
Sub New(path As String)
@@ -55,7 +55,7 @@ Class HelpForm
MsgWarn("Failed to load: " + path)
End Try
Icon = My.Resources.MainIcon
Icon = My.Resources.RipIcon
End Sub
Private DocumentValue As HelpDocument
Oops, something went wrong.

0 comments on commit 92288c5

Please sign in to comment.