FFmpeg  2.1.1
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 "mpegvideo.h"
23 #include "h263.h"
24 #include "mathops.h"
25 #include "msmpeg4.h"
26 #include "msmpeg4data.h"
27 #include "intrax8.h"
28 #include "wmv2.h"
29 
30 
31 static void parse_mb_skip(Wmv2Context * w){
32  int mb_x, mb_y;
33  MpegEncContext * const s= &w->s;
34  uint32_t * const mb_type = s->current_picture_ptr->mb_type;
35 
36  w->skip_type= get_bits(&s->gb, 2);
37  switch(w->skip_type){
38  case SKIP_TYPE_NONE:
39  for(mb_y=0; mb_y<s->mb_height; mb_y++){
40  for(mb_x=0; mb_x<s->mb_width; mb_x++){
41  mb_type[mb_y*s->mb_stride + mb_x]= MB_TYPE_16x16 | MB_TYPE_L0;
42  }
43  }
44  break;
45  case SKIP_TYPE_MPEG:
46  for(mb_y=0; mb_y<s->mb_height; mb_y++){
47  for(mb_x=0; mb_x<s->mb_width; mb_x++){
48  mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
49  }
50  }
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]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
57  }
58  }else{
59  for(mb_x=0; mb_x<s->mb_width; mb_x++){
60  mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
61  }
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]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
70  }
71  }else{
72  for(mb_y=0; mb_y<s->mb_height; mb_y++){
73  mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
74  }
75  }
76  }
77  break;
78  }
79 }
80 
82  MpegEncContext * const s= &w->s;
83  GetBitContext gb;
84  int fps;
85  int code;
86 
87  if(s->avctx->extradata_size<4) return -1;
88 
89  init_get_bits(&gb, s->avctx->extradata, 32);
90 
91  fps = get_bits(&gb, 5);
92  s->bit_rate = get_bits(&gb, 11)*1024;
93  w->mspel_bit = get_bits1(&gb);
94  s->loop_filter = get_bits1(&gb);
95  w->abt_flag = get_bits1(&gb);
96  w->j_type_bit = get_bits1(&gb);
97  w->top_left_mv_flag= get_bits1(&gb);
98  w->per_mb_rl_bit = get_bits1(&gb);
99  code = get_bits(&gb, 3);
100 
101  if(code==0) return -1;
102 
103  s->slice_height = s->mb_height / code;
104 
106  av_log(s->avctx, AV_LOG_DEBUG, "fps:%d, br:%d, qpbit:%d, abt_flag:%d, j_type_bit:%d, tl_mv_flag:%d, mbrl_bit:%d, code:%d, loop_filter:%d, slices:%d\n",
107  fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit, w->top_left_mv_flag, w->per_mb_rl_bit, code, s->loop_filter,
108  code);
109  }
110  return 0;
111 }
112 
114 {
115  Wmv2Context * const w= (Wmv2Context*)s;
116  int code;
117 
118  if(s->picture_number==0)
120 
121  s->pict_type = get_bits1(&s->gb) + 1;
122  if(s->pict_type == AV_PICTURE_TYPE_I){
123  code = get_bits(&s->gb, 7);
124  av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code);
125  }
126  s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
127  if(s->qscale <= 0)
128  return -1;
129 
130  return 0;
131 }
132 
134 {
135  Wmv2Context * const w= (Wmv2Context*)s;
136 
137  if (s->pict_type == AV_PICTURE_TYPE_I) {
138  if(w->j_type_bit) w->j_type= get_bits1(&s->gb);
139  else w->j_type= 0; //FIXME check
140 
141  if(!w->j_type){
142  if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);
143  else s->per_mb_rl_table= 0;
144 
145  if(!s->per_mb_rl_table){
147  s->rl_table_index = decode012(&s->gb);
148  }
149 
150  s->dc_table_index = get_bits1(&s->gb);
151  }
152  s->inter_intra_pred= 0;
153  s->no_rounding = 1;
155  av_log(s->avctx, AV_LOG_DEBUG, "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n",
156  s->qscale,
158  s->rl_table_index,
159  s->dc_table_index,
160  s->per_mb_rl_table,
161  w->j_type);
162  }
163  }else{
164  int cbp_index;
165  w->j_type=0;
166 
167  parse_mb_skip(w);
168  cbp_index= decode012(&s->gb);
169  if(s->qscale <= 10){
170  int map[3]= {0,2,1};
171  w->cbp_table_index= map[cbp_index];
172  }else if(s->qscale <= 20){
173  int map[3]= {1,0,2};
174  w->cbp_table_index= map[cbp_index];
175  }else{
176  int map[3]= {2,1,0};
177  w->cbp_table_index= map[cbp_index];
178  }
179 
180  if(w->mspel_bit) s->mspel= get_bits1(&s->gb);
181  else 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 
190  if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);
191  else s->per_mb_rl_table= 0;
192 
193  if(!s->per_mb_rl_table){
194  s->rl_table_index = decode012(&s->gb);
196  }
197 
198  s->dc_table_index = get_bits1(&s->gb);
199  s->mv_table_index = get_bits1(&s->gb);
200 
201  s->inter_intra_pred= 0;//(s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE);
202  s->no_rounding ^= 1;
203 
205  av_log(s->avctx, AV_LOG_DEBUG, "rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n",
206  s->rl_table_index,
208  s->dc_table_index,
209  s->mv_table_index,
210  s->per_mb_rl_table,
211  s->qscale,
212  s->mspel,
213  w->per_mb_abt,
214  w->abt_type,
215  w->cbp_table_index,
216  s->inter_intra_pred);
217  }
218  }
219  s->esc3_level_length= 0;
220  s->esc3_run_length= 0;
221 
222 s->picture_number++; //FIXME ?
223 
224 
225  if(w->j_type){
226  ff_intrax8_decode_picture(&w->x8, 2*s->qscale, (s->qscale-1)|1 );
227  return 1;
228  }
229 
230  return 0;
231 }
232 
233 static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr){
234  MpegEncContext * const s= &w->s;
235  int ret;
236 
237  ret= ff_msmpeg4_decode_motion(s, mx_ptr, my_ptr);
238 
239  if(ret<0) return -1;
240 
241  if((((*mx_ptr)|(*my_ptr)) & 1) && s->mspel)
242  w->hshift= get_bits1(&s->gb);
243  else
244  w->hshift= 0;
245 
246  return 0;
247 }
248 
249 static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py){
250  MpegEncContext * const s= &w->s;
251  int xy, wrap, diff, type;
252  int16_t *A, *B, *C, *mot_val;
253 
254  wrap = s->b8_stride;
255  xy = s->block_index[0];
256 
257  mot_val = s->current_picture.motion_val[0][xy];
258 
259  A = s->current_picture.motion_val[0][xy - 1];
260  B = s->current_picture.motion_val[0][xy - wrap];
261  C = s->current_picture.motion_val[0][xy + 2 - wrap];
262 
263  if(s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag)
264  diff= FFMAX(FFABS(A[0] - B[0]), FFABS(A[1] - B[1]));
265  else
266  diff=0;
267 
268  if(diff >= 8)
269  type= get_bits1(&s->gb);
270  else
271  type= 2;
272 
273  if(type == 0){
274  *px= A[0];
275  *py= A[1];
276  }else if(type == 1){
277  *px= B[0];
278  *py= B[1];
279  }else{
280  /* special case for first (slice) line */
281  if (s->first_slice_line) {
282  *px = A[0];
283  *py = A[1];
284  } else {
285  *px = mid_pred(A[0], B[0], C[0]);
286  *py = mid_pred(A[1], B[1], C[1]);
287  }
288  }
289 
290  return mot_val;
291 }
292 
293 static inline int wmv2_decode_inter_block(Wmv2Context *w, int16_t *block, int n, int cbp){
294  MpegEncContext * const s= &w->s;
295  static const int sub_cbp_table[3]= {2,3,1};
296  int sub_cbp;
297 
298  if(!cbp){
299  s->block_last_index[n] = -1;
300 
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 (ff_msmpeg4_decode_block(s, block, n, 1, scantable) < 0)
317  return -1;
318  }
319 
320  if(sub_cbp&2){
321  if (ff_msmpeg4_decode_block(s, w->abt_block2[n], n, 1, scantable) < 0)
322  return -1;
323  }
324  s->block_last_index[n] = 63;
325 
326  return 0;
327  }else{
328  return ff_msmpeg4_decode_block(s, block, n, 1, s->inter_scantable.permutated);
329  }
330 }
331 
332 
334 {
335  Wmv2Context * const w= (Wmv2Context*)s;
336  int cbp, code, i;
337  uint8_t *coded_val;
338 
339  if(w->j_type) 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 
357  if (code < 0)
358  return -1;
359  s->mb_intra = (~code & 0x40) >> 6;
360 
361  cbp = code & 0x3f;
362  } else {
363  s->mb_intra = 1;
365  if (code < 0){
366  av_log(s->avctx, AV_LOG_ERROR, "II-cbp illegal at %d %d\n", s->mb_x, s->mb_y);
367  return -1;
368  }
369  /* predict coded block pattern */
370  cbp = 0;
371  for(i=0;i<6;i++) {
372  int val = ((code >> (5 - i)) & 1);
373  if (i < 4) {
374  int pred = ff_msmpeg4_coded_block_pred(s, i, &coded_val);
375  val = val ^ pred;
376  *coded_val = val;
377  }
378  cbp |= val << (5 - i);
379  }
380  }
381 
382  if (!s->mb_intra) {
383  int mx, my;
384  wmv2_pred_motion(w, &mx, &my);
385 
386  if(cbp){
387  s->dsp.clear_blocks(s->block[0]);
388  if(s->per_mb_rl_table){
389  s->rl_table_index = decode012(&s->gb);
391  }
392 
393  if(w->abt_flag && w->per_mb_abt){
394  w->per_block_abt= get_bits1(&s->gb);
395  if(!w->per_block_abt)
396  w->abt_type= decode012(&s->gb);
397  }else
398  w->per_block_abt=0;
399  }
400 
401  if (wmv2_decode_motion(w, &mx, &my) < 0)
402  return -1;
403 
404  s->mv_dir = MV_DIR_FORWARD;
405  s->mv_type = MV_TYPE_16X16;
406  s->mv[0][0][0] = mx;
407  s->mv[0][0][1] = my;
408 
409  for (i = 0; i < 6; i++) {
410  if (wmv2_decode_inter_block(w, block[i], i, (cbp >> (5 - i)) & 1) < 0)
411  {
412  av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding inter block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
413  return -1;
414  }
415  }
416  } else {
418  av_dlog(s->avctx, "%d%d ", s->inter_intra_pred, cbp);
419  av_dlog(s->avctx, "I at %d %d %d %06X\n", s->mb_x, s->mb_y,
420  ((cbp & 3) ? 1 : 0) +((cbp & 0x3C)? 2 : 0),
421  show_bits(&s->gb, 24));
422  s->ac_pred = get_bits1(&s->gb);
423  if(s->inter_intra_pred){
425  av_dlog(s->avctx, "%d%d %d %d/",
426  s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
427  }
428  if(s->per_mb_rl_table && cbp){
429  s->rl_table_index = decode012(&s->gb);
431  }
432 
433  s->dsp.clear_blocks(s->block[0]);
434  for (i = 0; i < 6; i++) {
435  if (ff_msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0)
436  {
437  av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding intra block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
438  return -1;
439  }
440  }
441  }
442 
443  return 0;
444 }
445 
447  Wmv2Context * const w= avctx->priv_data;
448 
449  avctx->flags |= CODEC_FLAG_EMU_EDGE;
450 
451  if(ff_msmpeg4_decode_init(avctx) < 0)
452  return -1;
453 
455 
456  ff_intrax8_common_init(&w->x8,&w->s);
457 
458  return 0;
459 }
460 
462 {
463  Wmv2Context *w = avctx->priv_data;
464 
466  return ff_h263_decode_end(avctx);
467 }
468 
470  .name = "wmv2",
471  .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"),
472  .type = AVMEDIA_TYPE_VIDEO,
473  .id = AV_CODEC_ID_WMV2,
474  .priv_data_size = sizeof(Wmv2Context),
478  .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
479  .pix_fmts = ff_pixfmt_list_420,
480 };
static av_cold int wmv2_decode_init(AVCodecContext *avctx)
Definition: wmv2dec.c:446
int inter_intra_pred
Definition: mpegvideo.h:650
int j_type_bit
Definition: wmv2.h:39
#define MB_TYPE_SKIP
Definition: avcodec.h:849
const char const char void * val
Definition: avisynth_c.h:671
int picture_number
Definition: mpegvideo.h:279
const char * s
Definition: avisynth_c.h:668
#define SKIP_TYPE_COL
Definition: wmv2.h:32
int esc3_level_length
Definition: mpegvideo.h:646
#define IS_SKIP(a)
Definition: mpegvideo.h:140
static av_cold int wmv2_decode_end(AVCodecContext *avctx)
Definition: wmv2dec.c:461
#define C
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:255
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:293
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
int per_mb_abt
Definition: wmv2.h:44
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:233
Definition: vf_geq.c:45
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
static int decode_ext_header(Wmv2Context *w)
Definition: wmv2dec.c:81
int abt_type_table[6]
Definition: wmv2.h:43
#define wrap(func)
Definition: w64xmmtest.h:70
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: dsputil.h:113
AVCodec.
Definition: avcodec.h:2922
#define av_cold
Definition: avcodec.h:653
#define MB_NON_INTRA_VLC_BITS
Definition: msmpeg4.h:34
int qscale
QP.
Definition: mpegvideo.h:373
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1254
Predicted.
Definition: avcodec.h:2305
int esc3_run_length
Definition: mpegvideo.h:647
uint8_t
const char * name
Name of the codec implementation.
Definition: avcodec.h:2929
int no_rounding
apply no rounding to motion compensation (MPEG4, msmpeg4, ...) for b-frames rounding mode is always 0...
Definition: mpegvideo.h:443
Picture current_picture
copy of the current picture structure.
Definition: mpegvideo.h:347
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:742
int ff_msmpeg4_decode_motion(MpegEncContext *s, int *mx_ptr, int *my_ptr)
Definition: msmpeg4dec.c:872
MSMPEG4 data tables.
const uint8_t * scantable
Definition: dsputil.h:112
int mb_height
number of MBs horizontally &amp; vertically
Definition: mpegvideo.h:281
enum AVPixelFormat ff_pixfmt_list_420[]
Definition: mpegvideo.c:121
MpegEncContext s
Definition: wmv2.h:36
int ff_wmv2_decode_picture_header(MpegEncContext *s)
Definition: wmv2dec.c:113
#define A(x)
Definition: vp56_arith.h:28
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: avcodec.h:4147
static void parse_mb_skip(Wmv2Context *w)
Definition: wmv2dec.c:31
int rl_chroma_table_index
Definition: mpegvideo.h:638
int mb_skipped
MUST BE SET only during DECODING.
Definition: mpegvideo.h:362
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:151
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: avcodec.h:4168
int per_mb_rl_table
Definition: mpegvideo.h:645
int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
Definition: wmv2dec.c:133
int flags
CODEC_FLAG_*.
Definition: avcodec.h:1234
AVCodec ff_wmv2_decoder
Definition: wmv2dec.c:469
GetBitContext gb
Definition: mpegvideo.h:654
Libavcodec external API header.
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: h263dec.c:368
#define CODEC_CAP_DRAW_HORIZ_BAND
Decoder can use draw_horiz_band callback.
Definition: avcodec.h:736
av_cold void ff_intrax8_common_init(IntraX8Context *w, MpegEncContext *const s)
Initialize IntraX8 frame decoder.
Definition: intrax8.c:691
av_cold void ff_intrax8_common_end(IntraX8Context *w)
Destroy IntraX8 frame structure.
Definition: intrax8.c:713
ret
Definition: avfilter.c:961
void(* clear_blocks)(int16_t *blocks)
Definition: dsputil.h:143
int16_t(*[2] motion_val)[2]
Definition: mpegvideo.h:105
Picture * current_picture_ptr
pointer to the current picture
Definition: mpegvideo.h:351
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:282
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:550
int block_last_index[12]
last non zero coefficient in block
Definition: mpegvideo.h:295
int n
Definition: avisynth_c.h:588
static int16_t * wmv2_pred_motion(Wmv2Context *w, int *px, int *py)
Definition: wmv2dec.c:249
int block_index[6]
index to current MB in block based arrays with edges
Definition: mpegvideo.h:469
static const float pred[4]
Definition: siprdata.h:259
#define MV_TYPE_16X16
1 vector for the whole mb
Definition: mpegvideo.h:425
int first_slice_line
used in mpeg4 too to handle resync markers
Definition: mpegvideo.h:642
int abt_flag
Definition: wmv2.h:41
#define SKIP_TYPE_MPEG
Definition: wmv2.h:30
#define FFMAX(a, b)
Definition: avcodec.h:923
int cbp_table_index
Definition: wmv2.h:47
int debug
debug
Definition: avcodec.h:2442
main external API structure.
Definition: avcodec.h:1146
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:538
VLC ff_inter_intra_vlc
Definition: msmpeg4dec.c:69
int skip_type
Definition: wmv2.h:50
int extradata_size
Definition: avcodec.h:1255
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:299
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:405
#define MB_INTRA_VLC_BITS
Definition: msmpeg4.h:35
int slice_height
in macroblocks
Definition: mpegvideo.h:641
#define MB_TYPE_16x16
Definition: avcodec.h:841
#define mid_pred
Definition: mathops.h:94
DSPContext dsp
pointers for accelerated dsp functions
Definition: mpegvideo.h:395
int ff_intrax8_decode_picture(IntraX8Context *const w, int dquant, int quant_offset)
Decode single IntraX8 frame.
Definition: intrax8.c:729
#define type
#define MV_DIR_FORWARD
Definition: mpegvideo.h:421
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
Definition: mpegvideo.h:381
int bit_rate
wanted bit rate
Definition: mpegvideo.h:252
#define FFABS(a)
Definition: avcodec.h:920
void * priv_data
Definition: avcodec.h:1182
#define FF_DEBUG_PICT_INFO
Definition: avcodec.h:2443
int mv[2][4][2]
motion vectors for a macroblock first coordinate : 0 = forward 1 = backward second &quot; : depend...
Definition: mpegvideo.h:435
int b8_stride
2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
Definition: mpegvideo.h:283
MpegEncContext.
Definition: mpegvideo.h:245
struct AVCodecContext * avctx
Definition: mpegvideo.h:247
#define SKIP_TYPE_NONE
Definition: wmv2.h:29
#define CODEC_FLAG_EMU_EDGE
Don&#39;t draw edges.
Definition: avcodec.h:706
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left &amp; top MBs without sig11 ...
Definition: mpegvideo.h:282
int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
Definition: wmv2dec.c:333
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:130
int hshift
Definition: wmv2.h:51
IntraX8Context x8
Definition: wmv2.h:37
av_cold void ff_wmv2_common_init(Wmv2Context *w)
Definition: wmv2.c:28
int16_t(* block)[64]
points to one of the following blocks
Definition: mpegvideo.h:705
static int decode012(GetBitContext *gb)
Definition: get_bits.h:565
VLC_TYPE(* table)[2]
code, bits
Definition: get_bits.h:65
int rl_table_index
Definition: mpegvideo.h:637
int chroma_qscale
chroma QP
Definition: mpegvideo.h:374
int ff_msmpeg4_decode_block(MpegEncContext *s, int16_t *block, int n, int coded, const uint8_t *scan_table)
Definition: msmpeg4dec.c:637
int mspel_bit
Definition: wmv2.h:46
#define INTER_INTRA_VLC_BITS
Definition: msmpeg4.h:33
uint32_t * mb_type
Definition: mpegvideo.h:108
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:299
int ff_msmpeg4_coded_block_pred(MpegEncContext *s, int n, uint8_t **coded_block_ptr)
Definition: msmpeg4.c:152
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868
#define SKIP_TYPE_ROW
Definition: wmv2.h:31
int mv_table_index
Definition: mpegvideo.h:636
int h263_aic_dir
AIC direction: 0 = left, 1 = top.
Definition: mpegvideo.h:552
int dc_table_index
Definition: mpegvideo.h:639
#define MB_TYPE_L0
Definition: avcodec.h:854
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:198