• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavcodec/bfin/dsputil_bfin.h

Go to the documentation of this file.
00001 /*
00002  * BlackFin DSPUTILS COMMON OPTIMIZATIONS HEADER
00003  *
00004  * Copyright (C) 2007 Marc Hoffman <mmh@pleasantst.com>
00005  *
00006  * This file is part of FFmpeg.
00007  *
00008  * FFmpeg is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2.1 of the License, or (at your option) any later version.
00012  *
00013  * FFmpeg is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with FFmpeg; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
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 /* AVCODEC_BFIN_DSPUTIL_BFIN_H */

Generated on Sat Feb 16 2013 09:23:11 for ffmpeg by  doxygen 1.7.1