00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 2 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * This program is distributed in the hope that it will be useful, 00008 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 * GNU Library General Public License for more details. 00011 * 00012 * You should have received a copy of the GNU General Public License 00013 * along with this program; if not, write to the Free Software 00014 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00015 */ 00016 #include <iostream.h> 00017 #include <PatGen.hpp> 00018 00019 int main(int argc, char** argv) { 00020 00021 if (argc != 7) { 00022 cout << "Usage: " << argv[0] << " yuv org mpg width height fpg\n"; 00023 exit(-1); 00024 } 00025 00026 00027 PatGen pg(argv[1], argv[2], argv[3], atoi(argv[4]), atoi(argv[5]), atoi(argv[6])); 00028 00029 00030 00035 // YUVStream holen 00036 YUVStream* stream = (YUVStream*)pg.getYUVStream(); 00037 00038 // (Master) YUVGOP mit der Nr gopNr holen 00039 for (uint i = 0; i < stream->getMasterGOPCount(); i++) { 00040 YUVGOP* gop = (YUVGOP*)stream->getMasterGOP(i); 00041 cout << gop->getFramesInGOP().latin1() << tab << "PSNR: " 00042 << gop->getPSNR() << nl; 00043 } 00044 return (0); 00045 00046 00047 //~ /** 00048 //~ * PSNR computation example 00049 //~ */ 00050 //~ YUVStream* stream = (YUVStream*)pg.getYUVStream(); 00051 //~ YUVGOP* yuv = (YUVGOP*)stream->getMasterGOP(0); 00052 //~ YUVGOP* org = yuv->getOrgGOP(); 00053 //~ YUVFrame* f0 = (YUVFrame*)org->getFrame(0); 00054 //~ YUVFrame* f1 = (YUVFrame*)yuv->getFrame(0); 00055 //~ YUVFrame* f2 = (YUVFrame*)org->getFrame(1); 00056 00057 //~ f1->fillBuffer(); 00058 //~ f0->fillBuffer(); 00059 //~ f2->fillBuffer(); 00060 //~ cout << f0->computePSNR(f1) << nl; 00061 //~ cout << f2->computePSNR(f1) << nl; 00062 00063 //~ f1->freeBuffer(); 00064 //~ f0->freeBuffer(); 00065 //~ cout << f0->computePSNR(f1) << nl; 00066 00067 //~ cout << f1->getPSNR() << nl; 00068 //~ cout << yuv->getPSNR() << nl; 00069 } 00070