aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-03-22 23:22:08 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-03-22 23:22:08 +0000
commit11ce88346b1ae4da21b581baf1b4eb784d842547 (patch)
treebffaf9c06980445db1dc0cf44399526faee72316 /libavcodec/mpegvideo.c
parentc5b1c10a0e1ed783674b24d787797ffba9bdffc0 (diff)
downloadffmpeg-11ce88346b1ae4da21b581baf1b4eb784d842547.tar.gz
mpeg4 aspect_ratio_info in AVCodecContext (requested by alex)
experimental (& faster) motion estimation squished a dirty uninitialized var bug mpeg1 fcode>1 support Originally committed as revision 349 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 180addb6f6..9510ca1847 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -294,6 +294,7 @@ int MPV_encode_init(AVCodecContext *avctx)
s->qcompress= avctx->qcompress;
s->qblur= avctx->qblur;
s->avctx = avctx;
+ s->aspect_ratio_info= avctx->aspect_ratio_info;
if (s->gop_size <= 1) {
s->intra_only = 1;
@@ -377,6 +378,8 @@ int MPV_encode_init(AVCodecContext *avctx)
if (s->out_format == FMT_H263)
h263_encode_init(s);
+ else if (s->out_format == FMT_MPEG1)
+ mpeg1_encode_init(s);
s->encoding = 1;
@@ -1075,7 +1078,6 @@ static void encode_picture(MpegEncContext *s, int picture_number)
/* Reset the average MB variance */
s->avg_mb_var = 0;
s->mc_mb_var = 0;
-
/* Estimate motion for every MB */
for(mb_y=0; mb_y < s->mb_height; mb_y++) {
for(mb_x=0; mb_x < s->mb_width; mb_x++) {
@@ -1132,12 +1134,13 @@ static void encode_picture(MpegEncContext *s, int picture_number)
for(i=MAX_FCODE; i>1; i--){
loose+= mv_num[i];
- if(loose > 4) break;
+ if(loose > 4) break; //FIXME this is pretty ineffective
}
s->f_code= i;
}else{
s->f_code= 1;
}
+
//printf("f_code %d ///\n", s->f_code);
/* convert MBs with too long MVs to I-Blocks */
if(s->pict_type==P_TYPE){