comparison libmpcodecs/vf_divtc.c @ 23666:5c3c7efd9b75

Get rid of my_memcpy_pic code duplication in many filters.
author reimar
date Thu, 28 Jun 2007 11:24:12 +0000
parents fa99b3d31d13
children ba7da0656d80
comparison
equal deleted inserted replaced
23665:88b417d972ab 23666:5c3c7efd9b75
168 *d=(t=(*d<<1)-*s)<0?0:t>255?255:t; 168 *d=(t=(*d<<1)-*s)<0?0:t>255?255:t;
169 169
170 return 0; 170 return 0;
171 } 171 }
172 172
173 static int copyop(unsigned char *d, unsigned char *s, int bpl, int h, int dstride, int sstride, int dummy) {
174 memcpy_pic(d, s, bpl, h, dstride, sstride);
175 return 0;
176 }
177
173 static int imgop(int(*planeop)(unsigned char *, unsigned char *, 178 static int imgop(int(*planeop)(unsigned char *, unsigned char *,
174 int, int, int, int, int), 179 int, int, int, int, int),
175 mp_image_t *dst, mp_image_t *src, int arg) 180 mp_image_t *dst, mp_image_t *src, int arg)
176 { 181 {
177 if(dst->flags&MP_IMGFLAG_PLANAR) 182 if(dst->flags&MP_IMGFLAG_PLANAR)
334 } 339 }
335 340
336 switch((p->frameno++-p->phase+10)%5) 341 switch((p->frameno++-p->phase+10)%5)
337 { 342 {
338 case 0: 343 case 0:
339 imgop((void *)memcpy_pic, dmpi, mpi, 0); 344 imgop(copyop, dmpi, mpi, 0);
340 return 0; 345 return 0;
341 346
342 case 4: 347 case 4:
343 if(p->deghost>0) 348 if(p->deghost>0)
344 { 349 {
346 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | 351 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE |
347 MP_IMGFLAG_READABLE, 352 MP_IMGFLAG_READABLE,
348 mpi->width, mpi->height); 353 mpi->width, mpi->height);
349 vf_clone_mpi_attributes(tmpi, mpi); 354 vf_clone_mpi_attributes(tmpi, mpi);
350 355
351 imgop((void *)memcpy_pic, tmpi, mpi, 0); 356 imgop(copyop, tmpi, mpi, 0);
352 imgop(deghost_plane, tmpi, dmpi, p->deghost); 357 imgop(deghost_plane, tmpi, dmpi, p->deghost);
353 imgop((void *)memcpy_pic, dmpi, mpi, 0); 358 imgop(copyop, dmpi, mpi, 0);
354 return vf_next_put_image(vf, tmpi, MP_NOPTS_VALUE); 359 return vf_next_put_image(vf, tmpi, MP_NOPTS_VALUE);
355 } 360 }
356 } 361 }
357 362
358 imgop((void *)memcpy_pic, dmpi, mpi, 0); 363 imgop(copyop, dmpi, mpi, 0);
359 return vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE); 364 return vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
360 } 365 }
361 366
362 static int analyze(struct vf_priv_s *p) 367 static int analyze(struct vf_priv_s *p)
363 { 368 {