The code is running fine on my laptop. What seg-fault log are you getting? Also, I looked on internet for converting rgb to yuv with integers, I got these equations. http://stackoverflow.com/questions/4979504/fast-rgb-yuv-conversion-in-opencl
On Sun, Oct 26, 2014 at 4:27 PM, Michael Niedermayer <michae...@gmx.at> wrote: > 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 > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel