Mercurial > mplayer.hg
comparison libmpcodecs/vf_yvu9.c @ 32702:7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
author | cehoyos |
---|---|
date | Fri, 14 Jan 2011 22:10:21 +0000 |
parents | a972c1a4a012 |
children |
comparison
equal
deleted
inserted
replaced
32701:02bc7c860503 | 32702:7af3e6f901fd |
---|---|
33 | 33 |
34 //===========================================================================// | 34 //===========================================================================// |
35 | 35 |
36 static int config(struct vf_instance *vf, | 36 static int config(struct vf_instance *vf, |
37 int width, int height, int d_width, int d_height, | 37 int width, int height, int d_width, int d_height, |
38 unsigned int flags, unsigned int outfmt){ | 38 unsigned int flags, unsigned int outfmt){ |
39 | 39 |
40 if(vf_next_query_format(vf,IMGFMT_YV12)<=0){ | 40 if(vf_next_query_format(vf,IMGFMT_YV12)<=0){ |
41 mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_WarnNextFilterDoesntSupport, "YVU9"); | 41 mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_WarnNextFilterDoesntSupport, "YVU9"); |
42 return 0; | 42 return 0; |
43 } | 43 } |
44 | 44 |
45 return vf_next_config(vf,width,height,d_width,d_height,flags,IMGFMT_YV12); | 45 return vf_next_config(vf,width,height,d_width,d_height,flags,IMGFMT_YV12); |
46 } | 46 } |
47 | 47 |
49 mp_image_t *dmpi; | 49 mp_image_t *dmpi; |
50 int y,w,h; | 50 int y,w,h; |
51 | 51 |
52 // hope we'll get DR buffer: | 52 // hope we'll get DR buffer: |
53 dmpi=vf_get_image(vf->next,IMGFMT_YV12, | 53 dmpi=vf_get_image(vf->next,IMGFMT_YV12, |
54 MP_IMGTYPE_TEMP, 0/*MP_IMGFLAG_ACCEPT_STRIDE*/, | 54 MP_IMGTYPE_TEMP, 0/*MP_IMGFLAG_ACCEPT_STRIDE*/, |
55 mpi->w, mpi->h); | 55 mpi->w, mpi->h); |
56 | 56 |
57 for(y=0;y<mpi->h;y++) | 57 for(y=0;y<mpi->h;y++) |
58 fast_memcpy(dmpi->planes[0]+dmpi->stride[0]*y, | 58 fast_memcpy(dmpi->planes[0]+dmpi->stride[0]*y, |
59 mpi->planes[0]+mpi->stride[0]*y, | 59 mpi->planes[0]+mpi->stride[0]*y, |
60 mpi->w); | 60 mpi->w); |
61 | 61 |
62 w=mpi->w/4; h=mpi->h/2; | 62 w=mpi->w/4; h=mpi->h/2; |
63 for(y=0;y<h;y++){ | 63 for(y=0;y<h;y++){ |
64 unsigned char* s=mpi->planes[1]+mpi->stride[1]*(y>>1); | 64 unsigned char* s=mpi->planes[1]+mpi->stride[1]*(y>>1); |
65 unsigned char* d=dmpi->planes[1]+dmpi->stride[1]*y; | 65 unsigned char* d=dmpi->planes[1]+dmpi->stride[1]*y; |
66 int x; | 66 int x; |
67 for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x]; | 67 for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x]; |
68 } | 68 } |
69 for(y=0;y<h;y++){ | 69 for(y=0;y<h;y++){ |
70 unsigned char* s=mpi->planes[2]+mpi->stride[2]*(y>>1); | 70 unsigned char* s=mpi->planes[2]+mpi->stride[2]*(y>>1); |
71 unsigned char* d=dmpi->planes[2]+dmpi->stride[2]*y; | 71 unsigned char* d=dmpi->planes[2]+dmpi->stride[2]*y; |
72 int x; | 72 int x; |
73 for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x]; | 73 for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x]; |
74 } | 74 } |
75 | 75 |
76 vf_clone_mpi_attributes(dmpi, mpi); | 76 vf_clone_mpi_attributes(dmpi, mpi); |
77 | 77 |
78 return vf_next_put_image(vf,dmpi, pts); | 78 return vf_next_put_image(vf,dmpi, pts); |
80 | 80 |
81 //===========================================================================// | 81 //===========================================================================// |
82 | 82 |
83 static int query_format(struct vf_instance *vf, unsigned int fmt){ | 83 static int query_format(struct vf_instance *vf, unsigned int fmt){ |
84 if (fmt == IMGFMT_YVU9 || fmt == IMGFMT_IF09) | 84 if (fmt == IMGFMT_YVU9 || fmt == IMGFMT_IF09) |
85 return vf_next_query_format(vf,IMGFMT_YV12) & (~VFCAP_CSP_SUPPORTED_BY_HW); | 85 return vf_next_query_format(vf,IMGFMT_YV12) & (~VFCAP_CSP_SUPPORTED_BY_HW); |
86 return 0; | 86 return 0; |
87 } | 87 } |
88 | 88 |
89 static int vf_open(vf_instance_t *vf, char *args){ | 89 static int vf_open(vf_instance_t *vf, char *args){ |
90 vf->config=config; | 90 vf->config=config; |