Bitstream debug tool: Guard code under 'if(0)'.
Instead of a commented block, use an 'if' to ensure the code is compiled
whenever CONFIG_BITSTREAM_DEBUG is on.
Change-Id: I1bcabb903691f8c94f2c8859cfdf00e59480f904
diff --git a/aom_util/debug_util.c b/aom_util/debug_util.c
index e57935e..3e9c314 100644
--- a/aom_util/debug_util.c
+++ b/aom_util/debug_util.c
@@ -10,6 +10,7 @@
*/
#include <assert.h>
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include "aom_util/debug_util.h"
@@ -68,16 +69,19 @@
}
void bitstream_queue_push(int result, const aom_cdf_prob *cdf, int nsymbs) {
- // If you observe a cdf error, turn the following debug code on and
- // set target_frame_idx_r and target_queue_r accordingly.
- /*
- int target_frame_idx_r = 1;
- int target_queue_r = 18005;
- if (frame_idx_w == target_frame_idx_r && queue_w == target_queue_r) {
- fprintf(stderr, "\n *** bitstream queue at frame_idx_w %d queue_w %d\n",
- frame_idx_w, queue_w);
+ // If you observe a CDF error:
+ // - Set 'debug_cdf_mismatch' to true
+ // - Set target_frame_idx_r and target_queue_r to where CDF error was reported
+ // - Set a breakpoint in debugger at the 'fprintf' below.
+ const bool debug_cdf_mismatch = false;
+ if (debug_cdf_mismatch) {
+ int target_frame_idx_r = 1;
+ int target_queue_r = 18005;
+ if (frame_idx_w == target_frame_idx_r && queue_w == target_queue_r) {
+ fprintf(stderr, "\n *** bitstream queue at frame_idx_w %d queue_w %d\n",
+ frame_idx_w, queue_w);
+ }
}
- */
if (!skip_w) {
result_queue[queue_w] = result;
nsymbs_queue[queue_w] = nsymbs;