[Ffmpeg-devel] [PATCH] watermark.c optimizations for single-frameinput (previous patch included)
Mihail Stoyanov
screamer
Sat Oct 21 20:02:34 CEST 2006
Resending the patch with fixed tabs and some more optimizations suggested by
Michael Niedermayer.
There is 1 more addition. There's new command line option "-c".
Quote watermark.c
* The pixel calculation formula in the default case (without -c) is:
* new_pixel_color = orig_pixel_color + (water_mark_image_color - threshold)
* It is applied to Red, Green, Blue channels.
* Using the -c changes the formula to:
* new_pixel_color = orig_pixel_color + (water_mark_image_color - threshold)
* + ((orig_pixel_color - threshold) * contrast_percent)
* In that way you have control over the difference between the movie source
* (a.k.a "orig") pixel color and the threshold (or contrast)
* If using the default threshold (without -t) the -c switch is similar to
* applying contrast ONLY over that watermark pixels that aren't equal to
the
* threashold (like contast-mask).
* When using positive values for -c, the dark pixels of the movie source
will
* become even more dark, the light ones will become even more light.
* When using negative values for -c, the dark pixels of the movie source
will
* become more light, the light ones will become even more dark.
* Note that the -l switch is in percents (-100 to 100)
Cheers
----- Original Message -----
From: "Mihail Stoyanov" <screamer at data.bg>
To: "FFmpeg development discussions and patches" <ffmpeg-devel at mplayerhq.hu>
Sent: Friday, October 20, 2006 4:41 PM
Subject: [Ffmpeg-devel] [PATCH] watermark.c optimizations for
single-frameinput (previous patch included)
> This patch optimizes watermark.c in 2 ways
> 1. Checks if the current pixel RGB (of the input image) is equal to the
> threshold before doing any other calculations, thus skipping useless
> itterations.
>
> 2. When using single-frame watermark input...
> [cut]
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: watermark_mod3.patch
Type: application/octet-stream
Size: 12756 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20061021/fef452bd/attachment.obj>
More information about the ffmpeg-devel
mailing list