comparison mpeg12.c @ 5445:5581a40c673a libavcodec

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)
author michael
date Wed, 01 Aug 2007 22:12:52 +0000
parents 38517a9edb50
children 26ae667e2595
comparison
equal deleted inserted replaced
5444:38517a9edb50 5445:5581a40c673a
381 if (s->picture_structure == PICT_FRAME) { 381 if (s->picture_structure == PICT_FRAME) {
382 mb_type |= MB_TYPE_16x16; 382 mb_type |= MB_TYPE_16x16;
383 s->mv_type = MV_TYPE_16X16; 383 s->mv_type = MV_TYPE_16X16;
384 for(i=0;i<2;i++) { 384 for(i=0;i<2;i++) {
385 if (USES_LIST(mb_type, i)) { 385 if (USES_LIST(mb_type, i)) {
386 s->mv_dir |= (MV_DIR_FORWARD >> i); 386 s->mv_dir |= (MV_DIR_FORWARD << i);
387 /* MT_FRAME */ 387 /* MT_FRAME */
388 s->mv[i][0][0]= s->last_mv[i][0][0]= s->last_mv[i][1][0] = 388 s->mv[i][0][0]= s->last_mv[i][0][0]= s->last_mv[i][1][0] =
389 mpeg_decode_motion(s, s->mpeg_f_code[i][0], s->last_mv[i][0][0]); 389 mpeg_decode_motion(s, s->mpeg_f_code[i][0], s->last_mv[i][0][0]);
390 s->mv[i][0][1]= s->last_mv[i][0][1]= s->last_mv[i][1][1] = 390 s->mv[i][0][1]= s->last_mv[i][0][1]= s->last_mv[i][1][1] =
391 mpeg_decode_motion(s, s->mpeg_f_code[i][1], s->last_mv[i][0][1]); 391 mpeg_decode_motion(s, s->mpeg_f_code[i][1], s->last_mv[i][0][1]);
399 } else { 399 } else {
400 mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED; 400 mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
401 s->mv_type = MV_TYPE_16X8; 401 s->mv_type = MV_TYPE_16X8;
402 for(i=0;i<2;i++) { 402 for(i=0;i<2;i++) {
403 if (USES_LIST(mb_type, i)) { 403 if (USES_LIST(mb_type, i)) {
404 s->mv_dir |= (MV_DIR_FORWARD >> i); 404 s->mv_dir |= (MV_DIR_FORWARD << i);
405 /* MT_16X8 */ 405 /* MT_16X8 */
406 for(j=0;j<2;j++) { 406 for(j=0;j<2;j++) {
407 s->field_select[i][j] = get_bits1(&s->gb); 407 s->field_select[i][j] = get_bits1(&s->gb);
408 for(k=0;k<2;k++) { 408 for(k=0;k<2;k++) {
409 val = mpeg_decode_motion(s, s->mpeg_f_code[i][k], 409 val = mpeg_decode_motion(s, s->mpeg_f_code[i][k],
420 s->mv_type = MV_TYPE_FIELD; 420 s->mv_type = MV_TYPE_FIELD;
421 if (s->picture_structure == PICT_FRAME) { 421 if (s->picture_structure == PICT_FRAME) {
422 mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED; 422 mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
423 for(i=0;i<2;i++) { 423 for(i=0;i<2;i++) {
424 if (USES_LIST(mb_type, i)) { 424 if (USES_LIST(mb_type, i)) {
425 s->mv_dir |= (MV_DIR_FORWARD >> i); 425 s->mv_dir |= (MV_DIR_FORWARD << i);
426 for(j=0;j<2;j++) { 426 for(j=0;j<2;j++) {
427 s->field_select[i][j] = get_bits1(&s->gb); 427 s->field_select[i][j] = get_bits1(&s->gb);
428 val = mpeg_decode_motion(s, s->mpeg_f_code[i][0], 428 val = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
429 s->last_mv[i][j][0]); 429 s->last_mv[i][j][0]);
430 s->last_mv[i][j][0] = val; 430 s->last_mv[i][j][0] = val;
440 } 440 }
441 } else { 441 } else {
442 mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED; 442 mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED;
443 for(i=0;i<2;i++) { 443 for(i=0;i<2;i++) {
444 if (USES_LIST(mb_type, i)) { 444 if (USES_LIST(mb_type, i)) {
445 s->mv_dir |= (MV_DIR_FORWARD >> i); 445 s->mv_dir |= (MV_DIR_FORWARD << i);
446 s->field_select[i][0] = get_bits1(&s->gb); 446 s->field_select[i][0] = get_bits1(&s->gb);
447 for(k=0;k<2;k++) { 447 for(k=0;k<2;k++) {
448 val = mpeg_decode_motion(s, s->mpeg_f_code[i][k], 448 val = mpeg_decode_motion(s, s->mpeg_f_code[i][k],
449 s->last_mv[i][0][k]); 449 s->last_mv[i][0][k]);
450 s->last_mv[i][0][k] = val; 450 s->last_mv[i][0][k] = val;
458 case MT_DMV: 458 case MT_DMV:
459 s->mv_type = MV_TYPE_DMV; 459 s->mv_type = MV_TYPE_DMV;
460 for(i=0;i<2;i++) { 460 for(i=0;i<2;i++) {
461 if (USES_LIST(mb_type, i)) { 461 if (USES_LIST(mb_type, i)) {
462 int dmx, dmy, mx, my, m; 462 int dmx, dmy, mx, my, m;
463 s->mv_dir |= (MV_DIR_FORWARD >> i); 463 s->mv_dir |= (MV_DIR_FORWARD << i);
464 mx = mpeg_decode_motion(s, s->mpeg_f_code[i][0], 464 mx = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
465 s->last_mv[i][0][0]); 465 s->last_mv[i][0][0]);
466 s->last_mv[i][0][0] = mx; 466 s->last_mv[i][0][0] = mx;
467 s->last_mv[i][1][0] = mx; 467 s->last_mv[i][1][0] = mx;
468 dmx = get_dmv(s); 468 dmx = get_dmv(s);