FFmpeg
mxpegdec.c
Go to the documentation of this file.
1 /*
2  * MxPEG decoder
3  * Copyright (c) 2011 Anatoly Nenashev
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 
23 /**
24  * @file
25  * MxPEG decoder
26  */
27 
28 #include "libavutil/mem.h"
29 #include "codec_internal.h"
30 #include "decode.h"
31 #include "hpeldsp.h"
32 #include "mjpeg.h"
33 #include "mjpegdec.h"
34 
35 typedef struct MXpegDecodeContext {
37  AVFrame *picture[2]; /* pictures array */
38  int picture_index; /* index of current picture */
39  int got_sof_data; /* true if SOF data successfully parsed */
40  int got_mxm_bitmask; /* true if MXM bitmask available */
41  uint8_t *mxm_bitmask; /* bitmask buffer */
42  unsigned bitmask_size; /* size of bitmask */
43  int has_complete_frame; /* true if has complete frame */
44  uint8_t *completion_bitmask; /* completion bitmask of macroblocks */
45  unsigned mb_width, mb_height; /* size of picture in MB's from MXM header */
47 
49 {
50  MXpegDecodeContext *s = avctx->priv_data;
51  int i;
52 
53  ff_mjpeg_decode_end(avctx);
54 
55  for (i = 0; i < 2; ++i)
56  av_frame_free(&s->picture[i]);
57 
58  s->bitmask_size = 0;
59  av_freep(&s->mxm_bitmask);
60  av_freep(&s->completion_bitmask);
61 
62  return 0;
63 }
64 
66 {
67  MXpegDecodeContext *s = avctx->priv_data;
68  HpelDSPContext hdsp;
69 
70  ff_hpeldsp_init(&hdsp, avctx->flags);
71  s->jpg.copy_block = hdsp.put_pixels_tab[1][0];
72 
73  s->picture[0] = av_frame_alloc();
74  s->picture[1] = av_frame_alloc();
75  if (!s->picture[0] || !s->picture[1])
76  return AVERROR(ENOMEM);
77 
78  s->jpg.picture_ptr = s->picture[0];
79  return ff_mjpeg_decode_init(avctx);
80 }
81 
83  const uint8_t *buf_ptr, int buf_size)
84 {
85  int len;
86  if (buf_size < 2)
87  return 0;
88  len = AV_RB16(buf_ptr);
89  skip_bits(&s->jpg.gb, 8*FFMIN(len,buf_size));
90 
91  return 0;
92 }
93 
95  const uint8_t *buf_ptr, int buf_size)
96 {
97  unsigned bitmask_size, mb_count;
98  int i;
99 
100  s->mb_width = AV_RL16(buf_ptr+4);
101  s->mb_height = AV_RL16(buf_ptr+6);
102  mb_count = s->mb_width * s->mb_height;
103 
104  bitmask_size = (mb_count + 7) >> 3;
105  if (bitmask_size > buf_size - 12) {
106  av_log(s->jpg.avctx, AV_LOG_ERROR,
107  "MXM bitmask is not complete\n");
108  return AVERROR(EINVAL);
109  }
110 
111  if (s->bitmask_size != bitmask_size) {
112  s->bitmask_size = 0;
113  av_freep(&s->mxm_bitmask);
114  s->mxm_bitmask = av_malloc(bitmask_size);
115  if (!s->mxm_bitmask) {
116  av_log(s->jpg.avctx, AV_LOG_ERROR,
117  "MXM bitmask memory allocation error\n");
118  return AVERROR(ENOMEM);
119  }
120 
121  av_freep(&s->completion_bitmask);
122  s->completion_bitmask = av_mallocz(bitmask_size);
123  if (!s->completion_bitmask) {
124  av_log(s->jpg.avctx, AV_LOG_ERROR,
125  "Completion bitmask memory allocation error\n");
126  return AVERROR(ENOMEM);
127  }
128 
129  s->bitmask_size = bitmask_size;
130  }
131 
132  memcpy(s->mxm_bitmask, buf_ptr + 12, bitmask_size);
133  s->got_mxm_bitmask = 1;
134 
135  if (!s->has_complete_frame) {
136  uint8_t completion_check = 0xFF;
137  for (i = 0; i < bitmask_size; ++i) {
138  s->completion_bitmask[i] |= s->mxm_bitmask[i];
139  completion_check &= s->completion_bitmask[i];
140  }
141  s->has_complete_frame = !(completion_check ^ 0xFF);
142  }
143 
144  return 0;
145 }
146 
148  const uint8_t *buf_ptr, int buf_size)
149 {
150  int len, ret = 0;
151  if (buf_size < 2)
152  return 0;
153  len = AV_RB16(buf_ptr);
154  if (len > 14 && len <= buf_size && !strncmp(buf_ptr + 2, "MXM", 3)) {
155  ret = mxpeg_decode_mxm(s, buf_ptr + 2, len - 2);
156  }
157  skip_bits(&s->jpg.gb, 8*FFMIN(len,buf_size));
158 
159  return ret;
160 }
161 
163  AVFrame *reference_ptr)
164 {
165  if ((jpg->width + 0x0F)>>4 != s->mb_width ||
166  (jpg->height + 0x0F)>>4 != s->mb_height) {
167  av_log(jpg->avctx, AV_LOG_ERROR,
168  "Picture dimensions stored in SOF and MXM mismatch\n");
169  return AVERROR(EINVAL);
170  }
171 
172  if (reference_ptr->data[0]) {
173  int i;
174  for (i = 0; i < MAX_COMPONENTS; ++i) {
175  if ( (!reference_ptr->data[i] ^ !jpg->picture_ptr->data[i]) ||
176  reference_ptr->linesize[i] != jpg->picture_ptr->linesize[i]) {
177  av_log(jpg->avctx, AV_LOG_ERROR,
178  "Dimensions of current and reference picture mismatch\n");
179  return AVERROR(EINVAL);
180  }
181  }
182  if (reference_ptr->width != jpg->picture_ptr->width ||
183  reference_ptr->height != jpg->picture_ptr->height ||
184  reference_ptr->format != jpg->picture_ptr->format) {
185  av_log(jpg->avctx, AV_LOG_ERROR, "Reference mismatching\n");
186  return AVERROR_INVALIDDATA;
187  }
188  }
189 
190  return 0;
191 }
192 
193 static int mxpeg_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
194  int *got_frame, AVPacket *avpkt)
195 {
196  const uint8_t *buf = avpkt->data;
197  int buf_size = avpkt->size;
198  MXpegDecodeContext *s = avctx->priv_data;
199  MJpegDecodeContext *jpg = &s->jpg;
200  const uint8_t *buf_end, *buf_ptr;
201  const uint8_t *unescaped_buf_ptr;
202  int unescaped_buf_size;
203  int start_code;
204  int ret;
205 
206  if (avctx->skip_frame == AVDISCARD_ALL)
207  return AVERROR_PATCHWELCOME;
208 
209  buf_ptr = buf;
210  buf_end = buf + buf_size;
211  jpg->got_picture = 0;
212  s->got_mxm_bitmask = 0;
213  s->got_sof_data = !!s->got_sof_data;
214  while (buf_ptr < buf_end) {
215  start_code = ff_mjpeg_find_marker(jpg, &buf_ptr, buf_end,
216  &unescaped_buf_ptr, &unescaped_buf_size);
217  if (start_code < 0)
218  goto the_end;
219  {
220  init_get_bits(&jpg->gb, unescaped_buf_ptr, unescaped_buf_size*8);
221 
222  if (start_code >= APP0 && start_code <= APP15) {
223  mxpeg_decode_app(s, unescaped_buf_ptr, unescaped_buf_size);
224  }
225 
226  switch (start_code) {
227  case SOI:
228  if (jpg->got_picture) //emulating EOI
229  goto the_end;
230  break;
231  case EOI:
232  goto the_end;
233  case DQT:
234  ret = ff_mjpeg_decode_dqt(jpg);
235  if (ret < 0) {
236  av_log(avctx, AV_LOG_ERROR,
237  "quantization table decode error\n");
238  return ret;
239  }
240  break;
241  case DHT:
242  ret = ff_mjpeg_decode_dht(jpg);
243  if (ret < 0) {
244  av_log(avctx, AV_LOG_ERROR,
245  "huffman table decode error\n");
246  return ret;
247  }
248  break;
249  case COM:
250  ret = mxpeg_decode_com(s, unescaped_buf_ptr,
251  unescaped_buf_size);
252  if (ret < 0)
253  return ret;
254  break;
255  case SOF0:
256  if (s->got_sof_data > 1) {
257  av_log(avctx, AV_LOG_ERROR,
258  "Multiple SOF in a frame\n");
259  return AVERROR_INVALIDDATA;
260  }
261  ret = ff_mjpeg_decode_sof(jpg);
262  if (ret < 0) {
263  av_log(avctx, AV_LOG_ERROR,
264  "SOF data decode error\n");
265  s->got_sof_data = 0;
266  return ret;
267  }
268  if (jpg->interlaced) {
269  av_log(avctx, AV_LOG_ERROR,
270  "Interlaced mode not supported in MxPEG\n");
271  s->got_sof_data = 0;
272  return AVERROR(EINVAL);
273  }
274  s->got_sof_data ++;
275  break;
276  case SOS:
277  if (!s->got_sof_data) {
278  av_log(avctx, AV_LOG_WARNING,
279  "Can not process SOS without SOF data, skipping\n");
280  break;
281  }
282  if (!jpg->got_picture) {
283  if (jpg->first_picture) {
284  av_log(avctx, AV_LOG_WARNING,
285  "First picture has no SOF, skipping\n");
286  break;
287  }
288  if (!s->got_mxm_bitmask){
289  av_log(avctx, AV_LOG_WARNING,
290  "Non-key frame has no MXM, skipping\n");
291  break;
292  }
293  /* use stored SOF data to allocate current picture */
295  if ((ret = ff_get_buffer(avctx, jpg->picture_ptr,
297  return ret;
300  jpg->got_picture = 1;
301  } else {
304  }
305 
306  if (s->got_mxm_bitmask) {
307  AVFrame *reference_ptr = s->picture[s->picture_index ^ 1];
308  if (mxpeg_check_dimensions(s, jpg, reference_ptr) < 0)
309  break;
310 
311  /* allocate dummy reference picture if needed */
312  if (!reference_ptr->data[0] &&
313  (ret = ff_get_buffer(avctx, reference_ptr,
315  return ret;
316 
317  ret = ff_mjpeg_decode_sos(jpg, s->mxm_bitmask, s->bitmask_size, reference_ptr);
318  if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
319  return ret;
320  } else {
321  ret = ff_mjpeg_decode_sos(jpg, NULL, 0, NULL);
322  if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
323  return ret;
324  }
325 
326  break;
327  }
328 
329  buf_ptr += (get_bits_count(&jpg->gb)+7) >> 3;
330  }
331 
332  }
333 
334 the_end:
335  if (jpg->got_picture) {
336  int ret = av_frame_ref(rframe, jpg->picture_ptr);
337  if (ret < 0)
338  return ret;
339  *got_frame = 1;
340 
341  s->picture_index ^= 1;
342  jpg->picture_ptr = s->picture[s->picture_index];
343 
344  if (!s->has_complete_frame) {
345  if (!s->got_mxm_bitmask)
346  s->has_complete_frame = 1;
347  else
348  *got_frame = 0;
349  }
350  }
351 
352  return buf_ptr - buf;
353 }
354 
356  .p.name = "mxpeg",
357  CODEC_LONG_NAME("Mobotix MxPEG video"),
358  .p.type = AVMEDIA_TYPE_VIDEO,
359  .p.id = AV_CODEC_ID_MXPEG,
360  .priv_data_size = sizeof(MXpegDecodeContext),
364  .p.capabilities = AV_CODEC_CAP_DR1,
365  .p.max_lowres = 3,
366  .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
367 };
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:216
mjpeg.h
AV_EF_EXPLODE
#define AV_EF_EXPLODE
abort decoding on minor error detection
Definition: defs.h:51
MJpegDecodeContext::avctx
AVCodecContext * avctx
Definition: mjpegdec.h:57
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:42
MJpegDecodeContext::height
int height
Definition: mjpegdec.h:92
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
SOS
@ SOS
Definition: mjpeg.h:72
MXpegDecodeContext::mb_width
unsigned mb_width
Definition: mxpegdec.c:45
SOF0
@ SOF0
Definition: mjpeg.h:39
AVCodecContext::err_recognition
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
Definition: avcodec.h:1398
get_bits_count
static int get_bits_count(const GetBitContext *s)
Definition: get_bits.h:250
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:64
mjpegdec.h
start_code
static const uint8_t start_code[]
Definition: videotoolboxenc.c:230
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:427
AVFrame::width
int width
Definition: frame.h:499
AVPacket::data
uint8_t * data
Definition: packet.h:558
MXpegDecodeContext::got_mxm_bitmask
int got_mxm_bitmask
Definition: mxpegdec.c:40
MJpegDecodeContext::first_picture
int first_picture
Definition: mjpegdec.h:70
FFCodec
Definition: codec_internal.h:127
AVFrame::flags
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
Definition: frame.h:671
MXpegDecodeContext::mb_height
unsigned mb_height
Definition: mxpegdec.c:45
AV_CODEC_ID_MXPEG
@ AV_CODEC_ID_MXPEG
Definition: codec_id.h:198
init_get_bits
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:512
MXpegDecodeContext
Definition: mxpegdec.c:35
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:448
av_malloc
#define av_malloc(s)
Definition: tableprint_vlc.h:31
APP15
@ APP15
Definition: mjpeg.h:94
skip_bits
static void skip_bits(GetBitContext *s, int n)
Definition: get_bits.h:379
close
static av_cold void close(AVCodecParserContext *s)
Definition: apv_parser.c:135
ff_mjpeg_decode_dht
int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
Definition: mjpegdec.c:238
FFCodec::p
AVCodec p
The public AVCodec.
Definition: codec_internal.h:131
ff_mjpeg_decode_init
av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
Definition: mjpegdec.c:122
AVCodecContext::skip_frame
enum AVDiscard skip_frame
Skip decoding for selected frames.
Definition: avcodec.h:1662
AVCodecContext::flags
int flags
AV_CODEC_FLAG_*.
Definition: avcodec.h:488
av_frame_alloc
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Definition: frame.c:52
MJpegDecodeContext::picture_ptr
AVFrame * picture_ptr
Definition: mjpegdec.h:110
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
av_cold
#define av_cold
Definition: attributes.h:100
COM
@ COM
Definition: mjpeg.h:111
AV_FRAME_FLAG_KEY
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
Definition: frame.h:642
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:346
MXpegDecodeContext::picture
AVFrame * picture[2]
Definition: mxpegdec.c:37
s
#define s(width, name)
Definition: cbs_vp9.c:198
AV_GET_BUFFER_FLAG_REF
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
Definition: avcodec.h:411
MJpegDecodeContext::interlaced
int interlaced
Definition: mjpegdec.h:71
mxpeg_decode_mxm
static int mxpeg_decode_mxm(MXpegDecodeContext *s, const uint8_t *buf_ptr, int buf_size)
Definition: mxpegdec.c:94
decode.h
AV_RL16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:94
ff_mjpeg_decode_end
av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
Definition: mjpegdec.c:2880
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:331
AVDISCARD_ALL
@ AVDISCARD_ALL
discard all
Definition: defs.h:232
NULL
#define NULL
Definition: coverity.c:32
AVERROR_PATCHWELCOME
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:64
ff_mjpeg_decode_dqt
int ff_mjpeg_decode_dqt(MJpegDecodeContext *s)
Definition: mjpegdec.c:195
MJpegDecodeContext::gb
GetBitContext gb
Definition: mjpegdec.h:58
MXpegDecodeContext::mxm_bitmask
uint8_t * mxm_bitmask
Definition: mxpegdec.c:41
AV_PICTURE_TYPE_I
@ AV_PICTURE_TYPE_I
Intra.
Definition: avutil.h:278
MJpegDecodeContext
Definition: mjpegdec.h:55
ff_mxpeg_decoder
const FFCodec ff_mxpeg_decoder
Definition: mxpegdec.c:355
MJpegDecodeContext::width
int width
Definition: mjpegdec.h:92
HpelDSPContext
Half-pel DSP context.
Definition: hpeldsp.h:46
HpelDSPContext::put_pixels_tab
op_pixels_func put_pixels_tab[4][4]
Halfpel motion compensation with rounding (a+b+1)>>1.
Definition: hpeldsp.h:57
AVFrame::pict_type
enum AVPictureType pict_type
Picture type of the frame.
Definition: frame.h:519
ff_get_buffer
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition: decode.c:1720
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AVPacket::size
int size
Definition: packet.h:559
av_frame_ref
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
Definition: frame.c:278
codec_internal.h
ff_mjpeg_decode_sos
int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask, int mb_bitmask_size, const AVFrame *reference)
Definition: mjpegdec.c:1669
AVFrame::format
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition: frame.h:514
MXpegDecodeContext::picture_index
int picture_index
Definition: mxpegdec.c:38
DQT
@ DQT
Definition: mjpeg.h:73
mxpeg_decode_app
static int mxpeg_decode_app(MXpegDecodeContext *s, const uint8_t *buf_ptr, int buf_size)
Definition: mxpegdec.c:82
MXpegDecodeContext::got_sof_data
int got_sof_data
Definition: mxpegdec.c:39
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
EOI
@ EOI
Definition: mjpeg.h:71
mxpeg_decode_init
static av_cold int mxpeg_decode_init(AVCodecContext *avctx)
Definition: mxpegdec.c:65
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
av_frame_unref
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
Definition: frame.c:496
av_mallocz
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Definition: mem.c:256
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:179
len
int len
Definition: vorbis_enc_data.h:426
DHT
@ DHT
Definition: mjpeg.h:56
mxpeg_decode_end
static av_cold int mxpeg_decode_end(AVCodecContext *avctx)
Definition: mxpegdec.c:48
MXpegDecodeContext::jpg
MJpegDecodeContext jpg
Definition: mxpegdec.c:36
mxpeg_check_dimensions
static int mxpeg_check_dimensions(MXpegDecodeContext *s, MJpegDecodeContext *jpg, AVFrame *reference_ptr)
Definition: mxpegdec.c:162
ret
ret
Definition: filter_design.txt:187
mxpeg_decode_frame
static int mxpeg_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition: mxpegdec.c:193
ff_mjpeg_find_marker
int ff_mjpeg_find_marker(MJpegDecodeContext *s, const uint8_t **buf_ptr, const uint8_t *buf_end, const uint8_t **unescaped_buf_ptr, int *unescaped_buf_size)
Definition: mjpegdec.c:2219
MXpegDecodeContext::bitmask_size
unsigned bitmask_size
Definition: mxpegdec.c:42
AVCodecContext
main external API structure.
Definition: avcodec.h:431
AVFrame::height
int height
Definition: frame.h:499
ff_mjpeg_decode_sof
int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
Definition: mjpegdec.c:299
APP0
@ APP0
Definition: mjpeg.h:79
MJpegDecodeContext::got_picture
int got_picture
we found a SOF and picture is valid, too.
Definition: mjpegdec.h:111
AV_PICTURE_TYPE_P
@ AV_PICTURE_TYPE_P
Predicted.
Definition: avutil.h:279
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
mem.h
SOI
@ SOI
Definition: mjpeg.h:70
AVPacket
This structure stores compressed data.
Definition: packet.h:535
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:458
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:35
hpeldsp.h
MAX_COMPONENTS
#define MAX_COMPONENTS
Definition: mjpegdec.h:46
AVFrame::linesize
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition: frame.h:472
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
mxpeg_decode_com
static int mxpeg_decode_com(MXpegDecodeContext *s, const uint8_t *buf_ptr, int buf_size)
Definition: mxpegdec.c:147
MXpegDecodeContext::has_complete_frame
int has_complete_frame
Definition: mxpegdec.c:43
ff_hpeldsp_init
av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags)
Definition: hpeldsp.c:337
AV_RB16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
Definition: bytestream.h:98
MXpegDecodeContext::completion_bitmask
uint8_t * completion_bitmask
Definition: mxpegdec.c:44