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 B8DC344449 for ; Fri, 9 Sep 2022 21:34:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5EB7468BAD6; Sat, 10 Sep 2022 00:34:45 +0300 (EEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-oln040092074053.outbound.protection.outlook.com [40.92.74.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A070A68BA9F for ; Sat, 10 Sep 2022 00:34:39 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kgyU2VTlDdWydfs8HJbqZFGE0KoCrz6MkzAUPKMPzmzY/tAdWoDw4MF8eAcHk1v4Sz7YC6HuJEIvIXr6JyZxnhz40D5LN27L1SmR1AQF4xLFQANRh0QCoBJv+g1BG6AHTOzfUqOv9JW2a8F2LLo/thpGnr9YUHp/6fdTNiNsdIUUq63PuMt4m185o/xZMKY7AfYeRBmKAlT07DHNPa9BaZg1F6LOH+jUbX6q6HSNopdFLoSe9c3EjTONwVRRI8gjzfNLVRNhK0YIJP/o1m4udFUSRHa7Z2HJiWuLioI8ahME+NcQlAy5GAAnC31gR97T0HOr0ifljk7jcxIuDYbB6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GW2N/1rdFBW8WieBJaZO8FAWsObus/vGbfLfFC/fFMw=; b=gnwHRK9wkDmVtzsJzPYl9OhgUgZxeeseOU3qfOVDEyona9/rLNAY1vxhaXKooCqNuAtqlUD+YUAJrLXZ7C+dj3Q/JqEKeUk3AOxT173CZzmvFMUsHQdp9jdfGMge9allJYhIHlmpm61EDurG/9WwMHUhSwBzC5iMUUSj32KLNlRRJ7HVgwxGHfCMoIJZvOdODzgU+gD7CUGkgHsuiKiLxrq94DfymWyDPo2l0AskI2MzBgKCOt8t1xHzK8eumTypImU+W5FP+vxL3T3iEm4V01ilbOvg1/HODpuWEVDSeCpVxm/hyxxj+KcufqDNLvU5bLWrCRrDzr87Dfi/b4Q9TQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GW2N/1rdFBW8WieBJaZO8FAWsObus/vGbfLfFC/fFMw=; b=Y6+t6MLqtWHZxe9xeJcJMnwrqdTIJUa1eCLqj16mb3MMHWTkP1aFUBQMohhVpdU60A7TDoMuZCmzTnNGruw5GybhnTLv5R2qemXMskZTF53YLO12x9ggv7tRUenlRpZZDB2/DP4KKqKldYmalzWImiJtQ3eXOZepiSWCAFi42hSm9vlpJArEVlm8mv/YxvQhL24H6C4x2YXER1a9pF+VLwUJgqY97w6l/CVbNGluWg76tFPi6+CiZnLK20Tg7gCnYWCTYAQ9e3VJokzCVU87c8lfyWb8vpMoLMOG9vOH/cHa+6zrxZvrPVi0Qd9uk8T1si6+RVtwfSiLicESBjBzsg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV1P250MB0857.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:97::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Fri, 9 Sep 2022 21:34:36 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::611e:1608:45cb:b58a]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::611e:1608:45cb:b58a%4]) with mapi id 15.20.5612.019; Fri, 9 Sep 2022 21:34:36 +0000 Message-ID: Date: Fri, 9 Sep 2022 23:34:38 +0200 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220908204953.46737-1-etemesicaleb@gmail.com> <20220909154618.GF2088045@pb2> From: Andreas Rheinhardt In-Reply-To: X-TMN: [sWB5nGmdv2mYn8YIxZB9pZyDVLAoUfb+CnoMlxvbtzo=] X-ClientProxiedBy: FR0P281CA0083.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1e::18) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <93aad63f-ca64-abad-5cd6-c56fffd93f2b@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV1P250MB0857:EE_ X-MS-Office365-Filtering-Correlation-Id: df74eabf-ff97-4ed0-14ed-08da92ab176b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /iPdoiFUtAsIAJMt+tElNV19QzdsNRnSH7Yg1vQBqj42U1vWVa/LGp/68kITgLthTFVCW2v9nE01yVJJhQv6yYwLP1qIEd8ox7ifbre6WE/YEs9UAfl8TRU430gJtyO/3eeRXAwzpjRtn6irDCtjhT0D3jBTI2hKlAgV+/NoeQpHIuNXan2UvFYi0L/aZRXxGIl8Iwq857ilLMhPB9sjHtUezxJ2S3/UBfYcjN/ceHfB7La7A4nAEUqr4eQ/G6pQQaCavCoH6dAihkkZ4df6ZJ/D3GsDB35d9iTClVb6gjgYv8RMOUPlrwWkjNr0d+fGb0WHcZ4uV3bPHV/FyM1zvs6f2m9eth+EtWUH6FnanjrOL+sOhZGZmOOJHg79JchQ3RSUREHFo7ojq4CLQ3PN+WNglRRNCXgieeoGpigwq2fVR2Fw3bI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utf-8?B?UW85cG9IK1lhM0p0UmJYbEtuWXV0eXJFUXg3QXlnd2dzUkZKdGd1bUIyQ2xH?= =?utf-8?B?YnJLOGRyTVMzNGdVN0RsdHNRb0tFenlBM2JocjA0blNJb29vbHhyRXduaFVL?= =?utf-8?B?WU9EOThaWlJuK3BkV2xKMzJMS1BpQTFBSjdkTFVNWlRpdU9YVEFOSmtSSlhu?= =?utf-8?B?MThjVkRoTTVadFlRVHRERUhVcG9YZThHMFR3R0VWdWZmV0U2bVR6QWdBRHNm?= =?utf-8?Q?on44E1uiAcZhOd+7/szamn7SrmjM2wLXMETG+B1?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: df74eabf-ff97-4ed0-14ed-08da92ab176b X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2022 21:34:35.9428 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1P250MB0857 Subject: Re: [FFmpeg-devel] [PATCH v2] avcodec/jpeg2000: Add support for High-Throughput JPEG 2000 (HTJ2K) decoding. 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-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: Caleb Etemesi: >> This is unneeded for the encoder >> maybe a jpeg2000dec.h would be better for this >> also code moving should be in a seperate patch >> from functional changes > > > This will be a circular dependence, since jpeg2000htdec.h needs the decoder > context, and jpeg2000.c needs jpeg2000htdec.c. > It seems like the only use of the decoder context in jpeg2000htdec.h is in jpeg2000_decode_ctx_vlc() where the Jpeg2000DecoderContext is not even used at all. And I fail to see the circular dependency even if jpeg2000htdec.h needed the decoder context: after all, you are not adding an inclusion of jpeg2000htdec.h to jpeg2000.h, so jpeg2000dec.h will also not include jpeg2000htdec.h. > > On Fri, 9 Sept 2022, 19:52 Caleb Etemesi, wrote: > >> Will address in the next iteration >> >> On Fri, 9 Sept 2022, 18:46 Michael Niedermayer, >> wrote: >> >>> On Thu, Sep 08, 2022 at 11:49:53PM +0300, etemesicaleb@gmail.com wrote: >>>> From: caleb >>>> >>>> Rebased this patch on master branch >>>> --- >>>> libavcodec/Makefile | 2 +- >>>> libavcodec/j2kenc.c | 26 +- >>>> libavcodec/jpeg2000.h | 103 ++- >>>> libavcodec/jpeg2000dec.c | 193 ++---- >>>> libavcodec/jpeg2000htdec.c | 1212 ++++++++++++++++++++++++++++++++++++ >>>> libavcodec/jpeg2000htdec.h | 210 +++++++ >>>> 6 files changed, 1599 insertions(+), 147 deletions(-) >>>> create mode 100644 libavcodec/jpeg2000htdec.c >>>> create mode 100644 libavcodec/jpeg2000htdec.h >>>> >>>> diff --git a/libavcodec/Makefile b/libavcodec/Makefile >>>> index 945908e3b8..ecf5c47cad 100644 >>>> --- a/libavcodec/Makefile >>>> +++ b/libavcodec/Makefile >>>> @@ -450,7 +450,7 @@ OBJS-$(CONFIG_JACOSUB_DECODER) += >>> jacosubdec.o ass.o >>>> OBJS-$(CONFIG_JPEG2000_ENCODER) += j2kenc.o mqcenc.o mqc.o >>> jpeg2000.o \ >>>> jpeg2000dwt.o >>>> OBJS-$(CONFIG_JPEG2000_DECODER) += jpeg2000dec.o jpeg2000.o >>> jpeg2000dsp.o \ >>>> - jpeg2000dwt.o mqcdec.o mqc.o >>>> + jpeg2000dwt.o mqcdec.o mqc.o >>> jpeg2000htdec.o >>>> OBJS-$(CONFIG_JPEGLS_DECODER) += jpeglsdec.o jpegls.o >>>> OBJS-$(CONFIG_JPEGLS_ENCODER) += jpeglsenc.o jpegls.o >>>> OBJS-$(CONFIG_JV_DECODER) += jvdec.o >>>> diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c >>>> index e883d5deb7..233d75e96d 100644 >>>> --- a/libavcodec/j2kenc.c >>>> +++ b/libavcodec/j2kenc.c >>>> @@ -106,7 +106,7 @@ static const int dwt_norms[2][4][10] = { // >>> [dwt_type][band][rlevel] (multiplied >>>> typedef struct { >>>> Jpeg2000Component *comp; >>>> double *layer_rates; >>>> -} Jpeg2000Tile; >>>> +} Jpeg2000EncTile; >>>> >>>> typedef struct { >>>> AVClass *class; >>>> @@ -131,7 +131,7 @@ typedef struct { >>>> Jpeg2000CodingStyle codsty; >>>> Jpeg2000QuantStyle qntsty; >>>> >>>> - Jpeg2000Tile *tile; >>>> + Jpeg2000EncTile *tile; >>>> int layer_rates[100]; >>>> uint8_t compression_rate_enc; ///< Is compression done using >>> compression ratio? >>>> >>>> @@ -427,7 +427,7 @@ static void compute_rates(Jpeg2000EncoderContext* s) >>>> int layno, compno; >>>> for (i = 0; i < s->numYtiles; i++) { >>>> for (j = 0; j < s->numXtiles; j++) { >>>> - Jpeg2000Tile *tile = &s->tile[s->numXtiles * i + j]; >>>> + Jpeg2000EncTile *tile = &s->tile[s->numXtiles * i + j]; >>>> for (compno = 0; compno < s->ncomponents; compno++) { >>>> int tilew = tile->comp[compno].coord[0][1] - >>> tile->comp[compno].coord[0][0]; >>>> int tileh = tile->comp[compno].coord[1][1] - >>> tile->comp[compno].coord[1][0]; >>>> @@ -460,12 +460,12 @@ static int init_tiles(Jpeg2000EncoderContext *s) >>>> s->numXtiles = ff_jpeg2000_ceildiv(s->width, s->tile_width); >>>> s->numYtiles = ff_jpeg2000_ceildiv(s->height, s->tile_height); >>>> >>>> - s->tile = av_calloc(s->numXtiles, s->numYtiles * >>> sizeof(Jpeg2000Tile)); >>>> + s->tile = av_calloc(s->numXtiles, s->numYtiles * >>> sizeof(Jpeg2000EncTile)); >>>> if (!s->tile) >>>> return AVERROR(ENOMEM); >>>> for (tileno = 0, tiley = 0; tiley < s->numYtiles; tiley++) >>>> for (tilex = 0; tilex < s->numXtiles; tilex++, tileno++){ >>>> - Jpeg2000Tile *tile = s->tile + tileno; >>>> + Jpeg2000EncTile *tile = s->tile + tileno; >>>> >>>> tile->comp = av_calloc(s->ncomponents, >>> sizeof(*tile->comp)); >>>> if (!tile->comp) >>>> @@ -509,7 +509,7 @@ static int init_tiles(Jpeg2000EncoderContext *s) >>>> int tileno, compno, i, y, x; >>> \ >>>> const PIXEL *line; >>> \ >>>> for (tileno = 0; tileno < s->numXtiles * s->numYtiles; >>> tileno++){ \ >>>> - Jpeg2000Tile *tile = s->tile + tileno; >>> \ >>>> + Jpeg2000EncTile *tile = s->tile + tileno; >>> \ >>>> if (s->planar){ >>> \ >>>> for (compno = 0; compno < s->ncomponents; compno++){ >>> \ >>>> Jpeg2000Component *comp = tile->comp + compno; >>> \ >>>> @@ -701,7 +701,7 @@ static void encode_clnpass(Jpeg2000T1Context *t1, >>> int width, int height, int ban >>>> } >>>> } >>>> >>>> -static void encode_cblk(Jpeg2000EncoderContext *s, Jpeg2000T1Context >>> *t1, Jpeg2000Cblk *cblk, Jpeg2000Tile *tile, >>>> +static void encode_cblk(Jpeg2000EncoderContext *s, Jpeg2000T1Context >>> *t1, Jpeg2000Cblk *cblk, Jpeg2000EncTile *tile, >>>> int width, int height, int bandpos, int lev) >>>> { >>>> int pass_t = 2, passno, x, y, max=0, nmsedec, bpno; >>>> @@ -935,7 +935,7 @@ static int encode_packet(Jpeg2000EncoderContext *s, >>> Jpeg2000ResLevel *rlevel, in >>>> return 0; >>>> } >>>> >>>> -static int encode_packets(Jpeg2000EncoderContext *s, Jpeg2000Tile >>> *tile, int tileno, int nlayers) >>>> +static int encode_packets(Jpeg2000EncoderContext *s, Jpeg2000EncTile >>> *tile, int tileno, int nlayers) >>>> { >>>> int compno, reslevelno, layno, ret; >>>> Jpeg2000CodingStyle *codsty = &s->codsty; >>>> @@ -1181,7 +1181,7 @@ static int encode_packets(Jpeg2000EncoderContext >>> *s, Jpeg2000Tile *tile, int til >>>> return 0; >>>> } >>>> >>>> -static void makelayer(Jpeg2000EncoderContext *s, int layno, double >>> thresh, Jpeg2000Tile* tile, int final) >>>> +static void makelayer(Jpeg2000EncoderContext *s, int layno, double >>> thresh, Jpeg2000EncTile* tile, int final) >>>> { >>>> int compno, resno, bandno, precno, cblkno; >>>> int passno; >>>> @@ -1264,7 +1264,7 @@ static void makelayer(Jpeg2000EncoderContext *s, >>> int layno, double thresh, Jpeg2 >>>> } >>>> } >>>> >>>> -static void makelayers(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile) >>>> +static void makelayers(Jpeg2000EncoderContext *s, Jpeg2000EncTile >>> *tile) >>>> { >>>> int precno, compno, reslevelno, bandno, cblkno, lev, passno, layno; >>>> int i; >>>> @@ -1365,7 +1365,7 @@ static int getcut(Jpeg2000Cblk *cblk, int64_t >>> lambda, int dwt_norm) >>>> return res; >>>> } >>>> >>>> -static void truncpasses(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile) >>>> +static void truncpasses(Jpeg2000EncoderContext *s, Jpeg2000EncTile >>> *tile) >>>> { >>>> int precno, compno, reslevelno, bandno, cblkno, lev; >>>> Jpeg2000CodingStyle *codsty = &s->codsty; >>>> @@ -1399,7 +1399,7 @@ static void truncpasses(Jpeg2000EncoderContext >>> *s, Jpeg2000Tile *tile) >>>> } >>>> } >>>> >>>> -static int encode_tile(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, >>> int tileno) >>>> +static int encode_tile(Jpeg2000EncoderContext *s, Jpeg2000EncTile >>> *tile, int tileno) >>>> { >>>> int compno, reslevelno, bandno, ret; >>>> Jpeg2000T1Context t1; >>>> @@ -1514,7 +1514,7 @@ static void reinit(Jpeg2000EncoderContext *s) >>>> { >>>> int tileno, compno; >>>> for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++){ >>>> - Jpeg2000Tile *tile = s->tile + tileno; >>>> + Jpeg2000EncTile *tile = s->tile + tileno; >>>> for (compno = 0; compno < s->ncomponents; compno++) >>>> ff_jpeg2000_reinit(tile->comp + compno, &s->codsty); >>>> } >>> >>> Renaming Jpeg2000Tile could be in a seperate patch >>> >>> >>>> diff --git a/libavcodec/jpeg2000.h b/libavcodec/jpeg2000.h >>>> index e5ecb4cbf9..a5dd693392 100644 >>>> --- a/libavcodec/jpeg2000.h >>>> +++ b/libavcodec/jpeg2000.h >>>> @@ -33,8 +33,9 @@ >>>> >>>> #include "avcodec.h" >>>> #include "mqc.h" >>>> +#include "bytestream.h" >>>> #include "jpeg2000dwt.h" >>>> - >>>> +#include "jpeg2000dsp.h" >>>> enum Jpeg2000Markers { >>>> JPEG2000_SOC = 0xff4f, // start of codestream >>>> JPEG2000_SIZ = 0xff51, // image and tile size >>> >>>> @@ -171,7 +172,6 @@ typedef struct Jpeg2000Layer { >>>> double disto; >>>> int cum_passes; >>>> } Jpeg2000Layer; >>>> - >>>> typedef struct Jpeg2000Cblk { >>>> uint8_t npasses; >>>> uint8_t ninclpasses; // number coding of passes included in >>> codestream >>> >>> unintended, i assume >>> >>> >>>> @@ -181,6 +181,7 @@ typedef struct Jpeg2000Cblk { >>>> uint16_t *lengthinc; >>>> uint8_t nb_lengthinc; >>>> uint8_t lblock; >>>> + uint8_t zbp; // Zero bit planes >>>> uint8_t *data; >>>> size_t data_allocated; >>>> int nb_terminations; >>>> @@ -189,6 +190,7 @@ typedef struct Jpeg2000Cblk { >>>> Jpeg2000Pass *passes; >>>> Jpeg2000Layer *layers; >>>> int coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}} >>>> + int pass_lengths[2]; >>>> } Jpeg2000Cblk; // code block >>> >>> Please use doxygen compatible comments so it all appears on for example >>> https://ffmpeg.org/doxygen/trunk/structJpeg2000Cblk.html >>> >>>> >>>> typedef struct Jpeg2000Prec { >>>> @@ -227,6 +229,103 @@ typedef struct Jpeg2000Component { >>>> uint8_t roi_shift; // ROI scaling value for the component >>>> } Jpeg2000Component; >>>> >>>> +#define JP2_SIG_TYPE 0x6A502020 >>>> +#define JP2_SIG_VALUE 0x0D0A870A >>>> +#define JP2_CODESTREAM 0x6A703263 >>>> +#define JP2_HEADER 0x6A703268 >>>> + >>>> +#define HAD_COC 0x01 >>>> +#define HAD_QCC 0x02 >>>> + >>>> +#define MAX_POCS 32 >>>> + >>>> +typedef struct Jpeg2000POCEntry { >>>> + uint16_t LYEpoc; >>>> + uint16_t CSpoc; >>>> + uint16_t CEpoc; >>>> + uint8_t RSpoc; >>>> + uint8_t REpoc; >>>> + uint8_t Ppoc; >>>> +} Jpeg2000POCEntry; >>>> + >>>> +typedef struct Jpeg2000POC { >>>> + Jpeg2000POCEntry poc[MAX_POCS]; >>>> + int nb_poc; >>>> + int is_default; >>>> +} Jpeg2000POC; >>>> + >>>> +typedef struct Jpeg2000TilePart { >>>> + uint8_t tile_index; // Tile index who refers the >>> tile-part >>>> + const uint8_t *tp_end; >>>> + GetByteContext header_tpg; // bit stream of header if PPM >>> header is used >>>> + GetByteContext tpg; // bit stream in tile-part >>>> +} Jpeg2000TilePart; >>>> + >>>> +/* RMK: For JPEG2000 DCINEMA 3 tile-parts in a tile >>>> + * one per component, so tile_part elements have a size of 3 */ >>>> +typedef struct Jpeg2000Tile { >>> ^^^^^^^^^^^^ >>>> + Jpeg2000Component *comp; >>>> + uint8_t properties[4]; >>>> + Jpeg2000CodingStyle codsty[4]; >>>> + Jpeg2000QuantStyle qntsty[4]; >>>> + Jpeg2000POC poc; >>>> + Jpeg2000TilePart tile_part[32]; >>>> + uint8_t has_ppt; // whether this tile >>> has a ppt marker >>>> + uint8_t *packed_headers; // contains packed >>> headers. Used only along with PPT marker >>>> + int packed_headers_size; // size in bytes of >>> the packed headers >>>> + GetByteContext packed_headers_stream; // byte context >>> corresponding to packed headers >>>> + uint16_t tp_idx; // Tile-part index >>>> + int coord[2][2]; // border coordinates >>> {{x0, x1}, {y0, y1}} >>>> +} Jpeg2000DecTile; >>> ^^^^^^^^^^^^^^^ >>> This difference appears unintended >>> >>> >>>> + >>>> +typedef struct Jpeg2000DecoderContext { >>> >>> This is unneeded for the encoder >>> maybe a jpeg2000dec.h would be better for this >>> also code moving should be in a seperate patch from functional changes >>> >>> [...] >>>> +#endif /* AVCODEC_JPEG2000HTDEC_H */ >>> >>>> \ No newline at end of file >>> >>> needs newline >>> >>> new decoder not reviewed, feel free to wait for someone to review it >>> before reposting >>> >>> thx >>> >>> >>> [...] >>> -- >>> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB >>> >>> Those who would give up essential Liberty, to purchase a little >>> temporary Safety, deserve neither Liberty nor Safety -- Benjamin Franklin _______________________________________________ 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".