On 2/13/2014 6:59 PM, Jan Ekström wrote:
> The official Ut Video encoder only threads with slices, thus until
> now any files encoded by the libavcodec encoder have only been
> decode'able with a single thread. The default slice count is now
  ~~~~~~~~~~~
            ^-- decodable


> set to subsampled_height / 120.
> 
> Also sets slices to 1 for the Ut Video encoder tests to keep them
> green.

Add some slice tests too?~

> ---
>  libavcodec/utvideoenc.c | 31 ++++++++++++++++++++++++++++---
>  tests/fate/utvideo.mak  |  2 +-
>  2 files changed, 29 insertions(+), 4 deletions(-)

[...]

> +    /* Check the asked slice count for obviously invalid values (> 256 or 
> negative) */

/*
 * Check the asked slice count for obviously invalid
 * values (> 256 or negative).
 */

> +    if (avctx->slices > 256 || avctx->slices < 0) {
> +        av_log(avctx, AV_LOG_ERROR,
> +               "Slice count %d is not supported in Ut Video (theoretical 
> range is 0-256).\n",
> +               avctx->slices);
> +        return AVERROR_INVALIDDATA;
> +    }

Why not make it a warning and use:

av_clip_uint8(avctx->slices)

> +    if (!avctx->slices) {
> +        c->slices = subsampled_height / 120;
> +        if (!c->slices)
> +            c->slices = 1;
> +        else if (c->slices > 256)
> +            c->slices = 256;
> +    } else
> +        c->slices = avctx->slices;

Diego-nit: Braces for consistency

Rest LGTM.

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

Reply via email to