| @@ -135,12 +135,16 @@ static int extrc_get_frame_type(FRAME_UPDATE_TYPE update_type) { · 134 unmodified lines |
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | | −void vp9_extrc_get_encodeframe_decision( |
| 138 | +vpx_codec_err_t vp9_extrc_get_encodeframe_decision( |
| 139 | 139 | EXT_RATECTRL *ext_ratectrl, int show_index, int coding_index, int gop_index, |
| 140 | 140 | FRAME_UPDATE_TYPE update_type, |
| 141 | 141 | RefCntBuffer *ref_frame_bufs[MAX_INTER_REF_FRAMES], int ref_frame_flags, |
| 142 | 142 | vpx_rc_encodeframe_decision_t *encode_frame_decision) { |
| 143 | + if (ext_ratectrl == NULL) { |
| 144 | + return VPX_CODEC_ERROR; |
| 145 | + } |
| 143 | 146 | if (ext_ratectrl->ready) { |
| 147 | + vpx_rc_status_t rc_status; |
| 144 | 148 | vpx_rc_encodeframe_info_t encode_frame_info; |
| 145 | 149 | encode_frame_info.show_index = show_index; |
| 146 | 150 | encode_frame_info.coding_index = coding_index; |
| @@ -151,9 +155,13 @@ void vp9_extrc_get_encodeframe_decision( · 4 unmodified lines |
| 151 | 155 | encode_frame_info.ref_frame_coding_indexes, |
| 152 | 156 | encode_frame_info.ref_frame_valid_list); |
| 153 | 157 | |
| 154 | | − ext_ratectrl->funcs.get_encodeframe_decision( |
| 158 | + rc_status = ext_ratectrl->funcs.get_encodeframe_decision( |
| 155 | 159 | ext_ratectrl->model, &encode_frame_info, encode_frame_decision); |
| 160 | + if (rc_status == VPX_RC_ERROR) { |
| 161 | + return VPX_CODEC_ERROR; |
| 162 | + } |
| 156 | 163 | } |
| 164 | + return VPX_CODEC_OK; |
| 157 | 165 | } |
| 158 | 166 | |
| 159 | 167 | void vp9_extrc_update_encodeframe_result(EXT_RATECTRL *ext_ratectrl, |