Update Android HW encoders to the latest CodecSpecificInfoVP9 changes.

- Always set |first_frame_in_picture| and |end_of_superframe|.
- Avoid division by zero when calculating the gof_idx.

Bug: webrtc:9157
Change-Id: I19e48fa4f639815c874edec0e32deb5914912410
Tested: AppRTCMobile
Reviewed-on: https://webrtc-review.googlesource.com/70143
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22903}
This commit is contained in:
Rasmus Brandt
2018-04-17 13:49:18 +02:00
committed by Commit Bot
parent 772d43d4c0
commit 4478d9b773
2 changed files with 6 additions and 0 deletions

View File

@ -1080,6 +1080,8 @@ bool MediaCodecVideoEncoder::DeliverPendingOutputs(JNIEnv* jni) {
info.codecSpecific.VP9.gof_idx =
static_cast<uint8_t>(gof_idx_++ % gof_.num_frames_in_gof);
info.codecSpecific.VP9.num_spatial_layers = 1;
info.codecSpecific.VP9.first_frame_in_picture = true;
info.codecSpecific.VP9.end_of_superframe = true;
info.codecSpecific.VP9.spatial_layer_resolution_present = false;
if (info.codecSpecific.VP9.ss_data_available) {
info.codecSpecific.VP9.spatial_layer_resolution_present = true;

View File

@ -66,6 +66,8 @@ int32_t VideoEncoderWrapper::InitEncodeInternal(JNIEnv* jni) {
break;
case kVideoCodecVP9:
automatic_resize_on = codec_settings_.VP9()->automaticResizeOn;
gof_.SetGofInfoVP9(TemporalStructureMode::kTemporalStructureMode1);
gof_idx_ = 0;
break;
default:
automatic_resize_on = true;
@ -414,6 +416,8 @@ CodecSpecificInfo VideoEncoderWrapper::ParseCodecSpecificInfo(
info.codecSpecific.VP9.gof_idx =
static_cast<uint8_t>(gof_idx_++ % gof_.num_frames_in_gof);
info.codecSpecific.VP9.num_spatial_layers = 1;
info.codecSpecific.VP9.first_frame_in_picture = true;
info.codecSpecific.VP9.end_of_superframe = true;
info.codecSpecific.VP9.spatial_layer_resolution_present = false;
if (info.codecSpecific.VP9.ss_data_available) {
info.codecSpecific.VP9.spatial_layer_resolution_present = true;