OLD | NEW |
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 Loading... |
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 |
OLD | NEW |