FFmpeg  2.8.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
wmv2dec.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002 The FFmpeg Project
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 "avcodec.h"
22 #include "h263.h"
23 #include "internal.h"
24 #include "intrax8.h"
25 #include "mathops.h"
26 #include "mpegutils.h"
27 #include "mpegvideo.h"
28 #include "msmpeg4.h"
29 #include "msmpeg4data.h"
30 #include "wmv2.h"
31 
32 
33 static int parse_mb_skip(Wmv2Context *w)
34 {
35  int mb_x, mb_y;
36  MpegEncContext *const s = &w->s;
37  uint32_t *const mb_type = s->current_picture_ptr->mb_type;
38 
39  w->skip_type = get_bits(&s->gb, 2);
40  switch (w->skip_type) {
41  case SKIP_TYPE_NONE:
42  for (mb_y = 0; mb_y < s->mb_height; mb_y++)
43  for (mb_x = 0; mb_x < s->mb_width; mb_x++)
44  mb_type[mb_y * s->mb_stride + mb_x] =
46  break;
47  case SKIP_TYPE_MPEG:
48  if (get_bits_left(&s->gb) < s->mb_height * s->mb_width)
49  return AVERROR_INVALIDDATA;
50  for (mb_y = 0; mb_y < s->mb_height; mb_y++)
51  for (mb_x = 0; mb_x < s->mb_width; mb_x++)
52  mb_type[mb_y * s->mb_stride + mb_x] =
54  break;
55  case SKIP_TYPE_ROW:
56  for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
57  if (get_bits_left(&s->gb) < 1)
58  return AVERROR_INVALIDDATA;
59  if (get_bits1(&s->gb)) {
60  for (mb_x = 0; mb_x < s->mb_width; mb_x++)
61  mb_type[mb_y * s->mb_stride + mb_x] =
63  } else {
64  for (mb_x = 0; mb_x < s->mb_width; mb_x++)
65  mb_type[mb_y * s->mb_stride + mb_x] =
67  }
68  }
69  break;
70  case SKIP_TYPE_COL:
71  for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
72  if (get_bits_left(&s->gb) < 1)
73  return AVERROR_INVALIDDATA;
74  if (get_bits1(&s->gb)) {
75  for (mb_y = 0; mb_y < s->mb_height; mb_y++)
76  mb_type[mb_y * s->mb_stride + mb_x] =
78  } else {
79  for (mb_y = 0; mb_y < s->mb_height; mb_y++)
80  mb_type[mb_y * s->mb_stride + mb_x] =
82  }
83  }
84  break;
85  }
86  return 0;
87 }
88 
90 {
91  MpegEncContext *const s = &w->s;
92  GetBitContext gb;
93  int fps;
94  int code;
95 
96  if (s->avctx->extradata_size < 4)
97  return AVERROR_INVALIDDATA;
98 
99  init_get_bits(&gb, s->avctx->extradata, 32);
100 
101  fps = get_bits(&gb, 5);
102  s->bit_rate = get_bits(&gb, 11) * 1024;
103  w->mspel_bit = get_bits1(&gb);
104  s->loop_filter = get_bits1(&gb);
105  w->abt_flag = get_bits1(&gb);
106  w->j_type_bit = get_bits1(&gb);
107  w->top_left_mv_flag = get_bits1(&gb);
108  w->per_mb_rl_bit = get_bits1(&gb);
109  code = get_bits(&gb, 3);
110 
111  if (code == 0)
112  return AVERROR_INVALIDDATA;
113 
114  s->slice_height = s->mb_height / code;
115 
116  if (s->avctx->debug & FF_DEBUG_PICT_INFO)
118  "fps:%d, br:%"PRId64", qpbit:%d, abt_flag:%d, j_type_bit:%d, "
119  "tl_mv_flag:%d, mbrl_bit:%d, code:%d, loop_filter:%d, "
120  "slices:%d\n",
121  fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit,
122  w->top_left_mv_flag, w->per_mb_rl_bit, code, s->loop_filter,
123  code);
124  return 0;
125 }
126 
128 {
129  Wmv2Context *const w = (Wmv2Context *) s;
130  int code;
131 
132  if (s->picture_number == 0)
134 
135  s->pict_type = get_bits1(&s->gb) + 1;
136  if (s->pict_type == AV_PICTURE_TYPE_I) {
137  code = get_bits(&s->gb, 7);
138  av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code);
139  }
140  s->chroma_qscale = s->qscale = get_bits(&s->gb, 5);
141  if (s->qscale <= 0)
142  return AVERROR_INVALIDDATA;
143 
144  return 0;
145 }
146 
148 {
149  Wmv2Context *const w = (Wmv2Context *) s;
150 
151  if (s->pict_type == AV_PICTURE_TYPE_I) {
152  if (w->j_type_bit)
153  w->j_type = get_bits1(&s->gb);
154  else
155  w->j_type = 0; // FIXME check
156 
157  if (!w->j_type) {
158  if (w->per_mb_rl_bit)
159  s->per_mb_rl_table = get_bits1(&s->gb);
160  else
161  s->per_mb_rl_table = 0;
162 
163  if (!s->per_mb_rl_table) {
165  s->rl_table_index = decode012(&s->gb);
166  }
167 
168  s->dc_table_index = get_bits1(&s->gb);
169  }
170  s->inter_intra_pred = 0;
171  s->no_rounding = 1;
172  if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
174  "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n",
177  }
178  } else {
179  int cbp_index;
180  int ret;
181  w->j_type = 0;
182 
183  ret = parse_mb_skip(w);
184  if (ret < 0)
185  return ret;
186  cbp_index = decode012(&s->gb);
187  w->cbp_table_index = wmv2_get_cbp_table_index(s, cbp_index);
188 
189  if (w->mspel_bit)
190  s->mspel = get_bits1(&s->gb);
191  else
192  s->mspel = 0; // FIXME check
193 
194  if (w->abt_flag) {
195  w->per_mb_abt = get_bits1(&s->gb) ^ 1;
196  if (!w->per_mb_abt)
197  w->abt_type = decode012(&s->gb);
198  }
199 
200  if (w->per_mb_rl_bit)
201  s->per_mb_rl_table = get_bits1(&s->gb);
202  else
203  s->per_mb_rl_table = 0;
204 
205  if (!s->per_mb_rl_table) {
206  s->rl_table_index = decode012(&s->gb);
208  }
209 
210  s->dc_table_index = get_bits1(&s->gb);
211  s->mv_table_index = get_bits1(&s->gb);
212 
213  s->inter_intra_pred = 0; // (s->width * s->height < 320 * 240 && s->bit_rate <= II_BITRATE);
214  s->no_rounding ^= 1;
215 
216  if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
218  "rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d "
219  "per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n",
222  s->per_mb_rl_table, s->qscale, s->mspel,
224  s->inter_intra_pred);
225  }
226  }
227  s->esc3_level_length = 0;
228  s->esc3_run_length = 0;
229  s->picture_number++; // FIXME ?
230 
231  if (w->j_type) {
232  ff_intrax8_decode_picture(&w->x8, 2 * s->qscale, (s->qscale - 1) | 1);
233  return 1;
234  }
235 
236  return 0;
237 }
238 
239 static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr)
240 {
241  MpegEncContext *const s = &w->s;
242  int ret;
243 
244  ret = ff_msmpeg4_decode_motion(s, mx_ptr, my_ptr);
245 
246  if (ret < 0)
247  return ret;
248 
249  if ((((*mx_ptr) | (*my_ptr)) & 1) && s->mspel)
250  w->hshift = get_bits1(&s->gb);
251  else
252  w->hshift = 0;
253 
254  return 0;
255 }
256 
257 static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py)
258 {
259  MpegEncContext *const s = &w->s;
260  int xy, wrap, diff, type;
261  int16_t *A, *B, *C, *mot_val;
262 
263  wrap = s->b8_stride;
264  xy = s->block_index[0];
265 
266  mot_val = s->current_picture.motion_val[0][xy];
267 
268  A = s->current_picture.motion_val[0][xy - 1];
269  B = s->current_picture.motion_val[0][xy - wrap];
270  C = s->current_picture.motion_val[0][xy + 2 - wrap];
271 
272  if (s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag)
273  diff = FFMAX(FFABS(A[0] - B[0]), FFABS(A[1] - B[1]));
274  else
275  diff = 0;
276 
277  if (diff >= 8)
278  type = get_bits1(&s->gb);
279  else
280  type = 2;
281 
282  if (type == 0) {
283  *px = A[0];
284  *py = A[1];
285  } else if (type == 1) {
286  *px = B[0];
287  *py = B[1];
288  } else {
289  /* special case for first (slice) line */
290  if (s->first_slice_line) {
291  *px = A[0];
292  *py = A[1];
293  } else {
294  *px = mid_pred(A[0], B[0], C[0]);
295  *py = mid_pred(A[1], B[1], C[1]);
296  }
297  }
298 
299  return mot_val;
300 }
301 
302 static inline int wmv2_decode_inter_block(Wmv2Context *w, int16_t *block,
303  int n, int cbp)
304 {
305  MpegEncContext *const s = &w->s;
306  static const int sub_cbp_table[3] = { 2, 3, 1 };
307  int sub_cbp, ret;
308 
309  if (!cbp) {
310  s->block_last_index[n] = -1;
311  return 0;
312  }
313 
314  if (w->per_block_abt)
315  w->abt_type = decode012(&s->gb);
316  w->abt_type_table[n] = w->abt_type;
317 
318  if (w->abt_type) {
319 // const uint8_t *scantable = w->abt_scantable[w->abt_type - 1].permutated;
320  const uint8_t *scantable = w->abt_scantable[w->abt_type - 1].scantable;
321 // const uint8_t *scantable = w->abt_type - 1 ? w->abt_scantable[1].permutated : w->abt_scantable[0].scantable;
322 
323  sub_cbp = sub_cbp_table[decode012(&s->gb)];
324 
325  if (sub_cbp & 1)
326  if ((ret = ff_msmpeg4_decode_block(s, block, n, 1, scantable)) < 0)
327  return ret;
328 
329  if (sub_cbp & 2)
330  if ((ret = ff_msmpeg4_decode_block(s, w->abt_block2[n], n, 1, scantable)) < 0)
331  return ret;
332 
333  s->block_last_index[n] = 63;
334 
335  return 0;
336  } else {
337  return ff_msmpeg4_decode_block(s, block, n, 1,
339  }
340 }
341 
343 {
344  Wmv2Context *const w = (Wmv2Context *) s;
345  int cbp, code, i, ret;
346  uint8_t *coded_val;
347 
348  if (w->j_type)
349  return 0;
350 
351  if (s->pict_type == AV_PICTURE_TYPE_P) {
352  if (IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])) {
353  /* skip mb */
354  s->mb_intra = 0;
355  for (i = 0; i < 6; i++)
356  s->block_last_index[i] = -1;
357  s->mv_dir = MV_DIR_FORWARD;
358  s->mv_type = MV_TYPE_16X16;
359  s->mv[0][0][0] = 0;
360  s->mv[0][0][1] = 0;
361  s->mb_skipped = 1;
362  w->hshift = 0;
363  return 0;
364  }
365  if (get_bits_left(&s->gb) <= 0)
366  return AVERROR_INVALIDDATA;
367 
370  if (code < 0)
371  return AVERROR_INVALIDDATA;
372  s->mb_intra = (~code & 0x40) >> 6;
373 
374  cbp = code & 0x3f;
375  } else {
376  s->mb_intra = 1;
377  if (get_bits_left(&s->gb) <= 0)
378  return AVERROR_INVALIDDATA;
380  if (code < 0) {
382  "II-cbp illegal at %d %d\n", s->mb_x, s->mb_y);
383  return AVERROR_INVALIDDATA;
384  }
385  /* predict coded block pattern */
386  cbp = 0;
387  for (i = 0; i < 6; i++) {
388  int val = ((code >> (5 - i)) & 1);
389  if (i < 4) {
390  int pred = ff_msmpeg4_coded_block_pred(s, i, &coded_val);
391  val = val ^ pred;
392  *coded_val = val;
393  }
394  cbp |= val << (5 - i);
395  }
396  }
397 
398  if (!s->mb_intra) {
399  int mx, my;
400  wmv2_pred_motion(w, &mx, &my);
401 
402  if (cbp) {
403  s->bdsp.clear_blocks(s->block[0]);
404  if (s->per_mb_rl_table) {
405  s->rl_table_index = decode012(&s->gb);
407  }
408 
409  if (w->abt_flag && w->per_mb_abt) {
410  w->per_block_abt = get_bits1(&s->gb);
411  if (!w->per_block_abt)
412  w->abt_type = decode012(&s->gb);
413  } else
414  w->per_block_abt = 0;
415  }
416 
417  if ((ret = wmv2_decode_motion(w, &mx, &my)) < 0)
418  return ret;
419 
420  s->mv_dir = MV_DIR_FORWARD;
421  s->mv_type = MV_TYPE_16X16;
422  s->mv[0][0][0] = mx;
423  s->mv[0][0][1] = my;
424 
425  for (i = 0; i < 6; i++) {
426  if ((ret = wmv2_decode_inter_block(w, block[i], i, (cbp >> (5 - i)) & 1)) < 0) {
428  "\nerror while decoding inter block: %d x %d (%d)\n",
429  s->mb_x, s->mb_y, i);
430  return ret;
431  }
432  }
433  } else {
434  if (s->pict_type == AV_PICTURE_TYPE_P)
435  ff_dlog(s->avctx, "%d%d ", s->inter_intra_pred, cbp);
436  ff_dlog(s->avctx, "I at %d %d %d %06X\n", s->mb_x, s->mb_y,
437  ((cbp & 3) ? 1 : 0) + ((cbp & 0x3C) ? 2 : 0),
438  show_bits(&s->gb, 24));
439  s->ac_pred = get_bits1(&s->gb);
440  if (s->inter_intra_pred) {
443  ff_dlog(s->avctx, "%d%d %d %d/",
444  s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
445  }
446  if (s->per_mb_rl_table && cbp) {
447  s->rl_table_index = decode012(&s->gb);
449  }
450 
451  s->bdsp.clear_blocks(s->block[0]);
452  for (i = 0; i < 6; i++) {
453  if ((ret = ff_msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL)) < 0) {
455  "\nerror while decoding intra block: %d x %d (%d)\n",
456  s->mb_x, s->mb_y, i);
457  return ret;
458  }
459  }
460  }
461 
462  return 0;
463 }
464 
466 {
467  Wmv2Context *const w = avctx->priv_data;
468  int ret;
469 
470 #if FF_API_EMU_EDGE
471  avctx->flags |= CODEC_FLAG_EMU_EDGE;
472 #endif
473 
474  if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
475  return ret;
476 
478 
479  ff_intrax8_common_init(&w->x8, &w->s);
480 
481  return 0;
482 }
483 
485 {
486  Wmv2Context *w = avctx->priv_data;
487 
489  return ff_h263_decode_end(avctx);
490 }
491 
493  .name = "wmv2",
494  .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"),
495  .type = AVMEDIA_TYPE_VIDEO,
496  .id = AV_CODEC_ID_WMV2,
497  .priv_data_size = sizeof(Wmv2Context),
499  .close = wmv2_decode_end,
502  .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
503  AV_PIX_FMT_NONE },
504 };
static av_cold int wmv2_decode_init(AVCodecContext *avctx)
Definition: wmv2dec.c:465
int inter_intra_pred
Definition: mpegvideo.h:447
int j_type_bit
Definition: wmv2.h:39
#define NULL
Definition: coverity.c:32
#define MB_TYPE_SKIP
Definition: avcodec.h:1152
const char const char void * val
Definition: avisynth_c.h:634
int picture_number
Definition: mpegvideo.h:134
const char * s
Definition: avisynth_c.h:631
#define SKIP_TYPE_COL
Definition: wmv2.h:32
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
static av_always_inline int wmv2_get_cbp_table_index(MpegEncContext *s, int cbp_index)
Definition: wmv2.h:74
int esc3_level_length
Definition: mpegvideo.h:443
static av_cold int wmv2_decode_end(AVCodecContext *avctx)
Definition: wmv2dec.c:484
int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
Definition: wmv2dec.c:342
#define C
int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
Definition: wmv2dec.c:147
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:261
int ff_msmpeg4_decode_init(AVCodecContext *avctx)
Definition: msmpeg4dec.c:299
int16_t abt_block2[6][64]
Definition: wmv2.h:54
static int wmv2_decode_inter_block(Wmv2Context *w, int16_t *block, int n, int cbp)
Definition: wmv2dec.c:302
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
int per_mb_abt
Definition: wmv2.h:44
void(* clear_blocks)(int16_t *blocks)
Definition: blockdsp.h:36
static int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr)
Definition: wmv2dec.c:239
static int decode_ext_header(Wmv2Context *w)
Definition: wmv2dec.c:89
int abt_type_table[6]
Definition: wmv2.h:43
mpegvideo header.
int per_mb_rl_bit
Definition: wmv2.h:49
uint8_t permutated[64]
Definition: idctdsp.h:31
AVCodec.
Definition: avcodec.h:3482
#define MB_NON_INTRA_VLC_BITS
Definition: msmpeg4.h:34
int qscale
QP.
Definition: mpegvideo.h:211
int esc3_run_length
Definition: mpegvideo.h:444
uint8_t
#define av_cold
Definition: attributes.h:74
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1627
int no_rounding
apply no rounding to motion compensation (MPEG4, msmpeg4, ...) for b-frames rounding mode is always 0...
Definition: mpegvideo.h:292
Picture current_picture
copy of the current picture structure.
Definition: mpegvideo.h:187
int ff_msmpeg4_decode_motion(MpegEncContext *s, int *mx_ptr, int *my_ptr)
Definition: msmpeg4dec.c:891
MSMPEG4 data tables.
#define ff_dlog(a,...)
const uint8_t * scantable
Definition: idctdsp.h:30
int mb_height
number of MBs horizontally & vertically
Definition: mpegvideo.h:136
MpegEncContext s
Definition: wmv2.h:36
#define A(x)
Definition: vp56_arith.h:28
#define av_log(a,...)
static int get_bits_left(GetBitContext *gb)
Definition: get_bits.h:594
int ff_wmv2_decode_picture_header(MpegEncContext *s)
Definition: wmv2dec.c:127
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
int rl_chroma_table_index
Definition: mpegvideo.h:435
int mb_skipped
MUST BE SET only during DECODING.
Definition: mpegvideo.h:202
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:178
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:197
int per_mb_rl_table
Definition: mpegvideo.h:442
int flags
AV_CODEC_FLAG_*.
Definition: avcodec.h:1607
#define wrap(func)
Definition: neontest.h:62
const char * name
Name of the codec implementation.
Definition: avcodec.h:3489
#define IS_SKIP(a)
Definition: mpegutils.h:77
AVCodec ff_wmv2_decoder
Definition: wmv2dec.c:492
GetBitContext gb
Definition: mpegvideo.h:451
#define FFMAX(a, b)
Definition: common.h:90
Libavcodec external API header.
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: h263dec.c:409
#define AV_CODEC_CAP_DRAW_HORIZ_BAND
Decoder can use draw_horiz_band callback.
Definition: avcodec.h:851
av_cold void ff_intrax8_common_init(IntraX8Context *w, MpegEncContext *const s)
Initialize IntraX8 frame decoder.
Definition: intrax8.c:692
av_cold void ff_intrax8_common_end(IntraX8Context *w)
Destroy IntraX8 frame structure.
Definition: intrax8.c:714
static int parse_mb_skip(Wmv2Context *w)
Definition: wmv2dec.c:33
int16_t(*[2] motion_val)[2]
Definition: mpegpicture.h:53
Picture * current_picture_ptr
pointer to the current picture
Definition: mpegvideo.h:191
ScanTable abt_scantable[2]
Definition: wmv2.h:53
int abt_type
Definition: wmv2.h:42
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
Definition: get_bits.h:288
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:68
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
Definition: get_bits.h:561
int block_last_index[12]
last non zero coefficient in block
Definition: mpegvideo.h:93
int n
Definition: avisynth_c.h:547
static int16_t * wmv2_pred_motion(Wmv2Context *w, int *px, int *py)
Definition: wmv2dec.c:257
int block_index[6]
index to current MB in block based arrays with edges
Definition: mpegvideo.h:301
static const float pred[4]
Definition: siprdata.h:259
#define MV_TYPE_16X16
1 vector for the whole mb
Definition: mpegvideo.h:274
int first_slice_line
used in mpeg4 too to handle resync markers
Definition: mpegvideo.h:439
int abt_flag
Definition: wmv2.h:41
#define SKIP_TYPE_MPEG
Definition: wmv2.h:30
BlockDSPContext bdsp
Definition: mpegvideo.h:233
int cbp_table_index
Definition: wmv2.h:47
int debug
debug
Definition: avcodec.h:2852
main external API structure.
Definition: avcodec.h:1512
VLC ff_inter_intra_vlc
Definition: msmpeg4dec.c:71
int skip_type
Definition: wmv2.h:50
GLint GLenum type
Definition: opengl_enc.c:105
int extradata_size
Definition: avcodec.h:1628
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:305
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:415
#define MB_INTRA_VLC_BITS
Definition: msmpeg4.h:35
int slice_height
in macroblocks
Definition: mpegvideo.h:438
#define MB_TYPE_16x16
Definition: avcodec.h:1144
#define mid_pred
Definition: mathops.h:95
int ff_intrax8_decode_picture(IntraX8Context *const w, int dquant, int quant_offset)
Decode single IntraX8 frame.
Definition: intrax8.c:730
#define MV_DIR_FORWARD
Definition: mpegvideo.h:270
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
Definition: mpegvideo.h:219
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:245
#define FF_DEBUG_PICT_INFO
Definition: avcodec.h:2853
int mv[2][4][2]
motion vectors for a macroblock first coordinate : 0 = forward 1 = backward second " : depend...
Definition: mpegvideo.h:284
int b8_stride
2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
Definition: mpegvideo.h:138
MpegEncContext.
Definition: mpegvideo.h:88
struct AVCodecContext * avctx
Definition: mpegvideo.h:105
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
Definition: ccaption_dec.c:521
#define SKIP_TYPE_NONE
Definition: wmv2.h:29
#define CODEC_FLAG_EMU_EDGE
Definition: avcodec.h:985
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:63
common internal api header.
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 ...
Definition: mpegvideo.h:137
if(ret< 0)
Definition: vf_mcdeint.c:280
VLC ff_mb_non_intra_vlc[4]
Definition: msmpeg4dec.c:65
int per_block_abt
Definition: wmv2.h:45
int ff_h263_decode_end(AVCodecContext *avctx)
Definition: h263dec.c:149
void * priv_data
Definition: avcodec.h:1554
int hshift
Definition: wmv2.h:51
static av_always_inline int diff(const uint32_t a, const uint32_t b)
Definition: vf_geq.c:46
IntraX8Context x8
Definition: wmv2.h:37
av_cold void ff_wmv2_common_init(Wmv2Context *w)
Definition: wmv2.c:30
int16_t(* block)[64]
points to one of the following blocks
Definition: mpegvideo.h:500
static int decode012(GetBitContext *gb)
Definition: get_bits.h:576
VLC_TYPE(* table)[2]
code, bits
Definition: get_bits.h:66
int64_t bit_rate
wanted bit rate
Definition: mpegvideo.h:110
int rl_table_index
Definition: mpegvideo.h:434
int chroma_qscale
chroma QP
Definition: mpegvideo.h:212
int ff_msmpeg4_decode_block(MpegEncContext *s, int16_t *block, int n, int coded, const uint8_t *scan_table)
Definition: msmpeg4dec.c:654
int mspel_bit
Definition: wmv2.h:46
#define INTER_INTRA_VLC_BITS
Definition: msmpeg4.h:33
uint32_t * mb_type
types and macros are defined in mpegutils.h
Definition: mpegpicture.h:56
VLC ff_msmp4_mb_i_vlc
Definition: msmpeg4data.c:38
ScanTable inter_scantable
if inter == intra then intra should be used to reduce tha cache usage
Definition: mpegvideo.h:97
int ff_msmpeg4_coded_block_pred(MpegEncContext *s, int n, uint8_t **coded_block_ptr)
Definition: msmpeg4.c:153
#define SKIP_TYPE_ROW
Definition: wmv2.h:31
int mv_table_index
Definition: mpegvideo.h:433
int h263_aic_dir
AIC direction: 0 = left, 1 = top.
Definition: mpegvideo.h:383
AVPixelFormat
Pixel format.
Definition: pixfmt.h:61
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:857
int dc_table_index
Definition: mpegvideo.h:436
#define MB_TYPE_L0
Definition: avcodec.h:1157
Predicted.
Definition: avutil.h:267
int top_left_mv_flag
Definition: wmv2.h:48
int j_type
Definition: wmv2.h:40
static int16_t block[64]
Definition: dct-test.c:110