Skip to content

Commit

Permalink
Merge "Reduce memory usage of test with large frame size" into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromejj authored and Gerrit Code Review committed Oct 20, 2023
2 parents 9004ace + 352f9f6 commit 974c145
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/encode_api_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,12 @@ TEST(EncodeAPI, ConfigResizeChangeThreadCount) {
}

#if CONFIG_VP9_ENCODER
// Frame size needed to trigger the overflow exceeds the max buffer allowed on
// 32-bit systems defined by VPX_MAX_ALLOCABLE_MEMORY
#if VPX_ARCH_X86_64 || VPX_ARCH_AARCH64
TEST(EncodeAPI, ConfigLargeTargetBitrateVp9) {
constexpr int kWidth = 16383;
constexpr int kHeight = 16383;
constexpr int kWidth = 12383;
constexpr int kHeight = 8192;
constexpr auto *iface = &vpx_codec_vp9_cx_algo;
SCOPED_TRACE(vpx_codec_iface_name(iface));
vpx_codec_enc_cfg_t cfg = {};
Expand All @@ -425,10 +427,11 @@ TEST(EncodeAPI, ConfigLargeTargetBitrateVp9) {
// The following setting will cause avg_frame_bandwidth in rate control to be
// larger than INT_MAX
cfg.rc_target_bitrate = INT_MAX;
// Framerate 0.1 (equivalent to timebase 10) is the smallest framerate allowed
// by libvpx
cfg.g_timebase.den = 1;
cfg.g_timebase.num = 10;
EXPECT_NO_FATAL_FAILURE(InitCodec(*iface, kWidth, kHeight, &enc.ctx, &cfg));
EXPECT_NO_FATAL_FAILURE(EncodeWithConfig(cfg, &enc.ctx))
EXPECT_NO_FATAL_FAILURE(InitCodec(*iface, kWidth, kHeight, &enc.ctx, &cfg))
<< "target bitrate: " << cfg.rc_target_bitrate << " framerate: "
<< static_cast<double>(cfg.g_timebase.den) / cfg.g_timebase.num;
}
Expand Down

0 comments on commit 974c145

Please sign in to comment.