2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
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.
13 int y4m_write_file_header(char *buf
, size_t len
, int width
, int height
,
14 const struct VpxRational
*framerate
,
16 const char *const color
= fmt
== VPX_IMG_FMT_444A
? "C444alpha\n" :
17 fmt
== VPX_IMG_FMT_I444
? "C444\n" :
18 fmt
== VPX_IMG_FMT_I422
? "C422\n" :
21 return snprintf(buf
, len
, "YUV4MPEG2 W%u H%u F%u:%u I%c %s", width
, height
,
22 framerate
->numerator
, framerate
->denominator
, 'p', color
);
25 int y4m_write_frame_header(char *buf
, size_t len
) {
26 return snprintf(buf
, len
, "FRAME\n");