[FFmpeg-devel] [PATCH v2] utvideoenc: Enable support for multiple slices and use them

Michael Niedermayer michaelni at gmx.at
Fri Feb 14 21:59:50 CET 2014


On Fri, Feb 14, 2014 at 02:48:19PM +0200, Jan Ekström wrote:
> The official Ut Video decoder only threads with slices, thus until
> now any files encoded by the libavcodec encoder have only been
> decodable with a single thread. The default slice count is now
> set to subsampled_height / 120.
> 
> Also sets slices to 1 for the Ut Video encoder tests to keep them
> green.
[...]

> @@ -181,9 +201,20 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
>  
>      /*
>       * Set how many slices are going to be used.
> -     * Set one slice for now.
> +     * By default uses multiple slices depending on the subsampled height.
> +     * This enables multithreading in the official decoder.
>       */
> -    c->slices = 1;
> +    if (!avctx->slices) {
> +        c->slices = subsampled_height / 120;
> +

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

this can be simplified using av_clip()

patch applied & merged
patch that does above simplication is welcome

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140214/ad5e6071/attachment.asc>


More information about the ffmpeg-devel mailing list