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

Side by Side Diff: webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc

Issue 2911193002: Implement timing frames. (Closed)
Patch Set: Implement Holmer@ comments Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 11 matching lines...) Expand all
22 #include "vpx/vp8dx.h" 22 #include "vpx/vp8dx.h"
23 23
24 #include "webrtc/base/checks.h" 24 #include "webrtc/base/checks.h"
25 #include "webrtc/base/keep_ref_until_done.h" 25 #include "webrtc/base/keep_ref_until_done.h"
26 #include "webrtc/base/logging.h" 26 #include "webrtc/base/logging.h"
27 #include "webrtc/base/random.h" 27 #include "webrtc/base/random.h"
28 #include "webrtc/base/timeutils.h" 28 #include "webrtc/base/timeutils.h"
29 #include "webrtc/base/trace_event.h" 29 #include "webrtc/base/trace_event.h"
30 #include "webrtc/common_video/include/video_frame_buffer.h" 30 #include "webrtc/common_video/include/video_frame_buffer.h"
31 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 31 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
32 #include "webrtc/modules/include/module_common_types.h"
33 #include "webrtc/modules/video_coding/codecs/vp9/screenshare_layers.h" 32 #include "webrtc/modules/video_coding/codecs/vp9/screenshare_layers.h"
34 33
35 namespace webrtc { 34 namespace webrtc {
36 35
37 // Only positive speeds, range for real-time coding currently is: 5 - 8. 36 // Only positive speeds, range for real-time coding currently is: 5 - 8.
38 // Lower means slower/better quality, higher means fastest/lower quality. 37 // Lower means slower/better quality, higher means fastest/lower quality.
39 int GetCpuSpeed(int width, int height) { 38 int GetCpuSpeed(int width, int height) {
40 #if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64) || defined(ANDROID) 39 #if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64) || defined(ANDROID)
41 return 8; 40 return 8;
42 #else 41 #else
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 if (encoded_image_._length > 0) { 702 if (encoded_image_._length > 0) {
704 TRACE_COUNTER1("webrtc", "EncodedFrameSize", encoded_image_._length); 703 TRACE_COUNTER1("webrtc", "EncodedFrameSize", encoded_image_._length);
705 encoded_image_._timeStamp = input_image_->timestamp(); 704 encoded_image_._timeStamp = input_image_->timestamp();
706 encoded_image_.capture_time_ms_ = input_image_->render_time_ms(); 705 encoded_image_.capture_time_ms_ = input_image_->render_time_ms();
707 encoded_image_.rotation_ = input_image_->rotation(); 706 encoded_image_.rotation_ = input_image_->rotation();
708 encoded_image_.content_type_ = (codec_.mode == kScreensharing) 707 encoded_image_.content_type_ = (codec_.mode == kScreensharing)
709 ? VideoContentType::SCREENSHARE 708 ? VideoContentType::SCREENSHARE
710 : VideoContentType::UNSPECIFIED; 709 : VideoContentType::UNSPECIFIED;
711 encoded_image_._encodedHeight = raw_->d_h; 710 encoded_image_._encodedHeight = raw_->d_h;
712 encoded_image_._encodedWidth = raw_->d_w; 711 encoded_image_._encodedWidth = raw_->d_w;
712 encoded_image_.timing_.is_timing_frame = false;
713 int qp = -1; 713 int qp = -1;
714 vpx_codec_control(encoder_, VP8E_GET_LAST_QUANTIZER, &qp); 714 vpx_codec_control(encoder_, VP8E_GET_LAST_QUANTIZER, &qp);
715 encoded_image_.qp_ = qp; 715 encoded_image_.qp_ = qp;
716
716 encoded_complete_callback_->OnEncodedImage(encoded_image_, &codec_specific, 717 encoded_complete_callback_->OnEncodedImage(encoded_image_, &codec_specific,
717 &frag_info); 718 &frag_info);
718 } 719 }
719 return WEBRTC_VIDEO_CODEC_OK; 720 return WEBRTC_VIDEO_CODEC_OK;
720 } 721 }
721 722
722 vpx_svc_ref_frame_config VP9EncoderImpl::GenerateRefsAndFlags( 723 vpx_svc_ref_frame_config VP9EncoderImpl::GenerateRefsAndFlags(
723 const SuperFrameRefSettings& settings) { 724 const SuperFrameRefSettings& settings) {
724 static const vpx_enc_frame_flags_t kAllFlags = 725 static const vpx_enc_frame_flags_t kAllFlags =
725 VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_LAST | 726 VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_LAST |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 frame_buffer_pool_.ClearPool(); 1008 frame_buffer_pool_.ClearPool();
1008 inited_ = false; 1009 inited_ = false;
1009 return WEBRTC_VIDEO_CODEC_OK; 1010 return WEBRTC_VIDEO_CODEC_OK;
1010 } 1011 }
1011 1012
1012 const char* VP9DecoderImpl::ImplementationName() const { 1013 const char* VP9DecoderImpl::ImplementationName() const {
1013 return "libvpx"; 1014 return "libvpx";
1014 } 1015 }
1015 1016
1016 } // namespace webrtc 1017 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc ('k') | webrtc/modules/video_coding/encoded_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698