OLD | NEW |
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 #include "remoting/codec/video_encoder_vpx.h" | 5 #include "remoting/codec/video_encoder_vpx.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 135 |
136 // Request the lowest-CPU usage that VP9 supports, which depends on whether | 136 // Request the lowest-CPU usage that VP9 supports, which depends on whether |
137 // we are encoding lossy or lossless. | 137 // we are encoding lossy or lossless. |
138 // Note that this is configured via the same parameter as for VP8. | 138 // Note that this is configured via the same parameter as for VP8. |
139 int cpu_used = lossless_encode ? 5 : 7; | 139 int cpu_used = lossless_encode ? 5 : 7; |
140 if (vpx_codec_control(codec.get(), VP8E_SET_CPUUSED, cpu_used)) | 140 if (vpx_codec_control(codec.get(), VP8E_SET_CPUUSED, cpu_used)) |
141 return ScopedVpxCodec(); | 141 return ScopedVpxCodec(); |
142 | 142 |
143 // Use the lowest level of noise sensitivity so as to spend less time | 143 // Use the lowest level of noise sensitivity so as to spend less time |
144 // on motion estimation and inter-prediction mode. | 144 // on motion estimation and inter-prediction mode. |
145 // Note that this is configured via the same parameter as for VP8. | 145 if (vpx_codec_control(codec.get(), VP9E_SET_NOISE_SENSITIVITY, 0)) |
146 if (vpx_codec_control(codec.get(), VP8E_SET_NOISE_SENSITIVITY, 0)) | |
147 return ScopedVpxCodec(); | 146 return ScopedVpxCodec(); |
148 | 147 |
149 return codec.Pass(); | 148 return codec.Pass(); |
150 } | 149 } |
151 | 150 |
152 void CreateImage(bool use_i444, | 151 void CreateImage(bool use_i444, |
153 const webrtc::DesktopSize& size, | 152 const webrtc::DesktopSize& size, |
154 scoped_ptr<vpx_image_t>* out_image, | 153 scoped_ptr<vpx_image_t>* out_image, |
155 scoped_ptr<uint8[]>* out_image_buffer) { | 154 scoped_ptr<uint8[]>* out_image_buffer) { |
156 DCHECK(!size.is_empty()); | 155 DCHECK(!size.is_empty()); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 uint8* map = active_map_.get() + top * active_map_width_; | 444 uint8* map = active_map_.get() + top * active_map_width_; |
446 for (int y = top; y <= bottom; ++y) { | 445 for (int y = top; y <= bottom; ++y) { |
447 for (int x = left; x <= right; ++x) | 446 for (int x = left; x <= right; ++x) |
448 map[x] = 1; | 447 map[x] = 1; |
449 map += active_map_width_; | 448 map += active_map_width_; |
450 } | 449 } |
451 } | 450 } |
452 } | 451 } |
453 | 452 |
454 } // namespace remoting | 453 } // namespace remoting |
OLD | NEW |