Remove |hw_encoder| and |hw_decoder| from VideoCodecTestFixture::Config.
Only used for output filename nowadays. Previously, it was used for selecting the codec implementation. That is now done by injecting the appropriate codec factory. Bug: webrtc:9317 Change-Id: Ia2bf28f7df165fb65410ecd1f5d646ee6604e1be Reviewed-on: https://webrtc-review.googlesource.com/c/106023 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Rasmus Brandt <brandtr@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25204}
This commit is contained in:

committed by
Commit Bot

parent
f907c49722
commit
2d0c68744c
@ -123,10 +123,6 @@ class VideoCodecTestFixture {
|
|||||||
webrtc::H264PacketizationMode::NonInterleaved;
|
webrtc::H264PacketizationMode::NonInterleaved;
|
||||||
} h264_codec_settings;
|
} h264_codec_settings;
|
||||||
|
|
||||||
// Should hardware accelerated codecs be used?
|
|
||||||
bool hw_encoder = false;
|
|
||||||
bool hw_decoder = false;
|
|
||||||
|
|
||||||
// Custom checker that will be called for each frame.
|
// Custom checker that will be called for each frame.
|
||||||
const EncodedFrameChecker* encoded_frame_checker = nullptr;
|
const EncodedFrameChecker* encoded_frame_checker = nullptr;
|
||||||
|
|
||||||
|
@ -130,9 +130,7 @@ bool RunEncodeInRealTime(const VideoCodecTestFixtureImpl::Config& config) {
|
|||||||
|
|
||||||
std::string FilenameWithParams(
|
std::string FilenameWithParams(
|
||||||
const VideoCodecTestFixtureImpl::Config& config) {
|
const VideoCodecTestFixtureImpl::Config& config) {
|
||||||
std::string implementation_type = config.hw_encoder ? "hw" : "sw";
|
|
||||||
return config.filename + "_" + config.CodecName() + "_" +
|
return config.filename + "_" + config.CodecName() + "_" +
|
||||||
implementation_type + "_" +
|
|
||||||
std::to_string(config.codec_settings.startBitrate);
|
std::to_string(config.codec_settings.startBitrate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,8 +63,6 @@ VideoCodecTestFixture::Config CreateConfig() {
|
|||||||
config.filepath = ResourcePath(config.filename, "yuv");
|
config.filepath = ResourcePath(config.filename, "yuv");
|
||||||
config.num_frames = kNumFramesLong;
|
config.num_frames = kNumFramesLong;
|
||||||
config.use_single_core = true;
|
config.use_single_core = true;
|
||||||
config.hw_encoder = false;
|
|
||||||
config.hw_decoder = false;
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,8 +33,6 @@ VideoCodecTestFixture::Config CreateConfig() {
|
|||||||
config.filename = "foreman_cif";
|
config.filename = "foreman_cif";
|
||||||
config.filepath = ResourcePath(config.filename, "yuv");
|
config.filepath = ResourcePath(config.filename, "yuv");
|
||||||
config.num_frames = kForemanNumFrames;
|
config.num_frames = kForemanNumFrames;
|
||||||
config.hw_encoder = true;
|
|
||||||
config.hw_decoder = true;
|
|
||||||
// In order to not overwhelm the OpenMAX buffers in the Android MediaCodec.
|
// In order to not overwhelm the OpenMAX buffers in the Android MediaCodec.
|
||||||
config.encode_in_real_time = true;
|
config.encode_in_real_time = true;
|
||||||
return config;
|
return config;
|
||||||
|
@ -32,8 +32,6 @@ VideoCodecTestFixture::Config CreateConfig() {
|
|||||||
config.num_frames = kNumFrames;
|
config.num_frames = kNumFrames;
|
||||||
// Only allow encoder/decoder to use single core, for predictability.
|
// Only allow encoder/decoder to use single core, for predictability.
|
||||||
config.use_single_core = true;
|
config.use_single_core = true;
|
||||||
config.hw_encoder = false;
|
|
||||||
config.hw_decoder = false;
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -20,7 +20,6 @@ namespace {
|
|||||||
// Loop variables.
|
// Loop variables.
|
||||||
const size_t kBitrates[] = {500};
|
const size_t kBitrates[] = {500};
|
||||||
const VideoCodecType kVideoCodecType[] = {kVideoCodecVP8};
|
const VideoCodecType kVideoCodecType[] = {kVideoCodecVP8};
|
||||||
const bool kHwCodec[] = {false};
|
|
||||||
|
|
||||||
// Codec settings.
|
// Codec settings.
|
||||||
const int kNumSpatialLayers = 1;
|
const int kNumSpatialLayers = 1;
|
||||||
@ -39,12 +38,11 @@ const int kNumFrames = 30;
|
|||||||
class VideoCodecTestParameterized
|
class VideoCodecTestParameterized
|
||||||
: public ::testing::Test,
|
: public ::testing::Test,
|
||||||
public ::testing::WithParamInterface<
|
public ::testing::WithParamInterface<
|
||||||
::testing::tuple<size_t, VideoCodecType, bool>> {
|
::testing::tuple<size_t, VideoCodecType>> {
|
||||||
protected:
|
protected:
|
||||||
VideoCodecTestParameterized()
|
VideoCodecTestParameterized()
|
||||||
: bitrate_(::testing::get<0>(GetParam())),
|
: bitrate_(::testing::get<0>(GetParam())),
|
||||||
codec_type_(::testing::get<1>(GetParam())),
|
codec_type_(::testing::get<1>(GetParam())) {}
|
||||||
hw_codec_(::testing::get<2>(GetParam())) {}
|
|
||||||
~VideoCodecTestParameterized() override = default;
|
~VideoCodecTestParameterized() override = default;
|
||||||
|
|
||||||
void RunTest(size_t width,
|
void RunTest(size_t width,
|
||||||
@ -56,8 +54,6 @@ class VideoCodecTestParameterized
|
|||||||
config.filepath = ResourcePath(filename, "yuv");
|
config.filepath = ResourcePath(filename, "yuv");
|
||||||
config.use_single_core = kUseSingleCore;
|
config.use_single_core = kUseSingleCore;
|
||||||
config.measure_cpu = kMeasureCpu;
|
config.measure_cpu = kMeasureCpu;
|
||||||
config.hw_encoder = hw_codec_;
|
|
||||||
config.hw_decoder = hw_codec_;
|
|
||||||
config.num_frames = kNumFrames;
|
config.num_frames = kNumFrames;
|
||||||
|
|
||||||
const size_t num_simulcast_streams =
|
const size_t num_simulcast_streams =
|
||||||
@ -80,14 +76,13 @@ class VideoCodecTestParameterized
|
|||||||
std::unique_ptr<VideoCodecTestFixture> fixture_;
|
std::unique_ptr<VideoCodecTestFixture> fixture_;
|
||||||
const size_t bitrate_;
|
const size_t bitrate_;
|
||||||
const VideoCodecType codec_type_;
|
const VideoCodecType codec_type_;
|
||||||
const bool hw_codec_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(CodecSettings,
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
CodecSettings,
|
||||||
VideoCodecTestParameterized,
|
VideoCodecTestParameterized,
|
||||||
::testing::Combine(::testing::ValuesIn(kBitrates),
|
::testing::Combine(::testing::ValuesIn(kBitrates),
|
||||||
::testing::ValuesIn(kVideoCodecType),
|
::testing::ValuesIn(kVideoCodecType)));
|
||||||
::testing::ValuesIn(kHwCodec)));
|
|
||||||
|
|
||||||
TEST_P(VideoCodecTestParameterized, Foreman_352x288_30) {
|
TEST_P(VideoCodecTestParameterized, Foreman_352x288_30) {
|
||||||
RunTest(352, 288, 30, "foreman_cif");
|
RunTest(352, 288, 30, "foreman_cif");
|
||||||
|
@ -28,8 +28,6 @@ VideoCodecTestFixture::Config CreateConfig() {
|
|||||||
config.filename = "foreman_cif";
|
config.filename = "foreman_cif";
|
||||||
config.filepath = ResourcePath(config.filename, "yuv");
|
config.filepath = ResourcePath(config.filename, "yuv");
|
||||||
config.num_frames = kForemanNumFrames;
|
config.num_frames = kForemanNumFrames;
|
||||||
config.hw_encoder = true;
|
|
||||||
config.hw_decoder = true;
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user