summaryrefslogtreecommitdiff
path: root/media/libaom/src/test/encode_test_driver.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-03-03 18:48:48 +0000
committerMoonchild <moonchild@palemoon.org>2021-03-04 00:03:46 +0000
commitd192e6808fab971ffbe8c15ff3695c7d08b280c6 (patch)
tree9d9cc4d21c93ae3e1a88ab5c160c3be5f6af0ca9 /media/libaom/src/test/encode_test_driver.h
parentc81c0395a36b0a6b21a6a0ae7b31953fe4a460d9 (diff)
downloaduxp-d192e6808fab971ffbe8c15ff3695c7d08b280c6.tar.gz
Issue #1737 - Import libaom 2.0.2 source
Diffstat (limited to 'media/libaom/src/test/encode_test_driver.h')
-rw-r--r--media/libaom/src/test/encode_test_driver.h38
1 files changed, 27 insertions, 11 deletions
diff --git a/media/libaom/src/test/encode_test_driver.h b/media/libaom/src/test/encode_test_driver.h
index 4f3f855cf9..6319a52202 100644
--- a/media/libaom/src/test/encode_test_driver.h
+++ b/media/libaom/src/test/encode_test_driver.h
@@ -82,7 +82,7 @@ class TwopassStatsStore {
// level of abstraction will be fleshed out as more tests are written.
class Encoder {
public:
- Encoder(aom_codec_enc_cfg_t cfg, const uint32_t init_flags,
+ Encoder(aom_codec_enc_cfg_t cfg, const aom_codec_flags_t init_flags,
TwopassStatsStore *stats)
: cfg_(cfg), init_flags_(init_flags), stats_(stats) {
memset(&encoder_, 0, sizeof(encoder_));
@@ -105,23 +105,38 @@ class Encoder {
void EncodeFrame(VideoSource *video) { EncodeFrame(video, 0); }
void Control(int ctrl_id, int arg) {
- const aom_codec_err_t res = aom_codec_control_(&encoder_, ctrl_id, arg);
+ const aom_codec_err_t res = aom_codec_control(&encoder_, ctrl_id, arg);
ASSERT_EQ(AOM_CODEC_OK, res) << EncoderError();
}
void Control(int ctrl_id, int *arg) {
- const aom_codec_err_t res = aom_codec_control_(&encoder_, ctrl_id, arg);
+ const aom_codec_err_t res = aom_codec_control(&encoder_, ctrl_id, arg);
ASSERT_EQ(AOM_CODEC_OK, res) << EncoderError();
}
void Control(int ctrl_id, struct aom_scaling_mode *arg) {
- const aom_codec_err_t res = aom_codec_control_(&encoder_, ctrl_id, arg);
+ const aom_codec_err_t res = aom_codec_control(&encoder_, ctrl_id, arg);
+ ASSERT_EQ(AOM_CODEC_OK, res) << EncoderError();
+ }
+
+ void Control(int ctrl_id, struct aom_svc_layer_id *arg) {
+ const aom_codec_err_t res = aom_codec_control(&encoder_, ctrl_id, arg);
+ ASSERT_EQ(AOM_CODEC_OK, res) << EncoderError();
+ }
+
+ void Control(int ctrl_id, struct aom_svc_ref_frame_config *arg) {
+ const aom_codec_err_t res = aom_codec_control(&encoder_, ctrl_id, arg);
+ ASSERT_EQ(AOM_CODEC_OK, res) << EncoderError();
+ }
+
+ void Control(int ctrl_id, struct aom_svc_params *arg) {
+ const aom_codec_err_t res = aom_codec_control(&encoder_, ctrl_id, arg);
ASSERT_EQ(AOM_CODEC_OK, res) << EncoderError();
}
#if CONFIG_AV1_ENCODER
void Control(int ctrl_id, aom_active_map_t *arg) {
- const aom_codec_err_t res = aom_codec_control_(&encoder_, ctrl_id, arg);
+ const aom_codec_err_t res = aom_codec_control(&encoder_, ctrl_id, arg);
ASSERT_EQ(AOM_CODEC_OK, res) << EncoderError();
}
#endif
@@ -149,7 +164,7 @@ class Encoder {
aom_codec_ctx_t encoder_;
aom_codec_enc_cfg_t cfg_;
- unsigned long init_flags_;
+ aom_codec_flags_t init_flags_;
TwopassStatsStore *stats_;
};
@@ -164,7 +179,7 @@ class EncoderTest {
protected:
explicit EncoderTest(const CodecFactory *codec)
: codec_(codec), abort_(false), init_flags_(0), frame_flags_(0),
- last_pts_(0), mode_(kRealTime) {
+ last_pts_(0), mode_(kRealTime), number_spatial_layers_(1) {
// Default to 1 thread.
cfg_.g_threads = 1;
}
@@ -178,9 +193,7 @@ class EncoderTest {
void SetMode(TestMode mode);
// Set encoder flag.
- void set_init_flags(unsigned long flag) { // NOLINT(runtime/int)
- init_flags_ = flag;
- }
+ void set_init_flags(aom_codec_flags_t flag) { init_flags_ = flag; }
// Main loop
virtual void RunLoop(VideoSource *video);
@@ -227,6 +240,8 @@ class EncoderTest {
return AOM_CODEC_OK == res_dec;
}
+ virtual int GetNumSpatialLayers() { return 1; }
+
// Hook that can modify the encoder's output data
virtual const aom_codec_cx_pkt_t *MutateEncoderOutputHook(
const aom_codec_cx_pkt_t *pkt) {
@@ -238,10 +253,11 @@ class EncoderTest {
aom_codec_enc_cfg_t cfg_;
unsigned int passes_;
TwopassStatsStore stats_;
- unsigned long init_flags_;
+ aom_codec_flags_t init_flags_;
unsigned long frame_flags_;
aom_codec_pts_t last_pts_;
TestMode mode_;
+ int number_spatial_layers_;
};
} // namespace libaom_test