if ((xd->mb_to_right_edge >> (3 + LOG2_MI_SIZE)) + bw > x_idx &&
(xd->mb_to_bottom_edge >> (3 + LOG2_MI_SIZE)) + bh > y) {
MODE_INFO *mi_addr = xd->mode_info_context + x_idx + y * mis;
-
- vpx_memcpy(mi_addr, mi, sizeof(MODE_INFO));
+ *mi_addr = *mi;
}
}
}
ctx->txfm_rd_diff[ALLOW_32X32] = ctx->txfm_rd_diff[ALLOW_16X16];
}
- if (mbmi->ref_frame != INTRA_FRAME &&
- mbmi->sb_type < BLOCK_SIZE_SB8X8) {
- vpx_memcpy(x->partition_info, &ctx->partition_info,
- sizeof(PARTITION_INFO));
-
- mbmi->mv[0].as_int =
- x->partition_info->bmi[3].mv.as_int;
- mbmi->mv[1].as_int =
- x->partition_info->bmi[3].second_mv.as_int;
+ if (mbmi->ref_frame != INTRA_FRAME && mbmi->sb_type < BLOCK_SIZE_SB8X8) {
+ *x->partition_info = ctx->partition_info;
+ mbmi->mv[0].as_int = x->partition_info->bmi[3].mv.as_int;
+ mbmi->mv[1].as_int = x->partition_info->bmi[3].second_mv.as_int;
}
x->skip = ctx->skip;
- cpi->source->ts_start);
// don't want to do output stats with a stack variable!
- memcpy(&cpi->twopass.this_frame_stats,
- &fps,
- sizeof(FIRSTPASS_STATS));
+ cpi->twopass.this_frame_stats = fps;
output_stats(cpi, cpi->output_pkt_list, &cpi->twopass.this_frame_stats);
accumulate_stats(&cpi->twopass.total_stats, &fps);
}
break;
}
- vpx_memcpy(this_frame, &next_frame, sizeof(*this_frame));
+ *this_frame = next_frame;
old_boost_score = boost_score;
}
// keyframe and section processing !
if (cpi->twopass.frames_to_key == 0) {
// Define next KF group and assign bits to it
- vpx_memcpy(&this_frame_copy, &this_frame, sizeof(this_frame));
+ this_frame_copy = this_frame;
find_next_key_frame(cpi, &this_frame_copy);
}
// Is this a GF / ARF (Note that a KF is always also a GF)
if (cpi->frames_till_gf_update_due == 0) {
// Define next gf group and assign bits to it
- vpx_memcpy(&this_frame_copy, &this_frame, sizeof(this_frame));
+ this_frame_copy = this_frame;
#if CONFIG_MULTIPLE_ARF
if (cpi->multi_arf_enabled) {
// Assign a standard frames worth of bits from those allocated
// to the GF group
int bak = cpi->per_frame_bandwidth;
- vpx_memcpy(&this_frame_copy, &this_frame, sizeof(this_frame));
+ this_frame_copy = this_frame;
assign_std_frame_bits(cpi, &this_frame_copy);
cpi->per_frame_bandwidth = bak;
}
} else {
// Otherwise this is an ordinary frame
// Assign bits from those allocated to the GF group
- vpx_memcpy(&this_frame_copy, &this_frame, sizeof(this_frame));
+ this_frame_copy = this_frame;
assign_std_frame_bits(cpi, &this_frame_copy);
}
double decay_accumulator = 1.0;
double next_iiratio;
- vpx_memcpy(&local_next_frame, next_frame, sizeof(*next_frame));
+ local_next_frame = *next_frame;
// Note the starting file position so we can reset to it
start_pos = cpi->twopass.stats_in;
cpi->twopass.frames_to_key = 1;
// Take a copy of the initial frame details
- vpx_memcpy(&first_frame, this_frame, sizeof(*this_frame));
+ first_frame = *this_frame;
cpi->twopass.kf_group_bits = 0; // Total bits available to kf group
cpi->twopass.kf_group_error_left = 0; // Group modified error score.
kf_group_coded_err += this_frame->coded_error;
// load a the next frame's stats
- vpx_memcpy(&last_frame, this_frame, sizeof(*this_frame));
+ last_frame = *this_frame;
input_stats(cpi, this_frame);
// Provided that we are not at the end of the file...
cpi->twopass.frames_to_key /= 2;
// Copy first frame details
- vpx_memcpy(&tmp_frame, &first_frame, sizeof(first_frame));
+ tmp_frame = first_frame;
// Reset to the start of the group
reset_fpf_position(cpi, start_position);
// restored if we decide to encode this way
ctx->skip = x->skip;
ctx->best_mode_index = mode_index;
- vpx_memcpy(&ctx->mic, xd->mode_info_context,
- sizeof(MODE_INFO));
+ ctx->mic = *xd->mode_info_context;
+
if (partition)
- vpx_memcpy(&ctx->partition_info, partition,
- sizeof(PARTITION_INFO));
+ ctx->partition_info = *partition;
+
ctx->best_ref_mv.as_int = ref_mv->as_int;
ctx->second_best_ref_mv.as_int = second_ref_mv->as_int;
xd->mode_info_context->mbmi.mode = mode;
}
- vpx_memcpy(&ctx->mic, xd->mode_info_context, sizeof(MODE_INFO));
+ ctx->mic = *xd->mode_info_context;
}
int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
tmp_best_ratey = rate_y;
tmp_best_distortion = distortion;
tmp_best_skippable = skippable;
- vpx_memcpy(&tmp_best_mbmode, mbmi, sizeof(MB_MODE_INFO));
- vpx_memcpy(&tmp_best_partition, x->partition_info,
- sizeof(PARTITION_INFO));
- for (i = 0; i < 4; i++) {
+ tmp_best_mbmode = *mbmi;
+ tmp_best_partition = *x->partition_info;
+ for (i = 0; i < 4; i++)
tmp_best_bmodes[i] = xd->mode_info_context->bmi[i];
- }
pred_exists = 1;
}
} // switchable_filter_index loop
rate_y = tmp_best_ratey;
distortion = tmp_best_distortion;
skippable = tmp_best_skippable;
- vpx_memcpy(mbmi, &tmp_best_mbmode, sizeof(MB_MODE_INFO));
- vpx_memcpy(x->partition_info, &tmp_best_partition,
- sizeof(PARTITION_INFO));
- for (i = 0; i < 4; i++) {
+ *mbmi = tmp_best_mbmode;
+ *x->partition_info = tmp_best_partition;
+ for (i = 0; i < 4; i++)
xd->mode_info_context->bmi[i] = tmp_best_bmodes[i];
- }
}
rate2 += rate;
*returnrate = rate2;
*returndistortion = distortion2;
best_rd = this_rd;
- vpx_memcpy(&best_mbmode, mbmi, sizeof(MB_MODE_INFO));
- vpx_memcpy(&best_partition, x->partition_info, sizeof(PARTITION_INFO));
+ best_mbmode = *mbmi;
+ best_partition = *x->partition_info;
- if (this_mode == I4X4_PRED || this_mode == SPLITMV) {
- for (i = 0; i < 4; i++) {
+ if (this_mode == I4X4_PRED || this_mode == SPLITMV)
+ for (i = 0; i < 4; i++)
best_bmodes[i] = xd->mode_info_context->bmi[i];
- }
- }
}
#if 0
// Testing this mode gave rise to an improvement in best error score.
}
// macroblock modes
- vpx_memcpy(mbmi, &best_mbmode, sizeof(MB_MODE_INFO));
+ *mbmi = best_mbmode;
if (best_mbmode.ref_frame == INTRA_FRAME &&
best_mbmode.sb_type < BLOCK_SIZE_SB8X8) {
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++)
xd->mode_info_context->bmi[i].as_mode = best_bmodes[i].as_mode;
- }
}
if (best_mbmode.ref_frame != INTRA_FRAME &&
for (i = 0; i < 4; i++)
xd->mode_info_context->bmi[i].as_mv[0].as_int =
best_bmodes[i].as_mv[0].as_int;
+
if (mbmi->second_ref_frame > 0)
for (i = 0; i < 4; i++)
xd->mode_info_context->bmi[i].as_mv[1].as_int =
best_bmodes[i].as_mv[1].as_int;
- vpx_memcpy(x->partition_info, &best_partition, sizeof(PARTITION_INFO));
+ *x->partition_info = best_partition;
mbmi->mv[0].as_int = x->partition_info->bmi[3].mv.as_int;
mbmi->mv[1].as_int = x->partition_info->bmi[3].second_mv.as_int;