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 "dsputil.h"
23 #include "mpegvideo.h"
24 #include "h263.h"
25 #include "mathops.h"
26 #include "msmpeg4.h"
27 #include "msmpeg4data.h"
28 #include "intrax8.h"
29 #include "wmv2.h"
30 
31 
32 static void parse_mb_skip(Wmv2Context * w){
33  int mb_x, mb_y;
34  MpegEncContext * const s= &w->s;
35  uint32_t * const mb_type = s->current_picture_ptr->f.mb_type;
36 
37  w->skip_type= get_bits(&s->gb, 2);
38  switch(w->skip_type){
39  case SKIP_TYPE_NONE:
40  for(mb_y=0; mb_y<s->mb_height; mb_y++){
41  for(mb_x=0; mb_x<s->mb_width; mb_x++){
42  mb_type[mb_y*s->mb_stride + mb_x]= MB_TYPE_16x16 | MB_TYPE_L0;
43  }
44  }
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]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
50  }
51  }
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]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
58  }
59  }else{
60  for(mb_x=0; mb_x<s->mb_width; mb_x++){
61  mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
62  }
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]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
71  }
72  }else{
73  for(mb_y=0; mb_y<s->mb_height; mb_y++){
74  mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
75  }
76  }
77  }
78  break;
79  }
80 }
81 
83  MpegEncContext * const s= &w->s;
84  GetBitContext gb;
85  int fps;
86  int code;
87 
88  if(s->avctx->extradata_size<4) return -1;
89 
90  init_get_bits(&gb, s->avctx->extradata, 32);
91 
92  fps = get_bits(&gb, 5);
93  s->bit_rate = get_bits(&gb, 11)*1024;
94  w->mspel_bit = get_bits1(&gb);
95  s->loop_filter = get_bits1(&gb);
96  w->abt_flag = get_bits1(&gb);
97  w->j_type_bit = get_bits1(&gb);
98  w->top_left_mv_flag= get_bits1(&gb);
99  w->per_mb_rl_bit = get_bits1(&gb);
100  code = get_bits(&gb, 3);
101 
102  if(code==0) return -1;
103 
104  s->slice_height = s->mb_height / code;
105 
107  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",
108  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,
109  code);
110  }
111  return 0;
112 }
113 
115 {
116  Wmv2Context * const w= (Wmv2Context*)s;
117  int code;
118 
119  if(s->picture_number==0)
121 
122  s->pict_type = get_bits1(&s->gb) + 1;
123  if(s->pict_type == AV_PICTURE_TYPE_I){
124  code = get_bits(&s->gb, 7);
125  av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code);
126  }
127  s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
128  if(s->qscale <= 0)
129  return -1;
130 
131  return 0;
132 }
133 
135 {
136  Wmv2Context * const w= (Wmv2Context*)s;
137 
138  if (s->pict_type == AV_PICTURE_TYPE_I) {
139  if(w->j_type_bit) w->j_type= get_bits1(&s->gb);
140  else w->j_type= 0; //FIXME check
141 
142  if(!w->j_type){
143  if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);
144  else s->per_mb_rl_table= 0;
145 
146  if(!s->per_mb_rl_table){
148  s->rl_table_index = decode012(&s->gb);
149  }
150 
151  s->dc_table_index = get_bits1(&s->gb);
152  }
153  s->inter_intra_pred= 0;
154  s->no_rounding = 1;
156  av_log(s->avctx, AV_LOG_DEBUG, "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n",
157  s->qscale,
159  s->rl_table_index,
160  s->dc_table_index,
161  s->per_mb_rl_table,
162  w->j_type);
163  }
164  }else{
165  int cbp_index;
166  w->j_type=0;
167 
168  parse_mb_skip(w);
169  cbp_index= decode012(&s->gb);
170  if(s->qscale <= 10){
171  int map[3]= {0,2,1};
172  w->cbp_table_index= map[cbp_index];
173  }else if(s->qscale <= 20){
174  int map[3]= {1,0,2};
175  w->cbp_table_index= map[cbp_index];
176  }else{
177  int map[3]= {2,1,0};
178  w->cbp_table_index= map[cbp_index];
179  }
180 
181  if(w->mspel_bit) s->mspel= get_bits1(&s->gb);
182  else 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 
191  if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);
192  else 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 
206  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",
207  s->rl_table_index,
209  s->dc_table_index,
210  s->mv_table_index,
211  s->per_mb_rl_table,
212  s->qscale,
213  s->mspel,
214  w->per_mb_abt,
215  w->abt_type,
216  w->cbp_table_index,
217  s->inter_intra_pred);
218  }
219  }
220  s->esc3_level_length= 0;
221  s->esc3_run_length= 0;
222 
223 s->picture_number++; //FIXME ?
224 
225 
226  if(w->j_type){
227  ff_intrax8_decode_picture(&w->x8, 2*s->qscale, (s->qscale-1)|1 );
228  return 1;
229  }
230 
231  return 0;
232 }
233 
234 static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr){
235  MpegEncContext * const s= &w->s;
236  int ret;
237 
238  ret= ff_msmpeg4_decode_motion(s, mx_ptr, my_ptr);
239 
240  if(ret<0) return -1;
241 
242  if((((*mx_ptr)|(*my_ptr)) & 1) && s->mspel)
243  w->hshift= get_bits1(&s->gb);
244  else
245  w->hshift= 0;
246 
247 //printf("%d %d ", *mx_ptr, *my_ptr);
248 
249  return 0;
250 }
251 
252 static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py){
253  MpegEncContext * const s= &w->s;
254  int xy, wrap, diff, type;
255  int16_t *A, *B, *C, *mot_val;
256 
257  wrap = s->b8_stride;
258  xy = s->block_index[0];
259 
260  mot_val = s->current_picture.f.motion_val[0][xy];
261 
262  A = s->current_picture.f.motion_val[0][xy - 1];
263  B = s->current_picture.f.motion_val[0][xy - wrap];
264  C = s->current_picture.f.motion_val[0][xy + 2 - wrap];
265 
266  if(s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag)
267  diff= FFMAX(FFABS(A[0] - B[0]), FFABS(A[1] - B[1]));
268  else
269  diff=0;
270 
271  if(diff >= 8)
272  type= get_bits1(&s->gb);
273  else
274  type= 2;
275 
276  if(type == 0){
277  *px= A[0];
278  *py= A[1];
279  }else if(type == 1){
280  *px= B[0];
281  *py= B[1];
282  }else{
283  /* special case for first (slice) line */
284  if (s->first_slice_line) {
285  *px = A[0];
286  *py = A[1];
287  } else {
288  *px = mid_pred(A[0], B[0], C[0]);
289  *py = mid_pred(A[1], B[1], C[1]);
290  }
291  }
292 
293  return mot_val;
294 }
295 
296 static inline int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n, int cbp){
297  MpegEncContext * const s= &w->s;
298  static const int sub_cbp_table[3]= {2,3,1};
299  int sub_cbp;
300 
301  if(!cbp){
302  s->block_last_index[n] = -1;
303 
304  return 0;
305  }
306 
307  if(w->per_block_abt)
308  w->abt_type= decode012(&s->gb);
309  w->abt_type_table[n]= w->abt_type;
310 
311  if(w->abt_type){
312 // const uint8_t *scantable= w->abt_scantable[w->abt_type-1].permutated;
313  const uint8_t *scantable= w->abt_scantable[w->abt_type-1].scantable;
314 // const uint8_t *scantable= w->abt_type-1 ? w->abt_scantable[1].permutated : w->abt_scantable[0].scantable;
315 
316  sub_cbp= sub_cbp_table[ decode012(&s->gb) ];
317 // printf("S%d", sub_cbp);
318 
319  if(sub_cbp&1){
320  if (ff_msmpeg4_decode_block(s, block, n, 1, scantable) < 0)
321  return -1;
322  }
323 
324  if(sub_cbp&2){
325  if (ff_msmpeg4_decode_block(s, w->abt_block2[n], n, 1, scantable) < 0)
326  return -1;
327  }
328  s->block_last_index[n] = 63;
329 
330  return 0;
331  }else{
332  return ff_msmpeg4_decode_block(s, block, n, 1, s->inter_scantable.permutated);
333  }
334 }
335 
336 
338 {
339  Wmv2Context * const w= (Wmv2Context*)s;
340  int cbp, code, i;
341  uint8_t *coded_val;
342 
343  if(w->j_type) return 0;
344 
345  if (s->pict_type == AV_PICTURE_TYPE_P) {
346  if (IS_SKIP(s->current_picture.f.mb_type[s->mb_y * s->mb_stride + s->mb_x])) {
347  /* skip mb */
348  s->mb_intra = 0;
349  for(i=0;i<6;i++)
350  s->block_last_index[i] = -1;
351  s->mv_dir = MV_DIR_FORWARD;
352  s->mv_type = MV_TYPE_16X16;
353  s->mv[0][0][0] = 0;
354  s->mv[0][0][1] = 0;
355  s->mb_skipped = 1;
356  w->hshift=0;
357  return 0;
358  }
359 
361  if (code < 0)
362  return -1;
363  s->mb_intra = (~code & 0x40) >> 6;
364 
365  cbp = code & 0x3f;
366  } else {
367  s->mb_intra = 1;
369  if (code < 0){
370  av_log(s->avctx, AV_LOG_ERROR, "II-cbp illegal at %d %d\n", s->mb_x, s->mb_y);
371  return -1;
372  }
373  /* predict coded block pattern */
374  cbp = 0;
375  for(i=0;i<6;i++) {
376  int val = ((code >> (5 - i)) & 1);
377  if (i < 4) {
378  int pred = ff_msmpeg4_coded_block_pred(s, i, &coded_val);
379  val = val ^ pred;
380  *coded_val = val;
381  }
382  cbp |= val << (5 - i);
383  }
384  }
385 
386  if (!s->mb_intra) {
387  int mx, my;
388 //printf("P at %d %d\n", s->mb_x, s->mb_y);
389  wmv2_pred_motion(w, &mx, &my);
390 
391  if(cbp){
392  s->dsp.clear_blocks(s->block[0]);
393  if(s->per_mb_rl_table){
394  s->rl_table_index = decode012(&s->gb);
396  }
397 
398  if(w->abt_flag && w->per_mb_abt){
399  w->per_block_abt= get_bits1(&s->gb);
400  if(!w->per_block_abt)
401  w->abt_type= decode012(&s->gb);
402  }else
403  w->per_block_abt=0;
404  }
405 
406  if (wmv2_decode_motion(w, &mx, &my) < 0)
407  return -1;
408 
409  s->mv_dir = MV_DIR_FORWARD;
410  s->mv_type = MV_TYPE_16X16;
411  s->mv[0][0][0] = mx;
412  s->mv[0][0][1] = my;
413 
414  for (i = 0; i < 6; i++) {
415  if (wmv2_decode_inter_block(w, block[i], i, (cbp >> (5 - i)) & 1) < 0)
416  {
417  av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding inter block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
418  return -1;
419  }
420  }
421  } else {
422 //if(s->pict_type==AV_PICTURE_TYPE_P)
423 // printf("%d%d ", s->inter_intra_pred, cbp);
424 //printf("I at %d %d %d %06X\n", s->mb_x, s->mb_y, ((cbp&3)? 1 : 0) +((cbp&0x3C)? 2 : 0), show_bits(&s->gb, 24));
425  s->ac_pred = get_bits1(&s->gb);
426  if(s->inter_intra_pred){
428 // printf("%d%d %d %d/", s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
429  }
430  if(s->per_mb_rl_table && cbp){
431  s->rl_table_index = decode012(&s->gb);
433  }
434 
435  s->dsp.clear_blocks(s->block[0]);
436  for (i = 0; i < 6; i++) {
437  if (ff_msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0)
438  {
439  av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding intra block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
440  return -1;
441  }
442  }
443  }
444 
445  return 0;
446 }
447 
449  Wmv2Context * const w= avctx->priv_data;
450 
451  if(avctx->idct_algo==FF_IDCT_AUTO){
452  avctx->idct_algo=FF_IDCT_WMV2;
453  }
454 
455  if(ff_msmpeg4_decode_init(avctx) < 0)
456  return -1;
457 
459 
460  ff_intrax8_common_init(&w->x8,&w->s);
461 
462  return 0;
463 }
464 
466 {
467  Wmv2Context *w = avctx->priv_data;
468 
470  return ff_h263_decode_end(avctx);
471 }
472 
474  .name = "wmv2",
475  .type = AVMEDIA_TYPE_VIDEO,
476  .id = CODEC_ID_WMV2,
477  .priv_data_size = sizeof(Wmv2Context),
481  .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
482  .max_lowres = 3,
483  .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"),
484  .pix_fmts= ff_pixfmt_list_420,
485 };
static av_cold int wmv2_decode_init(AVCodecContext *avctx)
Definition: wmv2dec.c:448
int inter_intra_pred
Definition: mpegvideo.h:599
int j_type_bit
Definition: wmv2.h:38
#define MB_TYPE_L0
Definition: avcodec.h:823
int picture_number
Definition: mpegvideo.h:235
#define SKIP_TYPE_COL
Definition: wmv2.h:32
int esc3_level_length
Definition: mpegvideo.h:595
#define IS_SKIP(a)
Definition: mpegvideo.h:101
static av_cold int wmv2_decode_end(AVCodecContext *avctx)
Definition: wmv2dec.c:465
int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
Definition: wmv2dec.c:134
#define B
Definition: dsputil.c:1975
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:237
VLC ff_inter_intra_vlc
Definition: msmpeg4.c:1047
Definition: vf_drawbox.c:32
int per_mb_abt
Definition: wmv2.h:43
int ff_msmpeg4_decode_init(AVCodecContext *avctx)
Definition: msmpeg4.c:1258
static int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr)
Definition: wmv2dec.c:234
int ff_msmpeg4_decode_block(MpegEncContext *s, DCTELEM *block, int n, int coded, const uint8_t *scan_table)
Definition: msmpeg4.c:1608
static int decode_ext_header(Wmv2Context *w)
Definition: wmv2dec.c:82
int abt_type_table[6]
Definition: wmv2.h:42
int wrap
Definition: rotozoom.c:164
mpegvideo header.
int per_mb_rl_bit
Definition: wmv2.h:48
uint8_t permutated[64]
Definition: dsputil.h:198
DCTELEM abt_block2[6][64]
Definition: wmv2.h:53
AVCodec.
Definition: avcodec.h:3189
#define MB_NON_INTRA_VLC_BITS
Definition: msmpeg4.h:31
int qscale
QP.
Definition: mpegvideo.h:324
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
Definition: h263dec.c:338
int esc3_run_length
Definition: mpegvideo.h:596
VLC ff_mb_non_intra_vlc[4]
Definition: msmpeg4.c:1041
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
Definition: mimic.c:228
#define av_cold
Definition: attributes.h:71
#define FF_DEBUG_PICT_INFO
Definition: avcodec.h:2008
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1387
int no_rounding
apply no rounding to motion compensation (MPEG4, msmpeg4, ...) for b-frames rounding mode is always 0...
Definition: mpegvideo.h:388
Picture current_picture
copy of the current picture structure.
Definition: mpegvideo.h:295
MSMPEG4 data tables.
const uint8_t * scantable
Definition: dsputil.h:197
int mb_height
number of MBs horizontally & vertically
Definition: mpegvideo.h:237
MpegEncContext s
Definition: wmv2.h:36
enum PixelFormat ff_pixfmt_list_420[]
Definition: mpegvideo.c:130
static int init(AVCodecParserContext *s)
Definition: h264_parser.c:336
#define FF_IDCT_AUTO
Definition: avcodec.h:1911
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:719
int ff_wmv2_decode_picture_header(MpegEncContext *s)
Definition: wmv2dec.c:114
static void parse_mb_skip(Wmv2Context *w)
Definition: wmv2dec.c:32
int rl_chroma_table_index
Definition: mpegvideo.h:587
int mb_skipped
MUST BE SET only during DECODING.
Definition: mpegvideo.h:313
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:191
int per_mb_rl_table
Definition: mpegvideo.h:594
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:140
const char * name
Name of the codec implementation.
Definition: avcodec.h:3196
AVCodec ff_wmv2_decoder
Definition: wmv2dec.c:473
GetBitContext gb
Definition: mpegvideo.h:603
#define FFMAX(a, b)
Definition: common.h:53
static DCTELEM block[64]
Definition: dct-test.c:189
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:708
int idct_algo
IDCT algorithm, see FF_IDCT_* below.
Definition: avcodec.h:1910
Picture * current_picture_ptr
pointer to the current picture
Definition: mpegvideo.h:299
ScanTable abt_scantable[2]
Definition: wmv2.h:52
int abt_type
Definition: wmv2.h:41
#define FFABS(a)
Definition: common.h:50
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:481
int block_last_index[12]
last non zero coefficient in block
Definition: mpegvideo.h:251
static int16_t * wmv2_pred_motion(Wmv2Context *w, int *px, int *py)
Definition: wmv2dec.c:252
int block_index[6]
index to current MB in block based arrays with edges
Definition: mpegvideo.h:414
static const float pred[4]
Definition: siprdata.h:259
uint32_t * mb_type
macroblock type table mb_type_base + mb_width + 2
Definition: avcodec.h:1117
#define MV_TYPE_16X16
1 vector for the whole mb
Definition: mpegvideo.h:370
int first_slice_line
used in mpeg4 too to handle resync markers
Definition: mpegvideo.h:591
NULL
Definition: eval.c:50
#define FF_IDCT_WMV2
Definition: avcodec.h:1930
int abt_flag
Definition: wmv2.h:40
external API header
#define SKIP_TYPE_MPEG
Definition: wmv2.h:30
int cbp_table_index
Definition: wmv2.h:46
int debug
debug
Definition: avcodec.h:2007
main external API structure.
Definition: avcodec.h:1329
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:327
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:111
int16_t(*[2] motion_val)[2]
motion vector table
Definition: avcodec.h:1109
int skip_type
Definition: wmv2.h:49
int extradata_size
Definition: avcodec.h:1388
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:268
#define CODEC_CAP_DRAW_HORIZ_BAND
Definition: avcodec.h:713
int ff_msmpeg4_decode_motion(MpegEncContext *s, int *mx_ptr, int *my_ptr)
Definition: msmpeg4.c:1843
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:354
struct Wmv2Context Wmv2Context
#define MB_INTRA_VLC_BITS
Definition: msmpeg4.h:32
int slice_height
in macroblocks
Definition: mpegvideo.h:590
#define mid_pred
Definition: mathops.h:88
DSPContext dsp
pointers for accelerated dsp functions
Definition: mpegvideo.h:343
int ff_intrax8_decode_picture(IntraX8Context *const w, int dquant, int quant_offset)
Decode single IntraX8 frame.
Definition: intrax8.c:725
short DCTELEM
Definition: dsputil.h:39
#define MB_TYPE_SKIP
Definition: avcodec.h:818
#define MV_DIR_FORWARD
Definition: mpegvideo.h:366
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
Definition: mpegvideo.h:331
int bit_rate
wanted bit rate
Definition: mpegvideo.h:208
DCTELEM(* block)[64]
points to one of the following blocks
Definition: mpegvideo.h:651
int mv[2][4][2]
motion vectors for a macroblock first coordinate : 0 = forward 1 = backward second " : depend...
Definition: mpegvideo.h:380
int b8_stride
2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
Definition: mpegvideo.h:239
void(* clear_blocks)(DCTELEM *blocks)
Definition: dsputil.h:266
MpegEncContext.
Definition: mpegvideo.h:201
struct AVCodecContext * avctx
Definition: mpegvideo.h:203
#define SKIP_TYPE_NONE
Definition: wmv2.h:29
int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
Definition: wmv2dec.c:337
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 ...
Definition: mpegvideo.h:238
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:125
int per_block_abt
Definition: wmv2.h:44
DSP utils.
int ff_h263_decode_end(AVCodecContext *avctx)
Definition: h263dec.c:121
void * priv_data
Definition: avcodec.h:1531
int hshift
Definition: wmv2.h:50
IntraX8Context x8
Definition: wmv2.h:37
av_cold void ff_wmv2_common_init(Wmv2Context *w)
Definition: wmv2.c:28
static int decode012(GetBitContext *gb)
Definition: get_bits.h:495
VLC_TYPE(* table)[2]
code, bits
Definition: get_bits.h:65
#define MB_TYPE_16x16
Definition: avcodec.h:810
int rl_table_index
Definition: mpegvideo.h:586
int chroma_qscale
chroma QP
Definition: mpegvideo.h:325
struct AVFrame f
Definition: mpegvideo.h:86
int mspel_bit
Definition: wmv2.h:45
#define INTER_INTRA_VLC_BITS
Definition: msmpeg4.h:30
VLC ff_msmp4_mb_i_vlc
Definition: msmpeg4data.c:32
ScanTable inter_scantable
if inter == intra then intra should be used to reduce tha cache usage
Definition: mpegvideo.h:255
int ff_msmpeg4_coded_block_pred(MpegEncContext *s, int n, uint8_t **coded_block_ptr)
Definition: msmpeg4.c:424
#define SKIP_TYPE_ROW
Definition: wmv2.h:31
int mv_table_index
Definition: mpegvideo.h:585
int h263_aic_dir
AIC direction: 0 = left, 1 = top.
Definition: mpegvideo.h:502
int dc_table_index
Definition: mpegvideo.h:588
static int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n, int cbp)
Definition: wmv2dec.c:296
Predicted.
Definition: avutil.h:297
int top_left_mv_flag
Definition: wmv2.h:47
int j_type
Definition: wmv2.h:39