[vlc-devel] [VLC 3.x 2/2] codec: dav1d: do not use VLC_CLIP

Steve Lhomme robux4 at ycbcr.xyz
Tue Apr 6 14:07:01 UTC 2021


Why ? All you have to do is replace vlc_GetCPUCount() with i_core_count 
and it's much more readable.

On 2021-04-06 14:01, Marvin Scholz wrote:
> ---
>   modules/codec/dav1d.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c
> index 0498492a73..7994a4b516 100644
> --- a/modules/codec/dav1d.c
> +++ b/modules/codec/dav1d.c
> @@ -285,7 +285,10 @@ static int OpenDecoder(vlc_object_t *p_this)
>       dav1d_default_settings(&p_sys->s);
>       p_sys->s.n_tile_threads = var_InheritInteger(p_this, "dav1d-thread-tiles");
>       if (p_sys->s.n_tile_threads == 0)
> -        p_sys->s.n_tile_threads = VLC_CLIP(vlc_GetCPUCount(), 1, 4);
> +        p_sys->s.n_tile_threads =
> +            (i_core_count > 4) ? 4 :
> +            (i_core_count > 1) ? i_core_count :
> +            1;
>       p_sys->s.n_frame_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
>       if (p_sys->s.n_frame_threads == 0)
>           p_sys->s.n_frame_threads = (i_core_count < 16) ? i_core_count : 16;
> -- 
> 2.30.1
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list