Re: [FFmpeg-devel] [PATCH v2] avcodec: Add librav1e encoder

2019-05-29 Thread Moritz Barsnick
Hi,

> +during configuration. You need to explicitly configue the build with
^ configure

> +Sets the maximum qauntizer (floor) to use when using bitrate mode.
^ quantizer

Cheers,
Moritz
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2] avcodec: Add librav1e encoder

2019-05-29 Thread Derek Buitenhuis
On 29/05/2019 17:12, James Almer wrote:
>> +end:
>> +if (cfg)
>> +rav1e_config_unref(cfg);
>> +
>> +if (ret)
>> +librav1e_encode_close(avctx);
> 
> Use the FF_CODEC_CAP_INIT_CLEANUP flag in AVCodec.caps_internal instead.
> It will call AVCodec.close() on AVCodec.init() failure.

OK.

>> +.pix_fmts   = (const enum AVPixelFormat[]) {
>> +AV_PIX_FMT_YUV420P,
>> +AV_PIX_FMT_YUV420P10,
>> +AV_PIX_FMT_YUV420P12,
>> +AV_PIX_FMT_YUV422P,
>> +AV_PIX_FMT_YUV422P10,
>> +AV_PIX_FMT_YUV422P12,
>> +AV_PIX_FMT_YUV444P,
>> +AV_PIX_FMT_YUV444P10,
>> +AV_PIX_FMT_YUV444P12,
>> +AV_PIX_FMT_GRAY8,
>> +AV_PIX_FMT_GRAY10,
>> +AV_PIX_FMT_GRAY12,
>> +AV_PIX_FMT_NONE
> 
> Nit: Split this off, like libx26* do.

OK.

- Derek
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2] avcodec: Add librav1e encoder

2019-05-29 Thread James Almer
On 5/29/2019 11:41 AM, Derek Buitenhuis wrote:
> Uses the crav1e C bindings for rav1e.
> 
> Port to the new send/receive API by: James Almer .
> 
> Signed-off-by: Derek Buitenhuis 
> ---
> The only thing I didn't address from the last set of replies was the
> second 'ret' variable, since I prefer it that way (having a separate
> ret for avcodec values and external values.
> ---
>  configure  |   4 +
>  doc/encoders.texi  |  29 +++
>  doc/general.texi   |   7 +
>  libavcodec/Makefile|   1 +
>  libavcodec/allcodecs.c |   1 +
>  libavcodec/librav1e.c  | 417 +
>  6 files changed, 459 insertions(+)
>  create mode 100644 libavcodec/librav1e.c

[...]

> +end:
> +if (cfg)
> +rav1e_config_unref(cfg);
> +
> +if (ret)
> +librav1e_encode_close(avctx);

Use the FF_CODEC_CAP_INIT_CLEANUP flag in AVCodec.caps_internal instead.
It will call AVCodec.close() on AVCodec.init() failure.

[...]

> +AVCodec ff_librav1e_encoder = {
> +.name   = "librav1e",
> +.long_name  = NULL_IF_CONFIG_SMALL("librav1e AV1"),
> +.type   = AVMEDIA_TYPE_VIDEO,
> +.id = AV_CODEC_ID_AV1,
> +.init   = librav1e_encode_init,
> +.send_frame = librav1e_send_frame,
> +.receive_packet = librav1e_receive_packet,
> +.close  = librav1e_encode_close,
> +.priv_data_size = sizeof(librav1eContext),
> +.priv_class = ,
> +.defaults   = librav1e_defaults,
> +.pix_fmts   = (const enum AVPixelFormat[]) {
> +AV_PIX_FMT_YUV420P,
> +AV_PIX_FMT_YUV420P10,
> +AV_PIX_FMT_YUV420P12,
> +AV_PIX_FMT_YUV422P,
> +AV_PIX_FMT_YUV422P10,
> +AV_PIX_FMT_YUV422P12,
> +AV_PIX_FMT_YUV444P,
> +AV_PIX_FMT_YUV444P10,
> +AV_PIX_FMT_YUV444P12,
> +AV_PIX_FMT_GRAY8,
> +AV_PIX_FMT_GRAY10,
> +AV_PIX_FMT_GRAY12,
> +AV_PIX_FMT_NONE

Nit: Split this off, like libx26* do.

> +},
> +.capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
> +.wrapper_name   = "librav1e",
> +};
> 

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2] avcodec: Add librav1e encoder

2019-05-29 Thread Derek Buitenhuis
On 29/05/2019 16:01, Lynne wrote:
> for (int i = 0; i < desc->nb_components; i++) {
> rav1e_frame_fill_plane() should probably return an error if the plane index 
> is invalid.

Yep. Fixed locally.

- Derek
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2] avcodec: Add librav1e encoder

2019-05-29 Thread Lynne



May 29, 2019, 3:41 PM by derek.buitenh...@gmail.com:

> +
> +static int librav1e_send_frame(AVCodecContext *avctx, const AVFrame *frame)
> +{
> +librav1eContext *ctx = avctx->priv_data;
> +int ret;
> +
> +if (!ctx->rframe && frame) {
> +const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
> +
> +ctx->rframe = rav1e_frame_new(ctx->ctx);
> +if (!ctx->rframe) {
> +av_log(avctx, AV_LOG_ERROR, "Could not allocate new rav1e 
> frame.\n");
> +return AVERROR(ENOMEM);
> +}
> +
> +for (int i = 0; i < 3; i++) {
>


for (int i = 0; i < desc->nb_components; i++) {
rav1e_frame_fill_plane() should probably return an error if the plane index is 
invalid.

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".