예제 #1
0
        public override Tile[] DoAction(Tile[] inputs)
        {
            this.Input = inputs;

            Triplet <byte[, ]>  triplet       = inputs.FirstOrDefault().GetMatrices <byte>();
            Triplet <short[, ]> resultTriplet = RFXPEncoderWrapper.RGBToYUV(triplet.X, triplet.Y, triplet.Z);
            Tile output = Tile.FromMatrices <short>(resultTriplet);

            this.Result = new[] { output };
            return(new[] { output });
        }
예제 #2
0
        public sealed override Tile[] DoAction(Tile[] inputs)
        {
            short[,] x, y, z;
            this.Input = inputs;

            Triplet <short[, ]> triplet = inputs.FirstOrDefault().GetMatrices <short>();

            RFXPEncoderWrapper.Quantization(triplet.X, QuantArray.quants[0], ParamUseReduceExtrapolate.Enabled, out x);
            RFXPEncoderWrapper.Quantization(triplet.Y, QuantArray.quants[1], ParamUseReduceExtrapolate.Enabled, out y);
            RFXPEncoderWrapper.Quantization(triplet.Z, QuantArray.quants[2], ParamUseReduceExtrapolate.Enabled, out z);

            var  resultTriplet = new Triplet <short[, ]>(x, y, z);
            Tile output        = Tile.FromMatrices <short>(resultTriplet);

            this.Result = new[] { output };
            return(new[] { output });
        }
예제 #3
0
        public override Tile[] DoAction(Tile[] inputs)
        {
            short[] x, y, z;
            this.Input = inputs;

            Triplet <short[, ]> triplet = inputs.FirstOrDefault().GetMatrices <short>();

            //// better use foreach, instead of repeating the code..
            RFXPEncoderWrapper.Linearaztion_NoLL3Delta(triplet.X, ParamUseReduceExtrapolate.Enabled, out x);
            RFXPEncoderWrapper.Linearaztion_NoLL3Delta(triplet.Y, ParamUseReduceExtrapolate.Enabled, out y);
            RFXPEncoderWrapper.Linearaztion_NoLL3Delta(triplet.Z, ParamUseReduceExtrapolate.Enabled, out z);

            var  resultTriplet = new Triplet <short[]>(x, y, z);
            Tile output        = Tile.FromArrays <short>(resultTriplet);

            this.Result = new[] { output };
            return(new[] { output });
        }
예제 #4
0
        public override Tile[] DoAction(Tile[] inputs)
        {
            this.Input = inputs;

            List <Triplet <short[]> > triplets = null;
            Tile input = inputs.FirstOrDefault();

            RFXPEncoderWrapper.ProgressiveQuantization(input.GetArrays <short>(), ProgQuants, ParamUseReduceExtrapolate.Enabled, out triplets);

            List <Tile> tiles = new List <Tile>();

            foreach (var triplet in triplets)
            {
                tiles.Add(Tile.FromArrays <short>(triplet));
            }

            this.Result = tiles.ToArray();
            return(tiles.ToArray());
        }
예제 #5
0
        public override Tile[] DoAction(Tile[] inputs)
        {
            this.Input = inputs;

            Triplet <short[]> preFrame = null;
            Triplet <short[]> triplet  = null;
            bool        useDiffing     = false;
            ICodecParam param          = Parameters.ContainsKey(Constants.PARAM_NAME_PREVIOUS_FRAME) ? Parameters[Constants.PARAM_NAME_PREVIOUS_FRAME] : null;

            if (param != null && param is Frame)
            {
                preFrame = ((Frame)param).Tile.GetArrays <short>();
            }

            RFXPEncoderWrapper.SubBandDiffing(inputs.FirstOrDefault().GetArrays <short>(), preFrame, ParamUseReduceExtrapolate.Enabled, out triplet, out useDiffing);
            ParamUseDifferenceTile.Enabled = useDiffing;
            Tile output = Tile.FromArrays <short>(triplet);

            this.Result = new[] { output };
            return(new[] { output });
        }
예제 #6
0
        // The output format is
        // firstPass [X, Y, Z]
        // ProgressivePass1 [encodedX, encodedY, encodedZ]
        // ProgressivePass1 [rawX, rawY, rawZ]
        // ...
        public override Tile[] DoAction(Tile[] inputs)
        {
            this.Input = inputs;

            var inputList = new List <Triplet <short[]> >();

            foreach (var input in inputs)
            {
                inputList.Add(input.GetArrays <short>());
            }
            List <Triplet <byte[]> > triplets = null;

            RFXPEncoderWrapper.RLGR_SRLEncode(inputList, ProgQuants, Mode, ParamUseReduceExtrapolate.Enabled, out triplets);

            List <Tile> tiles = new List <Tile>();

            foreach (var triplet in triplets)
            {
                tiles.Add(Tile.FromArrays <byte>(triplet));
            }

            this.Result = tiles.ToArray();
            return(tiles.ToArray());
        }