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
073d32e5
Commit
073d32e5
authored
Dec 07, 2009
by
Fiona Glaser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use aliasing-avoidance macros in array_non_zero
parent
346844af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
common/macroblock.h
common/macroblock.h
+6
-8
No files found.
common/macroblock.h
View file @
073d32e5
...
...
@@ -405,21 +405,19 @@ static ALWAYS_INLINE void x264_macroblock_cache_intra8x8_pred( x264_t *h, int x,
}
#define array_non_zero(a) array_non_zero_int(a, sizeof(a))
#define array_non_zero_int array_non_zero_int
static
ALWAYS_INLINE
int
array_non_zero_int
(
void
*
v
,
int
i_count
)
static
ALWAYS_INLINE
int
array_non_zero_int
(
int16_t
*
v
,
int
i_count
)
{
union
{
uint16_t
s
[
4
];
uint64_t
l
;}
*
x
=
v
;
if
(
i_count
==
8
)
return
!!
x
[
0
]
.
l
;
return
!!
M64
(
&
v
[
0
]
)
;
else
if
(
i_count
==
16
)
return
!!
(
x
[
0
].
l
|
x
[
1
].
l
);
return
!!
(
M64
(
&
v
[
0
]
)
|
M64
(
&
v
[
4
]
)
);
else
if
(
i_count
==
32
)
return
!!
(
x
[
0
].
l
|
x
[
1
].
l
|
x
[
2
].
l
|
x
[
3
].
l
);
return
!!
(
M64
(
&
v
[
0
]
)
|
M64
(
&
v
[
4
]
)
|
M64
(
&
v
[
8
]
)
|
M64
(
&
v
[
12
]
)
);
else
{
int
i
;
i_count
/=
sizeof
(
uint64_t
);
for
(
i
=
0
;
i
<
i_count
;
i
++
)
if
(
x
[
i
].
l
)
return
1
;
for
(
i
=
0
;
i
<
i_count
;
i
+=
4
)
if
(
M64
(
&
v
[
i
]
)
)
return
1
;
return
0
;
}
}
...
...
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