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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 config.rc_min_quantizer = 20; | 129 config.rc_min_quantizer = 20; |
130 config.rc_max_quantizer = 30; | 130 config.rc_max_quantizer = 30; |
131 } | 131 } |
132 | 132 |
133 if (vpx_codec_enc_init(codec.get(), algo, &config, 0)) | 133 if (vpx_codec_enc_init(codec.get(), algo, &config, 0)) |
134 return ScopedVpxCodec(); | 134 return ScopedVpxCodec(); |
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 : 6; |
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 if (vpx_codec_control(codec.get(), VP9E_SET_NOISE_SENSITIVITY, 0)) | 145 if (vpx_codec_control(codec.get(), VP9E_SET_NOISE_SENSITIVITY, 0)) |
146 return ScopedVpxCodec(); | 146 return ScopedVpxCodec(); |
147 | 147 |
148 return codec.Pass(); | 148 return codec.Pass(); |
149 } | 149 } |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 uint8* map = active_map_.get() + top * active_map_width_; | 444 uint8* map = active_map_.get() + top * active_map_width_; |
445 for (int y = top; y <= bottom; ++y) { | 445 for (int y = top; y <= bottom; ++y) { |
446 for (int x = left; x <= right; ++x) | 446 for (int x = left; x <= right; ++x) |
447 map[x] = 1; | 447 map[x] = 1; |
448 map += active_map_width_; | 448 map += active_map_width_; |
449 } | 449 } |
450 } | 450 } |
451 } | 451 } |
452 | 452 |
453 } // namespace remoting | 453 } // namespace remoting |
OLD | NEW |