FFmpeg
rawvideodec.c
Go to the documentation of this file.
1 /*
2  * RAW video demuxer
3  * Copyright (c) 2001 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 "config_components.h"
23 
24 #include <stdbool.h>
25 
26 #include "libavutil/imgutils.h"
27 #include "libavutil/parseutils.h"
28 #include "libavutil/pixdesc.h"
29 #include "libavutil/opt.h"
30 #include "demux.h"
31 #include "internal.h"
32 #include "avformat.h"
33 
34 typedef struct RawVideoDemuxerContext {
35  const AVClass *class; /**< Class for private options. */
36  int width, height; /**< Integers describing video size, set by a private option. */
38  AVRational framerate; /**< AVRational describing framerate, set by a private option. */
39 
41  /* We could derive linesize[1 to N] from linesize[0] for multiplane formats,
42  * but having users explicitly specify linesize for each plane can reduce
43  * unexpected results and support more use cases.
44  */
45  int *linesize;
46  unsigned nb_linesize;
47  // with padding
48  size_t frame_size;
49  // linesize without padding
50  int raw_bytes[4];
52 
53 // v210 frame width is padded to multiples of 48
54 #define GET_PACKET_SIZE(w, h) (((w + 47) / 48) * 48 * h * 8 / 3)
55 
57 {
59  enum AVPixelFormat pix_fmt = s->pix_fmt;
60  AVStream *st;
61  int packet_size;
62  int ret;
63 
65  if (!st)
66  return AVERROR(ENOMEM);
67 
69 
71  avpriv_set_pts_info(st, 64, s->framerate.den, s->framerate.num);
72 
73  ret = av_image_check_size(s->width, s->height, 0, ctx);
74  if (ret < 0)
75  return ret;
76 
77  st->codecpar->width = s->width;
78  st->codecpar->height = s->height;
79 
80  if (s->nb_linesize) {
82  if (s->nb_linesize != n) {
83  av_log(ctx, AV_LOG_ERROR, "Invalid number of stride %u, "
84  "pixel format has %d plane\n",
85  s->nb_linesize, n);
86  return AVERROR(EINVAL);
87  }
88 
89  ret = av_image_fill_linesizes(s->raw_bytes, pix_fmt, s->width);
90  if (ret < 0)
91  return ret;
92 
93  size_t linesize[4] = {0};
94  for (int i = 0; i < n; i++) {
95  if (s->linesize[i] < s->raw_bytes[i]) {
96  av_log(ctx, AV_LOG_ERROR, "Invalid stride %u of plane %d, "
97  "minimum required size is %d for width %d\n",
98  s->linesize[i], i, s->raw_bytes[i], s->width);
99  return AVERROR(EINVAL);
100  }
101  if (s->linesize[i] > s->raw_bytes[i])
102  s->has_padding = true;
103  linesize[i] = s->linesize[i];
104  }
105 
106  size_t plane_size[4] = {0};
107  av_image_fill_plane_sizes(plane_size, pix_fmt, s->height, linesize);
108  s->frame_size = plane_size[0] + plane_size[1] + plane_size[2] + plane_size[3];
109  }
110 
112  unsigned int pgroup; /* size of the pixel group in bytes */
113  unsigned int xinc;
114  const AVPixFmtDescriptor *desc;
115  int tag;
116 
119  if (pix_fmt == AV_PIX_FMT_YUV422P10) {
120  tag = MKTAG('U', 'Y', 'V', 'Y');
121  pgroup = 5;
122  xinc = 2;
123  } else if (pix_fmt == AV_PIX_FMT_UYVY422) {
124  tag = MKTAG('U', 'Y', 'V', 'Y');
125  pgroup = 4;
126  xinc = 2;
128  } else {
129  av_log(ctx, AV_LOG_ERROR, "unsupported format: %s for bitpacked.\n",
130  desc->name);
131  return AVERROR(EINVAL);
132  }
133  st->codecpar->codec_tag = tag;
134  packet_size = s->width * s->height * pgroup / xinc;
135  } else if ((ffifmt(ctx->iformat)->raw_codec_id == AV_CODEC_ID_V210) ||
139 
140  packet_size = GET_PACKET_SIZE(s->width, s->height);
141  } else {
142  packet_size = av_image_get_buffer_size(pix_fmt, s->width, s->height, 1);
143  if (packet_size < 0)
144  return packet_size;
145  }
146  if (packet_size == 0)
147  return AVERROR(EINVAL);
148 
149  st->codecpar->format = pix_fmt;
150  ctx->packet_size = packet_size;
152  (AVRational){8,1}, st->time_base);
153 
154  return 0;
155 }
156 
157 
159 {
160  int ret;
162 
163  if (!s->has_padding) {
165  if (ret < 0)
166  return ret;
167  pkt->pts = pkt->dts = pkt->pos / ctx->packet_size;
168 
169  return 0;
170  }
171 
173  if (ret < 0)
174  return ret;
175 
176  pkt->pos = avio_tell(ctx->pb);
177  pkt->pts = pkt->dts = pkt->pos / s->frame_size;
178 
179  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->pix_fmt);
180  uint8_t *p = pkt->data;
181  for (int i = 0; i < s->nb_linesize; i++) {
182  int shift = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
183  int h = AV_CEIL_RSHIFT(s->height, shift);
184  int skip_bytes = s->linesize[i] - s->raw_bytes[i];
185 
186  for (int j = 0; j < h; j++) {
187  ret = avio_read(ctx->pb, p, s->raw_bytes[i]);
188  if (ret != s->raw_bytes[i]) {
189  if (ret < 0 && ret != AVERROR_EOF)
190  return ret;
191 
192  if (ret == AVERROR_EOF && p == pkt->data)
193  return AVERROR_EOF;
194 
195  memset(p, 0, pkt->size - (p - pkt->data));
197 
198  return 0;
199  }
200 
201  p += s->raw_bytes[i];
203  }
204  }
205 
206  return 0;
207 }
208 
209 #define OFFSET(x) offsetof(RawVideoDemuxerContext, x)
210 #define DEC AV_OPT_FLAG_DECODING_PARAM
211 static const AVOption rawvideo_options[] = {
212  // Only supported by rawvideo demuxer
213  {"stride", "frame line size in bytes", OFFSET(linesize), AV_OPT_TYPE_INT | AV_OPT_TYPE_FLAG_ARRAY, {.arr = NULL}, 0, INT_MAX, DEC },
214 #define BITPACKED_OPTION_OFFSET 1 // skip stride option
215  /* pixel_format is not used by the v210 demuxers. */
216  { "pixel_format", "set pixel format", OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_YUV420P}, AV_PIX_FMT_YUV420P, INT_MAX, DEC },
217 #define V210_OPTION_OFFSET 2 // skip stride and pixel_format option
218  { "video_size", "set frame size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC },
219  { "framerate", "set frame rate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, DEC },
220  { NULL },
221 };
222 
224  .class_name = "rawvideo demuxer",
225  .item_name = av_default_item_name,
226  .option = rawvideo_options,
227  .version = LIBAVUTIL_VERSION_INT,
228 };
229 
231  .p.name = "rawvideo",
232  .p.long_name = NULL_IF_CONFIG_SMALL("raw video"),
233  .p.flags = AVFMT_GENERIC_INDEX,
234  .p.extensions = "yuv,cif,qcif,rgb",
235  .p.priv_class = &rawvideo_demuxer_class,
236  .priv_data_size = sizeof(RawVideoDemuxerContext),
239  .raw_codec_id = AV_CODEC_ID_RAWVIDEO,
240 };
241 
243  .class_name = "bitpacked demuxer",
244  .item_name = av_default_item_name,
246  .version = LIBAVUTIL_VERSION_INT,
247 };
248 
249 #if CONFIG_BITPACKED_DEMUXER
251  .p.name = "bitpacked",
252  .p.long_name = NULL_IF_CONFIG_SMALL("Bitpacked"),
253  .p.flags = AVFMT_GENERIC_INDEX,
254  .p.extensions = "bitpacked",
255  .p.priv_class = &bitpacked_demuxer_class,
256  .priv_data_size = sizeof(RawVideoDemuxerContext),
259  .raw_codec_id = AV_CODEC_ID_BITPACKED,
260 };
261 #endif // CONFIG_BITPACKED_DEMUXER
262 
263 static const AVClass v210_demuxer_class = {
264  .class_name = "v210(x) demuxer",
265  .item_name = av_default_item_name,
267  .version = LIBAVUTIL_VERSION_INT,
268 };
269 
270 #if CONFIG_V210_DEMUXER
272  .p.name = "v210",
273  .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
274  .p.flags = AVFMT_GENERIC_INDEX,
275  .p.extensions = "v210",
276  .p.priv_class = &v210_demuxer_class,
277  .priv_data_size = sizeof(RawVideoDemuxerContext),
280  .raw_codec_id = AV_CODEC_ID_V210,
281 };
282 #endif // CONFIG_V210_DEMUXER
283 
284 #if CONFIG_V210X_DEMUXER
286  .p.name = "v210x",
287  .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
288  .p.flags = AVFMT_GENERIC_INDEX,
289  .p.extensions = "yuv10",
290  .p.priv_class = &v210_demuxer_class,
291  .priv_data_size = sizeof(RawVideoDemuxerContext),
294  .raw_codec_id = AV_CODEC_ID_V210X,
295 };
296 #endif // CONFIG_V210X_DEMUXER
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
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
opt.h
AVCodecParameters::codec_type
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:51
avformat_new_stream
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
BITPACKED_OPTION_OFFSET
#define BITPACKED_OPTION_OFFSET
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3456
AVERROR_EOF
#define AVERROR_EOF
End of file.
Definition: error.h:57
AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
Definition: opt.h:315
RawVideoDemuxerContext::linesize
int * linesize
Definition: rawvideodec.c:45
AV_CODEC_ID_RAWVIDEO
@ AV_CODEC_ID_RAWVIDEO
Definition: codec_id.h:65
pixdesc.h
AVPacket::data
uint8_t * data
Definition: packet.h:588
AVOption
AVOption.
Definition: opt.h:429
av_get_bits_per_pixel
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
Definition: pixdesc.c:3408
AVCodecParameters::codec_tag
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
Definition: codec_par.h:59
RawVideoDemuxerContext::framerate
AVRational framerate
AVRational describing framerate, set by a private option.
Definition: rawvideodec.c:38
rawvideo_options
static const AVOption rawvideo_options[]
Definition: rawvideodec.c:211
av_pix_fmt_count_planes
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3496
RawVideoDemuxerContext
Definition: rawvideodec.c:34
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:777
ff_rawvideo_demuxer
const FFInputFormat ff_rawvideo_demuxer
Definition: rawvideodec.c:230
avio_tell
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:494
AVFMT_GENERIC_INDEX
#define AVFMT_GENERIC_INDEX
Use generic index building code.
Definition: avformat.h:479
RawVideoDemuxerContext::nb_linesize
unsigned nb_linesize
Definition: rawvideodec.c:46
rawvideo_read_header
static int rawvideo_read_header(AVFormatContext *ctx)
Definition: rawvideodec.c:56
V210_OPTION_OFFSET
#define V210_OPTION_OFFSET
pkt
AVPacket * pkt
Definition: movenc.c:60
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
AV_PKT_FLAG_CORRUPT
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
Definition: packet.h:644
AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:551
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:42
av_image_fill_linesizes
int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width)
Fill plane linesizes for an image with pixel format pix_fmt and width width.
Definition: imgutils.c:89
s
#define s(width, name)
Definition: cbs_vp9.c:198
av_new_packet
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
Definition: packet.c:98
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:60
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:549
AVFormatContext::iformat
const struct AVInputFormat * iformat
The input container format.
Definition: avformat.h:1276
pix_fmt
static enum AVPixelFormat pix_fmt
Definition: demux_decode.c:41
AVCodecParameters::width
int width
Video only.
Definition: codec_par.h:134
ctx
AVFormatContext * ctx
Definition: movenc.c:49
av_rescale_q
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
Definition: mathematics.c:142
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
AVFormatContext
Format I/O context.
Definition: avformat.h:1264
OFFSET
#define OFFSET(x)
Definition: rawvideodec.c:209
internal.h
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:767
framerate
float framerate
Definition: av1_levels.c:29
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
ff_bitpacked_demuxer
const FFInputFormat ff_bitpacked_demuxer
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:76
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:783
NULL
#define NULL
Definition: coverity.c:32
av_image_fill_plane_sizes
int av_image_fill_plane_sizes(size_t sizes[4], enum AVPixelFormat pix_fmt, int height, const ptrdiff_t linesizes[4])
Fill plane sizes for an image with pixel format pix_fmt and height height.
Definition: imgutils.c:111
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
Definition: opt.h:303
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:242
AVFormatContext::pb
AVIOContext * pb
I/O context.
Definition: avformat.h:1306
parseutils.h
ff_v210_demuxer
const FFInputFormat ff_v210_demuxer
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:540
GET_PACKET_SIZE
#define GET_PACKET_SIZE(w, h)
Definition: rawvideodec.c:54
AVPacket::size
int size
Definition: packet.h:589
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:94
shift
static int shift(int a, int b)
Definition: bonk.c:261
AV_OPT_TYPE_FLAG_ARRAY
@ AV_OPT_TYPE_FLAG_ARRAY
May be combined with another regular option type to declare an array option.
Definition: opt.h:346
RawVideoDemuxerContext::height
int height
Integers describing video size, set by a private option.
Definition: rawvideodec.c:36
AV_CODEC_ID_V210
@ AV_CODEC_ID_V210
Definition: codec_id.h:179
FFInputFormat::p
AVInputFormat p
The public AVInputFormat.
Definition: demux.h:51
AVPacket::dts
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
Definition: packet.h:587
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
AVPacket::flags
int flags
A combination of AV_PKT_FLAG values.
Definition: packet.h:594
ff_v210x_demuxer
const FFInputFormat ff_v210x_demuxer
read_header
static int read_header(FFV1Context *f, RangeCoder *c)
Definition: ffv1dec.c:498
AV_CODEC_ID_V210X
@ AV_CODEC_ID_V210X
Definition: codec_id.h:177
DEC
#define DEC
Definition: rawvideodec.c:210
AV_CODEC_ID_BITPACKED
@ AV_CODEC_ID_BITPACKED
Definition: codec_id.h:285
RawVideoDemuxerContext::frame_size
size_t frame_size
Definition: rawvideodec.c:48
rawvideo_read_packet
static int rawvideo_read_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: rawvideodec.c:158
RawVideoDemuxerContext::has_padding
bool has_padding
Definition: rawvideodec.c:40
RawVideoDemuxerContext::raw_bytes
int raw_bytes[4]
Definition: rawvideodec.c:50
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
AVPacket::pts
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: packet.h:581
AVCodecParameters::height
int height
Definition: codec_par.h:135
FFInputFormat::raw_codec_id
enum AVCodecID raw_codec_id
Raw demuxers store their codec ID here.
Definition: demux.h:56
demux.h
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:98
tag
uint32_t tag
Definition: movenc.c:2032
ret
ret
Definition: filter_design.txt:187
AVStream
Stream structure.
Definition: avformat.h:744
AVClass::class_name
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:81
v210_demuxer_class
static const AVClass v210_demuxer_class
Definition: rawvideodec.c:263
avformat.h
AV_PIX_FMT_UYVY422
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:88
RawVideoDemuxerContext::pix_fmt
enum AVPixelFormat pix_fmt
Definition: rawvideodec.c:37
ffifmt
static const FFInputFormat * ffifmt(const AVInputFormat *fmt)
Definition: demux.h:143
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
avio_read
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:615
Windows::Graphics::DirectX::Direct3D11::p
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
Definition: vsrc_gfxcapture_winrt.hpp:53
AV_OPT_TYPE_PIXEL_FMT
@ AV_OPT_TYPE_PIXEL_FMT
Underlying C type is enum AVPixelFormat.
Definition: opt.h:307
avio_skip
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition: aviobuf.c:321
AVFormatContext::packet_size
unsigned int packet_size
Definition: avformat.h:1408
desc
const char * desc
Definition: libsvtav1.c:78
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
AVCodecParameters::bits_per_coded_sample
int bits_per_coded_sample
The number of bits per sample in the codedwords.
Definition: codec_par.h:110
AVCodecParameters::format
int format
Definition: codec_par.h:92
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
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:565
AVPacket::pos
int64_t pos
byte position in stream, -1 if unknown
Definition: packet.h:608
RawVideoDemuxerContext::width
int width
Definition: rawvideodec.c:36
FFInputFormat
Definition: demux.h:47
imgutils.h
AVCodecParameters::bit_rate
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
Definition: codec_par.h:97
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
bitpacked_demuxer_class
static const AVClass bitpacked_demuxer_class
Definition: rawvideodec.c:242
skip_bytes
static const av_unused uint8_t * skip_bytes(CABACContext *c, int n)
Skip n bytes and reset the decoder.
Definition: cabac_functions.h:203
MKTAG
#define MKTAG(a, b, c, d)
Definition: macros.h:55
h
h
Definition: vp9dsp_template.c:2070
rawvideo_demuxer_class
static const AVClass rawvideo_demuxer_class
Definition: rawvideodec.c:223
av_image_check_size
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
Definition: imgutils.c:318
width
#define width
Definition: dsp.h:89
AVFormatContext::priv_data
void * priv_data
Format private data.
Definition: avformat.h:1292