public static void AddIVTC(FieldOrder order, bool hybrid, bool mostlyFilm, List <DeinterlaceFilter> filters) { StringBuilder script = new StringBuilder(); if (order == FieldOrder.TFF) { script.Append("AssumeTFF()."); } else if (order == FieldOrder.BFF) { script.Append("AssumeBFF()."); } script.Append("Telecide(guide=1).Decimate("); if (hybrid) { if (mostlyFilm) { script.Append("mode=3,"); } else { script.Append("mode=1,"); } script.Append("threshold=2.0"); } script.Append(")"); filters.Add(new DeinterlaceFilter( "Decomb IVTC", script.ToString())); }
public async Task <IActionResult> PutFieldOrder([FromRoute] int id, [FromBody] FieldOrder fieldOrder) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != fieldOrder.AutoId) { return(BadRequest()); } _context.Entry(fieldOrder).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FieldOrderExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
private void finishProcessing() { if (error) { finishedAnalysis(null, true, errorMessage); return; } if (!continueWorking) { return; } if (fieldOrder == FieldOrder.VARIABLE && d2vFileName.Length == 0) // We are stuck for field order information, lets just go for what we have most of { fieldOrder = (bffCount > tffCount) ? FieldOrder.BFF : FieldOrder.TFF; } SourceInfo info = new SourceInfo(); info.sourceType = type; info.decimateM = decimateM; info.fieldOrder = fieldOrder; info.majorityFilm = majorityFilm; finishedAnalysis(info, false, null); }
public static void AddYadif(FieldOrder order, List <DeinterlaceFilter> filters, bool bobber) { filters.Add(new DeinterlaceFilter( bobber ? "Yadif (with Bob)" : "Yadif", string.Format("Load_Stdcall_Plugin(\"{0}\"){1}Yadif({2}order={3})", MainForm.Instance.Settings.YadifPath, Environment.NewLine, bobber ? "mode=1, " : "", Order(order)))); }
public static void AddYadif(FieldOrder order, List <DeinterlaceFilter> filters) { filters.Add(new DeinterlaceFilter( "Yadif", string.Format("Load_Stdcall_Plugin(\"{0}\"){1}Yadif(order={2})", MainForm.Instance.Settings.YadifPath, Environment.NewLine, Order(order)))); }
public static void AddYadif(FieldOrder order, List <DeinterlaceFilter> filters) { filters.Add(new DeinterlaceFilter( "Yadif", string.Format("Load_Stdcall_Plugin(\"{0}\"){1}Yadif(order={2})", @"C:\programs\MeGUI\tools\avisynth_plugin\yadif.dll", Environment.NewLine, Order(order)))); }
public static void AddYadif(FieldOrder order, List <DeinterlaceFilter> filters, bool bobber) { string path = Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "yadifmod2.dll"); filters.Add(new DeinterlaceFilter( bobber ? "Yadif (with Bob)" : "Yadif", string.Format("LoadPlugin(\"{0}\"){1}Yadifmod2({2}order={3})", path, Environment.NewLine, bobber ? "mode=1, " : "", Order(order)))); }
public ActionResult <FieldOrder> Create([FromBody] FieldOrder fieldOrder) { if (fieldOrder == null || !ModelState.IsValid) { return(BadRequest()); } _fieldOderRepository.Create(fieldOrder); return(CreatedAtAction(nameof(GetFieldOrderById), new { fieldOrderId = fieldOrder.FieldOrderID }, fieldOrder)); }
public async Task <IActionResult> PostFieldOrder([FromBody] FieldOrder fieldOrder) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.FieldOrder.Add(fieldOrder); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFieldOrder", new { id = fieldOrder.AutoId }, fieldOrder)); }
void OrderFields(FieldOrder fieldOrder) { if (fieldOrder == FieldOrder.First) { OrderFieldToControl(pnlFirstFields, pnlSecondFields); } else if (fieldOrder == FieldOrder.Second) { OrderFieldToControl(pnlSecondFields, pnlFirstFields); } }
public ActionResult Update([FromBody] FieldOrder fieldOrder) { var e = GetFieldOrderById(fieldOrder.FieldOrderID); if (e == null) { return(BadRequest()); } _fieldOderRepository.Update(fieldOrder); return(NoContent()); }
public static void AddTMC(FieldOrder order, List <DeinterlaceFilter> filters) { string strPluginPath = Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "TomsMoComp.dll"); if (!File.Exists(strPluginPath)) { return; } filters.Add(new DeinterlaceFilter( "TomsMoComp", string.Format("LoadPlugin(\"{0}\"){1}TomsMoComp({2},5,1)", strPluginPath, Environment.NewLine, Order(order)))); }
public static int Order(FieldOrder order) { int i_order = -1; if (order == FieldOrder.BFF) { i_order = 0; } if (order == FieldOrder.TFF) { i_order = 1; } return(i_order); }
public static void AddTDeint(FieldOrder order, List <DeinterlaceFilter> filters, bool processAll, bool eedi2, bool bob) { StringBuilder script = new StringBuilder(); script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "TDeint.dll") + "\")\r\n"); if (eedi2) { script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "EEDI2.dll") + "\")\r\n"); script.Append("edeintted = last."); if (order == FieldOrder.TFF) { script.Append("AssumeTFF()."); } else if (order == FieldOrder.BFF) { script.Append("AssumeBFF()."); } script.Append("SeparateFields()."); if (!bob) { script.Append("SelectEven()."); } script.Append("EEDI2(field=-1)\r\n"); } script.Append("TDeint("); if (bob) { script.Append("mode=1,"); } if (order != FieldOrder.VARIABLE) { script.Append("order=" + Order(order) + ","); } if (!processAll) // For hybrid clips { script.Append("full=false,"); } if (eedi2) { script.Append("edeint=edeintted,"); } script = new StringBuilder(script.ToString().TrimEnd(new char[] { ',' })); script.Append(")"); filters.Add(new DeinterlaceFilter( bob ? (eedi2 ? "TDeint (with EDI + Bob)" : "TDeint (with Bob)") : (eedi2 ? "TDeint (with EDI)" : "TDeint"), script.ToString())); }
public static string GetFixedFieldString(string FOrder) { FieldOrder eFOrder = (FieldOrder)Enum.Parse(typeof(FieldOrder), FOrder); if (eFOrder == FieldOrder.UNKNOWN) { return("Unknown"); } else if (eFOrder == FieldOrder.VARIABLE) { return("Variable"); } else { return(FOrder); } }
public void AddField(string fieldName, System.Data.DbType fieldType, int length, bool isPrimaryKey, bool requireUnique, FieldOrder searchOrder) { if (this.Registered & !this.AllowRuntimeChanges) throw new InvalidOperationException("The Entity is already registered, it cannot be modified"); if (this.Registered & isPrimaryKey) throw new ArgumentException("The Entity is already registered, you cannot add a primary key", "isPrimaryKey"); var attr = new FieldAttribute(); attr.FieldName = fieldName; attr.DataType = fieldType; attr.AllowsNulls = !isPrimaryKey; attr.IsPrimaryKey = isPrimaryKey; attr.IsIdentity = EntityAttribute.KeyScheme == KeyScheme.Identity & isPrimaryKey & this.Fields.KeyFields.Count <= 0; attr.Length = length; attr.RequireUniqueValue = requireUnique; attr.SearchOrder = searchOrder; this.Fields.Add(attr); if (this.Registered && EntityDefinitionChanged != null) EntityDefinitionChanged.Invoke(this, new EntityTypeChangedArgs(this, attr)); }
private void button_analyse_Click(object sender, System.Windows.RoutedEventArgs e) { SourceDetector sd = new SourceDetector(m); if (sd.IsErrors) { //Сбрасываем результаты m.interlace_results = null; SetAnalyseToolTip(); } else if (sd.m != null) { DeinterlaceType olddeint = m.deinterlace; FieldOrder oldfo = m.fieldOrder; SourceType olditype = m.interlace; m = sd.m.Clone(); if (m.deinterlace != olddeint || m.fieldOrder != oldfo || m.interlace != olditype) { m = Format.GetOutInterlace(m); m = Calculate.UpdateOutFramerate(m); SetFramerateCombo(m.outframerate); //обновляем форму combo_fieldorder.SelectedItem = GetFixedFieldString(m.fieldOrder.ToString()); combo_sourcetype.SelectedItem = GetFixedSTypeString(m.interlace.ToString()); combo_deinterlace.SelectedValue = m.deinterlace; combo_outinterlace.SelectedItem = Format.GetCodecOutInterlace(m); //обновляем конечное колличество фреймов, с учётом режима деинтерелейса m = Calculate.UpdateOutFrames(m); m.outfilesize = Calculate.GetEncodingSize(m); Refresh(); } //Выводим результаты SetAnalyseToolTip(); } }
public static DataOrder GetDataOrder(this FieldOrder order) { switch (order) { case FieldOrder.Big: return(DataOrder.Big); case FieldOrder.InversedMiddle: return(DataOrder.InversedMiddle); case FieldOrder.Little: return(DataOrder.Little); case FieldOrder.Middle: return(DataOrder.Middle); } throw new NotSupportedException($"FieldOrder Not Supported {order}"); }
private void AnalyseFF() { if ((((double)oSourceInfo.sectionCountTFF + (double)oSourceInfo.sectionCountBFF) / 100.0 * (double)settings.HybridFOPercent) > oSourceInfo.sectionCountBFF) { analysis += "Source is declared tff by a margin of " + oSourceInfo.sectionCountTFF + " to " + oSourceInfo.sectionCountBFF + "."; fieldOrder = FieldOrder.TFF; } else if ((((double)oSourceInfo.sectionCountTFF + (double)oSourceInfo.sectionCountBFF) / 100.0 * (double)settings.HybridFOPercent) > oSourceInfo.sectionCountTFF) { analysis += "Source is declared bff by a margin of " + oSourceInfo.sectionCountBFF + " to " + oSourceInfo.sectionCountTFF + "."; fieldOrder = FieldOrder.BFF; } else { analysis += "Source is hybrid bff and tff at " + oSourceInfo.sectionCountBFF + " bff and " + oSourceInfo.sectionCountTFF + " tff."; fieldOrder = FieldOrder.VARIABLE; } FinishProcessing(); }
public static void AddFieldDeint(FieldOrder order, List <DeinterlaceFilter> filters, bool processAll, bool blend) { string name = "FieldDeinterlace"; if (!blend) { name = "FieldDeinterlace (no blend)"; } StringBuilder script = new StringBuilder(); script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "Decomb.dll") + "\")\r\n"); if (order == FieldOrder.TFF) { script.Append("AssumeTFF()."); } else if (order == FieldOrder.BFF) { script.Append("AssumeBFF()."); } script.Append("FieldDeinterlace("); if (!blend) { script.Append("blend=false"); } if (!processAll) { if (!blend) { script.Append(","); } script.Append("full=false"); } script.Append(")"); filters.Add(new DeinterlaceFilter( name, script.ToString())); }
public static void AddFieldDeint(FieldOrder order, List <DeinterlaceFilter> filters, bool processAll, bool blend) { string name = "FieldDeinterlace"; if (!blend) { name = "FieldDeinterlace (no blend)"; } StringBuilder script = new StringBuilder(); if (order == FieldOrder.TFF) { script.Append("AssumeTFF()."); } else if (order == FieldOrder.BFF) { script.Append("AssumeBFF()."); } script.Append("FieldDeinterlace("); if (!blend) { script.Append("blend=false"); } if (!processAll) { if (!blend) { script.Append(","); } script.Append("full=false"); } script.Append(")"); filters.Add(new DeinterlaceFilter( name, script.ToString())); }
public static void AddTDeint(FieldOrder order, List <DeinterlaceFilter> filters, bool processAll, bool eedi2) { StringBuilder script = new StringBuilder(); if (eedi2) { script.Append("edeintted = last."); if (order == FieldOrder.TFF) { script.Append("AssumeTFF()."); } else if (order == FieldOrder.BFF) { script.Append("AssumeBFF()."); } script.Append("SeparateFields().SelectEven().EEDI2(field=-1)\r\n"); } script.Append("TDeint("); if (order != FieldOrder.VARIABLE) { script.Append("order=" + Order(order) + ","); } if (!processAll) // For hybrid clips { script.Append("full=false,"); } if (eedi2) { script.Append("edeint=edeintted,"); } script = new StringBuilder(script.ToString().TrimEnd(new char[] { ',' })); script.Append(")"); filters.Add(new DeinterlaceFilter( eedi2 ? "TDeint (with EDI)" : "TDeint", script.ToString())); }
private void FinishProcessing() { _mre.Set(); // Make sure nothing is waiting for pause to stop isStopped = true; if (error) { finishedAnalysis(null, ExitType.ERROR, errorMessage); return; } if (!continueWorking) { finishedAnalysis(null, ExitType.ABORT, String.Empty); return; } if (fieldOrder == FieldOrder.VARIABLE && d2vFileName.Length == 0) // We are stuck for field order information, lets just go for what we have most of { fieldOrder = (bffCount > tffCount) ? FieldOrder.BFF : FieldOrder.TFF; } SourceInfo info = new SourceInfo(); info.sourceType = type; if (type == SourceType.DECIMATING) { info.decimateM = decimateM; } info.fieldOrder = fieldOrder; info.majorityFilm = majorityFilm; info.analysisResult = analysis; info.isAnime = isAnime; finishedAnalysis(info, ExitType.OK, String.Empty); }
// public static System.Web.Mvc.SelectList ToSelectList<TEnum>(this TEnum obj) //where TEnum : struct, IComparable, IFormattable, IConvertible // { // return new SelectList(TicketPriority.GetValues(typeof(TEnum)) // .OfType<TicketPriority>() // .Select(x => new SelectListItem // { // Text = TicketPriority.GetName(typeof(TEnum), x), // Value = (Convert.ToInt32(x)) // .ToString() // }), "Value", "Text"); // } public JsonResult GetFields() { //string[] str; //List<string[]> s = new List<string[]>(); //s.Add(new string[] { "name", "Subject" }); //s.Add(new string[] { "name", "StatusName" }); string s = @"[{ ""name"": ""Subject"" }, { ""name"": ""Status"" }]"; int uid = Convert.ToInt32(Session["uid"]); //List<FieldOrder> fl = FieldOrder.GetByuid(uid); //s = "["; //foreach (FieldOrder f in fl) //{ // s += @"{ ""name"": """+ f.FieldName +@""" },"; //} //s += s.TrimEnd(',') + "]"; //s = @"[{ ""name"": ""Subject"" }, { ""name"": ""Status"" }]"; s = FieldOrder.GetFields(uid); return(Json(s, JsonRequestBehavior.AllowGet)); }
public static void AddIVTC(FieldOrder order, bool hybrid, bool mostlyFilm, List <DeinterlaceFilter> filters) { StringBuilder script = new StringBuilder(); script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "Decomb.dll") + "\")\r\n"); if (order == FieldOrder.TFF) { script.Append("AssumeTFF()."); } else if (order == FieldOrder.BFF) { script.Append("AssumeBFF()."); } script.Append("Telecide(guide=1).Decimate("); if (hybrid) { if (mostlyFilm) { script.Append("mode=3,"); } else { script.Append("mode=1,"); } script.Append("threshold=2.0"); } script.Append(")"); filters.Add(new DeinterlaceFilter( "Decomb IVTC", script.ToString())); }
public static void AddTIVTC(string d2vFile, bool anime, bool hybrid, bool mostlyFilm, bool advancedDeinterlacing, FieldOrder fieldOrder, List<DeinterlaceFilter> filters) { StringBuilder script = new StringBuilder(); script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "TIVTC.dll") + "\")\r\n"); if (advancedDeinterlacing) { script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "EEDI2.dll") + "\")\r\n"); script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "TDeint.dll") + "\")\r\n"); script.Append("edeintted = "); if (fieldOrder == FieldOrder.TFF) script.Append("AssumeTFF()."); else if (fieldOrder == FieldOrder.BFF) script.Append("AssumeBFF()."); script.AppendFormat("SeparateFields().SelectEven().EEDI2(field=-1)\r\n"); script.Append("tdeintted = TDeint(edeint=edeintted"); if (fieldOrder != FieldOrder.VARIABLE) script.Append(",order=" + Order(fieldOrder)); script.Append(")\r\n"); } script.Append("tfm("); if (d2vFile.Length <= 0) script.AppendFormat("order={0}", Order(fieldOrder)); if (advancedDeinterlacing) { if (d2vFile.Length <= 0) script.Append(","); script.Append("clip2=tdeintted"); } script.Append(")"); script.Append(".tdecimate("); if (anime) script.Append("mode=1"); if (hybrid) { if (anime) script.Append(","); if (mostlyFilm) script.Append("hybrid=1"); else script.Append("hybrid=3"); } script.Append(")"); filters.Add(new DeinterlaceFilter( advancedDeinterlacing ? "TIVTC + TDeint(EDI) -- slow" : "TIVTC", script.ToString())); }
public override object[] Fetch(Type entityType, int fetchCount, int firstRowOffset, string sortField, FieldOrder sortOrder, FilterCondition filter, bool fillReferences, bool filterReferences) { throw new NotSupportedException("Fetch is not currently supported with this Provider."); }
public static void AddTIVTC(string d2vFile, bool anime, bool hybrid, bool mostlyFilm, bool advancedDeinterlacing, FieldOrder fieldOrder, List <DeinterlaceFilter> filters) { StringBuilder script = new StringBuilder(); script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "TIVTC.dll") + "\")\r\n"); if (advancedDeinterlacing) { script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "EEDI2.dll") + "\")\r\n"); script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "TDeint.dll") + "\")\r\n"); script.Append("edeintted = "); if (fieldOrder == FieldOrder.TFF) { script.Append("AssumeTFF()."); } else if (fieldOrder == FieldOrder.BFF) { script.Append("AssumeBFF()."); } script.AppendFormat("SeparateFields().SelectEven().EEDI2(field=-1)\r\n"); script.Append("tdeintted = TDeint(edeint=edeintted"); if (fieldOrder != FieldOrder.VARIABLE) { script.Append(",order=" + Order(fieldOrder)); } script.Append(")\r\n"); } script.Append("tfm("); if (d2vFile.Length <= 0) { script.AppendFormat("order={0}", Order(fieldOrder)); } if (advancedDeinterlacing) { if (d2vFile.Length <= 0) { script.Append(","); } script.Append("clip2=tdeintted"); } script.Append(")"); script.Append(".tdecimate("); if (anime) { script.Append("mode=1"); } if (hybrid) { if (anime) { script.Append(","); } if (mostlyFilm) { script.Append("hybrid=1"); } else { script.Append("hybrid=3"); } } script.Append(")"); filters.Add(new DeinterlaceFilter( advancedDeinterlacing ? "TIVTC + TDeint(EDI) -- slow" : "TIVTC", script.ToString())); }
private void analyseFF(string filename) { CultureInfo ci = new CultureInfo("en-us"); StreamReader instream; try { instream = new StreamReader(filename); } catch (Exception) { instream = null; error = true; errorMessage = "Opening the field order analysis file failed."; finishProcessing(); return; } int countA = 0, countB = 0, countEqual = 0; int localCountA = 0, localCountB = 0, sectionCountA = 0, sectionCountB = 0; double sumA = 0, sumB = 0; double valueA, valueB; int count = 0; string line = instream.ReadLine(); while (line != null) { if (count != 0 && line.IndexOf("-1.#IND00") == -1) //Scene change or unexptected value -> ignore { string[] contents = line.Split(new char[] { '-' }); try { valueA = Double.Parse(contents[0], ci); valueB = Double.Parse(contents[1], ci); } catch (Exception) { error = true; errorMessage = "Unexpected value in file " + filename + "\r\n" + "This error should not have occurred. Please report it on \r\n" + "post it on http://sourceforge.net/projects/megui with the file named above."; errorMessage += "\r\nMore debugging info:\r\n" + "Line contents: " + line + "\r\n"; finishProcessing(); return; } if (valueA > valueB) { countA++; localCountA++; } else if (valueB > valueA) { countB++; localCountB++; } else countEqual++; sumA += valueA; sumB += valueB; } count++; if (count == 10) { count = 0; // Truly interlaced sections should always make one of the counts be 5 and the other 0. // Progressive sections will be randomly distributed between localCountA and localCountB, // so this algorithm successfully ignores those sections. // Film sections will always have two frames which show the actual field order, and the other // frames will show an arbitrary field order. This algorithm (luckily) seems to work very well // with film sections as well. Using this thresholding as opposed to just comparing countB to countA // produces _much_ more heavily-sided results. if (localCountA > localCountB && localCountB == 0) sectionCountA++; if (localCountB > localCountA && localCountA == 0) sectionCountB++; localCountA = 0; localCountB = 0; } line = instream.ReadLine(); } instream.Close(); if ((((double)sectionCountA +(double)sectionCountB) / 100.0 * (double)settings.HybridFOPercent) > sectionCountB) { analysis += "Source is declared tff by a margin of " + sectionCountA + " to " + sectionCountB + "."; fieldOrder = FieldOrder.TFF; } else if ((((double)sectionCountA +(double)sectionCountB) / 100.0 * (double)settings.HybridFOPercent) > sectionCountA) { analysis += "Source is declared bff by a margin of " + sectionCountB + " to " + sectionCountA + "."; fieldOrder = FieldOrder.BFF; } else { analysis += "Source is hybrid bff and tff at " + sectionCountB + " bff and " + sectionCountA + " tff."; fieldOrder = FieldOrder.VARIABLE; } tffCount = countA; bffCount = countB; finishProcessing(); }
public static void AddLeakDeint(FieldOrder order, List <DeinterlaceFilter> filters) { filters.Add(new DeinterlaceFilter( "LeakKernelDeint", string.Format("LoadPlugin(\"{0}\"){1}LeakKernelDeint(order={2},sharp=true)", Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "LeakKernelDeint.dll"), Environment.NewLine, Order(order)))); }
public static void AddFieldDeint(FieldOrder order, List<DeinterlaceFilter> filters, bool processAll, bool blend) { string name = "FieldDeinterlace"; if (!blend) name = "FieldDeinterlace (no blend)"; StringBuilder script = new StringBuilder(); script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "Decomb.dll") + "\")\r\n"); if (order == FieldOrder.TFF) script.Append("AssumeTFF()."); else if (order == FieldOrder.BFF) script.Append("AssumeBFF()."); script.Append("FieldDeinterlace("); if (!blend) script.Append("blend=false"); if (!processAll) { if (!blend) script.Append(","); script.Append("full=false"); } script.Append(")"); filters.Add(new DeinterlaceFilter( name, script.ToString())); }
private void finishProcessing() { if (error) { finishedAnalysis(null, true, errorMessage); return; } if (!continueWorking) { return; } if (fieldOrder == FieldOrder.VARIABLE && d2vFileName.Length == 0) // We are stuck for field order information, lets just go for what we have most of fieldOrder = (bffCount > tffCount) ? FieldOrder.BFF : FieldOrder.TFF; SourceInfo info = new SourceInfo(); info.sourceType = type; info.decimateM = decimateM; info.fieldOrder = fieldOrder; info.majorityFilm = majorityFilm; finishedAnalysis(info, false, null); }
public static void AddLeakDeint(FieldOrder order, List<DeinterlaceFilter> filters) { filters.Add(new DeinterlaceFilter( "LeakKernelDeint", string.Format("LoadPlugin(\"{0}\"){1}LeakKernelDeint(order={2},sharp=true)", Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "LeakKernelDeint.dll"), Environment.NewLine, Order(order)))); }
public static void AddIVTC(FieldOrder order, bool hybrid, bool mostlyFilm, List<DeinterlaceFilter> filters) { StringBuilder script = new StringBuilder(); script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "Decomb.dll") + "\")\r\n"); if (order == FieldOrder.TFF) script.Append("AssumeTFF()."); else if (order == FieldOrder.BFF) script.Append("AssumeBFF()."); script.Append("Telecide(guide=1).Decimate("); if (hybrid) { if (mostlyFilm) script.Append("mode=3,"); else script.Append("mode=1,"); script.Append("threshold=2.0"); } script.Append(")"); filters.Add(new DeinterlaceFilter( "Decomb IVTC", script.ToString())); }
public static void AddTDeint(FieldOrder order, List<DeinterlaceFilter> filters, bool processAll, bool eedi2, bool bob) { StringBuilder script = new StringBuilder(); script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "TDeint.dll") + "\")\r\n"); if (eedi2) { script.Append("LoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "EEDI2.dll") + "\")\r\n"); script.Append("edeintted = last."); if (order == FieldOrder.TFF) script.Append("AssumeTFF()."); else if (order == FieldOrder.BFF) script.Append("AssumeBFF()."); script.Append("SeparateFields().SelectEven().EEDI2(field=-1)\r\n"); } script.Append("TDeint("); if (bob) script.Append("mode=1,"); if (order != FieldOrder.VARIABLE) script.Append("order=" + Order(order) + ","); if (!processAll) // For hybrid clips script.Append("full=false,"); if (eedi2) script.Append("edeint=edeintted,"); script = new StringBuilder(script.ToString().TrimEnd(new char[] { ',' })); script.Append(")"); filters.Add(new DeinterlaceFilter( bob ? (eedi2 ? "TDeint (with EDI + Bob)" : "TDeint (with Bob)") : (eedi2 ? "TDeint (with EDI)" : "TDeint"), script.ToString())); }
protected override string VerifyIndex(string entityName, string fieldName, FieldOrder searchOrder, IDbConnection connection) { bool localConnection = false; if (connection == null) { localConnection = true; connection = GetConnection(true); } try { var indexName = string.Format("ORM_IDX_{0}_{1}_{2}", entityName, fieldName, searchOrder == FieldOrder.Descending ? "DESC" : "ASC"); if (m_indexNameCache.FirstOrDefault(ii => ii.Name == indexName) != null) { return(indexName); } using (var command = GetNewCommandObject()) { command.Connection = connection; var sql = string.Format("SELECT COUNT(*) FROM sqlite_master WHERE type = 'index' AND name = '{0}'", indexName); command.CommandText = sql; var i = (long)command.ExecuteScalar(); if (i == 0) { sql = string.Format("CREATE INDEX {0} ON {1}({2} {3})", indexName, entityName, fieldName, searchOrder == FieldOrder.Descending ? "DESC" : string.Empty); Debug.WriteLine(sql); command.CommandText = sql; command.ExecuteNonQuery(); } var indexinfo = new IndexInfo { Name = indexName, MaxCharLength = -1 }; m_indexNameCache.Add(indexinfo); } return(indexName); } finally { if (localConnection) { DoneWithConnection(connection, true); } } }
public void Create(FieldOrder fieldOrder) { _context.FieldOrders.InsertOne(fieldOrder); }
public static int Order(FieldOrder order) { int i_order = -1; if (order == FieldOrder.BFF) i_order = 0; if (order == FieldOrder.TFF) i_order = 1; return i_order; }
private void AnalyseFields(string filename, int SelectLength) { StreamReader instream = new StreamReader(filename); int count = 0, countA = 0, countB = 0; double valueA, valueB; string line = instream.ReadLine(); while (line != null && !IsAborted && !IsErrors) { count++; string[] contents = line.Split(new char[] { '-' }); valueA = Double.Parse(contents[0], new CultureInfo("en-US")); valueB = Double.Parse(contents[1], new CultureInfo("en-US")); if (valueA > valueB) countA++; else if (valueB > valueA) countB++; if (count == SelectLength) //10 { //Секция = SelectLength, а не просто 10. //------ // Truly interlaced sections should always make one of the counts be 5 and the other 0. // Progressive sections will be randomly distributed between localCountA and localCountB, // so this algorithm successfully ignores those sections. // Film sections will always have two frames which show the actual field order, and the other // frames will show an arbitrary field order. This algorithm (luckily) seems to work very well // with film sections as well. Using this thresholding as opposed to just comparing countB to countA // produces _much_ more heavily-sided results. if (countA > countB && countB == 0) sectionCountA++; if (countB > countA && countA == 0) sectionCountB++; countA = countB = count = 0; } line = instream.ReadLine(); } instream.Close(); if (sectionCountA == 0 && sectionCountB == 0) { field_order = FieldOrder.UNKNOWN; } else if ((Math.Min(sectionCountA, sectionCountB) * 100.0 / (Math.Max(sectionCountA, sectionCountB) * Math.Pow(FOPercent, 1.0 / 20))) >= FOPercent || sectionCountA == sectionCountB) { field_order = FieldOrder.VARIABLE; } else if (sectionCountA > sectionCountB) { field_order = FieldOrder.TFF; } else if (sectionCountA < sectionCountB) { field_order = FieldOrder.BFF; } }
private void AnalyseFields(string filename, int SelectLength) { StreamReader instream = new StreamReader(filename); int count = 0, countA = 0, countB = 0; double valueA, valueB; string line = instream.ReadLine(); while (line != null && !IsAborted && !IsErrors) { count++; string[] contents = line.Split(new char[] { '-' }); valueA = Double.Parse(contents[0], new CultureInfo("en-US")); valueB = Double.Parse(contents[1], new CultureInfo("en-US")); if (valueA > valueB) { countA++; } else if (valueB > valueA) { countB++; } if (count == SelectLength) //10 { //Секция = SelectLength, а не просто 10. //------ // Truly interlaced sections should always make one of the counts be 5 and the other 0. // Progressive sections will be randomly distributed between localCountA and localCountB, // so this algorithm successfully ignores those sections. // Film sections will always have two frames which show the actual field order, and the other // frames will show an arbitrary field order. This algorithm (luckily) seems to work very well // with film sections as well. Using this thresholding as opposed to just comparing countB to countA // produces _much_ more heavily-sided results. if (countA > countB && countB == 0) { sectionCountA++; } if (countB > countA && countA == 0) { sectionCountB++; } countA = countB = count = 0; } line = instream.ReadLine(); } instream.Close(); if (sectionCountA == 0 && sectionCountB == 0) { field_order = FieldOrder.UNKNOWN; } else if ((Math.Min(sectionCountA, sectionCountB) * 100.0 / (Math.Max(sectionCountA, sectionCountB) * Math.Pow(FOPercent, 1.0 / 20))) >= FOPercent || sectionCountA == sectionCountB) { field_order = FieldOrder.VARIABLE; } else if (sectionCountA > sectionCountB) { field_order = FieldOrder.TFF; } else if (sectionCountA < sectionCountB) { field_order = FieldOrder.BFF; } }
public static void AddTMC(FieldOrder order, List<DeinterlaceFilter> filters) { filters.Add(new DeinterlaceFilter( "TomsMoComp", string.Format("LoadPlugin(\"{0}\"){1}TomsMoComp({2},5,1)", Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "TomsMoComp.dll"), Environment.NewLine, Order(order)))); }
public void Update(FieldOrder fieldOrder) { _context.FieldOrders.ReplaceOne(order => order.FieldOrderID == fieldOrder.FieldOrderID, fieldOrder); }
public static void AddYadif(FieldOrder order, List<DeinterlaceFilter> filters, bool bobber) { filters.Add(new DeinterlaceFilter( bobber ? "Yadif (with Bob)" : "Yadif", string.Format("Load_Stdcall_Plugin(\"{0}\"){1}Yadif({2}order={3})", MainForm.Instance.Settings.YadifPath, Environment.NewLine, bobber ? "mode=1, " : "", Order(order)))); }