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){
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]);
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);
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],
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],
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;
}
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
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