Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Revan654 committed Feb 25, 2019
1 parent 76be1a3 commit 3875820
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 7 deletions.
83 changes: 77 additions & 6 deletions Encoding/Rav1e.vb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,37 @@ Public Class Rav1eParams
Property Mode As New OptionParam With {
.Text = "Mode",
.Path = "Basic",
.Options = {"Quality"}}
.AlwaysOn = True,
.Options = {"Speed", "Bitrate"},
.Values = {"--speed", "--bitrate"},
.InitValue = 0}

Property Bitrate As New NumParam With {
.Text = "Bitrate",
.Path = "Basic",
.Config = {0, 9999},
.ImportAction = Sub(arg As String)
If arg = "" Then Exit Sub
Dim a = arg.Trim(""""c)
Mode.Value = 1 + " " + Bitrate.Value
End Sub,
.ArgsFunc = Function() "" & Bitrate.Value,
.VisibleFunc = Function() Mode.Value = 1}

Property Passes As New OptionParam With {
.Text = "Passes",
.Path = "Basic",
.Options = {"One Pass", "Two Passes"},
.Values = {"--pass 1", "--pass 2"},
.InitValue = 0,
.VisibleFunc = Function() Mode.Value = 1}

Property Range As New OptionParam With {
.Text = "Range",
.Path = "VUI",
.Switch = "--range",
.InitValue = 0,
.Options = {"Unspecified", "Limited", "Full"}}

Property Prime As New OptionParam With {
.Text = "Primaries",
Expand Down Expand Up @@ -164,7 +194,14 @@ Public Class Rav1eParams
.Switch = "--speed",
.Config = {0, 10},
.Init = 3,
.Path = "Basic"}
.VisibleFunc = Function() Mode.Value = 0,
.ImportAction = Sub(arg As String)
If arg = "" Then Exit Sub
Dim a = arg.Trim(""""c)
Mode.Value = 0 + " " + Speed.Value
End Sub,
.ArgsFunc = Function() "" & Speed.Value,
.Path = "Basic"}

Property Quantizer As New NumParam With {
.Text = "Quantizer",
Expand All @@ -187,6 +224,32 @@ Public Class Rav1eParams
.Config = {0, 300},
.Init = 12}

Property Light As New NumParam With {
.Text = "Content Light",
.Switch = "--content_light",
.Path = "VUI",
.Config = {0, Integer.MaxValue, 50},
.ImportAction = Sub(arg As String)
If arg = "" Then Exit Sub
Dim a = arg.Trim(""""c).Split(","c)
Light.Value = a(0).ToInt
MaxFALL.Value = a(1).ToInt
End Sub,
.ArgsFunc = Function() If(Light.Value <> 0 OrElse MaxFALL.Value <> 0, "--content_light """ & Light.Value & "," & MaxFALL.Value & """", "")}

Property MaxFALL As New NumParam With {
.Path = "VUI",
.Config = {0, Integer.MaxValue, 50},
.ArgsFunc = Function() "",
.Text = "Maximum FALL"}

Property Threads As New NumParam With {
.Text = "Threads",
.Switch = "--threads",
.Path = "Basic",
.Config = {0, 20},
.Init = 0}

Property Custom As New StringParam With {
.Text = "Custom",
.Path = "Misc",
Expand All @@ -196,9 +259,10 @@ Public Class Rav1eParams
If ItemsValue Is Nothing Then
ItemsValue = New List(Of CommandLineParam)

Add(Mode, Tune, Speed, Quantizer,
Keyint, MinKeyint, Limit, Prime, Matrix, Transfer,
New BoolParam With {.Switch = "--low_latency", .Text = "Low Latency", .Path = "Basic", .NoSwitch = ""},
Add(Tune, Passes, Mode, Speed, Bitrate, Quantizer,
New StringParam With {.Switch = "--mastering_display", .Path = "VUI", .Text = "Master Display", .Quotes = True},
Keyint, MinKeyint, Threads, Limit, Light, MaxFALL, Prime, Matrix, Transfer, Range,
New BoolParam With {.Switch = "--low_latency", .Text = "Low Latency", .Path = "Basic"},
Custom)

For Each item In ItemsValue
Expand Down Expand Up @@ -261,4 +325,11 @@ Public Class Rav1eParams
Public Overrides Function GetPackage() As Package
Return Package.Rav1e
End Function
End Class

End Class

Public Enum Rav1eRateMode
Speed
OnePass
TwoPass
End Enum
2 changes: 1 addition & 1 deletion Encoding/x265Enc.vb
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ Public Class x265Params
New StringParam With {.Switch = "--dolby-vision-rpu", .Text = "Dolby Vision RPU", .Quotes = True, .BrowseFile = True},
New NumParam With {.Switch = "--log2-max-poc-lsb", .Text = "Maximum Picture Order Count", .Init = 8},
RepeatHeaders, Info, HRD, AUD,
New BoolParam With {.Switch = "--hrd-concat", .Init = False, .Text = "HRD Concat"},
New BoolParam With {.Switch = "---hrd-concat", .Init = False, .Text = "HRD Concat"},
New BoolParam With {.Switch = "--vui-timing-info", .Text = "VUI Timing Info", .Init = True},
New BoolParam With {.Switch = "--vui-hrd-info", .Text = "VUI HRD Info", .Init = True},
New BoolParam With {.Switch = "--idr-recovery-sei", .Init = False, .Text = "Recovery SEI"},
Expand Down

0 comments on commit 3875820

Please sign in to comment.