[FFmpeg-devel] [PATCH] huffyuvdec: use unsafe bitstream reader

Michael Niedermayer michaelni at gmx.at
Sun Jun 15 16:20:05 CEST 2014


On Sun, Jun 15, 2014 at 04:13:39PM +0200, Michael Niedermayer wrote:
> On Sun, Jun 15, 2014 at 02:39:05PM +0200, Christophe Gisquet wrote:
> > Hi,
> > 
> > this patch provides improvement for both win32 and win64 of around 10%
> > 
> > Other lossless decoders like utvideo would probably benefit from this too.
> > 
> > -- 
> > Christophe
> 
> >  huffyuvdec.c |    2 ++
> >  1 file changed, 2 insertions(+)
> > 8a03e3ebe99adc890a81a0b2564ff0822d66b9f7  0004-huffyuvdec-use-unsafe-bitstream-reader.patch
> > From 1c68d9b045d0fbd39d971f0a9b7d6244daca8faa Mon Sep 17 00:00:00 2001
> > From: Christophe Gisquet <christophe.gisquet at gmail.com>
> > Date: Sun, 15 Jun 2014 12:04:36 +0200
> > Subject: [PATCH 4/4] huffyuvdec: use unsafe bitstream reader
> > 
> > The reader reads in chunks of 11 bits at most, and at most 3 times. The unsafe
> > reader therefore may read 6 chunks instead of 1 in worst case, ie 8 bytes,
> > which is within the padding tolerance.
> 
> I think decode_bgr_1() could read more and needs some additional
> check

decode_422_bitstream() also needs an additional check because it
seems to be able ro read 4 samples which might be upto 16 byte but
the bitreader itself can overread  3 bytes so it might be slightly
beyond the required padding of 16 bytes

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140615/2de38b3d/attachment.asc>


More information about the ffmpeg-devel mailing list