| @@ -164,14 +164,17 @@ vpx_codec_err_t vp9_extrc_get_encodeframe_decision( · 163 unmodified lines |
| 164 | 164 | return VPX_CODEC_OK; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | | −void vp9_extrc_update_encodeframe_result(EXT_RATECTRL *ext_ratectrl, |
| 168 | | − int64_t bit_count, |
| 169 | | − const YV12_BUFFER_CONFIG *source_frame, |
| 170 | | − const YV12_BUFFER_CONFIG *coded_frame, |
| 171 | | − uint32_t bit_depth, |
| 172 | | − uint32_t input_bit_depth) { |
| 167 | +vpx_codec_err_t vp9_extrc_update_encodeframe_result( |
| 168 | + EXT_RATECTRL *ext_ratectrl, int64_t bit_count, |
| 169 | + const YV12_BUFFER_CONFIG *source_frame, |
| 170 | + const YV12_BUFFER_CONFIG *coded_frame, uint32_t bit_depth, |
| 171 | + uint32_t input_bit_depth) { |
| 172 | + if (ext_ratectrl == NULL) { |
| 173 | + return VPX_CODEC_ERROR; |
| 174 | + } |
| 173 | 175 | if (ext_ratectrl->ready) { |
| 174 | 176 | PSNR_STATS psnr; |
| 177 | + vpx_rc_status_t rc_status; |
| 175 | 178 | vpx_rc_encodeframe_result_t encode_frame_result; |
| 176 | 179 | encode_frame_result.bit_count = bit_count; |
| 177 | 180 | encode_frame_result.pixel_count = |
| @@ -186,7 +189,11 @@ void vp9_extrc_update_encodeframe_result(EXT_RATECTRL *ext_ratectrl, · 8 unmodified lines |
| 186 | 189 | vpx_calc_psnr(source_frame, coded_frame, &psnr); |
| 187 | 190 | #endif |
| 188 | 191 | encode_frame_result.sse = psnr.sse[0]; |
| 189 | | − ext_ratectrl->funcs.update_encodeframe_result(ext_ratectrl->model, |
| 190 | | − &encode_frame_result); |
| 192 | + rc_status = ext_ratectrl->funcs.update_encodeframe_result( |
| 193 | + ext_ratectrl->model, &encode_frame_result); |
| 194 | + if (rc_status == VPX_RC_ERROR) { |
| 195 | + return VPX_CODEC_ERROR; |
| 196 | + } |
| 191 | 197 | } |
| 198 | + return VPX_CODEC_OK; |
| 192 | 199 | } |