diff options
author | Marc Hoffman <mmhoffm@gmail.com> | 2007-06-12 19:13:50 +0000 |
---|---|---|
committer | Marc Hoffman <mmhoffm@gmail.com> | 2007-06-12 19:13:50 +0000 |
commit | 50ee61dda2b956bc09fa8238d54ba86620798b42 (patch) | |
tree | d2d1ccea5829a5a7561daa677c9e9f90803170dc /libavcodec/bfin/dsputil_bfin.h | |
parent | ea6ad30ce9f1a5dbdb18748f4c3c24745f6513fe (diff) | |
download | ffmpeg-50ee61dda2b956bc09fa8238d54ba86620798b42.tar.gz |
Blackfin dct_quantize_bfin routine
2x performance boost in performing quantization for mpeg encoding
Originally committed as revision 9293 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/bfin/dsputil_bfin.h')
-rw-r--r-- | libavcodec/bfin/dsputil_bfin.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/libavcodec/bfin/dsputil_bfin.h b/libavcodec/bfin/dsputil_bfin.h new file mode 100644 index 0000000000..d972e7faec --- /dev/null +++ b/libavcodec/bfin/dsputil_bfin.h @@ -0,0 +1,68 @@ +/* + * BlackFin DSPUTILS COMMON OPTIMIZATIONS HEADER + * + * Copyright (C) 2007 Marc Hoffman <mmh@pleasantst.com> + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +#ifndef DSPUTIL_BFIN_H +#define DSPUTIL_BFIN_H + +#define attribute_l1_text __attribute__ ((l1_text)) + +#ifdef BFIN_PROFILE + +static double Telem[16]; +static char *TelemNames[16]; +static int TelemCnt; + +#define PROF(lab,e) { int __e = e; char*__lab = lab; uint64_t _t0 = read_time(); +#define EPROF() _t0 = read_time()-_t0; Telem[__e] = Telem[__e] + _t0; TelemNames[__e] = __lab; } + +static void prof_report (void) +{ + int i; + double s = 0; + for (i=0;i<16;i++) { + double v; + if (TelemNames[i]) { + v = Telem[i]/TelemCnt; + av_log (NULL,AV_LOG_DEBUG,"%-20s: %12.4f\t%12.4f\n", TelemNames[i],v,v/64); + s = s + Telem[i]; + } + } + av_log (NULL,AV_LOG_DEBUG,"%-20s: %12.4f\t%12.4f\n%20.4f\t%d\n", + "total",s/TelemCnt,s/TelemCnt/64,s,TelemCnt); +} + +static void bfprof (void) +{ + static int init; + if (!init) atexit (prof_report); + init=1; + TelemCnt++; +} + +#else +#define PROF(a,b) +#define EPROF() +#define bfprof() +#endif + +#endif |