On Fri, May 30, 2014 at 01:20:36PM -0400, Justin Ruggles wrote:
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -13,6 +13,9 @@ libavutil:     2013-12-xx
>  
>  API changes, most recent first:
>  
> +2014-05-xx - xxxxxxx - lavu 53.16.0 - imgutils.h
> +  Add av_image_check_sar().
> +
>  2014-04-xx - xxxxxxx - lavr 1.3.0 - avresample.h
>    Add avresample_max_output_samples

At least a oneline description would be nice here.  Yes, there are
obviously other offenders...

> --- a/libavcodec/internal.h
> +++ b/libavcodec/internal.h
> @@ -177,6 +177,12 @@ const uint8_t *avpriv_find_start_code(const uint8_t 
> *restrict p,
>  
>  /**
> + * Check that the provided sample aspect ratio is valid and set it on the 
> codec
> + * context.
> + */
> +int ff_set_sar(AVCodecContext *avctx, AVRational sar);

Parameter descriptions would be appreciated here and keep the Doxygen
warning levels under control.

> --- a/libavutil/imgutils.c
> +++ b/libavutil/imgutils.c
> @@ -228,6 +230,27 @@ int av_image_check_size(unsigned int w, unsigned int h, 
> int log_offset, void *lo
>  
> +int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar)
> +{
> +    int64_t scaled_dim;
> +
> +    if (!sar.den)
> +        return AVERROR(EINVAL);
> +
> +    if (!sar.num || sar.num == sar.den)
> +        return 0;
> +
> +    if (sar.num < sar.den) {
> +        scaled_dim = av_rescale_rnd(w, sar.num, sar.den, AV_ROUND_ZERO);
> +    } else {
> +        scaled_dim = av_rescale_rnd(h, sar.den, sar.num, AV_ROUND_ZERO);
> +    }
> +    if (scaled_dim > 0) {
> +        return 0;
> +    }

nit: extra parentheses

> --- a/libavutil/imgutils.h
> +++ b/libavutil/imgutils.h
> @@ -128,6 +129,20 @@ void av_image_copy(uint8_t *dst_data[4], int 
> dst_linesizes[4],
>  
> +/**
> + * Check if the given sample aspect ratio of an image is valid.
> + *
> + * It is considered invalid if the denominator is 0 or if applying the ratio
> + * to the image size would make the smaller dimension less than 1. If the
> + * sar numerator is 0, it is considered unknown and will return as valid.
> + *
> + * @param w width of the image
> + * @param h height of the image
> + * @param sar sample aspect ratio of the image

nit: vertical alignment

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to