diff options
author | Angie Chiang <angiebird@google.com> | 2021-01-19 18:18:20 -0800 |
---|---|---|
committer | Angie Chiang <angiebird@google.com> | 2021-01-19 18:54:07 -0800 |
commit | d49700e25b280eba27ab3804cc769aed68ffb3e5 (patch) | |
tree | e5e100374a62534ada3f0d2e24062d77563514d0 /vp9/encoder | |
parent | d890579a2ec8a8a36b1e75b3fe6662faa99608e5 (diff) | |
download | libvpx-d49700e25b280eba27ab3804cc769aed68ffb3e5.tar libvpx-d49700e25b280eba27ab3804cc769aed68ffb3e5.tar.gz libvpx-d49700e25b280eba27ab3804cc769aed68ffb3e5.tar.bz2 libvpx-d49700e25b280eba27ab3804cc769aed68ffb3e5.zip |
Add return to vp9_extrc_update_encodeframe_result
Bug: webm:1716
Change-Id: Ib016ab5a49c765971366cc8d2b75bcca3ed5bd0f
Diffstat (limited to 'vp9/encoder')
-rw-r--r-- | vp9/encoder/vp9_ext_ratectrl.c | 23 | ||||
-rw-r--r-- | vp9/encoder/vp9_ext_ratectrl.h | 11 |
2 files changed, 20 insertions, 14 deletions
diff --git a/vp9/encoder/vp9_ext_ratectrl.c b/vp9/encoder/vp9_ext_ratectrl.c index ec6e198af..70d6dd9c2 100644 --- a/vp9/encoder/vp9_ext_ratectrl.c +++ b/vp9/encoder/vp9_ext_ratectrl.c @@ -164,14 +164,17 @@ vpx_codec_err_t vp9_extrc_get_encodeframe_decision( return VPX_CODEC_OK; } -void vp9_extrc_update_encodeframe_result(EXT_RATECTRL *ext_ratectrl, - int64_t bit_count, - const YV12_BUFFER_CONFIG *source_frame, - const YV12_BUFFER_CONFIG *coded_frame, - uint32_t bit_depth, - uint32_t input_bit_depth) { +vpx_codec_err_t vp9_extrc_update_encodeframe_result( + EXT_RATECTRL *ext_ratectrl, int64_t bit_count, + const YV12_BUFFER_CONFIG *source_frame, + const YV12_BUFFER_CONFIG *coded_frame, uint32_t bit_depth, + uint32_t input_bit_depth) { + if (ext_ratectrl == NULL) { + return VPX_CODEC_ERROR; + } if (ext_ratectrl->ready) { PSNR_STATS psnr; + vpx_rc_status_t rc_status; vpx_rc_encodeframe_result_t encode_frame_result; encode_frame_result.bit_count = bit_count; encode_frame_result.pixel_count = @@ -186,7 +189,11 @@ void vp9_extrc_update_encodeframe_result(EXT_RATECTRL *ext_ratectrl, vpx_calc_psnr(source_frame, coded_frame, &psnr); #endif encode_frame_result.sse = psnr.sse[0]; - ext_ratectrl->funcs.update_encodeframe_result(ext_ratectrl->model, - &encode_frame_result); + rc_status = ext_ratectrl->funcs.update_encodeframe_result( + ext_ratectrl->model, &encode_frame_result); + if (rc_status == VPX_RC_ERROR) { + return VPX_CODEC_ERROR; + } } + return VPX_CODEC_OK; } diff --git a/vp9/encoder/vp9_ext_ratectrl.h b/vp9/encoder/vp9_ext_ratectrl.h index 2082cd530..11e9102a6 100644 --- a/vp9/encoder/vp9_ext_ratectrl.h +++ b/vp9/encoder/vp9_ext_ratectrl.h @@ -39,11 +39,10 @@ vpx_codec_err_t vp9_extrc_get_encodeframe_decision( RefCntBuffer *ref_frame_bufs[MAX_INTER_REF_FRAMES], int ref_frame_flags, vpx_rc_encodeframe_decision_t *encode_frame_decision); -void vp9_extrc_update_encodeframe_result(EXT_RATECTRL *ext_ratectrl, - int64_t bit_count, - const YV12_BUFFER_CONFIG *source_frame, - const YV12_BUFFER_CONFIG *coded_frame, - uint32_t bit_depth, - uint32_t input_bit_depth); +vpx_codec_err_t vp9_extrc_update_encodeframe_result( + EXT_RATECTRL *ext_ratectrl, int64_t bit_count, + const YV12_BUFFER_CONFIG *source_frame, + const YV12_BUFFER_CONFIG *coded_frame, uint32_t bit_depth, + uint32_t input_bit_depth); #endif // VPX_VP9_ENCODER_VP9_EXT_RATECTRL_H_ |