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

Side by Side Diff: webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc

Issue 1412573010: Trace encoding/decoding time in a generic way. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 1 month 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/main/source/generic_decoder.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 (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 uint32_t targetPct = optimalBuffersize * scalePar * codec_.maxFramerate / 10; 709 uint32_t targetPct = optimalBuffersize * scalePar * codec_.maxFramerate / 10;
710 710
711 // Don't go below 3 times the per frame bandwidth. 711 // Don't go below 3 times the per frame bandwidth.
712 const uint32_t minIntraTh = 300; 712 const uint32_t minIntraTh = 300;
713 return (targetPct < minIntraTh) ? minIntraTh: targetPct; 713 return (targetPct < minIntraTh) ? minIntraTh: targetPct;
714 } 714 }
715 715
716 int VP8EncoderImpl::Encode(const VideoFrame& frame, 716 int VP8EncoderImpl::Encode(const VideoFrame& frame,
717 const CodecSpecificInfo* codec_specific_info, 717 const CodecSpecificInfo* codec_specific_info,
718 const std::vector<FrameType>* frame_types) { 718 const std::vector<FrameType>* frame_types) {
719 TRACE_EVENT1("webrtc", "VP8::Encode", "timestamp", frame.timestamp());
720
721 if (!inited_) 719 if (!inited_)
722 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; 720 return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
723 if (frame.IsZeroSize()) 721 if (frame.IsZeroSize())
724 return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; 722 return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
725 if (encoded_complete_callback_ == NULL) 723 if (encoded_complete_callback_ == NULL)
726 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; 724 return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
727 725
728 if (quality_scaler_enabled_) 726 if (quality_scaler_enabled_)
729 quality_scaler_.OnEncodeFrame(frame); 727 quality_scaler_.OnEncodeFrame(frame);
730 const VideoFrame& input_image = 728 const VideoFrame& input_image =
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 return -1; 1406 return -1;
1409 } 1407 }
1410 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) 1408 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_)
1411 != VPX_CODEC_OK) { 1409 != VPX_CODEC_OK) {
1412 return -1; 1410 return -1;
1413 } 1411 }
1414 return 0; 1412 return 0;
1415 } 1413 }
1416 1414
1417 } // namespace webrtc 1415 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/video_coding/main/source/generic_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698