Blame lib/decint.h

Packit 00c01a
/********************************************************************
Packit 00c01a
 *                                                                  *
Packit 00c01a
 * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE.   *
Packit 00c01a
 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
Packit 00c01a
 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
Packit 00c01a
 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
Packit 00c01a
 *                                                                  *
Packit 00c01a
 * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009                *
Packit 00c01a
 * by the Xiph.Org Foundation and contributors http://www.xiph.org/ *
Packit 00c01a
 *                                                                  *
Packit 00c01a
 ********************************************************************
Packit 00c01a
Packit 00c01a
  function:
Packit 00c01a
    last mod: $Id: decint.h 16503 2009-08-22 18:14:02Z giles $
Packit 00c01a
Packit 00c01a
 ********************************************************************/
Packit 00c01a
Packit 00c01a
#include <limits.h>
Packit 00c01a
#if !defined(_decint_H)
Packit 00c01a
# define _decint_H (1)
Packit 00c01a
# include "theora/theoradec.h"
Packit 00c01a
# include "internal.h"
Packit 00c01a
# include "bitpack.h"
Packit 00c01a
Packit 00c01a
typedef struct th_setup_info oc_setup_info;
Packit 00c01a
typedef struct th_dec_ctx    oc_dec_ctx;
Packit 00c01a
Packit 00c01a
# include "huffdec.h"
Packit 00c01a
# include "dequant.h"
Packit 00c01a
Packit 00c01a
/*Constants for the packet-in state machine specific to the decoder.*/
Packit 00c01a
Packit 00c01a
/*Next packet to read: Data packet.*/
Packit 00c01a
#define OC_PACKET_DATA (0)
Packit 00c01a
Packit 00c01a
Packit 00c01a
Packit 00c01a
struct th_setup_info{
Packit 00c01a
  /*The Huffman codes.*/
Packit 00c01a
  oc_huff_node      *huff_tables[TH_NHUFFMAN_TABLES];
Packit 00c01a
  /*The quantization parameters.*/
Packit 00c01a
  th_quant_info  qinfo;
Packit 00c01a
};
Packit 00c01a
Packit 00c01a
Packit 00c01a
Packit 00c01a
struct th_dec_ctx{
Packit 00c01a
  /*Shared encoder/decoder state.*/
Packit 00c01a
  oc_theora_state      state;
Packit 00c01a
  /*Whether or not packets are ready to be emitted.
Packit 00c01a
    This takes on negative values while there are remaining header packets to
Packit 00c01a
     be emitted, reaches 0 when the codec is ready for input, and goes to 1
Packit 00c01a
     when a frame has been processed and a data packet is ready.*/
Packit 00c01a
  int                  packet_state;
Packit 00c01a
  /*Buffer in which to assemble packets.*/
Packit 00c01a
  oc_pack_buf          opb;
Packit 00c01a
  /*Huffman decode trees.*/
Packit 00c01a
  oc_huff_node        *huff_tables[TH_NHUFFMAN_TABLES];
Packit 00c01a
  /*The index of the first token in each plane for each coefficient.*/
Packit 00c01a
  ptrdiff_t            ti0[3][64];
Packit 00c01a
  /*The number of outstanding EOB runs at the start of each coefficient in each
Packit 00c01a
     plane.*/
Packit 00c01a
  ptrdiff_t            eob_runs[3][64];
Packit 00c01a
  /*The DCT token lists.*/
Packit 00c01a
  unsigned char       *dct_tokens;
Packit 00c01a
  /*The extra bits associated with DCT tokens.*/
Packit 00c01a
  unsigned char       *extra_bits;
Packit 00c01a
  /*The number of dct tokens unpacked so far.*/
Packit 00c01a
  int                  dct_tokens_count;
Packit 00c01a
  /*The out-of-loop post-processing level.*/
Packit 00c01a
  int                  pp_level;
Packit 00c01a
  /*The DC scale used for out-of-loop deblocking.*/
Packit 00c01a
  int                  pp_dc_scale[64];
Packit 00c01a
  /*The sharpen modifier used for out-of-loop deringing.*/
Packit 00c01a
  int                  pp_sharp_mod[64];
Packit 00c01a
  /*The DC quantization index of each block.*/
Packit 00c01a
  unsigned char       *dc_qis;
Packit 00c01a
  /*The variance of each block.*/
Packit 00c01a
  int                 *variances;
Packit 00c01a
  /*The storage for the post-processed frame buffer.*/
Packit 00c01a
  unsigned char       *pp_frame_data;
Packit 00c01a
  /*Whether or not the post-processsed frame buffer has space for chroma.*/
Packit 00c01a
  int                  pp_frame_state;
Packit 00c01a
  /*The buffer used for the post-processed frame.
Packit 00c01a
    Note that this is _not_ guaranteed to have the same strides and offsets as
Packit 00c01a
     the reference frame buffers.*/
Packit 00c01a
  th_ycbcr_buffer      pp_frame_buf;
Packit 00c01a
  /*The striped decode callback function.*/
Packit 00c01a
  th_stripe_callback   stripe_cb;
Packit 00c01a
# if defined(HAVE_CAIRO)
Packit 00c01a
  /*Output metrics for debugging.*/
Packit 00c01a
  int                  telemetry;
Packit 00c01a
  int                  telemetry_mbmode;
Packit 00c01a
  int                  telemetry_mv;
Packit 00c01a
  int                  telemetry_qi;
Packit 00c01a
  int                  telemetry_bits;
Packit 00c01a
  int                  telemetry_frame_bytes;
Packit 00c01a
  int                  telemetry_coding_bytes;
Packit 00c01a
  int                  telemetry_mode_bytes;
Packit 00c01a
  int                  telemetry_mv_bytes;
Packit 00c01a
  int                  telemetry_qi_bytes;
Packit 00c01a
  int                  telemetry_dc_bytes;
Packit 00c01a
  unsigned char       *telemetry_frame_data;
Packit 00c01a
# endif
Packit 00c01a
};
Packit 00c01a
Packit 00c01a
#endif