diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | e2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch) | |
tree | 9047cf9e6b5c43878d5bf82660adae77ceee097a /mpeglib/lib/splay/dump.cpp | |
download | tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'mpeglib/lib/splay/dump.cpp')
-rw-r--r-- | mpeglib/lib/splay/dump.cpp | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/mpeglib/lib/splay/dump.cpp b/mpeglib/lib/splay/dump.cpp new file mode 100644 index 00000000..62551194 --- /dev/null +++ b/mpeglib/lib/splay/dump.cpp @@ -0,0 +1,157 @@ +/* + frame dumper + Copyright (C) 2001 Martin Vogt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation. + + For more information look at the file COPYRIGHT in this package + + */ + + +typedef float REAL; + +#define SSLIMIT 18 +#define SBLIMIT 32 + + + +#include "dump.h" +#include <stdio.h> + + +Dump::Dump() { + +} + + +Dump::~Dump() { +} + + +void Dump::dump(REAL out[SBLIMIT][SSLIMIT]) { + FILE* f=fopen("dump.raw","a+"); + int i; + int j; + for(i=0;i<SBLIMIT;i++) { + fprintf(f,"Line:%d\n",i); + for(j=0;j<SSLIMIT;j++) { + fprintf(f,"%.25f\n",out[i][j]); + } + } + fclose(f); +} + +void Dump::dump(REAL out[SBLIMIT*SSLIMIT]) { + FILE* f=fopen("dump.raw","a+"); + int i; + int line=0; + for(i=0;i<SBLIMIT*SSLIMIT;i++) { + if ( (i % SSLIMIT) == 0) { + fprintf(f,"Line:%d\n",line++); + } + fprintf(f,"%.25f\n",out[i]); + } + fclose(f); +} + +void Dump::dump2(REAL out[SSLIMIT*SBLIMIT]) { + FILE* f=fopen("dump.raw","a+"); + int i; + int j; + int line=0; + for(i=0;i<SSLIMIT;i++) { + fprintf(f,"Line:%d\n",line++); + for(j=0;j<SBLIMIT;j++) { + fprintf(f,"%.25f\n",out[i*SBLIMIT+j]); + } + } + fclose(f); +} + +void Dump::dump(REAL out[SSLIMIT][SBLIMIT]) { + FILE* f=fopen("dump.raw","a+"); + int i; + int j; + for(i=0;i<SBLIMIT;i++) { + fprintf(f,"Line:%d\n",i); + for(j=0;j<SSLIMIT;j++) { + fprintf(f,"%.25f\n",out[j][i]); + } + } + fclose(f); +} + +void Dump::dump(int out[SBLIMIT][SSLIMIT]) { + FILE* f=fopen("dump.raw","a+"); + int i; + int j; + for(i=0;i<SBLIMIT;i++) { + fprintf(f,"Line:%d\n",i); + for(j=0;j<SSLIMIT;j++) { + if (out[i][j] == 0) { + fprintf(f," %d ",out[i][j]); + continue; + } + if (out[i][j] < 0) { + fprintf(f," -x"); + continue; + } + fprintf(f," +x"); + + } + fprintf(f," \n"); + + } + fclose(f); +} + +void Dump::dump(char* ptr,int len,int ldelete) { + FILE* f; + if (ldelete) { + f=fopen("/tmp/dump.raw","w+"); + } else { + f=fopen("/tmp/dump.raw","a+"); + } + fwrite(ptr,len,1,f); + fclose(f); +} + + +void Dump::scale_zero(layer3scalefactor* out) { + + int i; + int j; + + for(i=0;i<23;i++) { + out->l[i]=0; + } + + for(i=0;i<3;i++) { + for(j=0;j<13;j++) { + out->s[i][j]=0; + } + } +} + + +void Dump::dump(layer3scalefactor* out) { + FILE* f=fopen("dump.raw","a+"); + int i; + int j; + + for(i=0;i<23;i++) { + fprintf(f,"l[%d]=%d\n",i,out->l[i]); + } + + for(i=0;i<3;i++) { + for(j=0;j<13;j++) { + fprintf(f,"s[%d][%d]=%d\n",i,j,out->s[i][j]); + } + } + fprintf(f,"---------\n"); + + fclose(f); +} |