From 1b9d4a771a27d6017d826ed03dfbbc7ee976bf77 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 12 Dec 2012 23:55:41 +0100 Subject: video: remove things related to old DR code Remove mp_image.width/height. The w/h members are the ones to use. width/height were used internally by vf_get_image(), and sometimes for other purposes. Remove some image flags, most of which are now useless or completely unused. This includes VFCAP_ACCEPT_STRIDE: the vf_expand insertion in vf.c does nothing. Remove some other unused mp_image fields. Some rather messy changes in vo_opengl[_old] to get rid of legacy mp_image flags and fields. This is left from when vo_gl supported DR. --- video/filter/vf.c | 30 +++++++++++------------------- video/filter/vf_dlopen.c | 2 +- video/filter/vf_flip.c | 6 +++--- video/filter/vf_pp.c | 2 +- video/filter/vf_pullup.c | 2 +- video/filter/vf_vo.c | 7 +------ 6 files changed, 18 insertions(+), 31 deletions(-) (limited to 'video/filter') diff --git a/video/filter/vf.c b/video/filter/vf.c index 4da167641a..b31d8b3971 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -127,24 +127,16 @@ void vf_mpi_clear(mp_image_t *mpi, int x0, int y0, int w, int h) if (mpi->flags & MP_IMGFLAG_PLANAR) { y0 &= ~1; h += h & 1; - if (x0 == 0 && w == mpi->width) { - // full width clear: - memset(mpi->planes[0] + mpi->stride[0] * y0, 0, mpi->stride[0] * h); - memset(mpi->planes[1] + mpi->stride[1] *(y0 >> mpi->chroma_y_shift), - 128, mpi->stride[1] * (h >> mpi->chroma_y_shift)); - memset(mpi->planes[2] + mpi->stride[2] *(y0 >> mpi->chroma_y_shift), - 128, mpi->stride[2] * (h >> mpi->chroma_y_shift)); - } else - for (y = y0; y < y0 + h; y += 2) { - memset(mpi->planes[0] + x0 + mpi->stride[0] * y, 0, w); - memset(mpi->planes[0] + x0 + mpi->stride[0] * (y + 1), 0, w); - memset(mpi->planes[1] + (x0 >> mpi->chroma_x_shift) + - mpi->stride[1] * (y >> mpi->chroma_y_shift), - 128, (w >> mpi->chroma_x_shift)); - memset(mpi->planes[2] + (x0 >> mpi->chroma_x_shift) + - mpi->stride[2] * (y >> mpi->chroma_y_shift), - 128, (w >> mpi->chroma_x_shift)); - } + for (y = y0; y < y0 + h; y += 2) { + memset(mpi->planes[0] + x0 + mpi->stride[0] * y, 0, w); + memset(mpi->planes[0] + x0 + mpi->stride[0] * (y + 1), 0, w); + memset(mpi->planes[1] + (x0 >> mpi->chroma_x_shift) + + mpi->stride[1] * (y >> mpi->chroma_y_shift), + 128, (w >> mpi->chroma_x_shift)); + memset(mpi->planes[2] + (x0 >> mpi->chroma_x_shift) + + mpi->stride[2] * (y >> mpi->chroma_y_shift), + 128, (w >> mpi->chroma_x_shift)); + } return; } // packed: @@ -378,7 +370,7 @@ void vf_clone_mpi_attributes(mp_image_t *dst, mp_image_t *src) dst->fields = src->fields; dst->qscale_type = src->qscale_type; dst->pts = src->pts; - if (dst->width == src->width && dst->height == src->height) { + if (dst->w == src->w && dst->h == src->h) { dst->qstride = src->qstride; dst->qscale = src->qscale; dst->display_w = src->display_w; diff --git a/video/filter/vf_dlopen.c b/video/filter/vf_dlopen.c index 639f1c1d36..323f5231ee 100644 --- a/video/filter/vf_dlopen.c +++ b/video/filter/vf_dlopen.c @@ -188,7 +188,7 @@ static int filter(struct vf_instance *vf, struct mp_image *mpi) set_imgprop(&vf->priv->filter.inpic, mpi); if (mpi->qscale) { if (mpi->qscale_type != 0) { - k = mpi->qstride * ((mpi->height + 15) >> 4); + k = mpi->qstride * ((mpi->h + 15) >> 4); if (vf->priv->qbuffersize != k) { vf->priv->qbuffer = realloc(vf->priv->qbuffer, k); vf->priv->qbuffersize = k; diff --git a/video/filter/vf_flip.c b/video/filter/vf_flip.c index 49d6993023..aa9fbaf0da 100644 --- a/video/filter/vf_flip.c +++ b/video/filter/vf_flip.c @@ -40,14 +40,14 @@ static int config(struct vf_instance *vf, static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi) { mpi->planes[0]=mpi->planes[0]+ - mpi->stride[0]*(mpi->height-1); + mpi->stride[0]*(mpi->h-1); mpi->stride[0]=-mpi->stride[0]; if(mpi->flags&MP_IMGFLAG_PLANAR){ mpi->planes[1]=mpi->planes[1]+ - mpi->stride[1]*((mpi->height>>mpi->chroma_y_shift)-1); + mpi->stride[1]*((mpi->h>>mpi->chroma_y_shift)-1); mpi->stride[1]=-mpi->stride[1]; mpi->planes[2]=mpi->planes[2]+ - mpi->stride[2]*((mpi->height>>mpi->chroma_y_shift)-1); + mpi->stride[2]*((mpi->h>>mpi->chroma_y_shift)-1); mpi->stride[2]=-mpi->stride[2]; } return mpi; diff --git a/video/filter/vf_pp.c b/video/filter/vf_pp.c index 82bc0181e0..8a6b1cf172 100644 --- a/video/filter/vf_pp.c +++ b/video/filter/vf_pp.c @@ -150,7 +150,7 @@ static int vf_open(vf_instance_t *vf, char *args){ vf->config=config; vf->filter=filter; vf->uninit=uninit; - vf->default_caps=VFCAP_ACCEPT_STRIDE|VFCAP_POSTPROC; + vf->default_caps=VFCAP_POSTPROC; vf->priv=malloc(sizeof(struct vf_priv_s)); vf->priv->context=NULL; diff --git a/video/filter/vf_pullup.c b/video/filter/vf_pullup.c index 84bc64b1cf..45e80b6b57 100644 --- a/video/filter/vf_pullup.c +++ b/video/filter/vf_pullup.c @@ -58,7 +58,7 @@ static void init_pullup(struct vf_instance *vf, mp_image_t *mpi) c->h[1] = c->h[2] = mpi->chroma_height; c->w[3] = ((mpi->w+15)/16) * ((mpi->h+15)/16); c->h[3] = 2; - c->stride[0] = mpi->width; + c->stride[0] = mpi->w; c->stride[1] = c->stride[2] = mpi->chroma_width; c->stride[3] = c->w[3]; c->background[1] = c->background[2] = 128; diff --git a/video/filter/vf_vo.c b/video/filter/vf_vo.c index 93ca91b2b1..bb29684b10 100644 --- a/video/filter/vf_vo.c +++ b/video/filter/vf_vo.c @@ -113,12 +113,7 @@ static int control(struct vf_instance *vf, int request, void *data) static int query_format(struct vf_instance *vf, unsigned int fmt) { - int flags = video_out->driver->query_format(video_out, fmt); - // draw_slice() accepts stride, draw_frame() doesn't: - if (flags) - if (fmt == IMGFMT_YV12 || fmt == IMGFMT_I420 || fmt == IMGFMT_IYUV) - flags |= VFCAP_ACCEPT_STRIDE; - return flags; + return video_out->driver->query_format(video_out, fmt); } static void uninit(struct vf_instance *vf) -- cgit v1.2.3