comparison mpeg12.c @ 1181:4c2339f3863a libavcodec

100l (mpeg2 decoding fixed)
author michaelni
date Fri, 11 Apr 2003 21:15:17 +0000
parents fea03d2c4946
children 38e8b8f331cb
comparison
equal deleted inserted replaced
1180:ea015319b9e8 1181:4c2339f3863a
819 vlc_dc_chroma_bits, 1, 1, 819 vlc_dc_chroma_bits, 1, 1,
820 vlc_dc_chroma_code, 2, 2); 820 vlc_dc_chroma_code, 2, 2);
821 init_vlc(&mv_vlc, MV_VLC_BITS, 17, 821 init_vlc(&mv_vlc, MV_VLC_BITS, 17,
822 &mbMotionVectorTable[0][1], 2, 1, 822 &mbMotionVectorTable[0][1], 2, 1,
823 &mbMotionVectorTable[0][0], 2, 1); 823 &mbMotionVectorTable[0][0], 2, 1);
824 init_vlc(&mbincr_vlc, MBINCR_VLC_BITS, 35, 824 init_vlc(&mbincr_vlc, MBINCR_VLC_BITS, 36,
825 &mbAddrIncrTable[0][1], 2, 1, 825 &mbAddrIncrTable[0][1], 2, 1,
826 &mbAddrIncrTable[0][0], 2, 1); 826 &mbAddrIncrTable[0][0], 2, 1);
827 init_vlc(&mb_pat_vlc, MB_PAT_VLC_BITS, 63, 827 init_vlc(&mb_pat_vlc, MB_PAT_VLC_BITS, 63,
828 &mbPatTable[0][1], 2, 1, 828 &mbPatTable[0][1], 2, 1,
829 &mbPatTable[0][0], 2, 1); 829 &mbPatTable[0][0], 2, 1);
1957 /* read again increment */ 1957 /* read again increment */
1958 s->mb_skip_run = 0; 1958 s->mb_skip_run = 0;
1959 for(;;) { 1959 for(;;) {
1960 int code = get_vlc2(&s->gb, mbincr_vlc.table, MBINCR_VLC_BITS, 2); 1960 int code = get_vlc2(&s->gb, mbincr_vlc.table, MBINCR_VLC_BITS, 2);
1961 if (code < 0){ 1961 if (code < 0){
1962 align_get_bits(&s->gb); 1962 fprintf(stderr, "mb incr damaged\n");
1963 if(s->mb_skip_run != 0 || show_bits(&s->gb, 24) != 1){ 1963 return -1;
1964 fprintf(stderr, "slice end missmatch\n");
1965 return -1;
1966 }
1967 goto eos; /* error = end of slice */
1968 } 1964 }
1969 if (code >= 33) { 1965 if (code >= 33) {
1970 if (code == 33) { 1966 if (code == 33) {
1971 s->mb_skip_run += 33; 1967 s->mb_skip_run += 33;
1968 }else if(code == 35){
1969 if(s->mb_skip_run != 0 || show_bits(&s->gb, 15) != 0){
1970 fprintf(stderr, "slice missmatch\n");
1971 return -1;
1972 }
1973 goto eos; /* end of slice */
1972 } 1974 }
1973 /* otherwise, stuffing, nothing to do */ 1975 /* otherwise, stuffing, nothing to do */
1974 } else { 1976 } else {
1975 s->mb_skip_run += code; 1977 s->mb_skip_run += code;
1976 break; 1978 break;