[vlc-devel] [PATCH 03/11] Add transform helper functions.

Rémi Denis-Courmont remi at remlab.net
Thu Mar 6 21:30:03 CET 2014


Le jeudi 6 mars 2014, 01:12:24 Matthias Keiser a écrit :
> diff --git a/src/misc/es_format.c b/src/misc/es_format.c
> index 8936414..82961b5 100644
> --- a/src/misc/es_format.c
> +++ b/src/misc/es_format.c
> @@ -244,6 +244,179 @@ void video_format_ScaleCropAr( video_format_t *p_dst,
> const video_format_t *p_sr p_dst->i_sar_num, p_dst->i_sar_den, 65536);
>  }
> 
> +//Simplify transforms to have something more managable. Order: angle,
> hflip. +void transform_GetBasicOps( video_transform_t transform, int
> *angle, int *hflip ) { +
> +    *angle = 0;
> +    *hflip = 0;
> +
> +    switch ( transform ) {
> +
> +        case TRANSFORM_R90:
> +            *angle = 90;
> +            break;
> +        case TRANSFORM_R180:
> +            *angle = 180;
> +            break;
> +        case TRANSFORM_R270:
> +            *angle = 270;
> +            break;
> +        case TRANSFORM_HFLIP:
> +            *hflip = 1;
> +            break;
> +        case TRANSFORM_VFLIP:
> +            *angle = 180;
> +            *hflip = 1;
> +            break;
> +        case TRANSFORM_TRANSPOSE:
> +            *angle = 90;
> +            *hflip = 1;
> +            break;
> +        case TRANSFORM_ANTI_TRANSPOSE:
> +            *angle = 270;
> +            *hflip = 1;
> +            break;
> +    }
> +}

That's not a problem yet, but given vflip is faster and easier to implement in 
CPU than hflip, it might be better to use that for decomposition.

vflip is really just swapping scanlines (except for hardware surfaces).

Merged anyway.

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list