summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-04-13 00:03:11 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-04-13 00:03:11 +0000
commit06cbb5007cb66b7e1230ca23d7306f0444487529 (patch)
tree27530867313d9c93cd5d3132e252b2fdb19d9b45
parent67e8b044c348559ffed73a6a2819cdc40a7bfd94 (diff)
downloadmpv-06cbb5007cb66b7e1230ca23d7306f0444487529.tar.bz2
mpv-06cbb5007cb66b7e1230ca23d7306f0444487529.tar.xz
Restore grayscale decoding support with FFmpeg.
Removing support was done due to a silly misunderstanding. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26427 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--Changelog2
-rw-r--r--DOCS/man/en/mplayer.19
-rw-r--r--libmpcodecs/vd_ffmpeg.c3
-rw-r--r--libmpcodecs/ve_lavc.c3
4 files changed, 15 insertions, 2 deletions
diff --git a/Changelog b/Changelog
index bbfc5b8084..2083d7ff33 100644
--- a/Changelog
+++ b/Changelog
@@ -43,7 +43,7 @@ MPlayer (1.0)
* reworked screensaver disabling support, most users will need to use
-heartbeat-cmd due to screensaver authors being unable to design a
common API
- * grayscale decoding/encoding with FFmpeg disabled, it slowed down
+ * grayscale decoding/encoding with FFmpeg disabled where it slowed down
the color case
Ports:
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index 8e2cc8ee9d..6c9f1601b9 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -3220,6 +3220,7 @@ Will usually only work with "\-fstype \-fullscreen" or "\-fstype none".
.TP
.B \-zrbw (\-vo zr only)
Display in black and white.
+For optimal performance, this can be combined with '\-lavdopts gray'.
.
.TP
.B \-zrcrop <[width]x[height]+[x offset]+[y offset]> (\-vo zr only)
@@ -4298,7 +4299,7 @@ Separate multiple options with a colon.
.I EXAMPLE:
.PD 0
.RSs
-\-lavdopts skiploopfilter=all:skipframe=nonref
+\-lavdopts gray:skiploopfilter=all:skipframe=nonref
.RE
.PD 1
.sp 1
@@ -4399,6 +4400,8 @@ Enable optimizations which do not comply to the specification and might
potentially cause problems, like simpler dequantization, simpler motion
compensation, assuming use of the default quantization matrix, assuming
YUV 4:2:0 and skipping a few checks to detect damaged bitstreams.
+.IPs "gray\ "
+grayscale only decoding (a bit faster than with color)
.IPs "idct=<0\-99> (see \-lavcopts)"
For best decoding quality use the same IDCT algorithm for decoding and encoding.
This may come at a price in accuracy, though.
@@ -8343,6 +8346,10 @@ good choice
slice structured mode for H.263+
.
.TP
+.B "gray\ \ \ "
+grayscale only encoding (faster)
+.
+.TP
.B vfdct=<0\-10>
DCT algorithm
.PD 0
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index da527ea4af..97a4fa62cd 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -71,6 +71,7 @@ static void mc_render_slice(struct AVCodecContext *s,
static int lavc_param_workaround_bugs= FF_BUG_AUTODETECT;
static int lavc_param_error_resilience=2;
static int lavc_param_error_concealment=3;
+static int lavc_param_gray=0;
static int lavc_param_vstats=0;
static int lavc_param_idct_algo=0;
static int lavc_param_debug=0;
@@ -89,6 +90,7 @@ static int lavc_param_bitexact=0;
const m_option_t lavc_decode_opts_conf[]={
{"bug", &lavc_param_workaround_bugs, CONF_TYPE_INT, CONF_RANGE, -1, 999999, NULL},
{"er", &lavc_param_error_resilience, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL},
+ {"gray", &lavc_param_gray, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART, NULL},
{"idct", &lavc_param_idct_algo, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL},
{"ec", &lavc_param_error_concealment, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL},
{"vstats", &lavc_param_vstats, CONF_TYPE_FLAG, 0, 0, 1, NULL},
@@ -286,6 +288,7 @@ static int init(sh_video_t *sh){
avctx->height= sh->disp_h;
avctx->workaround_bugs= lavc_param_workaround_bugs;
avctx->error_resilience= lavc_param_error_resilience;
+ if(lavc_param_gray) avctx->flags|= CODEC_FLAG_GRAY;
#ifdef CODEC_FLAG2_FAST
avctx->flags2|= lavc_param_fast;
#endif
diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c
index e21a5d5866..df06bfb81c 100644
--- a/libmpcodecs/ve_lavc.c
+++ b/libmpcodecs/ve_lavc.c
@@ -67,6 +67,7 @@ static int lavc_param_chroma_elim_threshold = 0;
static int lavc_param_packet_size= 0;
static int lavc_param_strict= -1;
static int lavc_param_data_partitioning= 0;
+static int lavc_param_gray=0;
static float lavc_param_rc_qsquish=1.0;
static float lavc_param_rc_qmod_amp=0;
static int lavc_param_rc_qmod_freq=0;
@@ -195,6 +196,7 @@ m_option_t lavcopts_conf[]={
{"vstrict", &lavc_param_strict, CONF_TYPE_INT, CONF_RANGE, -99, 99, NULL},
{"vdpart", &lavc_param_data_partitioning, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART, NULL},
{"keyint", &lavc_param_keyint, CONF_TYPE_INT, 0, 0, 0, NULL},
+ {"gray", &lavc_param_gray, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART, NULL},
{"mpeg_quant", &lavc_param_mpeg_quant, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"vi_qfactor", &lavc_param_vi_qfactor, CONF_TYPE_FLOAT, CONF_RANGE, -31.0, 31.0, NULL},
{"vi_qoffset", &lavc_param_vi_qoffset, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 31.0, NULL},
@@ -554,6 +556,7 @@ static int config(struct vf_instance_s* vf,
#ifdef CODEC_FLAG_CLOSED_GOP
lavc_venc_context->flags|= lavc_param_closed_gop;
#endif
+ if(lavc_param_gray) lavc_venc_context->flags|= CODEC_FLAG_GRAY;
if(lavc_param_normalize_aqp) lavc_venc_context->flags|= CODEC_FLAG_NORMALIZE_AQP;
if(lavc_param_interlaced_dct) lavc_venc_context->flags|= CODEC_FLAG_INTERLACED_DCT;