vp9_onyxd_int.h 2.62 KB
Newer Older
John Koleszar's avatar
John Koleszar committed
1
/*
2
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar's avatar
John Koleszar committed
3
 *
4
 *  Use of this source code is governed by a BSD-style license
5 6
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
7
 *  in the file PATENTS.  All contributing project authors may
8
 *  be found in the AUTHORS file in the root of the source tree.
John Koleszar's avatar
John Koleszar committed
9 10
 */

11 12
#ifndef VP9_DECODER_VP9_ONYXD_INT_H_
#define VP9_DECODER_VP9_ONYXD_INT_H_
13
#include "./vpx_config.h"
14
#include "vp9/decoder/vp9_onyxd.h"
15
#include "vp9/decoder/vp9_treereader.h"
16
#include "vp9/common/vp9_onyxc_int.h"
17
#include "vp9/decoder/vp9_dequantize.h"
John Koleszar's avatar
John Koleszar committed
18

John Koleszar's avatar
John Koleszar committed
19
// #define DEC_DEBUG
20

John Koleszar's avatar
John Koleszar committed
21 22 23 24
typedef struct {
  int ithread;
  void *ptr1;
  void *ptr2;
John Koleszar's avatar
John Koleszar committed
25 26
} DECODETHREAD_DATA;

John Koleszar's avatar
John Koleszar committed
27 28 29 30 31
typedef struct {
  MACROBLOCKD  mbd;
  int mb_row;
  int current_mb_col;
  short *coef_ptr;
John Koleszar's avatar
John Koleszar committed
32 33
} MB_ROW_DEC;

John Koleszar's avatar
John Koleszar committed
34 35 36
typedef struct {
  int const *scan;
  int const *scan_8x8;
John Koleszar's avatar
John Koleszar committed
37
  uint8_t const *ptr_block2leftabove;
38
  vp9_tree_index const *vp9_coef_tree_ptr;
John Koleszar's avatar
John Koleszar committed
39
  unsigned char *norm_ptr;
John Koleszar's avatar
John Koleszar committed
40 41
  uint8_t *ptr_coef_bands_x;
  uint8_t *ptr_coef_bands_x_8x8;
John Koleszar's avatar
John Koleszar committed
42

John Koleszar's avatar
John Koleszar committed
43 44
  ENTROPY_CONTEXT_PLANES *A;
  ENTROPY_CONTEXT_PLANES *L;
John Koleszar's avatar
John Koleszar committed
45

John Koleszar's avatar
John Koleszar committed
46
  int16_t *qcoeff_start_ptr;
John Koleszar's avatar
John Koleszar committed
47

48
  vp9_prob const *coef_probs_4x4[BLOCK_TYPES_4X4];
49 50
  vp9_prob const *coef_probs_8x8[BLOCK_TYPES_8X8];
  vp9_prob const *coef_probs_16X16[BLOCK_TYPES_16X16];
John Koleszar's avatar
John Koleszar committed
51

John Koleszar's avatar
John Koleszar committed
52
  uint8_t eob[25];
John Koleszar's avatar
John Koleszar committed
53 54 55

} DETOK;

56
typedef struct VP9Decompressor {
John Koleszar's avatar
John Koleszar committed
57
  DECLARE_ALIGNED(16, MACROBLOCKD, mb);
John Koleszar's avatar
John Koleszar committed
58

59
  DECLARE_ALIGNED(16, VP9_COMMON, common);
John Koleszar's avatar
John Koleszar committed
60

61
  VP9D_CONFIG oxcf;
John Koleszar's avatar
John Koleszar committed
62 63


John Koleszar's avatar
John Koleszar committed
64 65
  const unsigned char *Source;
  unsigned int   source_sz;
66

67
  vp9_reader *mbc;
John Koleszar's avatar
John Koleszar committed
68 69
  int64_t last_time_stamp;
  int   ready_for_new_data;
John Koleszar's avatar
John Koleszar committed
70

John Koleszar's avatar
John Koleszar committed
71
  DETOK detoken;
John Koleszar's avatar
John Koleszar committed
72

73 74 75 76 77
  vp9_dequant_idct_add_fn_t            idct_add;
  vp9_dequant_dc_idct_add_fn_t         dc_idct_add;
  vp9_dequant_dc_idct_add_y_block_fn_t dc_idct_add_y_block;
  vp9_dequant_idct_add_y_block_fn_t    idct_add_y_block;
  vp9_dequant_idct_add_uv_block_fn_t   idct_add_uv_block;
John Koleszar's avatar
John Koleszar committed
78

79
  int refresh_frame_flags;
80
  vp9_prob prob_skip_false;
Scott LaVarnway's avatar
Scott LaVarnway committed
81

John Koleszar's avatar
John Koleszar committed
82
  int decoded_key_frame;
83

84
} VP9D_COMP;
John Koleszar's avatar
John Koleszar committed
85

86
int vp9_decode_frame(VP9D_COMP *cpi, const unsigned char **p_data_end);
John Koleszar's avatar
John Koleszar committed
87 88 89 90


#if CONFIG_DEBUG
#define CHECK_MEM_ERROR(lval,expr) do {\
John Koleszar's avatar
John Koleszar committed
91 92 93 94 95 96
    lval = (expr); \
    if(!lval) \
      vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\
                         "Failed to allocate "#lval" at %s:%d", \
                         __FILE__,__LINE__);\
  } while(0)
John Koleszar's avatar
John Koleszar committed
97 98
#else
#define CHECK_MEM_ERROR(lval,expr) do {\
John Koleszar's avatar
John Koleszar committed
99 100 101 102 103
    lval = (expr); \
    if(!lval) \
      vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\
                         "Failed to allocate "#lval);\
  } while(0)
John Koleszar's avatar
John Koleszar committed
104 105
#endif

106
#endif  // VP9_DECODER_VP9_TREEREADER_H_