Alex Bikfalvi
SimStream Documentation
StreamBufferMulti.h
00001 #pragma once 00002 00003 #include "StreamBufferLayer.h" 00004 00005 class CStreamBufferMulti 00006 { 00007 private: 00008 __uint32 numLayers; 00009 00010 __uint32 size; 00011 __uint32 sizeHistory; 00012 __uint32 sizePlay; 00013 __byte sizeGop; 00014 __uint32 sizeGopLayer; 00015 00016 __uint32 currentIndex; 00017 00018 CStreamBufferLayer** buffers; 00019 00020 public: 00021 CStreamBufferMulti( 00022 __uint32 numLayers, 00023 __uint32 size, 00024 __uint32 sizeHistory, 00025 __byte sizeGop 00026 ); 00027 ~CStreamBufferMulti(); 00028 00029 inline __uint32 IndexToLayer(__uint32 index) { return (index / this->sizeGop) % this->numLayers; } 00030 inline __uint32 IndexToLayerIndex(__uint32 index) { return this->sizeGop * (index / this->sizeGopLayer) + (index % this->sizeGop); } 00031 inline __uint32 LayerIndexToIndex(__uint32 layerIndex, __uint32 layer) { return this->sizeGopLayer * (layerIndex / this->sizeGop) + (layer * this->sizeGop) + (layerIndex % this->sizeGop); } 00032 inline __uint32 IndexToLayerBaseIndex(__uint32 index) { return this->sizeGop * (index / this->sizeGop); } 00033 00034 void Reset(__uint32 index); 00035 bool Add(__uint32 layer, CStreamFrame frame); 00036 void Shift(); 00037 00038 inline __uint32 Size() { return this->size; } 00039 inline __uint32 SizePlay() { return this->sizePlay; } 00040 inline __uint32 SizeHistory() { return this->sizeHistory; } 00041 00042 inline __uint32 Count(__uint32 layer) { assert(layer < this->numLayers); return this->buffers[layer]->Count(); } 00043 inline __uint32 NumPlay(__uint32 layer) { assert(layer < this->numLayers); return this->buffers[layer]->NumPlay(); } 00044 inline __uint32 NumHistory(__uint32 layer) { assert(layer < this->numLayers); return this->buffers[layer]->NumHistory(); } 00045 00046 bool Has(__uint32 index); 00047 bool HasCurrentIndex(); 00048 00049 inline __uint32 CurrentIndex() { return this->currentIndex; } 00050 inline __uint32 LayerIndex(__uint32 layer) { assert(layer < this->numLayers); return this->buffers[layer]->CurrentIndex(); } 00051 CStreamFrame* CurrentFrame(); 00052 00053 bool IsCurrentDecodable(); 00054 bool IsCurrentIndependent(); 00055 bool IsDecodable(__uint32 index); 00056 00057 void Log(); 00058 }; 00059
Last updated: February 8, 2011