From 76fd33ee6bbb5a7ed99aacaea149333dbd55a3ab Mon Sep 17 00:00:00 2001 From: stax76 Date: Sat, 25 Feb 2017 14:11:18 +0100 Subject: [PATCH] - --- Encoding/AMDEncoder.vb | 13 +- Encoding/NVIDIAEncoder.vb | 2 +- Encoding/x265.vb | 39 ++++-- General/GlobalCommands.vb | 2 +- General/MediaInfo.vb | 9 +- General/Muxer.vb | 8 ++ General/Package.vb | 9 +- My Project/AssemblyInfo.vb | 2 +- My Project/app.manifest | 16 +-- md/test-build.md | 7 +- x265/alt_param.cpp | 59 ++++++++- x265/alt_x265cli.h | 28 +++- x265/param.cpp | 263 +++++++++++++++++++++++++++---------- x265/x265cli.h | 40 +++++- 14 files changed, 375 insertions(+), 122 deletions(-) diff --git a/Encoding/AMDEncoder.vb b/Encoding/AMDEncoder.vb index 728ff7ec..786e8919 100644 --- a/Encoding/AMDEncoder.vb +++ b/Encoding/AMDEncoder.vb @@ -127,8 +127,8 @@ Class AMDEncoder Property Decoder As New OptionParam With { .Text = "Decoder:", - .Options = {"AviSynth/VapourSynth", "QSVEncC (Intel)", "ffmpeg (Intel)", "ffmpeg (DXVA2)"}, - .Values = {"avs", "qs", "ffqsv", "ffdxva"}} + .Options = {"AviSynth/VapourSynth", "VCEEncC (VCE)", "QSVEncC (Intel)", "ffmpeg (Intel)", "ffmpeg (DXVA2)"}, + .Values = {"avs", "vce", "qs", "ffqsv", "ffdxva"}} Property QPI As New NumParam With { .Text = "Constant QP I:", @@ -160,9 +160,11 @@ Class AMDEncoder ItemsValue = New List(Of CommandLineParam) 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 = "--profile", .Name = "profile264", .VisibleFunc = Function() Codec.ValueText = "h264", .Text = "Profile:", .Options = {"Automatic", "Baseline", "Main", "High"}}, + New OptionParam With {.Switch = "--profile", .Name = "profile265", .VisibleFunc = Function() Codec.ValueText = "hevc", .Text = "Profile:", .Options = {"Main"}}, 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"}}, + New OptionParam With {.Switch = "--level", .Name = "LevelH264", .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"}}, + New OptionParam With {.Switch = "--level", .Name = "LevelH265", .Text = "Level:", .VisibleFunc = Function() Codec.ValueText = "hevc", .Options = {"Unrestricted", "1", "2", "2.1", "3", "3.1", "4", "4.1", "5", "5.1", "5.2", "6", "6.1", "6.2"}}, QPI, QPP, QPB) Add("Slice Decision", New NumParam With {.Switch = "--slices", .Text = "Slices:", .InitValue = 1}, @@ -228,6 +230,9 @@ Class AMDEncoder Case "ffqsv" sourcePath = "-" If includePaths Then ret = If(includePaths, Package.ffmpeg.Path.Quotes, "ffmpeg") + " -threads 1 -hwaccel qsv -i " + If(includePaths, p.SourceFile.Quotes, "path") + " -f yuv4mpegpipe -pix_fmt yuv420p -loglevel error - | " + If(includePaths, Package.VCEEncC.Path.Quotes, "VCEEncC") + Case "vce" + sourcePath = p.LastOriginalSourceFile + ret += " --avvce" End Select Dim q = From i In Items Where i.GetArgs <> "" diff --git a/Encoding/NVIDIAEncoder.vb b/Encoding/NVIDIAEncoder.vb index 5f01e6ec..0281e83b 100644 --- a/Encoding/NVIDIAEncoder.vb +++ b/Encoding/NVIDIAEncoder.vb @@ -272,7 +272,7 @@ Public Class NVIDIAEncoder 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-deinterlace", .Text = "Deinterlace:", .VisibleFunc = Function() Decoder.ValueText = "nvnative" OrElse Decoder.ValueText = "nvcuda", .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) diff --git a/Encoding/x265.vb b/Encoding/x265.vb index 8f714131..3e9da398 100644 --- a/Encoding/x265.vb +++ b/Encoding/x265.vb @@ -759,11 +759,6 @@ Public Class x265Params .Options = {"0", "1", "2", "3"}, .InitValue = 3} - Property LimitTU As New OptionParam With { - .Switch = "--limit-tu", - .Text = "Limit TU:", - .Options = {"0", "1", "2"}} - Property CSV As New BoolParam With { .Switch = "--csv", .Text = "Write encoding results to a comma separated value log file", @@ -794,21 +789,36 @@ Public Class x265Params Add("Analysis 1", RD, New StringParam With {.Switch = "--analysis-file", .Text = "Analysis File:", .Quotes = True, .BrowseFileFilter = "*.*|*.*"}, New OptionParam With {.Switch = "--analysis-mode", .Text = "Analysis Mode:", .Options = {"off", "save", "load"}}, - MinCuSize, MaxCuSize, MaxTuSize, LimitRefs, LimitTU, TUintra, TUinter, rdoqLevel) + MinCuSize, MaxCuSize, MaxTuSize, LimitRefs, + New NumParam With {.Switch = "--limit-tu", .Text = "Limit TU:", .MinMaxStep = {0, 4, 1}}, + TUintra, TUinter, rdoqLevel, + New NumParam() With {.Switch = "--dynamic-rd", .Text = "Dynamic RD:", .MinMaxStepDec = {0, 4, 1, 1}}) Add("Analysis 2", Rect, AMP, EarlySkip, FastIntra, BIntra, CUlossless, Tskip, TskipFast, LimitModes, RdRefine, New BoolParam With {.Switch = "--cu-stats", .Text = "CU Stats"}, - RecursionSkip) + RecursionSkip, + New BoolParam With {.Switch = "--ssim-rd", .Text = "SSIM RDO"}) Add("Rate Control 1", New StringParam With {.Switch = "--zones", .Text = "Zones:"}, AQmode, qgSize, AQStrength, QComp, CBQPoffs, QBlur, NRintra, NRinter, qpmin, qpmax, qpstep) Add("Rate Control 2", CRFmin, CRFmax, VBVbufsize, VBVmaxrate, VBVinit, - IPRatio, PBRatio, Cplxblur, CUtree, Lossless, StrictCBR, rcGrain) + IPRatio, PBRatio, Cplxblur) + Add("Rate Control 3", + CUtree, Lossless, StrictCBR, rcGrain, + New BoolParam() With {.Switch = "--multi-pass-opt-analysis", .Text = "Multipass analysis refinement along with multipass ratecontrol"}, + New BoolParam() With {.Switch = "--multi-pass-opt-distortion", .Text = "Enable multipass refinement of qp based on distortion data"}, + New BoolParam() With {.Switch = "--aq-motion", .Text = "AQ Motion"}) Add("Motion Search", SubME, [Me], MErange, MaxMerge, Weightp, Weightb, TemporalMVP, New BoolParam With {.Switch = "--analyze-src-pics", .NoSwitch = "--no-analyze-src-pics", .Text = "Analyze SRC Pics"}) - Add("Slice Decision", BAdapt, BFrames, BFrameBias, RCLookahead, LookaheadSlices, Scenecut, Ref, MinKeyint, Keyint, Bpyramid, OpenGop, IntraRefresh) + Add("Slice Decision", BAdapt, BFrames, BFrameBias, + RCLookahead, + LookaheadSlices, + New NumParam() With {.Switch = "--lookahead-threads", .Text = "Lookahead Threads:"}, + Scenecut, + New NumParam() With {.Switch = "--scenecut-bias", .Text = "Scenecut Bias:", .InitValue = 5, .MinMaxStepDec = {0, 100, 1, 1}}, + Ref, MinKeyint, Keyint, Bpyramid, OpenGop, IntraRefresh) Add("Spatial/Intra", StrongIntraSmoothing, New BoolParam With {.Switch = "--constrained-intra", .NoSwitch = "--no-constrained-intra", .Switches = {"--cip"}, .Text = "Constrained Intra Prediction", .InitValue = True}, RDpenalty) @@ -825,14 +835,19 @@ Public Class x265Params Videoformat, Colorprim, Colormatrix, Transfer, New OptionParam With {.Switch = "--overscan", .Text = "Overscan", .Options = {"undefined", "show", "crop"}}, New OptionParam With {.Switch = "--range", .Text = "Range", .Options = {"undefined", "full", "limited"}}, - minLuma, maxLuma, MaxCLL, MaxFALL) - Add("Bitstream", Hash, + minLuma, maxLuma, MaxCLL, MaxFALL, + New BoolParam With {.Switch = "--hdr", .Text = "Force signalling of HDR parameters in SEI packets"}, + New BoolParam With {.Switch = "--hdr-opt", .Text = "Add luma and chroma offsets for HDR/WCG content"}) + Add("Bitstream", + Hash, New NumParam With {.Switch = "--log2-max-poc-lsb", .Text = "log2-max-poc-lsb:", .InitValue = 8}, RepeatHeaders, Info, HRD, AUD, New BoolParam With {.Switch = "--annexb", .Text = "Annex B"}, New BoolParam With {.Switch = "--temporal-layers", .Text = "Temporal Layers"}, New BoolParam With {.Switch = "--vui-timing-info", .Text = "VUI Timing Info"}, - New BoolParam With {.Switch = "--vui-hrd-info", .Text = "VUI HRD Info"}) + New BoolParam With {.Switch = "--vui-hrd-info", .Text = "VUI HRD Info"}, + New BoolParam With {.Switch = "--opt-cu-delta-qp", .Text = "Optimize CU level QPs pulling up lower QPs close to meanQP"}, + New BoolParam With {.Switch = "--multi-pass-opt-rps", .Text = "Enable storing commonly used RPS in SPS in multi pass mode"}) Add("Input/Output", New OptionParam With {.Switch = "--input-depth", .Text = "Input Depth:", .Options = {"Automatic", "8", "10", "12", "14", "16"}}, New OptionParam With {.Switch = "--input-csp", .Text = "Input CSP:", .Options = {"Automatic", "i400", "i420", "i422", "i444", "nv12", "nv16"}}, diff --git a/General/GlobalCommands.vb b/General/GlobalCommands.vb index a329e674..b9c21488 100644 --- a/General/GlobalCommands.vb +++ b/General/GlobalCommands.vb @@ -243,7 +243,7 @@ Public Class GlobalCommands Dim amdExcept = "--audio-bitrate --audio-codec --audio-copy --audio-file --audio-filter --avsw --device --input-analyze --audio-ignore-decode-error --audio-ignore-notrack-error --audio-resampler - --audio-samplerate --audio-source --audio-stream --avs --avvce --avvce-analyze + --audio-samplerate --audio-source --audio-stream --avs --avvce-analyze --check-avversion --check-codecs --check-decoders --check-encoders --check-filters --check-formats --check-protocols --dar --format --fps --help --input-file --input-res --log-framelist --mux-option --output-file --raw --seek --skip-frame diff --git a/General/MediaInfo.vb b/General/MediaInfo.vb index 1e7078ac..4bcd96e7 100644 --- a/General/MediaInfo.vb +++ b/General/MediaInfo.vb @@ -259,18 +259,19 @@ Public Class MediaInfo Return GetInfo(path, MediaInfoStreamKind.General, parameter) End Function - Function GetFrameRate() As Double + Function GetFrameRate(Optional defaultValue As Double = 25) As Double Dim num = GetInfo(MediaInfoStreamKind.Video, "FrameRate_Num").ToInt Dim den = GetInfo(MediaInfoStreamKind.Video, "FrameRate_Den").ToInt If num > 0 AndAlso den > 0 Then Return num / den Dim ret = GetInfo(MediaInfoStreamKind.Video, "FrameRate") If ret = "" Then ret = GetInfo(MediaInfoStreamKind.Video, "FrameRate_Original") If ret = "" Then ret = GetInfo(MediaInfoStreamKind.Video, "FrameRate_Nominal") - If ret.IsDouble Then Return ret.ToDouble Else Return 25 + If ret.IsDouble Then Return ret.ToDouble Else Return defaultValue End Function - Shared Function GetFrameRate(path As String) As Double - Return GetMediaInfo(path).GetFrameRate + Shared Function GetFrameRate(path As String, + Optional defaultValue As Double = 25) As Double + Return GetMediaInfo(path).GetFrameRate(defaultValue) End Function Shared Function GetAudioCodecs(path As String) As String diff --git a/General/Muxer.vb b/General/Muxer.vb index 55e9ed67..5ddd29dc 100644 --- a/General/Muxer.vb +++ b/General/Muxer.vb @@ -208,6 +208,10 @@ Class MP4Muxer Private Function GetArgs() As String Dim args As New StringBuilder + If MediaInfo.GetFrameRate(p.VideoEncoder.OutputPath, 0) = 0 Then + args.Append(" -fps " + p.Script.GetFramerate.ToString("f6", CultureInfo.InvariantCulture)) + End If + Dim temp As String = Nothing Dim par = Calc.GetTargetPAR @@ -473,6 +477,10 @@ Class MkvMuxer args.Append(" --track-name """ & vID & ":" + Macro.Solve(VideoTrackName).Replace("""", "'") + """") End If + If MediaInfo.GetFrameRate(p.VideoEncoder.OutputPath, 0) = 0 Then + args.Append(" --default-duration 0:" + p.Script.GetFramerate.ToString("f6", CultureInfo.InvariantCulture) + "fps") + End If + args.Append(" " + p.VideoEncoder.OutputPath.Quotes) AddAudioArgs(p.Audio0, args) diff --git a/General/Package.vb b/General/Package.vb index 45921bd0..785a2218 100644 --- a/General/Package.vb +++ b/General/Package.vb @@ -207,8 +207,7 @@ Public Class Package .Description = "Visual C++ 2012 Redistributable is required by some tools used by StaxRip.", .DownloadURL = "https://www.microsoft.com/en-US/download/details.aspx?id=30679", .FixedDir = Folder.System, - .IsRequiredFunc = Function() Items("masktools2 avs").IsRequired OrElse - Items("SangNom2 avs").IsRequired, + .IsRequiredFunc = Function() Items("SangNom2 avs").IsRequired, .TreePath = "Runtimes"}) Add(New Package With { @@ -415,8 +414,8 @@ Public Class Package Add(New PluginPackage With { .Name = "masktools2", .Filename = "masktools2.dll", - .WebURL = "http://avisynth.nl/index.php/MaskTools2", - .HelpURL = "http://avisynth.nl/index.php/MaskTools2", + .WebURL = "https://github.com/pinterf/masktools", + .HelpURL = "https://github.com/pinterf/masktools", .Description = "MaskTools2 contain a set of filters designed to create, manipulate and use masks. Masks, in video processing, are a way to give a relative importance to each pixel. You can, for example, create a mask that selects only the green parts of the video, and then replace those parts with another video.", .AviSynthFilterNames = {"Mt_edge", "Mt_motion"}}) @@ -703,7 +702,7 @@ Public Class Package End Function Overridable Function GetStatus() As String - If IsOutdated() Then Return "Unsupported outdated version" + If IsOutdated() Then Return "Unsupported outdated version, continue with F12 if you must." If Not StatusFunc Is Nothing Then Return StatusFunc.Invoke End Function diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index c7c9740e..6a429d84 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/My Project/app.manifest b/My Project/app.manifest index bab8a044..2bcc52bc 100644 --- a/My Project/app.manifest +++ b/My Project/app.manifest @@ -1,14 +1,14 @@  - - - + + + - + - + @@ -20,9 +20,9 @@ - + - true/PM + true @@ -37,4 +37,4 @@ /> - \ No newline at end of file + \ No newline at end of file diff --git a/md/test-build.md b/md/test-build.md index a0514b06..9414825f 100644 --- a/md/test-build.md +++ b/md/test-build.md @@ -8,10 +8,10 @@ https://onedrive.live.com/redir?resid=604D4754F64B0ABC!4140&authkey=!ANUm9V3vTPm #### New Features -- x265 --me sea added - MPEG2DecPlus filter added to open d2v files with AviSynth+ - NVEncC added --lookahead --cbrhq --vbrhq --aq-temporal --no-b-adapt --i-adapt --enable-ltr --output-depth --strict-gop --vbr-quality --vpp-gauss --vpp-knn --vpp-pmd - VCEncC added --check-features --codec --enforce-hrd --filler --fullrange --ltr --pre-analysis --ref --tier --vbaq +- x265 added --me sea --dynamic-rd --scenecut-bias --lookahead-threads --opt-cu-delta-qp --multi-pass-opt-analysis --multi-pass-opt-distortion --multi-pass-opt-rps --aq-motion --ssim-rd --hdr --hdr-opt #### Fixed Bugs @@ -25,11 +25,12 @@ https://onedrive.live.com/redir?resid=604D4754F64B0ABC!4140&authkey=!ANUm9V3vTPm #### Updated Tools -- x265 2.2+17 - vslsmashsource (vs) 921 - L-SMASH-Works (avs) 921 - RgTools (avs) 0.94 - NVEncC 3.06 - VCEEncC 3.05v2 - QSVEncC 2.62 -- mkvtoolnix 9.9.0 \ No newline at end of file +- mkvtoolnix 9.9.0 +- x265 2.3+8 +- masktools2 2.2.2 \ No newline at end of file diff --git a/x265/alt_param.cpp b/x265/alt_param.cpp index f4542d47..cd623106 100644 --- a/x265/alt_param.cpp +++ b/x265/alt_param.cpp @@ -2,6 +2,7 @@ * Copyright (C) 2013 x265 project * * Authors: Deepthi Nandakumar + * Min Chen * * 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 @@ -174,6 +175,8 @@ void x265_param_default(x265_param* param) param->bEnableTSkipFast = 0; param->maxNumReferences = 3; param->bEnableTemporalMvp = 1; + param->bSourceReferenceEstimation = 0; + param->limitTU = 0; /* Loop Filter */ param->bEnableLoopFilter = 1; @@ -224,6 +227,8 @@ void x265_param_default(x265_param* param) param->rc.bEnableSlowFirstPass = 1; param->rc.bStrictCbr = 0; param->rc.bEnableGrain = 0; + param->rc.qpMin = 0; + param->rc.qpMax = QP_MAX_MAX; /* Video Usability Information (VUI) */ param->vui.aspectRatioIdc = 0; @@ -249,6 +254,14 @@ void x265_param_default(x265_param* param) param->maxFALL = 0; param->minLuma = 0; param->maxLuma = PIXEL_MAX; + param->log2MaxPocLsb = 8; + param->maxSlices = 1; + + param->bEmitVUITimingInfo = 1; + param->bEmitVUIHRDInfo = 1; + param->bOptQpPPS = 1; + param->bOptRefListLengthPPS = 1; + } int x265_param_default_preset(x265_param* param, const char* preset, const char* tune) @@ -509,6 +522,7 @@ int x265_param_parse(x265_param* p, const char* name, const char* value) bool bError = false; bool bNameWasBool = false; bool bValueWasNull = !value; + bool bExtraParams = false; char nameBuf[64]; if (!name) @@ -747,6 +761,7 @@ int x265_param_parse(x265_param* p, const char* name, const char* value) OPT("vbv-init") p->rc.vbvBufferInit = atof(value); OPT("crf-max") p->rc.rfConstantMax = atof(value); OPT("crf-min") p->rc.rfConstantMin = atof(value); + OPT("qpmax") p->rc.qpMax = atoi(value); OPT("crf") { p->rc.rfConstant = atof(value); @@ -885,7 +900,24 @@ int x265_param_parse(x265_param* p, const char* name, const char* value) OPT("max-luma") p->maxLuma = (uint16_t)atoi(value); OPT("uhd-bd") p->uhdBluray = atobool(value); else - return X265_PARAM_BAD_NAME; + bExtraParams = true; + + // solve "fatal error C1061: compiler limit : blocks nested too deeply" + if (bExtraParams) + { + if (0) ; + OPT("qpmin") p->rc.qpMin = atoi(value); + OPT("analyze-src-pics") p->bSourceReferenceEstimation = atobool(value); + OPT("log2-max-poc-lsb") p->log2MaxPocLsb = atoi(value); + OPT("vui-timing-info") p->bEmitVUITimingInfo = atobool(value); + OPT("vui-hrd-info") p->bEmitVUIHRDInfo = atobool(value); + OPT("slices") p->maxSlices = atoi(value); + OPT("limit-tu") p->limitTU = atoi(value); + OPT("opt-qp-pps") p->bOptQpPPS = atobool(value); + OPT("opt-ref-list-length-pps") p->bOptRefListLengthPPS = atobool(value); + else + return X265_PARAM_BAD_NAME; + } #undef OPT #undef atobool #undef atoi @@ -1041,6 +1073,8 @@ int x265_check_params(x265_param* param) uint32_t tuQTMaxLog2Size = X265_MIN(maxLog2CUSize, 5); uint32_t tuQTMinLog2Size = 2; //log2(4) + CHECK((param->maxSlices > 1) && !param->bEnableWavefront, + "Multiple-Slices mode must be enable Wavefront Parallel Processing (--wpp)"); CHECK(param->internalBitDepth != X265_DEPTH, "internalBitDepth must match compiled bit depth"); CHECK(param->minCUSize != 64 && param->minCUSize != 32 && param->minCUSize != 16 && param->minCUSize != 8, @@ -1087,6 +1121,7 @@ int x265_check_params(x265_param* param) "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1"); CHECK((param->maxTUSize != 32 && param->maxTUSize != 16 && param->maxTUSize != 8 && param->maxTUSize != 4), "max TU size must be 4, 8, 16, or 32"); + CHECK(param->limitTU > 2, "Invalid limit-tu option, limit-TU must be 0, 1 or 2"); CHECK(param->maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater."); CHECK(param->maxNumMergeCand > 5, "MaxNumMergeCand must be 5 or smaller."); @@ -1208,6 +1243,14 @@ int x265_check_params(x265_param* param) "Strict-cbr cannot be applied without specifying target bitrate or vbv bufsize"); CHECK(param->analysisMode && (param->analysisMode < X265_ANALYSIS_OFF || param->analysisMode > X265_ANALYSIS_LOAD), "Invalid analysis mode. Analysis mode 0: OFF 1: SAVE : 2 LOAD"); + CHECK(param->rc.qpMax < QP_MIN || param->rc.qpMax > QP_MAX_MAX, + "qpmax exceeds supported range (0 to 69)"); + CHECK(param->rc.qpMin < QP_MIN || param->rc.qpMin > QP_MAX_MAX, + "qpmin exceeds supported range (0 to 69)"); + CHECK(param->log2MaxPocLsb < 4, + "maximum of the picture order count can not be less than 4"); + CHECK(1 > param->maxSlices || param->maxSlices > ((param->sourceHeight + param->maxCUSize - 1) / param->maxCUSize), + "The slices can not be more than number of rows"); return check_failed; } @@ -1258,12 +1301,9 @@ int x265_set_globals(x265_param* param) // compute actual CU depth with respect to config depth and max transform size g_maxCUDepth = maxLog2CUSize - minLog2CUSize; g_unitSizeDepth = maxLog2CUSize - LOG2_UNIT_SIZE; - - // initialize partition order - uint32_t* tmp = &g_zscanToRaster[0]; - initZscanToRaster(g_unitSizeDepth, 1, 0, tmp); - initRasterToZscan(g_unitSizeDepth); } + + g_maxSlices = param->maxSlices; return 0; } @@ -1355,6 +1395,7 @@ void x265_print_params(x265_param* param) TOOLVAL(param->noiseReductionInter, "nr-inter=%d"); TOOLOPT(param->bEnableTSkipFast, "tskip-fast"); TOOLOPT(!param->bEnableTSkipFast && param->bEnableTransformSkip, "tskip"); + TOOLVAL(param->limitTU , "limit-tu=%d"); TOOLOPT(param->bCULossless, "cu-lossless"); TOOLOPT(param->bEnableSignHiding, "signhide"); TOOLOPT(param->bEnableTemporalMvp, "tmvp"); @@ -1363,6 +1404,8 @@ void x265_print_params(x265_param* param) TOOLOPT(param->bEnableFastIntra, "fast-intra"); TOOLOPT(param->bEnableStrongIntraSmoothing, "strong-intra-smoothing"); TOOLVAL(param->lookaheadSlices, "lslices=%d"); + if (param->maxSlices > 1) + TOOLVAL(param->maxSlices, "slices=%d"); if (param->bEnableLoopFilter) { if (param->deblockingFilterBetaOffset || param->deblockingFilterTCOffset) @@ -1443,6 +1486,8 @@ char *x265_param2string(x265_param* p) s += sprintf(s, " psy-rd=%.2f", p->psyRd); s += sprintf(s, " rdoq-level=%d", p->rdoqLevel); s += sprintf(s, " psy-rdoq=%.2f", p->psyRdoq); + s += sprintf(s, " log2-max-poc-lsb=%d", p->log2MaxPocLsb); + s += sprintf(s, " limit-tu=%d", p->limitTU); BOOL(p->bEnableRdRefine, "rd-refine"); BOOL(p->bEnableSignHiding, "signhide"); BOOL(p->bEnableLoopFilter, "deblock"); @@ -1463,7 +1508,7 @@ char *x265_param2string(x265_param* p) else s += sprintf(s, " bitrate=%d", p->rc.bitrate); s += sprintf(s, " qcomp=%.2f qpmin=%d qpmax=%d qpstep=%d", - p->rc.qCompress, QP_MIN, QP_MAX_SPEC, p->rc.qpStep); + p->rc.qCompress, p->rc.qpMin, p->rc.qpMax, p->rc.qpStep); if (p->rc.bStatRead) s += sprintf( s, " cplxblur=%.1f qblur=%.1f", p->rc.complexityBlur, p->rc.qblur); diff --git a/x265/alt_x265cli.h b/x265/alt_x265cli.h index 7dffeab3..9f9f7051 100644 --- a/x265/alt_x265cli.h +++ b/x265/alt_x265cli.h @@ -2,6 +2,7 @@ * Copyright (C) 2013 x265 project * * Authors: Steve Borho + * Min Chen * * 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 @@ -84,6 +85,7 @@ static const struct option long_options[] = { "max-tu-size", required_argument, NULL, 0 }, { "tu-intra-depth", required_argument, NULL, 0 }, { "tu-inter-depth", required_argument, NULL, 0 }, + { "limit-tu", required_argument, NULL, 0 }, { "me", required_argument, NULL, 0 }, { "subme", required_argument, NULL, 'm' }, { "merange", required_argument, NULL, 0 }, @@ -152,6 +154,8 @@ static const struct option long_options[] = { "pbratio", required_argument, NULL, 0 }, { "qcomp", required_argument, NULL, 0 }, { "qpstep", required_argument, NULL, 0 }, + { "qpmin", required_argument, NULL, 0 }, + { "qpmax", required_argument, NULL, 0 }, { "ratetol", required_argument, NULL, 0 }, { "cplxblur", required_argument, NULL, 0 }, { "qblur", required_argument, NULL, 0 }, @@ -204,6 +208,15 @@ static const struct option long_options[] = { "max-cll", required_argument, NULL, 0 }, { "min-luma", required_argument, NULL, 0 }, { "max-luma", required_argument, NULL, 0 }, + { "log2-max-poc-lsb", required_argument, NULL, 8 }, + { "vui-timing-info", no_argument, NULL, 0 }, + { "no-vui-timing-info", no_argument, NULL, 0 }, + { "vui-hrd-info", no_argument, NULL, 0 }, + { "no-vui-hrd-info", no_argument, NULL, 0 }, + { "opt-qp-pps", no_argument, NULL, 0 }, + { "no-opt-qp-pps", no_argument, NULL, 0 }, + { "opt-ref-list-length-pps", no_argument, NULL, 0 }, + { "no-opt-ref-list-length-pps", no_argument, NULL, 0 }, { "no-dither", no_argument, NULL, 0 }, { "dither", no_argument, NULL, 0 }, { "no-repeat-headers", no_argument, NULL, 0 }, @@ -230,6 +243,9 @@ static const struct option long_options[] = { "no-temporal-layers", no_argument, NULL, 0 }, { "qg-size", required_argument, NULL, 0 }, { "recon-y4m-exec", required_argument, NULL, 0 }, + { "analyze-src-pics", no_argument, NULL, 0 }, + { "no-analyze-src-pics", no_argument, NULL, 0 }, + { "slices", required_argument, NULL, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, @@ -293,6 +309,7 @@ static void showHelp(x265_param *param) H0(" '-' implies no threads on node, '+' implies one thread per core on node\n"); H0("-F/--frame-threads Number of concurrently encoded frames. 0: auto-determined by core count\n"); H0(" --[no-]wpp Enable Wavefront Parallel Processing. Default %s\n", OPT(param->bEnableWavefront)); + H0(" --[no-]slices Enable Multiple Slices feature. Default %d\n", param->maxSlices); H0(" --[no-]pmode Parallel mode analysis. Default %s\n", OPT(param->bDistributeModeAnalysis)); H0(" --[no-]pme Parallel motion estimation. Default %s\n", OPT(param->bDistributeMotionEstimation)); H0(" --[no-]asm Override CPU detection. Default: auto\n"); @@ -307,6 +324,7 @@ static void showHelp(x265_param *param) H0(" --max-tu-size <32|16|8|4> Maximum TU size (WxH). Default %d\n", param->maxTUSize); H0(" --tu-intra-depth Max TU recursive depth for intra CUs. Default %d\n", param->tuQTMaxIntraDepth); H0(" --tu-inter-depth Max TU recursive depth for inter CUs. Default %d\n", param->tuQTMaxInterDepth); + H0(" --limit-tu Enable early exit from TU recursion for inter coded blocks. Default %d\n", param->limitTU); H0("\nAnalysis:\n"); H0(" --rd <1..6> Level of RDO in mode decision 1:least....6:full RDO. Default %d\n", param->rdLevel); H0(" --[no-]psy-rd <0..5.0> Strength of psycho-visual rate distortion optimization, 0 to disable. Default %.1f\n", param->psyRd); @@ -375,19 +393,22 @@ static void showHelp(x265_param *param) " - 2 : Last pass, does not overwrite stats file\n" " - 3 : Nth pass, overwrites stats file\n"); H0(" --stats Filename for stats file in multipass pass rate control. Default x265_2pass.log\n"); + H0(" --[no-]analyze-src-pics Motion estimation uses source frame planes. Default disable\n"); H0(" --[no-]slow-firstpass Enable a slow first pass in a multipass rate control mode. Default %s\n", OPT(param->rc.bEnableSlowFirstPass)); H0(" --[no-]strict-cbr Enable stricter conditions and tolerance for bitrate deviations in CBR mode. Default %s\n", OPT(param->rc.bStrictCbr)); H0(" --analysis-mode save - Dump analysis info into file, load - Load analysis buffers from the file. Default %d\n", param->analysisMode); H0(" --analysis-file Specify file name used for either dumping or reading analysis data.\n"); H0(" --aq-mode Mode for Adaptive Quantization - 0:none 1:uniform AQ 2:auto variance 3:auto variance with bias to dark scenes. Default %d\n", param->rc.aqMode); H0(" --aq-strength Reduces blocking and blurring in flat and textured areas (0 to 3.0). Default %.2f\n", param->rc.aqStrength); - H0(" --qg-size Specifies the size of the quantization group (64, 32, 16). Default %d\n", param->rc.qgSize); + H0(" --qg-size Specifies the size of the quantization group (64, 32, 16, 8). Default %d\n", param->rc.qgSize); H0(" --[no-]cutree Enable cutree for Adaptive Quantization. Default %s\n", OPT(param->rc.cuTree)); H0(" --[no-]rc-grain Enable ratecontrol mode to handle grains specifically. turned on with tune grain. Default %s\n", OPT(param->rc.bEnableGrain)); H1(" --ipratio QP factor between I and P. Default %.2f\n", param->rc.ipFactor); H1(" --pbratio QP factor between P and B. Default %.2f\n", param->rc.pbFactor); H1(" --qcomp Weight given to predicted complexity. Default %.2f\n", param->rc.qCompress); H1(" --qpstep The maximum single adjustment in QP allowed to rate control. Default %d\n", param->rc.qpStep); + H1(" --qpmin sets a hard lower limit on QP allowed to ratecontrol. Default %d\n", param->rc.qpMin); + H1(" --qpmax sets a hard upper limit on QP allowed to ratecontrol. Default %d\n", param->rc.qpMax); H1(" --cbqpoffs Chroma Cb QP Offset [-12..12]. Default %d\n", param->cbQpOffset); H1(" --crqpoffs Chroma Cr QP Offset [-12..12]. Default %d\n", param->crQpOffset); H1(" --scaling-list Specify a file containing HM style quant scaling lists or 'default' or 'off'. Default: off\n"); @@ -434,6 +455,11 @@ static void showHelp(x265_param *param) H0(" --[no-]temporal-layers Enable a temporal sublayer for unreferenced B frames. Default %s\n", OPT(param->bEnableTemporalSubLayers)); H0(" --[no-]aud Emit access unit delimiters at the start of each access unit. Default %s\n", OPT(param->bEnableAccessUnitDelimiters)); H1(" --hash Decoded Picture Hash SEI 0: disabled, 1: MD5, 2: CRC, 3: Checksum. Default %d\n", param->decodedPictureHashSEI); + H0(" --log2-max-poc-lsb Maximum of the picture order count\n"); + H0(" --[no-]vui-timing-info Discard optional VUI timing information from the bistream. Default %s\n", OPT(param->bEmitVUITimingInfo)); + H0(" --[no-]vui-hrd-info Discard optional HRD timing information from the bistream. Default %s\n", OPT(param->bEmitVUIHRDInfo)); + H0(" --[no-]opt-qp-pps Discard optional HRD timing information from the bistream. Default %s\n", OPT(param->bOptQpPPS)); + H0(" --[no-]opt-ref-list-length-pps Discard optional HRD timing information from the bistream. Default %s\n", OPT(param->bOptRefListLengthPPS)); H1("\nReconstructed video options (debugging):\n"); H1("-r/--recon Reconstructed raw image YUV or Y4M output file name\n"); H1(" --recon-depth Bit-depth of reconstructed raw image file. Defaults to input bit depth, or 8 if Y4M\n"); diff --git a/x265/param.cpp b/x265/param.cpp index cd623106..3b601f71 100644 --- a/x265/param.cpp +++ b/x265/param.cpp @@ -131,6 +131,7 @@ void x265_param_default(x265_param* param) param->bEnableAccessUnitDelimiters = 0; param->bEmitHRDSEI = 0; param->bEmitInfoSEI = 1; + param->bEmitHDRSEI = 0; /* CU definitions */ param->maxCUSize = 64; @@ -149,7 +150,8 @@ void x265_param_default(x265_param* param) param->bBPyramid = 1; param->scenecutThreshold = 40; /* Magic number pulled in from x264 */ param->lookaheadSlices = 8; - + param->lookaheadThreads = 0; + param->scenecutBias = 5.0; /* Intra Coding Tools */ param->bEnableConstrainedIntra = 0; param->bEnableStrongIntraSmoothing = 1; @@ -177,6 +179,7 @@ void x265_param_default(x265_param* param) param->bEnableTemporalMvp = 1; param->bSourceReferenceEstimation = 0; param->limitTU = 0; + param->dynamicRd = 0; /* Loop Filter */ param->bEnableLoopFilter = 1; @@ -192,12 +195,16 @@ void x265_param_default(x265_param* param) param->psyRd = 2.0; param->psyRdoq = 0.0; param->analysisMode = 0; + param->analysisMultiPassRefine = 0; + param->analysisMultiPassDistortion = 0; param->analysisFileName = NULL; param->bIntraInBFrames = 0; param->bLossless = 0; param->bCULossless = 0; param->bEnableTemporalSubLayers = 0; param->bEnableRdRefine = 0; + param->bMultiPassOptRPS = 0; + param->bSsimRd = 0; /* Rate control options */ param->rc.vbvMaxBitrate = 0; @@ -261,6 +268,9 @@ void x265_param_default(x265_param* param) param->bEmitVUIHRDInfo = 1; param->bOptQpPPS = 1; param->bOptRefListLengthPPS = 1; + param->bOptCUDeltaQP = 0; + param->bAQMotion = 0; + param->bHDROpt = 0; } @@ -915,6 +925,26 @@ int x265_param_parse(x265_param* p, const char* name, const char* value) OPT("limit-tu") p->limitTU = atoi(value); OPT("opt-qp-pps") p->bOptQpPPS = atobool(value); OPT("opt-ref-list-length-pps") p->bOptRefListLengthPPS = atobool(value); + OPT("multi-pass-opt-rps") p->bMultiPassOptRPS = atobool(value); + OPT("scenecut-bias") p->scenecutBias = atof(value); + OPT("lookahead-threads") p->lookaheadThreads = atoi(value); + OPT("opt-cu-delta-qp") p->bOptCUDeltaQP = atobool(value); + OPT("multi-pass-opt-analysis") p->analysisMultiPassRefine = atobool(value); + OPT("multi-pass-opt-distortion") p->analysisMultiPassDistortion = atobool(value); + OPT("aq-motion") p->bAQMotion = atobool(value); + OPT("dynamic-rd") p->dynamicRd = atof(value); + OPT("ssim-rd") + { + int bval = atobool(value); + if (bError || bval) + { + bError = false; + p->psyRd = 0.0; + p->bSsimRd = atobool(value); + } + } + OPT("hdr") p->bEmitHDRSEI = atobool(value); + OPT("hdr-opt") p->bHDROpt = atobool(value); else return X265_PARAM_BAD_NAME; } @@ -1077,8 +1107,8 @@ int x265_check_params(x265_param* param) "Multiple-Slices mode must be enable Wavefront Parallel Processing (--wpp)"); CHECK(param->internalBitDepth != X265_DEPTH, "internalBitDepth must match compiled bit depth"); - CHECK(param->minCUSize != 64 && param->minCUSize != 32 && param->minCUSize != 16 && param->minCUSize != 8, - "minimim CU size must be 8, 16, 32, or 64"); + CHECK(param->minCUSize != 32 && param->minCUSize != 16 && param->minCUSize != 8, + "minimim CU size must be 8, 16 or 32"); CHECK(param->minCUSize > param->maxCUSize, "min CU size must be less than or equal to max CU size"); CHECK(param->rc.qp < -6 * (param->internalBitDepth - 8) || param->rc.qp > QP_MAX_SPEC, @@ -1087,8 +1117,8 @@ int x265_check_params(x265_param* param) "Frame rate numerator and denominator must be specified"); CHECK(param->interlaceMode < 0 || param->interlaceMode > 2, "Interlace mode must be 0 (progressive) 1 (top-field first) or 2 (bottom field first)"); - CHECK(param->searchMethod<0 || param->searchMethod> X265_FULL_SEARCH, - "Search method is not supported value (0:DIA 1:HEX 2:UMH 3:HM 5:FULL)"); + CHECK(param->searchMethod < 0 || param->searchMethod > X265_FULL_SEARCH, + "Search method is not supported value (0:DIA 1:HEX 2:UMH 3:HM 4:SEA 5:FULL)"); CHECK(param->searchRange < 0, "Search Range must be more than 0"); CHECK(param->searchRange >= 32768, @@ -1121,7 +1151,7 @@ int x265_check_params(x265_param* param) "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1"); CHECK((param->maxTUSize != 32 && param->maxTUSize != 16 && param->maxTUSize != 8 && param->maxTUSize != 4), "max TU size must be 4, 8, 16, or 32"); - CHECK(param->limitTU > 2, "Invalid limit-tu option, limit-TU must be 0, 1 or 2"); + CHECK(param->limitTU > 4, "Invalid limit-tu option, limit-TU must be between 0 and 4"); CHECK(param->maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater."); CHECK(param->maxNumMergeCand > 5, "MaxNumMergeCand must be 5 or smaller."); @@ -1143,6 +1173,8 @@ int x265_check_params(x265_param* param) "RD Level is out of range"); CHECK(param->rdoqLevel < 0 || param->rdoqLevel > 2, "RDOQ Level is out of range"); + CHECK(param->dynamicRd < 0 || param->dynamicRd > x265_ADAPT_RD_STRENGTH, + "Dynamic RD strength must be between 0 and 4"); CHECK(param->bframes && param->bframes >= param->lookaheadDepth && !param->rc.bStatRead, "Lookahead depth must be greater than the max consecutive bframe count"); CHECK(param->bframes < 0, @@ -1217,6 +1249,8 @@ int x265_check_params(x265_param* param) "Valid Logging level -1:none 0:error 1:warning 2:info 3:debug 4:full"); CHECK(param->scenecutThreshold < 0, "scenecutThreshold must be greater than 0"); + CHECK(param->scenecutBias < 0 || 100 < param->scenecutBias, + "scenecut-bias must be between 0 and 100"); CHECK(param->rdPenalty < 0 || param->rdPenalty > 2, "Valid penalty for 32x32 intra TU in non-I slices. 0:disabled 1:RD-penalty 2:maximum"); CHECK(param->keyframeMax < -1, @@ -1247,10 +1281,16 @@ int x265_check_params(x265_param* param) "qpmax exceeds supported range (0 to 69)"); CHECK(param->rc.qpMin < QP_MIN || param->rc.qpMin > QP_MAX_MAX, "qpmin exceeds supported range (0 to 69)"); - CHECK(param->log2MaxPocLsb < 4, - "maximum of the picture order count can not be less than 4"); - CHECK(1 > param->maxSlices || param->maxSlices > ((param->sourceHeight + param->maxCUSize - 1) / param->maxCUSize), - "The slices can not be more than number of rows"); + CHECK(param->log2MaxPocLsb < 4 || param->log2MaxPocLsb > 16, + "Supported range for log2MaxPocLsb is 4 to 16"); +#if !X86_64 + CHECK(param->searchMethod == X265_SEA && (param->sourceWidth > 840 || param->sourceHeight > 480), + "SEA motion search does not support resolutions greater than 480p in 32 bit build"); +#endif + + if (param->masteringDisplayColorVolume || param->maxFALL || param->maxCLL) + param->bEmitHDRSEI = 1; + return check_failed; } @@ -1338,9 +1378,8 @@ void x265_print_params(x265_param* param) x265_log(param, X265_LOG_INFO, "ME / range / subpel / merge : %s / %d / %d / %d\n", x265_motion_est_names[param->searchMethod], param->searchRange, param->subpelRefine, param->maxNumMergeCand); - if (param->keyframeMax != INT_MAX || param->scenecutThreshold) - x265_log(param, X265_LOG_INFO, "Keyframe min / max / scenecut : %d / %d / %d\n", param->keyframeMin, param->keyframeMax, param->scenecutThreshold); + x265_log(param, X265_LOG_INFO, "Keyframe min / max / scenecut / bias: %d / %d / %d / %.2lf\n", param->keyframeMin, param->keyframeMax, param->scenecutThreshold, param->scenecutBias * 100); else x265_log(param, X265_LOG_INFO, "Keyframe min / max / scenecut : disabled\n"); @@ -1385,6 +1424,7 @@ void x265_print_params(x265_param* param) TOOLOPT(param->bEnableAMP, "amp"); TOOLOPT(param->limitModes, "limit-modes"); TOOLVAL(param->rdLevel, "rd=%d"); + TOOLVAL(param->dynamicRd, "dynamic-rd=%.2f"); TOOLVAL(param->psyRd, "psy-rd=%.2lf"); TOOLVAL(param->rdoqLevel, "rdoq=%d"); TOOLVAL(param->psyRdoq, "psy-rdoq=%.2lf"); @@ -1404,6 +1444,7 @@ void x265_print_params(x265_param* param) TOOLOPT(param->bEnableFastIntra, "fast-intra"); TOOLOPT(param->bEnableStrongIntraSmoothing, "strong-intra-smoothing"); TOOLVAL(param->lookaheadSlices, "lslices=%d"); + TOOLVAL(param->lookaheadThreads, "lthreads=%d") if (param->maxSlices > 1) TOOLVAL(param->maxSlices, "slices=%d"); if (param->bEnableLoopFilter) @@ -1424,7 +1465,7 @@ void x265_print_params(x265_param* param) fflush(stderr); } -char *x265_param2string(x265_param* p) +char *x265_param2string(x265_param* p, int padx, int pady) { char *buf, *s; @@ -1435,71 +1476,93 @@ char *x265_param2string(x265_param* p) #define BOOL(param, cliopt) \ s += sprintf(s, " %s", (param) ? cliopt : "no-" cliopt); - s += sprintf(s, "%dx%d", p->sourceWidth,p->sourceHeight); - s += sprintf(s, " fps=%u/%u", p->fpsNum, p->fpsDenom); - s += sprintf(s, " bitdepth=%d", p->internalBitDepth); + s += sprintf(s, "cpuid=%d", p->cpuid); + s += sprintf(s, " frame-threads=%d", p->frameNumThreads); + if (p->numaPools) + s += sprintf(s, " numa-pools=%s", p->numaPools); BOOL(p->bEnableWavefront, "wpp"); + BOOL(p->bDistributeModeAnalysis, "pmode"); + BOOL(p->bDistributeMotionEstimation, "pme"); + BOOL(p->bEnablePsnr, "psnr"); + BOOL(p->bEnableSsim, "ssim"); + s += sprintf(s, " log-level=%d", p->logLevel); + s += sprintf(s, " bitdepth=%d", p->internalBitDepth); + s += sprintf(s, " input-csp=%d", p->internalCsp); + s += sprintf(s, " fps=%u/%u", p->fpsNum, p->fpsDenom); + s += sprintf(s, " input-res=%dx%d", p->sourceWidth - padx, p->sourceHeight - pady); + s += sprintf(s, " interlace=%d", p->interlaceMode); + s += sprintf(s, " total-frames=%d", p->totalFrames); + s += sprintf(s, " level-idc=%d", p->levelIdc); + s += sprintf(s, " high-tier=%d", p->bHighTier); + s += sprintf(s, " uhd-bd=%d", p->uhdBluray); + s += sprintf(s, " ref=%d", p->maxNumReferences); + BOOL(p->bAllowNonConformance, "allow-non-conformance"); + BOOL(p->bRepeatHeaders, "repeat-headers"); + BOOL(p->bAnnexB, "annexb"); + BOOL(p->bEnableAccessUnitDelimiters, "aud"); + BOOL(p->bEmitHRDSEI, "hrd"); + BOOL(p->bEmitInfoSEI, "info"); + s += sprintf(s, " hash=%d", p->decodedPictureHashSEI); + BOOL(p->bEnableTemporalSubLayers, "temporal-layers"); + BOOL(p->bOpenGOP, "open-gop"); + s += sprintf(s, " min-keyint=%d", p->keyframeMin); + s += sprintf(s, " keyint=%d", p->keyframeMax); + s += sprintf(s, " bframes=%d", p->bframes); + s += sprintf(s, " b-adapt=%d", p->bFrameAdaptive); + BOOL(p->bBPyramid, "b-pyramid"); + s += sprintf(s, " bframe-bias=%d", p->bFrameBias); + s += sprintf(s, " rc-lookahead=%d", p->lookaheadDepth); + s += sprintf(s, " lookahead-slices=%d", p->lookaheadSlices); + s += sprintf(s, " scenecut=%d", p->scenecutThreshold); + BOOL(p->bIntraRefresh, "intra-refresh"); s += sprintf(s, " ctu=%d", p->maxCUSize); s += sprintf(s, " min-cu-size=%d", p->minCUSize); + BOOL(p->bEnableRectInter, "rect"); + BOOL(p->bEnableAMP, "amp"); s += sprintf(s, " max-tu-size=%d", p->maxTUSize); - s += sprintf(s, " tu-intra-depth=%d", p->tuQTMaxIntraDepth); s += sprintf(s, " tu-inter-depth=%d", p->tuQTMaxInterDepth); + s += sprintf(s, " tu-intra-depth=%d", p->tuQTMaxIntraDepth); + s += sprintf(s, " limit-tu=%d", p->limitTU); + s += sprintf(s, " rdoq-level=%d", p->rdoqLevel); + s += sprintf(s, " dynamic-rd=%.2f", p->dynamicRd); + BOOL(p->bEnableSignHiding, "signhide"); + BOOL(p->bEnableTransformSkip, "tskip"); + s += sprintf(s, " nr-intra=%d", p->noiseReductionIntra); + s += sprintf(s, " nr-inter=%d", p->noiseReductionInter); + BOOL(p->bEnableConstrainedIntra, "constrained-intra"); + BOOL(p->bEnableStrongIntraSmoothing, "strong-intra-smoothing"); + s += sprintf(s, " max-merge=%d", p->maxNumMergeCand); + s += sprintf(s, " limit-refs=%d", p->limitReferences); + BOOL(p->limitModes, "limit-modes"); s += sprintf(s, " me=%d", p->searchMethod); s += sprintf(s, " subme=%d", p->subpelRefine); s += sprintf(s, " merange=%d", p->searchRange); - BOOL(p->bEnableRectInter, "rect"); - BOOL(p->bEnableAMP, "amp"); - s += sprintf(s, " max-merge=%d", p->maxNumMergeCand); BOOL(p->bEnableTemporalMvp, "temporal-mvp"); - BOOL(p->bEnableEarlySkip, "early-skip"); - BOOL(p->bEnableRecursionSkip, "rskip"); - s += sprintf(s, " rdpenalty=%d", p->rdPenalty); - BOOL(p->bEnableTransformSkip, "tskip"); - BOOL(p->bEnableTSkipFast, "tskip-fast"); - BOOL(p->bEnableStrongIntraSmoothing, "strong-intra-smoothing"); - BOOL(p->bLossless, "lossless"); - BOOL(p->bCULossless, "cu-lossless"); - BOOL(p->bEnableConstrainedIntra, "constrained-intra"); - BOOL(p->bEnableFastIntra, "fast-intra"); - BOOL(p->bOpenGOP, "open-gop"); - BOOL(p->bEnableTemporalSubLayers, "temporal-layers"); - s += sprintf(s, " interlace=%d", p->interlaceMode); - s += sprintf(s, " keyint=%d", p->keyframeMax); - s += sprintf(s, " min-keyint=%d", p->keyframeMin); - s += sprintf(s, " scenecut=%d", p->scenecutThreshold); - s += sprintf(s, " rc-lookahead=%d", p->lookaheadDepth); - s += sprintf(s, " lookahead-slices=%d", p->lookaheadSlices); - s += sprintf(s, " bframes=%d", p->bframes); - s += sprintf(s, " bframe-bias=%d", p->bFrameBias); - s += sprintf(s, " b-adapt=%d", p->bFrameAdaptive); - s += sprintf(s, " ref=%d", p->maxNumReferences); - s += sprintf(s, " limit-refs=%d", p->limitReferences); - BOOL(p->limitModes, "limit-modes"); BOOL(p->bEnableWeightedPred, "weightp"); BOOL(p->bEnableWeightedBiPred, "weightb"); - s += sprintf(s, " aq-mode=%d", p->rc.aqMode); - s += sprintf(s, " qg-size=%d", p->rc.qgSize); - s += sprintf(s, " aq-strength=%.2f", p->rc.aqStrength); - s += sprintf(s, " cbqpoffs=%d", p->cbQpOffset); - s += sprintf(s, " crqpoffs=%d", p->crQpOffset); - s += sprintf(s, " rd=%d", p->rdLevel); - s += sprintf(s, " psy-rd=%.2f", p->psyRd); - s += sprintf(s, " rdoq-level=%d", p->rdoqLevel); - s += sprintf(s, " psy-rdoq=%.2f", p->psyRdoq); - s += sprintf(s, " log2-max-poc-lsb=%d", p->log2MaxPocLsb); - s += sprintf(s, " limit-tu=%d", p->limitTU); - BOOL(p->bEnableRdRefine, "rd-refine"); - BOOL(p->bEnableSignHiding, "signhide"); + BOOL(p->bSourceReferenceEstimation, "analyze-src-pics"); BOOL(p->bEnableLoopFilter, "deblock"); if (p->bEnableLoopFilter) s += sprintf(s, "=%d:%d", p->deblockingFilterTCOffset, p->deblockingFilterBetaOffset); BOOL(p->bEnableSAO, "sao"); BOOL(p->bSaoNonDeblocked, "sao-non-deblock"); - BOOL(p->bBPyramid, "b-pyramid"); - BOOL(p->rc.cuTree, "cutree"); - BOOL(p->bIntraRefresh, "intra-refresh"); + s += sprintf(s, " rd=%d", p->rdLevel); + BOOL(p->bEnableEarlySkip, "early-skip"); + BOOL(p->bEnableRecursionSkip, "rskip"); + BOOL(p->bEnableFastIntra, "fast-intra"); + BOOL(p->bEnableTSkipFast, "tskip-fast"); + BOOL(p->bCULossless, "cu-lossless"); + BOOL(p->bIntraInBFrames, "b-intra"); + s += sprintf(s, " rdpenalty=%d", p->rdPenalty); + s += sprintf(s, " psy-rd=%.2f", p->psyRd); + s += sprintf(s, " psy-rdoq=%.2f", p->psyRdoq); + BOOL(p->bEnableRdRefine, "rd-refine"); + s += sprintf(s, " analysis-mode=%d", p->analysisMode); + BOOL(p->bLossless, "lossless"); + s += sprintf(s, " cbqpoffs=%d", p->cbQpOffset); + s += sprintf(s, " crqpoffs=%d", p->crQpOffset); s += sprintf(s, " rc=%s", p->rc.rateControlMode == X265_RC_ABR ? ( - p->rc.bStatRead ? "2 pass" : p->rc.bitrate == p->rc.vbvMaxBitrate ? "cbr" : "abr") + p->rc.bitrate == p->rc.vbvMaxBitrate ? "cbr" : "abr") : p->rc.rateControlMode == X265_RC_CRF ? "crf" : "cqp"); if (p->rc.rateControlMode == X265_RC_ABR || p->rc.rateControlMode == X265_RC_CRF) { @@ -1507,17 +1570,20 @@ char *x265_param2string(x265_param* p) s += sprintf(s, " crf=%.1f", p->rc.rfConstant); else s += sprintf(s, " bitrate=%d", p->rc.bitrate); - s += sprintf(s, " qcomp=%.2f qpmin=%d qpmax=%d qpstep=%d", - p->rc.qCompress, p->rc.qpMin, p->rc.qpMax, p->rc.qpStep); + s += sprintf(s, " qcomp=%.2f qpstep=%d", p->rc.qCompress, p->rc.qpStep); + s += sprintf(s, " stats-write=%d", p->rc.bStatWrite); + s += sprintf(s, " stats-read=%d", p->rc.bStatRead); if (p->rc.bStatRead) - s += sprintf( s, " cplxblur=%.1f qblur=%.1f", - p->rc.complexityBlur, p->rc.qblur); + s += sprintf(s, " cplxblur=%.1f qblur=%.1f", + p->rc.complexityBlur, p->rc.qblur); + if (p->rc.bStatWrite && !p->rc.bStatRead) + BOOL(p->rc.bEnableSlowFirstPass, "slow-firstpass"); if (p->rc.vbvBufferSize) { - s += sprintf(s, " vbv-maxrate=%d vbv-bufsize=%d", - p->rc.vbvMaxBitrate, p->rc.vbvBufferSize); + s += sprintf(s, " vbv-maxrate=%d vbv-bufsize=%d vbv-init=%.1f", + p->rc.vbvMaxBitrate, p->rc.vbvBufferSize, p->rc.vbvBufferInit); if (p->rc.rateControlMode == X265_RC_CRF) - s += sprintf(s, " crf-max=%.1f", p->rc.rfConstantMax); + s += sprintf(s, " crf-max=%.1f crf-min=%.1f", p->rc.rfConstantMax, p->rc.rfConstantMin); } } else if (p->rc.rateControlMode == X265_RC_CQP) @@ -1528,6 +1594,63 @@ char *x265_param2string(x265_param* p) if (p->bframes) s += sprintf(s, " pbratio=%.2f", p->rc.pbFactor); } + s += sprintf(s, " aq-mode=%d", p->rc.aqMode); + s += sprintf(s, " aq-strength=%.2f", p->rc.aqStrength); + BOOL(p->rc.cuTree, "cutree"); + s += sprintf(s, " zone-count=%d", p->rc.zoneCount); + if (p->rc.zoneCount) + { + for (int i = 0; i < p->rc.zoneCount; ++i) + { + s += sprintf(s, " zones: start-frame=%d end-frame=%d", + p->rc.zones[i].startFrame, p->rc.zones[i].endFrame); + if (p->rc.zones[i].bForceQp) + s += sprintf(s, " qp=%d", p->rc.zones[i].qp); + else + s += sprintf(s, " bitrate-factor=%f", p->rc.zones[i].bitrateFactor); + } + } + BOOL(p->rc.bStrictCbr, "strict-cbr"); + s += sprintf(s, " qg-size=%d", p->rc.qgSize); + BOOL(p->rc.bEnableGrain, "rc-grain"); + s += sprintf(s, " qpmax=%d qpmin=%d", p->rc.qpMax, p->rc.qpMin); + s += sprintf(s, " sar=%d", p->vui.aspectRatioIdc); + if (p->vui.aspectRatioIdc == X265_EXTENDED_SAR) + s += sprintf(s, " sar-width : sar-height=%d:%d", p->vui.sarWidth, p->vui.sarHeight); + s += sprintf(s, " overscan=%d", p->vui.bEnableOverscanInfoPresentFlag); + if (p->vui.bEnableOverscanInfoPresentFlag) + s += sprintf(s, " overscan-crop=%d", p->vui.bEnableOverscanAppropriateFlag); + s += sprintf(s, " videoformat=%d", p->vui.videoFormat); + s += sprintf(s, " range=%d", p->vui.bEnableVideoFullRangeFlag); + s += sprintf(s, " colorprim=%d", p->vui.colorPrimaries); + s += sprintf(s, " transfer=%d", p->vui.transferCharacteristics); + s += sprintf(s, " colormatrix=%d", p->vui.matrixCoeffs); + s += sprintf(s, " chromaloc=%d", p->vui.bEnableChromaLocInfoPresentFlag); + if (p->vui.bEnableChromaLocInfoPresentFlag) + s += sprintf(s, " chromaloc-top=%d chromaloc-bottom=%d", + p->vui.chromaSampleLocTypeTopField, p->vui.chromaSampleLocTypeBottomField); + s += sprintf(s, " display-window=%d", p->vui.bEnableDefaultDisplayWindowFlag); + if (p->vui.bEnableDefaultDisplayWindowFlag) + s += sprintf(s, " left=%d top=%d right=%d bottom=%d", + p->vui.defDispWinLeftOffset, p->vui.defDispWinTopOffset, + p->vui.defDispWinRightOffset, p->vui.defDispWinBottomOffset); + if (p->masteringDisplayColorVolume) + s += sprintf(s, " master-display=%s", p->masteringDisplayColorVolume); + s += sprintf(s, " max-cll=%hu,%hu", p->maxCLL, p->maxFALL); + s += sprintf(s, " min-luma=%hu", p->minLuma); + s += sprintf(s, " max-luma=%hu", p->maxLuma); + s += sprintf(s, " log2-max-poc-lsb=%d", p->log2MaxPocLsb); + BOOL(p->bEmitVUITimingInfo, "vui-timing-info"); + BOOL(p->bEmitVUIHRDInfo, "vui-hrd-info"); + s += sprintf(s, " slices=%d", p->maxSlices); + BOOL(p->bOptQpPPS, "opt-qp-pps"); + BOOL(p->bOptRefListLengthPPS, "opt-ref-list-length-pps"); + BOOL(p->bMultiPassOptRPS, "multi-pass-opt-rps"); + s += sprintf(s, " scenecut-bias=%.2f", p->scenecutBias); + BOOL(p->bOptCUDeltaQP, "opt-cu-delta-qp"); + BOOL(p->bAQMotion, "aq-motion"); + BOOL(p->bEmitHDRSEI, "hdr"); + BOOL(p->bHDROpt, "hdr-opt"); #undef BOOL return buf; } @@ -1537,10 +1660,10 @@ bool parseLambdaFile(x265_param* param) if (!param->rc.lambdaFileName) return false; - FILE *lfn = fopen(param->rc.lambdaFileName, "r"); + FILE *lfn = x265_fopen(param->rc.lambdaFileName, "r"); if (!lfn) { - x265_log(param, X265_LOG_ERROR, "unable to read lambda file <%s>\n", param->rc.lambdaFileName); + x265_log_file(param, X265_LOG_ERROR, "unable to read lambda file <%s>\n", param->rc.lambdaFileName); return true; } diff --git a/x265/x265cli.h b/x265/x265cli.h index 9f9f7051..e00887d9 100644 --- a/x265/x265cli.h +++ b/x265/x265cli.h @@ -121,9 +121,11 @@ static const struct option long_options[] = { "min-keyint", required_argument, NULL, 'i' }, { "scenecut", required_argument, NULL, 0 }, { "no-scenecut", no_argument, NULL, 0 }, + { "scenecut-bias", required_argument, NULL, 0 }, { "intra-refresh", no_argument, NULL, 0 }, { "rc-lookahead", required_argument, NULL, 0 }, { "lookahead-slices", required_argument, NULL, 0 }, + { "lookahead-threads", required_argument, NULL, 0 }, { "bframes", required_argument, NULL, 'b' }, { "bframe-bias", required_argument, NULL, 0 }, { "b-adapt", required_argument, NULL, 0 }, @@ -164,6 +166,7 @@ static const struct option long_options[] = { "rd", required_argument, NULL, 0 }, { "rdoq-level", required_argument, NULL, 0 }, { "no-rdoq-level", no_argument, NULL, 0 }, + { "dynamic-rd", required_argument, NULL, 0 }, { "psy-rd", required_argument, NULL, 0 }, { "psy-rdoq", required_argument, NULL, 0 }, { "no-psy-rd", no_argument, NULL, 0 }, @@ -217,6 +220,8 @@ static const struct option long_options[] = { "no-opt-qp-pps", no_argument, NULL, 0 }, { "opt-ref-list-length-pps", no_argument, NULL, 0 }, { "no-opt-ref-list-length-pps", no_argument, NULL, 0 }, + { "opt-cu-delta-qp", no_argument, NULL, 0 }, + { "no-opt-cu-delta-qp", no_argument, NULL, 0 }, { "no-dither", no_argument, NULL, 0 }, { "dither", no_argument, NULL, 0 }, { "no-repeat-headers", no_argument, NULL, 0 }, @@ -234,8 +239,14 @@ static const struct option long_options[] = { "nr-inter", required_argument, NULL, 0 }, { "stats", required_argument, NULL, 0 }, { "pass", required_argument, NULL, 0 }, + { "multi-pass-opt-analysis", no_argument, NULL, 0 }, + { "no-multi-pass-opt-analysis", no_argument, NULL, 0 }, + { "multi-pass-opt-distortion", no_argument, NULL, 0 }, + { "no-multi-pass-opt-distortion", no_argument, NULL, 0 }, { "slow-firstpass", no_argument, NULL, 0 }, { "no-slow-firstpass", no_argument, NULL, 0 }, + { "multi-pass-opt-rps", no_argument, NULL, 0 }, + { "no-multi-pass-opt-rps", no_argument, NULL, 0 }, { "analysis-mode", required_argument, NULL, 0 }, { "analysis-file", required_argument, NULL, 0 }, { "strict-cbr", no_argument, NULL, 0 }, @@ -246,6 +257,14 @@ static const struct option long_options[] = { "analyze-src-pics", no_argument, NULL, 0 }, { "no-analyze-src-pics", no_argument, NULL, 0 }, { "slices", required_argument, NULL, 0 }, + { "aq-motion", no_argument, NULL, 0 }, + { "no-aq-motion", no_argument, NULL, 0 }, + { "ssim-rd", no_argument, NULL, 0 }, + { "no-ssim-rd", no_argument, NULL, 0 }, + { "hdr", no_argument, NULL, 0 }, + { "no-hdr", no_argument, NULL, 0 }, + { "hdr-opt", no_argument, NULL, 0 }, + { "no-hdr-opt", no_argument, NULL, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, @@ -324,12 +343,14 @@ static void showHelp(x265_param *param) H0(" --max-tu-size <32|16|8|4> Maximum TU size (WxH). Default %d\n", param->maxTUSize); H0(" --tu-intra-depth Max TU recursive depth for intra CUs. Default %d\n", param->tuQTMaxIntraDepth); H0(" --tu-inter-depth Max TU recursive depth for inter CUs. Default %d\n", param->tuQTMaxInterDepth); - H0(" --limit-tu Enable early exit from TU recursion for inter coded blocks. Default %d\n", param->limitTU); + H0(" --limit-tu <0..4> Enable early exit from TU recursion for inter coded blocks. Default %d\n", param->limitTU); H0("\nAnalysis:\n"); H0(" --rd <1..6> Level of RDO in mode decision 1:least....6:full RDO. Default %d\n", param->rdLevel); H0(" --[no-]psy-rd <0..5.0> Strength of psycho-visual rate distortion optimization, 0 to disable. Default %.1f\n", param->psyRd); H0(" --[no-]rdoq-level <0|1|2> Level of RDO in quantization 0:none, 1:levels, 2:levels & coding groups. Default %d\n", param->rdoqLevel); H0(" --[no-]psy-rdoq <0..50.0> Strength of psycho-visual optimization in RDO quantization, 0 to disable. Default %.1f\n", param->psyRdoq); + H0(" --dynamic-rd <0..4.0> Strength of dynamic RD, 0 to disable. Default %.2f\n", param->dynamicRd); + H0(" --[no-]ssim-rd Enable ssim rate distortion optimization, 0 to disable. Default %s\n", OPT(param->bSsimRd)); 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-]rskip Enable early exit from recursion. Default %s\n", OPT(param->bEnableRecursionSkip)); @@ -365,9 +386,11 @@ static void showHelp(x265_param *param) H0("-i/--min-keyint Scenecuts closer together than this are coded as I, not IDR. Default: auto\n"); H0(" --no-scenecut Disable adaptive I-frame decision\n"); H0(" --scenecut How aggressively to insert extra I-frames. Default %d\n", param->scenecutThreshold); + H1(" --scenecut-bias <0..100.0> Bias for scenecut detection. Default %.2f\n", param->scenecutBias); H0(" --intra-refresh Use Periodic Intra Refresh instead of IDR frames\n"); H0(" --rc-lookahead Number of frames for frame-type lookahead (determines encoder latency) Default %d\n", param->lookaheadDepth); H1(" --lookahead-slices <0..16> Number of slices to use per lookahead cost estimate. Default %d\n", param->lookaheadSlices); + H0(" --lookahead-threads Number of threads to be dedicated to perform lookahead only. Default %d\n", param->lookaheadThreads); H0(" --bframes Maximum number of consecutive b-frames (now it only enables B GOP structure) Default %d\n", param->bframes); H1(" --bframe-bias Bias towards B frame decisions. Default %d\n", param->bFrameBias); H0(" --b-adapt <0..2> 0 - none, 1 - fast, 2 - full (trellis) adaptive B frame scheduling. Default %d\n", param->bFrameAdaptive); @@ -392,6 +415,8 @@ static void showHelp(x265_param *param) " - 1 : First pass, creates stats file\n" " - 2 : Last pass, does not overwrite stats file\n" " - 3 : Nth pass, overwrites stats file\n"); + H0(" --[no-]multi-pass-opt-analysis Refine analysis in 2 pass based on analysis information from pass 1\n"); + H0(" --[no-]multi-pass-opt-distortion Use distortion of CTU from pass 1 to refine qp in 2 pass\n"); H0(" --stats Filename for stats file in multipass pass rate control. Default x265_2pass.log\n"); H0(" --[no-]analyze-src-pics Motion estimation uses source frame planes. Default disable\n"); H0(" --[no-]slow-firstpass Enable a slow first pass in a multipass rate control mode. Default %s\n", OPT(param->rc.bEnableSlowFirstPass)); @@ -400,6 +425,7 @@ static void showHelp(x265_param *param) H0(" --analysis-file Specify file name used for either dumping or reading analysis data.\n"); H0(" --aq-mode Mode for Adaptive Quantization - 0:none 1:uniform AQ 2:auto variance 3:auto variance with bias to dark scenes. Default %d\n", param->rc.aqMode); H0(" --aq-strength Reduces blocking and blurring in flat and textured areas (0 to 3.0). Default %.2f\n", param->rc.aqStrength); + H0(" --[no-]aq-motion Adaptive Quantization based on the relative motion of each CU w.r.t., frame. Default %s\n", OPT(param->bOptCUDeltaQP)); H0(" --qg-size Specifies the size of the quantization group (64, 32, 16, 8). Default %d\n", param->rc.qgSize); H0(" --[no-]cutree Enable cutree for Adaptive Quantization. Default %s\n", OPT(param->rc.cuTree)); H0(" --[no-]rc-grain Enable ratecontrol mode to handle grains specifically. turned on with tune grain. Default %s\n", OPT(param->rc.bEnableGrain)); @@ -446,6 +472,8 @@ static void showHelp(x265_param *param) H0(" --master-display SMPTE ST 2086 master display color volume info SEI (HDR)\n"); H0(" format: G(x,y)B(x,y)R(x,y)WP(x,y)L(max,min)\n"); H0(" --max-cll Emit content light level info SEI as \"cll,fall\" (HDR)\n"); + H0(" --[no-]hdr Control dumping of HDR SEI packet. If max-cll or master-display has non-zero values, this is enabled. Default %s\n", OPT(param->bEmitHDRSEI)); + H0(" --[no-]hdr-opt Add luma and chroma offsets for HDR/WCG content. Default %s\n", OPT(param->bHDROpt)); H0(" --min-luma Minimum luma plane value of input source picture\n"); H0(" --max-luma Maximum luma plane value of input source picture\n"); H0("\nBitstream options:\n"); @@ -456,10 +484,12 @@ static void showHelp(x265_param *param) H0(" --[no-]aud Emit access unit delimiters at the start of each access unit. Default %s\n", OPT(param->bEnableAccessUnitDelimiters)); H1(" --hash Decoded Picture Hash SEI 0: disabled, 1: MD5, 2: CRC, 3: Checksum. Default %d\n", param->decodedPictureHashSEI); H0(" --log2-max-poc-lsb Maximum of the picture order count\n"); - H0(" --[no-]vui-timing-info Discard optional VUI timing information from the bistream. Default %s\n", OPT(param->bEmitVUITimingInfo)); - H0(" --[no-]vui-hrd-info Discard optional HRD timing information from the bistream. Default %s\n", OPT(param->bEmitVUIHRDInfo)); - H0(" --[no-]opt-qp-pps Discard optional HRD timing information from the bistream. Default %s\n", OPT(param->bOptQpPPS)); - H0(" --[no-]opt-ref-list-length-pps Discard optional HRD timing information from the bistream. Default %s\n", OPT(param->bOptRefListLengthPPS)); + H0(" --[no-]vui-timing-info Emit VUI timing information in the bistream. Default %s\n", OPT(param->bEmitVUITimingInfo)); + H0(" --[no-]vui-hrd-info Emit VUI HRD information in the bistream. Default %s\n", OPT(param->bEmitVUIHRDInfo)); + H0(" --[no-]opt-qp-pps Dynamically optimize QP in PPS (instead of default 26) based on QPs in previous GOP. Default %s\n", OPT(param->bOptQpPPS)); + H0(" --[no-]opt-ref-list-length-pps Dynamically set L0 and L1 ref list length in PPS (instead of default 0) based on values in last GOP. Default %s\n", OPT(param->bOptRefListLengthPPS)); + H0(" --[no-]multi-pass-opt-rps Enable storing commonly used RPS in SPS in multi pass mode. Default %s\n", OPT(param->bMultiPassOptRPS)); + H0(" --[no-]opt-cu-delta-qp Optimize to signal consistent CU level delta QPs in frame. Default %s\n", OPT(param->bOptCUDeltaQP)); H1("\nReconstructed video options (debugging):\n"); H1("-r/--recon Reconstructed raw image YUV or Y4M output file name\n"); H1(" --recon-depth Bit-depth of reconstructed raw image file. Defaults to input bit depth, or 8 if Y4M\n");