[MPlayer-dev-eng] [PATCH] changes in vf_get_image semantics

D Richard Felker III dalias at aerifal.cx
Tue Nov 23 17:50:10 CET 2004


On Tue, Nov 23, 2004 at 08:57:15AM +0100, Jindrich Makovicka wrote:
> Hi,
> 
> the attached patch modifies the *_get_image to make possible to specify 
> an explicit horizontal and vertical alignment. This issue has already 
> been discussed in the thread
> 
> http://mplayerhq.hu/pipermail/mplayer-dev-eng/2004-October/030502.html
> 
> The patch
> 
> 1) renames vf_get_image to vf_get_image_aligned and adds two additional 
> parameters, which specify alignment_bytecount-1 (only 2^n-1 are valid)
> 
> 2) creates vf_get_image as wrappers calling vf_get_image_aligned with 
> the proper alignment parameters - height_align=0, width_align=either 15 
> or 0 depending on MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE.
> 
> 3) changes all (they are only a few) occurences of vf_get_image and 
> mpcodecs_get_image with aligned dimensions to calls of 
> _get_image_aligned with original dimension and explicit specification of 
> the alignment.

could you please explain why this is necessary? i was under the
impression it was just a bug in the codec. stride alignment is already
done, anyway...

with that said, i'd like to recommend a different api. rather than
requesting alignment of allocated width/height, the caller should
request a (minimum) amount of 'border space' it wants writable on all
sides of the image, including top and left. this type of design works
even with more complex filter chains.

furthermore, ALL of this (image size, border, etc.) should be decided
at CONFIG TIME, not everytime get_image is called. get_image should
implicitly assume the same sizes config() was called with, otherwise
it's nonsense. of course this would be a major pain to fix up in g1...
let's discuss it more.

rich




More information about the MPlayer-dev-eng mailing list