public static void BitrateLookupEncode(Func <int, string> encodeFunc, Func <string, double> getSize) { int limit = ArgList.Get(Arg.LIMIT).AsInt(); int delta = ArgList.Get(Arg.AUTOLIMIT_DELTA).AsInt(); LinearBitrateLookup bl = new LinearBitrateLookup(limit - delta / 2); int size = 0; while (!(limit - size < delta && size < limit)) { int newTarget = bl.GetTarget(); if (newTarget == -1) { break; } string result = encodeFunc(newTarget); size = (int)getSize(result); bl.AddPoint(newTarget, size); } }
public static void BitrateLookupEncode(Func<int, string> encodeFunc, Func<string, double> getSize) { int limit = ArgList.Get(Arg.LIMIT).AsInt(); int delta = ArgList.Get(Arg.AUTOLIMIT_DELTA).AsInt(); LinearBitrateLookup bl = new LinearBitrateLookup(limit - delta / 2); int size = 0; while (!(limit - size < delta && size < limit)) { int newTarget = bl.GetTarget(); if (newTarget == -1) break; string result = encodeFunc(newTarget); size = (int)getSize(result); bl.AddPoint(newTarget, size); } }