FFmpeg
Loading...
Searching...
No Matches
jpeg2000dec.h
Go to the documentation of this file.
1/*
2 * JPEG 2000 image decoder
3 * Copyright (c) 2007 Kamil Nowosad
4 * Copyright (c) 2013 Nicolas Bertrand <nicoinattendu@gmail.com>
5 * Copyright (c) 2022 Caleb Etemesi <etemesicaleb@gmail.com>
6 *
7 * This file is part of FFmpeg.
8 *
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#ifndef AVCODEC_JPEG2000DEC_H
25#define AVCODEC_JPEG2000DEC_H
26
27#include "bytestream.h"
28#include "jpeg2000.h"
29#include "jpeg2000dsp.h"
30
31
32#define MAX_POCS 32
33
34typedef struct Jpeg2000POCEntry {
35 uint16_t LYEpoc;
36 uint16_t CSpoc;
37 uint16_t CEpoc;
38 uint8_t RSpoc;
39 uint8_t REpoc;
40 uint8_t Ppoc;
42
48
49typedef struct Jpeg2000TilePart {
50 uint8_t tile_index; // Tile index who refers the tile-part
51 const uint8_t *tp_end;
52 GetByteContext header_tpg; // bit stream of header if PPM header is used
53 GetByteContext tpg; // bit stream in tile-part
55
56/* RMK: For JPEG2000 DCINEMA 3 tile-parts in a tile
57 * one per component, so tile_part elements have a size of 3 */
58typedef struct Jpeg2000Tile {
60 uint8_t properties[4];
65 uint8_t has_ppt; // whether this tile has a ppt marker
66 uint8_t *packed_headers; // contains packed headers. Used only along with PPT marker
67 int packed_headers_size; // size in bytes of the packed headers
68 GetByteContext packed_headers_stream; // byte context corresponding to packed headers
69 uint16_t tp_idx; // Tile-part index
70 int coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}}
72
73typedef struct Jpeg2000DecoderContext {
74 AVClass *class;
77
81 uint8_t cbps[4]; // bits per sample in particular components
82 uint8_t sgnd[4]; // if a component is signed
83 uint8_t properties[4];
84
85 uint8_t has_ppm;
86 uint8_t *packed_headers; // contains packed headers. Used only along with PPM marker
89
90 int cdx[4], cdy[4];
94 uint32_t palette[256];
95 int8_t pal8;
96 int cdef[4];
101
105 uint8_t roi_shift[4];
106
108
110
113
114 uint8_t isHT; // HTJ2K?
115 uint8_t Ccap15_b14_15; // HTONLY(= 0) or HTDECLARED(= 1) or MIXED(= 3) ?
116 uint8_t Ccap15_b12; // RGNFREE(= 0) or RGN(= 1)?
117 uint8_t Ccap15_b11; // HOMOGENEOUS(= 0) or HETEROGENEOUS(= 1) ?
118 uint8_t Ccap15_b05; // HTREV(= 0) or HTIRV(= 1) ?
119 uint8_t HT_B; // The parameter B for MAGBp value (see Table 4 in the Rec. ITU-T T.814 | ISO/IEC 15444-15)
120
121 /*options parameters*/
124
125#endif //AVCODEC_JPEG2000DEC_H
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
Definition eamad.c:79
JPEG 2000 structures and defines common to encoder and decoder.
#define MAX_POCS
Definition jpeg2000dec.h:32
Describe the class of an AVClass context structure.
Definition log.h:76
main external API structure.
Definition avcodec.h:443
Rational number (pair of numerator and denominator).
Definition rational.h:58
Jpeg2000Tile * tile
AVCodecContext * avctx
Definition jpeg2000dec.h:75
GetByteContext packed_headers_stream
Definition jpeg2000dec.h:88
uint32_t palette[256]
Definition jpeg2000dec.h:94
Jpeg2000QuantStyle qntsty[4]
Jpeg2000DSPContext dsp
Jpeg2000CodingStyle codsty[4]
Jpeg2000POCEntry poc[MAX_POCS]
Definition jpeg2000dec.h:44
const uint8_t * tp_end
Definition jpeg2000dec.h:51
GetByteContext header_tpg
Definition jpeg2000dec.h:52
GetByteContext tpg
Definition jpeg2000dec.h:53
Jpeg2000TilePart tile_part[32]
Definition jpeg2000dec.h:64
int coord[2][2]
Definition jpeg2000dec.h:70
Jpeg2000POC poc
Definition jpeg2000dec.h:63
Jpeg2000QuantStyle qntsty[4]
Definition jpeg2000dec.h:62
Jpeg2000CodingStyle codsty[4]
Definition jpeg2000dec.h:61
GetByteContext packed_headers_stream
Definition jpeg2000dec.h:68
uint8_t has_ppt
Definition jpeg2000dec.h:65
uint8_t * packed_headers
Definition jpeg2000dec.h:66
uint16_t tp_idx
Definition jpeg2000dec.h:69
int packed_headers_size
Definition jpeg2000dec.h:67
uint8_t properties[4]
Definition jpeg2000dec.h:60