Mercurial > libavcodec.hg
comparison mpeg12.c @ 1085:9acf4b552047 libavcodec
move repeat_pict field from AVCodecContext -> AVFrame (closes bug #683536)
author | michaelni |
---|---|
date | Wed, 26 Feb 2003 17:26:20 +0000 |
parents | 01154fced380 |
children | f59c3f66363b |
comparison
equal
deleted
inserted
replaced
1084:01154fced380 | 1085:9acf4b552047 |
---|---|
1784 /* start frame decoding */ | 1784 /* start frame decoding */ |
1785 if (s->first_slice) { | 1785 if (s->first_slice) { |
1786 s->first_slice = 0; | 1786 s->first_slice = 0; |
1787 if(MPV_frame_start(s, avctx) < 0) | 1787 if(MPV_frame_start(s, avctx) < 0) |
1788 return DECODE_SLICE_FATAL_ERROR; | 1788 return DECODE_SLICE_FATAL_ERROR; |
1789 | 1789 /* first check if we must repeat the frame */ |
1790 s->current_picture.repeat_pict = 0; | |
1791 | |
1792 if (s->repeat_first_field) { | |
1793 if (s->progressive_sequence) { | |
1794 if (s->top_field_first) | |
1795 s->current_picture.repeat_pict = 4; | |
1796 else | |
1797 s->current_picture.repeat_pict = 2; | |
1798 } else if (s->progressive_frame) { | |
1799 s->current_picture.repeat_pict = 1; | |
1800 } | |
1801 } | |
1802 // printf("%d \n", s->current_picture.repeat_pict); | |
1803 | |
1790 if(s->avctx->debug&FF_DEBUG_PICT_INFO){ | 1804 if(s->avctx->debug&FF_DEBUG_PICT_INFO){ |
1791 printf("qp:%d fc:%2d%2d%2d%2d %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n", | 1805 printf("qp:%d fc:%2d%2d%2d%2d %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n", |
1792 s->qscale, s->mpeg_f_code[0][0],s->mpeg_f_code[0][1],s->mpeg_f_code[1][0],s->mpeg_f_code[1][1], | 1806 s->qscale, s->mpeg_f_code[0][0],s->mpeg_f_code[0][1],s->mpeg_f_code[1][0],s->mpeg_f_code[1][1], |
1793 s->pict_type == I_TYPE ? "I" : (s->pict_type == P_TYPE ? "P" : (s->pict_type == B_TYPE ? "B" : "S")), | 1807 s->pict_type == I_TYPE ? "I" : (s->pict_type == P_TYPE ? "P" : (s->pict_type == B_TYPE ? "B" : "S")), |
1794 s->progressive_sequence ? "pro" :"", s->alternate_scan ? "alt" :"", s->top_field_first ? "top" :"", | 1808 s->progressive_sequence ? "pro" :"", s->alternate_scan ? "alt" :"", s->top_field_first ? "top" :"", |
2144 if(avctx->hurry_up>=5) break; | 2158 if(avctx->hurry_up>=5) break; |
2145 | 2159 |
2146 ret = mpeg_decode_slice(avctx, picture, | 2160 ret = mpeg_decode_slice(avctx, picture, |
2147 start_code, s->buffer, input_size); | 2161 start_code, s->buffer, input_size); |
2148 if (ret == DECODE_SLICE_EOP) { | 2162 if (ret == DECODE_SLICE_EOP) { |
2149 /* got a picture: exit */ | |
2150 /* first check if we must repeat the frame */ | |
2151 avctx->repeat_pict = 0; | |
2152 #if 0 | |
2153 if (s2->progressive_frame && s2->repeat_first_field) { | |
2154 //fprintf(stderr,"\nRepeat this frame: %d! pict: %d",avctx->frame_number,s2->picture_number); | |
2155 //s2->repeat_first_field = 0; | |
2156 //s2->progressive_frame = 0; | |
2157 if (++s->repeat_field > 2) | |
2158 s->repeat_field = 0; | |
2159 avctx->repeat_pict = 1; | |
2160 } | |
2161 #endif | |
2162 if (s2->repeat_first_field) { | |
2163 if (s2->progressive_sequence) { | |
2164 if (s2->top_field_first) | |
2165 avctx->repeat_pict = 4; | |
2166 else | |
2167 avctx->repeat_pict = 2; | |
2168 } else if (s2->progressive_frame) { | |
2169 avctx->repeat_pict = 1; | |
2170 } | |
2171 } | |
2172 *data_size = sizeof(AVPicture); | 2163 *data_size = sizeof(AVPicture); |
2173 goto the_end; | 2164 goto the_end; |
2174 }else if(ret<0){ | 2165 }else if(ret<0){ |
2175 fprintf(stderr,"Error while decoding slice\n"); | 2166 fprintf(stderr,"Error while decoding slice\n"); |
2176 if(ret==DECODE_SLICE_FATAL_ERROR) return -1; | 2167 if(ret==DECODE_SLICE_FATAL_ERROR) return -1; |