[vlc-devel] [PATCH] adding vlc_uint10 to modules/video_filter/filter_picture.h (needed for yup420 10b color extraction)

Rémi Denis-Courmont remi at remlab.net
Tue Apr 4 19:09:57 CEST 2017


Le tiistaina 4. huhtikuuta 2017, 13.01.01 EEST 
victorien.lecouviour.tuffet at gmail.com a écrit :
> From: Psilokos <victorien.lecouviour-tuffet at epitech.eu>
> 
> ---
>  modules/video_filter/filter_picture.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/modules/video_filter/filter_picture.h
> b/modules/video_filter/filter_picture.h index 30aec839a7..ac987242e2 100644
> --- a/modules/video_filter/filter_picture.h
> +++ b/modules/video_filter/filter_picture.h
> @@ -119,6 +119,15 @@ static inline uint8_t vlc_uint8( int v )
>      return v;
>  }
> 
> +static inline uint16_t vlc_uint10( int v )
> +{
> +    if( v > 1023 )
> +        return 1023;
> +    else if( v < 0 )
> +        return 0;
> +    return v;
> +}
> +
>  static inline void yuv_to_rgb( int *r, int *g, int *b,
>                                 uint8_t y1, uint8_t u1, uint8_t v1 )
>  {

This is very poor naming. And in any case, the pixel values should always be 
valid. Clamping them explicitly is slow and should be useless.

-- 
雷米‧德尼-库尔蒙
https://www.remlab.net/



More information about the vlc-devel mailing list