[MPlayer-cvslog] CVS: main/libmpcodecs vd_ffmpeg.c,1.138,1.139

Nico Sabbi CVS syncmail at mplayerhq.hu
Fri Dec 17 08:34:25 CET 2004


CVS change done by Nico Sabbi CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv903

Modified Files:
	vd_ffmpeg.c 
Log Message:
conditional lowres: activate lowres if frame width >= threshold

Index: vd_ffmpeg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_ffmpeg.c,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -r1.138 -r1.139
--- vd_ffmpeg.c	6 Dec 2004 04:11:17 -0000	1.138
+++ vd_ffmpeg.c	17 Dec 2004 07:34:23 -0000	1.139
@@ -105,6 +105,7 @@
 static int lavc_param_skip_bottom=0;
 static int lavc_param_fast=0;
 static int lavc_param_lowres=0;
+static char *lavc_param_lowres_str=NULL;
 
 m_option_t lavc_decode_opts_conf[]={
 	{"bug", &lavc_param_workaround_bugs, CONF_TYPE_INT, CONF_RANGE, -1, 999999, NULL},
@@ -120,7 +121,7 @@
 #ifdef CODEC_FLAG2_FAST
         {"fast", &lavc_param_fast, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG2_FAST, NULL},
 #endif
-	{"lowres", &lavc_param_lowres, CONF_TYPE_INT, CONF_RANGE, 0, 16, NULL},
+	{"lowres", &lavc_param_lowres_str, CONF_TYPE_STRING, 0, 0, 0, NULL},
 	{NULL, NULL, 0, 0, 0, 0, NULL}
 };
 
@@ -163,6 +164,9 @@
     AVCodecContext *avctx;
     vd_ffmpeg_ctx *ctx;
     AVCodec *lavc_codec;
+#if LIBAVCODEC_BUILD >= 4722
+    int lowres_w=0;
+#endif
     int do_vis_debug= lavc_param_vismv || (lavc_param_debug&(FF_DEBUG_VIS_MB_TYPE|FF_DEBUG_VIS_QP));
 
     if(!avcodec_inited){
@@ -259,7 +263,13 @@
     avctx->skip_bottom= lavc_param_skip_bottom;
 #endif    
 #if LIBAVCODEC_BUILD >= 4722
-    avctx->lowres= lavc_param_lowres;
+    if(lavc_param_lowres_str != NULL)
+    {
+        sscanf(lavc_param_lowres_str, "%d,%d", &lavc_param_lowres, &lowres_w);
+        if(lavc_param_lowres < 1 || lavc_param_lowres > 16 || (lowres_w > 0 && avctx->width < lowres_w))
+            lavc_param_lowres = 0;
+        avctx->lowres = lavc_param_lowres;
+    }
 #endif    
     mp_dbg(MSGT_DECVIDEO,MSGL_DBG2,"libavcodec.size: %d x %d\n",avctx->width,avctx->height);
     /* AVRn stores huffman table in AVI header */




More information about the MPlayer-cvslog mailing list