mirror of https://github.com/mpv-player/mpv
conditional lowres: activate lowres if frame width >= threshold
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14170 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
40d0c2b622
commit
00b6d88ebf
|
@ -105,6 +105,7 @@ static int lavc_param_skip_top=0;
|
||||||
static int lavc_param_skip_bottom=0;
|
static int lavc_param_skip_bottom=0;
|
||||||
static int lavc_param_fast=0;
|
static int lavc_param_fast=0;
|
||||||
static int lavc_param_lowres=0;
|
static int lavc_param_lowres=0;
|
||||||
|
static char *lavc_param_lowres_str=NULL;
|
||||||
|
|
||||||
m_option_t lavc_decode_opts_conf[]={
|
m_option_t lavc_decode_opts_conf[]={
|
||||||
{"bug", &lavc_param_workaround_bugs, CONF_TYPE_INT, CONF_RANGE, -1, 999999, NULL},
|
{"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
|
#ifdef CODEC_FLAG2_FAST
|
||||||
{"fast", &lavc_param_fast, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG2_FAST, NULL},
|
{"fast", &lavc_param_fast, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG2_FAST, NULL},
|
||||||
#endif
|
#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}
|
{NULL, NULL, 0, 0, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -163,6 +164,9 @@ static int init(sh_video_t *sh){
|
||||||
AVCodecContext *avctx;
|
AVCodecContext *avctx;
|
||||||
vd_ffmpeg_ctx *ctx;
|
vd_ffmpeg_ctx *ctx;
|
||||||
AVCodec *lavc_codec;
|
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));
|
int do_vis_debug= lavc_param_vismv || (lavc_param_debug&(FF_DEBUG_VIS_MB_TYPE|FF_DEBUG_VIS_QP));
|
||||||
|
|
||||||
if(!avcodec_inited){
|
if(!avcodec_inited){
|
||||||
|
@ -259,7 +263,13 @@ static int init(sh_video_t *sh){
|
||||||
avctx->skip_bottom= lavc_param_skip_bottom;
|
avctx->skip_bottom= lavc_param_skip_bottom;
|
||||||
#endif
|
#endif
|
||||||
#if LIBAVCODEC_BUILD >= 4722
|
#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
|
#endif
|
||||||
mp_dbg(MSGT_DECVIDEO,MSGL_DBG2,"libavcodec.size: %d x %d\n",avctx->width,avctx->height);
|
mp_dbg(MSGT_DECVIDEO,MSGL_DBG2,"libavcodec.size: %d x %d\n",avctx->width,avctx->height);
|
||||||
/* AVRn stores huffman table in AVI header */
|
/* AVRn stores huffman table in AVI header */
|
||||||
|
|
Loading…
Reference in New Issue