[Ffmpeg-cvslog] r5450 - in trunk/libavcodec: avcodec.h mpegvideo.c utils.c

corey subversion
Sat Jun 3 08:26:05 CEST 2006


Author: corey
Date: Sat Jun  3 08:26:04 2006
New Revision: 5450

Modified:
   trunk/libavcodec/avcodec.h
   trunk/libavcodec/mpegvideo.c
   trunk/libavcodec/utils.c

Log:
Make B-frame reduction sensitivity by b_strategy/vb_strategy = 1
user-tunable.



Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h	(original)
+++ trunk/libavcodec/avcodec.h	Sat Jun  3 08:26:04 2006
@@ -1977,6 +1977,13 @@
      * - decoding: unused
      */
     int mv0_threshold;
+
+    /**
+     * adjusts sensitivity of b_frame_strategy 1
+     * - encoding: set by user.
+     * - decoding: unused
+     */
+    int b_sensitivity;
 } AVCodecContext;
 
 /**

Modified: trunk/libavcodec/mpegvideo.c
==============================================================================
--- trunk/libavcodec/mpegvideo.c	(original)
+++ trunk/libavcodec/mpegvideo.c	Sat Jun  3 08:26:04 2006
@@ -2375,7 +2375,7 @@
                     }
                 }
                 for(i=0; i<s->max_b_frames+1; i++){
-                    if(s->input_picture[i]==NULL || s->input_picture[i]->b_frame_score - 1 > s->mb_num/40) break;
+                    if(s->input_picture[i]==NULL || s->input_picture[i]->b_frame_score - 1 > s->mb_num/s->avctx->b_sensitivity) break;
                 }
 
                 b_frames= FFMAX(0, i-1);

Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c	(original)
+++ trunk/libavcodec/utils.c	Sat Jun  3 08:26:04 2006
@@ -741,6 +741,7 @@
 {"sc_factor", NULL, OFFSET(scenechange_factor), FF_OPT_TYPE_INT, 6, 0, INT_MAX, V|E},
 {"mv0_threshold", NULL, OFFSET(mv0_threshold), FF_OPT_TYPE_INT, 256, 0, INT_MAX, V|E},
 {"ivlc", "intra vlc table", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_INTRA_VLC, INT_MIN, INT_MAX, V|E, "flags2"},
+{"b_sensitivity", NULL, OFFSET(b_sensitivity), FF_OPT_TYPE_INT, 40, 1, INT_MAX, V|E},
 {NULL},
 };
 
@@ -796,6 +797,7 @@
     s->nsse_weight= 8;
     s->sample_fmt= SAMPLE_FMT_S16; // FIXME: set to NONE
     s->mv0_threshold= 256;
+    s->b_sensitivity= 40;
 
     s->intra_quant_bias= FF_DEFAULT_QUANT_BIAS;
     s->inter_quant_bias= FF_DEFAULT_QUANT_BIAS;




More information about the ffmpeg-cvslog mailing list