Commit 439b21c2 authored by Sebastien Alaiwan's avatar Sebastien Alaiwan
Browse files

Coding path sync test: force picture size

Change-Id: Ib9dd9aaa5240ac7c90f9c276ae8ef9055fcf1fdd
parent 9cde59f0
...@@ -37,8 +37,15 @@ class CompressedSource { ...@@ -37,8 +37,15 @@ class CompressedSource {
cfg.rc_end_usage = AOM_CQ; cfg.rc_end_usage = AOM_CQ;
cfg.rc_max_quantizer = max_q; cfg.rc_max_quantizer = max_q;
cfg.rc_min_quantizer = max_q; cfg.rc_min_quantizer = max_q;
cfg.g_w = kWidth;
cfg.g_h = kHeight; // choose the picture size
{
width_ = rnd_.PseudoUniform(kWidth - 8) + 8;
height_ = rnd_.PseudoUniform(kHeight - 8) + 8;
}
cfg.g_w = width_;
cfg.g_h = height_;
cfg.g_lag_in_frames = 0; cfg.g_lag_in_frames = 0;
aom_codec_enc_init(&enc_, algo, &cfg, 0); aom_codec_enc_init(&enc_, algo, &cfg, 0);
...@@ -60,7 +67,7 @@ class CompressedSource { ...@@ -60,7 +67,7 @@ class CompressedSource {
buf[i] = (i + phase) % period < period / 2 ? val_a : val_b; buf[i] = (i + phase) % period < period / 2 ? val_a : val_b;
aom_image_t img; aom_image_t img;
aom_img_wrap(&img, AOM_IMG_FMT_I420, kWidth, kHeight, 0, buf); aom_img_wrap(&img, AOM_IMG_FMT_I420, width_, height_, 0, buf);
aom_codec_encode(&enc_, &img, frame_count_++, 1, 0, 0); aom_codec_encode(&enc_, &img, frame_count_++, 1, 0, 0);
aom_codec_iter_t iter = NULL; aom_codec_iter_t iter = NULL;
...@@ -75,12 +82,13 @@ class CompressedSource { ...@@ -75,12 +82,13 @@ class CompressedSource {
} }
private: private:
static const int kWidth = 32; static const int kWidth = 128;
static const int kHeight = 32; static const int kHeight = 128;
ACMRandom rnd_; ACMRandom rnd_;
aom_codec_ctx_t enc_; aom_codec_ctx_t enc_;
int frame_count_; int frame_count_;
int width_, height_;
}; };
// lowers an aom_image_t to a easily comparable/printable form // lowers an aom_image_t to a easily comparable/printable form
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment