ref: d890579a2ec8a8a36b1e75b3fe6662faa99608e5
parent: 27f1838519ea1354bb8a038ec4e9d2c6da0da994
author: Angie Chiang <angiebird@google.com>
date: Tue Jan 19 12:57:00 EST 2021
Add status in vp9_extrc_get_encodeframe_decision Bug: webm:1716 Change-Id: Ie6d63a68539369c51fefefa528e299b00a967e29
--- a/vp9/encoder/vp9_ext_ratectrl.c
+++ b/vp9/encoder/vp9_ext_ratectrl.c
@@ -135,12 +135,16 @@
}
}
-void vp9_extrc_get_encodeframe_decision(
+vpx_codec_err_t vp9_extrc_get_encodeframe_decision(
EXT_RATECTRL *ext_ratectrl, int show_index, int coding_index, int gop_index,
FRAME_UPDATE_TYPE update_type,
RefCntBuffer *ref_frame_bufs[MAX_INTER_REF_FRAMES], int ref_frame_flags,
vpx_rc_encodeframe_decision_t *encode_frame_decision) {
+ if (ext_ratectrl == NULL) {
+ return VPX_CODEC_ERROR;
+ }
if (ext_ratectrl->ready) {
+ vpx_rc_status_t rc_status;
vpx_rc_encodeframe_info_t encode_frame_info;
encode_frame_info.show_index = show_index;
encode_frame_info.coding_index = coding_index;
@@ -151,9 +155,13 @@
encode_frame_info.ref_frame_coding_indexes,
encode_frame_info.ref_frame_valid_list);
- ext_ratectrl->funcs.get_encodeframe_decision(
+ rc_status = ext_ratectrl->funcs.get_encodeframe_decision(
ext_ratectrl->model, &encode_frame_info, encode_frame_decision);
+ if (rc_status == VPX_RC_ERROR) {
+ return VPX_CODEC_ERROR;
+ }
}
+ return VPX_CODEC_OK;
}
void vp9_extrc_update_encodeframe_result(EXT_RATECTRL *ext_ratectrl,
--- a/vp9/encoder/vp9_ext_ratectrl.h
+++ b/vp9/encoder/vp9_ext_ratectrl.h
@@ -33,7 +33,7 @@
vpx_codec_err_t vp9_extrc_send_firstpass_stats(
EXT_RATECTRL *ext_ratectrl, const FIRST_PASS_INFO *first_pass_info);
-void vp9_extrc_get_encodeframe_decision(
+vpx_codec_err_t vp9_extrc_get_encodeframe_decision(
EXT_RATECTRL *ext_ratectrl, int show_index, int coding_index, int gop_index,
FRAME_UPDATE_TYPE update_type,
RefCntBuffer *ref_frame_bufs[MAX_INTER_REF_FRAMES], int ref_frame_flags,