Mercurial > mplayer.hg
annotate libmpcodecs/vf_flip.c @ 23584:a01f8876ea2c
adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
author | mhoffman |
---|---|
date | Fri, 22 Jun 2007 12:45:18 +0000 |
parents | 20aca9baf5d8 |
children | 00fff9a3b735 |
rev | line source |
---|---|
5557 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 #include <string.h> | |
4 | |
17012 | 5 #include "config.h" |
6 #include "mp_msg.h" | |
5557 | 7 |
5607 | 8 #include "mp_image.h" |
5557 | 9 #include "vf.h" |
10 | |
17012 | 11 #include "libvo/video_out.h" |
5557 | 12 |
13 //===========================================================================// | |
14 | |
6137
6253fc19afb1
do not pass the flip flag to vo - maybe it support flipping just report no support
arpi
parents:
5691
diff
changeset
|
15 static int config(struct vf_instance_s* vf, |
6253fc19afb1
do not pass the flip flag to vo - maybe it support flipping just report no support
arpi
parents:
5691
diff
changeset
|
16 int width, int height, int d_width, int d_height, |
6253fc19afb1
do not pass the flip flag to vo - maybe it support flipping just report no support
arpi
parents:
5691
diff
changeset
|
17 unsigned int flags, unsigned int outfmt){ |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
10141
diff
changeset
|
18 flags&=~VOFLAG_FLIPPING; // remove the FLIP flag |
6137
6253fc19afb1
do not pass the flip flag to vo - maybe it support flipping just report no support
arpi
parents:
5691
diff
changeset
|
19 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); |
6253fc19afb1
do not pass the flip flag to vo - maybe it support flipping just report no support
arpi
parents:
5691
diff
changeset
|
20 } |
6253fc19afb1
do not pass the flip flag to vo - maybe it support flipping just report no support
arpi
parents:
5691
diff
changeset
|
21 |
5557 | 22 static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){ |
23 if(mpi->flags&MP_IMGFLAG_ACCEPT_STRIDE){ | |
24 // try full DR ! | |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
25 vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, |
5557 | 26 mpi->type, mpi->flags, mpi->width, mpi->height); |
27 // set up mpi as a upside-down image of dmpi: | |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
28 mpi->planes[0]=vf->dmpi->planes[0]+ |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
29 vf->dmpi->stride[0]*(vf->dmpi->height-1); |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
30 mpi->stride[0]=-vf->dmpi->stride[0]; |
5557 | 31 if(mpi->flags&MP_IMGFLAG_PLANAR){ |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
32 mpi->planes[1]=vf->dmpi->planes[1]+ |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
33 vf->dmpi->stride[1]*((vf->dmpi->height>>mpi->chroma_y_shift)-1); |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
34 mpi->stride[1]=-vf->dmpi->stride[1]; |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
35 mpi->planes[2]=vf->dmpi->planes[2]+ |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
36 vf->dmpi->stride[2]*((vf->dmpi->height>>mpi->chroma_y_shift)-1); |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
37 mpi->stride[2]=-vf->dmpi->stride[2]; |
5557 | 38 } |
39 mpi->flags|=MP_IMGFLAG_DIRECT; | |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
40 mpi->priv=(void*)vf->dmpi; |
5557 | 41 } |
42 } | |
43 | |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17012
diff
changeset
|
44 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ |
5557 | 45 if(mpi->flags&MP_IMGFLAG_DIRECT){ |
7368 | 46 // we've used DR, so we're ready... |
9279 | 47 if(!(mpi->flags&MP_IMGFLAG_PLANAR)) |
48 ((mp_image_t*)mpi->priv)->planes[1] = mpi->planes[1]; // passthrough rgb8 palette | |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17012
diff
changeset
|
49 return vf_next_put_image(vf,(mp_image_t*)mpi->priv, pts); |
5557 | 50 } |
51 | |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
52 vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, |
5691 | 53 MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE, |
5557 | 54 mpi->width, mpi->height); |
55 | |
56 // set up mpi as a upside-down image of dmpi: | |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
57 vf->dmpi->planes[0]=mpi->planes[0]+ |
5557 | 58 mpi->stride[0]*(mpi->height-1); |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
59 vf->dmpi->stride[0]=-mpi->stride[0]; |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
60 if(vf->dmpi->flags&MP_IMGFLAG_PLANAR){ |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
61 vf->dmpi->planes[1]=mpi->planes[1]+ |
6539
79b536a37e40
better planar support, chroma subsampling support and Y8/Y800 support
alex
parents:
6137
diff
changeset
|
62 mpi->stride[1]*((mpi->height>>mpi->chroma_y_shift)-1); |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
63 vf->dmpi->stride[1]=-mpi->stride[1]; |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
64 vf->dmpi->planes[2]=mpi->planes[2]+ |
6539
79b536a37e40
better planar support, chroma subsampling support and Y8/Y800 support
alex
parents:
6137
diff
changeset
|
65 mpi->stride[2]*((mpi->height>>mpi->chroma_y_shift)-1); |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
66 vf->dmpi->stride[2]=-mpi->stride[2]; |
7258 | 67 } else |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9593
diff
changeset
|
68 vf->dmpi->planes[1]=mpi->planes[1]; // passthru bgr8 palette!!! |
5557 | 69 |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17012
diff
changeset
|
70 return vf_next_put_image(vf,vf->dmpi, pts); |
5557 | 71 } |
72 | |
73 //===========================================================================// | |
74 | |
75 static int open(vf_instance_t *vf, char* args){ | |
6137
6253fc19afb1
do not pass the flip flag to vo - maybe it support flipping just report no support
arpi
parents:
5691
diff
changeset
|
76 vf->config=config; |
5557 | 77 vf->get_image=get_image; |
78 vf->put_image=put_image; | |
5565
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5557
diff
changeset
|
79 vf->default_reqs=VFCAP_ACCEPT_STRIDE; |
5557 | 80 return 1; |
81 } | |
82 | |
83 vf_info_t vf_info_flip = { | |
84 "flip image upside-down", | |
85 "flip", | |
86 "A'rpi", | |
87 "", | |
9593
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
9279
diff
changeset
|
88 open, |
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
9279
diff
changeset
|
89 NULL |
5557 | 90 }; |
91 | |
92 //===========================================================================// |