• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 #include "vpx_dsp/skin_detection.h"
12 #include "vpx_util/vpx_write_yuv_frame.h"
13 
vpx_write_yuv_frame(FILE * yuv_file,YV12_BUFFER_CONFIG * s)14 void vpx_write_yuv_frame(FILE *yuv_file, YV12_BUFFER_CONFIG *s) {
15 #if defined(OUTPUT_YUV_SRC) || defined(OUTPUT_YUV_DENOISED) || \
16     defined(OUTPUT_YUV_SKINMAP) || defined(OUTPUT_YUV_SVC_SRC)
17 
18   unsigned char *src = s->y_buffer;
19   int h = s->y_crop_height;
20 
21   do {
22     fwrite(src, s->y_width, 1, yuv_file);
23     src += s->y_stride;
24   } while (--h);
25 
26   src = s->u_buffer;
27   h = s->uv_crop_height;
28 
29   do {
30     fwrite(src, s->uv_width, 1, yuv_file);
31     src += s->uv_stride;
32   } while (--h);
33 
34   src = s->v_buffer;
35   h = s->uv_crop_height;
36 
37   do {
38     fwrite(src, s->uv_width, 1, yuv_file);
39     src += s->uv_stride;
40   } while (--h);
41 
42 #else
43   (void)yuv_file;
44   (void)s;
45 #endif
46 }
47