| @@ -2464,7 +2464,12 @@ VP9_COMP *vp9_create_compressor(const VP9EncoderConfig *oxcf, · 2463 unmodified lines |
| 2464 | | 2464 | |
| 2465 | cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED; | 2465 | cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED; |
| 2466 | | 2466 | |
| 2467 | vp9_extrc_init(&cpi->ext_ratectrl); | 2467 | { |
| | 2468 | vpx_codec_err_t codec_status = vp9_extrc_init(&cpi->ext_ratectrl); |
| | 2469 | if (codec_status != VPX_CODEC_OK) { |
| | 2470 | vpx_internal_error(&cm->error, codec_status, "vp9_extrc_init() failed"); |
| | 2471 | } |
| | 2472 | } |
| 2468 | | 2473 | |
| 2469 | #if !CONFIG_REALTIME_ONLY | 2474 | #if !CONFIG_REALTIME_ONLY |
| 2470 | if (oxcf->pass == 1) { | 2475 | if (oxcf->pass == 1) { |
| @@ -4503,6 +4508,7 @@ static void encode_with_recode_loop(VP9_COMP *cpi, size_t *size, uint8_t *dest · 2032 unmodified lines |
| 4503 | } | 4508 | } |
| 4504 | #endif | 4509 | #endif |
| 4505 | if (cpi->ext_ratectrl.ready) { | 4510 | if (cpi->ext_ratectrl.ready) { |
| | 4511 | vpx_codec_err_t codec_status; |
| 4506 | const GF_GROUP *gf_group = &cpi->twopass.gf_group; | 4512 | const GF_GROUP *gf_group = &cpi->twopass.gf_group; |
| 4507 | vpx_rc_encodeframe_decision_t encode_frame_decision; | 4513 | vpx_rc_encodeframe_decision_t encode_frame_decision; |
| 4508 | FRAME_UPDATE_TYPE update_type = gf_group->update_type[gf_group->index]; | 4514 | FRAME_UPDATE_TYPE update_type = gf_group->update_type[gf_group->index]; |
| @@ -4511,10 +4517,14 @@ static void encode_with_recode_loop(VP9_COMP *cpi, size_t *size, uint8_t *dest · 2 unmodified lines |
| 4511 | const RefCntBuffer *curr_frame_buf = | 4517 | const RefCntBuffer *curr_frame_buf = |
| 4512 | get_ref_cnt_buffer(cm, cm->new_fb_idx); | 4518 | get_ref_cnt_buffer(cm, cm->new_fb_idx); |
| 4513 | get_ref_frame_bufs(cpi, ref_frame_bufs); | 4519 | get_ref_frame_bufs(cpi, ref_frame_bufs); |
| 4514 | vp9_extrc_get_encodeframe_decision( | 4520 | codec_status = vp9_extrc_get_encodeframe_decision( |
| 4515 | &cpi->ext_ratectrl, curr_frame_buf->frame_index, | 4521 | &cpi->ext_ratectrl, curr_frame_buf->frame_index, |
| 4516 | cm->current_frame_coding_index, gf_group->index, update_type, | 4522 | cm->current_frame_coding_index, gf_group->index, update_type, |
| 4517 | ref_frame_bufs, ref_frame_flags, &encode_frame_decision); | 4523 | ref_frame_bufs, ref_frame_flags, &encode_frame_decision); |
| | 4524 | if (codec_status != VPX_CODEC_OK) { |
| | 4525 | vpx_internal_error(&cm->error, codec_status, |
| | 4526 | "vp9_extrc_get_encodeframe_decision() failed"); |
| | 4527 | } |
| 4518 | q = encode_frame_decision.q_index; | 4528 | q = encode_frame_decision.q_index; |
| 4519 | } | 4529 | } |
| 4520 | | 4530 | |
| @@ -5489,9 +5499,13 @@ static void encode_frame_to_data_rate( · 968 unmodified lines |
| 5489 | { | 5499 | { |
| 5490 | const RefCntBuffer *coded_frame_buf = | 5500 | const RefCntBuffer *coded_frame_buf = |
| 5491 | get_ref_cnt_buffer(cm, cm->new_fb_idx); | 5501 | get_ref_cnt_buffer(cm, cm->new_fb_idx); |
| 5492 | vp9_extrc_update_encodeframe_result( | 5502 | vpx_codec_err_t codec_status = vp9_extrc_update_encodeframe_result( |
| 5493 | &cpi->ext_ratectrl, (*size) << 3, cpi->Source, &coded_frame_buf->buf, | 5503 | &cpi->ext_ratectrl, (*size) << 3, cpi->Source, &coded_frame_buf->buf, |
| 5494 | cm->bit_depth, cpi->oxcf.input_bit_depth); | 5504 | cm->bit_depth, cpi->oxcf.input_bit_depth); |
| | 5505 | if (codec_status != VPX_CODEC_OK) { |
| | 5506 | vpx_internal_error(&cm->error, codec_status, |
| | 5507 | "vp9_extrc_update_encodeframe_result() failed"); |
| | 5508 | } |
| 5495 | } | 5509 | } |
| 5496 | #if CONFIG_REALTIME_ONLY | 5510 | #if CONFIG_REALTIME_ONLY |
| 5497 | (void)encode_frame_result; | 5511 | (void)encode_frame_result; |
| @@ -5682,8 +5696,13 @@ static void Pass2Encode(VP9_COMP *cpi, size_t *size, uint8_t *dest, · 184 unmodified lines |
| 5682 | cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED; | 5696 | cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED; |
| 5683 | | 5697 | |
| 5684 | if (cpi->common.current_frame_coding_index == 0) { | 5698 | if (cpi->common.current_frame_coding_index == 0) { |
| 5685 | vp9_extrc_send_firstpass_stats(&cpi->ext_ratectrl, | 5699 | VP9_COMMON *cm = &cpi->common; |
| 5686 | &cpi->twopass.first_pass_info); | 5700 | const vpx_codec_err_t codec_status = vp9_extrc_send_firstpass_stats( |
| | 5701 | &cpi->ext_ratectrl, &cpi->twopass.first_pass_info); |
| | 5702 | if (codec_status != VPX_CODEC_OK) { |
| | 5703 | vpx_internal_error(&cm->error, codec_status, |
| | 5704 | "vp9_extrc_send_firstpass_stats() failed"); |
| | 5705 | } |
| 5687 | } | 5706 | } |
| 5688 | #if CONFIG_MISMATCH_DEBUG | 5707 | #if CONFIG_MISMATCH_DEBUG |
| 5689 | mismatch_move_frame_idx_w(); | 5708 | mismatch_move_frame_idx_w(); |