FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups 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 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  w->cbp_table_index = wmv2_get_cbp_table_index(s, cbp_index);
178 
179  if (w->mspel_bit)
180  s->mspel = get_bits1(&s->gb);
181  else
182  s->mspel = 0; // FIXME check
183 
184  if (w->abt_flag) {
185  w->per_mb_abt = get_bits1(&s->gb) ^ 1;
186  if (!w->per_mb_abt)
187  w->abt_type = decode012(&s->gb);
188  }
189 
190  if (w->per_mb_rl_bit)
191  s->per_mb_rl_table = get_bits1(&s->gb);
192  else
193  s->per_mb_rl_table = 0;
194 
195  if (!s->per_mb_rl_table) {
196  s->rl_table_index = decode012(&s->gb);
198  }
199 
200  s->dc_table_index = get_bits1(&s->gb);
201  s->mv_table_index = get_bits1(&s->gb);
202 
203  s->inter_intra_pred = 0; // (s->width * s->height < 320 * 240 && s->bit_rate <= II_BITRATE);
204  s->no_rounding ^= 1;
205 
206  if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
208  "rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d "
209  "per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n",
212  s->per_mb_rl_table, s->qscale, s->mspel,
214  s->inter_intra_pred);
215  }
216  }
217  s->esc3_level_length = 0;
218  s->esc3_run_length = 0;
219  s->picture_number++; // FIXME ?
220 
221  if (w->j_type) {
222  ff_intrax8_decode_picture(&w->x8, 2 * s->qscale, (s->qscale - 1) | 1);
223  return 1;
224  }
225 
226  return 0;
227 }
228 
229 static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr)
230 {
231  MpegEncContext *const s = &w->s;
232  int ret;
233 
234  ret = ff_msmpeg4_decode_motion(s, mx_ptr, my_ptr);
235 
236  if (ret < 0)
237  return ret;
238 
239  if ((((*mx_ptr) | (*my_ptr)) & 1) && s->mspel)
240  w->hshift = get_bits1(&s->gb);
241  else
242  w->hshift = 0;
243 
244  return 0;
245 }
246 
247 static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py)
248 {
249  MpegEncContext *const s = &w->s;
250  int xy, wrap, diff, type;
251  int16_t *A, *B, *C, *mot_val;
252 
253  wrap = s->b8_stride;
254  xy = s->block_index[0];
255 
256  mot_val = s->current_picture.motion_val[0][xy];
257 
258  A = s->current_picture.motion_val[0][xy - 1];
259  B = s->current_picture.motion_val[0][xy - wrap];
260  C = s->current_picture.motion_val[0][xy + 2 - wrap];
261 
262  if (s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag)
263  diff = FFMAX(FFABS(A[0] - B[0]), FFABS(A[1] - B[1]));
264  else
265  diff = 0;
266 
267  if (diff >= 8)
268  type = get_bits1(&s->gb);
269  else
270  type = 2;
271 
272  if (type == 0) {
273  *px = A[0];
274  *py = A[1];
275  } else if (type == 1) {
276  *px = B[0];
277  *py = B[1];
278  } else {
279  /* special case for first (slice) line */
280  if (s->first_slice_line) {
281  *px = A[0];
282  *py = A[1];
283  } else {
284  *px = mid_pred(A[0], B[0], C[0]);
285  *py = mid_pred(A[1], B[1], C[1]);
286  }
287  }
288 
289  return mot_val;
290 }
291 
292 static inline int wmv2_decode_inter_block(Wmv2Context *w, int16_t *block,
293  int n, int cbp)
294 {
295  MpegEncContext *const s = &w->s;
296  static const int sub_cbp_table[3] = { 2, 3, 1 };
297  int sub_cbp, ret;
298 
299  if (!cbp) {
300  s->block_last_index[n] = -1;
301  return 0;
302  }
303 
304  if (w->per_block_abt)
305  w->abt_type = decode012(&s->gb);
306  w->abt_type_table[n] = w->abt_type;
307 
308  if (w->abt_type) {
309 // const uint8_t *scantable = w->abt_scantable[w->abt_type - 1].permutated;
310  const uint8_t *scantable = w->abt_scantable[w->abt_type - 1].scantable;
311 // const uint8_t *scantable = w->abt_type - 1 ? w->abt_scantable[1].permutated : w->abt_scantable[0].scantable;
312 
313  sub_cbp = sub_cbp_table[decode012(&s->gb)];
314 
315  if (sub_cbp & 1)
316  if ((ret = ff_msmpeg4_decode_block(s, block, n, 1, scantable)) < 0)
317  return ret;
318 
319  if (sub_cbp & 2)
320  if ((ret = ff_msmpeg4_decode_block(s, w->abt_block2[n], n, 1, scantable)) < 0)
321  return ret;
322 
323  s->block_last_index[n] = 63;
324 
325  return 0;
326  } else {
327  return ff_msmpeg4_decode_block(s, block, n, 1,
329  }
330 }
331 
333 {
334  Wmv2Context *const w = (Wmv2Context *) s;
335  int cbp, code, i, ret;
336  uint8_t *coded_val;
337 
338  if (w->j_type)
339  return 0;
340 
341  if (s->pict_type == AV_PICTURE_TYPE_P) {
342  if (IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])) {
343  /* skip mb */
344  s->mb_intra = 0;
345  for (i = 0; i < 6; i++)
346  s->block_last_index[i] = -1;
347  s->mv_dir = MV_DIR_FORWARD;
348  s->mv_type = MV_TYPE_16X16;
349  s->mv[0][0][0] = 0;
350  s->mv[0][0][1] = 0;
351  s->mb_skipped = 1;
352  w->hshift = 0;
353  return 0;
354  }
355 
358  if (code < 0)
359  return AVERROR_INVALIDDATA;
360  s->mb_intra = (~code & 0x40) >> 6;
361 
362  cbp = code & 0x3f;
363  } else {
364  s->mb_intra = 1;
366  if (code < 0) {
368  "II-cbp illegal at %d %d\n", s->mb_x, s->mb_y);
369  return AVERROR_INVALIDDATA;
370  }
371  /* predict coded block pattern */
372  cbp = 0;
373  for (i = 0; i < 6; i++) {
374  int val = ((code >> (5 - i)) & 1);
375  if (i < 4) {
376  int pred = ff_msmpeg4_coded_block_pred(s, i, &coded_val);
377  val = val ^ pred;
378  *coded_val = val;
379  }
380  cbp |= val << (5 - i);
381  }
382  }
383 
384  if (!s->mb_intra) {
385  int mx, my;
386  wmv2_pred_motion(w, &mx, &my);
387 
388  if (cbp) {
389  s->bdsp.clear_blocks(s->block[0]);
390  if (s->per_mb_rl_table) {
391  s->rl_table_index = decode012(&s->gb);
393  }
394 
395  if (w->abt_flag && w->per_mb_abt) {
396  w->per_block_abt = get_bits1(&s->gb);
397  if (!w->per_block_abt)
398  w->abt_type = decode012(&s->gb);
399  } else
400  w->per_block_abt = 0;
401  }
402 
403  if ((ret = wmv2_decode_motion(w, &mx, &my)) < 0)
404  return ret;
405 
406  s->mv_dir = MV_DIR_FORWARD;
407  s->mv_type = MV_TYPE_16X16;
408  s->mv[0][0][0] = mx;
409  s->mv[0][0][1] = my;
410 
411  for (i = 0; i < 6; i++) {
412  if ((ret = wmv2_decode_inter_block(w, block[i], i, (cbp >> (5 - i)) & 1)) < 0) {
414  "\nerror while decoding inter block: %d x %d (%d)\n",
415  s->mb_x, s->mb_y, i);
416  return ret;
417  }
418  }
419  } else {
420  if (s->pict_type == AV_PICTURE_TYPE_P)
421  ff_dlog(s->avctx, "%d%d ", s->inter_intra_pred, cbp);
422  ff_dlog(s->avctx, "I at %d %d %d %06X\n", s->mb_x, s->mb_y,
423  ((cbp & 3) ? 1 : 0) + ((cbp & 0x3C) ? 2 : 0),
424  show_bits(&s->gb, 24));
425  s->ac_pred = get_bits1(&s->gb);
426  if (s->inter_intra_pred) {
429  ff_dlog(s->avctx, "%d%d %d %d/",
430  s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
431  }
432  if (s->per_mb_rl_table && cbp) {
433  s->rl_table_index = decode012(&s->gb);
435  }
436 
437  s->bdsp.clear_blocks(s->block[0]);
438  for (i = 0; i < 6; i++) {
439  if ((ret = ff_msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL)) < 0) {
441  "\nerror while decoding intra block: %d x %d (%d)\n",
442  s->mb_x, s->mb_y, i);
443  return ret;
444  }
445  }
446  }
447 
448  return 0;
449 }
450 
452 {
453  Wmv2Context *const w = avctx->priv_data;
454  int ret;
455 
456  avctx->flags |= CODEC_FLAG_EMU_EDGE;
457 
458  if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
459  return ret;
460 
462 
463  ff_intrax8_common_init(&w->x8, &w->s);
464 
465  return 0;
466 }
467 
469 {
470  Wmv2Context *w = avctx->priv_data;
471 
473  return ff_h263_decode_end(avctx);
474 }
475 
477  .name = "wmv2",
478  .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"),
479  .type = AVMEDIA_TYPE_VIDEO,
480  .id = AV_CODEC_ID_WMV2,
481  .priv_data_size = sizeof(Wmv2Context),
483  .close = wmv2_decode_end,
485  .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
486  .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
487  AV_PIX_FMT_NONE },
488 };
static av_cold int wmv2_decode_init(AVCodecContext *avctx)
Definition: wmv2dec.c:451
int inter_intra_pred
Definition: mpegvideo.h:505
int j_type_bit
Definition: wmv2.h:39
#define NULL
Definition: coverity.c:32
#define MB_TYPE_SKIP
Definition: avcodec.h:905
const char const char void * val
Definition: avisynth_c.h:634
int picture_number
Definition: mpegvideo.h:196
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:501
static av_cold int wmv2_decode_end(AVCodecContext *avctx)
Definition: wmv2dec.c:468
int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
Definition: wmv2dec.c:332
#define C
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:260
int ff_msmpeg4_decode_init(AVCodecContext *avctx)
Definition: msmpeg4dec.c:288
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:292
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:229
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:3181
#define MB_NON_INTRA_VLC_BITS
Definition: msmpeg4.h:34
int qscale
QP.
Definition: mpegvideo.h:273
int esc3_run_length
Definition: mpegvideo.h:502
uint8_t
#define av_cold
Definition: attributes.h:74
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1355
int no_rounding
apply no rounding to motion compensation (MPEG4, msmpeg4, ...) for b-frames rounding mode is always 0...
Definition: mpegvideo.h:351
Picture current_picture
copy of the current picture structure.
Definition: mpegvideo.h:249
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:789
int ff_msmpeg4_decode_motion(MpegEncContext *s, int *mx_ptr, int *my_ptr)
Definition: msmpeg4dec.c:880
MSMPEG4 data tables.
const uint8_t * scantable
Definition: idctdsp.h:30
int mb_height
number of MBs horizontally & vertically
Definition: mpegvideo.h:198
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:120
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
static void parse_mb_skip(Wmv2Context *w)
Definition: wmv2dec.c:33
int rl_chroma_table_index
Definition: mpegvideo.h:493
int mb_skipped
MUST BE SET only during DECODING.
Definition: mpegvideo.h:264
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:175
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:197
int per_mb_rl_table
Definition: mpegvideo.h:500
int flags
CODEC_FLAG_*.
Definition: avcodec.h:1335
#define wrap(func)
Definition: neontest.h:62
const char * name
Name of the codec implementation.
Definition: avcodec.h:3188
#define IS_SKIP(a)
Definition: mpegutils.h:77
AVCodec ff_wmv2_decoder
Definition: wmv2dec.c:476
GetBitContext gb
Definition: mpegvideo.h:509
#define FFMAX(a, b)
Definition: common.h:64
Libavcodec external API header.
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: h263dec.c:409
#define CODEC_CAP_DRAW_HORIZ_BAND
Decoder can use draw_horiz_band callback.
Definition: avcodec.h:783
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:97
Picture * current_picture_ptr
pointer to the current picture
Definition: mpegvideo.h:253
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)
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:555
int block_last_index[12]
last non zero coefficient in block
Definition: mpegvideo.h:155
int n
Definition: avisynth_c.h:547
static int16_t * wmv2_pred_motion(Wmv2Context *w, int *px, int *py)
Definition: wmv2dec.c:247
int block_index[6]
index to current MB in block based arrays with edges
Definition: mpegvideo.h:360
static const float pred[4]
Definition: siprdata.h:259
#define MV_TYPE_16X16
1 vector for the whole mb
Definition: mpegvideo.h:333
int first_slice_line
used in mpeg4 too to handle resync markers
Definition: mpegvideo.h:497
int abt_flag
Definition: wmv2.h:41
#define SKIP_TYPE_MPEG
Definition: wmv2.h:30
#define ff_dlog(ctx,...)
Definition: internal.h:54
BlockDSPContext bdsp
Definition: mpegvideo.h:295
int cbp_table_index
Definition: wmv2.h:47
int debug
debug
Definition: avcodec.h:2565
main external API structure.
Definition: avcodec.h:1241
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:1356
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:496
#define MB_TYPE_16x16
Definition: avcodec.h:897
#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:329
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
Definition: mpegvideo.h:281
int bit_rate
wanted bit rate
Definition: mpegvideo.h:172
#define FF_DEBUG_PICT_INFO
Definition: avcodec.h:2566
int mv[2][4][2]
motion vectors for a macroblock first coordinate : 0 = forward 1 = backward second " : depend...
Definition: mpegvideo.h:343
int b8_stride
2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
Definition: mpegvideo.h:200
MpegEncContext.
Definition: mpegvideo.h:150
struct AVCodecContext * avctx
Definition: mpegvideo.h:167
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
Definition: ccaption_dec.c:522
#define SKIP_TYPE_NONE
Definition: wmv2.h:29
#define CODEC_FLAG_EMU_EDGE
Definition: avcodec.h:744
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:199
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:1283
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:30
int16_t(* block)[64]
points to one of the following blocks
Definition: mpegvideo.h:558
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:492
int chroma_qscale
chroma QP
Definition: mpegvideo.h:274
int ff_msmpeg4_decode_block(MpegEncContext *s, int16_t *block, int n, int coded, const uint8_t *scan_table)
Definition: msmpeg4dec.c:643
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:100
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:159
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:491
int h263_aic_dir
AIC direction: 0 = left, 1 = top.
Definition: mpegvideo.h:441
AVPixelFormat
Pixel format.
Definition: pixfmt.h:61
Definition: vf_geq.c:45
int dc_table_index
Definition: mpegvideo.h:494
for(j=16;j >0;--j)
#define MB_TYPE_L0
Definition: avcodec.h:910
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