Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
088b05fd
Commit
088b05fd
authored
Aug 12, 2015
by
hui su
Browse files
Use sizeof(variable) instead of sizeof(type)
Change-Id: Ia069da11eebb271063e9eb837bdb3e7175ecce13
parent
0a81d36a
Changes
10
Hide whitespace changes
Inline
Side-by-side
vp10/common/reconintra.c
View file @
088b05fd
...
...
@@ -173,24 +173,24 @@ static void build_intra_predictors_high(const MACROBLOCKD *xd,
/* slower path if the block needs border extension */
if
(
x0
+
2
*
bs
<=
frame_width
)
{
if
(
right_available
&&
bs
==
4
)
{
memcpy
(
above_row
,
above_ref
,
2
*
bs
*
sizeof
(
uint16_t
));
memcpy
(
above_row
,
above_ref
,
2
*
bs
*
sizeof
(
above_row
[
0
]
));
}
else
{
memcpy
(
above_row
,
above_ref
,
bs
*
sizeof
(
uint16_t
));
memcpy
(
above_row
,
above_ref
,
bs
*
sizeof
(
above_row
[
0
]
));
vpx_memset16
(
above_row
+
bs
,
above_row
[
bs
-
1
],
bs
);
}
}
else
if
(
x0
+
bs
<=
frame_width
)
{
const
int
r
=
frame_width
-
x0
;
if
(
right_available
&&
bs
==
4
)
{
memcpy
(
above_row
,
above_ref
,
r
*
sizeof
(
uint16_t
));
memcpy
(
above_row
,
above_ref
,
r
*
sizeof
(
above_row
[
0
]
));
vpx_memset16
(
above_row
+
r
,
above_row
[
r
-
1
],
x0
+
2
*
bs
-
frame_width
);
}
else
{
memcpy
(
above_row
,
above_ref
,
bs
*
sizeof
(
uint16_t
));
memcpy
(
above_row
,
above_ref
,
bs
*
sizeof
(
above_row
[
0
]
));
vpx_memset16
(
above_row
+
bs
,
above_row
[
bs
-
1
],
bs
);
}
}
else
if
(
x0
<=
frame_width
)
{
const
int
r
=
frame_width
-
x0
;
memcpy
(
above_row
,
above_ref
,
r
*
sizeof
(
uint16_t
));
memcpy
(
above_row
,
above_ref
,
r
*
sizeof
(
above_row
[
0
]
));
vpx_memset16
(
above_row
+
r
,
above_row
[
r
-
1
],
x0
+
2
*
bs
-
frame_width
);
}
...
...
@@ -201,9 +201,9 @@ static void build_intra_predictors_high(const MACROBLOCKD *xd,
if
(
bs
==
4
&&
right_available
&&
left_available
)
{
const_above_row
=
above_ref
;
}
else
{
memcpy
(
above_row
,
above_ref
,
bs
*
sizeof
(
uint16_t
));
memcpy
(
above_row
,
above_ref
,
bs
*
sizeof
(
above_row
[
0
]
));
if
(
bs
==
4
&&
right_available
)
memcpy
(
above_row
+
bs
,
above_ref
+
bs
,
bs
*
sizeof
(
uint16_t
));
memcpy
(
above_row
+
bs
,
above_ref
+
bs
,
bs
*
sizeof
(
above_row
[
0
]
));
else
vpx_memset16
(
above_row
+
bs
,
above_row
[
bs
-
1
],
bs
);
// TODO(Peter): this value should probably change for high bitdepth
...
...
vp10/encoder/encodeframe.c
View file @
088b05fd
...
...
@@ -1046,7 +1046,7 @@ static void update_state(VP9_COMP *cpi, ThreadData *td,
x
->
skip
=
ctx
->
skip
;
memcpy
(
x
->
zcoeff_blk
[
mbmi
->
tx_size
],
ctx
->
zcoeff_blk
,
sizeof
(
uint8_t
)
*
ctx
->
num_4x4_blk
);
sizeof
(
ctx
->
zcoeff_blk
[
0
]
)
*
ctx
->
num_4x4_blk
);
if
(
!
output_enabled
)
return
;
...
...
vp10/encoder/extend.c
View file @
088b05fd
...
...
@@ -74,7 +74,7 @@ static void highbd_copy_and_extend_plane(const uint8_t *src8, int src_pitch,
for
(
i
=
0
;
i
<
h
;
i
++
)
{
vpx_memset16
(
dst_ptr1
,
src_ptr1
[
0
],
extend_left
);
memcpy
(
dst_ptr1
+
extend_left
,
src_ptr1
,
w
*
sizeof
(
uint16_t
));
memcpy
(
dst_ptr1
+
extend_left
,
src_ptr1
,
w
*
sizeof
(
src_ptr1
[
0
]
));
vpx_memset16
(
dst_ptr2
,
src_ptr2
[
0
],
extend_right
);
src_ptr1
+=
src_pitch
;
src_ptr2
+=
src_pitch
;
...
...
@@ -91,12 +91,12 @@ static void highbd_copy_and_extend_plane(const uint8_t *src8, int src_pitch,
linesize
=
extend_left
+
extend_right
+
w
;
for
(
i
=
0
;
i
<
extend_top
;
i
++
)
{
memcpy
(
dst_ptr1
,
src_ptr1
,
linesize
*
sizeof
(
uint16_t
));
memcpy
(
dst_ptr1
,
src_ptr1
,
linesize
*
sizeof
(
src_ptr1
[
0
]
));
dst_ptr1
+=
dst_pitch
;
}
for
(
i
=
0
;
i
<
extend_bottom
;
i
++
)
{
memcpy
(
dst_ptr2
,
src_ptr2
,
linesize
*
sizeof
(
uint16_t
));
memcpy
(
dst_ptr2
,
src_ptr2
,
linesize
*
sizeof
(
src_ptr2
[
0
]
));
dst_ptr2
+=
dst_pitch
;
}
}
...
...
vp10/encoder/rdopt.c
View file @
088b05fd
...
...
@@ -3396,7 +3396,7 @@ void vp10_rd_pick_inter_mode_sb(VP9_COMP *cpi,
if
(
!
x
->
select_tx_size
)
swap_block_ptr
(
x
,
ctx
,
1
,
0
,
0
,
max_plane
);
memcpy
(
ctx
->
zcoeff_blk
,
x
->
zcoeff_blk
[
mbmi
->
tx_size
],
sizeof
(
uint8_t
)
*
ctx
->
num_4x4_blk
);
sizeof
(
ctx
->
zcoeff_blk
[
0
]
)
*
ctx
->
num_4x4_blk
);
// TODO(debargha): enhance this test with a better distortion prediction
// based on qp, activity mask and history
...
...
@@ -4137,7 +4137,7 @@ void vp10_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi,
if
(
!
x
->
select_tx_size
)
swap_block_ptr
(
x
,
ctx
,
1
,
0
,
0
,
max_plane
);
memcpy
(
ctx
->
zcoeff_blk
,
x
->
zcoeff_blk
[
TX_4X4
],
sizeof
(
uint8_t
)
*
ctx
->
num_4x4_blk
);
sizeof
(
ctx
->
zcoeff_blk
[
0
]
)
*
ctx
->
num_4x4_blk
);
for
(
i
=
0
;
i
<
4
;
i
++
)
best_bmodes
[
i
]
=
xd
->
mi
[
0
]
->
bmi
[
i
];
...
...
vp10/encoder/resize.c
View file @
088b05fd
...
...
@@ -448,7 +448,7 @@ static void resize_multistep(const uint8_t *const input,
uint8_t
*
buf
)
{
int
steps
;
if
(
length
==
olength
)
{
memcpy
(
output
,
input
,
sizeof
(
uint8_t
)
*
length
);
memcpy
(
output
,
input
,
sizeof
(
output
[
0
]
)
*
length
);
return
;
}
steps
=
get_down2_steps
(
length
,
olength
);
...
...
@@ -741,7 +741,7 @@ static void highbd_resize_multistep(const uint16_t *const input,
int
bd
)
{
int
steps
;
if
(
length
==
olength
)
{
memcpy
(
output
,
input
,
sizeof
(
uint16_t
)
*
length
);
memcpy
(
output
,
input
,
sizeof
(
output
[
0
]
)
*
length
);
return
;
}
steps
=
get_down2_steps
(
length
,
olength
);
...
...
vp9/common/vp9_reconintra.c
View file @
088b05fd
...
...
@@ -186,24 +186,24 @@ static void build_intra_predictors_high(const MACROBLOCKD *xd,
/* slower path if the block needs border extension */
if
(
x0
+
2
*
bs
<=
frame_width
)
{
if
(
right_available
&&
bs
==
4
)
{
memcpy
(
above_row
,
above_ref
,
2
*
bs
*
sizeof
(
uint16_t
));
memcpy
(
above_row
,
above_ref
,
2
*
bs
*
sizeof
(
above_row
[
0
]
));
}
else
{
memcpy
(
above_row
,
above_ref
,
bs
*
sizeof
(
uint16_t
));
memcpy
(
above_row
,
above_ref
,
bs
*
sizeof
(
above_row
[
0
]
));
vpx_memset16
(
above_row
+
bs
,
above_row
[
bs
-
1
],
bs
);
}
}
else
if
(
x0
+
bs
<=
frame_width
)
{
const
int
r
=
frame_width
-
x0
;
if
(
right_available
&&
bs
==
4
)
{
memcpy
(
above_row
,
above_ref
,
r
*
sizeof
(
uint16_t
));
memcpy
(
above_row
,
above_ref
,
r
*
sizeof
(
above_row
[
0
]
));
vpx_memset16
(
above_row
+
r
,
above_row
[
r
-
1
],
x0
+
2
*
bs
-
frame_width
);
}
else
{
memcpy
(
above_row
,
above_ref
,
bs
*
sizeof
(
uint16_t
));
memcpy
(
above_row
,
above_ref
,
bs
*
sizeof
(
above_row
[
0
]
));
vpx_memset16
(
above_row
+
bs
,
above_row
[
bs
-
1
],
bs
);
}
}
else
if
(
x0
<=
frame_width
)
{
const
int
r
=
frame_width
-
x0
;
memcpy
(
above_row
,
above_ref
,
r
*
sizeof
(
uint16_t
));
memcpy
(
above_row
,
above_ref
,
r
*
sizeof
(
above_row
[
0
]
));
vpx_memset16
(
above_row
+
r
,
above_row
[
r
-
1
],
x0
+
2
*
bs
-
frame_width
);
}
...
...
@@ -214,9 +214,9 @@ static void build_intra_predictors_high(const MACROBLOCKD *xd,
if
(
bs
==
4
&&
right_available
&&
left_available
)
{
const_above_row
=
above_ref
;
}
else
{
memcpy
(
above_row
,
above_ref
,
bs
*
sizeof
(
uint16_t
));
memcpy
(
above_row
,
above_ref
,
bs
*
sizeof
(
above_row
[
0
]
));
if
(
bs
==
4
&&
right_available
)
memcpy
(
above_row
+
bs
,
above_ref
+
bs
,
bs
*
sizeof
(
uint16_t
));
memcpy
(
above_row
+
bs
,
above_ref
+
bs
,
bs
*
sizeof
(
above_row
[
0
]
));
else
vpx_memset16
(
above_row
+
bs
,
above_row
[
bs
-
1
],
bs
);
// TODO(Peter): this value should probably change for high bitdepth
...
...
vp9/encoder/vp9_encodeframe.c
View file @
088b05fd
...
...
@@ -1046,7 +1046,7 @@ static void update_state(VP9_COMP *cpi, ThreadData *td,
x
->
skip
=
ctx
->
skip
;
memcpy
(
x
->
zcoeff_blk
[
mbmi
->
tx_size
],
ctx
->
zcoeff_blk
,
sizeof
(
uint8_t
)
*
ctx
->
num_4x4_blk
);
sizeof
(
ctx
->
zcoeff_blk
[
0
]
)
*
ctx
->
num_4x4_blk
);
if
(
!
output_enabled
)
return
;
...
...
vp9/encoder/vp9_extend.c
View file @
088b05fd
...
...
@@ -74,7 +74,7 @@ static void highbd_copy_and_extend_plane(const uint8_t *src8, int src_pitch,
for
(
i
=
0
;
i
<
h
;
i
++
)
{
vpx_memset16
(
dst_ptr1
,
src_ptr1
[
0
],
extend_left
);
memcpy
(
dst_ptr1
+
extend_left
,
src_ptr1
,
w
*
sizeof
(
uint16_t
));
memcpy
(
dst_ptr1
+
extend_left
,
src_ptr1
,
w
*
sizeof
(
src_ptr1
[
0
]
));
vpx_memset16
(
dst_ptr2
,
src_ptr2
[
0
],
extend_right
);
src_ptr1
+=
src_pitch
;
src_ptr2
+=
src_pitch
;
...
...
@@ -91,12 +91,12 @@ static void highbd_copy_and_extend_plane(const uint8_t *src8, int src_pitch,
linesize
=
extend_left
+
extend_right
+
w
;
for
(
i
=
0
;
i
<
extend_top
;
i
++
)
{
memcpy
(
dst_ptr1
,
src_ptr1
,
linesize
*
sizeof
(
uint16_t
));
memcpy
(
dst_ptr1
,
src_ptr1
,
linesize
*
sizeof
(
src_ptr1
[
0
]
));
dst_ptr1
+=
dst_pitch
;
}
for
(
i
=
0
;
i
<
extend_bottom
;
i
++
)
{
memcpy
(
dst_ptr2
,
src_ptr2
,
linesize
*
sizeof
(
uint16_t
));
memcpy
(
dst_ptr2
,
src_ptr2
,
linesize
*
sizeof
(
src_ptr2
[
0
]
));
dst_ptr2
+=
dst_pitch
;
}
}
...
...
vp9/encoder/vp9_rdopt.c
View file @
088b05fd
...
...
@@ -3394,7 +3394,7 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi,
if
(
!
x
->
select_tx_size
)
swap_block_ptr
(
x
,
ctx
,
1
,
0
,
0
,
max_plane
);
memcpy
(
ctx
->
zcoeff_blk
,
x
->
zcoeff_blk
[
mbmi
->
tx_size
],
sizeof
(
uint8_t
)
*
ctx
->
num_4x4_blk
);
sizeof
(
ctx
->
zcoeff_blk
[
0
]
)
*
ctx
->
num_4x4_blk
);
// TODO(debargha): enhance this test with a better distortion prediction
// based on qp, activity mask and history
...
...
@@ -4135,7 +4135,7 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi,
if
(
!
x
->
select_tx_size
)
swap_block_ptr
(
x
,
ctx
,
1
,
0
,
0
,
max_plane
);
memcpy
(
ctx
->
zcoeff_blk
,
x
->
zcoeff_blk
[
TX_4X4
],
sizeof
(
uint8_t
)
*
ctx
->
num_4x4_blk
);
sizeof
(
ctx
->
zcoeff_blk
[
0
]
)
*
ctx
->
num_4x4_blk
);
for
(
i
=
0
;
i
<
4
;
i
++
)
best_bmodes
[
i
]
=
xd
->
mi
[
0
]
->
bmi
[
i
];
...
...
vp9/encoder/vp9_resize.c
View file @
088b05fd
...
...
@@ -448,7 +448,7 @@ static void resize_multistep(const uint8_t *const input,
uint8_t
*
buf
)
{
int
steps
;
if
(
length
==
olength
)
{
memcpy
(
output
,
input
,
sizeof
(
uint8_t
)
*
length
);
memcpy
(
output
,
input
,
sizeof
(
output
[
0
]
)
*
length
);
return
;
}
steps
=
get_down2_steps
(
length
,
olength
);
...
...
@@ -741,7 +741,7 @@ static void highbd_resize_multistep(const uint16_t *const input,
int
bd
)
{
int
steps
;
if
(
length
==
olength
)
{
memcpy
(
output
,
input
,
sizeof
(
uint16_t
)
*
length
);
memcpy
(
output
,
input
,
sizeof
(
output
[
0
]
)
*
length
);
return
;
}
steps
=
get_down2_steps
(
length
,
olength
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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