FFmpeg
yuv4mpegdec.c
Go to the documentation of this file.
1 /*
2  * YUV4MPEG demuxer
3  * Copyright (c) 2001, 2002, 2003 Fabrice Bellard
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "libavutil/avstring.h"
23 #include "libavutil/imgutils.h"
24 
25 #include "avformat.h"
26 #include "demux.h"
27 #include "internal.h"
28 #include "yuv4mpeg.h"
29 
30 /* Header size increased to allow room for optional flags */
31 #define MAX_YUV4_HEADER 128
32 #define MAX_FRAME_HEADER 80
33 
35 {
36  char header[MAX_YUV4_HEADER + 10]; // Include headroom for
37  // the longest option
38  char *tokstart, *tokend, *header_end;
39  int i;
40  AVIOContext *pb = s->pb;
41  int width = -1, height = -1, raten = 0,
42  rated = 0, aspectn = 0, aspectd = 0;
44  enum AVChromaLocation chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED;
45  enum AVFieldOrder field_order = AV_FIELD_UNKNOWN;
47  AVStream *st;
48  int64_t data_offset;
49 
50  for (i = 0; i < MAX_YUV4_HEADER; i++) {
51  header[i] = avio_r8(pb);
52  if (header[i] == '\n') {
53  header[i + 1] = 0x20; // Add a space after last option.
54  // Makes parsing "444" vs "444alpha" easier.
55  header[i + 2] = 0;
56  break;
57  }
58  }
59  if (i == MAX_YUV4_HEADER) {
60  av_log(s, AV_LOG_ERROR, "Header too large.\n");
61  return AVERROR(EINVAL);
62  }
63  if (strncmp(header, Y4M_MAGIC, strlen(Y4M_MAGIC))) {
64  av_log(s, AV_LOG_ERROR, "Invalid magic number for yuv4mpeg.\n");
65  return AVERROR(EINVAL);
66  }
67 
68  header_end = &header[i + 1]; // Include space
69  for (tokstart = &header[strlen(Y4M_MAGIC) + 1];
70  tokstart < header_end; tokstart++) {
71  if (*tokstart == 0x20)
72  continue;
73  switch (*tokstart++) {
74  case 'W': // Width. Required.
75  width = strtol(tokstart, &tokend, 10);
76  tokstart = tokend;
77  break;
78  case 'H': // Height. Required.
79  height = strtol(tokstart, &tokend, 10);
80  tokstart = tokend;
81  break;
82  case 'C': // Color space
83  {
84  static const struct {
85 #define MAX_PIX_FMT_LENGTH 8
86  char name[MAX_PIX_FMT_LENGTH + 1];
87 #undef MAX_PIX_FMT_LENGTH
89  enum AVChromaLocation chroma_loc;
90  } pix_fmt_array[] = {
92  { "420mpeg2", AV_PIX_FMT_YUV420P, AVCHROMA_LOC_LEFT },
119  };
120  for (i = 0; i < FF_ARRAY_ELEMS(pix_fmt_array); i++) {
121  if (av_strstart(tokstart, pix_fmt_array[i].name, NULL)) {
122  pix_fmt = pix_fmt_array[i].pix_fmt;
123  if (pix_fmt_array[i].chroma_loc != AVCHROMA_LOC_UNSPECIFIED)
124  chroma_sample_location = pix_fmt_array[i].chroma_loc;
125  break;
126  }
127  }
128  if (i == FF_ARRAY_ELEMS(pix_fmt_array)) {
129  av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains an unknown "
130  "pixel format.\n");
131  return AVERROR_INVALIDDATA;
132  }
133  while (tokstart < header_end && *tokstart != 0x20)
134  tokstart++;
135  break;
136  }
137  case 'I': // Interlace type
138  switch (*tokstart++){
139  case '?':
140  field_order = AV_FIELD_UNKNOWN;
141  break;
142  case 'p':
143  field_order = AV_FIELD_PROGRESSIVE;
144  break;
145  case 't':
146  field_order = AV_FIELD_TT;
147  break;
148  case 'b':
149  field_order = AV_FIELD_BB;
150  break;
151  case 'm':
152  av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains mixed "
153  "interlaced and non-interlaced frames.\n");
154  default:
155  av_log(s, AV_LOG_ERROR, "YUV4MPEG has invalid header.\n");
156  return AVERROR(EINVAL);
157  }
158  break;
159  case 'F': // Frame rate
160  sscanf(tokstart, "%d:%d", &raten, &rated); // 0:0 if unknown
161  while (tokstart < header_end && *tokstart != 0x20)
162  tokstart++;
163  break;
164  case 'A': // Pixel aspect
165  sscanf(tokstart, "%d:%d", &aspectn, &aspectd); // 0:0 if unknown
166  while (tokstart < header_end && *tokstart != 0x20)
167  tokstart++;
168  break;
169  case 'X': // Vendor extensions
170  if (strncmp("YSCSS=", tokstart, 6) == 0) {
171  static const struct {
172 #define MAX_PIX_FMT_LENGTH 8
173  char name[MAX_PIX_FMT_LENGTH + 1];
174 #undef MAX_PIX_FMT_LENGTH
175  enum AVPixelFormat pix_fmt;
176  } pix_fmt_array[] = {
177  { "420JPEG", AV_PIX_FMT_YUV420P },
178  { "420MPEG2", AV_PIX_FMT_YUV420P },
179  { "420PALDV", AV_PIX_FMT_YUV420P },
180  { "420P9", AV_PIX_FMT_YUV420P9 },
181  { "422P9", AV_PIX_FMT_YUV422P9 },
182  { "444P9", AV_PIX_FMT_YUV444P9 },
183  { "420P10", AV_PIX_FMT_YUV420P10 },
184  { "444P10", AV_PIX_FMT_YUV444P10 },
185  { "420P12", AV_PIX_FMT_YUV420P12 },
186  { "422P12", AV_PIX_FMT_YUV422P12 },
187  { "444P12", AV_PIX_FMT_YUV444P12 },
188  { "420P14", AV_PIX_FMT_YUV420P14 },
189  { "422P14", AV_PIX_FMT_YUV422P14 },
190  { "444P14", AV_PIX_FMT_YUV444P14 },
191  { "420P16", AV_PIX_FMT_YUV420P16 },
192  { "422P16", AV_PIX_FMT_YUV422P16 },
193  { "444P16", AV_PIX_FMT_YUV444P16 },
194  { "411", AV_PIX_FMT_YUV411P },
195  { "422", AV_PIX_FMT_YUV422P },
196  { "444", AV_PIX_FMT_YUV444P },
197  };
198  // Older nonstandard pixel format representation
199  tokstart += 6;
200  for (size_t i = 0; i < FF_ARRAY_ELEMS(pix_fmt_array); i++)
201  if (av_strstart(tokstart, pix_fmt_array[i].name, NULL)) {
202  alt_pix_fmt = pix_fmt_array[i].pix_fmt;
203  break;
204  }
205  } else if (strncmp("COLORRANGE=", tokstart, 11) == 0) {
206  tokstart += 11;
207  if (strncmp("FULL",tokstart, 4) == 0)
209  else if (strncmp("LIMITED", tokstart, 7) == 0)
211  }
212  while (tokstart < header_end && *tokstart != 0x20)
213  tokstart++;
214  break;
215  }
216  }
217 
218  if (width == -1 || height == -1) {
219  av_log(s, AV_LOG_ERROR, "YUV4MPEG has invalid header.\n");
220  return AVERROR_INVALIDDATA;
221  }
222 
223  if (pix_fmt == AV_PIX_FMT_NONE) {
224  if (alt_pix_fmt == AV_PIX_FMT_NONE)
226  else
227  pix_fmt = alt_pix_fmt;
228  }
229 
230  if (raten <= 0 || rated <= 0) {
231  // Frame rate unknown
232  raten = 25;
233  rated = 1;
234  }
235 
236  if (aspectn == 0 && aspectd == 0) {
237  // Pixel aspect unknown
238  aspectd = 1;
239  }
240 
241  st = avformat_new_stream(s, NULL);
242  if (!st)
243  return AVERROR(ENOMEM);
244  st->codecpar->width = width;
245  st->codecpar->height = height;
246  av_reduce(&raten, &rated, raten, rated, (1UL << 31) - 1);
247  avpriv_set_pts_info(st, 64, rated, raten);
248  st->avg_frame_rate = av_inv_q(st->time_base);
249  st->codecpar->format = pix_fmt;
252  st->sample_aspect_ratio = (AVRational){ aspectn, aspectd };
253  st->codecpar->chroma_location = chroma_sample_location;
255  st->codecpar->field_order = field_order;
257  if ((int) s->packet_size < 0)
258  return s->packet_size;
259  ffformatcontext(s)->data_offset = data_offset = avio_tell(pb);
260 
261  st->duration = (avio_size(pb) - data_offset) / s->packet_size;
262 
263  return 0;
264 }
265 
267 {
268  int i;
269  char header[MAX_FRAME_HEADER+1];
270  int ret;
271  int64_t off = avio_tell(s->pb);
272 
273  for (i = 0; i < MAX_FRAME_HEADER; i++) {
274  header[i] = avio_r8(s->pb);
275  if (header[i] == '\n') {
276  header[i + 1] = 0;
277  break;
278  }
279  }
280  if (s->pb->error)
281  return s->pb->error;
282  else if (s->pb->eof_reached)
283  return AVERROR_EOF;
284  else if (i == MAX_FRAME_HEADER)
285  return AVERROR_INVALIDDATA;
286 
287  if (strncmp(header, Y4M_FRAME_MAGIC, strlen(Y4M_FRAME_MAGIC)))
288  return AVERROR_INVALIDDATA;
289 
290  ret = av_get_packet(s->pb, pkt, s->packet_size - Y4M_FRAME_MAGIC_LEN);
291  if (ret < 0)
292  return ret;
293  else if (ret != s->packet_size - Y4M_FRAME_MAGIC_LEN) {
294  return s->pb->eof_reached ? AVERROR_EOF : AVERROR(EIO);
295  }
296  pkt->stream_index = 0;
297  pkt->pts = (off - ffformatcontext(s)->data_offset) / s->packet_size;
298  pkt->duration = 1;
299  return 0;
300 }
301 
302 static int yuv4_read_seek(AVFormatContext *s, int stream_index,
303  int64_t pts, int flags)
304 {
305  int64_t pos;
306 
308  pts = FFMAX(0, pts - 1);
309  if (pts < 0)
310  return -1;
311  pos = pts * s->packet_size;
312 
313  if (avio_seek(s->pb, pos + ffformatcontext(s)->data_offset, SEEK_SET) < 0)
314  return -1;
315  return 0;
316 }
317 
318 static int yuv4_probe(const AVProbeData *pd)
319 {
320  /* check file header */
321  if (strncmp(pd->buf, Y4M_MAGIC, sizeof(Y4M_MAGIC) - 1) == 0)
322  return AVPROBE_SCORE_MAX;
323  else
324  return 0;
325 }
326 
328  .p.name = "yuv4mpegpipe",
329  .p.long_name = NULL_IF_CONFIG_SMALL("YUV4MPEG pipe"),
330  .p.extensions = "y4m",
331  .read_probe = yuv4_probe,
332  .read_header = yuv4_read_header,
333  .read_packet = yuv4_read_packet,
334  .read_seek = yuv4_read_seek,
335 };
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AVCodecParameters::codec_type
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:51
AVFieldOrder
AVFieldOrder
Definition: defs.h:198
ffformatcontext
static av_always_inline FFFormatContext * ffformatcontext(AVFormatContext *s)
Definition: internal.h:188
avformat_new_stream
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
AVERROR_EOF
#define AVERROR_EOF
End of file.
Definition: error.h:57
AV_FIELD_PROGRESSIVE
@ AV_FIELD_PROGRESSIVE
Definition: defs.h:200
int64_t
long long int64_t
Definition: coverity.c:34
AV_CODEC_ID_RAWVIDEO
@ AV_CODEC_ID_RAWVIDEO
Definition: codec_id.h:65
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:683
Y4M_FRAME_MAGIC_LEN
#define Y4M_FRAME_MAGIC_LEN
Definition: yuv4mpeg.h:26
AVStream::avg_frame_rate
AVRational avg_frame_rate
Average framerate.
Definition: avformat.h:832
Y4M_MAGIC
#define Y4M_MAGIC
Definition: yuv4mpeg.h:24
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:478
MAX_FRAME_HEADER
#define MAX_FRAME_HEADER
Definition: yuv4mpegdec.c:32
AVPacket::duration
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: packet.h:540
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
avio_size
int64_t avio_size(AVIOContext *s)
Get the filesize.
Definition: aviobuf.c:322
AV_PIX_FMT_GRAY9
#define AV_PIX_FMT_GRAY9
Definition: pixfmt.h:458
AVPROBE_SCORE_MAX
#define AVPROBE_SCORE_MAX
maximum score
Definition: avformat.h:463
AV_FIELD_TT
@ AV_FIELD_TT
Top coded_first, top displayed first.
Definition: defs.h:201
avpriv_set_pts_info
void avpriv_set_pts_info(AVStream *st, int pts_wrap_bits, unsigned int pts_num, unsigned int pts_den)
Set the time base and wrapping info for a given stream.
Definition: avformat.c:853
AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:476
avio_tell
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:494
pts
static int64_t pts
Definition: transcode_aac.c:643
AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:462
AVStream::duration
int64_t duration
Decoding: duration of the stream, in stream time base.
Definition: avformat.h:802
av_reduce
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
Definition: rational.c:35
Y4M_FRAME_MAGIC
#define Y4M_FRAME_MAGIC
Definition: yuv4mpeg.h:25
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:481
pkt
AVPacket * pkt
Definition: movenc.c:59
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:490
AV_FIELD_UNKNOWN
@ AV_FIELD_UNKNOWN
Definition: defs.h:199
width
#define width
s
#define s(width, name)
Definition: cbs_vp9.c:198
yuv4_probe
static int yuv4_probe(const AVProbeData *pd)
Definition: yuv4mpegdec.c:318
AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:491
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:553
pix_fmt
static enum AVPixelFormat pix_fmt
Definition: demux_decode.c:41
AVProbeData::buf
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:453
AVCodecParameters::width
int width
Video only.
Definition: codec_par.h:134
AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:475
FFFormatContext::data_offset
int64_t data_offset
offset of the first packet
Definition: internal.h:101
AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV420P16
Definition: pixfmt.h:489
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
color_range
color_range
Definition: vf_selectivecolor.c:43
AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:459
AVFormatContext
Format I/O context.
Definition: avformat.h:1255
internal.h
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:766
AVSEEK_FLAG_BACKWARD
#define AVSEEK_FLAG_BACKWARD
Definition: avformat.h:2433
AVStream::time_base
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
Definition: avformat.h:782
NULL
#define NULL
Definition: coverity.c:32
AVCHROMA_LOC_LEFT
@ AVCHROMA_LOC_LEFT
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
Definition: pixfmt.h:704
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
AVCHROMA_LOC_TOPLEFT
@ AVCHROMA_LOC_TOPLEFT
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
Definition: pixfmt.h:706
AVProbeData
This structure contains the data a format has to probe a file.
Definition: avformat.h:451
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:479
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
AVCOL_RANGE_UNSPECIFIED
@ AVCOL_RANGE_UNSPECIFIED
Definition: pixfmt.h:649
yuv4_read_packet
static int yuv4_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: yuv4mpegdec.c:266
AVIOContext
Bytestream IO Context.
Definition: avio.h:160
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:483
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:485
AVCHROMA_LOC_UNSPECIFIED
@ AVCHROMA_LOC_UNSPECIFIED
Definition: pixfmt.h:703
AVStream::sample_aspect_ratio
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
Definition: avformat.h:821
FFInputFormat::p
AVInputFormat p
The public AVInputFormat.
Definition: demux.h:41
header
static const uint8_t header[24]
Definition: sdr2.c:68
avio_r8
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:602
height
#define height
av_image_get_buffer_size
int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align)
Return the size in bytes of the amount of data required to store an image with the given parameters.
Definition: imgutils.c:466
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:174
av_strstart
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
Definition: avstring.c:36
AVChromaLocation
AVChromaLocation
Location of chroma samples.
Definition: pixfmt.h:702
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:255
AVPacket::pts
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: packet.h:515
AVCodecParameters::height
int height
Definition: codec_par.h:135
AV_FIELD_BB
@ AV_FIELD_BB
Bottom coded first, bottom displayed first.
Definition: defs.h:202
av_inv_q
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
Definition: rational.h:159
demux.h
AVCodecParameters::color_range
enum AVColorRange color_range
Video only.
Definition: codec_par.h:166
yuv4mpeg.h
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:666
AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:477
AVCodecParameters::field_order
enum AVFieldOrder field_order
Video only.
Definition: codec_par.h:161
av_get_packet
int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
Allocate and read the payload of a packet and initialize its fields with default values.
Definition: utils.c:103
ret
ret
Definition: filter_design.txt:187
AVStream
Stream structure.
Definition: avformat.h:743
avio_seek
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:230
pos
unsigned int pos
Definition: spdifenc.c:413
avformat.h
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:482
AVCodecParameters::chroma_location
enum AVChromaLocation chroma_location
Definition: codec_par.h:170
AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:487
AVCHROMA_LOC_CENTER
@ AVCHROMA_LOC_CENTER
MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0.
Definition: pixfmt.h:705
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
ff_yuv4mpegpipe_demuxer
const FFInputFormat ff_yuv4mpegpipe_demuxer
Definition: yuv4mpegdec.c:327
yuv4_read_header
static int yuv4_read_header(AVFormatContext *s)
Definition: yuv4mpegdec.c:34
AVPacket::stream_index
int stream_index
Definition: packet.h:524
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:78
MAX_YUV4_HEADER
#define MAX_YUV4_HEADER
Definition: yuv4mpegdec.c:31
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:77
AVCodecParameters::format
int format
Definition: codec_par.h:92
yuv4_read_seek
static int yuv4_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags)
Definition: yuv4mpegdec.c:302
AVCodecParameters::codec_id
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition: codec_par.h:55
AVPacket
This structure stores compressed data.
Definition: packet.h:499
AV_PIX_FMT_YUV411P
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:80
FFInputFormat
Definition: demux.h:37
imgutils.h
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
MAX_PIX_FMT_LENGTH
#define MAX_PIX_FMT_LENGTH
AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:488
avstring.h
AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:460
AVColorRange
AVColorRange
Visual content value range.
Definition: pixfmt.h:648
AV_PIX_FMT_YUV420P14
#define AV_PIX_FMT_YUV420P14
Definition: pixfmt.h:486