Beispiel #1
0
        public static Massive EncodeLine(Massive m)
        {
            //Определяем дефолты (с учетом --preset и --tune)
            x265_arguments defaults = new x265_arguments(m.x265options.preset, m.x265options.tune, m.x265options.profile);

            //обнуляем старые строки
            m.vpasses.Clear();

            string line = "";

            if (m.encodingmode == Settings.EncodingModes.OnePass ||
                m.encodingmode == Settings.EncodingModes.TwoPass ||
                m.encodingmode == Settings.EncodingModes.ThreePass)
                line += "--bitrate " + m.outvbitrate;
            else if (m.encodingmode == Settings.EncodingModes.TwoPassSize ||
                m.encodingmode == Settings.EncodingModes.ThreePassSize)
                line += "--size " + m.outvbitrate;
            else if (m.encodingmode == Settings.EncodingModes.Quality ||
                m.encodingmode == Settings.EncodingModes.TwoPassQuality ||
                m.encodingmode == Settings.EncodingModes.ThreePassQuality)
                line += "--crf " + Calculate.ConvertDoubleToPointString((double)m.outvbitrate, 1);
            else if (m.encodingmode == Settings.EncodingModes.Quantizer)
                line += "--qp " + m.outvbitrate;

            //Пресет
            line += " --preset " + m.x265options.preset.ToString().ToLower();

            if (m.x265options.tune != defaults.tune && !m.x265options.extra_cli.Contains("--tune "))
                line += " --tune " + m.x265options.tune.ToString().ToLower();

            if (m.x265options.profile != defaults.profile && !m.x265options.extra_cli.Contains("--profile "))
            {
                if (m.x265options.profile == Profiles.Main) line += " --profile main";
                else if (m.x265options.profile == Profiles.Main444) line += " --profile main444-8";
                else if (m.x265options.profile == Profiles.Main_10) line += " --profile main10";
                else if (m.x265options.profile == Profiles.Main422_10) line += " --profile main422-10";
                else if (m.x265options.profile == Profiles.Main444_10) line += " --profile main444-10";
            }

            if (m.x265options.level != defaults.level && !m.x265options.extra_cli.Contains("--level-idc ") && !m.x265options.extra_cli.Contains("--level "))
                line += " --level-idc " + m.x265options.level;

            if (m.x265options.high_tier != defaults.high_tier && !m.x265options.extra_cli.Contains("--high-tier") && !m.x265options.extra_cli.Contains("--no-high-tier"))
                line += (m.x265options.high_tier) ? " --high-tier" : " --no-high-tier";

            if (m.x265options.lossless != defaults.lossless && !m.x265options.extra_cli.Contains("--lossless") && !m.x265options.extra_cli.Contains("--no-lossless"))
                line += (m.x265options.lossless) ? " --lossless" : " --no-lossless";

            if (m.x265options.reference != defaults.reference && !m.x265options.extra_cli.Contains("--ref "))
                line += " --ref " + m.x265options.reference;

            if (m.x265options.aqmode != defaults.aqmode && !m.x265options.extra_cli.Contains("--aq-mode "))
                line += " --aq-mode " + m.x265options.aqmode;

            if (m.x265options.aqstrength != defaults.aqstrength && m.x265options.aqmode != 0 && !m.x265options.extra_cli.Contains("--aq-strength "))
                line += " --aq-strength " + m.x265options.aqstrength;

            if (m.x265options.cutree != defaults.cutree && !m.x265options.extra_cli.Contains("--cutree") && !m.x265options.extra_cli.Contains("--no-cutree"))
                line += (m.x265options.cutree) ? " --cutree" : " --no-cutree";

            if (!m.x265options.deblocking && defaults.deblocking && !m.x265options.extra_cli.Contains("--no-deblock"))
                line += " --no-deblock";

            if (m.x265options.deblocking && (m.x265options.deblockTC != defaults.deblockTC || m.x265options.deblockBeta != defaults.deblockBeta) &&
                !m.x265options.extra_cli.Contains("--deblock "))
                line += " --deblock " + m.x265options.deblockTC + ":" + m.x265options.deblockBeta;

            if (m.x265options.sao != defaults.sao && !m.x265options.extra_cli.Contains("--sao") && !m.x265options.extra_cli.Contains("--no-sao"))
                line += (m.x265options.sao) ? " --sao" : " --no-sao";

            if (m.x265options.merange != defaults.merange && !m.x265options.extra_cli.Contains("--merange "))
                line += " --merange " + m.x265options.merange;

            if (m.x265options.max_merge != defaults.max_merge && !m.x265options.extra_cli.Contains("--max-merge "))
                line += " --max-merge " + m.x265options.max_merge;

            if (m.x265options.rd != defaults.rd && !m.x265options.extra_cli.Contains("--rd "))
                line += " --rd " + m.x265options.rd;

            if (m.x265options.ctu != defaults.ctu && !m.x265options.extra_cli.Contains("--ctu ") && !m.x265options.extra_cli.Contains("-s "))
                line += " --ctu " + m.x265options.ctu;

            if (m.x265options.max_tu != defaults.max_tu && !m.x265options.extra_cli.Contains("--max-tu-size "))
                line += " --max-tu-size " + m.x265options.max_tu;

            if (m.x265options.cu_lossless != defaults.cu_lossless && !m.x265options.extra_cli.Contains("--cu-lossless") && !m.x265options.extra_cli.Contains("--no-cu-lossless"))
                line += (m.x265options.cu_lossless) ? " --cu-lossless" : " --no-cu-lossless";

            if (m.x265options.early_skip != defaults.early_skip && !m.x265options.extra_cli.Contains("--early-skip") && !m.x265options.extra_cli.Contains("--no-early-skip"))
                line += (m.x265options.early_skip) ? " --early-skip" : " --no-early-skip";

            if (m.x265options.rect != defaults.rect && !m.x265options.extra_cli.Contains("--rect") && !m.x265options.extra_cli.Contains("--no-rect"))
                line += (m.x265options.rect) ? " --rect" : " --no-rect";

            if (m.x265options.amp != defaults.amp && !m.x265options.extra_cli.Contains("--amp") && !m.x265options.extra_cli.Contains("--no-amp"))
                line += (m.x265options.amp) ? " --amp" : " --no-amp";

            if (m.x265options.constr_intra != defaults.constr_intra && !m.x265options.extra_cli.Contains("--constrained-intra") && !m.x265options.extra_cli.Contains("--no-constrained-intra"))
                line += (m.x265options.constr_intra) ? " --constrained-intra" : " --no-constrained-intra";

            if (m.x265options.b_intra != defaults.b_intra && !m.x265options.extra_cli.Contains("--b-intra") && !m.x265options.extra_cli.Contains("--no-b-intra"))
                line += (m.x265options.b_intra) ? " --b-intra" : " --no-b-intra";

            if (m.x265options.bframes != defaults.bframes && !m.x265options.extra_cli.Contains("--bframes "))
                line += " --bframes " + m.x265options.bframes;

            if (m.x265options.b_adapt != defaults.b_adapt && !m.x265options.extra_cli.Contains("--b-adapt ") && !m.x265options.extra_cli.Contains("--no-b-adapt"))
                line += " --b-adapt " + m.x265options.b_adapt;

            if (m.x265options.bpyramid != defaults.bpyramid && !m.x265options.extra_cli.Contains("--b-pyramid") && !m.x265options.extra_cli.Contains("--no-b-pyramid"))
                line += (m.x265options.bpyramid) ? " --b-pyramid" : " --no-b-pyramid";

            if (m.x265options.weightb != defaults.weightb && !m.x265options.extra_cli.Contains("--weightb") && !m.x265options.extra_cli.Contains("--no-weightb"))
                line += (m.x265options.weightb) ? " --weightb" : " --no-weightb";

            if (m.x265options.weightp != defaults.weightp && !m.x265options.extra_cli.Contains("--weightp") && !m.x265options.extra_cli.Contains("--no-weightp"))
                line += (m.x265options.weightp) ? " --weightp" : " --no-weightp";

            if (m.x265options.psyrd != defaults.psyrd && !m.x265options.extra_cli.Contains("--psy-rd "))
                line += " --psy-rd " + Calculate.ConvertDoubleToPointString((double)m.x265options.psyrd, 2);

            if (m.x265options.psyrdoq != defaults.psyrdoq && !m.x265options.extra_cli.Contains("--psy-rdoq "))
                line += " --psy-rdoq " + Calculate.ConvertDoubleToPointString((double)m.x265options.psyrdoq, 2);

            if (m.x265options.threads != defaults.threads && !m.x265options.extra_cli.Contains("--threads "))
                line += " --threads " + m.x265options.threads;

            if (m.x265options.threads_frames != defaults.threads_frames && !m.x265options.extra_cli.Contains("--frame-threads "))
                line += " --frame-threads " + m.x265options.threads_frames;

            if (m.x265options.qcomp != defaults.qcomp && !m.x265options.extra_cli.Contains("--qcomp "))
                line += " --qcomp " + Calculate.ConvertDoubleToPointString((double)m.x265options.qcomp, 2);

            if (m.x265options.ratio_ip != defaults.ratio_ip && !m.x265options.extra_cli.Contains("--ipratio "))
                line += " --ipratio " + Calculate.ConvertDoubleToPointString((double)m.x265options.ratio_ip, 2);

            if (m.x265options.ratio_pb != defaults.ratio_pb && !m.x265options.extra_cli.Contains("--pbratio "))
                line += " --pbratio " + Calculate.ConvertDoubleToPointString((double)m.x265options.ratio_pb, 2);

            if (m.x265options.chroma_offset_cb != defaults.chroma_offset_cb && !m.x265options.extra_cli.Contains("--cbqpoffs "))
                line += " --cbqpoffs " + m.x265options.chroma_offset_cb;

            if (m.x265options.chroma_offset_cr != defaults.chroma_offset_cr && !m.x265options.extra_cli.Contains("--crqpoffs "))
                line += " --crqpoffs " + m.x265options.chroma_offset_cr;

            if (m.x265options.vbv_maxrate != defaults.vbv_maxrate && !m.x265options.extra_cli.Contains("--vbv-maxrate "))
                line += " --vbv-maxrate " + m.x265options.vbv_maxrate;

            if (m.x265options.vbv_bufsize != defaults.vbv_bufsize && !m.x265options.extra_cli.Contains("--vbv-bufsize "))
                line += " --vbv-bufsize " + m.x265options.vbv_bufsize;

            if (m.x265options.vbv_init != defaults.vbv_init && !m.x265options.extra_cli.Contains("--vbv-init "))
                line += " --vbv-init " + Calculate.ConvertDoubleToPointString((double)m.x265options.vbv_init, 2);

            if (m.x265options.subme != defaults.subme && !m.x265options.extra_cli.Contains("--subme "))
                line += " --subme " + m.x265options.subme;

            if (m.x265options.me != defaults.me && !m.x265options.extra_cli.Contains("--me "))
                line += " --me " + m.x265options.me;

            if (m.x265options.slow_firstpass != defaults.slow_firstpass && !m.x265options.extra_cli.Contains("--slow-firstpass") && !m.x265options.extra_cli.Contains("--no-slow-firstpass"))
                line += (m.x265options.slow_firstpass) ? " --slow-firstpass" : " --no-slow-firstpass";

            if (m.x265options.lookahead != defaults.lookahead && !m.x265options.extra_cli.Contains("--rc-lookahead "))
                line += " --rc-lookahead " + m.x265options.lookahead;

            if (m.x265options.gop_min != defaults.gop_min && !m.x265options.extra_cli.Contains("--min-keyint "))
                line += " --min-keyint " + m.x265options.gop_min;

            if (m.x265options.gop_max != defaults.gop_max && !m.x265options.extra_cli.Contains("--keyint "))
                line += " --keyint " + m.x265options.gop_max;

            if (m.x265options.open_gop != defaults.open_gop && !m.x265options.extra_cli.Contains("--open-gop") && !m.x265options.extra_cli.Contains("--no-open-gop"))
                line += (m.x265options.open_gop) ? " --open-gop" : " --no-open-gop";

            if (m.x265options.range_out != defaults.range_out && !m.x265options.extra_cli.Contains("--range "))
                line += " --range " + m.x265options.range_out;

            if (m.x265options.colorprim != defaults.colorprim && !m.x265options.extra_cli.Contains("--colorprim "))
                line += " --colorprim " + ((m.x265options.colorprim == "Undefined") ? "undef" : m.x265options.colorprim);

            if (m.x265options.transfer != defaults.transfer && !m.x265options.extra_cli.Contains("--transfer "))
                line += " --transfer " + ((m.x265options.transfer == "Undefined") ? "undef" : m.x265options.transfer);

            if (m.x265options.colormatrix != defaults.colormatrix && !m.x265options.extra_cli.Contains("--colormatrix "))
                line += " --colormatrix " + ((m.x265options.colormatrix == "Undefined") ? "undef" : m.x265options.colormatrix);

            if (m.x265options.hash != defaults.hash && !m.x265options.extra_cli.Contains("--hash "))
                line += " --hash " + m.x265options.hash;

            if (m.x265options.info != defaults.info && !m.x265options.extra_cli.Contains("--info") && !m.x265options.extra_cli.Contains("--no-info"))
                line += (m.x265options.info) ? " --info" : " --no-info";

            if (m.x265options.aud != defaults.aud && !m.x265options.extra_cli.Contains("--aud") && !m.x265options.extra_cli.Contains("--no-aud"))
                line += (m.x265options.aud) ? " --aud" : " --no-aud";

            if (m.x265options.hrd != defaults.hrd && !m.x265options.extra_cli.Contains("--hrd") && !m.x265options.extra_cli.Contains("--no-hrd"))
                line += (m.x265options.hrd) ? " --hrd" : " --no-hrd";

            if (m.x265options.headers_repeat != defaults.headers_repeat && !m.x265options.extra_cli.Contains("--repeat-headers") && !m.x265options.extra_cli.Contains("--no-repeat-headers"))
                line += (m.x265options.headers_repeat) ? " --repeat-headers" : " --no-repeat-headers";

            if (m.x265options.temp_layers != defaults.temp_layers && !m.x265options.extra_cli.Contains("--temporal-layers") && !m.x265options.extra_cli.Contains("--no-temporal-layers"))
                line += (m.x265options.temp_layers) ? " --temporal-layers" : " --no-temporal-layers";

            if (m.x265options.wpp != defaults.wpp && !m.x265options.extra_cli.Contains("--wpp") && !m.x265options.extra_cli.Contains("--no-wpp"))
                line += (m.x265options.wpp) ? " --wpp" : " --no-wpp";

            if (m.x265options.pmode != defaults.pmode && !m.x265options.extra_cli.Contains("--pmode") && !m.x265options.extra_cli.Contains("--no-pmode"))
                line += (m.x265options.pmode) ? " --pmode" : " --no-pmode";

            if (m.x265options.pme != defaults.pme && !m.x265options.extra_cli.Contains("--pme") && !m.x265options.extra_cli.Contains("--no-pme"))
                line += (m.x265options.pme) ? " --pme" : " --no-pme";

            line += " --extra:";
            if (m.x265options.extra_cli != defaults.extra_cli)
                line += " " + m.x265options.extra_cli;

            //удаляем пустоту в начале
            line = line.TrimStart(new char[] { ' ' });

            //забиваем данные в массив
            if (m.encodingmode == Settings.EncodingModes.OnePass ||
                m.encodingmode == Settings.EncodingModes.Quality ||
                m.encodingmode == Settings.EncodingModes.Quantizer)
                m.vpasses.Add(line);
            else if (m.encodingmode == Settings.EncodingModes.TwoPassQuality)
            {
                m.vpasses.Add("--pass 1 " + line);
                m.vpasses.Add("--pass 2 " + line);
            }
            else if (m.encodingmode == Settings.EncodingModes.ThreePassQuality)
            {
                m.vpasses.Add("--pass 1 " + line);
                m.vpasses.Add("--pass 3 " + line);
                m.vpasses.Add("--pass 2 " + line);
            }
            else if (m.encodingmode == Settings.EncodingModes.TwoPass ||
                m.encodingmode == Settings.EncodingModes.TwoPassSize)
            {
                m.vpasses.Add("--pass 1 " + line);
                m.vpasses.Add("--pass 2 " + line);
            }
            else if (m.encodingmode == Settings.EncodingModes.ThreePass ||
                m.encodingmode == Settings.EncodingModes.ThreePassSize)
            {
                m.vpasses.Add("--pass 1 " + line);
                m.vpasses.Add("--pass 3 " + line);
                m.vpasses.Add("--pass 2 " + line);
            }

            return m;
        }
