2
0

vpx_debug_util.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (c) 2019 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef VPX_VPX_UTIL_VPX_DEBUG_UTIL_H_
  11. #define VPX_VPX_UTIL_VPX_DEBUG_UTIL_H_
  12. #include "./vpx_config.h"
  13. #include "vpx_dsp/prob.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #if CONFIG_BITSTREAM_DEBUG || CONFIG_MISMATCH_DEBUG
  18. void bitstream_queue_set_frame_write(int frame_idx);
  19. int bitstream_queue_get_frame_write(void);
  20. void bitstream_queue_set_frame_read(int frame_idx);
  21. int bitstream_queue_get_frame_read(void);
  22. #endif
  23. #if CONFIG_BITSTREAM_DEBUG
  24. /* This is a debug tool used to detect bitstream error. On encoder side, it
  25. * pushes each bit and probability into a queue before the bit is written into
  26. * the Arithmetic coder. On decoder side, whenever a bit is read out from the
  27. * Arithmetic coder, it pops out the reference bit and probability from the
  28. * queue as well. If the two results do not match, this debug tool will report
  29. * an error. This tool can be used to pin down the bitstream error precisely.
  30. * By combining gdb's backtrace method, we can detect which module causes the
  31. * bitstream error. */
  32. int bitstream_queue_get_write(void);
  33. int bitstream_queue_get_read(void);
  34. void bitstream_queue_record_write(void);
  35. void bitstream_queue_reset_write(void);
  36. void bitstream_queue_pop(int *result, int *prob);
  37. void bitstream_queue_push(int result, const int prob);
  38. void bitstream_queue_set_skip_write(int skip);
  39. void bitstream_queue_set_skip_read(int skip);
  40. #endif // CONFIG_BITSTREAM_DEBUG
  41. #if CONFIG_MISMATCH_DEBUG
  42. void mismatch_move_frame_idx_w(void);
  43. void mismatch_move_frame_idx_r(void);
  44. void mismatch_reset_frame(int num_planes);
  45. void mismatch_record_block_pre(const uint8_t *src, int src_stride, int plane,
  46. int pixel_c, int pixel_r, int blk_w, int blk_h,
  47. int highbd);
  48. void mismatch_record_block_tx(const uint8_t *src, int src_stride, int plane,
  49. int pixel_c, int pixel_r, int blk_w, int blk_h,
  50. int highbd);
  51. void mismatch_check_block_pre(const uint8_t *src, int src_stride, int plane,
  52. int pixel_c, int pixel_r, int blk_w, int blk_h,
  53. int highbd);
  54. void mismatch_check_block_tx(const uint8_t *src, int src_stride, int plane,
  55. int pixel_c, int pixel_r, int blk_w, int blk_h,
  56. int highbd);
  57. #endif // CONFIG_MISMATCH_DEBUG
  58. #ifdef __cplusplus
  59. } // extern "C"
  60. #endif
  61. #endif // VPX_VPX_UTIL_VPX_DEBUG_UTIL_H_