Mercurial > mplayer.hg
comparison libmpcodecs/vf.c @ 6486:c0d84f46d349
yvu9 support
author | alex |
---|---|
date | Fri, 21 Jun 2002 17:38:06 +0000 |
parents | 83032783f65d |
children | 3d520cf84f50 |
comparison
equal
deleted
inserted
replaced
6485:52563321dc78 | 6486:c0d84f46d349 |
---|---|
31 extern vf_info_t vf_info_lavc; | 31 extern vf_info_t vf_info_lavc; |
32 extern vf_info_t vf_info_dvbscale; | 32 extern vf_info_t vf_info_dvbscale; |
33 extern vf_info_t vf_info_cropdetect; | 33 extern vf_info_t vf_info_cropdetect; |
34 extern vf_info_t vf_info_test; | 34 extern vf_info_t vf_info_test; |
35 extern vf_info_t vf_info_noise; | 35 extern vf_info_t vf_info_noise; |
36 extern vf_info_t vf_info_yvu9; | |
36 | 37 |
37 char** vo_plugin_args=(char**) NULL; | 38 char** vo_plugin_args=(char**) NULL; |
38 | 39 |
39 // list of available filters: | 40 // list of available filters: |
40 static vf_info_t* filter_list[]={ | 41 static vf_info_t* filter_list[]={ |
59 #endif | 60 #endif |
60 &vf_info_dvbscale, | 61 &vf_info_dvbscale, |
61 &vf_info_cropdetect, | 62 &vf_info_cropdetect, |
62 &vf_info_test, | 63 &vf_info_test, |
63 &vf_info_noise, | 64 &vf_info_noise, |
65 &vf_info_yvu9, | |
64 NULL | 66 NULL |
65 }; | 67 }; |
66 | 68 |
67 //============================================================================ | 69 //============================================================================ |
68 // mpi stuff: | 70 // mpi stuff: |
162 | 164 |
163 if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ | 165 if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ |
164 // non-direct and not yet allocaed image. allocate it! | 166 // non-direct and not yet allocaed image. allocate it! |
165 mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8); | 167 mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8); |
166 if(mpi->flags&MP_IMGFLAG_PLANAR){ | 168 if(mpi->flags&MP_IMGFLAG_PLANAR){ |
167 // YV12/I420. feel free to add other planar formats here... | 169 // YV12/I420/YVU9. feel free to add other planar formats here... |
168 if(!mpi->stride[0]) mpi->stride[0]=mpi->width; | 170 if(!mpi->stride[0]) mpi->stride[0]=mpi->width; |
169 if(!mpi->stride[1]) mpi->stride[1]=mpi->stride[2]=mpi->width/2; | 171 if (!mpi->stride[1]) |
172 { | |
173 if (mpi->imgfmt == IMGFMT_YVU9) | |
174 mpi->stride[1]=mpi->stride[2]=mpi->width/4; | |
175 else | |
176 mpi->stride[1]=mpi->stride[2]=mpi->width/2; | |
177 } | |
170 if(mpi->flags&MP_IMGFLAG_SWAPPED){ | 178 if(mpi->flags&MP_IMGFLAG_SWAPPED){ |
171 // I420/IYUV (Y,U,V) | 179 // I420/IYUV (Y,U,V) |
172 mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; | 180 mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; |
173 mpi->planes[2]=mpi->planes[1]+(mpi->width>>1)*(mpi->height>>1); | 181 mpi->planes[2]=mpi->planes[1]+(mpi->width>>1)*(mpi->height>>1); |
174 } else { | 182 } else { |
175 // YV12,YVU9 (Y,V,U) | 183 // YV12,YVU9 (Y,V,U) |
176 mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height; | 184 mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height; |
177 mpi->planes[1]=mpi->planes[2]+(mpi->width>>1)*(mpi->height>>1); | 185 if (mpi->imgfmt == IMGFMT_YVU9) |
186 mpi->planes[1]=mpi->planes[2]+(mpi->width>>2)*(mpi->height>>2); | |
187 else | |
188 mpi->planes[1]=mpi->planes[2]+(mpi->width>>1)*(mpi->height>>1); | |
178 } | 189 } |
179 } else { | 190 } else { |
180 if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8; | 191 if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8; |
181 } | 192 } |
182 vf_mpi_clear(mpi,0,0,mpi->width,mpi->height); | 193 vf_mpi_clear(mpi,0,0,mpi->width,mpi->height); |
190 ((mpi->flags&MP_IMGFLAG_DIRECT)?"Direct Rendering":"Allocating"), | 201 ((mpi->flags&MP_IMGFLAG_DIRECT)?"Direct Rendering":"Allocating"), |
191 mpi->width,mpi->height,mpi->bpp, | 202 mpi->width,mpi->height,mpi->bpp, |
192 (mpi->flags&MP_IMGFLAG_YUV)?"YUV":"RGB", | 203 (mpi->flags&MP_IMGFLAG_YUV)?"YUV":"RGB", |
193 (mpi->flags&MP_IMGFLAG_PLANAR)?"planar":"packed", | 204 (mpi->flags&MP_IMGFLAG_PLANAR)?"planar":"packed", |
194 mpi->bpp*mpi->width*mpi->height/8); | 205 mpi->bpp*mpi->width*mpi->height/8); |
206 mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"(imgfmt: %x, planes: %x,%x,%x strides: %d,%d,%d)\n", | |
207 mpi->imgfmt, mpi->planes[0], mpi->planes[1], mpi->planes[2], | |
208 mpi->stride[0], mpi->stride[1], mpi->stride[2]); | |
195 mpi->flags|=MP_IMGFLAG_TYPE_DISPLAYED; | 209 mpi->flags|=MP_IMGFLAG_TYPE_DISPLAYED; |
196 } | 210 } |
197 | 211 |
198 } | 212 } |
199 return mpi; | 213 return mpi; |