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

Side by Side Diff: content/common/gpu/media/vp9_decoder.cc

Issue 1421483005: Reland: Remove DCHECK_IMPLIES/CHECK_IMPLIES. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "content/common/gpu/media/vp9_decoder.h" 6 #include "content/common/gpu/media/vp9_decoder.h"
7 #include "media/base/limits.h" 7 #include "media/base/limits.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 if (!DecodeAndOutputPicture(pic)) { 132 if (!DecodeAndOutputPicture(pic)) {
133 SetError(); 133 SetError();
134 return kDecodeError; 134 return kDecodeError;
135 } 135 }
136 } 136 }
137 } 137 }
138 138
139 void VP9Decoder::RefreshReferenceFrames(const scoped_refptr<VP9Picture>& pic) { 139 void VP9Decoder::RefreshReferenceFrames(const scoped_refptr<VP9Picture>& pic) {
140 for (size_t i = 0; i < media::kVp9NumRefFrames; ++i) { 140 for (size_t i = 0; i < media::kVp9NumRefFrames; ++i) {
141 DCHECK_IMPLIES(pic->frame_hdr->IsKeyframe(), 141 DCHECK(!pic->frame_hdr->IsKeyframe() || pic->frame_hdr->RefreshFlag(i));
142 pic->frame_hdr->RefreshFlag(i));
143 if (pic->frame_hdr->RefreshFlag(i)) 142 if (pic->frame_hdr->RefreshFlag(i))
144 ref_frames_[i] = pic; 143 ref_frames_[i] = pic;
145 } 144 }
146 } 145 }
147 146
148 bool VP9Decoder::DecodeAndOutputPicture(scoped_refptr<VP9Picture> pic) { 147 bool VP9Decoder::DecodeAndOutputPicture(scoped_refptr<VP9Picture> pic) {
149 DCHECK(!pic_size_.IsEmpty()); 148 DCHECK(!pic_size_.IsEmpty());
150 DCHECK(pic->frame_hdr); 149 DCHECK(pic->frame_hdr);
151 150
152 if (!accelerator_->SubmitDecode(pic, parser_.GetSegmentation(), 151 if (!accelerator_->SubmitDecode(pic, parser_.GetSegmentation(),
(...skipping 18 matching lines...) Expand all
171 return pic_size_; 170 return pic_size_;
172 } 171 }
173 172
174 size_t VP9Decoder::GetRequiredNumOfPictures() const { 173 size_t VP9Decoder::GetRequiredNumOfPictures() const {
175 // kMaxVideoFrames to keep higher level media pipeline populated, +2 for the 174 // kMaxVideoFrames to keep higher level media pipeline populated, +2 for the
176 // pictures being parsed and decoded currently. 175 // pictures being parsed and decoded currently.
177 return media::limits::kMaxVideoFrames + media::kVp9NumRefFrames + 2; 176 return media::limits::kMaxVideoFrames + media::kVp9NumRefFrames + 2;
178 } 177 }
179 178
180 } // namespace content 179 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/gl_helper_scaling.cc ('k') | content/renderer/gpu/mailbox_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698