vpx_write_yuv_frame.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) 2015 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. #include "vpx_dsp/skin_detection.h"
  11. #include "vpx_util/vpx_write_yuv_frame.h"
  12. void vpx_write_yuv_frame(FILE *yuv_file, YV12_BUFFER_CONFIG *s) {
  13. #if defined(OUTPUT_YUV_SRC) || defined(OUTPUT_YUV_DENOISED) || \
  14. defined(OUTPUT_YUV_SKINMAP) || defined(OUTPUT_YUV_SVC_SRC)
  15. unsigned char *src = s->y_buffer;
  16. int h = s->y_crop_height;
  17. do {
  18. fwrite(src, s->y_width, 1, yuv_file);
  19. src += s->y_stride;
  20. } while (--h);
  21. src = s->u_buffer;
  22. h = s->uv_crop_height;
  23. do {
  24. fwrite(src, s->uv_width, 1, yuv_file);
  25. src += s->uv_stride;
  26. } while (--h);
  27. src = s->v_buffer;
  28. h = s->uv_crop_height;
  29. do {
  30. fwrite(src, s->uv_width, 1, yuv_file);
  31. src += s->uv_stride;
  32. } while (--h);
  33. #else
  34. (void)yuv_file;
  35. (void)s;
  36. #endif
  37. }