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

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

Issue 1213323003: Supply empty frames until codec is done with top-off. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Loosen top-off frame count tests Created 5 years, 5 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
« no previous file with comments | « remoting/codec/video_encoder_vpx.cc ('k') | no next file » | 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 <limits> 7 #include <limits>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP8()); 156 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP8());
157 157
158 scoped_ptr<webrtc::DesktopFrame> frame(CreateTestFrame(frame_size)); 158 scoped_ptr<webrtc::DesktopFrame> frame(CreateTestFrame(frame_size));
159 frame->set_dpi(webrtc::DesktopVector(96, 97)); 159 frame->set_dpi(webrtc::DesktopVector(96, 97));
160 scoped_ptr<VideoPacket> packet = encoder->Encode(*frame); 160 scoped_ptr<VideoPacket> packet = encoder->Encode(*frame);
161 EXPECT_EQ(packet->format().x_dpi(), 96); 161 EXPECT_EQ(packet->format().x_dpi(), 96);
162 EXPECT_EQ(packet->format().y_dpi(), 97); 162 EXPECT_EQ(packet->format().y_dpi(), 97);
163 } 163 }
164 164
165 TEST(VideoEncoderVerbatimTest, Vp8EncodeUnchangedFrame) { 165 TEST(VideoEncoderVpxTest, Vp8EncodeUnchangedFrame) {
166 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP8()); 166 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP8());
167 TestVideoEncoderEmptyFrames(encoder.get(), 0); 167 TestVideoEncoderEmptyFrames(encoder.get(), 0);
168 } 168 }
169 169
170 TEST(VideoEncoderVerbatimTest, Vp9LosslessUnchangedFrame) { 170 TEST(VideoEncoderVpxTest, Vp9LosslessUnchangedFrame) {
171 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP9()); 171 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP9());
172 encoder->SetLosslessEncode(true); 172 encoder->SetLosslessEncode(true);
173 TestVideoEncoderEmptyFrames(encoder.get(), 0); 173 TestVideoEncoderEmptyFrames(encoder.get(), 0);
174 } 174 }
175 175
176 TEST(VideoEncoderVerbatimTest, Vp9LossyUnchangedFrame) { 176 TEST(VideoEncoderVpxTest, Vp9LossyUnchangedFrame) {
177 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP9()); 177 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP9());
178 encoder->SetLosslessEncode(false); 178 encoder->SetLosslessEncode(false);
179 TestVideoEncoderEmptyFrames(encoder.get(), 2); 179 // Expect that VP9+CR should generate no more than 10 top-off frames
180 // per cycle, and take no more than 2 cycles to top-off.
181 TestVideoEncoderEmptyFrames(encoder.get(), 20);
180 } 182 }
181 183
182 } // namespace remoting 184 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/codec/video_encoder_vpx.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698