[FFmpeg-devel] [PATCH] lavfi: add xbr filter
Michael Niedermayer
michaelni at gmx.at
Sun Oct 26 11:57:05 CET 2014
On Sun, Oct 26, 2014 at 02:51:48PM +0530, arwa arif wrote:
> I think the segmentation fault is maybe because of wrong input format. The
> code runs for rgb24 only. I have attached the updated patch along with the
> tested input file. I was not able to attach a video file. So, for now I am
> attaching an image instead.
code must not segfault
also, this segfaults too:
./ffplay images.jpeg -vf xbr,xbr
[...]
> +/**
> +* Calculates the weight of difference of the pixels, by transforming these
> +* pixels into their Y'UV parts. It then uses the threshold used by HQx filters:
> +* 48*Y + 7*U + 6*V, to give it those smooth looking edges.
> +**/
> +static int d(AVFrame *in,int x1,int y1,int x2,int y2){
> +
> + int r1 = *(in->data[0] + y1 * in->linesize[0] + x1*3);
> + int g1 = *(in->data[0] + y1 * in->linesize[0] + x1*3 + 1);
> + int b1 = *(in->data[0] + y1 * in->linesize[0] + x1*3 + 2);
> +
> + int r2 = *(in->data[0] + y2 * in->linesize[0] + x2*3);
> + int g2 = *(in->data[0] + y2 * in->linesize[0] + x2*3 + 1);
> + int b2 = *(in->data[0] + y2 * in->linesize[0] + x2*3 + 2);
> +
> + int r = (r1 - r2);
> + int g = (g1 - g2);
> + int b = (b1 - b2);
trailing whitespace
tools/patcheck should find all of them
> +
> + /*Convert RGB to Y'UV*/
> + int y = abs( ( ( 66 * r + 129 * g + 25 * b + 128) >> 8) + 16);
> + int u = abs( ( ( -38 * r - 74 * g + 112 * b + 128) >> 8) + 128);
> + int v = abs( ( ( 112 * r - 94 * g - 18 * b + 128) >> 8) + 128);
this looks alot better but i think the equations are still not correct
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- 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/20141026/ddfe19a4/attachment.asc>
More information about the ffmpeg-devel
mailing list