コード例 #1
0
 void InitializeNewContext(AmtEncodingInstruction inst, uint currentIndex)
 {
     mCurrentContext = new AmtEncoderContext
     {
         Category = inst.Category,
         First    = currentIndex,
         Last     = currentIndex,
     };
     mContexts.Add(mCurrentContext);
 }
コード例 #2
0
        public void Chunk(List <AmtEncodingInstruction> instructions)
        {
            var contexts = new List <AmtEncoderContext>();
            AmtEncoderContext currentContext = null;
            var count = (uint)instructions.Count;

            for (uint i = 0; i < count; ++i)
            {
                var inst = instructions[(int)i];
                if (currentContext == null)
                {
                    currentContext = new AmtEncoderContext
                    {
                        Category = inst.Category,
                        First    = i,
                        Last     = i,
                    };
                    contexts.Add(currentContext);
                }
                else
                {
                    if (currentContext.Category == inst.Category)
                    {
                        currentContext.Last = i;
                    }
                    else
                    {
                        currentContext = new AmtEncoderContext
                        {
                            Category = inst.Category,
                            First    = i,
                            Last     = i,
                        };
                        contexts.Add(currentContext);
                    }
                }
            }
        }
コード例 #3
0
 public void Clear()
 {
     mContexts.Clear();
     mInstructions.Clear();
     mCurrentContext = null;
 }
コード例 #4
0
 public AmtIncrementalChunkifier()
 {
     mContexts       = new List <AmtEncoderContext>();
     mInstructions   = new List <AmtRecordInstruction>();
     mCurrentContext = null;
 }