Skip to content

Commit

Permalink
Initialize frame_mv in rd pick inter
Browse files Browse the repository at this point in the history
Bug: b/334626386
Change-Id: Ie480a08f09c1b212b4163a5f6eb191c35510236f
  • Loading branch information
jeromejj committed Apr 16, 2024
1 parent 976134c commit 85dafa9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vp9/encoder/vp9_rdopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3435,6 +3435,14 @@ int vp9_active_edge_sb(VP9_COMP *cpi, int mi_row, int mi_col) {
}

#if !CONFIG_REALTIME_ONLY
void init_frame_mv(int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES]) {
for (int mode = 0; mode < MB_MODE_COUNT; ++mode) {
for (int ref_frame = 0; ref_frame < MAX_REF_FRAMES; ++ref_frame) {
frame_mv[mode][ref_frame].as_int = INVALID_MV;
}
}
}

void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data,
MACROBLOCK *x, int mi_row, int mi_col,
RD_COST *rd_cost, BLOCK_SIZE bsize,
Expand Down Expand Up @@ -3530,6 +3538,8 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data,

rd_cost->rate = INT_MAX;

init_frame_mv(frame_mv);

for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
x->pred_mv_sad[ref_frame] = INT_MAX;
if ((cpi->ref_frame_flags & ref_frame_to_flag(ref_frame)) &&
Expand Down

0 comments on commit 85dafa9

Please sign in to comment.