[FFmpeg-cvslog] r9864 - in trunk/libavcodec: h263.c mpeg12.c mpeg12enc.c mpegvideo.h

michael subversion
Thu Aug 2 00:12:53 CEST 2007


Author: michael
Date: Thu Aug  2 00:12:52 2007
New Revision: 9864

Log:
exchange the values of MV_DIR_FORWARD and MV_DIR_BACKWARD (this is more sane,
matches the order of some other stuff and allows some simplifications)


Modified:
   trunk/libavcodec/h263.c
   trunk/libavcodec/mpeg12.c
   trunk/libavcodec/mpeg12enc.c
   trunk/libavcodec/mpegvideo.h

Modified: trunk/libavcodec/h263.c
==============================================================================
--- trunk/libavcodec/h263.c	(original)
+++ trunk/libavcodec/h263.c	Thu Aug  2 00:12:52 2007
@@ -910,7 +910,7 @@ void mpeg4_encode_mb(MpegEncContext * s,
         int i, cbp;
 
         if(s->pict_type==B_TYPE){
-            static const int mb_type_table[8]= {-1, 2, 3, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */
+            static const int mb_type_table[8]= {-1, 3, 2, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */
             int mb_type=  mb_type_table[s->mv_dir];
 
             if(s->mb_x==0){

Modified: trunk/libavcodec/mpeg12.c
==============================================================================
--- trunk/libavcodec/mpeg12.c	(original)
+++ trunk/libavcodec/mpeg12.c	Thu Aug  2 00:12:52 2007
@@ -383,7 +383,7 @@ static int mpeg_decode_mb(MpegEncContext
                     s->mv_type = MV_TYPE_16X16;
                     for(i=0;i<2;i++) {
                         if (USES_LIST(mb_type, i)) {
-                            s->mv_dir |= (MV_DIR_FORWARD >> i);
+                            s->mv_dir |= (MV_DIR_FORWARD << i);
                             /* MT_FRAME */
                             s->mv[i][0][0]= s->last_mv[i][0][0]= s->last_mv[i][1][0] =
                                 mpeg_decode_motion(s, s->mpeg_f_code[i][0], s->last_mv[i][0][0]);
@@ -401,7 +401,7 @@ static int mpeg_decode_mb(MpegEncContext
                     s->mv_type = MV_TYPE_16X8;
                     for(i=0;i<2;i++) {
                         if (USES_LIST(mb_type, i)) {
-                            s->mv_dir |= (MV_DIR_FORWARD >> i);
+                            s->mv_dir |= (MV_DIR_FORWARD << i);
                             /* MT_16X8 */
                             for(j=0;j<2;j++) {
                                 s->field_select[i][j] = get_bits1(&s->gb);
@@ -422,7 +422,7 @@ static int mpeg_decode_mb(MpegEncContext
                     mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
                     for(i=0;i<2;i++) {
                         if (USES_LIST(mb_type, i)) {
-                            s->mv_dir |= (MV_DIR_FORWARD >> i);
+                            s->mv_dir |= (MV_DIR_FORWARD << i);
                             for(j=0;j<2;j++) {
                                 s->field_select[i][j] = get_bits1(&s->gb);
                                 val = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
@@ -442,7 +442,7 @@ static int mpeg_decode_mb(MpegEncContext
                     mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED;
                     for(i=0;i<2;i++) {
                         if (USES_LIST(mb_type, i)) {
-                            s->mv_dir |= (MV_DIR_FORWARD >> i);
+                            s->mv_dir |= (MV_DIR_FORWARD << i);
                             s->field_select[i][0] = get_bits1(&s->gb);
                             for(k=0;k<2;k++) {
                                 val = mpeg_decode_motion(s, s->mpeg_f_code[i][k],
@@ -460,7 +460,7 @@ static int mpeg_decode_mb(MpegEncContext
                 for(i=0;i<2;i++) {
                     if (USES_LIST(mb_type, i)) {
                         int dmx, dmy, mx, my, m;
-                        s->mv_dir |= (MV_DIR_FORWARD >> i);
+                        s->mv_dir |= (MV_DIR_FORWARD << i);
                         mx = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
                                                 s->last_mv[i][0][0]);
                         s->last_mv[i][0][0] = mx;

Modified: trunk/libavcodec/mpeg12enc.c
==============================================================================
--- trunk/libavcodec/mpeg12enc.c	(original)
+++ trunk/libavcodec/mpeg12enc.c	Thu Aug  2 00:12:52 2007
@@ -562,7 +562,7 @@ static av_always_inline void mpeg1_encod
             }
             s->f_count++;
         } else{
-            static const int mb_type_len[4]={0,3,4,2}; //bak,for,bi
+            static const int mb_type_len[4]={0,4,3,2}; //bak,for,bi
 
             if(s->mv_type == MV_TYPE_16X16){
                 if (cbp){    // With coded bloc pattern

Modified: trunk/libavcodec/mpegvideo.h
==============================================================================
--- trunk/libavcodec/mpegvideo.h	(original)
+++ trunk/libavcodec/mpegvideo.h	Thu Aug  2 00:12:52 2007
@@ -368,8 +368,8 @@ typedef struct MpegEncContext {
     uint8_t (*b_field_select_table[2][2]);
     int me_method;                       ///< ME algorithm
     int mv_dir;
-#define MV_DIR_BACKWARD  1
-#define MV_DIR_FORWARD   2
+#define MV_DIR_FORWARD   1
+#define MV_DIR_BACKWARD  2
 #define MV_DIRECT        4 ///< bidirectional mode where the difference equals the MV of the last P/S/I-Frame (mpeg4)
     int mv_type;
 #define MV_TYPE_16X16       0   ///< 1 vector for the whole mb




More information about the ffmpeg-cvslog mailing list