[FFmpeg-devel] [PATCH] lavc/vvc: Remove floating point logic

Nuo Mi nuomi2021 at gmail.com
Mon Nov 11 14:32:31 EET 2024


On Mon, Nov 11, 2024 at 4:24 AM Frank Plowman <post at frankplowman.com> wrote:

> This was the only floating point logic in the native VVC decoder.
>
👍, applied.

>
> Signed-off-by: Frank Plowman <post at frankplowman.com>
> ---
>  libavcodec/vvc/intra_utils.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/libavcodec/vvc/intra_utils.c b/libavcodec/vvc/intra_utils.c
> index 8c40eb1b16..7229222b95 100644
> --- a/libavcodec/vvc/intra_utils.c
> +++ b/libavcodec/vvc/intra_utils.c
> @@ -184,13 +184,13 @@ int ff_vvc_intra_pred_angle_derive(const int
> pred_mode)
>      return intra_pred_angle;
>  }
>
> -#define ROUND(f) (int)(f < 0 ? -(-f + 0.5) : (f + 0.5))
>  int ff_vvc_intra_inv_angle_derive(const int intra_pred_angle)
>  {
> -    float inv_angle;
> -    av_assert0(intra_pred_angle);
> -    inv_angle = 32 * 512.0 / intra_pred_angle;
> -    return ROUND(inv_angle);
> +    av_assert2(intra_pred_angle != 0);
> +    if (intra_pred_angle > 0)
> +        return ROUNDED_DIV(32*512, intra_pred_angle);
> +    else
> +        return -ROUNDED_DIV(32*512, -intra_pred_angle);
>  }
>
>  //8.4.5.2.7 Wide angle intra prediction mode mapping proces
> --
> 2.47.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-devel mailing list