Adding simulcast/spatial layering support to VideoProcessor.
Encoded frames are preserved and decoded after all layers are encoded. Each spatial layer is decoded with separate decoder. For quality evaluation of lowres layers original input frame is downscaled with bilinear interpolation. Encoded and decoded frames are dumped into separate files. For async codecs encoded frames are passed to decoder in encode callback, as before. Bug: webrtc:8524 Change-Id: Idb0c92c7274c1915cff9a011a2794f1cf4bc8cb1 Reviewed-on: https://webrtc-review.googlesource.com/43381 Commit-Queue: Sergey Silkin <ssilkin@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21844}
This commit is contained in:
committed by
Commit Bot
parent
d5e17d6831
commit
10d9d59db1
@ -98,6 +98,10 @@ void TestConfig::SetCodecSettings(VideoCodecType codec_type,
|
||||
// Spatial scalability is only available with VP9.
|
||||
RTC_CHECK(num_spatial_layers < 2 || codec_type == kVideoCodecVP9);
|
||||
|
||||
// Simulcast/SVC is only supposed to work with software codecs.
|
||||
RTC_CHECK((!hw_encoder && !hw_decoder) ||
|
||||
(num_simulcast_streams == 1 && num_spatial_layers == 1));
|
||||
|
||||
// Some base code requires numberOfSimulcastStreams to be set to zero
|
||||
// when simulcast is not used.
|
||||
codec_settings.numberOfSimulcastStreams =
|
||||
@ -186,36 +190,6 @@ size_t TestConfig::NumberOfSimulcastStreams() const {
|
||||
return codec_settings.numberOfSimulcastStreams;
|
||||
}
|
||||
|
||||
size_t TestConfig::TemporalLayerForFrame(size_t frame_idx) const {
|
||||
size_t tl = 0;
|
||||
switch (NumberOfTemporalLayers()) {
|
||||
case 1:
|
||||
tl = 0;
|
||||
break;
|
||||
case 2:
|
||||
// temporal layer 1: 1 3
|
||||
// temporal layer 0: 0 2 4 ...
|
||||
tl = (frame_idx % 2 == 0) ? 0 : 1;
|
||||
break;
|
||||
case 3:
|
||||
// temporal layer 2: 1 3 5 7
|
||||
// temporal layer 1: 2 6
|
||||
// temporal layer 0: 0 4 8 ...
|
||||
if (frame_idx % 4 == 0) {
|
||||
tl = 0;
|
||||
} else if ((frame_idx + 2) % 4 == 0) {
|
||||
tl = 1;
|
||||
} else if ((frame_idx + 1) % 2 == 0) {
|
||||
tl = 2;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
RTC_NOTREACHED();
|
||||
break;
|
||||
}
|
||||
return tl;
|
||||
}
|
||||
|
||||
std::vector<FrameType> TestConfig::FrameTypeForFrame(size_t frame_idx) const {
|
||||
if (keyframe_interval > 0 && (frame_idx % keyframe_interval == 0)) {
|
||||
return {kVideoFrameKey};
|
||||
@ -264,5 +238,9 @@ std::string TestConfig::FilenameWithParams() const {
|
||||
std::to_string(codec_settings.startBitrate);
|
||||
}
|
||||
|
||||
bool TestConfig::IsAsyncCodec() const {
|
||||
return hw_encoder || hw_decoder;
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user