History

Add return to vp9_extrc_update_encodeframe_result

Angie Chiang committed 5 years ago

Commit d49700e1 parent d8905792 files · +20 −14Browse files

Unified · Split

2 files
  1. vp9/encoder/vp9_ext_ratectrl.c +15 −8
  2. vp9/encoder/vp9_ext_ratectrl.h +5 −6
vp9/encoder/vp9_ext_ratectrl.c+15−8
@@ -164,14 +164,17 @@ vpx_codec_err_t vp9_extrc_get_encodeframe_decision( · 163 unmodified lines
164164 return VPX_CODEC_OK;
165165 }
166166
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+ }
173175 if (ext_ratectrl->ready) {
174176 PSNR_STATS psnr;
177+ vpx_rc_status_t rc_status;
175178 vpx_rc_encodeframe_result_t encode_frame_result;
176179 encode_frame_result.bit_count = bit_count;
177180 encode_frame_result.pixel_count =
@@ -186,7 +189,11 @@ void vp9_extrc_update_encodeframe_result(EXT_RATECTRL *ext_ratectrl, · 8 unmodified lines
186189 vpx_calc_psnr(source_frame, coded_frame, &psnr);
187190 #endif
188191 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+ }
191197 }
198+ return VPX_CODEC_OK;
192199 }
vp9/encoder/vp9_ext_ratectrl.h+5−6
@@ -39,11 +39,10 @@ vpx_codec_err_t vp9_extrc_get_encodeframe_decision( · 38 unmodified lines
3939 RefCntBuffer *ref_frame_bufs[MAX_INTER_REF_FRAMES], int ref_frame_flags,
4040 vpx_rc_encodeframe_decision_t *encode_frame_decision);
4141
42−void vp9_extrc_update_encodeframe_result(EXT_RATECTRL *ext_ratectrl,
43− int64_t bit_count,
44− const YV12_BUFFER_CONFIG *source_frame,
45− const YV12_BUFFER_CONFIG *coded_frame,
46− uint32_t bit_depth,
47− uint32_t input_bit_depth);
42+vpx_codec_err_t vp9_extrc_update_encodeframe_result(
43+ EXT_RATECTRL *ext_ratectrl, int64_t bit_count,
44+ const YV12_BUFFER_CONFIG *source_frame,
45+ const YV12_BUFFER_CONFIG *coded_frame, uint32_t bit_depth,
46+ uint32_t input_bit_depth);
4847
4948 #endif // VPX_VP9_ENCODER_VP9_EXT_RATECTRL_H_

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t