summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-12-17 07:34:23 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-12-17 07:34:23 +0000
commit00b6d88ebf6f7ab22335a578e608311eadfac979 (patch)
tree133d97ed7ac37969948bb9a46f33f49df5941e04 /libmpcodecs
parent40d0c2b622610c0ae5a1a47fa415a2a7d5a007b2 (diff)
downloadmpv-00b6d88ebf6f7ab22335a578e608311eadfac979.tar.bz2
mpv-00b6d88ebf6f7ab22335a578e608311eadfac979.tar.xz
conditional lowres: activate lowres if frame width >= threshold
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14170 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd_ffmpeg.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 730f3ae8e3..5a7ddfbe9a 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -105,6 +105,7 @@ static int lavc_param_skip_top=0;
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 @@ m_option_t lavc_decode_opts_conf[]={
#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 @@ static int init(sh_video_t *sh){
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 @@ static int init(sh_video_t *sh){
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 */