]> granicus.if.org Git - libvpx/commitdiff
Fix show_index in vp9_extrc_encodeframe_decision()
authorAngie Chiang <angiebird@google.com>
Fri, 18 Dec 2020 02:09:55 +0000 (18:09 -0800)
committerAngie Chiang <angiebird@google.com>
Fri, 18 Dec 2020 02:09:55 +0000 (18:09 -0800)
Change-Id: I93bb1fb3c14126d881d3f691d30875a0062e436c

test/vp9_ext_ratectrl_test.cc
vp9/encoder/vp9_encoder.c

index 812a18ed2258f7a33279427c7ac14ab34f4130c0..4b3693a3470d68554de306f3718a00413aed652b 100644 (file)
@@ -73,6 +73,7 @@ vpx_rc_status_t rc_get_encodeframe_decision(
   EXPECT_EQ(encode_frame_info->coding_index, toy_rate_ctrl->coding_index);
 
   if (encode_frame_info->coding_index == 0) {
+    EXPECT_EQ(encode_frame_info->show_index, 0);
     EXPECT_EQ(encode_frame_info->gop_index, 0);
     EXPECT_EQ(encode_frame_info->frame_type, 0 /*kFrameTypeKey*/);
     EXPECT_EQ(encode_frame_info->ref_frame_valid_list[0],
@@ -84,6 +85,7 @@ vpx_rc_status_t rc_get_encodeframe_decision(
   }
 
   if (encode_frame_info->coding_index == 1) {
+    EXPECT_EQ(encode_frame_info->show_index, 4);
     EXPECT_EQ(encode_frame_info->gop_index, 1);
     EXPECT_EQ(encode_frame_info->frame_type, 2 /*kFrameTypeAltRef*/);
     EXPECT_EQ(encode_frame_info->ref_frame_valid_list[0],
@@ -104,6 +106,7 @@ vpx_rc_status_t rc_get_encodeframe_decision(
   }
 
   if (encode_frame_info->coding_index == 5) {
+    EXPECT_EQ(encode_frame_info->show_index, 4);
     EXPECT_EQ(encode_frame_info->gop_index, 0);
     EXPECT_EQ(encode_frame_info->frame_type, 3 /*kFrameTypeOverlay*/);
     EXPECT_EQ(encode_frame_info->ref_frame_valid_list[0],
index 37f644501d7c1fa6ef113579a856169c59361d3c..6968e57919674d7f259f3f47606c179255a06d4e 100644 (file)
@@ -4508,9 +4508,11 @@ static void encode_with_recode_loop(VP9_COMP *cpi, size_t *size, uint8_t *dest
       FRAME_UPDATE_TYPE update_type = gf_group->update_type[gf_group->index];
       const int ref_frame_flags = get_ref_frame_flags(cpi);
       RefCntBuffer *ref_frame_bufs[MAX_INTER_REF_FRAMES];
+      const RefCntBuffer *curr_frame_buf =
+          get_ref_cnt_buffer(cm, cm->new_fb_idx);
       get_ref_frame_bufs(cpi, ref_frame_bufs);
       vp9_extrc_get_encodeframe_decision(
-          &cpi->ext_ratectrl, cm->current_video_frame,
+          &cpi->ext_ratectrl, curr_frame_buf->frame_index,
           cm->current_frame_coding_index, gf_group->index, update_type,
           ref_frame_bufs, ref_frame_flags, &encode_frame_decision);
       q = encode_frame_decision.q_index;