Chromium Code Reviews| Index: modules/video_coding/codecs/test/videoprocessor_integrationtest.cc |
| diff --git a/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc b/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc |
| index 4e4262a9f908bf64320fd022926313b6efde1f94..e138c6031534c4fe29de23b2833acf28e6352677 100644 |
| --- a/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc |
| +++ b/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc |
| @@ -175,6 +175,7 @@ void VideoProcessorIntegrationTest::ProcessFramesAndMaybeVerify( |
| const RateProfile& rate_profile, |
| const std::vector<RateControlThresholds>* rc_thresholds, |
| const QualityThresholds* quality_thresholds, |
| + const BitstreamThresholds* bs_thresholds, |
| const VisualizationParams* visualization_params) { |
| // The Android HW codec needs to be run on a task queue, so we simply always |
| // run the test on a task queue. |
| @@ -245,6 +246,10 @@ void VideoProcessorIntegrationTest::ProcessFramesAndMaybeVerify( |
| while (frame_number < num_frames) { |
| UpdateRateControlMetrics(frame_number); |
| + if (bs_thresholds) { |
| + VerifyBitstream(frame_number, bs_thresholds); |
| + } |
| + |
| ++frame_number; |
| if (frame_number == |
| @@ -334,6 +339,11 @@ void VideoProcessorIntegrationTest::CreateEncoderAndDecoder() { |
| case kVideoCodecH264: |
| // TODO(brandtr): Generalize so that we support multiple profiles here. |
| codec = cricket::VideoCodec(cricket::kH264CodecName); |
| + if (config_.packetization_mode == H264PacketizationMode::NonInterleaved) { |
| + codec.SetParam(cricket::kH264FmtpPacketizationMode, "1"); |
| + } else { |
| + codec.SetParam(cricket::kH264FmtpPacketizationMode, "0"); |
|
hbos
2017/09/25 16:13:41
If there is an assumption about the enum only havi
ssilkin
2017/09/26 09:17:52
Sorry, i didn't get you previous comment on this r
|
| + } |
| encoder_.reset(encoder_factory->CreateVideoEncoder(codec)); |
| decoder_ = |
| decoder_factory_->CreateVideoDecoderWithParams(codec, decoder_params); |
| @@ -560,6 +570,15 @@ void VideoProcessorIntegrationTest::PrintRateControlMetrics( |
| printf("\n"); |
| } |
| +void VideoProcessorIntegrationTest::VerifyBitstream( |
| + int frame_number, |
| + const BitstreamThresholds *bs_thresholds) { |
|
hbos
2017/09/25 16:13:41
nit: const BitstreamThresholds* bs_thresholds
ssilkin
2017/09/26 09:17:52
Done.
|
| + RTC_CHECK_GE(frame_number, 0); |
| + const FrameStatistic* frame_stat = stats_.GetFrame(frame_number); |
| + EXPECT_LE(*(frame_stat->max_nalu_length), |
| + *(bs_thresholds->max_nalu_length)); |
| +} |
| + |
| // Temporal layer index corresponding to frame number, for up to 3 layers. |
| int VideoProcessorIntegrationTest::TemporalLayerIndexForFrame( |
| int frame_number) const { |