FFmpeg
mpegpicture.c
Go to the documentation of this file.
1 /*
2  * Mpeg video formats-related picture management functions
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include <stdint.h>
22 
23 #include "libavutil/avassert.h"
24 #include "libavutil/common.h"
25 #include "libavutil/mem.h"
26 #include "libavutil/pixdesc.h"
27 #include "libavutil/imgutils.h"
28 
29 #include "avcodec.h"
30 #include "motion_est.h"
31 #include "mpegpicture.h"
32 #include "mpegvideo.h"
33 #include "refstruct.h"
34 #include "threadframe.h"
35 
37 {
38  pic->alloc_mb_width =
39  pic->alloc_mb_height = 0;
40 
44 
45  for (int i = 0; i < 2; i++) {
48  }
49 }
50 
52 {
53  AVBufferRef *old = *ref, *new;
54 
55  if (av_buffer_is_writable(old))
56  return 0;
57  new = av_buffer_allocz(old->size);
58  if (!new)
59  return AVERROR(ENOMEM);
61  *ref = new;
62  return 0;
63 }
64 
65 static int make_tables_writable(Picture *pic)
66 {
67 #define MAKE_WRITABLE(table) \
68 do {\
69  int ret = make_table_writable(&pic->table); \
70  if (ret < 0) \
71  return ret; \
72 } while (0)
73 
74  MAKE_WRITABLE(mbskip_table_buf);
75  MAKE_WRITABLE(qscale_table_buf);
76  MAKE_WRITABLE(mb_type_buf);
77 
78  if (pic->motion_val_buf[0]) {
79  for (int i = 0; i < 2; i++) {
80  MAKE_WRITABLE(motion_val_buf[i]);
81  MAKE_WRITABLE(ref_index_buf[i]);
82  }
83  }
84 
85  return 0;
86 }
87 
89  ScratchpadContext *sc, int linesize)
90 {
91 # define EMU_EDGE_HEIGHT (4 * 70)
92  int alloc_size = FFALIGN(FFABS(linesize) + 64, 32);
93 
94  if (avctx->hwaccel)
95  return 0;
96 
97  if (linesize < 24) {
98  av_log(avctx, AV_LOG_ERROR, "Image too small, temporary buffers cannot function\n");
99  return AVERROR_PATCHWELCOME;
100  }
101 
102  if (av_image_check_size2(alloc_size, EMU_EDGE_HEIGHT, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx) < 0)
103  return AVERROR(ENOMEM);
104 
105  // edge emu needs blocksize + filter length - 1
106  // (= 17x17 for halfpel / 21x21 for H.264)
107  // VC-1 computes luma and chroma simultaneously and needs 19X19 + 9x9
108  // at uvlinesize. It supports only YUV420 so 24x24 is enough
109  // linesize * interlaced * MBsize
110  // we also use this buffer for encoding in encode_mb_internal() needig an additional 32 lines
111  if (!FF_ALLOCZ_TYPED_ARRAY(sc->edge_emu_buffer, alloc_size * EMU_EDGE_HEIGHT) ||
112  !FF_ALLOCZ_TYPED_ARRAY(me->scratchpad, alloc_size * 4 * 16 * 2)) {
114  return AVERROR(ENOMEM);
115  }
116 
117  me->temp = me->scratchpad;
118  sc->rd_scratchpad = me->scratchpad;
119  sc->b_scratchpad = me->scratchpad;
120  sc->obmc_scratchpad = me->scratchpad + 16;
121 
122  return 0;
123 }
124 
125 /**
126  * Check the pic's linesize and allocate linesize dependent scratch buffers
127  */
130  int linesize, int uvlinesize)
131 {
132  int ret;
133 
134  if ((linesize && linesize != pic->f->linesize[0]) ||
135  (uvlinesize && uvlinesize != pic->f->linesize[1])) {
136  av_log(avctx, AV_LOG_ERROR,
137  "get_buffer() failed (stride changed: linesize=%d/%d uvlinesize=%d/%d)\n",
138  linesize, pic->f->linesize[0],
139  uvlinesize, pic->f->linesize[1]);
141  return -1;
142  }
143 
144  if (av_pix_fmt_count_planes(pic->f->format) > 2 &&
145  pic->f->linesize[1] != pic->f->linesize[2]) {
146  av_log(avctx, AV_LOG_ERROR,
147  "get_buffer() failed (uv stride mismatch)\n");
149  return -1;
150  }
151 
152  if (!sc->edge_emu_buffer &&
153  (ret = ff_mpeg_framesize_alloc(avctx, me, sc,
154  pic->f->linesize[0])) < 0) {
155  av_log(avctx, AV_LOG_ERROR,
156  "get_buffer() failed to allocate context scratch buffers.\n");
158  return ret;
159  }
160 
161  return 0;
162 }
163 
164 static int alloc_picture_tables(AVCodecContext *avctx, Picture *pic, int encoding, int out_format,
165  int mb_stride, int mb_width, int mb_height, int b8_stride)
166 {
167  const int big_mb_num = mb_stride * (mb_height + 1) + 1;
168  const int mb_array_size = mb_stride * mb_height;
169  const int b8_array_size = b8_stride * mb_height * 2;
170  int i;
171 
172 
173  pic->mbskip_table_buf = av_buffer_allocz(mb_array_size + 2);
174  pic->qscale_table_buf = av_buffer_allocz(big_mb_num + mb_stride);
175  pic->mb_type_buf = av_buffer_allocz((big_mb_num + mb_stride) *
176  sizeof(uint32_t));
177  if (!pic->mbskip_table_buf || !pic->qscale_table_buf || !pic->mb_type_buf)
178  return AVERROR(ENOMEM);
179 
180  if (out_format == FMT_H263 || encoding ||
182  int mv_size = 2 * (b8_array_size + 4) * sizeof(int16_t);
183  int ref_index_size = 4 * mb_array_size;
184 
185  for (i = 0; mv_size && i < 2; i++) {
186  pic->motion_val_buf[i] = av_buffer_allocz(mv_size);
187  pic->ref_index_buf[i] = av_buffer_allocz(ref_index_size);
188  if (!pic->motion_val_buf[i] || !pic->ref_index_buf[i])
189  return AVERROR(ENOMEM);
190  }
191  }
192 
193  pic->alloc_mb_width = mb_width;
194  pic->alloc_mb_height = mb_height;
195  pic->alloc_mb_stride = mb_stride;
196 
197  return 0;
198 }
199 
200 /**
201  * Allocate a Picture.
202  * The pixels are allocated/set by calling get_buffer() if shared = 0
203  */
205  ScratchpadContext *sc, int encoding, int out_format,
206  int mb_stride, int mb_width, int mb_height, int b8_stride,
207  ptrdiff_t *linesize, ptrdiff_t *uvlinesize)
208 {
209  int i, ret;
210 
211  if (pic->qscale_table_buf)
212  if ( pic->alloc_mb_width != mb_width
213  || pic->alloc_mb_height != mb_height)
214  free_picture_tables(pic);
215 
216  if (handle_pic_linesizes(avctx, pic, me, sc,
217  *linesize, *uvlinesize) < 0)
218  return -1;
219 
220  *linesize = pic->f->linesize[0];
221  *uvlinesize = pic->f->linesize[1];
222 
223  if (!pic->qscale_table_buf)
224  ret = alloc_picture_tables(avctx, pic, encoding, out_format,
225  mb_stride, mb_width, mb_height, b8_stride);
226  else
227  ret = make_tables_writable(pic);
228  if (ret < 0)
229  goto fail;
230 
231  pic->mbskip_table = pic->mbskip_table_buf->data;
232  pic->qscale_table = pic->qscale_table_buf->data + 2 * mb_stride + 1;
233  pic->mb_type = (uint32_t*)pic->mb_type_buf->data + 2 * mb_stride + 1;
234 
235  if (pic->motion_val_buf[0]) {
236  for (i = 0; i < 2; i++) {
237  pic->motion_val[i] = (int16_t (*)[2])pic->motion_val_buf[i]->data + 4;
238  pic->ref_index[i] = pic->ref_index_buf[i]->data;
239  }
240  }
241 
242  return 0;
243 fail:
244  av_log(avctx, AV_LOG_ERROR, "Error allocating a picture.\n");
246  free_picture_tables(pic);
247  return AVERROR(ENOMEM);
248 }
249 
250 /**
251  * Deallocate a picture; frees the picture tables in case they
252  * need to be reallocated anyway.
253  */
255 {
256  pic->tf.f = pic->f;
258 
260 
261  if (pic->needs_realloc)
262  free_picture_tables(pic);
263 
264  pic->field_picture = 0;
265  pic->b_frame_score = 0;
266  pic->needs_realloc = 0;
267  pic->reference = 0;
268  pic->shared = 0;
269  pic->display_picture_number = 0;
270  pic->coded_picture_number = 0;
271 }
272 
274 {
275  int i, ret;
276 
277  ret = av_buffer_replace(&dst->mbskip_table_buf, src->mbskip_table_buf);
278  ret |= av_buffer_replace(&dst->qscale_table_buf, src->qscale_table_buf);
279  ret |= av_buffer_replace(&dst->mb_type_buf, src->mb_type_buf);
280  for (i = 0; i < 2; i++) {
281  ret |= av_buffer_replace(&dst->motion_val_buf[i], src->motion_val_buf[i]);
282  ret |= av_buffer_replace(&dst->ref_index_buf[i], src->ref_index_buf[i]);
283  }
284 
285  if (ret < 0) {
286  free_picture_tables(dst);
287  return ret;
288  }
289 
290  dst->mbskip_table = src->mbskip_table;
291  dst->qscale_table = src->qscale_table;
292  dst->mb_type = src->mb_type;
293  for (i = 0; i < 2; i++) {
294  dst->motion_val[i] = src->motion_val[i];
295  dst->ref_index[i] = src->ref_index[i];
296  }
297 
298  dst->alloc_mb_width = src->alloc_mb_width;
299  dst->alloc_mb_height = src->alloc_mb_height;
300  dst->alloc_mb_stride = src->alloc_mb_stride;
301 
302  return 0;
303 }
304 
306 {
307  int ret;
308 
309  av_assert0(!dst->f->buf[0]);
310  av_assert0(src->f->buf[0]);
311 
312  src->tf.f = src->f;
313  dst->tf.f = dst->f;
314  ret = ff_thread_ref_frame(&dst->tf, &src->tf);
315  if (ret < 0)
316  goto fail;
317 
319  if (ret < 0)
320  goto fail;
321 
323  src->hwaccel_picture_private);
324 
325  dst->field_picture = src->field_picture;
326  dst->b_frame_score = src->b_frame_score;
327  dst->needs_realloc = src->needs_realloc;
328  dst->reference = src->reference;
329  dst->shared = src->shared;
330  dst->display_picture_number = src->display_picture_number;
331  dst->coded_picture_number = src->coded_picture_number;
332 
333  return 0;
334 fail:
336  return ret;
337 }
338 
339 static inline int pic_is_unused(Picture *pic)
340 {
341  if (!pic->f->buf[0])
342  return 1;
343  if (pic->needs_realloc)
344  return 1;
345  return 0;
346 }
347 
348 static int find_unused_picture(AVCodecContext *avctx, Picture *picture, int shared)
349 {
350  int i;
351 
352  if (shared) {
353  for (i = 0; i < MAX_PICTURE_COUNT; i++) {
354  if (!picture[i].f->buf[0])
355  return i;
356  }
357  } else {
358  for (i = 0; i < MAX_PICTURE_COUNT; i++) {
359  if (pic_is_unused(&picture[i]))
360  return i;
361  }
362  }
363 
364  av_log(avctx, AV_LOG_FATAL,
365  "Internal error, picture buffer overflow\n");
366  /* We could return -1, but the codec would crash trying to draw into a
367  * non-existing frame anyway. This is safer than waiting for a random crash.
368  * Also the return of this is never useful, an encoder must only allocate
369  * as much as allowed in the specification. This has no relationship to how
370  * much libavcodec could allocate (and MAX_PICTURE_COUNT is always large
371  * enough for such valid streams).
372  * Plus, a decoder has to check stream validity and remove frames if too
373  * many reference frames are around. Waiting for "OOM" is not correct at
374  * all. Similarly, missing reference frames have to be replaced by
375  * interpolated/MC frames, anything else is a bug in the codec ...
376  */
377  abort();
378  return -1;
379 }
380 
381 int ff_find_unused_picture(AVCodecContext *avctx, Picture *picture, int shared)
382 {
383  int ret = find_unused_picture(avctx, picture, shared);
384 
385  if (ret >= 0 && ret < MAX_PICTURE_COUNT) {
386  if (picture[ret].needs_realloc) {
387  ff_mpeg_unref_picture(&picture[ret]);
388  }
389  }
390  return ret;
391 }
392 
394 {
395  free_picture_tables(pic);
397  av_frame_free(&pic->f);
398 }
FF_ALLOCZ_TYPED_ARRAY
#define FF_ALLOCZ_TYPED_ARRAY(p, nelem)
Definition: internal.h:78
AVCodecContext::hwaccel
const struct AVHWAccel * hwaccel
Hardware accelerator in use.
Definition: avcodec.h:1427
Picture::ref_index_buf
AVBufferRef * ref_index_buf[2]
Definition: mpegpicture.h:62
EMU_EDGE_HEIGHT
#define EMU_EDGE_HEIGHT
ScratchpadContext::obmc_scratchpad
uint8_t * obmc_scratchpad
Definition: mpegpicture.h:39
ff_mpeg_framesize_alloc
int ff_mpeg_framesize_alloc(AVCodecContext *avctx, MotionEstContext *me, ScratchpadContext *sc, int linesize)
Definition: mpegpicture.c: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
free_picture_tables
static void av_noinline free_picture_tables(Picture *pic)
Definition: mpegpicture.c:36
AVBufferRef::data
uint8_t * data
The data buffer.
Definition: buffer.h:90
ScratchpadContext::rd_scratchpad
uint8_t * rd_scratchpad
scratchpad for rate distortion mb decision
Definition: mpegpicture.h:38
MotionEstContext
Motion estimation context.
Definition: motion_est.h:47
Picture::alloc_mb_width
int alloc_mb_width
mb_width used to allocate tables
Definition: mpegpicture.h:65
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:160
Picture::field_picture
int field_picture
whether or not the picture was encoded in separate fields
Definition: mpegpicture.h:72
pixdesc.h
Picture::ref_index
int8_t * ref_index[2]
Definition: mpegpicture.h:63
mpegvideo.h
Picture
Picture.
Definition: mpegpicture.h:46
AVFrame::buf
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
Definition: frame.h:588
make_tables_writable
static int make_tables_writable(Picture *pic)
Definition: mpegpicture.c:65
ThreadFrame::f
AVFrame * f
Definition: threadframe.h:28
ScratchpadContext
Definition: mpegpicture.h:36
av_pix_fmt_count_planes
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3005
Picture::needs_realloc
int needs_realloc
Picture needs to be reallocated (eg due to a frame size change)
Definition: mpegpicture.h:75
ff_mpeg_unref_picture
void ff_mpeg_unref_picture(Picture *pic)
Deallocate a picture; frees the picture tables in case they need to be reallocated anyway.
Definition: mpegpicture.c:254
alloc_picture_tables
static int alloc_picture_tables(AVCodecContext *avctx, Picture *pic, int encoding, int out_format, int mb_stride, int mb_width, int mb_height, int b8_stride)
Definition: mpegpicture.c:164
fail
#define fail()
Definition: checkasm.h:179
Picture::mbskip_table
uint8_t * mbskip_table
Definition: mpegpicture.h:60
av_noinline
#define av_noinline
Definition: attributes.h:72
motion_est.h
refstruct.h
MAX_PICTURE_COUNT
#define MAX_PICTURE_COUNT
Definition: mpegpicture.h:33
av_image_check_size2
int av_image_check_size2(unsigned int w, unsigned int h, int64_t max_pixels, enum AVPixelFormat pix_fmt, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of a plane of an image with...
Definition: imgutils.c:289
avassert.h
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
av_cold
#define av_cold
Definition: attributes.h:90
Picture::b_frame_score
int b_frame_score
Definition: mpegpicture.h:74
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:40
ff_mpv_picture_free
void av_cold ff_mpv_picture_free(Picture *pic)
Definition: mpegpicture.c:393
AVCodecContext::max_pixels
int64_t max_pixels
The number of pixels per image to maximally accept.
Definition: avcodec.h:1934
Picture::hwaccel_picture_private
void * hwaccel_picture_private
RefStruct reference for hardware accelerator private data.
Definition: mpegpicture.h:70
ff_thread_ref_frame
int ff_thread_ref_frame(ThreadFrame *dst, const ThreadFrame *src)
Definition: utils.c:850
FMT_H263
@ FMT_H263
Definition: mpegvideo.h:65
FFABS
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:73
if
if(ret)
Definition: filter_design.txt:179
Picture::reference
int reference
Definition: mpegpicture.h:77
Picture::mb_type_buf
AVBufferRef * mb_type_buf
Definition: mpegpicture.h:56
ff_find_unused_picture
int ff_find_unused_picture(AVCodecContext *avctx, Picture *picture, int shared)
Definition: mpegpicture.c:381
threadframe.h
AVERROR_PATCHWELCOME
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:64
av_buffer_unref
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
Definition: buffer.c:139
me
#define me
Definition: vf_colormatrix.c:102
ff_mpeg_ref_picture
int ff_mpeg_ref_picture(Picture *dst, Picture *src)
Definition: mpegpicture.c:305
ff_update_picture_tables
int ff_update_picture_tables(Picture *dst, const Picture *src)
Definition: mpegpicture.c:273
Picture::motion_val_buf
AVBufferRef * motion_val_buf[2]
Definition: mpegpicture.h:53
Picture::tf
ThreadFrame tf
Definition: mpegpicture.h:48
ff_thread_release_ext_buffer
void ff_thread_release_ext_buffer(ThreadFrame *f)
Unref a ThreadFrame.
Definition: pthread_frame.c:1008
f
f
Definition: af_crystalizer.c:121
Picture::display_picture_number
int display_picture_number
Definition: mpegpicture.h:80
Picture::qscale_table_buf
AVBufferRef * qscale_table_buf
Definition: mpegpicture.h:50
Picture::alloc_mb_height
int alloc_mb_height
mb_height used to allocate tables
Definition: mpegpicture.h:66
AVFrame::format
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition: frame.h:462
mpegpicture.h
Picture::motion_val
int16_t(*[2] motion_val)[2]
Definition: mpegpicture.h:54
AVBufferRef::size
size_t size
Size of data in bytes.
Definition: buffer.h:94
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
MAKE_WRITABLE
#define MAKE_WRITABLE(table)
common.h
ff_alloc_picture
int ff_alloc_picture(AVCodecContext *avctx, Picture *pic, MotionEstContext *me, ScratchpadContext *sc, int encoding, int out_format, int mb_stride, int mb_width, int mb_height, int b8_stride, ptrdiff_t *linesize, ptrdiff_t *uvlinesize)
Allocate a Picture.
Definition: mpegpicture.c:204
av_buffer_replace
int av_buffer_replace(AVBufferRef **pdst, const AVBufferRef *src)
Ensure dst refers to the same data as src.
Definition: buffer.c:233
av_buffer_is_writable
int av_buffer_is_writable(const AVBufferRef *buf)
Definition: buffer.c:147
avcodec.h
av_buffer_allocz
AVBufferRef * av_buffer_allocz(size_t size)
Same as av_buffer_alloc(), except the returned buffer will be initialized to zero.
Definition: buffer.c:93
ret
ret
Definition: filter_design.txt:187
AV_LOG_FATAL
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
Definition: log.h:174
Picture::qscale_table
int8_t * qscale_table
Definition: mpegpicture.h:51
pic_is_unused
static int pic_is_unused(Picture *pic)
Definition: mpegpicture.c:339
ff_refstruct_replace
void ff_refstruct_replace(void *dstp, const void *src)
Ensure *dstp refers to the same object as src.
Definition: refstruct.c:160
Picture::coded_picture_number
int coded_picture_number
Definition: mpegpicture.h:81
AVCodecContext
main external API structure.
Definition: avcodec.h:445
Picture::shared
int shared
Definition: mpegpicture.h:78
ScratchpadContext::edge_emu_buffer
uint8_t * edge_emu_buffer
temporary buffer for if MVs point to out-of-frame data
Definition: mpegpicture.h:37
Picture::mb_type
uint32_t * mb_type
types and macros are defined in mpegutils.h
Definition: mpegpicture.h:57
handle_pic_linesizes
static int handle_pic_linesizes(AVCodecContext *avctx, Picture *pic, MotionEstContext *me, ScratchpadContext *sc, int linesize, int uvlinesize)
Check the pic's linesize and allocate linesize dependent scratch buffers.
Definition: mpegpicture.c:128
Picture::f
struct AVFrame * f
Definition: mpegpicture.h:47
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
ref
static int ref[MAX_W *MAX_W]
Definition: jpeg2000dwt.c:112
AVCodecContext::export_side_data
int export_side_data
Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of metadata exported in frame,...
Definition: avcodec.h:1926
find_unused_picture
static int find_unused_picture(AVCodecContext *avctx, Picture *picture, int shared)
Definition: mpegpicture.c:348
mem.h
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
AV_CODEC_EXPORT_DATA_MVS
#define AV_CODEC_EXPORT_DATA_MVS
Export motion vectors through frame side data.
Definition: avcodec.h:406
FFALIGN
#define FFALIGN(x, a)
Definition: macros.h:78
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
imgutils.h
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:420
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
Picture::mbskip_table_buf
AVBufferRef * mbskip_table_buf
Definition: mpegpicture.h:59
ScratchpadContext::b_scratchpad
uint8_t * b_scratchpad
scratchpad used for writing into write only buffers
Definition: mpegpicture.h:40
ff_refstruct_unref
void ff_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
Definition: refstruct.c:120
Picture::alloc_mb_stride
int alloc_mb_stride
mb_stride used to allocate tables
Definition: mpegpicture.h:67
make_table_writable
static int make_table_writable(AVBufferRef **ref)
Definition: mpegpicture.c:51