00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FFMPEG_DSPUTIL_BFIN_H
00025 #define FFMPEG_DSPUTIL_BFIN_H
00026
00027 #define attribute_l1_text __attribute__ ((l1_text))
00028
00029 #ifdef BFIN_PROFILE
00030
00031 static double Telem[16];
00032 static char *TelemNames[16];
00033 static int TelemCnt;
00034
00035 #define PROF(lab,e) { int xx_e = e; char*xx_lab = lab; uint64_t xx_t0 = read_time();
00036 #define EPROF() xx_t0 = read_time()-xx_t0; Telem[xx_e] = Telem[xx_e] + xx_t0; TelemNames[xx_e] = xx_lab; }
00037
00038 static void prof_report (void)
00039 {
00040 int i;
00041 double s = 0;
00042 for (i=0;i<16;i++) {
00043 double v;
00044 if (TelemNames[i]) {
00045 v = Telem[i]/TelemCnt;
00046 av_log (NULL,AV_LOG_DEBUG,"%-20s: %12.4f\t%12.4f\n", TelemNames[i],v,v/64);
00047 s = s + Telem[i];
00048 }
00049 }
00050 av_log (NULL,AV_LOG_DEBUG,"%-20s: %12.4f\t%12.4f\n%20.4f\t%d\n",
00051 "total",s/TelemCnt,s/TelemCnt/64,s,TelemCnt);
00052 }
00053
00054 static void bfprof (void)
00055 {
00056 static int init;
00057 if (!init) atexit (prof_report);
00058 init=1;
00059 TelemCnt++;
00060 }
00061
00062 #else
00063 #define PROF(a,b)
00064 #define EPROF()
00065 #define bfprof()
00066 #endif
00067
00068 #endif