示例#1
0
        public override void Encode(IntField image, Stream output)
        {
            image.ArgbTo4c();
            switch (_mode)
            {
            case 0:
                SetCounter("mispredicts-h", image.PredictionEnTransformXor(SeerH));
                AddImageGrayscale(image, "xformed-h");
                break;

            case 1:
                image.Transpose();
                SetCounter("mispredicts-v", image.PredictionEnTransformXor(SeerV));
                image.Transpose();
                AddImageGrayscale(image, "xformed-v");
                break;

            case 2:
                SetCounter("mispredicts-h", image.PredictionEnTransformXor(SeerH));
                AddImageGrayscale(image, "xformed-h");
                image.Transpose();
                SetCounter("mispredicts-v", image.PredictionEnTransformXor(SeerV));
                image.Transpose();
                AddImageGrayscale(image, "xformed-v");
                break;

            case 3:
                image.Transpose();
                SetCounter("mispredicts-v", image.PredictionEnTransformXor(SeerV));
                image.Transpose();
                AddImageGrayscale(image, "xformed-v");
                SetCounter("mispredicts-h", image.PredictionEnTransformXor(SeerH));
                AddImageGrayscale(image, "xformed-h");
                break;

            default:
                throw new Exception();
            }

            base.Encode(image, output);
        }