Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
x264
Commits
8c02c790
Commit
8c02c790
authored
May 10, 2010
by
Henrik Gramner
Committed by
Fiona Glaser
May 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shrink even more constant arrays
parent
dfba665a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
25 deletions
+21
-25
common/arm/mc-c.c
common/arm/mc-c.c
+2
-2
common/mc.c
common/mc.c
+2
-2
common/ppc/mc.c
common/ppc/mc.c
+2
-2
common/set.c
common/set.c
+5
-5
common/x86/mc-c.c
common/x86/mc-c.c
+2
-2
encoder/encoder.c
encoder/encoder.c
+2
-2
encoder/me.c
encoder/me.c
+1
-1
encoder/set.c
encoder/set.c
+5
-9
No files found.
common/arm/mc-c.c
View file @
8c02c790
...
...
@@ -112,8 +112,8 @@ static void (* const x264_mc_copy_wtab_neon[5])( uint8_t *, int, uint8_t *, int,
x264_mc_copy_w16_neon
,
};
static
const
int
hpel_ref0
[
16
]
=
{
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
2
,
3
,
3
,
3
,
0
,
1
,
1
,
1
};
static
const
int
hpel_ref1
[
16
]
=
{
0
,
0
,
0
,
0
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
};
static
const
u
int
8_t
hpel_ref0
[
16
]
=
{
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
2
,
3
,
3
,
3
,
0
,
1
,
1
,
1
};
static
const
u
int
8_t
hpel_ref1
[
16
]
=
{
0
,
0
,
0
,
0
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
};
static
void
mc_luma_neon
(
uint8_t
*
dst
,
int
i_dst_stride
,
uint8_t
*
src
[
4
],
int
i_src_stride
,
...
...
common/mc.c
View file @
8c02c790
...
...
@@ -203,8 +203,8 @@ static void hpel_filter( uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, uint8_t *s
}
}
static
const
int
hpel_ref0
[
16
]
=
{
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
2
,
3
,
3
,
3
,
0
,
1
,
1
,
1
};
static
const
int
hpel_ref1
[
16
]
=
{
0
,
0
,
0
,
0
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
};
static
const
u
int
8_t
hpel_ref0
[
16
]
=
{
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
2
,
3
,
3
,
3
,
0
,
1
,
1
,
1
};
static
const
u
int
8_t
hpel_ref1
[
16
]
=
{
0
,
0
,
0
,
0
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
};
static
void
mc_luma
(
uint8_t
*
dst
,
int
i_dst_stride
,
uint8_t
*
src
[
4
],
int
i_src_stride
,
...
...
common/ppc/mc.c
View file @
8c02c790
...
...
@@ -37,8 +37,8 @@ typedef void (*pf_mc_t)( uint8_t *src, int i_src,
uint8_t
*
dst
,
int
i_dst
,
int
i_height
);
static
const
int
hpel_ref0
[
16
]
=
{
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
2
,
3
,
3
,
3
,
0
,
1
,
1
,
1
};
static
const
int
hpel_ref1
[
16
]
=
{
0
,
0
,
0
,
0
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
};
static
const
u
int
8_t
hpel_ref0
[
16
]
=
{
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
2
,
3
,
3
,
3
,
0
,
1
,
1
,
1
};
static
const
u
int
8_t
hpel_ref1
[
16
]
=
{
0
,
0
,
0
,
0
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
};
static
inline
int
x264_tapfilter
(
uint8_t
*
pix
,
int
i_pix_next
)
...
...
common/set.c
View file @
8c02c790
...
...
@@ -23,7 +23,7 @@
#define SHIFT(x,s) ((s)<=0 ? (x)<<-(s) : ((x)+(1<<((s)-1)))>>(s))
#define DIV(n,d) (((n) + ((d)>>1)) / (d))
static
const
int
dequant4_scale
[
6
][
3
]
=
static
const
u
int
8_t
dequant4_scale
[
6
][
3
]
=
{
{
10
,
13
,
16
},
{
11
,
14
,
18
},
...
...
@@ -32,7 +32,7 @@ static const int dequant4_scale[6][3] =
{
16
,
20
,
25
},
{
18
,
23
,
29
}
};
static
const
int
quant4_scale
[
6
][
3
]
=
static
const
u
int
16_t
quant4_scale
[
6
][
3
]
=
{
{
13107
,
8066
,
5243
},
{
11916
,
7490
,
4660
},
...
...
@@ -42,11 +42,11 @@ static const int quant4_scale[6][3] =
{
7282
,
4559
,
2893
},
};
static
const
int
quant8_scan
[
16
]
=
static
const
u
int
8_t
quant8_scan
[
16
]
=
{
0
,
3
,
4
,
3
,
3
,
1
,
5
,
1
,
4
,
5
,
2
,
5
,
3
,
1
,
5
,
1
};
static
const
int
dequant8_scale
[
6
][
6
]
=
static
const
u
int
8_t
dequant8_scale
[
6
][
6
]
=
{
{
20
,
18
,
32
,
19
,
25
,
24
},
{
22
,
19
,
35
,
21
,
28
,
26
},
...
...
@@ -55,7 +55,7 @@ static const int dequant8_scale[6][6] =
{
32
,
28
,
51
,
30
,
40
,
38
},
{
36
,
32
,
58
,
34
,
46
,
43
},
};
static
const
int
quant8_scale
[
6
][
6
]
=
static
const
u
int
16_t
quant8_scale
[
6
][
6
]
=
{
{
13107
,
11428
,
20972
,
12222
,
16777
,
15481
},
{
11916
,
10826
,
19174
,
11058
,
14980
,
14290
},
...
...
common/x86/mc-c.c
View file @
8c02c790
...
...
@@ -228,8 +228,8 @@ static void x264_weight_cache_ssse3( x264_t *h, x264_weight_t *w )
}
}
static
const
int
hpel_ref0
[
16
]
=
{
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
2
,
3
,
3
,
3
,
0
,
1
,
1
,
1
};
static
const
int
hpel_ref1
[
16
]
=
{
0
,
0
,
0
,
0
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
};
static
const
u
int
8_t
hpel_ref0
[
16
]
=
{
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
2
,
3
,
3
,
3
,
0
,
1
,
1
,
1
};
static
const
u
int
8_t
hpel_ref1
[
16
]
=
{
0
,
0
,
0
,
0
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
,
2
,
2
,
3
,
2
};
#define MC_LUMA(name,instr1,instr2)\
static void mc_luma_##name( uint8_t *dst, int i_dst_stride,\
...
...
encoder/encoder.c
View file @
8c02c790
...
...
@@ -2816,8 +2816,8 @@ void x264_encoder_close ( x264_t *h )
/* Slices used and PSNR */
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
static
const
int
slice_order
[]
=
{
SLICE_TYPE_I
,
SLICE_TYPE_SI
,
SLICE_TYPE_P
,
SLICE_TYPE_SP
,
SLICE_TYPE_B
};
static
const
char
*
slice_name
[]
=
{
"P"
,
"B"
,
"I"
,
"SP"
,
"SI"
};
static
const
u
int
8_t
slice_order
[]
=
{
SLICE_TYPE_I
,
SLICE_TYPE_SI
,
SLICE_TYPE_P
,
SLICE_TYPE_SP
,
SLICE_TYPE_B
};
static
const
char
*
const
slice_name
[]
=
{
"P"
,
"B"
,
"I"
,
"SP"
,
"SI"
};
int
i_slice
=
slice_order
[
i
];
if
(
h
->
stat
.
i_frame_count
[
i_slice
]
>
0
)
...
...
encoder/me.c
View file @
8c02c790
...
...
@@ -484,7 +484,7 @@ void x264_me_search_ref( x264_t *h, x264_me_t *m, int16_t (*mvc)[2], int i_mvc,
int
i
=
1
;
do
{
static
const
int
hex4
[
16
][
2
]
=
{
static
const
int
8_t
hex4
[
16
][
2
]
=
{
{
0
,
-
4
},
{
0
,
4
},
{
-
2
,
-
3
},
{
2
,
-
3
},
{
-
4
,
-
2
},
{
4
,
-
2
},
{
-
4
,
-
1
},
{
4
,
-
1
},
{
-
4
,
0
},
{
4
,
0
},
{
-
4
,
1
},
{
4
,
1
},
...
...
encoder/set.c
View file @
8c02c790
...
...
@@ -315,26 +315,22 @@ void x264_sps_write( bs_t *s, x264_sps_t *sps )
if
(
sps
->
vui
.
b_aspect_ratio_info_present
)
{
int
i
;
static
const
struct
{
int
w
,
h
;
int
sar
;
}
sar
[]
=
static
const
struct
{
u
int
8_t
w
,
h
,
sar
;
}
sar
[]
=
{
{
1
,
1
,
1
},
{
12
,
11
,
2
},
{
10
,
11
,
3
},
{
16
,
11
,
4
},
{
40
,
33
,
5
},
{
24
,
11
,
6
},
{
20
,
11
,
7
},
{
32
,
11
,
8
},
{
80
,
33
,
9
},
{
18
,
11
,
10
},
{
15
,
11
,
11
},
{
64
,
33
,
12
},
{
160
,
99
,
13
},
{
0
,
0
,
-
1
}
{
160
,
99
,
13
},
{
0
,
0
,
255
}
};
for
(
i
=
0
;
sar
[
i
].
sar
!=
-
1
;
i
++
)
for
(
i
=
0
;
sar
[
i
].
sar
!=
255
;
i
++
)
{
if
(
sar
[
i
].
w
==
sps
->
vui
.
i_sar_width
&&
sar
[
i
].
h
==
sps
->
vui
.
i_sar_height
)
break
;
}
if
(
sar
[
i
].
sar
!=
-
1
)
bs_write
(
s
,
8
,
sar
[
i
].
sar
);
if
(
sar
[
i
].
sar
==
255
)
/* aspect_ratio_idc (extended) */
{
bs_write
(
s
,
8
,
sar
[
i
].
sar
);
}
else
{
bs_write
(
s
,
8
,
255
);
/* aspect_ratio_idc (extended) */
bs_write
(
s
,
16
,
sps
->
vui
.
i_sar_width
);
bs_write
(
s
,
16
,
sps
->
vui
.
i_sar_height
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment