From 2693ca528350d462d5a3a4ceb08a66ef1b6dd618 Mon Sep 17 00:00:00 2001 From: "Nathan E. Egge" Date: Wed, 22 Feb 2017 16:23:02 -0500 Subject: [PATCH] Add frame inspection data to the analyzer. Change-Id: I753b51a1ae9759086198c7433410717296f61c20 --- configure | 10 +++++----- examples/analyzer.cc | 22 +++++++++++++++++++++- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/configure b/configure index d197d2ad0..6c20358a8 100755 --- a/configure +++ b/configure @@ -498,13 +498,13 @@ post_process_cmdline() { log_echo "disabling tile_groups" disable_feature tile_groups fi - + # Enable accounting and inspection when building the analyzer + if enabled analyzer; then + soft_enable accounting + soft_enable inspection + fi } -# Enable accounting if building the analyzer -enabled analyzer && soft_enable accounting - - process_targets() { enabled child || write_common_config_banner write_common_target_config_h ${BUILD_PFX}aom_config.h diff --git a/examples/analyzer.cc b/examples/analyzer.cc index 3a02e32cf..6c2a35f68 100644 --- a/examples/analyzer.cc +++ b/examples/analyzer.cc @@ -18,6 +18,7 @@ #include "aom/aomdx.h" #include "av1/common/accounting.h" #include "av1/common/onyxc_int.h" +#include "av1/decoder/inspection.h" #define OD_SIGNMASK(a) (-((a) < 0)) #define OD_FLIPSIGNI(a, b) (((a) + OD_SIGNMASK(b)) ^ OD_SIGNMASK(b)) @@ -39,6 +40,8 @@ class AV1Decoder { const AvxVideoInfo *info; const AvxInterface *decoder; + insp_frame_data frame_data; + aom_codec_ctx_t codec; public: @@ -57,8 +60,10 @@ class AV1Decoder { int getWidth() const; int getHeight() const; - bool setAccountingEnabled(bool enable); bool getAccountingStruct(Accounting **acct); + bool setInspectionCallback(); + + static void inspect(void *decoder, void *data); }; AV1Decoder::AV1Decoder() @@ -84,6 +89,8 @@ bool AV1Decoder::open(const wxString &path) { fprintf(stderr, "Failed to initialize decoder."); return false; } + ifd_init(&frame_data, info->frame_width, info->frame_height); + setInspectionCallback(); return true; } @@ -119,6 +126,19 @@ bool AV1Decoder::getAccountingStruct(Accounting **accounting) { AOM_CODEC_OK; } +bool AV1Decoder::setInspectionCallback() { + aom_inspect_init ii; + ii.inspect_cb = AV1Decoder::inspect; + ii.inspect_ctx = (void *)this; + return aom_codec_control(&codec, AV1_SET_INSPECTION_CALLBACK, &ii) == + AOM_CODEC_OK; +} + +void AV1Decoder::inspect(void *pbi, void *data) { + AV1Decoder *decoder = (AV1Decoder *)data; + ifd_inspect(&decoder->frame_data, pbi); +} + #define MIN_ZOOM (1) #define MAX_ZOOM (4) -- GitLab