Mercurial > libavcodec.hg
comparison mpeg12.c @ 5444:38517a9edb50 libavcodec
exchange if() and for() in the MT_FIELD case
18 cpu cycles faster for matrixbench
author | michael |
---|---|
date | Wed, 01 Aug 2007 21:17:26 +0000 |
parents | 40c87c0f754b |
children | 5581a40c673a |
comparison
equal
deleted
inserted
replaced
5443:40c87c0f754b | 5444:38517a9edb50 |
---|---|
416 } | 416 } |
417 } | 417 } |
418 break; | 418 break; |
419 case MT_FIELD: | 419 case MT_FIELD: |
420 s->mv_type = MV_TYPE_FIELD; | 420 s->mv_type = MV_TYPE_FIELD; |
421 for(i=0;i<2;i++) { | 421 if (s->picture_structure == PICT_FRAME) { |
422 if (USES_LIST(mb_type, i)) { | 422 mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED; |
423 s->mv_dir |= (MV_DIR_FORWARD >> i); | 423 for(i=0;i<2;i++) { |
424 if (s->picture_structure == PICT_FRAME) { | 424 if (USES_LIST(mb_type, i)) { |
425 mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED; | 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; |
434 s->last_mv[i][j][1] >> 1); | 434 s->last_mv[i][j][1] >> 1); |
435 s->last_mv[i][j][1] = val << 1; | 435 s->last_mv[i][j][1] = val << 1; |
436 s->mv[i][j][1] = val; | 436 s->mv[i][j][1] = val; |
437 dprintf(s->avctx, "fmy=%d\n", val); | 437 dprintf(s->avctx, "fmy=%d\n", val); |
438 } | 438 } |
439 } else { | 439 } |
440 mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED; | 440 } |
441 } else { | |
442 mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED; | |
443 for(i=0;i<2;i++) { | |
444 if (USES_LIST(mb_type, i)) { | |
445 s->mv_dir |= (MV_DIR_FORWARD >> i); | |
441 s->field_select[i][0] = get_bits1(&s->gb); | 446 s->field_select[i][0] = get_bits1(&s->gb); |
442 for(k=0;k<2;k++) { | 447 for(k=0;k<2;k++) { |
443 val = mpeg_decode_motion(s, s->mpeg_f_code[i][k], | 448 val = mpeg_decode_motion(s, s->mpeg_f_code[i][k], |
444 s->last_mv[i][0][k]); | 449 s->last_mv[i][0][k]); |
445 s->last_mv[i][0][k] = val; | 450 s->last_mv[i][0][k] = val; |