ref: 54fb24aac324871054ecbb8bc8e526361b094be2
parent: 3acfe46e8d8040314b9e5c5ef5079cc49a707d00
parent: 088b05fd99d48e391a453a48f8d1185eb34e951e
author: Hui Su <[email protected]>
date: Wed Aug 12 15:49:22 EDT 2015
Merge "Use sizeof(variable) instead of sizeof(type)"
--- a/vp10/common/reconintra.c
+++ b/vp10/common/reconintra.c
@@ -173,24 +173,24 @@
/* 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 @@
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
--- a/vp10/encoder/encodeframe.c
+++ b/vp10/encoder/encodeframe.c
@@ -1046,7 +1046,7 @@
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;
--- a/vp10/encoder/extend.c
+++ b/vp10/encoder/extend.c
@@ -74,7 +74,7 @@
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 @@
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;
}
}
--- a/vp10/encoder/rdopt.c
+++ b/vp10/encoder/rdopt.c
@@ -3396,7 +3396,7 @@
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 @@
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];
--- a/vp10/encoder/resize.c
+++ b/vp10/encoder/resize.c
@@ -448,7 +448,7 @@
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 @@
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);
--- a/vp9/common/vp9_reconintra.c
+++ b/vp9/common/vp9_reconintra.c
@@ -186,24 +186,24 @@
/* 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 @@
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
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1046,7 +1046,7 @@
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;
--- a/vp9/encoder/vp9_extend.c
+++ b/vp9/encoder/vp9_extend.c
@@ -74,7 +74,7 @@
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 @@
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;
}
}
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3394,7 +3394,7 @@
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 @@
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];
--- a/vp9/encoder/vp9_resize.c
+++ b/vp9/encoder/vp9_resize.c
@@ -448,7 +448,7 @@
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 @@
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);