# HG changeset patch # User michaelni # Date 1036066313 0 # Node ID 8f31ed5bacd148185a5d82c320aa2bcde379bd66 # Parent dfaa1c45bd27f835a6dda67da51eb1906945d9bb dont call emms_c() for each MB diff -r dfaa1c45bd27 -r 8f31ed5bacd1 mpegvideo.c --- a/mpegvideo.c Thu Oct 31 11:47:58 2002 +0000 +++ b/mpegvideo.c Thu Oct 31 12:11:53 2002 +0000 @@ -1819,7 +1819,7 @@ /* if previous was skipped too, then nothing to do ! skip only during decoding as we might trash the buffers during encoding a bit */ if (*mbskip_ptr >= s->ip_buffer_count && !s->encoding) - goto the_end; + return; } else { *mbskip_ptr = 0; /* not skipped */ } @@ -1866,7 +1866,7 @@ } /* skip dequant / idct if we are really late ;) */ - if(s->hurry_up>1) goto the_end; + if(s->hurry_up>1) return; /* add dct residue */ if(s->encoding || !( s->mpeg2 || s->h263_msmpeg4 || s->codec_id==CODEC_ID_MPEG1VIDEO @@ -1916,8 +1916,6 @@ } } } - the_end: - emms_c(); //FIXME remove } static inline void dct_single_coeff_elimination(MpegEncContext *s, int n, int threshold) @@ -2574,7 +2572,6 @@ // s->mb_type[mb_y*s->mb_width + mb_x]=MB_TYPE_INTER; } } - emms_c(); }else /* if(s->pict_type == I_TYPE) */{ /* I-Frame */ //FIXME do we need to zero them? @@ -2601,6 +2598,8 @@ } } } + emms_c(); + if(s->scene_change_score > 0 && s->pict_type == P_TYPE){ s->pict_type= I_TYPE; memset(s->mb_type , MB_TYPE_INTRA, sizeof(UINT8)*s->mb_width*s->mb_height); diff -r dfaa1c45bd27 -r 8f31ed5bacd1 utils.c --- a/utils.c Thu Oct 31 11:47:58 2002 +0000 +++ b/utils.c Thu Oct 31 12:11:53 2002 +0000 @@ -120,6 +120,9 @@ int ret; ret = avctx->codec->encode(avctx, buf, buf_size, (void *)pict); + + emms_c(); //needed to avoid a emms_c() call before every return; + avctx->frame_number++; return ret; } @@ -135,6 +138,9 @@ ret = avctx->codec->decode(avctx, picture, got_picture_ptr, buf, buf_size); + + emms_c(); //needed to avoid a emms_c() call before every return; + if (*got_picture_ptr) avctx->frame_number++; return ret;