[FFmpeg-devel] [PATCH v6] - Added Turing codec interface for ffmpeg

Paul B Mahol onemda at gmail.com
Fri Feb 10 17:50:23 EET 2017


On 2/10/17, Saverio Blasi <saverio.blasi at bbc.co.uk> wrote:
> - This patch contains the changes to interface the Turing codec
> (http://turingcodec.org/) with ffmpeg. The patch was modified to address the
> comments in the review as follows:
>   - Added a pkg-config file to list all dependencies required by libturing.
> This should address the issue pointed out by Hendrik Leppkes on Fri
> 18/11/2016
>   - As per suggestions of wm4, two functions (add_option and
> finalise_options) have been created. The former appends new options while
> the latter sets up the argv array of pointers to char* accordingly.
> add_option re-allocates the buffer for options using av_realloc
>   - Additionally, both these functions handle the errors in case the memory
> wasn't allocated correctly
>   - malloc|free|realloc have been substituted with their corresponding
> av_{malloc|free|realloc} version
>   - Check on bit-depth has been removed since the ffmpeg already casts the
> right pix_fmt and bit depth
>   - pix_fmts is now set in ff_libturing_encoder as in h264dec.c.
>   - Changed usage of av_free with av_freep and fixed calls to free arrays
>   - Added brackets to all if and for statements
>   - Avoid repetition of code to free arrays in case of failure to initialise
> the libturing encoder
>   - Some fixes to address the review from wm4 and Mark Thompson received on
> Wed 08/02/2017
> ---
>  LICENSE.md             |   1 +
>  configure              |   5 +
>  libavcodec/Makefile    |   1 +
>  libavcodec/allcodecs.c |   1 +
>  libavcodec/libturing.c | 320
> +++++++++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 328 insertions(+)
>  create mode 100644 libavcodec/libturing.c
>

[...]

> +static const AVOption options[] = {
> +    { "turing-params", "configure additional turing encoder parameters",
> offsetof(libturingEncodeContext, options), AV_OPT_TYPE_STRING,{ 0 }, 0, 0,
> AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
> +    { NULL }
> +};
> +
> +static const AVClass class = {
> +    .class_name = "libturing",
> +    .item_name = av_default_item_name,
> +    .option = options,
> +    .version = LIBAVUTIL_VERSION_INT,

Vertical indentation please.

> +};
> +
> +AVCodec ff_libturing_encoder = {
> +    .name = "libturing",
> +    .long_name = NULL_IF_CONFIG_SMALL("libturing HEVC"),
> +    .type = AVMEDIA_TYPE_VIDEO,
> +    .id = AV_CODEC_ID_HEVC,
> +    .init = libturing_encode_init,
> +    .encode2 = libturing_encode_frame,
> +    .close = libturing_encode_close,
> +    .priv_data_size = sizeof(libturingEncodeContext),
> +    .priv_class = &class,
> +    .capabilities = AV_CODEC_CAP_DELAY,
> +    .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV420P10,
> AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE},

Vertical indentation please.


More information about the ffmpeg-devel mailing list