Mercurial > libavcodec.hg
comparison mpegvideo.c @ 1089:7e79a58954b1 libavcodec
h263(+) clenaup & bugfixes
author | michaelni |
---|---|
date | Fri, 28 Feb 2003 13:07:07 +0000 |
parents | d3b93dc997a3 |
children | f59c3f66363b |
comparison
equal
deleted
inserted
replaced
1088:bb27c685fc72 | 1089:7e79a58954b1 |
---|---|
654 s->h263_plus = 1; | 654 s->h263_plus = 1; |
655 s->unrestricted_mv = 1; | 655 s->unrestricted_mv = 1; |
656 s->h263_aic = 1; | 656 s->h263_aic = 1; |
657 | 657 |
658 /* These are just to be sure */ | 658 /* These are just to be sure */ |
659 s->umvplus = 0; | 659 s->umvplus = 1; |
660 s->umvplus_dec = 0; | |
661 avctx->delay=0; | 660 avctx->delay=0; |
662 s->low_delay=1; | 661 s->low_delay=1; |
663 break; | 662 break; |
664 case CODEC_ID_RV10: | 663 case CODEC_ID_RV10: |
665 s->out_format = FMT_H263; | 664 s->out_format = FMT_H263; |
2906 | 2905 |
2907 s->scene_change_score=0; | 2906 s->scene_change_score=0; |
2908 | 2907 |
2909 s->qscale= (int)(s->frame_qscale + 0.5); //FIXME qscale / ... stuff for ME ratedistoration | 2908 s->qscale= (int)(s->frame_qscale + 0.5); //FIXME qscale / ... stuff for ME ratedistoration |
2910 | 2909 |
2911 if(s->msmpeg4_version){ | 2910 if(s->pict_type==I_TYPE){ |
2912 if(s->pict_type==I_TYPE) | 2911 if(s->msmpeg4_version) s->no_rounding=1; |
2913 s->no_rounding=1; | 2912 else s->no_rounding=0; |
2914 else if(s->flipflop_rounding) | 2913 }else if(s->pict_type!=B_TYPE){ |
2914 if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4) | |
2915 s->no_rounding ^= 1; | 2915 s->no_rounding ^= 1; |
2916 }else if(s->out_format == FMT_H263){ | 2916 } |
2917 if(s->pict_type==I_TYPE) | 2917 |
2918 s->no_rounding=0; | |
2919 else if(s->pict_type!=B_TYPE) | |
2920 s->no_rounding ^= 1; | |
2921 } | |
2922 /* Estimate motion for every MB */ | 2918 /* Estimate motion for every MB */ |
2923 s->mb_intra=0; //for the rate distoration & bit compare functions | 2919 s->mb_intra=0; //for the rate distoration & bit compare functions |
2924 if(s->pict_type != I_TYPE){ | 2920 if(s->pict_type != I_TYPE){ |
2925 if(s->pict_type != B_TYPE){ | 2921 if(s->pict_type != B_TYPE){ |
2926 if((s->avctx->pre_me && s->last_non_b_pict_type==I_TYPE) || s->avctx->pre_me==2){ | 2922 if((s->avctx->pre_me && s->last_non_b_pict_type==I_TYPE) || s->avctx->pre_me==2){ |
2991 s->pict_type= I_TYPE; | 2987 s->pict_type= I_TYPE; |
2992 memset(s->mb_type , MB_TYPE_INTRA, sizeof(uint8_t)*s->mb_width*s->mb_height); | 2988 memset(s->mb_type , MB_TYPE_INTRA, sizeof(uint8_t)*s->mb_width*s->mb_height); |
2993 //printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum); | 2989 //printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum); |
2994 } | 2990 } |
2995 | 2991 |
2996 if(s->codec_id != CODEC_ID_H263P){ //FIXME use umvplus or something | 2992 if(!s->umvplus){ |
2997 if(s->pict_type==P_TYPE || s->pict_type==S_TYPE) { | 2993 if(s->pict_type==P_TYPE || s->pict_type==S_TYPE) { |
2998 s->f_code= ff_get_best_fcode(s, s->p_mv_table, MB_TYPE_INTER); | 2994 s->f_code= ff_get_best_fcode(s, s->p_mv_table, MB_TYPE_INTER); |
2999 | 2995 |
3000 ff_fix_long_p_mvs(s); | 2996 ff_fix_long_p_mvs(s); |
3001 } | 2997 } |