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

Side by Side Diff: webrtc/api/android/jni/androidmediaencoder_jni.cc

Issue 2309743002: Move the QP scaling thresholds to the relevant encoders (Closed)
Patch Set: Remove redundant call Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 if (codecType_ == kVideoCodecVP8) { 388 if (codecType_ == kVideoCodecVP8) {
389 scale_ = codec_settings->codecSpecific.VP8.automaticResizeOn; 389 scale_ = codec_settings->codecSpecific.VP8.automaticResizeOn;
390 } else if (codecType_ != kVideoCodecVP9) { 390 } else if (codecType_ != kVideoCodecVP9) {
391 scale_ = true; 391 scale_ = true;
392 } 392 }
393 393
394 ALOGD << "InitEncode request: " << init_width << " x " << init_height; 394 ALOGD << "InitEncode request: " << init_width << " x " << init_height;
395 ALOGD << "Encoder automatic resize " << (scale_ ? "enabled" : "disabled"); 395 ALOGD << "Encoder automatic resize " << (scale_ ? "enabled" : "disabled");
396 396
397 if (scale_) { 397 if (scale_) {
398 if (codecType_ == kVideoCodecVP8) { 398 if (codecType_ == kVideoCodecVP8 || codecType_ == kVideoCodecH264) {
399 quality_scaler_.Init( 399 quality_scaler_.Init(codecType_, codec_settings->startBitrate,
400 QualityScaler::kLowVp8QpThreshold, QualityScaler::kBadVp8QpThreshold, 400 codec_settings->width, codec_settings->height,
401 codec_settings->startBitrate, codec_settings->width,
402 codec_settings->height, codec_settings->maxFramerate);
403 } else if (codecType_ == kVideoCodecH264) {
404 quality_scaler_.Init(QualityScaler::kLowH264QpThreshold,
405 QualityScaler::kBadH264QpThreshold,
406 codec_settings->startBitrate, codec_settings->width,
407 codec_settings->height,
408 codec_settings->maxFramerate); 401 codec_settings->maxFramerate);
409 } else { 402 } else {
410 // When adding codec support to additional hardware codecs, also configure 403 // When adding codec support to additional hardware codecs, also configure
411 // their QP thresholds for scaling. 404 // their QP thresholds for scaling.
412 RTC_NOTREACHED() << "Unsupported codec without configured QP thresholds."; 405 RTC_NOTREACHED() << "Unsupported codec without configured QP thresholds.";
413 scale_ = false; 406 scale_ = false;
414 } 407 }
415 QualityScaler::Resolution res = quality_scaler_.GetScaledResolution(); 408 QualityScaler::Resolution res = quality_scaler_.GetScaledResolution();
416 init_width = res.width; 409 init_width = res.width;
417 init_height = res.height; 410 init_height = res.height;
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 return supported_codecs_; 1290 return supported_codecs_;
1298 } 1291 }
1299 1292
1300 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( 1293 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder(
1301 webrtc::VideoEncoder* encoder) { 1294 webrtc::VideoEncoder* encoder) {
1302 ALOGD << "Destroy video encoder."; 1295 ALOGD << "Destroy video encoder.";
1303 delete encoder; 1296 delete encoder;
1304 } 1297 }
1305 1298
1306 } // namespace webrtc_jni 1299 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698