Clean up stray monochrome flags.
The monochrome flags have been removed
from both the encoder and decoder, as this
is now an option in the colour space.
Change-Id: Iccd0f051f35811174ba286c6ee454443fd5268be
diff --git a/examples/aom_cx_set_ref.c b/examples/aom_cx_set_ref.c
index e6ec4c5..456e813 100644
--- a/examples/aom_cx_set_ref.c
+++ b/examples/aom_cx_set_ref.c
@@ -69,8 +69,7 @@
}
static void testing_decode(aom_codec_ctx_t *encoder, aom_codec_ctx_t *decoder,
- unsigned int frame_out, int *mismatch_seen,
- int is_mono) {
+ unsigned int frame_out, int *mismatch_seen) {
aom_image_t enc_img, dec_img;
struct av1_ref_frame ref_enc, ref_dec;
@@ -85,7 +84,7 @@
die_codec(decoder, "Failed to get decoder reference frame");
dec_img = ref_dec.img;
- if (!aom_compare_img(&enc_img, &dec_img, is_mono ? 1 : 3)) {
+ if (!aom_compare_img(&enc_img, &dec_img)) {
int y[4], u[4], v[4];
*mismatch_seen = 1;
@@ -107,8 +106,7 @@
static int encode_frame(aom_codec_ctx_t *ecodec, aom_image_t *img,
unsigned int frame_in, AvxVideoWriter *writer,
int test_decode, aom_codec_ctx_t *dcodec,
- unsigned int *frame_out, int *mismatch_seen,
- int is_mono) {
+ unsigned int *frame_out, int *mismatch_seen) {
int got_pkts = 0;
aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL;
@@ -149,7 +147,7 @@
// Mismatch checking
if (got_data && test_decode) {
- testing_decode(ecodec, dcodec, *frame_out, mismatch_seen, is_mono);
+ testing_decode(ecodec, dcodec, *frame_out, mismatch_seen);
}
return got_pkts;
@@ -289,7 +287,7 @@
}
encode_frame(&ecodec, &raw, frame_in, writer, test_decode, &dcodec,
- &frame_out, &mismatch_seen, cfg.monochrome);
+ &frame_out, &mismatch_seen);
frame_in++;
if (mismatch_seen) break;
}
@@ -297,7 +295,7 @@
// Flush encoder.
if (!mismatch_seen)
while (encode_frame(&ecodec, NULL, frame_in, writer, test_decode, &dcodec,
- &frame_out, &mismatch_seen, cfg.monochrome)) {
+ &frame_out, &mismatch_seen)) {
}
printf("\n");
diff --git a/examples/encoder_util.c b/examples/encoder_util.c
index 474690d..32acf0a 100644
--- a/examples/encoder_util.c
+++ b/examples/encoder_util.c
@@ -102,7 +102,10 @@
}
int aom_compare_img(const aom_image_t *const img1,
- const aom_image_t *const img2, int num_planes) {
+ const aom_image_t *const img2) {
+ assert(img1->cs == img2->cs);
+ int num_planes = img1->cs == AOM_CS_MONOCHROME ? 1 : 3;
+
uint32_t l_w = img1->d_w;
uint32_t c_w = (img1->d_w + img1->x_chroma_shift) >> img1->x_chroma_shift;
const uint32_t c_h =
diff --git a/examples/encoder_util.h b/examples/encoder_util.h
index 72057a9..38deef0 100644
--- a/examples/encoder_util.h
+++ b/examples/encoder_util.h
@@ -31,6 +31,6 @@
// Returns 1 if the two images match.
int aom_compare_img(const aom_image_t *const img1,
- const aom_image_t *const img2, int num_planes);
+ const aom_image_t *const img2);
#endif // EXAMPLES_ENCODER_UTIL_H_