ref: eb8e9f80c4f88d2edd6a065da527fcdf5afb8515
parent: 85b27a1271b7db73509c74a6daae8b121d930db0
parent: e6109dbd41a8680d9a3b4d254dec877f57dccaa8
author: Adrian Grange <agrange@google.com>
date: Thu Oct 4 06:38:35 EDT 2012
Merge "Added handler for PSNR packets to EncoderTest class"
--- a/test/encode_test_driver.cc
+++ b/test/encode_test_driver.cc
@@ -159,16 +159,25 @@
while (const vpx_codec_cx_pkt_t *pkt = iter.Next()) {
again = true;
- if (pkt->kind != VPX_CODEC_CX_FRAME_PKT)
- continue;
+ switch (pkt->kind) {
+ case VPX_CODEC_CX_FRAME_PKT:
#if CONFIG_VP8_DECODER
- has_cxdata = true;
- decoder.DecodeFrame((const uint8_t*)pkt->data.frame.buf,
- pkt->data.frame.sz);
+ has_cxdata = true;
+ decoder.DecodeFrame((const uint8_t*)pkt->data.frame.buf,
+ pkt->data.frame.sz);
#endif
- ASSERT_GE(pkt->data.frame.pts, last_pts_);
- last_pts_ = pkt->data.frame.pts;
- FramePktHook(pkt);
+ ASSERT_GE(pkt->data.frame.pts, last_pts_);
+ last_pts_ = pkt->data.frame.pts;
+ FramePktHook(pkt);
+ break;
+
+ case VPX_CODEC_PSNR_PKT:
+ PSNRPktHook(pkt);
+ break;
+
+ default:
+ break;
+ }
}
#if CONFIG_VP8_DECODER
--- a/test/encode_test_driver.h
+++ b/test/encode_test_driver.h
@@ -176,6 +176,9 @@
// Hook to be called on every compressed data packet.
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {}
+ // Hook to be called on every PSNR packet.
+ virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {}
+
// Hook to determine whether the encode loop should continue.
virtual bool Continue() const { return !abort_; }
--
⑨