FFmpeg  2.6.9
 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 "intrax8.h"
24 #include "mathops.h"
25 #include "mpegutils.h"
26 #include "mpegvideo.h"
27 #include "msmpeg4.h"
28 #include "msmpeg4data.h"
29 #include "wmv2.h"
30 
31 
32 static void parse_mb_skip(Wmv2Context *w)
33 {
34  int mb_x, mb_y;
35  MpegEncContext *const s = &w->s;
36  uint32_t *const mb_type = s->current_picture_ptr->mb_type;
37 
38  w->skip_type = get_bits(&s->gb, 2);
39  switch (w->skip_type) {
40  case SKIP_TYPE_NONE:
41  for (mb_y = 0; mb_y < s->mb_height; mb_y++)
42  for (mb_x = 0; mb_x < s->mb_width; mb_x++)
43  mb_type[mb_y * s->mb_stride + mb_x] =
45  break;
46  case SKIP_TYPE_MPEG:
47  for (mb_y = 0; mb_y < s->mb_height; mb_y++)
48  for (mb_x = 0; mb_x < s->mb_width; mb_x++)
49  mb_type[mb_y * s->mb_stride + mb_x] =
51  break;
52  case SKIP_TYPE_ROW:
53  for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
54  if (get_bits1(&s->gb)) {
55  for (mb_x = 0; mb_x < s->mb_width; mb_x++)
56  mb_type[mb_y * s->mb_stride + mb_x] =
58  } else {
59  for (mb_x = 0; mb_x < s->mb_width; mb_x++)
60  mb_type[mb_y * s->mb_stride + mb_x] =
62  }
63  }
64  break;
65  case SKIP_TYPE_COL:
66  for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
67  if (get_bits1(&s->gb)) {
68  for (mb_y = 0; mb_y < s->mb_height; mb_y++)
69  mb_type[mb_y * s->mb_stride + mb_x] =
71  } else {
72  for (mb_y = 0; mb_y < s->mb_height; mb_y++)
73  mb_type[mb_y * s->mb_stride + mb_x] =
75  }
76  }
77  break;
78  }
79 }
80 
82 {
83  MpegEncContext *const s = &w->s;
84  GetBitContext gb;
85  int fps;
86  int code;
87 
88  if (s->avctx->extradata_size < 4)
89  return AVERROR_INVALIDDATA;
90 
91  init_get_bits(&gb, s->avctx->extradata, 32);
92 
93  fps = get_bits(&gb, 5);
94  s->bit_rate = get_bits(&gb, 11) * 1024;
95  w->mspel_bit = get_bits1(&gb);
96  s->loop_filter = get_bits1(&gb);
97  w->abt_flag = get_bits1(&gb);
98  w->j_type_bit = get_bits1(&gb);
99  w->top_left_mv_flag = get_bits1(&gb);
100  w->per_mb_rl_bit = get_bits1(&gb);
101  code = get_bits(&gb, 3);
102 
103  if (code == 0)
104  return AVERROR_INVALIDDATA;
105 
106  s->slice_height = s->mb_height / code;
107 
108  if (s->avctx->debug & FF_DEBUG_PICT_INFO)
110  "fps:%d, br:%d, qpbit:%d, abt_flag:%d, j_type_bit:%d, "
111  "tl_mv_flag:%d, mbrl_bit:%d, code:%d, loop_filter:%d, "
112  "slices:%d\n",
113  fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit,
114  w->top_left_mv_flag, w->per_mb_rl_bit, code, s->loop_filter,
115  code);
116  return 0;
117 }
118 
120 {
121  Wmv2Context *const w = (Wmv2Context *) s;
122  int code;
123 
124  if (s->picture_number == 0)
126 
127  s->pict_type = get_bits1(&s->gb) + 1;
128  if (s->pict_type == AV_PICTURE_TYPE_I) {
129  code = get_bits(&s->gb, 7);
130  av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code);
131  }
132  s->chroma_qscale = s->qscale = get_bits(&s->gb, 5);
133  if (s->qscale <= 0)
134  return AVERROR_INVALIDDATA;
135 
136  return 0;
137 }
138 
140 {
141  Wmv2Context *const w = (Wmv2Context *) s;
142 
143  if (s->pict_type == AV_PICTURE_TYPE_I) {
144  if (w->j_type_bit)
145  w->j_type = get_bits1(&s->gb);
146  else
147  w->j_type = 0; // FIXME check
148 
149  if (!w->j_type) {
150  if (w->per_mb_rl_bit)
151  s->per_mb_rl_table = get_bits1(&s->gb);
152  else
153  s->per_mb_rl_table = 0;
154 
155  if (!s->per_mb_rl_table) {
157  s->rl_table_index = decode012(&s->gb);
158  }
159 
160  s->dc_table_index = get_bits1(&s->gb);
161  }
162  s->inter_intra_pred = 0;
163  s->no_rounding = 1;
164  if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
166  "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n",
169  }
170  } else {
171  int cbp_index;
172  w->j_type = 0;
173 
174  parse_mb_skip(w);
175  cbp_index = decode012(&s->gb);
176  w->cbp_table_index = wmv2_get_cbp_table_index(s, cbp_index);
177 
178  if (w->mspel_bit)
179  s->mspel = get_bits1(&s->gb);
180  else
181  s->mspel = 0; // FIXME check
182 
183  if (w->abt_flag) {
184  w->per_mb_abt = get_bits1(&s->gb) ^ 1;
185  if (!w->per_mb_abt)
186  w->abt_type = decode012(&s->gb);
187  }
188 
189  if (w->per_mb_rl_bit)
190  s->per_mb_rl_table = get_bits1(&s->gb);
191  else
192  s->per_mb_rl_table = 0;
193 
194  if (!s->per_mb_rl_table) {
195  s->rl_table_index = decode012(&s->gb);
197  }
198 
199  s->dc_table_index = get_bits1(&s->gb);
200  s->mv_table_index = get_bits1(&s->gb);
201 
202  s->inter_intra_pred = 0; // (s->width * s->height < 320 * 240 && s->bit_rate <= II_BITRATE);
203  s->no_rounding ^= 1;
204 
205  if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
207  "rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d "
208  "per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n",
211  s->per_mb_rl_table, s->qscale, s->mspel,
213  s->inter_intra_pred);
214  }
215  }
216  s->esc3_level_length = 0;
217  s->esc3_run_length = 0;
218  s->picture_number++; // FIXME ?
219 
220  if (w->j_type) {
221  ff_intrax8_decode_picture(&w->x8, 2 * s->qscale, (s->qscale - 1) | 1);
222  return 1;
223  }
224 
225  return 0;
226 }
227 
228 static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr)
229 {
230  MpegEncContext *const s = &w->s;
231  int ret;
232 
233  ret = ff_msmpeg4_decode_motion(s, mx_ptr, my_ptr);
234 
235  if (ret < 0)
236  return ret;
237 
238  if ((((*mx_ptr) | (*my_ptr)) & 1) && s->mspel)
239  w->hshift = get_bits1(&s->gb);
240  else
241  w->hshift = 0;
242 
243  return 0;
244 }
245 
246 static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py)
247 {
248  MpegEncContext *const s = &w->s;
249  int xy, wrap, diff, type;
250  int16_t *A, *B, *C, *mot_val;
251 
252  wrap = s->b8_stride;
253  xy = s->block_index[0];
254 
255  mot_val = s->current_picture.motion_val[0][xy];
256 
257  A = s->current_picture.motion_val[0][xy - 1];
258  B = s->current_picture.motion_val[0][xy - wrap];
259  C = s->current_picture.motion_val[0][xy + 2 - wrap];
260 
261  if (s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag)
262  diff = FFMAX(FFABS(A[0] - B[0]), FFABS(A[1] - B[1]));
263  else
264  diff = 0;
265 
266  if (diff >= 8)
267  type = get_bits1(&s->gb);
268  else
269  type = 2;
270 
271  if (type == 0) {
272  *px = A[0];
273  *py = A[1];
274  } else if (type == 1) {
275  *px = B[0];
276  *py = B[1];
277  } else {
278  /* special case for first (slice) line */
279  if (s->first_slice_line) {
280  *px = A[0];
281  *py = A[1];
282  } else {
283  *px = mid_pred(A[0], B[0], C[0]);
284  *py = mid_pred(A[1], B[1], C[1]);
285  }
286  }
287 
288  return mot_val;
289 }
290 
291 static inline int wmv2_decode_inter_block(Wmv2Context *w, int16_t *block,
292  int n, int cbp)
293 {
294  MpegEncContext *const s = &w->s;
295  static const int sub_cbp_table[3] = { 2, 3, 1 };
296  int sub_cbp, ret;
297 
298  if (!cbp) {
299  s->block_last_index[n] = -1;
300  return 0;
301  }
302 
303  if (w->per_block_abt)
304  w->abt_type = decode012(&s->gb);
305  w->abt_type_table[n] = w->abt_type;
306 
307  if (w->abt_type) {
308 // const uint8_t *scantable = w->abt_scantable[w->abt_type - 1].permutated;
309  const uint8_t *scantable = w->abt_scantable[w->abt_type - 1].scantable;
310 // const uint8_t *scantable = w->abt_type - 1 ? w->abt_scantable[1].permutated : w->abt_scantable[0].scantable;
311 
312  sub_cbp = sub_cbp_table[decode012(&s->gb)];
313 
314  if (sub_cbp & 1)
315  if ((ret = ff_msmpeg4_decode_block(s, block, n, 1, scantable)) < 0)
316  return ret;
317 
318  if (sub_cbp & 2)
319  if ((ret = ff_msmpeg4_decode_block(s, w->abt_block2[n], n, 1, scantable)) < 0)
320  return ret;
321 
322  s->block_last_index[n] = 63;
323 
324  return 0;
325  } else {
326  return ff_msmpeg4_decode_block(s, block, n, 1,
328  }
329 }
330 
332 {
333  Wmv2Context *const w = (Wmv2Context *) s;
334  int cbp, code, i, ret;
335  uint8_t *coded_val;
336 
337  if (w->j_type)
338  return 0;
339 
340  if (s->pict_type == AV_PICTURE_TYPE_P) {
341  if (IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])) {
342  /* skip mb */
343  s->mb_intra = 0;
344  for (i = 0; i < 6; i++)
345  s->block_last_index[i] = -1;
346  s->mv_dir = MV_DIR_FORWARD;
347  s->mv_type = MV_TYPE_16X16;
348  s->mv[0][0][0] = 0;
349  s->mv[0][0][1] = 0;
350  s->mb_skipped = 1;
351  w->hshift = 0;
352  return 0;
353  }
354 
357  if (code < 0)
358  return AVERROR_INVALIDDATA;
359  s->mb_intra = (~code & 0x40) >> 6;
360 
361  cbp = code & 0x3f;
362  } else {
363  s->mb_intra = 1;
365  if (code < 0) {
367  "II-cbp illegal at %d %d\n", s->mb_x, s->mb_y);
368  return AVERROR_INVALIDDATA;
369  }
370  /* predict coded block pattern */
371  cbp = 0;
372  for (i = 0; i < 6; i++) {
373  int val = ((code >> (5 - i)) & 1);
374  if (i < 4) {
375  int pred = ff_msmpeg4_coded_block_pred(s, i, &coded_val);
376  val = val ^ pred;
377  *coded_val = val;
378  }
379  cbp |= val << (5 - i);
380  }
381  }
382 
383  if (!s->mb_intra) {
384  int mx, my;
385  wmv2_pred_motion(w, &mx, &my);
386 
387  if (cbp) {
388  s->bdsp.clear_blocks(s->block[0]);
389  if (s->per_mb_rl_table) {
390  s->rl_table_index = decode012(&s->gb);
392  }
393 
394  if (w->abt_flag && w->per_mb_abt) {
395  w->per_block_abt = get_bits1(&s->gb);
396  if (!w->per_block_abt)
397  w->abt_type = decode012(&s->gb);
398  } else
399  w->per_block_abt = 0;
400  }
401 
402  if ((ret = wmv2_decode_motion(w, &mx, &my)) < 0)
403  return ret;
404 
405  s->mv_dir = MV_DIR_FORWARD;
406  s->mv_type = MV_TYPE_16X16;
407  s->mv[0][0][0] = mx;
408  s->mv[0][0][1] = my;
409 
410  for (i = 0; i < 6; i++) {
411  if ((ret = wmv2_decode_inter_block(w, block[i], i, (cbp >> (5 - i)) & 1)) < 0) {
413  "\nerror while decoding inter block: %d x %d (%d)\n",
414  s->mb_x, s->mb_y, i);
415  return ret;
416  }
417  }
418  } else {
419  if (s->pict_type == AV_PICTURE_TYPE_P)
420  av_dlog(s->avctx, "%d%d ", s->inter_intra_pred, cbp);
421  av_dlog(s->avctx, "I at %d %d %d %06X\n", s->mb_x, s->mb_y,
422  ((cbp & 3) ? 1 : 0) + ((cbp & 0x3C) ? 2 : 0),
423  show_bits(&s->gb, 24));
424  s->ac_pred = get_bits1(&s->gb);
425  if (s->inter_intra_pred) {
428  av_dlog(s->avctx, "%d%d %d %d/",
429  s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
430  }
431  if (s->per_mb_rl_table && cbp) {
432  s->rl_table_index = decode012(&s->gb);
434  }
435 
436  s->bdsp.clear_blocks(s->block[0]);
437  for (i = 0; i < 6; i++) {
438  if ((ret = ff_msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL)) < 0) {
440  "\nerror while decoding intra block: %d x %d (%d)\n",
441  s->mb_x, s->mb_y, i);
442  return ret;
443  }
444  }
445  }
446 
447  return 0;
448 }
449 
451 {
452  Wmv2Context *const w = avctx->priv_data;
453  int ret;
454 
455  avctx->flags |= CODEC_FLAG_EMU_EDGE;
456 
457  if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
458  return ret;
459 
461 
462  ff_intrax8_common_init(&w->x8, &w->s);
463 
464  return 0;
465 }
466 
468 {
469  Wmv2Context *w = avctx->priv_data;
470 
472  return ff_h263_decode_end(avctx);
473 }
474 
476  .name = "wmv2",
477  .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"),
478  .type = AVMEDIA_TYPE_VIDEO,
479  .id = AV_CODEC_ID_WMV2,
480  .priv_data_size = sizeof(Wmv2Context),
482  .close = wmv2_decode_end,
484  .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
485  .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
486  AV_PIX_FMT_NONE },
487 };
static av_cold int wmv2_decode_init(AVCodecContext *avctx)
Definition: wmv2dec.c:450
int inter_intra_pred
Definition: mpegvideo.h:574
int j_type_bit
Definition: wmv2.h:39
#define NULL
Definition: coverity.c:32
#define MB_TYPE_SKIP
Definition: avcodec.h:903
const char const char void * val
Definition: avisynth_c.h:672
int picture_number
Definition: mpegvideo.h:262
const char * s
Definition: avisynth_c.h:669
#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:59
int esc3_level_length
Definition: mpegvideo.h:570
static av_cold int wmv2_decode_end(AVCodecContext *avctx)
Definition: wmv2dec.c:467
int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
Definition: wmv2dec.c:331
#define C
int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
Definition: wmv2dec.c:139
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:260
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:291
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
int ff_msmpeg4_decode_init(AVCodecContext *avctx)
Definition: msmpeg4dec.c:286
static int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr)
Definition: wmv2dec.c:228
static int decode_ext_header(Wmv2Context *w)
Definition: wmv2dec.c:81
int abt_type_table[6]
Definition: wmv2.h:43
mpegvideo header.
av_dlog(ac->avr,"%d samples - audio_convert: %s to %s (%s)\n", 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)
int per_mb_rl_bit
Definition: wmv2.h:49
uint8_t permutated[64]
Definition: idctdsp.h:31
AVCodec.
Definition: avcodec.h:3173
#define MB_NON_INTRA_VLC_BITS
Definition: msmpeg4.h:34
int qscale
QP.
Definition: mpegvideo.h:341
int esc3_run_length
Definition: mpegvideo.h:571
uint8_t
#define av_cold
Definition: attributes.h:74
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1353
int no_rounding
apply no rounding to motion compensation (MPEG4, msmpeg4, ...) for b-frames rounding mode is always 0...
Definition: mpegvideo.h:419
Picture current_picture
copy of the current picture structure.
Definition: mpegvideo.h:315
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:787
int ff_msmpeg4_decode_motion(MpegEncContext *s, int *mx_ptr, int *my_ptr)
Definition: msmpeg4dec.c:876
MSMPEG4 data tables.
const uint8_t * scantable
Definition: idctdsp.h:30
int mb_height
number of MBs horizontally & vertically
Definition: mpegvideo.h:264
MpegEncContext s
Definition: wmv2.h:36
#define A(x)
Definition: vp56_arith.h:28
#define av_log(a,...)
int ff_wmv2_decode_picture_header(MpegEncContext *s)
Definition: wmv2dec.c:119
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:175
static void parse_mb_skip(Wmv2Context *w)
Definition: wmv2dec.c:32
int rl_chroma_table_index
Definition: mpegvideo.h:562
int mb_skipped
MUST BE SET only during DECODING.
Definition: mpegvideo.h:330
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:180
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:196
int per_mb_rl_table
Definition: mpegvideo.h:569
int flags
CODEC_FLAG_*.
Definition: avcodec.h:1333
#define wrap(func)
Definition: neontest.h:62
const char * name
Name of the codec implementation.
Definition: avcodec.h:3180
#define IS_SKIP(a)
Definition: mpegutils.h:77
AVCodec ff_wmv2_decoder
Definition: wmv2dec.c:475
GetBitContext gb
Definition: mpegvideo.h:578
#define FFMAX(a, b)
Definition: common.h:79
Libavcodec external API header.
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: h263dec.c:401
#define CODEC_CAP_DRAW_HORIZ_BAND
Decoder can use draw_horiz_band callback.
Definition: avcodec.h:781
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
ret
Definition: avfilter.c:974
int16_t(*[2] motion_val)[2]
Definition: mpegvideo.h:111
Picture * current_picture_ptr
pointer to the current picture
Definition: mpegvideo.h:319
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:287
#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:555
int block_last_index[12]
last non zero coefficient in block
Definition: mpegvideo.h:218
int n
Definition: avisynth_c.h:589
static int16_t * wmv2_pred_motion(Wmv2Context *w, int *px, int *py)
Definition: wmv2dec.c:246
int block_index[6]
index to current MB in block based arrays with edges
Definition: mpegvideo.h:428
static const float pred[4]
Definition: siprdata.h:259
#define MV_TYPE_16X16
1 vector for the whole mb
Definition: mpegvideo.h:401
int first_slice_line
used in mpeg4 too to handle resync markers
Definition: mpegvideo.h:566
int abt_flag
Definition: wmv2.h:41
#define SKIP_TYPE_MPEG
Definition: wmv2.h:30
BlockDSPContext bdsp
Definition: mpegvideo.h:363
int cbp_table_index
Definition: wmv2.h:47
int debug
debug
Definition: avcodec.h:2563
main external API structure.
Definition: avcodec.h:1239
VLC ff_inter_intra_vlc
Definition: msmpeg4dec.c:69
int skip_type
Definition: wmv2.h:50
GLint GLenum type
Definition: opengl_enc.c:105
int extradata_size
Definition: avcodec.h:1354
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:304
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:410
#define MB_INTRA_VLC_BITS
Definition: msmpeg4.h:35
int slice_height
in macroblocks
Definition: mpegvideo.h:565
#define MB_TYPE_16x16
Definition: avcodec.h:895
#define mid_pred
Definition: mathops.h:96
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:397
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
Definition: mpegvideo.h:349
int bit_rate
wanted bit rate
Definition: mpegvideo.h:235
#define FF_DEBUG_PICT_INFO
Definition: avcodec.h:2564
int mv[2][4][2]
motion vectors for a macroblock first coordinate : 0 = forward 1 = backward second " : depend...
Definition: mpegvideo.h:411
int b8_stride
2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
Definition: mpegvideo.h:266
MpegEncContext.
Definition: mpegvideo.h:213
struct AVCodecContext * avctx
Definition: mpegvideo.h:230
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
Definition: ccaption_dec.c:520
#define SKIP_TYPE_NONE
Definition: wmv2.h:29
#define CODEC_FLAG_EMU_EDGE
Definition: avcodec.h:742
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:68
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 ...
Definition: mpegvideo.h:265
VLC ff_mb_non_intra_vlc[4]
Definition: msmpeg4dec.c:63
int per_block_abt
Definition: wmv2.h:45
int ff_h263_decode_end(AVCodecContext *avctx)
Definition: h263dec.c:141
void * priv_data
Definition: avcodec.h:1281
int hshift
Definition: wmv2.h:51
static av_always_inline int diff(const uint32_t a, const uint32_t b)
IntraX8Context x8
Definition: wmv2.h:37
av_cold void ff_wmv2_common_init(Wmv2Context *w)
Definition: wmv2.c:29
int16_t(* block)[64]
points to one of the following blocks
Definition: mpegvideo.h:627
static int decode012(GetBitContext *gb)
Definition: get_bits.h:570
VLC_TYPE(* table)[2]
code, bits
Definition: get_bits.h:65
int rl_table_index
Definition: mpegvideo.h:561
int chroma_qscale
chroma QP
Definition: mpegvideo.h:342
int ff_msmpeg4_decode_block(MpegEncContext *s, int16_t *block, int n, int coded, const uint8_t *scan_table)
Definition: msmpeg4dec.c:641
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: mpegvideo.h:114
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:222
int ff_msmpeg4_coded_block_pred(MpegEncContext *s, int n, uint8_t **coded_block_ptr)
Definition: msmpeg4.c:152
#define SKIP_TYPE_ROW
Definition: wmv2.h:31
Definition: vf_geq.c:45
int mv_table_index
Definition: mpegvideo.h:560
int h263_aic_dir
AIC direction: 0 = left, 1 = top.
Definition: mpegvideo.h:510
AVPixelFormat
Pixel format.
Definition: pixfmt.h:66
int dc_table_index
Definition: mpegvideo.h:563
for(j=16;j >0;--j)
#define MB_TYPE_L0
Definition: avcodec.h:908
Predicted.
Definition: avutil.h:268
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