[FFmpeg-devel] [PATCH 2/9] avcodec/gdv: Replace divisions by shifts in rescale()

Michael Niedermayer michael at niedermayer.cc
Mon Aug 6 00:49:45 EEST 2018


On Sun, Aug 05, 2018 at 11:37:24PM +0200, Nicolas George wrote:
> James Almer (2018-08-05):
> > This patch makes the code slightly less readable, IMO. What compiler
> > doesn't optimize out an integer division by 2 into a right shift?
> 
> Any compiler that cannot figure out that x is positive in this
> convoluted loop. Signed divisions cannot be optimized as shifts. Make
> everything unsigned and it will be fine.
> 
> But I do not understand the logic in having i going from 0 to w-1 just
> to compute x from w-1 to 0.
> 
> 	unsigned w, x;


> 	for (x = w - 1; x < w; x--)

thats done in the next patch

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180805/58739e48/attachment.sig>


More information about the ffmpeg-devel mailing list