[FFmpeg-soc] expand filter (alternative to pad syntax)

Michael Niedermayer michaelni at gmx.at
Sun May 11 16:52:18 CEST 2008


On Sun, May 11, 2008 at 12:47:20PM +0100, vmrsss wrote:
> Hi Michael,
> 
> 	Sorry, I need some clarification.
> 
> On 11 May 2008, at 12:15, Michael Niedermayer wrote:
> >>  double a;               // required aspect
> >
> > remove all aspect related code, you dont know what you are doing.
> > read about pixel vs display aspect ratio
> 
> I am happy to remove aspect related code, I agree it is not  
> particularly useful. The idea is taken from mplayer and is to expand  
> the frame to fit a specific ratio instead of giving size. Upon  

hmm, i think i misunderstood the code, maybe it is useful to keep,
have you tested it?


> reflection, I agree with your remark (because I do understand pixel vs  
> aspect ratio very well :-)
> 
> >>    /* copy slice (y, y+h) from the original frame */
> >>    for(plane = 0; plane < 3; plane++) {
> >>
> >>      if( plane == 0 ){
> >> 	vsub = hsub = 0;
> >>      }else{
> >> 	vsub = pad->vsub; hsub = pad->hsub;
> >>      }
> >>
> >>      j1 = ((pad->y + y) >>vsub) * out->linesize[plane];
> >>      j2 = (y >>vsub) * in->linesize[plane];
> >>
> >>      for(i = 0; i < (h >>vsub); i++){
> >>
> >> 	memset(out->data[plane] + j1, padcolor[plane], pad->x >>hsub);
> >> 	memcpy(out->data[plane] + j1 + (pad->x >>hsub),
> >> 	       in->data[plane]  + j2, in->w >>hsub);
> >> 	memset(out->data[plane] + j1 + ((pad->x + in->w) >>hsub),
> >> 	       padcolor[plane], k >>hsub);
> >>
> >> 	j1 += out->linesize[plane];
> >> 	j2 += in->linesize[plane];
> >>      }
> >>    }
> >
> > unconditional copying is unacceptable
> 
> help explain: Why unconditional? I am copying in->data between y and y 
> +h, which I assume is what draw_slice(...,y,h) entitles to do. Anyway,  
> more fittingly: how would you want that copying to be coded?

There should be no copy.
The source filter should directly draw into the larger buffer of the
destination filter.


> 
> >>
> >>    if( y+h >= in->h ){ // draw bottom bar
> >>      j1 = in->h + pad->y;
> >>      j2 = out->h - j1;
> >
> >>      memset(out->data[0] + j1 * out->linesize[0],
> >> 	   padcolor[0], j2 * out->linesize[0]);
> >>      memset(out->data[1] + (j1 >>pad->vsub)*out->linesize[1],
> >> 	     padcolor[1], (j2 >>pad->hsub) * out->linesize[1]);
> >>      memset(out->data[2] + (j1 >>pad->vsub)*out->linesize[2],
> >> 	     padcolor[1], (j2 >>pad->hsub) * out->linesize[2]);
> >
> > duplicate (rectangle drawing)
> 
> Why duplicate? This is drawing the bottom bar, it's not done  
> elsewhere, but there is a typo as the last padcolor[1] should be  
> padcolor[2]. Again, where would you like this code to be merged?

Both cases draw a rectangle, so its duplicate.

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20080511/12cb0199/attachment.pgp>


More information about the FFmpeg-soc mailing list