[FFmpeg-devel] [PATCH v14 3/4] avcodec/libjxl: add Jpeg XL encoding via libjxl

Anton Khirnov anton at khirnov.net
Thu Apr 14 20:49:07 EEST 2022


Quoting Leo Izen (2022-04-12 07:53:32)
> +
> +    while (1) {
> +        jret = JxlEncoderProcessOutput(ctx->encoder, &next_out, &available);
> +        if (jret == JXL_ENC_ERROR) {
> +            av_log(avctx, AV_LOG_ERROR, "Unspecified libjxl error occurred\n");
> +            return AVERROR_EXTERNAL;
> +        }
> +        bytes_written = ctx->buffer_size - available;
> +        /* all data passed has been encoded */
> +        if (jret == JXL_ENC_SUCCESS)
> +            break;
> +        if (jret == JXL_ENC_NEED_MORE_OUTPUT) {

Is it possible for the encoder to return anything other than the three
codes you're handling? Won't you get into an infinite loop if it does?

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list