tiny-nv12-scale.h 559 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. enum target_format {
  8. TARGET_FORMAT_NV12,
  9. TARGET_FORMAT_I420,
  10. TARGET_FORMAT_YUY2,
  11. };
  12. struct nv12_scale {
  13. enum target_format format;
  14. int src_cx;
  15. int src_cy;
  16. int dst_cx;
  17. int dst_cy;
  18. };
  19. typedef struct nv12_scale nv12_scale_t;
  20. extern void nv12_scale_init(nv12_scale_t *s, enum target_format format, int dst_cx, int dst_cy, int src_cx, int src_cy);
  21. extern void nv12_do_scale(nv12_scale_t *s, uint8_t *dst, const uint8_t *src);
  22. #ifdef __cplusplus
  23. }
  24. #endif