[Ffmpeg-devel] [PATCH] rewrite vhook/drawtext.c

Michael Niedermayer michaelni
Wed Sep 6 15:40:35 CEST 2006


Hi

On Wed, Sep 06, 2006 at 10:13:19AM -0300, Gustavo Sverzut Barbieri wrote:
[...]
> >> - makefile: use vhook specific LDFLAGS by appending library name with
> >> $(LDFLAGS_$@) and defining LDFLAGS_drawtext.so. I'm not sure if this
> >> works with every build system, please check.
> >
> >could you summarize the difference between the old and rewritten drawtext.c
> >
> >also if the files have nothing in common then replacing the old by the new
> >will not be accepted, rather add the new as drawtext2.c and disable the
> >old but not remove it, if then after a few month there are no complaints
> >then the old could be removed
> 
> no, essentially they're the same thing. Here follows the set of changes:
> - move macros to inline: less error-prone. ie: the old macros did use
> {} blocks, instead of do { } while (0);... which is buggy if used with
> "if" clauses. This is for GET_PIXEL ->get_pixel, SET_PIXEL ->
> set_pixel, RGB_TO_YUV -> rgb_to_yuv
> - replace time() usage, use gettimeofday()
> - use posix_fadvise() to hint about file usage.
> - use stdint types
> - isolate code in smaller functions, this helps understanding what
> code is doing, even things like "value >> 6" are not trivial to
> understand (why divide by 64?), but inside a function
> "ft_pos_to_pixel()" it make clear it's because you want to convert
> freetype position to pixel units.
> 
> Aside from this refactoring, I did fix some algorithm bugs with
> draw_text(), the old way was complicated and did work for my common
> case, but not for every case.... background drawing was specially
> flawed, since the limits detection were wrong. Border drawing also
> were overcomplicated, it's simpler now. Function measure_and_cache()
> is what you want to read for position and size calculation (this is
> used by draw_text and draw_box).
> 
> I did wrote the code and it was pending a rewrite since then. Now I
> had some time and here it is.
> 
> I hope you understand,

i do, but unrelated changes must be seperate patches, so as a change to the
existing drawtext.c your patch would need to be split

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list