Beispiel #2
0
        private void SetToolTips()
        {
            //Определяем дефолты (с учетом --preset и --tune)
            //x265_arguments def = new x265_arguments(m.x265options.preset, m.x265options.tune, m.x265options.profile);

            //Определяем дефолты без учета --preset и --tune, т.к. это именно дефолты самого энкодера
            x265_arguments def = new x265_arguments(Presets.Medium, Tunes.None, m.x265options.profile);

            CultureInfo cult_info = new CultureInfo("en-US");
            string _en = "checked", _dis = "unchecked";

            if (m.encodingmode == Settings.EncodingModes.OnePass ||
                m.encodingmode == Settings.EncodingModes.TwoPass ||
                m.encodingmode == Settings.EncodingModes.ThreePass)
                num_bitrate.ToolTip = "Set bitrate (Default: Auto)";
            else if (m.encodingmode == Settings.EncodingModes.TwoPassSize ||
                m.encodingmode == Settings.EncodingModes.ThreePassSize)
                num_bitrate.ToolTip = "Set file size (Default: InFileSize)";
            else if (m.encodingmode == Settings.EncodingModes.Quantizer)
                num_bitrate.ToolTip = "Set target quantizer (" + ((m.x265options.profile.ToString().EndsWith("10")) ? "-12" : "0") + " - 51). Lower - better quality but bigger filesize.\r\n(Default: 28)";
            else
                num_bitrate.ToolTip = "Set target quality (" + ((m.x265options.profile.ToString().EndsWith("10")) ? "-12" : "0") + " - 51). Lower - better quality but bigger filesize.\r\n(Default: 28)";

            combo_mode.ToolTip = "Encoding mode";
            combo_hevc_profile.ToolTip = "Limit HEVC profile (--profile, default: " + def.profile.ToString() + ")\r\n" +
                "Auto - don't set the --profile key\r\nMain, Main 444 - 410, 444 (8 bit depth)\r\nMain 10b, Main 422 10b, Main 444 10b - 410, 422, 444 (10 bit depth)";
            combo_level.ToolTip = "Force a minimum required decoder level (--level-idc, default: Unrestricted)";
            check_high_tier.ToolTip = "If a decoder level is specified, this modifier selects High tier of that level (--[no-]high-tier, default: " + ((def.high_tier) ? _en : _dis) + ")";
            combo_tune.ToolTip = "Tune the settings for a particular type of source or situation (--tune, default: " + def.tune.ToString() + ")";
            if (m.encodingmode == Settings.EncodingModes.Quality ||
                m.encodingmode == Settings.EncodingModes.Quantizer ||
                m.encodingmode == Settings.EncodingModes.TwoPassQuality ||
                m.encodingmode == Settings.EncodingModes.ThreePassQuality)
            {
                slider_preset.ToolTip = "Set encoding preset (--preset, default: Medium):" + Environment.NewLine +
                  "Ultrafast - fastest encoding, but biggest output file size" + Environment.NewLine +
                  "Medium - default, good speed and medium file size" + Environment.NewLine +
                  "Veryslow - high quality encoding, small file size" + Environment.NewLine +
                  "Placebo - super high quality encoding, smallest file size";
            }
            else
            {
                slider_preset.ToolTip = "Set encoding preset (--preset, default: Medium):" + Environment.NewLine +
                    "Ultrafast - fastest encoding, bad quality" + Environment.NewLine +
                    "Medium - default, optimal speed-quality solution" + Environment.NewLine +
                    "Veryslow - high quality encoding" + Environment.NewLine +
                    "Placebo - super high quality encoding";
            }

            check_lossless.ToolTip = "Enable lossless: bypass transform, quant and loop filters globally (--[no-]lossless, default: " + ((def.lossless) ? _en : _dis) + ")";
            check_slow_first.ToolTip = "Enable a slow first pass in a multipass rate control mode (--[no-]slow-firstpass, default: " + ((def.slow_firstpass) ? _en : _dis) + ")";
            combo_subme.ToolTip = "Amount of subpel refinement to perform (--subme, default " + def.subme + ")";
            combo_me.ToolTip = "Motion search method (--me, default: --me " + def.me + ")\r\n" +
                "Diamond Search, fast (--me dia)\r\nHexagonal Search (--me hex)\r\nUneven Multi-Hexagon Search (--me umh)\r\n" +
                "Star Search (--me star)\r\nFull Search, slow (--me full)";
            combo_merange.ToolTip = "Motion search range (--merange, default: " + def.merange + ")";
            combo_max_merge.ToolTip = "Maximum number of merge candidates (--max-merge, default: " + def.max_merge + ")";
            combo_rd.ToolTip = "Level of RD in mode decision (--rd, default: " + def.rd + ")";
            combo_ctu.ToolTip = "Maximum CU size, WxH (--ctu, default: " + def.ctu + ")";
            combo_max_tu.ToolTip = "Maximum TU size (<= CU size), WxH (--max-tu-size, default: " + def.max_tu + ")";
            check_weightedp.ToolTip = "Enable weighted prediction in P slices (--[no-]weightp, default: " + ((def.weightp) ? _en : _dis) + ")";
            check_weightedb.ToolTip = "Enable weighted prediction in B slices (--[no-]weightb, default: " + ((def.weightb) ? _en : _dis) + ")";
            check_cu_lossless.ToolTip = "Consider lossless mode in CU RDO decisions (--[no-]cu-lossless, default: " + ((def.cu_lossless) ? _en : _dis) + ")";
            check_early_skip.ToolTip = "Enable early SKIP detection (--[no-]early-skip, default: " + ((def.early_skip) ? _en : _dis) + ")";
            check_rect.ToolTip = "Enable rectangular motion partitions Nx2N and 2NxN (--[no-]rect, default: " + ((def.rect) ? _en : _dis) + ")";
            check_amp.ToolTip = "Enable asymmetric motion partitions, requires rectangular MP (--[no-]amp, default: " + ((def.amp) ? _en : _dis) + ")";
            check_constr_intra.ToolTip = "Constrained intra prediction; use only intra coded reference pixels (--[no-]constrained-intra, default: " + ((def.constr_intra) ? _en : _dis) + ")";
            check_b_intra.ToolTip = "Enable intra in B frames (--[no-]b-intra, default: " + ((def.b_intra) ? _en : _dis) + ")";

            combo_bframes.ToolTip = "Maximum number of consecutive b-frames; now it only enables B GOP structure (--bframes, default: " + def.bframes + ")";
            combo_badapt_mode.ToolTip = "Adaptive B frame scheduling (--b-adapt, default: " + (def.b_adapt == 0 ? "Disabled)" : def.b_adapt == 1 ? "Fast)" : "Full)");
            combo_bpyramid_mode.ToolTip = "Use B-frames as references (--[no-]b-pyramid, default: " + ((def.bpyramid)? "Enabled)" : "Disabled)");
            combo_ref.ToolTip = "Max. number of L0 references to be allowed (--ref, default: " + def.reference + ")";
            combo_open_gop.ToolTip = "Enable open-GOP, allows I slices to be non-IDR (--[no-]open-gop, default: " + ((def.open_gop) ? "Yes)" : "No)");
            num_min_gop.ToolTip = "Scenecuts closer together than this are coded as I, not IDR (--min-keyint, default: " + def.gop_min + ")\r\n0 - Auto";
            num_max_gop.ToolTip = "Max IDR period in frames (--keyint, default: " + def.gop_max + ")";
            num_lookahead.ToolTip = "Number of frames for frame-type lookahead; determines encoder latency (--rc-lookahead, default: " + def.lookahead + ")";
            check_deblocking.ToolTip = "Enable deblocking loop filter (--[no-]deblock, default: " + ((def.deblocking) ? _en : _dis) + ")";
            combo_dstrength.ToolTip = "Deblocking filter tC offset (--deblock, default: " + def.deblockTC + ":x)";
            combo_dthreshold.ToolTip = "Deblocking filter Beta offset (--deblock, default: x:" + def.deblockBeta + ")";
            check_sao.ToolTip = "Enable Sample Adaptive Offset (--[no-]sao, default: " + ((def.sao) ? _en : _dis) + ")";
            num_qcomp.ToolTip = "Weight given to predicted complexity (--qcomp, default: " + def.qcomp.ToString(cult_info) + ")";
            num_ratio_ip.ToolTip = "QP factor between I and P (--ipratio, default: " + def.ratio_ip.ToString(cult_info) + ")";
            num_ratio_pb.ToolTip = "QP factor between P and B (--pbratio, default: " + def.ratio_pb.ToString(cult_info) + ")";
            num_chroma_qpb.ToolTip = "Chroma Cb QP offset (--cbqpoffs, , default: " + def.chroma_offset_cb + ")";
            num_chroma_qpr.ToolTip = "Chroma Cr QP offset (--crqpoffs, , default: " + def.chroma_offset_cr + ")";
            num_vbv_max.ToolTip = "Max local bitrate, kbit/s (--vbv-maxrate, default: " + def.vbv_maxrate + ")";
            num_vbv_buf.ToolTip = "Set size of the VBV buffer, kbit (--vbv-bufsize, default: " + def.vbv_bufsize + ")";
            num_vbv_init.ToolTip = "Initial VBV buffer occupancy (--vbv-init, default: " + def.vbv_init.ToString(cult_info) + ")";
            combo_adapt_quant_mode.ToolTip = "Mode for Adaptive Quantization (--aq-mode, default: " + ((def.aqmode == 0) ? "None" : def.aqmode == 1 ? "VAQ" : "A-VAQ") + ")\r\n" +
                        "None - disabled, 0\r\nVAQ - variance AQ (uniform), 1\r\nA-VAQ - auto-variance AQ, 2";
            combo_adapt_quant.ToolTip = "AQ Strength (--ag-strength, default: " + def.aqstrength + ")\r\n" +
                        "Reduces blocking and blurring in flat and textured areas: 0.5 - weak AQ, 1.5 - strong AQ";
            check_cutree.ToolTip = "Enable CUTtree for Adaptive Quantization (--[no-]cutree, default: " + ((def.cutree) ? _en : _dis) + ")";
            num_psyrd.ToolTip = "Strength of psycho-visual rate distortion optimization (--psy-rd, default: " + def.psyrd.ToString(cult_info) + ")";
            num_psyrdoq.ToolTip = "Strength of psycho-visual optimization in quantization (--psy-rdoq, default: " + def.psyrdoq.ToString(cult_info) + ")";
            combo_range_out.ToolTip = "Specify black level and range of luma and chroma signals (--range, default: Auto)";
            combo_colorprim.ToolTip = "Specify color primaries (--colorprim, default: " + def.colorprim + ")";
            combo_transfer.ToolTip = "Specify transfer characteristics (--transfer, default: " + def.transfer + ")";
            combo_colormatrix.ToolTip = "Specify color matrix setting (--colormatrix, default: " + def.colormatrix + ")";
            combo_hash.ToolTip = "Decoded Picture Hash SEI (--hash, default: " + ((def.hash == 0) ? "None)" : (def.hash == 1) ? "MD5)" : (def.hash == 2) ? "CRC)" : "Checksum)");
            check_info.ToolTip = "Emit SEI identifying encoder and parameters (--[no-]info, default: " + ((def.info) ? _en : _dis) + ")";
            check_aud.ToolTip = "Emit Access Unit Delimiters at the start of each access unit (--[no-]aud, default: " + ((def.aud) ? _en : _dis) + ")";
            check_hrd.ToolTip = "Enable HRD parameters signaling (--[no-]hrd, default: " + ((def.hrd) ? _en : _dis) + ")";
            check_headers.ToolTip = "Emit SPS and PPS headers at each keyframe (--[no-]repeat-headers, default: " + ((def.headers_repeat) ? _en : _dis) + ")";
            check_temp_layers.ToolTip = "Enable a temporal sublayer for unreferenced B frames (--[no-]temporal-layers, default: " + ((def.temp_layers) ? _en : _dis) + ")";
            check_wpp.ToolTip = "Enable Wavefront Parallel Processing (--[no-]wpp, default: " + ((def.wpp) ? _en : _dis) + ")";
            check_pmode.ToolTip = "Enable parallel mode analysis (--[no-]pmode, default: " + ((def.pmode) ? _en : _dis) + ")";
            check_pme.ToolTip = "Enable parallel motion estimation (--[no-]pme, default: " + ((def.pme) ? _en : _dis) + ")";
            combo_threads_count.ToolTip = "Number of threads for thread pool (--threads, default: Auto)";
            combo_threads_frames.ToolTip = "Number of concurrently encoded frames (--frame-threads, default: Auto)";
        }
