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

Side by Side Diff: media/cast/video_sender/codecs/vp8/vp8_encoder.cc

Issue 116623002: Cast: Adding support for GPU accelerated encode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed merge nits Created 6 years, 11 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // TODO (pwestin): add a link to the design document describing the generic 5 // TODO (pwestin): add a link to the design document describing the generic
6 // protocol and the VP8 specific details. 6 // protocol and the VP8 specific details.
7 #include "media/cast/video_sender/codecs/vp8/vp8_encoder.h" 7 #include "media/cast/video_sender/codecs/vp8/vp8_encoder.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 raw_image_->stride[VPX_PLANE_Y] = video_frame->stride(VideoFrame::kYPlane); 140 raw_image_->stride[VPX_PLANE_Y] = video_frame->stride(VideoFrame::kYPlane);
141 raw_image_->stride[VPX_PLANE_U] = video_frame->stride(VideoFrame::kUPlane); 141 raw_image_->stride[VPX_PLANE_U] = video_frame->stride(VideoFrame::kUPlane);
142 raw_image_->stride[VPX_PLANE_V] = video_frame->stride(VideoFrame::kVPlane); 142 raw_image_->stride[VPX_PLANE_V] = video_frame->stride(VideoFrame::kVPlane);
143 143
144 uint8 latest_frame_id_to_reference; 144 uint8 latest_frame_id_to_reference;
145 Vp8Buffers buffer_to_update; 145 Vp8Buffers buffer_to_update;
146 vpx_codec_flags_t flags = 0; 146 vpx_codec_flags_t flags = 0;
147 if (key_frame_requested_) { 147 if (key_frame_requested_) {
148 flags = VPX_EFLAG_FORCE_KF; 148 flags = VPX_EFLAG_FORCE_KF;
149 // Self reference. 149 // Self reference.
150 latest_frame_id_to_reference = 150 latest_frame_id_to_reference = last_encoded_frame_id_ + 1;
151 static_cast<uint8>(last_encoded_frame_id_ + 1);
152 // We can pick any buffer as buffer_to_update since we update 151 // We can pick any buffer as buffer_to_update since we update
153 // them all. 152 // them all.
154 buffer_to_update = kLastBuffer; 153 buffer_to_update = kLastBuffer;
155 } else { 154 } else {
156 // Reference all acked frames (buffers). 155 // Reference all acked frames (buffers).
157 latest_frame_id_to_reference = GetLatestFrameIdToReference(); 156 latest_frame_id_to_reference = GetLatestFrameIdToReference();
158 GetCodecReferenceFlags(&flags); 157 GetCodecReferenceFlags(&flags);
159 buffer_to_update = GetNextBufferToUpdate(); 158 buffer_to_update = GetNextBufferToUpdate();
160 GetCodecUpdateFlags(buffer_to_update, &flags); 159 GetCodecUpdateFlags(buffer_to_update, &flags);
161 } 160 }
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 float scale_parameter = 0.5; 371 float scale_parameter = 0.5;
373 uint32 target_pct = optimal_buffer_size_ms * scale_parameter * 372 uint32 target_pct = optimal_buffer_size_ms * scale_parameter *
374 cast_config_.max_frame_rate / 10; 373 cast_config_.max_frame_rate / 10;
375 374
376 // Don't go below 3 times the per frame bandwidth. 375 // Don't go below 3 times the per frame bandwidth.
377 return std::max(target_pct, kMinIntra); 376 return std::max(target_pct, kMinIntra);
378 } 377 }
379 378
380 } // namespace cast 379 } // namespace cast
381 } // namespace media 380 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/video_receiver/video_decoder_unittest.cc ('k') | media/cast/video_sender/external_video_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698