protected Intra16X16LumaAbstractPredictor(int x, int y, Macroblock macroblock, IAlgorithmFactory algorithms)
        {
            this.x = x;
            this.y = y;
            access = macroblock.MacroblockAccess;
            info = new MacroblockInfo(macroblock);
            transform = algorithms.CreateTransform();
            quantizer = algorithms.CreateQuantizer();
            distortion = algorithms.CreateDistortionMetric();
            scanner = algorithms.CreateScanner();
            mOrig = new int[mbHeight][];
            for (var i = 0; i < mOrig.Length; i++)
                mOrig[i] = new int[mbWidth];

            mResd = new int[mbHeight][];
            for (var i = 0; i < mResd.Length; i++)
                mResd[i] = new int[mbWidth];

            mPred = new int[mbHeight][];
            for (var i = 0; i < mPred.Length; i++)
                mPred[i] = new int[mbWidth];

            mDc = new int[dcHeight][];
            for (var i = 0; i < mDc.Length; i++)
                mDc[i] = new int[dcWidth];
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates an instance of <see cref="JwtDecoder" />.
 /// </summary>
 /// <param name="jsonSerializer">The Json Serializer.</param>
 /// <param name="jwtValidator">The Jwt validator.</param>
 /// <param name="urlEncoder">The Base64 URL Encoder.</param>
 /// <param name="algFactory">The Algorithm Factory.</param>
 public JwtDecoder(IJsonSerializer jsonSerializer, IJwtValidator jwtValidator, IBase64UrlEncoder urlEncoder, IAlgorithmFactory algFactory)
 {
     _jsonSerializer = jsonSerializer;
     _jwtValidator   = jwtValidator;
     _urlEncoder     = urlEncoder;
     _algFactory     = algFactory;
 }
		internal EnvelopeCryptoProvider(IDataKeyProvider dataKeyProvider, IEnvelopeCryptoConfig config, IAlgorithmFactory algorithmFactory)
		{
			if (dataKeyProvider == null)
			{
				throw new ArgumentNullException("dataKeyProvider");
			}
			_dataKeyProvider = dataKeyProvider;
			_config = config;
			_algorithmFactory = algorithmFactory;
		}
Exemplo n.º 4
0
 internal EnvelopeCryptoProvider(IDataKeyProvider dataKeyProvider, IEnvelopeCryptoConfig config, IAlgorithmFactory algorithmFactory)
 {
     if (dataKeyProvider == null)
     {
         throw new ArgumentNullException("dataKeyProvider");
     }
     _dataKeyProvider  = dataKeyProvider;
     _config           = config;
     _algorithmFactory = algorithmFactory;
 }
Exemplo n.º 5
0
 public void InitAlgos()
 {
     SelectedAlgorithm = null;
     Algorithms.Clear();
     IAlgorithmFactory.GetAllAlgorithms().ForEach((algo) =>
     {
         Dispatcher.Invoke(() => Algorithms.Add(new ListBoxItem {
             Content = algo
         }));
     });
 }
Exemplo n.º 6
0
        private void Init()
        {
            generator           = new ObjectGenerator();
            containerFactory    = new ContainerFactory();
            factory             = new AlgorithmFactory();
            algorithmProperties = new AlgorithmProperties();
            results             = new AlgorithmExecutionResults();
            stopwatch           = new Stopwatch();

            HandleDimensionalityChange();
        }
Exemplo n.º 7
0
        public ServerFunctions()
        {
            Port             = 8080;
            ListBoxLog       = new ObservableCollection <ListBoxItem>();
            HealthInterval   = 15000;
            ipAddress        = IPAddress.Parse("127.0.0.1");
            Servers          = new List <Server>();
            Buffersize       = 1024;
            Algorithms       = new ObservableCollection <ListBoxItem>();
            AlgoFactory      = new IAlgorithmFactory();
            CurrentAlgorithm = null;
            Sessions         = new List <Session>();

            InitAlgos();
            ServerHealthCheck();
        }
Exemplo n.º 8
0
        public static IProvider <ISelection> CreateSelections(IAlgorithmFactory algorithm, PeaSettings settings, ParameterSet parameterSet, IRandom random, IFitnessComparer fitnessComparer)
        {
            var selections = algorithm.GetSelections();

            //TODO: impement override by settings

            var selectionProvider = CreateProvider <ISelection>(selections.Count, random);

            foreach (var selectionType in selections)
            {
                var selectionInstance = (ISelection)Activator.CreateInstance(selectionType, random, fitnessComparer, parameterSet);
                selectionProvider.Add(selectionInstance, 1.0);
            }

            return(selectionProvider);
        }
Exemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AlgorithmFactories" /> class.
 /// </summary>
 /// <param name="assignAlgorithmFactory">The assign algorithm factory.</param>
 /// <param name="readAlgorithmFactory">The read algorithm factory.</param>
 /// <param name="commitAlgorithmFactory">The commit algorithm factory.</param>
 /// <param name="memoryAlgorithmFactory">The memory algorithm factory.</param>
 /// <param name="mergeAlgorithmFactory">The merge algorithm factory.</param>
 /// <param name="printAlgorithmFactory">The print algorithm factory.</param>
 public AlgorithmFactories(
     IAlgorithmFactory <IAssignAlgorithm> assignAlgorithmFactory,
     IAlgorithmFactory <IReadAlgorithm> readAlgorithmFactory,
     IAlgorithmFactory <ICommitAlgorithm> commitAlgorithmFactory,
     IAlgorithmFactory <IMemoryAlgorithm> memoryAlgorithmFactory,
     IAlgorithmFactory <IMergeAlgorithm> mergeAlgorithmFactory,
     IAlgorithmFactory <IPrintAlgorithm> printAlgorithmFactory
     )
 {
     this.AssignAlgorithmFactory = assignAlgorithmFactory;
     this.ReadAlgorithmFactory   = readAlgorithmFactory;
     this.CommitAlgorithmFactory = commitAlgorithmFactory;
     this.MemoryAlgorithmFactory = memoryAlgorithmFactory;
     this.MergeAlgorithmFactory  = mergeAlgorithmFactory;
     this.PrintAlgorithmFactory  = printAlgorithmFactory;
 }
Exemplo n.º 10
0
        private static IProvider <IReplacement> CreateReinsertions(IAlgorithmFactory algorithm, PeaSettings settings, ParameterSet parameterSet, IRandom random, IFitnessComparer fitnessComparer)
        {
            var reinsertions = algorithm.GetReinsertions();

            //TODO: impement override by settings


            var reinsertionProvider = CreateProvider <IReplacement>(reinsertions.Count, random);

            foreach (var reinsertion in reinsertions)
            {
                var reinsertionInstance = (IReplacement)Activator.CreateInstance(reinsertion, random, fitnessComparer, parameterSet);
                reinsertionProvider.Add(reinsertionInstance, 1.0);
            }

            return(reinsertionProvider);
        }
 public Intra8X8ChromaHorizontalPredictor(int x, int y, Macroblock macroblock, IAlgorithmFactory algorithms)
     : base(x, y, macroblock, algorithms)
 {
 }
 public Intra16X16LumaPlanePredictor(int x, int y, Macroblock macroblock, IAlgorithmFactory algorithms)
     : base(x, y, macroblock, algorithms)
 {
 }
Exemplo n.º 13
0
 public HomeController(IAlgorithmFactory algorithmFactory, IEmbederFactory embederFactory, IDetectorFactory detectorFactory)
 {
     _algorithmFactory = algorithmFactory;
     _embederFactory = embederFactory;
     _detectorFactory = detectorFactory;
 }
Exemplo n.º 14
0
 public StringEncryptor(IAlgorithmFactory algorithmFactory, ICryptoSettings settings)
 {
     this.settings         = settings;
     this.algorithmFactory = algorithmFactory;
 }
Exemplo n.º 15
0
 public AesService()
 {
     _dataProcessor    = new BlockProcessor();
     _padDataProcessor = new BlockPaddingProcessor();
     _algorithmFactory = new AesAlgorithmFactory(new BlockPaddingProcessor());
 }
Exemplo n.º 16
0
 /// <summary>
 /// Sets JWT algorithm factory.
 /// </summary>
 /// <returns>Current builder instance.</returns>
 public JwtBuilder WithAlgorithmFactory(IAlgorithmFactory algFactory)
 {
     _algFactory = algFactory;
     return(this);
 }
Exemplo n.º 17
0
 /// <summary>
 /// Creates an instance of <see cref="JwtDecoder" />
 /// </summary>
 /// <param name="jsonSerializer">The Json Serializer</param>
 /// <param name="jwtValidator">The Jwt validator</param>
 /// <param name="urlEncoder">The Base64 URL Encoder</param>
 /// <param name="algFactory">The Algorithm Factory</param>
 /// <exception cref="ArgumentNullException" />
 public JwtDecoder(IJsonSerializer jsonSerializer, IJwtValidator jwtValidator, IBase64UrlEncoder urlEncoder, IAlgorithmFactory algFactory)
     : this(jsonSerializer, urlEncoder)
 {
     _jwtValidator = jwtValidator ?? throw new ArgumentNullException(nameof(jwtValidator));
     _algFactory   = algFactory ?? throw new ArgumentNullException(nameof(algFactory));
 }
 public static ISymmetricAlgorithm CreateAlgorithm(this IAlgorithmFactory self, IEnvelopeCryptoConfig config)
 {
     return(self.CreateAlgorithm(config.AlgorithmName, config.KeyBits, config.Mode, config.Padding));
 }