[FFmpeg-devel] [PATCH] avcodec/pixlet: remove unnecessary double to float conversion

Nicolas George george at nsup.org
Fri Dec 23 10:19:30 EET 2016


Le duodi 2 nivôse, an CCXXV, James Almer a écrit :
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavcodec/pixlet.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c
> index c5d37bb..c1bd321 100644
> --- a/libavcodec/pixlet.c
> +++ b/libavcodec/pixlet.c
> @@ -457,7 +457,7 @@ static void postprocess_luma(AVFrame *frame, int w, int h, int depth)
>      uint16_t *dsty = (uint16_t *)frame->data[0];
>      int16_t *srcy  = (int16_t *)frame->data[0];
>      ptrdiff_t stridey = frame->linesize[0] / 2;
> -    const float factor = 1. / ((1 << depth) - 1);
> +    const float factor = 1.0f / ((1 << depth) - 1);

Any reason, here and everywhere, to do it that way and not the other way
around, i.e. change all floats to doubles? There are only a 32-cells
array and a few local variables, so memory is not a concern.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161223/f5d072f0/attachment.sig>


More information about the ffmpeg-devel mailing list