[FFmpeg-devel] [PATCH 2/3] lavc: add a framework to fix alignment problems.

Michael Niedermayer michael at niedermayer.cc
Thu May 11 03:51:11 EEST 2017


On Wed, May 10, 2017 at 06:46:41PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Wed, May 10, 2017 at 5:02 PM, Michael Niedermayer <michael at niedermayer.cc
> > wrote:
> 
> > On Wed, May 10, 2017 at 10:28:22PM +0200, Nicolas George wrote:
> > > Le primidi 21 floréal, an CCXXV, Michael Niedermayer a écrit :
> > > > fixed, and now your patchset seems to cause a 1% slowdown of the
> > > > example above
> > >
> > > Thanks. The slowdown is to be expected, since this filter used
> > > non-aligned frames which are now realigned. I guess you can get back the
> > > previous speed by setting "avctx->alignment = 0" in snow_encoder.init().
> > >
> >
> > > The default in this patchset is 5 to fix all the alignment problems, at
> > > the cost of some slowdown in corner cases such as this one. I am not
> > > qualified to decide the best way of setting an optimal value to get
> > > speed without crashes. My opinion would be:
> > >
> > > - have avctx->alignment default to 0;
> > >
> > > - have all codecs with explicit assembly set avctx->alignment to the
> > >   required value;
> > >
> > > - have all codecs that use generic DSP code init it through a function
> > >   that sets the alignment accordingly.
> >
> > hmm
> > run fate with intentionally misaligned frames, and make a list of
> > all codecs that dont crash and work fine.
> 
> 
> That's generally arch-specific. Codecs using AVX2 need 32byte, SSE2/Neon
> only need 16, MMX need none (although 8 would probably be slightly faster).

yes

If a test is written to check codecs like described above. It should
be easy to run it on multiple archs to find out which codecs never
require alignment so as to find an initial default for each.


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170511/88a89737/attachment.sig>


More information about the ffmpeg-devel mailing list