[FFmpeg-devel] [PATCH 1/2] avfilter/proresenc: switch default prores encoder to prores_ks

Michael Niedermayer michael at niedermayer.cc
Mon Jun 26 23:53:54 EEST 2017


On Mon, Jun 26, 2017 at 04:09:57PM +0200, Paul B Mahol wrote:
> Rationale:
> prores_ks have more features and is faster for qscale > 0
> and gives better quality output.
> 
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavcodec/Makefile             |  2 +-
>  libavcodec/proresenc_anatoliy.c | 14 --------------
>  libavcodec/proresenc_kostya.c   | 17 +++++++++++++++++
>  3 files changed, 18 insertions(+), 15 deletions(-)
> 
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index f0cba88..16dce40 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -477,7 +477,7 @@ OBJS-$(CONFIG_PPM_DECODER)             += pnmdec.o pnm.o
>  OBJS-$(CONFIG_PPM_ENCODER)             += pnmenc.o
>  OBJS-$(CONFIG_PRORES_DECODER)          += proresdec2.o proresdsp.o proresdata.o
>  OBJS-$(CONFIG_PRORES_LGPL_DECODER)     += proresdec_lgpl.o proresdsp.o proresdata.o
> -OBJS-$(CONFIG_PRORES_ENCODER)          += proresenc_anatoliy.o
> +OBJS-$(CONFIG_PRORES_ENCODER)          += proresenc_kostya.o proresdata.o
>  OBJS-$(CONFIG_PRORES_AW_ENCODER)       += proresenc_anatoliy.o
>  OBJS-$(CONFIG_PRORES_KS_ENCODER)       += proresenc_kostya.o proresdata.o
>  OBJS-$(CONFIG_PSD_DECODER)             += psd.o
> diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
> index 0516066..7ff6ff7 100644
> --- a/libavcodec/proresenc_anatoliy.c
> +++ b/libavcodec/proresenc_anatoliy.c
> @@ -614,17 +614,3 @@ AVCodec ff_prores_aw_encoder = {
>      .capabilities   = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
>      .profiles       = profiles
>  };
> -
> -AVCodec ff_prores_encoder = {
> -    .name           = "prores",
> -    .long_name      = NULL_IF_CONFIG_SMALL("Apple ProRes"),
> -    .type           = AVMEDIA_TYPE_VIDEO,
> -    .id             = AV_CODEC_ID_PRORES,
> -    .priv_data_size = sizeof(ProresContext),
> -    .init           = prores_encode_init,
> -    .close          = prores_encode_close,
> -    .encode2        = prores_encode_frame,
> -    .pix_fmts       = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV422P10, AV_PIX_FMT_NONE},
> -    .capabilities   = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
> -    .profiles       = profiles
> -};
> diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
> index 09bb611..21c2673 100644
> --- a/libavcodec/proresenc_kostya.c
> +++ b/libavcodec/proresenc_kostya.c
> @@ -1357,3 +1357,20 @@ AVCodec ff_prores_ks_encoder = {
>                        },
>      .priv_class     = &proresenc_class,
>  };
> +
> +AVCodec ff_prores_encoder = {
> +    .name           = "prores",
> +    .long_name      = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"),
> +    .type           = AVMEDIA_TYPE_VIDEO,
> +    .id             = AV_CODEC_ID_PRORES,
> +    .priv_data_size = sizeof(ProresContext),
> +    .init           = encode_init,
> +    .close          = encode_close,
> +    .encode2        = encode_frame,
> +    .capabilities   = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
> +    .pix_fmts       = (const enum AVPixelFormat[]) {
> +                          AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
> +                          AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_NONE
> +                      },
> +    .priv_class     = &proresenc_class,

the same priv_class cannot be used twice. The code deadlocks if you
do.
i would of course prefer if priv_class was semantically a
class and could be reused, its neither the first and likely wont be
the last time someone hits this issue ...

try
./ffmpeg -help full
to see the issue

but make fate deadlocks as well

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170626/7e6b40b8/attachment.sig>


More information about the ffmpeg-devel mailing list