| 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 } | 327 } |
| 328 | 328 |
| 329 VideoEncoderVpx::VideoEncoderVpx(bool use_vp9) | 329 VideoEncoderVpx::VideoEncoderVpx(bool use_vp9) |
| 330 : use_vp9_(use_vp9), | 330 : use_vp9_(use_vp9), |
| 331 lossless_encode_(false), | 331 lossless_encode_(false), |
| 332 lossless_color_(false), | 332 lossless_color_(false), |
| 333 active_map_width_(0), | 333 active_map_width_(0), |
| 334 active_map_height_(0) { | 334 active_map_height_(0) { |
| 335 if (use_vp9_) { | 335 if (use_vp9_) { |
| 336 // Use I444 colour space, by default, if specified on the command-line. | 336 // Use I444 colour space, by default, if specified on the command-line. |
| 337 if (CommandLine::ForCurrentProcess()->HasSwitch(kEnableI444SwitchName)) { | 337 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 338 kEnableI444SwitchName)) { |
| 338 SetLosslessColor(true); | 339 SetLosslessColor(true); |
| 339 } | 340 } |
| 340 } | 341 } |
| 341 } | 342 } |
| 342 | 343 |
| 343 bool VideoEncoderVpx::Initialize(const webrtc::DesktopSize& size) { | 344 bool VideoEncoderVpx::Initialize(const webrtc::DesktopSize& size) { |
| 344 DCHECK(use_vp9_ || !lossless_color_); | 345 DCHECK(use_vp9_ || !lossless_color_); |
| 345 DCHECK(use_vp9_ || !lossless_encode_); | 346 DCHECK(use_vp9_ || !lossless_encode_); |
| 346 | 347 |
| 347 codec_.reset(); | 348 codec_.reset(); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 uint8* map = active_map_.get() + top * active_map_width_; | 457 uint8* map = active_map_.get() + top * active_map_width_; |
| 457 for (int y = top; y <= bottom; ++y) { | 458 for (int y = top; y <= bottom; ++y) { |
| 458 for (int x = left; x <= right; ++x) | 459 for (int x = left; x <= right; ++x) |
| 459 map[x] = 1; | 460 map[x] = 1; |
| 460 map += active_map_width_; | 461 map += active_map_width_; |
| 461 } | 462 } |
| 462 } | 463 } |
| 463 } | 464 } |
| 464 | 465 |
| 465 } // namespace remoting | 466 } // namespace remoting |
| OLD | NEW |