summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_ffmpeg.c2
-rw-r--r--libmpcodecs/ad_spdif.c4
-rw-r--r--libmpcodecs/dec_video.c34
-rw-r--r--libmpcodecs/mp_image.h9
-rw-r--r--libmpcodecs/vd.c9
-rw-r--r--libmpcodecs/vd.h25
-rw-r--r--libmpcodecs/vd_ffmpeg.c14
-rw-r--r--libmpcodecs/vf.c6
-rw-r--r--libmpcodecs/vf_delogo.c6
-rw-r--r--libmpcodecs/vf_divtc.c2
-rw-r--r--libmpcodecs/vf_down3dright.c12
-rw-r--r--libmpcodecs/vf_expand.c6
-rw-r--r--libmpcodecs/vf_ilpack.c1
-rw-r--r--libmpcodecs/vf_phase.c2
-rw-r--r--libmpcodecs/vf_screenshot.c6
-rw-r--r--libmpcodecs/vf_softpulldown.c17
-rw-r--r--libmpcodecs/vf_stereo3d.c42
-rw-r--r--libmpcodecs/vf_unsharp.c1
18 files changed, 96 insertions, 102 deletions
diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c
index cca7725490..1d6683672b 100644
--- a/libmpcodecs/ad_ffmpeg.c
+++ b/libmpcodecs/ad_ffmpeg.c
@@ -159,6 +159,8 @@ static int init(sh_audio_t *sh_audio)
}
lavc_context->request_channels = opts->audio_output_channels;
lavc_context->codec_tag = sh_audio->format; //FOURCC
+ if (sh_audio->gsh->lavf_codec_tag)
+ lavc_context->codec_tag = sh_audio->gsh->lavf_codec_tag;
lavc_context->codec_type = AVMEDIA_TYPE_AUDIO;
lavc_context->codec_id = lavc_codec->id; // not sure if required, imho not --A'rpi
diff --git a/libmpcodecs/ad_spdif.c b/libmpcodecs/ad_spdif.c
index f6536178bc..877bc99317 100644
--- a/libmpcodecs/ad_spdif.c
+++ b/libmpcodecs/ad_spdif.c
@@ -250,8 +250,8 @@ static int decode_audio(sh_audio_t *sh, unsigned char *buf,
consumed = ds_parse(sh->ds, &start, &x, pts, 0);
if (x == 0) {
mp_msg(MSGT_DECAUDIO,MSGL_V,
- "start[%p] pkt.size[%d] in_size[%d] consumed[%d] x[%d].\n",
- start, pkt.size, in_size, consumed, x);
+ "start[%p] in_size[%d] consumed[%d] x[%d].\n",
+ start, in_size, consumed, x);
continue; // END_NOT_FOUND
}
sh->ds->buffer_pos -= in_size - consumed;
diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c
index e5dcf690c6..5c6d3113da 100644
--- a/libmpcodecs/dec_video.c
+++ b/libmpcodecs/dec_video.c
@@ -61,14 +61,6 @@ int get_video_quality_max(sh_video_t *sh_video)
return ret;
}
}
- const struct vd_functions *vd = sh_video->vd_driver;
- if (vd) {
- int ret = vd->control(sh_video, VDCTRL_QUERY_MAX_PP_LEVEL, NULL);
- if (ret > 0) {
- mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, "[PP] Using codec's postprocessing, max q = %d.\n", ret);
- return ret;
- }
- }
return 0;
}
@@ -86,13 +78,7 @@ int set_video_colors(sh_video_t *sh_video, const char *item, int value)
if (ret == CONTROL_TRUE)
return 1;
}
- /* try software control */
- const struct vd_functions *vd = sh_video->vd_driver;
- if (vd &&
- vd->control(sh_video, VDCTRL_SET_EQUALIZER, (void *)item, value)
- == CONTROL_OK)
- return 1;
- mp_tmsg(MSGT_DECVIDEO, MSGL_V, "Video attribute '%s' is not supported by selected vo & vd.\n",
+ mp_tmsg(MSGT_DECVIDEO, MSGL_V, "Video attribute '%s' is not supported by selected vo.\n",
item);
return 0;
}
@@ -112,10 +98,6 @@ int get_video_colors(sh_video_t *sh_video, const char *item, int *value)
return 1;
}
}
- /* try software control */
- const struct vd_functions *vd = sh_video->vd_driver;
- if (vd)
- return vd->control(sh_video, VDCTRL_GET_EQUALIZER, (void *)item, value);
return 0;
}
@@ -181,9 +163,7 @@ void resync_video_stream(sh_video_t *sh_video)
void video_reset_aspect(struct sh_video *sh_video)
{
- int r = sh_video->vd_driver->control(sh_video, VDCTRL_RESET_ASPECT, NULL);
- if (r != true)
- mpcodecs_config_vo(sh_video, sh_video->disp_w, sh_video->disp_h, 0);
+ sh_video->vd_driver->control(sh_video, VDCTRL_RESET_ASPECT, NULL);
}
int get_current_video_decoder_lag(sh_video_t *sh_video)
@@ -413,14 +393,8 @@ void *decode_video(sh_video_t *sh_video, struct demux_packet *packet,
}
}
- if (sh_video->vd_driver->decode2) {
- mpi = sh_video->vd_driver->decode2(sh_video, packet, start, in_size,
- drop_frame, &pts);
- } else {
- mpi = sh_video->vd_driver->decode(sh_video, start, in_size,
- drop_frame);
- pts = MP_NOPTS_VALUE;
- }
+ mpi = sh_video->vd_driver->decode(sh_video, packet, start, in_size,
+ drop_frame, &pts);
//------------------------ frame decoded. --------------------
diff --git a/libmpcodecs/mp_image.h b/libmpcodecs/mp_image.h
index 84a6f3260d..f2d149bc9d 100644
--- a/libmpcodecs/mp_image.h
+++ b/libmpcodecs/mp_image.h
@@ -31,7 +31,14 @@
//--- buffer content restrictions:
// set if buffer content shouldn't be modified:
#define MP_IMGFLAG_PRESERVE 0x01
-// set if buffer content will be READ for next frame's MC: (I/P mpeg frames)
+// set if buffer content will be READ.
+// This can be e.g. for next frame's MC: (I/P mpeg frames) -
+// then in combination with MP_IMGFLAG_PRESERVE - or it
+// can be because a video filter or codec will read a significant
+// amount of data while processing that frame (e.g. blending something
+// onto the frame, MV based intra prediction).
+// A frame marked like this should not be placed in to uncachable
+// video RAM for example.
#define MP_IMGFLAG_READABLE 0x02
//--- buffer width/stride/plane restrictions: (used for direct rendering)
diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c
index 511665aeac..3bfc17c895 100644
--- a/libmpcodecs/vd.c
+++ b/libmpcodecs/vd.c
@@ -51,9 +51,9 @@ const vd_functions_t * const mpcodecs_vd_drivers[] = {
NULL
};
-int mpcodecs_config_vo2(sh_video_t *sh, int w, int h,
- const unsigned int *outfmts,
- unsigned int preferred_outfmt)
+int mpcodecs_config_vo(sh_video_t *sh, int w, int h,
+ const unsigned int *outfmts,
+ unsigned int preferred_outfmt)
{
struct MPOpts *opts = sh->opts;
int j;
@@ -92,9 +92,8 @@ int mpcodecs_config_vo2(sh_video_t *sh, int w, int h,
csp_again:
if (mp_msg_test(MSGT_DECVIDEO, MSGL_V)) {
- vf_instance_t *f = vf;
mp_msg(MSGT_DECVIDEO, MSGL_V, "Trying filter chain:");
- for (f = vf; f; f = f->next)
+ for (vf_instance_t *f = vf; f; f = f->next)
mp_msg(MSGT_DECVIDEO, MSGL_V, " %s", f->info->name);
mp_msg(MSGT_DECVIDEO, MSGL_V, "\n");
}
diff --git a/libmpcodecs/vd.h b/libmpcodecs/vd.h
index 8b0f9c1aea..6b9803a611 100644
--- a/libmpcodecs/vd.h
+++ b/libmpcodecs/vd.h
@@ -33,35 +33,24 @@ typedef struct vd_functions
const vd_info_t *info;
int (*init)(sh_video_t *sh);
void (*uninit)(sh_video_t *sh);
- int (*control)(sh_video_t *sh, int cmd, void *arg, ...);
- mp_image_t * (*decode)(sh_video_t * sh, void *data, int len, int flags);
- struct mp_image *(*decode2)(struct sh_video *sh, struct demux_packet *pkt,
- void *data, int len, int flags,
- double *reordered_pts);
+ int (*control)(sh_video_t *sh, int cmd, void *arg);
+ struct mp_image *(*decode)(struct sh_video *sh, struct demux_packet *pkt,
+ void *data, int len, int flags,
+ double *reordered_pts);
} vd_functions_t;
// NULL terminated array of all drivers
extern const vd_functions_t *const mpcodecs_vd_drivers[];
#define VDCTRL_QUERY_FORMAT 3 // test for availabilty of a format
-#define VDCTRL_QUERY_MAX_PP_LEVEL 4 // query max postprocessing level (if any)
-#define VDCTRL_SET_PP_LEVEL 5 // set postprocessing level
-#define VDCTRL_SET_EQUALIZER 6 // set color options (brightness,contrast etc)
-#define VDCTRL_GET_EQUALIZER 7 // get color options (brightness,contrast etc)
#define VDCTRL_RESYNC_STREAM 8 // reset decode state after seeking
#define VDCTRL_QUERY_UNSEEN_FRAMES 9 // current decoder lag
#define VDCTRL_RESET_ASPECT 10 // reinit filter/VO chain for new aspect ratio
// callbacks:
-int mpcodecs_config_vo2(sh_video_t *sh, int w, int h,
- const unsigned int *outfmts,
- unsigned int preferred_outfmt);
-
-static inline int mpcodecs_config_vo(sh_video_t *sh, int w, int h,
- unsigned int preferred_outfmt)
-{
- return mpcodecs_config_vo2(sh, w, h, NULL, preferred_outfmt);
-}
+int mpcodecs_config_vo(sh_video_t *sh, int w, int h,
+ const unsigned int *outfmts,
+ unsigned int preferred_outfmt);
mp_image_t *mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag,
int w, int h);
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 941aae7175..a358dea014 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -239,6 +239,8 @@ static int init(sh_video_t *sh)
} else {
avctx->pix_fmt = rawfmt;
}
+ if (sh->gsh->lavf_codec_tag)
+ avctx->codec_tag = sh->gsh->lavf_codec_tag;
avctx->stream_codec_tag = sh->video.fccHandler;
avctx->idct_algo = lavc_param->idct_algo;
avctx->error_concealment = lavc_param->error_concealment;
@@ -444,8 +446,8 @@ static int init_vo(sh_video_t *sh, enum PixelFormat pix_fmt)
sh->colorspace = avcol_spc_to_mp_csp(avctx->colorspace);
sh->color_range = avcol_range_to_mp_csp_levels(avctx->color_range);
- if (!mpcodecs_config_vo2(sh, sh->disp_w, sh->disp_h, supported_fmts,
- ctx->best_csp))
+ if (!mpcodecs_config_vo(sh, sh->disp_w, sh->disp_h, supported_fmts,
+ ctx->best_csp))
return -1;
ctx->vo_initialized = 1;
}
@@ -585,6 +587,10 @@ static void release_buffer(struct AVCodecContext *avctx, AVFrame *pic)
if (mpi) {
// release mpi (in case MPI_IMGTYPE_NUMBERED is used, e.g. for VDPAU)
mpi->usage_count--;
+ if (mpi->usage_count < 0) {
+ mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Bad mp_image usage count, please report!\n");
+ mpi->usage_count = 0;
+ }
}
if (pic->type != FF_BUFFER_TYPE_USER) {
@@ -802,7 +808,7 @@ static enum PixelFormat get_format(struct AVCodecContext *avctx,
return fmt[i];
}
-static int control(sh_video_t *sh, int cmd, void *arg, ...)
+static int control(sh_video_t *sh, int cmd, void *arg)
{
vd_ffmpeg_ctx *ctx = sh->context;
AVCodecContext *avctx = ctx->avctx;
@@ -847,5 +853,5 @@ const struct vd_functions mpcodecs_vd_ffmpeg = {
.init = init,
.uninit = uninit,
.control = control,
- .decode2 = decode
+ .decode = decode,
};
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c
index fbaa1cf2a7..10b9fa546f 100644
--- a/libmpcodecs/vf.c
+++ b/libmpcodecs/vf.c
@@ -198,7 +198,9 @@ mp_image_t *vf_get_image(vf_instance_t *vf, unsigned int outfmt,
if (vf->put_image == vf_next_put_image) {
// passthru mode, if the filter uses the fallback/default put_image()
- return vf_get_image(vf->next, outfmt, mp_imgtype, mp_imgflag, w, h);
+ mpi = vf_get_image(vf->next,outfmt,mp_imgtype,mp_imgflag,w,h);
+ mpi->usage_count++;
+ return mpi;
}
// Note: we should call libvo first to check if it supports direct rendering
@@ -354,8 +356,8 @@ mp_image_t *vf_get_image(vf_instance_t *vf, unsigned int outfmt,
mpi->flags |= MP_IMGFLAG_TYPE_DISPLAYED;
}
mpi->qscale = NULL;
+ mpi->usage_count++;
}
- mpi->usage_count++;
return mpi;
}
diff --git a/libmpcodecs/vf_delogo.c b/libmpcodecs/vf_delogo.c
index 8fcc869c91..add6dc6b0c 100644
--- a/libmpcodecs/vf_delogo.c
+++ b/libmpcodecs/vf_delogo.c
@@ -180,6 +180,7 @@ static void get_image(struct vf_instance *vf, mp_image_t *mpi){
if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change
if(mpi->imgfmt!=vf->priv->outfmt) return; // colorspace differ
// ok, we can do pp in-place (or pp disabled):
+ mpi->priv =
vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,
mpi->type, mpi->flags, mpi->w, mpi->h);
mpi->planes[0]=vf->dmpi->planes[0];
@@ -197,7 +198,10 @@ static void get_image(struct vf_instance *vf, mp_image_t *mpi){
static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
mp_image_t *dmpi;
- if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
+ if(mpi->flags&MP_IMGFLAG_DIRECT) {
+ vf->dmpi = mpi->priv;
+ mpi->priv = NULL;
+ } else {
// no DR, so get a new image! hope we'll get DR buffer:
vf->dmpi=vf_get_image(vf->next,vf->priv->outfmt,
MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
diff --git a/libmpcodecs/vf_divtc.c b/libmpcodecs/vf_divtc.c
index e04e7c0b4e..6faeb7c411 100644
--- a/libmpcodecs/vf_divtc.c
+++ b/libmpcodecs/vf_divtc.c
@@ -415,7 +415,7 @@ static int analyze(struct vf_priv_s *p)
n++;
}
- if(!n)
+ if(n <= 15)
{
mp_msg(MSGT_VFILTER, MSGL_FATAL, "%s: Empty 2-pass log file.\n",
vf_info_divtc.name);
diff --git a/libmpcodecs/vf_down3dright.c b/libmpcodecs/vf_down3dright.c
index 1119618e78..a263661592 100644
--- a/libmpcodecs/vf_down3dright.c
+++ b/libmpcodecs/vf_down3dright.c
@@ -100,12 +100,12 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
{
mp_image_t *dmpi;
- // hope we'll get DR buffer:
- dmpi=vf_get_image(vf->next, IMGFMT_YV12,
- MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE |
- (vf->priv->scaleh == 1) ? MP_IMGFLAG_READABLE : 0,
- mpi->w * vf->priv->scalew,
- mpi->h / vf->priv->scaleh - vf->priv->skipline);
+ // hope we'll get DR buffer:
+ dmpi=vf_get_image(vf->next, IMGFMT_YV12,
+ MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE |
+ ((vf->priv->scaleh == 1) ? MP_IMGFLAG_READABLE : 0),
+ mpi->w * vf->priv->scalew,
+ mpi->h / vf->priv->scaleh - vf->priv->skipline);
toright(dmpi->planes, mpi->planes, dmpi->stride,
mpi->stride, mpi->w, mpi->h, vf->priv);
diff --git a/libmpcodecs/vf_expand.c b/libmpcodecs/vf_expand.c
index ff13a8501e..839820510d 100644
--- a/libmpcodecs/vf_expand.c
+++ b/libmpcodecs/vf_expand.c
@@ -171,10 +171,6 @@ static void get_image(struct vf_instance *vf, mp_image_t *mpi){
static void start_slice(struct vf_instance *vf, mp_image_t *mpi){
// printf("start_slice called! flag=%d\n",mpi->flags&MP_IMGFLAG_DRAW_CALLBACK);
- if(!vf->next->draw_slice){
- mpi->flags&=~MP_IMGFLAG_DRAW_CALLBACK;
- return;
- }
// they want slices!!! allocate the buffer.
if(!mpi->priv)
mpi->priv=vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,
@@ -182,8 +178,6 @@ static void start_slice(struct vf_instance *vf, mp_image_t *mpi){
MP_IMGTYPE_TEMP, mpi->flags,
FFMAX(vf->priv->exp_w, mpi->width +vf->priv->exp_x),
FFMAX(vf->priv->exp_h, mpi->height+vf->priv->exp_y));
- if(!(vf->dmpi->flags&MP_IMGFLAG_DRAW_CALLBACK))
- mp_tmsg(MSGT_VFILTER, MSGL_WARN, "WARNING! Next filter doesn't support SLICES, get ready for sig11...\n"); // shouldn't happen.
vf->priv->first_slice = 1;
}
diff --git a/libmpcodecs/vf_ilpack.c b/libmpcodecs/vf_ilpack.c
index db4a849e1f..e98d70d85d 100644
--- a/libmpcodecs/vf_ilpack.c
+++ b/libmpcodecs/vf_ilpack.c
@@ -437,6 +437,7 @@ static int vf_open(vf_instance_t *vf, char *args)
mp_msg(MSGT_VFILTER, MSGL_WARN,
"ilpack: unknown mode %d (fallback to linear)\n",
vf->priv->mode);
+ /* Fallthrough */
case 1:
vf->priv->pack[0] = pack_li_0;
vf->priv->pack[1] = pack_li_1;
diff --git a/libmpcodecs/vf_phase.c b/libmpcodecs/vf_phase.c
index b9ea66c506..f5d937ef70 100644
--- a/libmpcodecs/vf_phase.c
+++ b/libmpcodecs/vf_phase.c
@@ -242,6 +242,8 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
static void uninit(struct vf_instance *vf)
{
+ if (!vf->priv)
+ return;
free(vf->priv->buf[0]);
free(vf->priv->buf[1]);
free(vf->priv->buf[2]);
diff --git a/libmpcodecs/vf_screenshot.c b/libmpcodecs/vf_screenshot.c
index 604aab7835..693d871e5f 100644
--- a/libmpcodecs/vf_screenshot.c
+++ b/libmpcodecs/vf_screenshot.c
@@ -56,6 +56,7 @@ static int config(struct vf_instance *vf,
static void start_slice(struct vf_instance *vf, mp_image_t *mpi)
{
+ mpi->priv=
vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,
mpi->type, mpi->flags, mpi->width, mpi->height);
if (vf->priv->shot) {
@@ -118,10 +119,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
{
mp_image_t *dmpi = (mp_image_t *)mpi->priv;
- if (mpi->flags & MP_IMGFLAG_DRAW_CALLBACK)
- dmpi = vf->dmpi;
- else
- if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
+ if(!(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK))){
dmpi=vf_get_image(vf->next,mpi->imgfmt,
MP_IMGTYPE_EXPORT, 0,
mpi->width, mpi->height);
diff --git a/libmpcodecs/vf_softpulldown.c b/libmpcodecs/vf_softpulldown.c
index 5bd5e66bfd..d07f9d6e26 100644
--- a/libmpcodecs/vf_softpulldown.c
+++ b/libmpcodecs/vf_softpulldown.c
@@ -163,16 +163,13 @@ static void uninit(struct vf_instance *vf)
static int vf_open(vf_instance_t *vf, char *args)
{
- struct vf_priv_s *p;
- vf->config = config;
- vf->put_image = put_image;
- vf->uninit = uninit;
- vf->default_reqs = VFCAP_ACCEPT_STRIDE;
- vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
- vf->priv->state = 0;
- vf->priv->last_frame_duration = 2;
- vf_detc_init_pts_buf(&vf->priv->ptsbuf);
- return 1;
+ vf->config = config;
+ vf->put_image = put_image;
+ vf->uninit = uninit;
+ vf->default_reqs = VFCAP_ACCEPT_STRIDE;
+ vf->priv = calloc(1, sizeof(struct vf_priv_s));
+ vf->priv->state = 0;
+ return 1;
}
const vf_info_t vf_info_softpulldown = {
diff --git a/libmpcodecs/vf_stereo3d.c b/libmpcodecs/vf_stereo3d.c
index 417ca23042..60208cb3c6 100644
--- a/libmpcodecs/vf_stereo3d.c
+++ b/libmpcodecs/vf_stereo3d.c
@@ -48,6 +48,7 @@ typedef enum stereo_code {
ANAGLYPH_YB_GRAY, //anaglyph yellow/blue gray
ANAGLYPH_YB_HALF, //anaglyph yellow/blue half colored
ANAGLYPH_YB_COLOR, //anaglyph yellow/blue colored
+ ANAGLYPH_YB_DUBOIS, //anaglyph yellow/blue dubois
MONO_L, //mono output for debugging (left eye only)
MONO_R, //mono output for debugging (right eye only)
SIDE_BY_SIDE_LR, //side by side parallel (left eye left, right eye right)
@@ -74,37 +75,51 @@ typedef struct component {
} component;
//==global variables==//
-static const int ana_coeff[10][3][6] = {
- {{19595, 38470, 7471, 0, 0, 0}, //ANAGLYPH_RC_GRAY
+static const int ana_coeff[][3][6] = {
+ [ANAGLYPH_RC_GRAY] =
+ {{19595, 38470, 7471, 0, 0, 0},
{ 0, 0, 0, 19595, 38470, 7471},
{ 0, 0, 0, 19595, 38470, 7471}},
- {{19595, 38470, 7471, 0, 0, 0}, //ANAGLYPH_RC_HALF
+ [ANAGLYPH_RC_HALF] =
+ {{19595, 38470, 7471, 0, 0, 0},
{ 0, 0, 0, 0, 65536, 0},
{ 0, 0, 0, 0, 0, 65536}},
- {{65536, 0, 0, 0, 0, 0}, //ANAGLYPH_RC_COLOR
+ [ANAGLYPH_RC_COLOR] =
+ {{65536, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 65536, 0},
{ 0, 0, 0, 0, 0, 65536}},
- {{29891, 32800, 11559, -2849, -5763, -102}, //ANAGLYPH_RC_DUBOIS
+ [ANAGLYPH_RC_DUBOIS] =
+ {{29891, 32800, 11559, -2849, -5763, -102},
{-2627, -2479, -1033, 24804, 48080, -1209},
{ -997, -1350, -358, -4729, -7403, 80373}},
- {{ 0, 0, 0, 19595, 38470, 7471}, //ANAGLYPH_GM_GRAY
+ [ANAGLYPH_GM_GRAY] =
+ {{ 0, 0, 0, 19595, 38470, 7471},
{19595, 38470, 7471, 0, 0, 0},
{ 0, 0, 0, 19595, 38470, 7471}},
- {{ 0, 0, 0, 65536, 0, 0}, //ANAGLYPH_GM_HALF
+ [ANAGLYPH_GM_HALF] =
+ {{ 0, 0, 0, 65536, 0, 0},
{19595, 38470, 7471, 0, 0, 0},
{ 0, 0, 0, 0, 0, 65536}},
- {{ 0, 0, 0, 65536, 0, 0}, //ANAGLYPH_GM_COLOR
+ [ANAGLYPH_GM_COLOR] =
+ {{ 0, 0, 0, 65536, 0, 0},
{ 0, 65536, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 65536}},
- {{ 0, 0, 0, 19595, 38470, 7471}, //ANAGLYPH_YB_GRAY
+ [ANAGLYPH_YB_GRAY] =
+ {{ 0, 0, 0, 19595, 38470, 7471},
{ 0, 0, 0, 19595, 38470, 7471},
{19595, 38470, 7471, 0, 0, 0}},
- {{ 0, 0, 0, 65536, 0, 0}, //ANAGLYPH_YB_HALF
+ [ANAGLYPH_YB_HALF] =
+ {{ 0, 0, 0, 65536, 0, 0},
{ 0, 0, 0, 0, 65536, 0},
{19595, 38470, 7471, 0, 0, 0}},
- {{ 0, 0, 0, 65536, 0, 0}, //ANAGLYPH_YB_COLOR
+ [ANAGLYPH_YB_COLOR] =
+ {{ 0, 0, 0, 65536, 0, 0},
{ 0, 0, 0, 0, 65536, 0},
- { 0, 0, 65536, 0, 0, 0}}
+ { 0, 0, 65536, 0, 0, 0}},
+ [ANAGLYPH_YB_DUBOIS] =
+ {{65535,-12650,18451, -987, -7590, -1049},
+ {-1604, 56032, 4196, 370, 3826, -1049},
+ {-2345,-10676, 1358, 5801, 11416, 56217}},
};
struct vf_priv_s {
@@ -202,6 +217,7 @@ static int config(struct vf_instance *vf, int width, int height, int d_width,
case ANAGLYPH_YB_GRAY:
case ANAGLYPH_YB_HALF:
case ANAGLYPH_YB_COLOR:
+ case ANAGLYPH_YB_DUBOIS:
memcpy(vf->priv->ana_matrix, ana_coeff[vf->priv->out.fmt],
sizeof(vf->priv->ana_matrix));
break;
@@ -413,6 +429,8 @@ static const struct format_preset {
{"anaglyph_yellow_blue_half_color", ANAGLYPH_YB_HALF},
{"aybc", ANAGLYPH_YB_COLOR},
{"anaglyph_yellow_blue_color", ANAGLYPH_YB_COLOR},
+ {"aybd", ANAGLYPH_YB_DUBOIS},
+ {"anaglyph_yellow_blue_dubois", ANAGLYPH_YB_DUBOIS},
{"ml", MONO_L},
{"mono_left", MONO_L},
{"mr", MONO_R},
diff --git a/libmpcodecs/vf_unsharp.c b/libmpcodecs/vf_unsharp.c
index aa3d567070..69d573cdc2 100644
--- a/libmpcodecs/vf_unsharp.c
+++ b/libmpcodecs/vf_unsharp.c
@@ -177,6 +177,7 @@ static void get_image( struct vf_instance *vf, mp_image_t *mpi ) {
static int put_image( struct vf_instance *vf, mp_image_t *mpi, double pts) {
mp_image_t *dmpi = mpi->priv;
+ mpi->priv = NULL;
if( !(mpi->flags & MP_IMGFLAG_DIRECT) )
// no DR, so get a new image! hope we'll get DR buffer: