Check flags in S/ErrRes/Droppable frame tests
Make sure that Switch, Error Resilient and Droppable frames
have the correct output flags set.
Change-Id: I1004b90cb07987d75046bda0100ed62f6897963d
diff --git a/test/error_resilience_test.cc b/test/error_resilience_test.cc
index 13ac0bf..b86d8b0 100644
--- a/test/error_resilience_test.cc
+++ b/test/error_resilience_test.cc
@@ -145,6 +145,23 @@
}
}
+ virtual void FramePktHook(const aom_codec_cx_pkt_t *pkt) {
+ // Check that the encode frame flags are correctly reflected
+ // in the output frame flags.
+ const int encode_flags = pkt->data.frame.flags >> 16;
+ if ((encode_flags & (AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF |
+ AOM_EFLAG_NO_UPD_ARF)) ==
+ (AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF | AOM_EFLAG_NO_UPD_ARF)) {
+ ASSERT_TRUE(!!(pkt->data.frame.flags & AOM_FRAME_IS_DROPPABLE));
+ }
+ if (encode_flags & AOM_EFLAG_SET_S_FRAME) {
+ ASSERT_TRUE(!!(pkt->data.frame.flags & AOM_FRAME_IS_SWITCH));
+ }
+ if (encode_flags & AOM_EFLAG_ERROR_RESILIENT) {
+ ASSERT_TRUE(!!(pkt->data.frame.flags & AOM_FRAME_IS_ERROR_RESILIENT));
+ }
+ }
+
double GetAveragePsnr() const {
if (nframes_) return psnr_ / nframes_;
return 0.0;