Mercurial > mplayer.hg
annotate libmpcodecs/vf_yuy2.c @ 13877:a4a28364b79b
10l
author | faust3 |
---|---|
date | Fri, 05 Nov 2004 13:48:41 +0000 |
parents | 7f95a79ba916 |
children | 6ff3379a0862 |
rev | line source |
---|---|
5539 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 #include <string.h> | |
4 #include <inttypes.h> | |
5 | |
6 #include "../config.h" | |
7 #include "../mp_msg.h" | |
8 | |
5607 | 9 #include "img_format.h" |
10 #include "mp_image.h" | |
5539 | 11 #include "vf.h" |
12 | |
13 #include "../libvo/fastmemcpy.h" | |
14 #include "../postproc/rgb2rgb.h" | |
10993 | 15 #include "vf_scale.h" |
5539 | 16 |
17 //===========================================================================// | |
18 | |
19 static int config(struct vf_instance_s* vf, | |
20 int width, int height, int d_width, int d_height, | |
21 unsigned int flags, unsigned int outfmt){ | |
10993 | 22 |
23 sws_rgb2rgb_init(get_sws_cpuflags()); | |
5539 | 24 |
25 if(vf_next_query_format(vf,IMGFMT_YUY2)<=0){ | |
26 printf("yuy2 not supported by next filter/vo :(\n"); | |
27 return 0; | |
28 } | |
29 | |
30 return vf_next_config(vf,width,height,d_width,d_height,flags,IMGFMT_YUY2); | |
31 } | |
32 | |
7368 | 33 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){ |
5539 | 34 mp_image_t *dmpi; |
35 | |
36 // hope we'll get DR buffer: | |
37 dmpi=vf_get_image(vf->next,IMGFMT_YUY2, | |
38 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, | |
39 mpi->w, mpi->h); | |
40 | |
7342 | 41 if(mpi->imgfmt==IMGFMT_422P) |
42 yuv422ptoyuy2(mpi->planes[0],mpi->planes[1],mpi->planes[2], dmpi->planes[0], | |
43 mpi->w,mpi->h, mpi->stride[0],mpi->stride[1],dmpi->stride[0]); | |
44 else | |
5539 | 45 yv12toyuy2(mpi->planes[0],mpi->planes[1],mpi->planes[2], dmpi->planes[0], |
46 mpi->w,mpi->h, mpi->stride[0],mpi->stride[1],dmpi->stride[0]); | |
47 | |
9934 | 48 vf_clone_mpi_attributes(dmpi, mpi); |
5539 | 49 |
7368 | 50 return vf_next_put_image(vf,dmpi); |
5539 | 51 } |
52 | |
53 //===========================================================================// | |
54 | |
55 static int query_format(struct vf_instance_s* vf, unsigned int fmt){ | |
56 switch(fmt){ | |
57 case IMGFMT_YV12: | |
58 case IMGFMT_I420: | |
59 case IMGFMT_IYUV: | |
7342 | 60 case IMGFMT_422P: |
5565
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5539
diff
changeset
|
61 return vf_next_query_format(vf,IMGFMT_YUY2) & (~VFCAP_CSP_SUPPORTED_BY_HW); |
5539 | 62 } |
63 return 0; | |
64 } | |
65 | |
66 static int open(vf_instance_t *vf, char* args){ | |
67 vf->config=config; | |
68 vf->put_image=put_image; | |
69 vf->query_format=query_format; | |
70 return 1; | |
71 } | |
72 | |
73 vf_info_t vf_info_yuy2 = { | |
7342 | 74 "fast YV12/Y422p -> YUY2 conversion", |
5539 | 75 "yuy2", |
76 "A'rpi", | |
77 "", | |
9593
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
7368
diff
changeset
|
78 open, |
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
7368
diff
changeset
|
79 NULL |
5539 | 80 }; |
81 | |
82 //===========================================================================// |