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 #include "config.h"
00028 #include "libavcodec/dsputil.h"
00029
00030 #if defined(__FDPIC__) && CONFIG_SRAM
00031 #define attribute_l1_text __attribute__ ((l1_text))
00032 #define attribute_l1_data_b __attribute__((l1_data_B))
00033 #else
00034 #define attribute_l1_text
00035 #define attribute_l1_data_b
00036 #endif
00037
00038 void ff_bfin_idct (DCTELEM *block) attribute_l1_text;
00039 void ff_bfin_fdct (DCTELEM *block) attribute_l1_text;
00040 void ff_bfin_vp3_idct (DCTELEM *block);
00041 void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, DCTELEM *block);
00042 void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, DCTELEM *block);
00043 void ff_bfin_add_pixels_clamped (const DCTELEM *block, uint8_t *dest, int line_size) attribute_l1_text;
00044 void ff_bfin_put_pixels_clamped (const DCTELEM *block, uint8_t *dest, int line_size) attribute_l1_text;
00045 void ff_bfin_diff_pixels (DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride) attribute_l1_text;
00046 void ff_bfin_get_pixels (DCTELEM *restrict block, const uint8_t *pixels, int line_size) attribute_l1_text;
00047 int ff_bfin_pix_norm1 (uint8_t * pix, int line_size) attribute_l1_text;
00048 int ff_bfin_z_sad8x8 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;
00049 int ff_bfin_z_sad16x16 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;
00050
00051 void ff_bfin_z_put_pixels16_xy2 (uint8_t *block, const uint8_t *s0, int dest_size, int line_size, int h) attribute_l1_text;
00052 void ff_bfin_z_put_pixels8_xy2 (uint8_t *block, const uint8_t *s0, int dest_size, int line_size, int h) attribute_l1_text;
00053 void ff_bfin_put_pixels16_xy2_nornd (uint8_t *block, const uint8_t *s0, int line_size, int h) attribute_l1_text;
00054 void ff_bfin_put_pixels8_xy2_nornd (uint8_t *block, const uint8_t *s0, int line_size, int h) attribute_l1_text;
00055
00056
00057 int ff_bfin_pix_sum (uint8_t *p, int stride) attribute_l1_text;
00058
00059 void ff_bfin_put_pixels8uc (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int dest_size, int line_size, int h) attribute_l1_text;
00060 void ff_bfin_put_pixels16uc (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int dest_size, int line_size, int h) attribute_l1_text;
00061 void ff_bfin_put_pixels8uc_nornd (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int line_size, int h) attribute_l1_text;
00062 void ff_bfin_put_pixels16uc_nornd (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int line_size, int h) attribute_l1_text;
00063
00064 int ff_bfin_sse4 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text;
00065 int ff_bfin_sse8 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text;
00066 int ff_bfin_sse16 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text;
00067
00068
00069 #ifdef BFIN_PROFILE
00070
00071 static double Telem[16];
00072 static char *TelemNames[16];
00073 static int TelemCnt;
00074
00075 #define PROF(lab,e) { int xx_e = e; char*xx_lab = lab; uint64_t xx_t0 = read_time();
00076 #define EPROF() xx_t0 = read_time()-xx_t0; Telem[xx_e] = Telem[xx_e] + xx_t0; TelemNames[xx_e] = xx_lab; }
00077
00078 static void prof_report (void)
00079 {
00080 int i;
00081 double s = 0;
00082 for (i=0;i<16;i++) {
00083 double v;
00084 if (TelemNames[i]) {
00085 v = Telem[i]/TelemCnt;
00086 av_log (NULL,AV_LOG_DEBUG,"%-20s: %12.4f\t%12.4f\n", TelemNames[i],v,v/64);
00087 s = s + Telem[i];
00088 }
00089 }
00090 av_log (NULL,AV_LOG_DEBUG,"%-20s: %12.4f\t%12.4f\n%20.4f\t%d\n",
00091 "total",s/TelemCnt,s/TelemCnt/64,s,TelemCnt);
00092 }
00093
00094 static void bfprof (void)
00095 {
00096 static int init;
00097 if (!init) atexit (prof_report);
00098 init=1;
00099 TelemCnt++;
00100 }
00101
00102 #else
00103 #define PROF(a,b)
00104 #define EPROF()
00105 #define bfprof()
00106 #endif
00107
00108 #endif