Libav
wmv2dec.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002 The Libav Project
3  *
4  * This file is part of Libav.
5  *
6  * Libav 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  * Libav 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 Libav; 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 void 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  for (mb_y = 0; mb_y < s->mb_height; mb_y++)
49  for (mb_x = 0; mb_x < s->mb_width; mb_x++)
50  mb_type[mb_y * s->mb_stride + mb_x] =
52  break;
53  case SKIP_TYPE_ROW:
54  for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
55  if (get_bits1(&s->gb)) {
56  for (mb_x = 0; mb_x < s->mb_width; mb_x++)
57  mb_type[mb_y * s->mb_stride + mb_x] =
59  } else {
60  for (mb_x = 0; mb_x < s->mb_width; mb_x++)
61  mb_type[mb_y * s->mb_stride + mb_x] =
63  }
64  }
65  break;
66  case SKIP_TYPE_COL:
67  for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
68  if (get_bits1(&s->gb)) {
69  for (mb_y = 0; mb_y < s->mb_height; mb_y++)
70  mb_type[mb_y * s->mb_stride + mb_x] =
72  } else {
73  for (mb_y = 0; mb_y < s->mb_height; mb_y++)
74  mb_type[mb_y * s->mb_stride + mb_x] =
76  }
77  }
78  break;
79  }
80 }
81 
83 {
84  MpegEncContext *const s = &w->s;
85  GetBitContext gb;
86  int fps;
87  int code;
88 
89  if (s->avctx->extradata_size < 4)
90  return AVERROR_INVALIDDATA;
91 
92  init_get_bits(&gb, s->avctx->extradata, 32);
93 
94  fps = get_bits(&gb, 5);
95  s->bit_rate = get_bits(&gb, 11) * 1024;
96  w->mspel_bit = get_bits1(&gb);
97  s->loop_filter = get_bits1(&gb);
98  w->abt_flag = get_bits1(&gb);
99  w->j_type_bit = get_bits1(&gb);
100  w->top_left_mv_flag = get_bits1(&gb);
101  w->per_mb_rl_bit = get_bits1(&gb);
102  code = get_bits(&gb, 3);
103 
104  if (code == 0)
105  return AVERROR_INVALIDDATA;
106 
107  s->slice_height = s->mb_height / code;
108 
109  if (s->avctx->debug & FF_DEBUG_PICT_INFO)
111  "fps:%d, br:%d, qpbit:%d, abt_flag:%d, j_type_bit:%d, "
112  "tl_mv_flag:%d, mbrl_bit:%d, code:%d, loop_filter:%d, "
113  "slices:%d\n",
114  fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit,
115  w->top_left_mv_flag, w->per_mb_rl_bit, code, s->loop_filter,
116  code);
117  return 0;
118 }
119 
121 {
122  Wmv2Context *const w = (Wmv2Context *) s;
123  int code;
124 
125  if (s->picture_number == 0)
127 
128  s->pict_type = get_bits1(&s->gb) + 1;
129  if (s->pict_type == AV_PICTURE_TYPE_I) {
130  code = get_bits(&s->gb, 7);
131  av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code);
132  }
133  s->chroma_qscale = s->qscale = get_bits(&s->gb, 5);
134  if (s->qscale <= 0)
135  return AVERROR_INVALIDDATA;
136 
137  return 0;
138 }
139 
141 {
142  Wmv2Context *const w = (Wmv2Context *) s;
143 
144  if (s->pict_type == AV_PICTURE_TYPE_I) {
145  if (w->j_type_bit)
146  w->j_type = get_bits1(&s->gb);
147  else
148  w->j_type = 0; // FIXME check
149 
150  if (!w->j_type) {
151  if (w->per_mb_rl_bit)
152  s->per_mb_rl_table = get_bits1(&s->gb);
153  else
154  s->per_mb_rl_table = 0;
155 
156  if (!s->per_mb_rl_table) {
158  s->rl_table_index = decode012(&s->gb);
159  }
160 
161  s->dc_table_index = get_bits1(&s->gb);
162  }
163  s->inter_intra_pred = 0;
164  s->no_rounding = 1;
165  if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
167  "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n",
170  }
171  } else {
172  int cbp_index;
173  w->j_type = 0;
174 
175  parse_mb_skip(w);
176  cbp_index = decode012(&s->gb);
177  if (s->qscale <= 10) {
178  int map[3] = { 0, 2, 1 };
179  w->cbp_table_index = map[cbp_index];
180  } else if (s->qscale <= 20) {
181  int map[3] = { 1, 0, 2 };
182  w->cbp_table_index = map[cbp_index];
183  } else {
184  int map[3] = {2,1,0};
185  w->cbp_table_index = map[cbp_index];
186  }
187 
188  if (w->mspel_bit)
189  s->mspel = get_bits1(&s->gb);
190  else
191  s->mspel = 0; // FIXME check
192 
193  if (w->abt_flag) {
194  w->per_mb_abt = get_bits1(&s->gb) ^ 1;
195  if (!w->per_mb_abt)
196  w->abt_type = decode012(&s->gb);
197  }
198 
199  if (w->per_mb_rl_bit)
200  s->per_mb_rl_table = get_bits1(&s->gb);
201  else
202  s->per_mb_rl_table = 0;
203 
204  if (!s->per_mb_rl_table) {
205  s->rl_table_index = decode012(&s->gb);
207  }
208 
209  s->dc_table_index = get_bits1(&s->gb);
210  s->mv_table_index = get_bits1(&s->gb);
211 
212  s->inter_intra_pred = 0; // (s->width * s->height < 320 * 240 && s->bit_rate <= II_BITRATE);
213  s->no_rounding ^= 1;
214 
215  if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
217  "rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d "
218  "per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n",
221  s->per_mb_rl_table, s->qscale, s->mspel,
223  s->inter_intra_pred);
224  }
225  }
226  s->esc3_level_length = 0;
227  s->esc3_run_length = 0;
228  s->picture_number++; // FIXME ?
229 
230  if (w->j_type) {
232  &s->gb, &s->mb_x, &s->mb_y,
233  2 * s->qscale, (s->qscale - 1) | 1,
234  s->loop_filter, s->low_delay);
235 
236  ff_er_add_slice(&w->s.er, 0, 0,
237  (w->s.mb_x >> 1) - 1, (w->s.mb_y >> 1) - 1,
238  ER_MB_END);
239  return 1;
240  }
241 
242  return 0;
243 }
244 
245 static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr)
246 {
247  MpegEncContext *const s = &w->s;
248  int ret;
249 
250  ret = ff_msmpeg4_decode_motion(s, mx_ptr, my_ptr);
251 
252  if (ret < 0)
253  return ret;
254 
255  if ((((*mx_ptr) | (*my_ptr)) & 1) && s->mspel)
256  w->hshift = get_bits1(&s->gb);
257  else
258  w->hshift = 0;
259 
260  return 0;
261 }
262 
263 static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py)
264 {
265  MpegEncContext *const s = &w->s;
266  int xy, wrap, diff, type;
267  int16_t *A, *B, *C, *mot_val;
268 
269  wrap = s->b8_stride;
270  xy = s->block_index[0];
271 
272  mot_val = s->current_picture.motion_val[0][xy];
273 
274  A = s->current_picture.motion_val[0][xy - 1];
275  B = s->current_picture.motion_val[0][xy - wrap];
276  C = s->current_picture.motion_val[0][xy + 2 - wrap];
277 
278  if (s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag)
279  diff = FFMAX(FFABS(A[0] - B[0]), FFABS(A[1] - B[1]));
280  else
281  diff = 0;
282 
283  if (diff >= 8)
284  type = get_bits1(&s->gb);
285  else
286  type = 2;
287 
288  if (type == 0) {
289  *px = A[0];
290  *py = A[1];
291  } else if (type == 1) {
292  *px = B[0];
293  *py = B[1];
294  } else {
295  /* special case for first (slice) line */
296  if (s->first_slice_line) {
297  *px = A[0];
298  *py = A[1];
299  } else {
300  *px = mid_pred(A[0], B[0], C[0]);
301  *py = mid_pred(A[1], B[1], C[1]);
302  }
303  }
304 
305  return mot_val;
306 }
307 
308 static inline int wmv2_decode_inter_block(Wmv2Context *w, int16_t *block,
309  int n, int cbp)
310 {
311  MpegEncContext *const s = &w->s;
312  static const int sub_cbp_table[3] = { 2, 3, 1 };
313  int sub_cbp, ret;
314 
315  if (!cbp) {
316  s->block_last_index[n] = -1;
317  return 0;
318  }
319 
320  if (w->per_block_abt)
321  w->abt_type = decode012(&s->gb);
322  w->abt_type_table[n] = w->abt_type;
323 
324  if (w->abt_type) {
325 // const uint8_t *scantable = w->abt_scantable[w->abt_type - 1].permutated;
326  const uint8_t *scantable = w->abt_scantable[w->abt_type - 1].scantable;
327 // const uint8_t *scantable = w->abt_type - 1 ? w->abt_scantable[1].permutated : w->abt_scantable[0].scantable;
328 
329  sub_cbp = sub_cbp_table[decode012(&s->gb)];
330 
331  if (sub_cbp & 1)
332  if ((ret = ff_msmpeg4_decode_block(s, block, n, 1, scantable)) < 0)
333  return ret;
334 
335  if (sub_cbp & 2)
336  if ((ret = ff_msmpeg4_decode_block(s, w->abt_block2[n], n, 1, scantable)) < 0)
337  return ret;
338 
339  s->block_last_index[n] = 63;
340 
341  return 0;
342  } else {
343  return ff_msmpeg4_decode_block(s, block, n, 1,
345  }
346 }
347 
348 int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
349 {
350  Wmv2Context *const w = (Wmv2Context *) s;
351  int cbp, code, i, ret;
352  uint8_t *coded_val;
353 
354  if (w->j_type)
355  return 0;
356 
357  if (s->pict_type == AV_PICTURE_TYPE_P) {
358  if (IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])) {
359  /* skip mb */
360  s->mb_intra = 0;
361  for (i = 0; i < 6; i++)
362  s->block_last_index[i] = -1;
363  s->mv_dir = MV_DIR_FORWARD;
364  s->mv_type = MV_TYPE_16X16;
365  s->mv[0][0][0] = 0;
366  s->mv[0][0][1] = 0;
367  s->mb_skipped = 1;
368  w->hshift = 0;
369  return 0;
370  }
371 
374  if (code < 0)
375  return AVERROR_INVALIDDATA;
376  s->mb_intra = (~code & 0x40) >> 6;
377 
378  cbp = code & 0x3f;
379  } else {
380  s->mb_intra = 1;
382  if (code < 0) {
384  "II-cbp illegal at %d %d\n", s->mb_x, s->mb_y);
385  return AVERROR_INVALIDDATA;
386  }
387  /* predict coded block pattern */
388  cbp = 0;
389  for (i = 0; i < 6; i++) {
390  int val = ((code >> (5 - i)) & 1);
391  if (i < 4) {
392  int pred = ff_msmpeg4_coded_block_pred(s, i, &coded_val);
393  val = val ^ pred;
394  *coded_val = val;
395  }
396  cbp |= val << (5 - i);
397  }
398  }
399 
400  if (!s->mb_intra) {
401  int mx, my;
402  wmv2_pred_motion(w, &mx, &my);
403 
404  if (cbp) {
405  s->bdsp.clear_blocks(s->block[0]);
406  if (s->per_mb_rl_table) {
407  s->rl_table_index = decode012(&s->gb);
409  }
410 
411  if (w->abt_flag && w->per_mb_abt) {
412  w->per_block_abt = get_bits1(&s->gb);
413  if (!w->per_block_abt)
414  w->abt_type = decode012(&s->gb);
415  } else
416  w->per_block_abt = 0;
417  }
418 
419  if ((ret = wmv2_decode_motion(w, &mx, &my)) < 0)
420  return ret;
421 
422  s->mv_dir = MV_DIR_FORWARD;
423  s->mv_type = MV_TYPE_16X16;
424  s->mv[0][0][0] = mx;
425  s->mv[0][0][1] = my;
426 
427  for (i = 0; i < 6; i++) {
428  if ((ret = wmv2_decode_inter_block(w, block[i], i, (cbp >> (5 - i)) & 1)) < 0) {
430  "\nerror while decoding inter block: %d x %d (%d)\n",
431  s->mb_x, s->mb_y, i);
432  return ret;
433  }
434  }
435  } else {
436  if (s->pict_type == AV_PICTURE_TYPE_P)
437  ff_dlog(s->avctx, "%d%d ", s->inter_intra_pred, cbp);
438  ff_dlog(s->avctx, "I at %d %d %d %06X\n", s->mb_x, s->mb_y,
439  ((cbp & 3) ? 1 : 0) + ((cbp & 0x3C) ? 2 : 0),
440  show_bits(&s->gb, 24));
441  s->ac_pred = get_bits1(&s->gb);
442  if (s->inter_intra_pred) {
445  ff_dlog(s->avctx, "%d%d %d %d/",
446  s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
447  }
448  if (s->per_mb_rl_table && cbp) {
449  s->rl_table_index = decode012(&s->gb);
451  }
452 
453  s->bdsp.clear_blocks(s->block[0]);
454  for (i = 0; i < 6; i++) {
455  if ((ret = ff_msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL)) < 0) {
457  "\nerror while decoding intra block: %d x %d (%d)\n",
458  s->mb_x, s->mb_y, i);
459  return ret;
460  }
461  }
462  }
463 
464  return 0;
465 }
466 
468 {
469  Wmv2Context *const w = avctx->priv_data;
470  int ret;
471 
472  if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
473  return ret;
474 
476 
477  return ff_intrax8_common_init(avctx, &w->x8, &w->s.idsp,
478  w->s.block, w->s.block_last_index,
479  w->s.mb_width, w->s.mb_height);
480 }
481 
483 {
484  Wmv2Context *w = avctx->priv_data;
485 
487  return ff_h263_decode_end(avctx);
488 }
489 
491  .name = "wmv2",
492  .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"),
493  .type = AVMEDIA_TYPE_VIDEO,
494  .id = AV_CODEC_ID_WMV2,
495  .priv_data_size = sizeof(Wmv2Context),
497  .close = wmv2_decode_end,
500  .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
501  AV_PIX_FMT_NONE },
502 };
static av_cold int wmv2_decode_init(AVCodecContext *avctx)
Definition: wmv2dec.c:467
int inter_intra_pred
Definition: mpegvideo.h:427
int j_type_bit
Definition: wmv2.h:39
IDCTDSPContext idsp
Definition: mpegvideo.h:221
#define MB_TYPE_SKIP
Definition: avcodec.h:1093
int picture_number
Definition: mpegvideo.h:122
#define SKIP_TYPE_COL
Definition: wmv2.h:32
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:54
int esc3_level_length
Definition: mpegvideo.h:423
static av_cold int wmv2_decode_end(AVCodecContext *avctx)
Definition: wmv2dec.c:482
int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
Definition: wmv2dec.c:348
int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
Definition: wmv2dec.c:140
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:228
#define ER_MB_END
int ff_msmpeg4_decode_init(AVCodecContext *avctx)
Definition: msmpeg4dec.c:282
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:308
int per_mb_abt
Definition: wmv2.h:44
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
static int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr)
Definition: wmv2dec.c:245
static int decode_ext_header(Wmv2Context *w)
Definition: wmv2dec.c:82
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:3120
#define MB_NON_INTRA_VLC_BITS
Definition: msmpeg4.h:34
int qscale
QP.
Definition: mpegvideo.h:199
av_cold int ff_intrax8_common_init(AVCodecContext *avctx, IntraX8Context *w, IDCTDSPContext *idsp, int16_t(*block)[64], int block_last_index[12], int mb_width, int mb_height)
Initialize IntraX8 frame decoder.
Definition: intrax8.c:732
static int16_t block[64]
Definition: dct.c:97
int esc3_run_length
Definition: mpegvideo.h:424
int ff_intrax8_decode_picture(IntraX8Context *const w, Picture *pict, GetBitContext *gb, int *mb_x, int *mb_y, int dquant, int quant_offset, int loopfilter, int lowdelay)
Decode single IntraX8 frame.
Definition: intrax8.c:772
uint8_t
#define av_cold
Definition: attributes.h:66
Definition: vf_drawbox.c:37
#define FF_DEBUG_PICT_INFO
Definition: avcodec.h:2627
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1523
int no_rounding
apply no rounding to motion compensation (MPEG-4, msmpeg4, ...) for B-frames rounding mode is always ...
Definition: mpegvideo.h:278
Picture current_picture
copy of the current picture structure.
Definition: mpegvideo.h:175
int ff_msmpeg4_decode_motion(MpegEncContext *s, int *mx_ptr, int *my_ptr)
Definition: msmpeg4dec.c:810
MSMPEG4 data tables.
const uint8_t * scantable
Definition: idctdsp.h:30
int mb_height
number of MBs horizontally & vertically
Definition: mpegvideo.h:124
MpegEncContext s
Definition: wmv2.h:36
#define B
Definition: huffyuv.h:49
int ff_wmv2_decode_picture_header(MpegEncContext *s)
Definition: wmv2dec.c:120
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:124
static void parse_mb_skip(Wmv2Context *w)
Definition: wmv2dec.c:33
void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy, int status)
Add a slice.
int rl_chroma_table_index
Definition: mpegvideo.h:415
int mb_skipped
MUST BE SET only during DECODING.
Definition: mpegvideo.h:190
void(* clear_blocks)(int16_t *blocks)
Definition: blockdsp.h:36
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:148
ERContext er
Definition: mpegvideo.h:528
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:145
int per_mb_rl_table
Definition: mpegvideo.h:422
#define wrap(func)
Definition: neontest.h:62
const char * name
Name of the codec implementation.
Definition: avcodec.h:3127
#define IS_SKIP(a)
Definition: mpegutils.h:83
int low_delay
no reordering needed / has no B-frames
Definition: mpegvideo.h:391
AVCodec ff_wmv2_decoder
Definition: wmv2dec.c:490
GetBitContext gb
Definition: mpegvideo.h:431
#define FFMAX(a, b)
Definition: common.h:64
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: h263dec.c:373
#define AV_CODEC_CAP_DRAW_HORIZ_BAND
Decoder can use draw_horiz_band callback.
Definition: avcodec.h:832
av_cold void ff_intrax8_common_end(IntraX8Context *w)
Destroy IntraX8 frame structure.
Definition: intrax8.c:767
static int decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt)
Definition: avconv.c:1288
int16_t(*[2] motion_val)[2]
Definition: mpegpicture.h:53
Picture * current_picture_ptr
pointer to the current picture
Definition: mpegvideo.h:179
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:250
#define FFABS(a)
Definition: common.h:61
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:493
int block_last_index[12]
last non zero coefficient in block
Definition: mpegvideo.h:81
static int16_t * wmv2_pred_motion(Wmv2Context *w, int *px, int *py)
Definition: wmv2dec.c:263
int block_index[6]
index to current MB in block based arrays with edges
Definition: mpegvideo.h:287
static const float pred[4]
Definition: siprdata.h:259
#define MV_TYPE_16X16
1 vector for the whole mb
Definition: mpegvideo.h:260
int first_slice_line
used in MPEG-4 too to handle resync markers
Definition: mpegvideo.h:419
NULL
Definition: eval.c:55
int abt_flag
Definition: wmv2.h:41
Libavcodec external API header.
#define SKIP_TYPE_MPEG
Definition: wmv2.h:30
#define ff_dlog(ctx,...)
Definition: internal.h:60
BlockDSPContext bdsp
Definition: mpegvideo.h:218
int cbp_table_index
Definition: wmv2.h:47
int debug
debug
Definition: avcodec.h:2626
main external API structure.
Definition: avcodec.h:1409
VLC ff_inter_intra_vlc
Definition: msmpeg4dec.c:69
int skip_type
Definition: wmv2.h:50
int extradata_size
Definition: avcodec.h:1524
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:267
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:362
#define MB_INTRA_VLC_BITS
Definition: msmpeg4.h:35
int slice_height
in macroblocks
Definition: mpegvideo.h:418
#define MB_TYPE_16x16
Definition: avcodec.h:1085
#define mid_pred
Definition: mathops.h:99
const VDPAUPixFmtMap * map
#define MV_DIR_FORWARD
Definition: mpegvideo.h:256
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
Definition: mpegvideo.h:206
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:257
int bit_rate
wanted bit rate
Definition: mpegvideo.h:98
int mv[2][4][2]
motion vectors for a macroblock first coordinate : 0 = forward 1 = backward second " : depend...
Definition: mpegvideo.h:270
int b8_stride
2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
Definition: mpegvideo.h:126
MpegEncContext.
Definition: mpegvideo.h:76
struct AVCodecContext * avctx
Definition: mpegvideo.h:93
#define SKIP_TYPE_NONE
Definition: wmv2.h:29
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:59
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:125
VLC ff_mb_non_intra_vlc[4]
Definition: msmpeg4dec.c:63
static av_cold int init(AVCodecParserContext *s)
Definition: h264_parser.c:582
int per_block_abt
Definition: wmv2.h:45
int ff_h263_decode_end(AVCodecContext *avctx)
Definition: h263dec.c:136
void * priv_data
Definition: avcodec.h:1451
int hshift
Definition: wmv2.h:51
IntraX8Context x8
Definition: wmv2.h:37
av_cold void ff_wmv2_common_init(Wmv2Context *w)
Definition: wmv2.c:31
int16_t(* block)[64]
points to one of the following blocks
Definition: mpegvideo.h:476
static int decode012(GetBitContext *gb)
Definition: get_bits.h:508
VLC_TYPE(* table)[2]
code, bits
Definition: vlc.h:28
int rl_table_index
Definition: mpegvideo.h:414
int chroma_qscale
chroma QP
Definition: mpegvideo.h:200
int ff_msmpeg4_decode_block(MpegEncContext *s, int16_t *block, int n, int coded, const uint8_t *scan_table)
Definition: msmpeg4dec.c:623
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 the cache usage
Definition: mpegvideo.h:85
int ff_msmpeg4_coded_block_pred(MpegEncContext *s, int n, uint8_t **coded_block_ptr)
Definition: msmpeg4.c:155
#define SKIP_TYPE_ROW
Definition: wmv2.h:31
int mv_table_index
Definition: mpegvideo.h:413
int h263_aic_dir
AIC direction: 0 = left, 1 = top.
Definition: mpegvideo.h:363
AVPixelFormat
Pixel format.
Definition: pixfmt.h:57
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:838
int dc_table_index
Definition: mpegvideo.h:416
for(j=16;j >0;--j)
#define MB_TYPE_L0
Definition: avcodec.h:1098
Predicted.
Definition: avutil.h:261
int top_left_mv_flag
Definition: wmv2.h:48
int j_type
Definition: wmv2.h:40