⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hpbit_stream_out_local.h

📁 JPEG2000实现的源码
💻 H
📖 第 1 页 / 共 2 页
字号:
     do not differ from their counterparts in the global header.
         The `tpart' field holds the zero-based index of the tile-part into
     which the marker is to be placed.  This field currently must hold zero
     except possibly for tile-specific POC markers. */

/*****************************************************************************/
/*                           hpbit_component_params                          */
/*****************************************************************************/

typedef
  struct hpbit_component_params {
    int num_levels;
    int num_bands;
  } hpbit_component_params, *hpbit_component_params_ptr;
  /* This structure manages the limited set of component-specific coding
     parameters which are required for correct translation of markers.  The
     `num_levels' field holds the number of decomposition levels available
     in the relevant tile-component.  The `num_bands' field holds the total
     number of subbands, which is, of course, dependent upon the decomposition
     structure, as well as he number of decomposition levels. */

/*****************************************************************************/
/*                               hpbit_params                                */
/*****************************************************************************/

typedef
  struct hpbit_params {
    int num_components;
    hpbit_component_params_ptr components;
  } hpbit_params, *hpbit_params_ptr;
  /* This structure maintains parameters which are needed to correctly
     translate codestream markers.  These parameters are fairly limited
     and readily extracted from simple markers.  Currently, we expect
     these parameters to be limited to the number of components, and the
     number of decomposition levels and the number of subbands in each
     component.  A separate structure is managed within each `hpbit_markers'
     structure. */

/*****************************************************************************/
/*                              hpbit_markers                                */
/*****************************************************************************/

typedef
  struct hpbit_markers {
    hpbit_pre_marker_ptr pre_markers;
    hpbit_codestream_marker_ptr codestream_markers;
    int total_codestream_bytes;
    int processed;
    hpbit_params params;
  } hpbit_markers, *hpbit_markers_ptr;
  /* This structure manages a complete set of marker information,
     corresponding to either the global header, or a tile header.
     Most markers start out on the `pre_marker' list, which is constructed
     from information delivered across the `stream_out__declare_marker_elt'
     and `stream_out__set_marker_val' interface functions.  This information
     is then massaged and used to create the final codestream markers.
         The `total_codestream_bytes' field holds the sum of the `num_bytes'
     fields from all elements of the list referenced by the
     `codestream_markers' field, plus the number of bytes associated with
     the SOC or SOT/SOD markers which form part of the relevant scope
     (global markers or tile-specific markers), but are not explicitly
     included on the list of codestream markers for simplicity.
         The `processed' field indicates whether or not the codestream
     markers have been generated from the pre-markers.
         The `params' field manages the limited set of coding parameters
     which are required to translate codestream markers. */

/*****************************************************************************/
/*                                hpbit_tile                                 */
/*****************************************************************************/

typedef
  struct hpbit_tile {
    int tnum;
    hpbit_markers markers;
    int resync;
    int eph;
    struct hpbit_tile *next;
  } hpbit_tile, *hpbit_tile_ptr;
  /* This structure manages the header and other tile-specific information
     as necessary.  It manages only the markers which must be
     included in tile-part headers for the tile.
         The `resync' flag indicates whether or not resync markers are
     to be used in the current tile.
         The `eph' flag indicates whether or not EPH markers are to be
     used in the current tile. */

/*****************************************************************************/
/*                           hpbit_stream_out_obj                            */
/*****************************************************************************/

typedef
  struct hpbit_stream_out_obj {
    stream_out_obj base;
    FILE *fp;
    hpbit_markers global_markers;
    hpbit_tile_ptr tiles;
    int remaining_bytes;
    int global_resync, current_resync;
    int global_eph, current_eph;
    std_ushort packet_sequence_idx;
    int open_packet;
    int packet_bytes;
    int outstanding_head_bytes;
    int outstanding_body_bytes;
    int num_non_compliant_markers;
    int use_old_sot;
  } hpbit_stream_out_obj, *hpbit_stream_out_ref;
  /* This structure defines the augmented state of the `stream_out' object
     created by `create_reference_stream_out'.
         `fp' points to the open file associated with the bit-stream.
         `global_markers' contains all information concerning the markers
     which must be written to the global header of the codestream, i.e.
     before the first tile header.
         `tiles' points to a linked list of `hpbit_tile' structures for
     which any tile-specific information is available.  The tiles are
     not guaranteed to appear in order within this list.
         `remaining_bytes' identifies the total number of bytes which can
     still be written to the output file, without violating the constraint
     established during the call to `stream_out__initialize'.  This includes
     any marker codes which have not yet been output to the file, even the
     SOC marker.
         `global_resync' holds 1 or 0, depending upon whether
     resynchronization (SOP) markers are to be inserted before each packet.
     The flag may be overridden in particular
     tiles, so the `current_resync' flag is provided to identify whether
     or not the current tile uses resync markers.
         `global_eph' holds 1 or 0, depending upon whether end-of-packet-head
     (EPH) markers are to be inserted immediately after the head of each
     packet as part of a global ERS style.  The flag may be overridden in
     particular tiles, as the `current_eph' flag is provided to identify
     whether or not the current tile uses EPH markers.
         `packet_sequence_idx' holds the sequence index for the next packet's
     resynchronization marker, when `resync' is non-zero.  The sequence
     index cycles through the range 0 to 2^16-1.
         `open_packet' is non-zero if a `start_packet' call has not been
     concluded by a matching `end_packet' call.  The value is positive if
     the packet head and body bytes are to be sent directly to the output
     file.  The value is negative, if the caller is simulating a packet
     output operation in order to determine the size of the packet.
         `packet_bytes' keeps track of the total number of bytes in the
     current packet, including resync markers and any extra bytes which
     must be stuffed to avoid misdetection of resync markers.
         `outstanding_head_bytes' and `outstanding_body_bytes' keep track
     of the number of head and body bytes declared in the most recent call
     to `start_packet' which have not yet been delivered via calls to
     `push_head_bytes' and `push_body_bytes', respectively.
         `num_non_compliant_markers' indicates the total number of codestream
     markers which the decompressor must understand to meaningfully decompress
     the codestream, yet which are not currently compliant with the
     standard.
         `use_old_sot' is a flag indicating whether or not the final
     `NTPsot' field in the SOT marker should be omitted.  The decompressor
     figures this out based upon the SOT marker's length field. */

#endif /* HPBIT_STREAM_OUT_LOCAL_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -