Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1090)

Unified Diff: webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodecH264.mm

Issue 2991123002: ObjC: Fix quality scaling for injected encoders (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodecH264.mm
diff --git a/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodecH264.mm b/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodecH264.mm
index 7cd6a7f0d075deb3ad2c7567b0bffa1b8a2ef5a3..7b38ec047cec1dfd2f1ee3080e91b7982117f077 100644
--- a/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodecH264.mm
+++ b/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodecH264.mm
@@ -27,6 +27,11 @@ const size_t kDefaultPayloadSize = 1440;
const char kHighProfileExperiment[] = "WebRTC-H264HighProfile";
+// These thresholds deviate from the default h264 QP thresholds, as they have been found to work
+// better on devices that support VideoToolbox
+const int kLowH264QpThreshold = 28;
+const int kHighH264QpThreshold = 39;
+
bool IsHighProfileEnabled() {
return webrtc::field_trial::IsEnabled(kHighProfileExperiment);
}
@@ -171,6 +176,11 @@ class H264VideoToolboxDecodeCompleteCallback : public webrtc::DecodedImageCallba
return _videoToolboxEncoder->SetRates(bitrateKbit, framerate) == WEBRTC_VIDEO_CODEC_OK;
}
+- (RTCVideoEncoderQpThresholds *)scalingSettings {
+ return [[RTCVideoEncoderQpThresholds alloc] initWithThresholdsLow:kLowH264QpThreshold
+ high:kHighH264QpThreshold];
+}
+
@end
// Decoder.

Powered by Google App Engine
This is Rietveld 408576698