[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec avcodec.h, 1.435, 1.436 utils.c, 1.167, 1.168 mpegvideo.c, 1.499, 1.500

Michael Niedermayer CVS michael
Sun Dec 25 19:34:05 CET 2005


Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv16356

Modified Files:
	avcodec.h utils.c mpegvideo.c 
Log Message:
support downscaling frames for dynamic b frame decission


Index: avcodec.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/avcodec.h,v
retrieving revision 1.435
retrieving revision 1.436
diff -u -d -r1.435 -r1.436
--- avcodec.h	23 Dec 2005 16:25:00 -0000	1.435
+++ avcodec.h	25 Dec 2005 18:34:02 -0000	1.436
@@ -1869,6 +1869,13 @@
      * - decoding: unused
      */
     int bidir_refine;
+
+    /**
+     *
+     * - encoding: set by user.
+     * - decoding: unused
+     */
+    int brd_scale;
 } AVCodecContext;
 
 /**

Index: utils.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/utils.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -d -r1.167 -r1.168
--- utils.c	25 Dec 2005 17:43:52 -0000	1.167
+++ utils.c	25 Dec 2005 18:34:02 -0000	1.168
@@ -708,6 +708,7 @@
 {"mb_lmax", NULL, OFFSET(mb_lmax), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
 {"me_penalty_compensation", NULL, OFFSET(me_penalty_compensation), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
 {"bidir_refine", NULL, OFFSET(bidir_refine), FF_OPT_TYPE_INT, DEFAULT, 0, 4, V|E},
+{"brd_scale", NULL, OFFSET(brd_scale), FF_OPT_TYPE_INT, DEFAULT, 0, 10, V|E},
 {NULL},
 };
 

Index: mpegvideo.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mpegvideo.c,v
retrieving revision 1.499
retrieving revision 1.500
diff -u -d -r1.499 -r1.500
--- mpegvideo.c	25 Dec 2005 17:30:52 -0000	1.499
+++ mpegvideo.c	25 Dec 2005 18:34:02 -0000	1.500
@@ -2145,9 +2145,9 @@
     AVCodec *codec= avcodec_find_encoder(s->avctx->codec_id);
     AVCodecContext *c= avcodec_alloc_context();
     AVFrame input[FF_MAX_B_FRAMES+2];
-    const int scale= 0;
+    const int scale= s->avctx->brd_scale;
     int i, j, out_size;
-    int outbuf_size= (s->width * s->height) >> (2*scale); //FIXME
+    int outbuf_size= s->width * s->height; //FIXME
     uint8_t *outbuf= av_malloc(outbuf_size);
     ImgReSampleContext *resample;
     int64_t best_rd= INT64_MAX;
@@ -2198,6 +2198,7 @@
         input[0].pict_type= I_TYPE;
         input[0].quality= 2 * FF_QP2LAMBDA;
         out_size = avcodec_encode_video(c, outbuf, outbuf_size, &input[0]);
+        rd += (out_size * lambda2) >> FF_LAMBDA_SHIFT;
 
         for(i=0; i<s->max_b_frames+1; i++){
             int is_p= i % (j+1) == j || i==s->max_b_frames;





More information about the ffmpeg-cvslog mailing list