Re: [FFmpeg-devel] swscale/input : avoid float calc for GrayFloat to Gray16 conv
On Wed, Aug 22, 2018 at 09:02:57PM +0200, Martin Vignali wrote: > > > > well then it should be ok > > not sure if the ff_ prefix is ideal for a static inline function > > > > > Do you think flt_2_uint16 is a better name ? yes thx > (can probably be interesting to also add same kind of func for float to > uint8 in unscaled part) > > Martin > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Let us carefully observe those good qualities wherein our enemies excel us and endeavor to excel them, by avoiding what is faulty, and imitating what is excellent in them. -- Plutarch signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] swscale/input : avoid float calc for GrayFloat to Gray16 conv
> > well then it should be ok > not sure if the ff_ prefix is ideal for a static inline function > > Do you think flt_2_uint16 is a better name ? (can probably be interesting to also add same kind of func for float to uint8 in unscaled part) Martin ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] swscale/input : avoid float calc for GrayFloat to Gray16 conv
On Wed, Aug 22, 2018 at 12:45:50PM +0200, Martin Vignali wrote: > > > --- > > > libswscale/input.c| 10 +- > > > libswscale/swscale_internal.h | 20 > > > 2 files changed, 25 insertions(+), 5 deletions(-) > > > > please provide benchmark, what is the impact on speed from this ? > > > > > In my tests, the patch increase speed by around 20%. well then it should be ok not sure if the ff_ prefix is ideal for a static inline function thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Does the universe only have a finite lifespan? No, its going to go on forever, its just that you wont like living in it. -- Hiranya Peiri signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] swscale/input : avoid float calc for GrayFloat to Gray16 conv
> > --- > > libswscale/input.c| 10 +- > > libswscale/swscale_internal.h | 20 > > 2 files changed, 25 insertions(+), 5 deletions(-) > > please provide benchmark, what is the impact on speed from this ? > > In my tests, the patch increase speed by around 20%. Test with this sample (UHD Gray float PSD file) : https://we.tl/t-Ty9hR20gUw And this command line (test the bswap func : grayf32ToY16_bswap_c) ./ffmpeg -benchmark -loop 1 -t 30 -i TEST_PSD_GRAY_0.psd -pix_fmt gray16be -f null - Without the patch : (using float calc) frame= 750 fps= 23 q=-0.0 Lsize=N/A time=00:00:30.00 bitrate=N/A speed=0.909x bench: utime=26.577s stime=10.061s rtime=33.063s bench: maxrss=697888768kB With the patch : (not use float calc) frame= 750 fps= 27 q=-0.0 Lsize=N/A time=00:00:30.00 bitrate=N/A speed=1.07x bench: utime=21.512s stime=10.136s rtime=27.992s bench: maxrss=697942016kB Martin ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] swscale/input : avoid float calc for GrayFloat to Gray16 conv
On Mon, Aug 20, 2018 at 04:41:02PM +0200, Martin Vignali wrote: > Hello, > > Patch in attach modify GrayFloat to Gray16 conversion > using the same method currently use inside exr decoder (no float calc) > > duplicate the float_to_uint func inside swscale_internal > > Martin > input.c| 10 +- > swscale_internal.h | 20 > 2 files changed, 25 insertions(+), 5 deletions(-) > 075a95ff08c3976a0b804422c515e49bea3a529b > 0004-swscale-input-avoid-float-calc-for-grayFloat-to-uint.patch > From 742160d2f161b316ad923b0ea0c60d79193c3357 Mon Sep 17 00:00:00 2001 > From: Martin Vignali > Date: Mon, 20 Aug 2018 16:35:13 +0200 > Subject: [PATCH 4/4] swscale/input : avoid float calc for grayFloat to uint16 > conversion > > reuse the float to uint16 func currently use inside exr decoder > --- > libswscale/input.c| 10 +- > libswscale/swscale_internal.h | 20 > 2 files changed, 25 insertions(+), 5 deletions(-) please provide benchmark, what is the impact on speed from this ? thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB During times of universal deceit, telling the truth becomes a revolutionary act. -- George Orwell signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] swscale/input : avoid float calc for GrayFloat to Gray16 conv
Hello, Patch in attach modify GrayFloat to Gray16 conversion using the same method currently use inside exr decoder (no float calc) duplicate the float_to_uint func inside swscale_internal Martin 0004-swscale-input-avoid-float-calc-for-grayFloat-to-uint.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel