Index: remoting/codec/video_encoder_vpx.cc |
diff --git a/remoting/codec/video_encoder_vpx.cc b/remoting/codec/video_encoder_vpx.cc |
index d92d5b336e1fdbcdb2b6b341ef9a9b7158e64543..317032cd03969228ec155f6895bf568099303581 100644 |
--- a/remoting/codec/video_encoder_vpx.cc |
+++ b/remoting/codec/video_encoder_vpx.cc |
@@ -373,14 +373,18 @@ void VideoEncoderVpx::PrepareImage(const webrtc::DesktopFrame& frame, |
} |
// Align the region to macroblocks, to avoid encoding artefacts. |
+ // If VP9 is in use then we also pad the rectangles before aligning them, to |
+ // avoid edge artefacts. |
// This also ensures that all rectangles have even-aligned top-left, which |
// is required for ConvertRGBToYUVWithRect() to work. |
std::vector<webrtc::DesktopRect> aligned_rects; |
+ int padding = use_vp9_ ? 8 : 0; |
for (webrtc::DesktopRegion::Iterator r(frame.updated_region()); |
!r.IsAtEnd(); r.Advance()) { |
const webrtc::DesktopRect& rect = r.rect(); |
aligned_rects.push_back(AlignRect(webrtc::DesktopRect::MakeLTRB( |
Sergey Ulanov
2015/01/13 19:19:42
nit: you can just call updated_region->AddRect() h
Wez
2015/01/13 19:29:05
The idea was to allow AddRects() to do whatever sm
|
- rect.left(), rect.top(), rect.right(), rect.bottom()))); |
+ rect.left() - padding, rect.top() - padding, rect.right() + padding, |
+ rect.bottom() + padding))); |
} |
DCHECK(!aligned_rects.empty()); |
updated_region->Clear(); |