[FFmpeg-devel] Fwd: [PATCH] lavfi: add xbr filter

Michael Niedermayer michaelni at gmx.at
Mon Nov 10 04:14:44 CET 2014


On Sun, Nov 09, 2014 at 11:06:17PM +0530, arwa arif wrote:
> On Sun, Nov 9, 2014 at 3:36 PM, arwa arif <arwaarif1994 at gmail.com> wrote:
> 
> >
> >
> > On Sun, Nov 9, 2014 at 7:07 AM, Michael Niedermayer <michaelni at gmx.at>
> > wrote:
> >
> >> On Sun, Nov 09, 2014 at 01:13:18AM +0100, Stefano Sabatini wrote:
> >> > On date Sunday 2014-11-09 00:59:36 +0530, arwa arif encoded:
> >> [...]
> >> >
> >> > > +#define pg_lbmask        0x00FEFEFE
> >> > > +#define pg_red_blue_mask 0x00FF00FF
> >> > > +#define pg_green_mask    0x0000FF00
> >> >
> >> > pg stands for? Also usually macros and defines are UPCASED.
> >>
> >> the names where taken from the reference code, so i suspect none of
> >> us can know what pg stands for
> >>
> >>
> >> [...]
> >> > > +static uint32_t df(uint32_t x, uint32_t y, const uint32_t *r2y)
> >> > > +{
> >> > > +
> >> > > +#define YMASK 0xff0000
> >> > > +#define UMASK 0x00ff00
> >> > > +#define VMASK 0x0000ff
> >> > > +
> >> > > +    uint32_t yuv1 = r2y[x & 0xffffff];
> >> > > +    uint32_t yuv2 = r2y[y & 0xffffff];
> >> >
> >> > Note: is the mask needed?
> >>
> >> this depends on if AV_PIX_FMT_0RGB32 is guranteed to have the 0 byte
> >> really 0. I would not bet on that, even if it works i suggest to leave
> >> this masking in there somewhere
> >>
> >> [...]
> >> --
> >> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> >>
> >> The real ebay dictionary, page 1
> >> "Used only once"    - "Some unspecified defect prevented a second use"
> >> "In good condition" - "Can be repaird by experienced expert"
> >> "As is" - "You wouldnt want it even if you were payed for it, if you knew
> >> ..."
> >>
> >>
> > I tried the running the filter without YUV masks, it is giving
> > segmentation fault.
> >
> >
> >> _______________________________________________
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel at ffmpeg.org
> >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>
> >>
> >
> I have implemented 2x,3x and 4x.

>  Changelog                |    1 
>  LICENSE.md               |    1 
>  configure                |    1 
>  doc/filters.texi         |    4 
>  libavfilter/Makefile     |    1 
>  libavfilter/allfilters.c |    1 
>  libavfilter/vf_xbr.c     |  758 +++++++++++++++++++++++++++++++++++++++++++++++
>  7 files changed, 767 insertions(+)
> 95d0dba9b3e0a3df6991a0daef4c1eae76fc2d39  0001-lavfi-add-xbr-filter.patch
> From 04b57f43e5904b9016001b86daa96c9a88f64b0e Mon Sep 17 00:00:00 2001
> From: Arwa Arif <arwaarif1994 at gmail.com>
> Date: Thu, 30 Oct 2014 22:06:20 +0530
> Subject: [PATCH] lavfi: add xbr filter xBR

very nice !
ive removed a few remaining trailing whitespaces and Capitalized the
context name for consistency with the rest of FFmpeg and pushed the
patch
Note you can probably configure your text editor to automatically
remove trailing whitespaces, many text editors support that

The output of the filter looks good and very similar to some reference
images i found like
http://i.imgur.com/FhiA3.png

there are some differences like somewhat more corners than rounded
curves on some squares which are caused by the different df()
function.
simply scaling the output of df() by /2 or /4 changes the areas of
the image that look different.
I think its a matter of taste which scaling looks better, also
the Y,U,V elements could be scaled independantly

Thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141110/6d78661d/attachment.asc>


More information about the ffmpeg-devel mailing list