]> granicus.if.org Git - libvpx/commitdiff
Fix flaky assertions in SimpleEncode
authorAngie Chiang <angiebird@google.com>
Fri, 18 Jun 2021 23:09:41 +0000 (16:09 -0700)
committerAngie Chiang <angiebird@google.com>
Mon, 21 Jun 2021 21:38:13 +0000 (14:38 -0700)
Bug: webm:1731

Change-Id: Ieecb98a7ac19e6291acd5d51432dc6a3789e9552

vp9/encoder/vp9_firstpass.c
vp9/simple_encode.cc

index 28a22ded6db1e2a56ceb0d72131f81b53a04c29a..375438839b1539785e54ec6bb8ed8456e57aae99 100644 (file)
@@ -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,
index 8ff5ad3c98be18067fde18c18f077ce2431af62b..87727cb12af8e8a2042a196d4fe6fa5df4d438ee 100644 (file)
@@ -1009,8 +1009,7 @@ T *GetVectorData(const std::vector<T> &v) {
 static GOP_COMMAND GetGopCommand(const std::vector<int> &gop_map,
                                  int start_show_index) {
   GOP_COMMAND gop_command;
-  if (gop_map.size() > 0) {
-    assert(static_cast<size_t>(start_show_index) < gop_map.size());
+  if (static_cast<size_t>(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