1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
| void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
{
memset( pixf, 0, sizeof(*pixf) );
#define INIT2_NAME( name1, name2, cpu ) \
pixf->name1[PIXEL_16x16] = x264_pixel_##name2##_16x16##cpu;\
pixf->name1[PIXEL_16x8] = x264_pixel_##name2##_16x8##cpu;
#define INIT4_NAME( name1, name2, cpu ) \
INIT2_NAME( name1, name2, cpu ) \
pixf->name1[PIXEL_8x16] = x264_pixel_##name2##_8x16##cpu;\
pixf->name1[PIXEL_8x8] = x264_pixel_##name2##_8x8##cpu;
#define INIT5_NAME( name1, name2, cpu ) \
INIT4_NAME( name1, name2, cpu ) \
pixf->name1[PIXEL_8x4] = x264_pixel_##name2##_8x4##cpu;
#define INIT6_NAME( name1, name2, cpu ) \
INIT5_NAME( name1, name2, cpu ) \
pixf->name1[PIXEL_4x8] = x264_pixel_##name2##_4x8##cpu;
#define INIT7_NAME( name1, name2, cpu ) \
INIT6_NAME( name1, name2, cpu ) \
pixf->name1[PIXEL_4x4] = x264_pixel_##name2##_4x4##cpu;
#define INIT8_NAME( name1, name2, cpu ) \
INIT7_NAME( name1, name2, cpu ) \
pixf->name1[PIXEL_4x16] = x264_pixel_##name2##_4x16##cpu;
#define INIT2( name, cpu ) INIT2_NAME( name, name, cpu )
#define INIT4( name, cpu ) INIT4_NAME( name, name, cpu )
#define INIT5( name, cpu ) INIT5_NAME( name, name, cpu )
#define INIT6( name, cpu ) INIT6_NAME( name, name, cpu )
#define INIT7( name, cpu ) INIT7_NAME( name, name, cpu )
#define INIT8( name, cpu ) INIT8_NAME( name, name, cpu )
#define INIT_ADS( cpu ) \
pixf->ads[PIXEL_16x16] = x264_pixel_ads4##cpu;\
pixf->ads[PIXEL_16x8] = x264_pixel_ads2##cpu;\
pixf->ads[PIXEL_8x8] = x264_pixel_ads1##cpu;
INIT8( sad, );
INIT8_NAME( sad_aligned, sad, );
INIT7( sad_x3, );
INIT7( sad_x4, );
INIT8( ssd, );
INIT8( satd, );
INIT7( satd_x3, );
INIT7( satd_x4, );
INIT4( hadamard_ac, );
INIT_ADS( );
pixf->sa8d[PIXEL_16x16] = x264_pixel_sa8d_16x16;
pixf->sa8d[PIXEL_8x8] = x264_pixel_sa8d_8x8;
pixf->var[PIXEL_16x16] = x264_pixel_var_16x16;
pixf->var[PIXEL_8x16] = x264_pixel_var_8x16;
pixf->var[PIXEL_8x8] = x264_pixel_var_8x8;
pixf->var2[PIXEL_8x16] = x264_pixel_var2_8x16;
pixf->var2[PIXEL_8x8] = x264_pixel_var2_8x8;
pixf->ssd_nv12_core = pixel_ssd_nv12_core;
pixf->ssim_4x4x2_core = ssim_4x4x2_core;
pixf->ssim_end4 = ssim_end4;
pixf->vsad = pixel_vsad;
pixf->asd8 = pixel_asd8;
pixf->intra_sad_x3_4x4 = x264_intra_sad_x3_4x4;
pixf->intra_satd_x3_4x4 = x264_intra_satd_x3_4x4;
pixf->intra_sad_x3_8x8 = x264_intra_sad_x3_8x8;
pixf->intra_sa8d_x3_8x8 = x264_intra_sa8d_x3_8x8;
pixf->intra_sad_x3_8x8c = x264_intra_sad_x3_8x8c;
pixf->intra_satd_x3_8x8c = x264_intra_satd_x3_8x8c;
pixf->intra_sad_x3_8x16c = x264_intra_sad_x3_8x16c;
pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c;
pixf->intra_sad_x3_16x16 = x264_intra_sad_x3_16x16;
pixf->intra_satd_x3_16x16 = x264_intra_satd_x3_16x16;
...
//后面是与 CPU 有关的函数定义,此处略去
}
|