Commit bf2ad75a authored by Jingning Han's avatar Jingning Han
Browse files

Use derived variable size for memcpy

Change-Id: I032fb9b56ed9c9b0abf0910225151a6c8b9aa8e4
parent f4b2926d
......@@ -464,11 +464,12 @@ static void build_intra_predictors_high(const MACROBLOCKD *xd,
if (extend_modes[mode] & NEED_ABOVE) {
const int need_right = !!(extend_modes[mode] & NEED_ABOVERIGHT);
if (n_top_px > 0) {
memcpy(above_row, above_ref, n_top_px * 2);
memcpy(above_row, above_ref, n_top_px * sizeof(above_ref[0]));
i = n_top_px;
if (need_right && n_topright_px > 0) {
assert(n_top_px == bs);
memcpy(above_row + bs, above_ref + bs, n_topright_px * 2);
memcpy(above_row + bs, above_ref + bs,
n_topright_px * sizeof(above_ref[0]));
i += n_topright_px;
}
if (i < (bs << need_right))
......
......@@ -378,7 +378,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
memcpy(output_ref_, output_, kOutputBufferSize);
#if CONFIG_AOM_HIGHBITDEPTH
// Copy 16-bit pixels values. The effective number of bytes is double.
memcpy(output16_ref_, output16_, 2 * kOutputBufferSize);
memcpy(output16_ref_, output16_, sizeof(output16_[0]) * kOutputBufferSize);
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment