comparison mpeg12.c @ 58:0e0a24def67a libavcodec

fixed last zero mv for field - fixed mismatch handling for intra coefs
author glantau
date Sat, 11 Aug 2001 22:08:23 +0000
parents 764f2eaf711e
children efd3c19f6d62
comparison
equal deleted inserted replaced
57:4efb718f4dc6 58:0e0a24def67a
631 if (s->pict_type == P_TYPE && !(mb_type & MB_FOR)) { 631 if (s->pict_type == P_TYPE && !(mb_type & MB_FOR)) {
632 s->mv_dir = MV_DIR_FORWARD; 632 s->mv_dir = MV_DIR_FORWARD;
633 s->mv_type = MV_TYPE_16X16; 633 s->mv_type = MV_TYPE_16X16;
634 s->last_mv[0][0][0] = 0; 634 s->last_mv[0][0][0] = 0;
635 s->last_mv[0][0][1] = 0; 635 s->last_mv[0][0][1] = 0;
636 s->last_mv[0][1][0] = 0;
637 s->last_mv[0][1][1] = 0;
636 s->mv[0][0][0] = 0; 638 s->mv[0][0][0] = 0;
637 s->mv[0][0][1] = 0; 639 s->mv[0][0][1] = 0;
638 } else if (mb_type & (MB_FOR | MB_BACK)) { 640 } else if (mb_type & (MB_FOR | MB_BACK)) {
639 /* motion vectors */ 641 /* motion vectors */
640 s->mv_dir = 0; 642 s->mv_dir = 0;
641 for(i=0;i<2;i++) { 643 for(i=0;i<2;i++) {
642 if (mb_type & (MB_FOR >> i)) { 644 if (mb_type & (MB_FOR >> i)) {
643 s->mv_dir |= (MV_DIR_FORWARD >> i); 645 s->mv_dir |= (MV_DIR_FORWARD >> i);
644 dprintf("mv_type=%d\n", motion_type); 646 dprintf("motion_type=%d\n", motion_type);
645 switch(motion_type) { 647 switch(motion_type) {
646 case MT_FRAME: /* or MT_16X8 */ 648 case MT_FRAME: /* or MT_16X8 */
647 if (s->picture_structure == PICT_FRAME) { 649 if (s->picture_structure == PICT_FRAME) {
648 /* MT_FRAME */ 650 /* MT_FRAME */
649 s->mv_type = MV_TYPE_16X16; 651 s->mv_type = MV_TYPE_16X16;
1004 1006
1005 if (s->alternate_scan) 1007 if (s->alternate_scan)
1006 scan_table = ff_alternate_vertical_scan; 1008 scan_table = ff_alternate_vertical_scan;
1007 else 1009 else
1008 scan_table = zigzag_direct; 1010 scan_table = zigzag_direct;
1009 mismatch = 1;
1010 1011
1011 /* DC coef */ 1012 /* DC coef */
1012 component = (n <= 3 ? 0 : n - 4 + 1); 1013 component = (n <= 3 ? 0 : n - 4 + 1);
1013 diff = decode_dc(s, component); 1014 diff = decode_dc(s, component);
1014 if (diff >= 0xffff) 1015 if (diff >= 0xffff)
1016 dc = s->last_dc[component]; 1017 dc = s->last_dc[component];
1017 dc += diff; 1018 dc += diff;
1018 s->last_dc[component] = dc; 1019 s->last_dc[component] = dc;
1019 block[0] = dc << (3 - s->intra_dc_precision); 1020 block[0] = dc << (3 - s->intra_dc_precision);
1020 dprintf("dc=%d\n", block[0]); 1021 dprintf("dc=%d\n", block[0]);
1022 mismatch = block[0] ^ 1;
1021 i = 1; 1023 i = 1;
1022 if (s->intra_vlc_format) 1024 if (s->intra_vlc_format)
1023 rl = &rl_mpeg2; 1025 rl = &rl_mpeg2;
1024 else 1026 else
1025 rl = &rl_mpeg1; 1027 rl = &rl_mpeg1;