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

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

Issue 2924993002: Move temporal-layer properties to FrameConfig. (Closed)
Patch Set: improve unittests Created 3 years, 5 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 | « webrtc/modules/video_coding/codecs/vp8/temporal_layers.h ('k') | no next file » | 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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 // change isn't stored in configurations_ so change will be discarded at 758 // change isn't stored in configurations_ so change will be discarded at
759 // the next update. 759 // the next update.
760 vpx_codec_enc_cfg_t temp_config; 760 vpx_codec_enc_cfg_t temp_config;
761 memcpy(&temp_config, &configurations_[i], sizeof(vpx_codec_enc_cfg_t)); 761 memcpy(&temp_config, &configurations_[i], sizeof(vpx_codec_enc_cfg_t));
762 if (temporal_layers_[stream_idx]->UpdateConfiguration(&temp_config)) { 762 if (temporal_layers_[stream_idx]->UpdateConfiguration(&temp_config)) {
763 if (vpx_codec_enc_config_set(&encoders_[i], &temp_config)) 763 if (vpx_codec_enc_config_set(&encoders_[i], &temp_config))
764 return WEBRTC_VIDEO_CODEC_ERROR; 764 return WEBRTC_VIDEO_CODEC_ERROR;
765 } 765 }
766 766
767 vpx_codec_control(&encoders_[i], VP8E_SET_FRAME_FLAGS, flags[stream_idx]); 767 vpx_codec_control(&encoders_[i], VP8E_SET_FRAME_FLAGS, flags[stream_idx]);
768 vpx_codec_control( 768 vpx_codec_control(&encoders_[i], VP8E_SET_TEMPORAL_LAYER_ID,
769 &encoders_[i], VP8E_SET_TEMPORAL_LAYER_ID, 769 tl_configs[i].encoder_layer_id);
770 temporal_layers_[stream_idx]->GetTemporalLayerId(tl_configs[i]));
771 } 770 }
772 // TODO(holmer): Ideally the duration should be the timestamp diff of this 771 // TODO(holmer): Ideally the duration should be the timestamp diff of this
773 // frame and the next frame to be encoded, which we don't have. Instead we 772 // frame and the next frame to be encoded, which we don't have. Instead we
774 // would like to use the duration of the previous frame. Unfortunately the 773 // would like to use the duration of the previous frame. Unfortunately the
775 // rate control seems to be off with that setup. Using the average input 774 // rate control seems to be off with that setup. Using the average input
776 // frame rate to calculate an average duration for now. 775 // frame rate to calculate an average duration for now.
777 assert(codec_.maxFramerate > 0); 776 assert(codec_.maxFramerate > 0);
778 uint32_t duration = 90000 / codec_.maxFramerate; 777 uint32_t duration = 90000 / codec_.maxFramerate;
779 778
780 // Note we must pass 0 for |flags| field in encode call below since they are 779 // Note we must pass 0 for |flags| field in encode call below since they are
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 buffer_pool_.Release(); 1149 buffer_pool_.Release();
1151 inited_ = false; 1150 inited_ = false;
1152 return WEBRTC_VIDEO_CODEC_OK; 1151 return WEBRTC_VIDEO_CODEC_OK;
1153 } 1152 }
1154 1153
1155 const char* VP8DecoderImpl::ImplementationName() const { 1154 const char* VP8DecoderImpl::ImplementationName() const {
1156 return "libvpx"; 1155 return "libvpx";
1157 } 1156 }
1158 1157
1159 } // namespace webrtc 1158 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp8/temporal_layers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698