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 AVCODEC_BFIN_DSPUTIL_BFIN_H
00025 #define AVCODEC_BFIN_DSPUTIL_BFIN_H
00026
00027 #ifdef __FDPIC__
00028 #define attribute_l1_text __attribute__ ((l1_text))
00029 #define attribute_l1_data_b __attribute__((l1_data_B))
00030 #else
00031 #define attribute_l1_text
00032 #define attribute_l1_data_b
00033 #endif
00034
00035 #ifdef BFIN_PROFILE
00036
00037 static double Telem[16];
00038 static char *TelemNames[16];
00039 static int TelemCnt;
00040
00041 #define PROF(lab,e) { int xx_e = e; char*xx_lab = lab; uint64_t xx_t0 = read_time();
00042 #define EPROF() xx_t0 = read_time()-xx_t0; Telem[xx_e] = Telem[xx_e] + xx_t0; TelemNames[xx_e] = xx_lab; }
00043
00044 static void prof_report (void)
00045 {
00046 int i;
00047 double s = 0;
00048 for (i=0;i<16;i++) {
00049 double v;
00050 if (TelemNames[i]) {
00051 v = Telem[i]/TelemCnt;
00052 av_log (NULL,AV_LOG_DEBUG,"%-20s: %12.4f\t%12.4f\n", TelemNames[i],v,v/64);
00053 s = s + Telem[i];
00054 }
00055 }
00056 av_log (NULL,AV_LOG_DEBUG,"%-20s: %12.4f\t%12.4f\n%20.4f\t%d\n",
00057 "total",s/TelemCnt,s/TelemCnt/64,s,TelemCnt);
00058 }
00059
00060 static void bfprof (void)
00061 {
00062 static int init;
00063 if (!init) atexit (prof_report);
00064 init=1;
00065 TelemCnt++;
00066 }
00067
00068 #else
00069 #define PROF(a,b)
00070 #define EPROF()
00071 #define bfprof()
00072 #endif
00073
00074 #endif