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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 // Use the lowest level of noise sensitivity so as to spend less time | 127 // Use the lowest level of noise sensitivity so as to spend less time |
128 // on motion estimation and inter-prediction mode. | 128 // on motion estimation and inter-prediction mode. |
129 ret = vpx_codec_control(codec, VP9E_SET_NOISE_SENSITIVITY, 0); | 129 ret = vpx_codec_control(codec, VP9E_SET_NOISE_SENSITIVITY, 0); |
130 DCHECK_EQ(VPX_CODEC_OK, ret) << "Failed to set noise sensitivity"; | 130 DCHECK_EQ(VPX_CODEC_OK, ret) << "Failed to set noise sensitivity"; |
131 | 131 |
132 // Configure the codec to tune it for screen media. | 132 // Configure the codec to tune it for screen media. |
133 ret = vpx_codec_control( | 133 ret = vpx_codec_control( |
134 codec, VP9E_SET_TUNE_CONTENT, VP9E_CONTENT_SCREEN); | 134 codec, VP9E_SET_TUNE_CONTENT, VP9E_CONTENT_SCREEN); |
135 DCHECK_EQ(VPX_CODEC_OK, ret) << "Failed to set screen content mode"; | 135 DCHECK_EQ(VPX_CODEC_OK, ret) << "Failed to set screen content mode"; |
| 136 |
| 137 // VP9 tiles allow for parallelism on both encode and decode |
| 138 ret = vpx_codec_control(codec, VP9E_SET_TILE_COLUMNS, 1); |
| 139 DCHECK_EQ(VPX_CODEC_OK, ret) << "Failed to set tile columns"; |
136 } | 140 } |
137 | 141 |
138 void CreateImage(bool use_i444, | 142 void CreateImage(bool use_i444, |
139 const webrtc::DesktopSize& size, | 143 const webrtc::DesktopSize& size, |
140 scoped_ptr<vpx_image_t>* out_image, | 144 scoped_ptr<vpx_image_t>* out_image, |
141 scoped_ptr<uint8[]>* out_image_buffer) { | 145 scoped_ptr<uint8[]>* out_image_buffer) { |
142 DCHECK(!size.is_empty()); | 146 DCHECK(!size.is_empty()); |
143 | 147 |
144 scoped_ptr<vpx_image_t> image(new vpx_image_t()); | 148 scoped_ptr<vpx_image_t> image(new vpx_image_t()); |
145 memset(image.get(), 0, sizeof(vpx_image_t)); | 149 memset(image.get(), 0, sizeof(vpx_image_t)); |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 uint8* map = active_map_.get() + top * active_map_width_; | 477 uint8* map = active_map_.get() + top * active_map_width_; |
474 for (int y = top; y <= bottom; ++y) { | 478 for (int y = top; y <= bottom; ++y) { |
475 for (int x = left; x <= right; ++x) | 479 for (int x = left; x <= right; ++x) |
476 map[x] = 1; | 480 map[x] = 1; |
477 map += active_map_width_; | 481 map += active_map_width_; |
478 } | 482 } |
479 } | 483 } |
480 } | 484 } |
481 | 485 |
482 } // namespace remoting | 486 } // namespace remoting |
OLD | NEW |