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

Unified Diff: media/gpu/vp8_decoder.cc

Issue 2926593002: V4L2SVDA/VAAPIVDA: use visible size from decoder and pass to client (Closed)
Patch Set: V4L2SVDA/VAAPIVDA: use visible size from decoder and pass to client Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/gpu/vp8_decoder.h ('k') | media/gpu/vp8_picture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/vp8_decoder.cc
diff --git a/media/gpu/vp8_decoder.cc b/media/gpu/vp8_decoder.cc
index 9d582ed0a627a3c862fe60e8aec93c38d27f9126..f7430651c9002ed9815563bdfac0334cc65b8b6f 100644
--- a/media/gpu/vp8_decoder.cc
+++ b/media/gpu/vp8_decoder.cc
@@ -65,9 +65,24 @@ VP8Decoder::DecodeResult VP8Decoder::Decode() {
}
if (curr_frame_hdr_->IsKeyframe()) {
- gfx::Size new_pic_size(curr_frame_hdr_->width, curr_frame_hdr_->height);
- if (new_pic_size.IsEmpty())
+ gfx::Rect new_visible_rect(curr_frame_hdr_->width, curr_frame_hdr_->height);
+ if (new_visible_rect.IsEmpty())
return kDecodeError;
+ visible_rect_ = new_visible_rect;
+ DVLOG(2) << "Visible size: " << visible_rect_.ToString();
+
+ // Per spec, frame size is not necessarily evenly divisible by 16, while
+ // frame is encoded by 16x16 macroblock units. Add excess width and height
+ // to be divisible by 16.
+ uint16_t coded_width =
Owen Lin 2017/06/14 02:28:25 You may use base::bits::Align. https://cs.chromiu
johnylin1 2017/06/14 14:11:22 Sounds good to me. Let's create another CL then.
+ (curr_frame_hdr_->width & 15)
+ ? curr_frame_hdr_->width + 16 - (curr_frame_hdr_->width & 15)
+ : curr_frame_hdr_->width;
+ uint16_t coded_height =
+ (curr_frame_hdr_->height & 15)
+ ? curr_frame_hdr_->height + 16 - (curr_frame_hdr_->height & 15)
+ : curr_frame_hdr_->height;
+ gfx::Size new_pic_size(coded_width, coded_height);
if (new_pic_size != pic_size_) {
DVLOG(2) << "New resolution: " << new_pic_size.ToString();
@@ -94,6 +109,7 @@ VP8Decoder::DecodeResult VP8Decoder::Decode() {
if (!curr_pic_)
return kRanOutOfSurfaces;
+ curr_pic_->visible_rect = visible_rect_;
if (!DecodeAndOutputCurrentFrame())
return kDecodeError;
« no previous file with comments | « media/gpu/vp8_decoder.h ('k') | media/gpu/vp8_picture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698