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

Side by Side Diff: webrtc/modules/video_coding/codecs/h264/test/h264_impl_unittest.cc

Issue 2833493003: Don't re-randomize picture_id/tl0_pic_idx when re-initializing internal encoders. (Closed)
Patch Set: Change back TimeMills() -> TimeMicros(). Created 3 years, 7 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 | « no previous file | webrtc/modules/video_coding/codecs/test/video_codec_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 26 matching lines...) Expand all
37 #define MAYBE_DecodedQpEqualsEncodedQp DecodedQpEqualsEncodedQp 37 #define MAYBE_DecodedQpEqualsEncodedQp DecodedQpEqualsEncodedQp
38 #else 38 #else
39 #define MAYBE_EncodeDecode DISABLED_EncodeDecode 39 #define MAYBE_EncodeDecode DISABLED_EncodeDecode
40 #define MAYBE_DecodedQpEqualsEncodedQp DISABLED_DecodedQpEqualsEncodedQp 40 #define MAYBE_DecodedQpEqualsEncodedQp DISABLED_DecodedQpEqualsEncodedQp
41 #endif 41 #endif
42 42
43 TEST_F(TestH264Impl, MAYBE_EncodeDecode) { 43 TEST_F(TestH264Impl, MAYBE_EncodeDecode) {
44 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, 44 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
45 encoder_->Encode(*input_frame_, nullptr, nullptr)); 45 encoder_->Encode(*input_frame_, nullptr, nullptr));
46 EncodedImage encoded_frame; 46 EncodedImage encoded_frame;
47 ASSERT_TRUE(WaitForEncodedFrame(&encoded_frame)); 47 CodecSpecificInfo codec_specific_info;
48 ASSERT_TRUE(WaitForEncodedFrame(&encoded_frame, &codec_specific_info));
48 // First frame should be a key frame. 49 // First frame should be a key frame.
49 encoded_frame._frameType = kVideoFrameKey; 50 encoded_frame._frameType = kVideoFrameKey;
50 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, 51 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
51 decoder_->Decode(encoded_frame, false, nullptr)); 52 decoder_->Decode(encoded_frame, false, nullptr));
52 std::unique_ptr<VideoFrame> decoded_frame; 53 std::unique_ptr<VideoFrame> decoded_frame;
53 rtc::Optional<uint8_t> decoded_qp; 54 rtc::Optional<uint8_t> decoded_qp;
54 ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp)); 55 ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp));
55 ASSERT_TRUE(decoded_frame); 56 ASSERT_TRUE(decoded_frame);
56 EXPECT_GT(I420PSNR(input_frame_.get(), decoded_frame.get()), 36); 57 EXPECT_GT(I420PSNR(input_frame_.get(), decoded_frame.get()), 36);
57 } 58 }
58 59
59 TEST_F(TestH264Impl, MAYBE_DecodedQpEqualsEncodedQp) { 60 TEST_F(TestH264Impl, MAYBE_DecodedQpEqualsEncodedQp) {
60 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, 61 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
61 encoder_->Encode(*input_frame_, nullptr, nullptr)); 62 encoder_->Encode(*input_frame_, nullptr, nullptr));
62 EncodedImage encoded_frame; 63 EncodedImage encoded_frame;
63 ASSERT_TRUE(WaitForEncodedFrame(&encoded_frame)); 64 CodecSpecificInfo codec_specific_info;
65 ASSERT_TRUE(WaitForEncodedFrame(&encoded_frame, &codec_specific_info));
64 // First frame should be a key frame. 66 // First frame should be a key frame.
65 encoded_frame._frameType = kVideoFrameKey; 67 encoded_frame._frameType = kVideoFrameKey;
66 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, 68 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
67 decoder_->Decode(encoded_frame, false, nullptr)); 69 decoder_->Decode(encoded_frame, false, nullptr));
68 std::unique_ptr<VideoFrame> decoded_frame; 70 std::unique_ptr<VideoFrame> decoded_frame;
69 rtc::Optional<uint8_t> decoded_qp; 71 rtc::Optional<uint8_t> decoded_qp;
70 ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp)); 72 ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp));
71 ASSERT_TRUE(decoded_frame); 73 ASSERT_TRUE(decoded_frame);
72 ASSERT_TRUE(decoded_qp); 74 ASSERT_TRUE(decoded_qp);
73 EXPECT_EQ(encoded_frame.qp_, *decoded_qp); 75 EXPECT_EQ(encoded_frame.qp_, *decoded_qp);
74 } 76 }
75 77
76 } // namespace webrtc 78 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/test/video_codec_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698