From: Angie Chiang Date: Fri, 18 Jun 2021 23:09:41 +0000 (-0700) Subject: Fix flaky assertions in SimpleEncode X-Git-Tag: v1.11.0-rc1~25^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a1fdfbb174487e5efb76e6e77119d2e50840086e;p=libvpx Fix flaky assertions in SimpleEncode Bug: webm:1731 Change-Id: Ieecb98a7ac19e6291acd5d51432dc6a3789e9552 --- diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 28a22ded6..375438839 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -3836,7 +3836,7 @@ void vp9_get_next_group_of_picture(const VP9_COMP *cpi, int *first_is_key_frame, if (gop_command->use) { *coding_frame_count = gop_command_coding_frame_count(gop_command); *use_alt_ref = gop_command->use_alt_ref; - assert(*coding_frame_count < rc.frames_to_key); + assert(gop_command->show_frame_count <= rc.frames_to_key); } else { *coding_frame_count = vp9_get_gop_coding_frame_count( &cpi->oxcf, &cpi->twopass, &cpi->frame_info, &rc, *first_show_idx, diff --git a/vp9/simple_encode.cc b/vp9/simple_encode.cc index 8ff5ad3c9..87727cb12 100644 --- a/vp9/simple_encode.cc +++ b/vp9/simple_encode.cc @@ -1009,8 +1009,7 @@ T *GetVectorData(const std::vector &v) { static GOP_COMMAND GetGopCommand(const std::vector &gop_map, int start_show_index) { GOP_COMMAND gop_command; - if (gop_map.size() > 0) { - assert(static_cast(start_show_index) < gop_map.size()); + if (static_cast(start_show_index) < gop_map.size()) { assert((gop_map[start_show_index] & kGopMapFlagStart) != 0); int end_show_index = start_show_index + 1; // gop_map[end_show_index] & kGopMapFlagStart == 0 means this is