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

2018-09-27 Thread Michael Niedermayer
On Wed, Sep 26, 2018 at 05:06:46PM +0200, Nicolas George wrote: > Michael Niedermayer (2018-09-24): > > CC-ing you so you dont miss this (though its not important) > > > > if i hear nothing from anyone i will apply the patchset as is. > > IIUC james is ok with that. > > But as said i can redo it

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

2018-09-26 Thread Nicolas George
Michael Niedermayer (2018-09-24): > CC-ing you so you dont miss this (though its not important) > > if i hear nothing from anyone i will apply the patchset as is. > IIUC james is ok with that. > But as said i can redo it with unsigned if people want. > Just dont want to spend time redoing a patch

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

2018-09-24 Thread Michael Niedermayer
On Mon, Aug 20, 2018 at 12:42:29AM +0200, Michael Niedermayer wrote: > On Sun, Aug 05, 2018 at 11:55:06PM +0200, Nicolas George wrote: > > Michael Niedermayer (2018-08-05): > > > thats done in the next patch > > > > Indeed, except for the part where the variable are turned to unsigned to > > let t

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

2018-08-19 Thread Michael Niedermayer
On Sun, Aug 05, 2018 at 11:55:06PM +0200, Nicolas George wrote: > Michael Niedermayer (2018-08-05): > > thats done in the next patch > > Indeed, except for the part where the variable are turned to unsigned to > let the compiler optimize the division. Sorry to have missed that. are you ok with le

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

2018-08-05 Thread James Almer
On 8/5/2018 6:58 PM, Michael Niedermayer wrote: > On Sun, Aug 05, 2018 at 06:19:01PM -0300, James Almer wrote: >> On 8/5/2018 5:29 PM, Michael Niedermayer wrote: >>> Divisions tend to be slower than shifts unless the compiler optimizes them >>> out. >>> And some of these are in inner loops. >> >>

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

2018-08-05 Thread Michael Niedermayer
On Sun, Aug 05, 2018 at 06:19:01PM -0300, James Almer wrote: > On 8/5/2018 5:29 PM, Michael Niedermayer wrote: > > Divisions tend to be slower than shifts unless the compiler optimizes them > > out. > > And some of these are in inner loops. > > This patch makes the code slightly less readable, IM

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

2018-08-05 Thread Nicolas George
Michael Niedermayer (2018-08-05): > thats done in the next patch Indeed, except for the part where the variable are turned to unsigned to let the compiler optimize the division. Sorry to have missed that. Regards, -- Nicolas George signature.asc Description: Digital signature __

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

2018-08-05 Thread Michael Niedermayer
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 t

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

2018-08-05 Thread Nicolas George
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

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

2018-08-05 Thread James Almer
On 8/5/2018 5:29 PM, Michael Niedermayer wrote: > Divisions tend to be slower than shifts unless the compiler optimizes them > out. > And some of these are in inner loops. This patch makes the code slightly less readable, IMO. What compiler doesn't optimize out an integer division by 2 into a rig

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

2018-08-05 Thread Michael Niedermayer
Divisions tend to be slower than shifts unless the compiler optimizes them out. And some of these are in inner loops. Signed-off-by: Michael Niedermayer --- libavcodec/gdv.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c i