vpxstats.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2013 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_VPXSTATS_H_
  11. #define VPX_VPXSTATS_H_
  12. #include <stdio.h>
  13. #include "vpx/vpx_encoder.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /* This structure is used to abstract the different ways of handling
  18. * first pass statistics
  19. */
  20. typedef struct {
  21. vpx_fixed_buf_t buf;
  22. int pass;
  23. FILE *file;
  24. char *buf_ptr;
  25. size_t buf_alloc_sz;
  26. } stats_io_t;
  27. int stats_open_file(stats_io_t *stats, const char *fpf, int pass);
  28. int stats_open_mem(stats_io_t *stats, int pass);
  29. void stats_close(stats_io_t *stats, int last_pass);
  30. void stats_write(stats_io_t *stats, const void *pkt, size_t len);
  31. vpx_fixed_buf_t stats_get(stats_io_t *stats);
  32. #ifdef __cplusplus
  33. } // extern "C"
  34. #endif
  35. #endif // VPX_VPXSTATS_H_