[FFmpeg-devel] [Patch] beautified + accelerated vf_fillborders – Please review

Michael Niedermayer michael at niedermayer.cc
Fri Mar 15 23:09:41 EET 2019


On Fri, Mar 15, 2019 at 01:08:33AM +0100, Ulf Zibis wrote:
[...]
>  static void fixed_borders16(FillBordersContext *s, AVFrame *frame)
>  {
> -    int p, y, x;
> -
> -    for (p = 0; p < s->nb_planes; p++) {
> +    for (int p = 0; p < s->nb_planes; p++) {
>          uint16_t *data = (uint16_t *)frame->data[p];
> -        int linesize = frame->linesize[p] / sizeof(uint16_t);
> +        int lz = frame->linesize[p] / sizeof(uint16_t);
>          int width = s->planewidth[p];
> -        int height = s->planeheight[p];
> +        int height = s->planeheight[p] * lz;
>          int left = s->borders[p].left;
> -        int right = s->borders[p].right;
> -        int top = s->borders[p].top;
> -        int bottom = s->borders[p].bottom;
> -        uint16_t fill = s->fill[p] << (s->depth - 8);
> +        int right = width - s->borders[p].right;
> +        int top = s->borders[p].top * lz;
> +        int bottom = height - s->borders[p].bottom * lz;
> +        int fill_sz = MAX(MAX(left, right), top!=0 || height-bottom!=0 ? width : 0);

this would be FFMAX

src/libavfilter/vf_fillborders.c: In function ‘fixed_borders16’:
src/libavfilter/vf_fillborders.c:239:9: error: implicit declaration of function ‘MAX’ [-Werror=implicit-function-declaration]
         int fill_sz = MAX(MAX(left, right), top!=0 || height-bottom!=0 ? width : 0);

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

Modern terrorism, a quick summary: Need oil, start war with country that
has oil, kill hundread thousand in war. Let country fall into chaos,
be surprised about raise of fundamantalists. Drop more bombs, kill more
people, be surprised about them taking revenge and drop even more bombs
and strip your own citizens of their rights and freedoms. to be continued
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190315/b1dedf16/attachment.sig>


More information about the ffmpeg-devel mailing list