[FFmpeg-devel] [PATCH] Re-implement ff_fill_linesize() using pixdescs info

Stefano Sabatini stefano.sabatini-lala
Sun Apr 11 16:11:34 CEST 2010


On date Wednesday 2010-04-07 16:46:04 +0200, Michael Niedermayer encoded:
> On Mon, Apr 05, 2010 at 12:34:56AM +0200, Stefano Sabatini wrote:
> > On date Friday 2010-03-05 01:53:31 +0100, Stefano Sabatini encoded:
> > > On date Friday 2010-03-05 01:42:01 +0100, Vitor Sessak encoded:
> > > > Stefano Sabatini wrote:
> > > > >Hi, as discussed here:
> > > > >http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/99224/focus=99279
> > > > >
> > > > >The idea is to make simpler/more general the code of ff_fill_linesize(),
> > > > >I have a similar patch for ff_fill_pointer().
> > > > >
> > > > >The test shows some difference between the old and the new
> > > > >implementation for odd sizes, the new implementation looks more
> > > > >correct in all cases.
> > > > >
> > > > >In attachment the test program and the patch meant for review.
> > > > 
> > > > [...]
> > > > 
> > > > >
> > > > >Mismatch for pixel format 'yuv422p16le' with size 1
> > > > >ff_fill_linesize : 2 2 2 0
> > > > >ff_fill_linesize2: 2 1 1 0
> > > > 
> > > > And I missing something or linesize for all 16-bit formats should be
> > > > always even?
> > > 
> > > Yes so the code needs to be readjusted...
> > 
> > Updated.
> > 
> > The differences with the old version looks always correct now, code is
> > about 1/4 of the original one (slightly slower), and it is general
> > enough so new format additions should not require changes to it.
> 
> looks ok

Applied with a minor fix on the bitstream size computation:
       picture->linesize[0] = (width * (desc->comp[0].step_minus1+1) + 7) >> 3;

while in the previous patch it was:
      picture->linesize[0] = ((width-1) * (desc->comp[0].step_minus1+1) + 8) >> 3;

The values reported with the step values currently used (1 and 4) were
always the same, but using a different value for step may result in a
wrong result.

Regards.
-- 
FFmpeg = Fierce & Fanciful Majestic Prodigious Enchanting Gymnast



More information about the ffmpeg-devel mailing list