Beispiel #3
0
        private void slider_preset_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            if (slider_preset.IsFocused || slider_preset.IsMouseOver)
            {
                //Создаем новые параметры с учетом --preset, и берем от них только те, от которых зависит пресет
                m.x265options.preset = (Presets)Enum.ToObject(typeof(Presets), (int)slider_preset.Value);
                x265_arguments defaults = new x265_arguments(m.x265options.preset, m.x265options.tune, m.x265options.profile);

                m.x265options.lookahead = defaults.lookahead;
                m.x265options.ctu = defaults.ctu;
                m.x265options.merange = defaults.merange;
                m.x265options.b_adapt = defaults.b_adapt;
                m.x265options.subme = defaults.subme;
                m.x265options.me = defaults.me;
                m.x265options.early_skip = defaults.early_skip;
                m.x265options.sao = defaults.sao;
                m.x265options.weightp = defaults.weightp;
                m.x265options.rd = defaults.rd;
                m.x265options.reference = defaults.reference;
                m.x265options.aqmode = defaults.aqmode;
                m.x265options.aqstrength = defaults.aqstrength;
                m.x265options.cutree = defaults.cutree;
                m.x265options.amp = defaults.amp;
                m.x265options.rect = defaults.rect;
                m.x265options.max_merge = defaults.max_merge;
                m.x265options.bframes = defaults.bframes;
                m.x265options.weightb = defaults.weightb;
                m.x265options.slow_firstpass = defaults.slow_firstpass;
                m.x265options.b_intra = defaults.b_intra;

                /*
                scenecutThreshold     scenecut
                bEnableSignHiding     signhide
                bEnableFastIntra      fast-intra
                tuQTMaxInterDepth     tu-inter-depth
                tuQTMaxIntraDepth     tu-intra-depth
                bEnableTransformSkip  tskip
                */

                root_window.UpdateOutSize();
                root_window.UpdateManualProfile();
                m = DecodeLine(m); //Пересчитываем параметры из CLI в m.x265options (это нужно для "--extra:")
                LoadFromProfile(); //Выставляем значения из m.x265options в элементы управления
            }
        }
