On Sun, Oct 26, 2014 at 02:51:48PM +0530, arwa arif wrote: [...] > +/** > +* Mixes a pixel A, with pixel B, with B's transperancy set to 'a' > +* In other words, A is a solid color (bottom) and B is a transparent color > (top) > +**/ > +static int mix(AVFrame *in,int x1,int y1,int x2,int y2,int a,int mode){
> + /*If red color*/ > + int col1,col2; > + if(mode==0){ > + col1 = *(in->data[0] + y1 * in->linesize[0] + x1*3); > + col2 = *(in->data[0] + y2 * in->linesize[0] + x2*3); > + } > + > + /*If green color*/ > + else if(mode==1){ > + col1 = *(in->data[0] + y1 * in->linesize[0] + x1*3 + 1); > + col2 = *(in->data[0] + y2 * in->linesize[0] + x2*3 + 1); > + } > + > + /*If blue color*/ > + else{ > + col1 = *(in->data[0] + y1 * in->linesize[0] + x1*3 + 2); > + col2 = *(in->data[0] + y2 * in->linesize[0] + x2*3 + 2); > + } All of this can be probably be simplified to: const int col1 = in->data[0][y1 * in->linesize[0] + x1*3 + mode]; const int col2 = in->data[0][y2 * in->linesize[0] + x2*3 + mode]; And "mode" is badly named, "layer", "color" or "channel" would be more appropriate. [...] > +/** > +* Applies the xBR filter rules. > +**/ > +static void apply_edge_detection_rules(AVFrame *in,AVFrame *out,int x,int y){ > + > + /* Matrix: (10 is 0,0 i.e: current pixel) > + -2 | -1| 0| +1| +2 (x) > + ______________________________ > + -2 | [ 0][ 1][ 2] > + -1 | [ 3][ 4][ 5][ 6][ 7] > + 0 | [ 8][ 9][10][11][12] > + +1 | [13][14][15][16][17] > + +2 | [18][19][20] > + |(y)| Why are the spaces totally broken here? Unless I'm mistaken, you want this: -2 | -1| 0| +1| +2 +----------------------> (x) -2 | [ 0][ 1][ 2] -1 | [ 3][ 4][ 5][ 6][ 7] 0 | [ 8][ 9][10][11][12] +1 | [13][14][15][16][17] +2 | [18][19][20] | (y) v And then my question becomes: why don't you pick the original naming with the letters as in the specs? [...] -- Clément B.
pgpYZcFU0OUb4.pgp
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel