MediaCodecVideoEncoder: Add QP stats to Encoded callback for VP9 and turn on quality scaling.
Add default QP scaling thresholds for VP9. BUG=webrtc:7662 Review-Url: https://codereview.webrtc.org/2914363002 Cr-Commit-Position: refs/heads/master@{#18469}
This commit is contained in:
@ -4,6 +4,7 @@ include_rules = [
|
||||
"+webrtc/common_video/libyuv/include/webrtc_libyuv.h",
|
||||
"+webrtc/modules/utility/include/jvm_android.h",
|
||||
"+webrtc/modules/video_coding/utility/vp8_header_parser.h",
|
||||
"+webrtc/modules/video_coding/utility/vp9_uncompressed_header_parser.h",
|
||||
"+webrtc/pc",
|
||||
"+webrtc/system_wrappers/include/field_trial_default.h",
|
||||
]
|
||||
|
||||
@ -39,6 +39,7 @@
|
||||
#include "webrtc/modules/video_coding/include/video_codec_interface.h"
|
||||
#include "webrtc/modules/video_coding/utility/quality_scaler.h"
|
||||
#include "webrtc/modules/video_coding/utility/vp8_header_parser.h"
|
||||
#include "webrtc/modules/video_coding/utility/vp9_uncompressed_header_parser.h"
|
||||
#include "webrtc/sdk/android/src/jni/androidmediacodeccommon.h"
|
||||
#include "webrtc/sdk/android/src/jni/classreferenceholder.h"
|
||||
#include "webrtc/sdk/android/src/jni/native_handle_impl.h"
|
||||
@ -404,12 +405,14 @@ int32_t MediaCodecVideoEncoder::InitEncode(
|
||||
codec_mode_ = codec_settings->mode;
|
||||
int init_width = codec_settings->width;
|
||||
int init_height = codec_settings->height;
|
||||
// Scaling is disabled for VP9, but optionally enabled for VP8.
|
||||
// Scaling is optionally enabled for VP8 and VP9.
|
||||
// TODO(pbos): Extract automaticResizeOn out of VP8 settings.
|
||||
scale_ = false;
|
||||
if (codec_type == kVideoCodecVP8) {
|
||||
scale_ = codec_settings->VP8().automaticResizeOn;
|
||||
} else if (codec_type != kVideoCodecVP9) {
|
||||
} else if (codec_type == kVideoCodecVP9) {
|
||||
scale_ = codec_settings->VP9().automaticResizeOn;
|
||||
} else {
|
||||
scale_ = true;
|
||||
}
|
||||
|
||||
@ -1104,6 +1107,12 @@ bool MediaCodecVideoEncoder::DeliverPendingOutputs(JNIEnv* jni) {
|
||||
current_acc_qp_ += qp;
|
||||
image->qp_ = qp;
|
||||
}
|
||||
} else if (codec_type == kVideoCodecVP9) {
|
||||
int qp;
|
||||
if (webrtc::vp9::GetQp(payload, payload_size, &qp)) {
|
||||
current_acc_qp_ += qp;
|
||||
image->qp_ = qp;
|
||||
}
|
||||
}
|
||||
} else if (codec_type == kVideoCodecH264) {
|
||||
h264_bitstream_parser_.ParseBitstream(payload, payload_size);
|
||||
|
||||
Reference in New Issue
Block a user