Beispiel #4
0
        private void combo_tune_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if ((combo_tune.IsDropDownOpen || combo_tune.IsSelectionBoxHighlighted) && combo_tune.SelectedIndex != -1)
            {
                //Создаем новые параметры с учетом --tune, и берем от них только те, от которых зависит tune
                m.x265options.tune = (Tunes)Enum.ToObject(typeof(Tunes), combo_tune.SelectedIndex);
                x265_arguments defaults = new x265_arguments(m.x265options.preset, m.x265options.tune, m.x265options.profile);

                m.x265options.deblockBeta = defaults.deblockBeta;
                m.x265options.deblockTC = defaults.deblockTC;
                m.x265options.b_intra = defaults.b_intra;
                m.x265options.psyrdoq = defaults.psyrdoq;
                m.x265options.psyrd = defaults.psyrd;
                m.x265options.ratio_ip = defaults.ratio_ip;
                m.x265options.ratio_pb = defaults.ratio_pb;
                m.x265options.aqmode = defaults.aqmode;
                m.x265options.aqstrength = defaults.aqstrength;
                m.x265options.qcomp = defaults.qcomp;
                m.x265options.deblocking = defaults.deblocking;
                m.x265options.sao = defaults.sao;
                m.x265options.weightp = defaults.weightp;
                m.x265options.weightb = defaults.weightb;
                m.x265options.b_intra = defaults.b_intra;

                /* zerolatency
                m.x265options.b_adapt = defaults.b_adapt;
                m.x265options.bframes = defaults.bframes;
                m.x265options.lookahead = defaults.lookahead;
                m.x265options.cutree = defaults.cutree;
                m.x265options.threads_frames = defaults.threads_frames;
                */

                /*
                scenecutThreshold     scenecut
                */

                root_window.UpdateOutSize();
                root_window.UpdateManualProfile();
                m = DecodeLine(m); //Пересчитываем параметры из CLI в m.x265options (это нужно для "--extra:")
                LoadFromProfile(); //Выставляем значения из m.x265options в элементы управления
            }
        }