Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

GOP.cpp

Go to the documentation of this file.
00001 
00007 #include <stdio.h>
00008 #include "GOP.hpp"
00009 #include "Frame.hpp"
00010 #include "Stream.hpp"
00011 #include "FrameVector.hpp"
00012 
00013 
00014 GOP::GOP(Stream* s, uint pat_i) {
00015     stream = s;
00016     patNo = pat_i;
00017     master = true;
00018     refCount = 1;
00019     isSubopt = false;
00020 }
00021 
00022 GOP::GOP(Stream * s, uint mod_i, uint pat_i) {
00023     stream = s;
00024     modNo = mod_i;
00025     patNo = pat_i;
00026     master = false;
00027     refCount = 1;
00028     isSubopt = false;
00029 }
00030 
00031 GOP::~GOP() {
00032 }
00033 
00034 
00035 void GOP::addFrame(Frame * f) {
00036     frameList.append(f);
00037 }
00038 
00039 uint GOP::getFrameCount() {
00040         return frameList.count();
00041 }
00042 
00043 Frame* GOP::getFrame(uint frNo) {
00044         return frameList.at(frNo);
00045 };  
00046 
00047 
00048 uint GOP::calcByteSize() {
00049     uint size = 0;
00050 
00051     // estimate byteSize -> sum of frame sizes
00052     for (uint i = 0; i < getFrameCount(); i++) {
00053                 size += getFrame(i)->getByteSize();
00054     }
00055 
00056     // set byteSize
00057     byteSize = size;
00058     return byteSize;
00059 }
00060 
00061 
00062 Frame *GOP::getFrameInStream(uint frNo) {
00063     Frame *fr;
00064     uint offset = this->getGOPNo() * this->getFrameCount();
00065 
00066     for (uint i = 0; i < this->getFrameCount(); i++) {
00067                 fr = frameList.at(i);
00068                 if (fr->getNoInStream() == frNo + offset) {
00069                 cout << ">>>>>>>> " << fr->getNoInStream() << nl;
00070                 return fr;
00071                 }
00072     }
00073     return NULL;
00074 }
00075 
00076 
00077 uint GOP::getGOPNo() {
00078         return patNo;
00079 }
00080 
00081 
00082 bool GOP::isMaster() {
00083         return master;
00084 }
00085 
00086 
00087 Stream* GOP::getStream() {
00088         return stream;
00089 }
00090 

Generated on Wed Mar 19 11:57:42 2003 for qctva4lv by doxygen1.2.17