Mercurial > mplayer.hg
comparison libmpcodecs/vf_remove_logo.c @ 29263:0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
author | diego |
---|---|
date | Wed, 13 May 2009 02:58:57 +0000 |
parents | 089d5341f9bc |
children | 969a093964a9 |
comparison
equal
deleted
inserted
replaced
29262:7d545a6b8aff | 29263:0f1b5b68af32 |
---|---|
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
22 */ | 22 */ |
23 | 23 |
24 /** | 24 /** |
25 * \file vf_remove_logo.c | 25 * \file vf_remove_logo.c |
26 * | 26 * |
27 * \brief Advanced blur-based logo removing filter. | 27 * \brief Advanced blur-based logo removing filter. |
28 | 28 |
29 * Hello and welcome. This code implements a filter to remove annoying TV | 29 * Hello and welcome. This code implements a filter to remove annoying TV |
30 * logos and other annoying images placed onto a video stream. It works by filling | 30 * logos and other annoying images placed onto a video stream. It works by filling |
31 * in the pixels that comprise the logo with neighboring pixels. The transform is | 31 * in the pixels that comprise the logo with neighboring pixels. The transform is |
193 static void calculate_bounding_rectangle(int * posx1, int * posy1, int * posx2, int * posy2, pgm_structure * filter) | 193 static void calculate_bounding_rectangle(int * posx1, int * posy1, int * posx2, int * posy2, pgm_structure * filter) |
194 { | 194 { |
195 int x; /* Temporary variables to run */ | 195 int x; /* Temporary variables to run */ |
196 int y; /* through each row or column. */ | 196 int y; /* through each row or column. */ |
197 int start_x; | 197 int start_x; |
198 int start_y; | 198 int start_y; |
199 int end_x = filter->width - 1; | 199 int end_x = filter->width - 1; |
200 int end_y = filter->height - 1; | 200 int end_y = filter->height - 1; |
201 int did_we_find_a_logo_pixel = 0; | 201 int did_we_find_a_logo_pixel = 0; |
202 | 202 |
203 /* Let's find the top bound first. */ | 203 /* Let's find the top bound first. */ |
316 for (c = -a; c <= a; c++) | 316 for (c = -a; c <= a; c++) |
317 { | 317 { |
318 if ((b * b) + (c * c) <= (a * a)) /* Circular 0/1 mask. */ | 318 if ((b * b) + (c * c) <= (a * a)) /* Circular 0/1 mask. */ |
319 mask[a][b + a][c + a] = 1; | 319 mask[a][b + a][c + a] = 1; |
320 else | 320 else |
321 mask[a][b + a][c + a] = 0; | 321 mask[a][b + a][c + a] = 0; |
322 } | 322 } |
323 } | 323 } |
324 } | 324 } |
325 | 325 |
326 /* Store values back to vf->priv so they aren't lost after the function returns. */ | 326 /* Store values back to vf->priv so they aren't lost after the function returns. */ |
764 * filter, has the logo removed by the filter, and is then sent to the next | 764 * filter, has the logo removed by the filter, and is then sent to the next |
765 * filter. | 765 * filter. |
766 */ | 766 */ |
767 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ | 767 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ |
768 mp_image_t *dmpi; | 768 mp_image_t *dmpi; |
769 | 769 |
770 dmpi=vf_get_image(vf->next,((vf_priv_s *)vf->priv)->fmt, | 770 dmpi=vf_get_image(vf->next,((vf_priv_s *)vf->priv)->fmt, |
771 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, | 771 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, |
772 mpi->w, mpi->h); | 772 mpi->w, mpi->h); |
773 | 773 |
774 /* Check to make sure that the filter image and the video stream are the same size. */ | 774 /* Check to make sure that the filter image and the video stream are the same size. */ |