From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id D24C9410F6 for ; Fri, 15 Apr 2022 19:32:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 07ECB68B4EA; Fri, 15 Apr 2022 22:32:20 +0300 (EEST) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6599E68B4E4 for ; Fri, 15 Apr 2022 22:32:13 +0300 (EEST) Received: by mail-qk1-f176.google.com with SMTP id 204so1223369qkg.5 for ; Fri, 15 Apr 2022 12:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=8wB5AFINP8yb4Vp71qZR75TauwsCdh51WP2GviKlBf4=; b=HREdB2QJTzZceq8NoDRlWVHimH+he3HnXsWciBCGxJrITpp21qThJSQsp/k+FJBwOa pkekTjuvH6EnN/thByOn79I6VmT7v511+LbtNDJI2Mm0sayjRGviQx0xoLs2mBT2KVd1 wFX/N7tew5jZLtm8AEMR1tC+gSC9bBm1pxqIRaRTh/2DM6DloUbBf0ZObPzj7YlZJo1m 9aKz3xXXBY0yfzJvUNrDGP0SjpvS7rPxxc2rd++R970hHkjabIlMpGW/JsNFmgOKFBtt psSEtfFJ3t7gakG9ABSvy76f9jJr9fuHeXCqDAhuQqVdcQNd2uYTUonNJ7Lrir8DoWVR V+yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=8wB5AFINP8yb4Vp71qZR75TauwsCdh51WP2GviKlBf4=; b=YT9D8MhaoT6sNG4/MUPEvhdBszKN8wO1jWzXBF6kqABSY7OiNm6j7ZCPvVntjF4G3+ Ph7NhY0S/j44uJa7vgKM03sEnT6RcZJiT04sxyYej+eVcPItm6X9Hc7LAgqlMqjgwHOS ork3qepWeDQL2b0jfD1vk6ppsQXZ4daq+kRftx+8k9LGRvQvHl7GbbCg+FCSYuzmmaRQ Mp5epbED7lOfJ3RGmIrKfXMLT04ihCaMPicBqaxXf0w1+edRC43SCHj767wRqJixiJM0 HHLtayE14nA+ATG3hzMaVg1QpJHKckDEfzLHeFwz75Aoy/m6xjJHTAHYjvy+v53ukNeV DFAw== X-Gm-Message-State: AOAM531Xhz+KKYjtRBb8l/5rVXoaSBagcH+iBmlYc5y7umo+h/HyaOut BUpQjbTeJZTHaKEIIM98x2qC9DmyXzY= X-Google-Smtp-Source: ABdhPJw4ctp7CfSDHreTPlkbALAuNY1VPd1ZUIAaxL+1QboqipltsVPtBF2H8r0hVEKqHnJIE73YOQ== X-Received: by 2002:a05:620a:94e:b0:69b:f275:ed1 with SMTP id w14-20020a05620a094e00b0069bf2750ed1mr295122qkw.527.1650051132061; Fri, 15 Apr 2022 12:32:12 -0700 (PDT) Received: from [192.168.1.35] (c-68-41-54-207.hsd1.mi.comcast.net. [68.41.54.207]) by smtp.gmail.com with ESMTPSA id v3-20020a05622a188300b002ec90a0ecc7sm3094173qtc.59.2022.04.15.12.32.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Apr 2022 12:32:11 -0700 (PDT) Message-ID: <87b253fd-3843-e58f-2c04-d9346fca0fc5@gmail.com> Date: Fri, 15 Apr 2022 15:32:10 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-US-large To: ffmpeg-devel@ffmpeg.org References: <20220412055333.62424-1-leo.izen@gmail.com> <20220412055333.62424-4-leo.izen@gmail.com> <164995854773.17571.4529122301029877169@lain.red.khirnov.net> <9b4c385d-6d26-ef40-de65-0896e4f3b38a@gmail.com> <165001915499.24258.15911732369228283522@lain.red.khirnov.net> From: Leo Izen In-Reply-To: <165001915499.24258.15911732369228283522@lain.red.khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH v14 3/4] avcodec/libjxl: add Jpeg XL encoding via libjxl X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 4/15/22 06:39, Anton Khirnov wrote: > Quoting Leo Izen (2022-04-15 03:37:20) >> On 4/14/22 13:49, Anton Khirnov wrote: >>> 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? >>> >> It's just these three, according to the documentation. >> https://libjxl.readthedocs.io/en/latest/api_encoder.html > So the end of the loop should be unreachable, as you always break, > continue or return before. I would put return AVERROR_EXTERNAL there > just in case. > > Beyond that I have no more comments on the set. > I suppose a failsafe in case of a bug or futureproofing wouldn't be a bad call. I can add one. - Leo Izen (thebombzen) _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".