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 6957242D31 for ; Wed, 4 May 2022 04:24:02 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1401368B2A5; Wed, 4 May 2022 07:24:00 +0300 (EEST) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7FC6A68B117 for ; Wed, 4 May 2022 07:23:54 +0300 (EEST) Received: by mail-ed1-f46.google.com with SMTP id be20so360796edb.12 for ; Tue, 03 May 2022 21:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandflow-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/MEbNaeaLxslLxy2B4JXAkmvuq+FxC0vh1nOzhSCh4E=; b=SpA2jPoyUpJbeP9FnRqVhjUA9uaBlhl7CDI0yNa0p64OtJjVBdpHj2dR7LoYvTfnKy l1JxvGOJXa0XJ9TK8JZNXUUmTtGHpA/FGZfbWM5o3HfS/ojsxB+Vq8pnk54Fz9UgJONJ ff0jGKMLUv61mZigtAZab54b4UGicu5gdi8KPTfVL17T7zG6vA7PsiiymO2tLVRyoXQJ AaA+CqDgiTDWkN3NuTl8duKrEDdPcd5lT/PGQoOmlFMPh1m+22wKA0H5+NI0pUR3KS0+ 0hG1vij1Id5iavAydcKPQHrtQc84d2gZv554qREE55lUr2pZzn5pDUtJAbbsHhe+jOM7 DVcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/MEbNaeaLxslLxy2B4JXAkmvuq+FxC0vh1nOzhSCh4E=; b=BOwit269XeV5qBkfYVpj/hnFvOUhSRJFaJcbnKFhBzGVKHXlxzWO/g/exBc/KlIkWU coAxZyzJZRbHgvH3Ehkqm96iKKaCvqcR0w+PSrZnyWMWJKMMulWF20iaBBg8hQ19AZin gp83dCZRjvXuODXCSj9oxJiKouj04xUS3fROvQhHrdUeOvd7QF+UGumt1b20TUV6oMHx 8RCcatOiPo1/+CpluT2wITujPPbKxzR/O+nXcElwcQWFs+KFGsPHykR6XuwqpaCKj0d6 uo2Dg3teC52eil/aF4/cOSFKx162nNimF1T1QZUW8NnQ92UB3V0Zgah7I8yKMBAIzi3J BLaQ== X-Gm-Message-State: AOAM533DtakEhfs4O00cioW5lio4eVgZRrYZNtpx+8GGudzRVpVLkniu r9TXUvzMrVpvC6oc0D46lMYbqPofGgeZX7cS X-Google-Smtp-Source: ABdhPJzmxSouHaSaG+kZjW13Gzfi7J4VM/lKLTiOwdFXGDVRXeqrFGDtJLZ9WyYaywEHNi2cRJdrSg== X-Received: by 2002:a05:6402:cb6:b0:425:f2e0:3644 with SMTP id cn22-20020a0564020cb600b00425f2e03644mr20964967edb.301.1651638233552; Tue, 03 May 2022 21:23:53 -0700 (PDT) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com. [209.85.208.48]) by smtp.gmail.com with ESMTPSA id h4-20020a1709070b0400b006f3ef214e5esm5089362ejl.196.2022.05.03.21.23.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 May 2022 21:23:52 -0700 (PDT) Received: by mail-ed1-f48.google.com with SMTP id b24so363699edu.10 for ; Tue, 03 May 2022 21:23:52 -0700 (PDT) X-Received: by 2002:a05:6402:5253:b0:427:ed62:bb8b with SMTP id t19-20020a056402525300b00427ed62bb8bmr5568283edd.65.1651638232008; Tue, 03 May 2022 21:23:52 -0700 (PDT) MIME-Version: 1.0 References: <20220419081701.8021-1-etemesicaleb@gmail.com> In-Reply-To: <20220419081701.8021-1-etemesicaleb@gmail.com> From: Pierre-Anthony Lemieux Date: Tue, 3 May 2022 21:23:39 -0700 X-Gmail-Original-Message-ID: Message-ID: To: caleb Subject: Re: [FFmpeg-devel] [PATCH] avcodec/jpeg2000:fast-fail if HTJ2K codeblocks are present 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 Cc: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Hi Caleb, There is a space missing in the commit message before "fast-fail". Few minor comments below. Looks good otherwise -- it works as expected on an MXF file that contains JPEG 2000 Part 15 code-blocks. Looking forward to the full implementation! Best, -- Pierre On Tue, Apr 19, 2022 at 1:17 AM caleb wrote: > > --- > This patch adds support for detecting Part 15 codeblocks to JPEG2000 specified in (Rec. ITU-T T.814 | ISO/IEC 15444-15). > > The decoder on detecting Part 15 codeblocks now fails gracefully with a AVERROR_PATCHWELCOME return code > > libavcodec/jpeg2000.h | 2 ++ > libavcodec/jpeg2000dec.c | 9 +++++++++ > 2 files changed, 11 insertions(+) > > diff --git a/libavcodec/jpeg2000.h b/libavcodec/jpeg2000.h > index d06313425e..e5ecb4cbf9 100644 > --- a/libavcodec/jpeg2000.h > +++ b/libavcodec/jpeg2000.h > @@ -110,6 +110,8 @@ enum Jpeg2000Quantsty { // quantization style > #define JPEG2000_CSTY_PREC 0x01 // Precincts defined in coding style > #define JPEG2000_CSTY_SOP 0x02 // SOP marker present > #define JPEG2000_CSTY_EPH 0x04 // EPH marker present > +#define JPEG2000_CTSY_HTJ2K_F 0x40 // Only HT code-blocks (Rec. ITU-T T.814 | ISO/IEC 15444-15) are present > +#define JPEG2000_CTSY_HTJ2K_M 0xC0 // HT code blocks (Rec. ITU-T T.814 | ISO/IEC 15444-15) can be present > > // Progression orders > #define JPEG2000_PGOD_LRCP 0x00 // Layer-resolution level-component-position progression > diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c > index 92966b11f5..ef4a653afe 100644 > --- a/libavcodec/jpeg2000dec.c > +++ b/libavcodec/jpeg2000dec.c > @@ -521,6 +521,15 @@ static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c) > > c->cblk_style = bytestream2_get_byteu(&s->g); > if (c->cblk_style != 0) { // cblk style > + if (c->cblk_style & JPEG2000_CTSY_HTJ2K_M || c->cblk_style & JPEG2000_CTSY_HTJ2K_F) { > + /* > + * HT code-blocks (Rec. ITU-T T.814 | ISO/IEC 15444-15) bit-stream > + * Not yet supported in ffmpeg, cannot continue. The comment above can be removed since the av_log and return code are sufficiently descriptive. > + */ > + av_log(s->avctx, AV_LOG_FATAL, "Support for High throughput JPEG 2000 is not yet available\n"); That should probably be AV_LOG_ERROR. > + return AVERROR_PATCHWELCOME; > + } > + > av_log(s->avctx, AV_LOG_WARNING, "extra cblk styles %X\n", c->cblk_style); > if (c->cblk_style & JPEG2000_CBLK_BYPASS) > av_log(s->avctx, AV_LOG_WARNING, "Selective arithmetic coding bypass\n"); > -- > 2.34.0 > > _______________________________________________ > 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". _______________________________________________ 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".