Revision 653f7387

View differences:

libavcodec/h263.c
910 910
        int i, cbp;
911 911

  
912 912
        if(s->pict_type==B_TYPE){
913
            static const int mb_type_table[8]= {-1, 2, 3, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */
913
            static const int mb_type_table[8]= {-1, 3, 2, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */
914 914
            int mb_type=  mb_type_table[s->mv_dir];
915 915

  
916 916
            if(s->mb_x==0){
libavcodec/mpeg12.c
383 383
                    s->mv_type = MV_TYPE_16X16;
384 384
                    for(i=0;i<2;i++) {
385 385
                        if (USES_LIST(mb_type, i)) {
386
                            s->mv_dir |= (MV_DIR_FORWARD >> i);
386
                            s->mv_dir |= (MV_DIR_FORWARD << i);
387 387
                            /* MT_FRAME */
388 388
                            s->mv[i][0][0]= s->last_mv[i][0][0]= s->last_mv[i][1][0] =
389 389
                                mpeg_decode_motion(s, s->mpeg_f_code[i][0], s->last_mv[i][0][0]);
......
401 401
                    s->mv_type = MV_TYPE_16X8;
402 402
                    for(i=0;i<2;i++) {
403 403
                        if (USES_LIST(mb_type, i)) {
404
                            s->mv_dir |= (MV_DIR_FORWARD >> i);
404
                            s->mv_dir |= (MV_DIR_FORWARD << i);
405 405
                            /* MT_16X8 */
406 406
                            for(j=0;j<2;j++) {
407 407
                                s->field_select[i][j] = get_bits1(&s->gb);
......
422 422
                    mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
423 423
                    for(i=0;i<2;i++) {
424 424
                        if (USES_LIST(mb_type, i)) {
425
                            s->mv_dir |= (MV_DIR_FORWARD >> i);
425
                            s->mv_dir |= (MV_DIR_FORWARD << i);
426 426
                            for(j=0;j<2;j++) {
427 427
                                s->field_select[i][j] = get_bits1(&s->gb);
428 428
                                val = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
......
442 442
                    mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED;
443 443
                    for(i=0;i<2;i++) {
444 444
                        if (USES_LIST(mb_type, i)) {
445
                            s->mv_dir |= (MV_DIR_FORWARD >> i);
445
                            s->mv_dir |= (MV_DIR_FORWARD << i);
446 446
                            s->field_select[i][0] = get_bits1(&s->gb);
447 447
                            for(k=0;k<2;k++) {
448 448
                                val = mpeg_decode_motion(s, s->mpeg_f_code[i][k],
......
460 460
                for(i=0;i<2;i++) {
461 461
                    if (USES_LIST(mb_type, i)) {
462 462
                        int dmx, dmy, mx, my, m;
463
                        s->mv_dir |= (MV_DIR_FORWARD >> i);
463
                        s->mv_dir |= (MV_DIR_FORWARD << i);
464 464
                        mx = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
465 465
                                                s->last_mv[i][0][0]);
466 466
                        s->last_mv[i][0][0] = mx;
libavcodec/mpeg12enc.c
562 562
            }
563 563
            s->f_count++;
564 564
        } else{
565
            static const int mb_type_len[4]={0,3,4,2}; //bak,for,bi
565
            static const int mb_type_len[4]={0,4,3,2}; //bak,for,bi
566 566

  
567 567
            if(s->mv_type == MV_TYPE_16X16){
568 568
                if (cbp){    // With coded bloc pattern
libavcodec/mpegvideo.h
368 368
    uint8_t (*b_field_select_table[2][2]);
369 369
    int me_method;                       ///< ME algorithm
370 370
    int mv_dir;
371
#define MV_DIR_BACKWARD  1
372
#define MV_DIR_FORWARD   2
371
#define MV_DIR_FORWARD   1
372
#define MV_DIR_BACKWARD  2
373 373
#define MV_DIRECT        4 ///< bidirectional mode where the difference equals the MV of the last P/S/I-Frame (mpeg4)
374 374
    int mv_type;
375 375
#define MV_TYPE_16X16       0   ///< 1 vector for the whole mb

Also available in: Unified diff