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

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

Issue 2769263002: Base screenshare layers on TemporalReferences. (Closed)
Patch Set: Created 3 years, 9 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) 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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 assert(codec_specific != NULL); 805 assert(codec_specific != NULL);
806 codec_specific->codecType = kVideoCodecVP8; 806 codec_specific->codecType = kVideoCodecVP8;
807 codec_specific->codec_name = ImplementationName(); 807 codec_specific->codec_name = ImplementationName();
808 CodecSpecificInfoVP8* vp8Info = &(codec_specific->codecSpecific.VP8); 808 CodecSpecificInfoVP8* vp8Info = &(codec_specific->codecSpecific.VP8);
809 vp8Info->pictureId = picture_id_[stream_idx]; 809 vp8Info->pictureId = picture_id_[stream_idx];
810 if (pkt.data.frame.flags & VPX_FRAME_IS_KEY) { 810 if (pkt.data.frame.flags & VPX_FRAME_IS_KEY) {
811 last_key_frame_picture_id_[stream_idx] = picture_id_[stream_idx]; 811 last_key_frame_picture_id_[stream_idx] = picture_id_[stream_idx];
812 } 812 }
813 vp8Info->simulcastIdx = stream_idx; 813 vp8Info->simulcastIdx = stream_idx;
814 vp8Info->keyIdx = kNoKeyIdx; // TODO(hlundin) populate this 814 vp8Info->keyIdx = kNoKeyIdx; // TODO(hlundin) populate this
815 vp8Info->nonReference = 815 vp8Info->nonReference = (pkt.data.frame.flags & VPX_FRAME_IS_DROPPABLE) != 0;
816 (pkt.data.frame.flags & VPX_FRAME_IS_DROPPABLE) ? true : false; 816 temporal_layers_[stream_idx]->PopulateCodecSpecific(
817 bool base_layer_sync_point = pkt.data.frame.flags & VPX_FRAME_IS_KEY; 817 (pkt.data.frame.flags & VPX_FRAME_IS_KEY) != 0, vp8Info, timestamp);
818 temporal_layers_[stream_idx]->PopulateCodecSpecific(base_layer_sync_point,
819 vp8Info, timestamp);
820 // Prepare next. 818 // Prepare next.
821 picture_id_[stream_idx] = (picture_id_[stream_idx] + 1) & 0x7FFF; 819 picture_id_[stream_idx] = (picture_id_[stream_idx] + 1) & 0x7FFF;
822 } 820 }
823 821
824 int VP8EncoderImpl::GetEncodedPartitions(const VideoFrame& input_image) { 822 int VP8EncoderImpl::GetEncodedPartitions(const VideoFrame& input_image) {
825 int bw_resolutions_disabled = 823 int bw_resolutions_disabled =
826 (encoders_.size() > 1) ? NumStreamsDisabled(send_stream_) : -1; 824 (encoders_.size() > 1) ? NumStreamsDisabled(send_stream_) : -1;
827 825
828 int stream_idx = static_cast<int>(encoders_.size()) - 1; 826 int stream_idx = static_cast<int>(encoders_.size()) - 1;
829 int result = WEBRTC_VIDEO_CODEC_OK; 827 int result = WEBRTC_VIDEO_CODEC_OK;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 } 875 }
878 } 876 }
879 encoded_images_[encoder_idx]._timeStamp = input_image.timestamp(); 877 encoded_images_[encoder_idx]._timeStamp = input_image.timestamp();
880 encoded_images_[encoder_idx].capture_time_ms_ = 878 encoded_images_[encoder_idx].capture_time_ms_ =
881 input_image.render_time_ms(); 879 input_image.render_time_ms();
882 encoded_images_[encoder_idx].rotation_ = input_image.rotation(); 880 encoded_images_[encoder_idx].rotation_ = input_image.rotation();
883 881
884 int qp = -1; 882 int qp = -1;
885 vpx_codec_control(&encoders_[encoder_idx], VP8E_GET_LAST_QUANTIZER_64, &qp); 883 vpx_codec_control(&encoders_[encoder_idx], VP8E_GET_LAST_QUANTIZER_64, &qp);
886 temporal_layers_[stream_idx]->FrameEncoded( 884 temporal_layers_[stream_idx]->FrameEncoded(
887 encoded_images_[encoder_idx]._length, 885 encoded_images_[encoder_idx]._length, qp);
888 encoded_images_[encoder_idx]._timeStamp, qp);
889 if (send_stream_[stream_idx]) { 886 if (send_stream_[stream_idx]) {
890 if (encoded_images_[encoder_idx]._length > 0) { 887 if (encoded_images_[encoder_idx]._length > 0) {
891 TRACE_COUNTER_ID1("webrtc", "EncodedFrameSize", encoder_idx, 888 TRACE_COUNTER_ID1("webrtc", "EncodedFrameSize", encoder_idx,
892 encoded_images_[encoder_idx]._length); 889 encoded_images_[encoder_idx]._length);
893 encoded_images_[encoder_idx]._encodedHeight = 890 encoded_images_[encoder_idx]._encodedHeight =
894 codec_.simulcastStream[stream_idx].height; 891 codec_.simulcastStream[stream_idx].height;
895 encoded_images_[encoder_idx]._encodedWidth = 892 encoded_images_[encoder_idx]._encodedWidth =
896 codec_.simulcastStream[stream_idx].width; 893 codec_.simulcastStream[stream_idx].width;
897 // Report once per frame (lowest stream always sent). 894 // Report once per frame (lowest stream always sent).
898 encoded_images_[encoder_idx].adapt_reason_.bw_resolutions_disabled = 895 encoded_images_[encoder_idx].adapt_reason_.bw_resolutions_disabled =
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 buffer_pool_.Release(); 1149 buffer_pool_.Release();
1153 inited_ = false; 1150 inited_ = false;
1154 return WEBRTC_VIDEO_CODEC_OK; 1151 return WEBRTC_VIDEO_CODEC_OK;
1155 } 1152 }
1156 1153
1157 const char* VP8DecoderImpl::ImplementationName() const { 1154 const char* VP8DecoderImpl::ImplementationName() const {
1158 return "libvpx"; 1155 return "libvpx";
1159 } 1156 }
1160 1157
1161 } // namespace webrtc 1158 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698