public static List <DeinterlaceFilter> GetDeinterlacers(SourceInfo info) { List <DeinterlaceFilter> filters = new List <DeinterlaceFilter>(); if (info.sourceType == SourceType.PROGRESSIVE) { filters.Add(new DeinterlaceFilter( "Do nothing", "#Not doing anything because the source is progressive")); } else if (info.sourceType == SourceType.DECIMATING) { ScriptServer.AddTDecimate(info.decimateM, filters); } else if (info.sourceType == SourceType.INTERLACED) { ScriptServer.AddYadif(info.fieldOrder, filters); ScriptServer.AddTDeint(info.fieldOrder, filters, true, false); ScriptServer.AddTDeint(info.fieldOrder, filters, true, true); if (info.fieldOrder != FieldOrder.VARIABLE) { ScriptServer.AddLeakDeint(info.fieldOrder, filters); } ScriptServer.AddTMC(info.fieldOrder, filters); ScriptServer.AddFieldDeint(info.fieldOrder, filters, true, true); ScriptServer.AddFieldDeint(info.fieldOrder, filters, true, false); } else if (info.sourceType == SourceType.FILM) { ScriptServer.AddTIVTC("", info.isAnime, false, true, false, info.fieldOrder, filters); ScriptServer.AddIVTC(info.fieldOrder, false, true, filters); } else if (info.sourceType == SourceType.HYBRID_FILM_INTERLACED || info.sourceType == SourceType.HYBRID_PROGRESSIVE_FILM) { ScriptServer.AddTIVTC("", info.isAnime, true, info.majorityFilm, false, info.fieldOrder, filters); ScriptServer.AddTIVTC("", info.isAnime, true, info.majorityFilm, true, info.fieldOrder, filters); ScriptServer.AddIVTC(info.fieldOrder, true, info.majorityFilm, filters); } else if (info.sourceType == SourceType.HYBRID_PROGRESSIVE_INTERLACED) { ScriptServer.AddYadif(info.fieldOrder, filters); ScriptServer.AddTDeint(info.fieldOrder, filters, false, false); ScriptServer.AddTDeint(info.fieldOrder, filters, false, true); ScriptServer.AddFieldDeint(info.fieldOrder, filters, false, true); ScriptServer.AddFieldDeint(info.fieldOrder, filters, false, false); if (info.fieldOrder != FieldOrder.VARIABLE) { ScriptServer.AddLeakDeint(info.fieldOrder, filters); } ScriptServer.AddTMC(info.fieldOrder, filters); } return(filters); }
private void finishProcessing() { if (error) { finishedAnalysis(null, 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; } #region script generation if (type == SourceType.NOT_ENOUGH_SECTIONS) { filters.Add(new DeinterlaceFilter( "Do nothing (Source Detection is stuck)", "#Not doing anything because I have no idea what is going on")); } else if (type == SourceType.PROGRESSIVE) { filters.Add(new DeinterlaceFilter( "Do nothing", "#Not doing anything because the source is progressive")); } else if (type == SourceType.DECIMATING) { ScriptServer.AddTDecimate(decimateM, filters); } else if (type == SourceType.INTERLACED) { ScriptServer.AddTDeint(fieldOrder, filters, true, true); ScriptServer.AddTDeint(fieldOrder, filters, true, false); if (fieldOrder != FieldOrder.VARIABLE) { ScriptServer.AddLeakDeint(fieldOrder, filters); } ScriptServer.AddTMC(fieldOrder, filters); ScriptServer.AddFieldDeint(fieldOrder, filters, true, true); ScriptServer.AddFieldDeint(fieldOrder, filters, true, false); } else if (type == SourceType.FILM) { ScriptServer.AddTIVTC(d2vFileName, isAnime, false, true, false, fieldOrder, filters); ScriptServer.AddIVTC(fieldOrder, false, true, filters); } else if (type == SourceType.HYBRID_FILM_INTERLACED || type == SourceType.HYBRID_PROGRESSIVE_FILM) { ScriptServer.AddTIVTC(d2vFileName, isAnime, true, majorityFilm, true, fieldOrder, filters); ScriptServer.AddTIVTC(d2vFileName, isAnime, true, majorityFilm, false, fieldOrder, filters); ScriptServer.AddIVTC(fieldOrder, true, majorityFilm, filters); } else if (type == SourceType.HYBRID_PROGRESSIVE_INTERLACED) { if (usingPortions) { ScriptServer.AddTDeint(fieldOrder, filters, true, true); ScriptServer.AddTDeint(fieldOrder, filters, true, false); if (fieldOrder != FieldOrder.VARIABLE) { ScriptServer.AddLeakDeint(fieldOrder, filters); } ScriptServer.AddTMC(fieldOrder, filters); ScriptServer.AddFieldDeint(fieldOrder, filters, true, true); ScriptServer.AddFieldDeint(fieldOrder, filters, true, false); ScriptServer.Portionize(filters, trimmedFilteredLine); } else { ScriptServer.AddTDeint(fieldOrder, filters, false, true); ScriptServer.AddTDeint(fieldOrder, filters, false, false); ScriptServer.AddFieldDeint(fieldOrder, filters, false, true); ScriptServer.AddFieldDeint(fieldOrder, filters, false, false); if (fieldOrder != FieldOrder.VARIABLE) { ScriptServer.AddLeakDeint(fieldOrder, filters); } ScriptServer.AddTMC(fieldOrder, filters); } } #endregion finishedAnalysis( new DetectResult { Text = analysis, FieldOrder = fieldOrder, Type = type }, filters.ToArray(), false, null); }