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

Side by Side Diff: remoting/codec/video_encoder_vpx.cc

Issue 26921005: Add VP9 decode support to the remoting client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update libvpx/webm comment. Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « remoting/codec/video_encoder_vpx.h ('k') | remoting/host/chromoting_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/logging.h" 8 #include "base/logging.h"
9 #include "base/sys_info.h" 9 #include "base/sys_info.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 memset(image_.get(), 0, sizeof(vpx_image_t)); 190 memset(image_.get(), 0, sizeof(vpx_image_t));
191 191
192 image_->fmt = VPX_IMG_FMT_YV12; 192 image_->fmt = VPX_IMG_FMT_YV12;
193 193
194 // libvpx seems to require both to be assigned. 194 // libvpx seems to require both to be assigned.
195 image_->d_w = size.width(); 195 image_->d_w = size.width();
196 image_->w = size.width(); 196 image_->w = size.width();
197 image_->d_h = size.height(); 197 image_->d_h = size.height();
198 image_->h = size.height(); 198 image_->h = size.height();
199 199
200 // libvpx should derive this from|fmt| but currently has a bug:
201 // https://code.google.com/p/webm/issues/detail?id=627
202 image_->x_chroma_shift = 1;
203 image_->y_chroma_shift = 1;
204
200 // Initialize active map. 205 // Initialize active map.
201 active_map_width_ = (image_->w + kMacroBlockSize - 1) / kMacroBlockSize; 206 active_map_width_ = (image_->w + kMacroBlockSize - 1) / kMacroBlockSize;
202 active_map_height_ = (image_->h + kMacroBlockSize - 1) / kMacroBlockSize; 207 active_map_height_ = (image_->h + kMacroBlockSize - 1) / kMacroBlockSize;
203 active_map_.reset(new uint8[active_map_width_ * active_map_height_]); 208 active_map_.reset(new uint8[active_map_width_ * active_map_height_]);
204 209
205 // YUV image size is 1.5 times of a plane. Multiplication is performed first 210 // YUV image size is 1.5 times of a plane. Multiplication is performed first
206 // to avoid rounding error. 211 // to avoid rounding error.
207 const int y_plane_size = image_->w * image_->h; 212 const int y_plane_size = image_->w * image_->h;
208 const int uv_width = (image_->w + 1) / 2; 213 const int uv_width = (image_->w + 1) / 2;
209 const int uv_height = (image_->h + 1) / 2; 214 const int uv_height = (image_->h + 1) / 2;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 uint8* map = active_map_.get() + top * active_map_width_; 312 uint8* map = active_map_.get() + top * active_map_width_;
308 for (int y = top; y <= bottom; ++y) { 313 for (int y = top; y <= bottom; ++y) {
309 for (int x = left; x <= right; ++x) 314 for (int x = left; x <= right; ++x)
310 map[x] = 1; 315 map[x] = 1;
311 map += active_map_width_; 316 map += active_map_width_;
312 } 317 }
313 } 318 }
314 } 319 }
315 320
316 } // namespace remoting 321 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/codec/video_encoder_vpx.h ('k') | remoting/host/chromoting_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698