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

vmrsss vmrsss at gmail.com
Sun May 11 13:47:20 CEST 2008


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  
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?

>>
>>    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?

Thanks.




More information about the FFmpeg-soc mailing list