vp9_onyxd_int.h 1.65 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

21
typedef struct VP9Decompressor {
John Koleszar's avatar
John Koleszar committed
22
  DECLARE_ALIGNED(16, MACROBLOCKD, mb);
John Koleszar's avatar
John Koleszar committed
23

24
  DECLARE_ALIGNED(16, VP9_COMMON, common);
John Koleszar's avatar
John Koleszar committed
25

26
  VP9D_CONFIG oxcf;
John Koleszar's avatar
John Koleszar committed
27
28


John Koleszar's avatar
John Koleszar committed
29
30
  const unsigned char *Source;
  unsigned int   source_sz;
31

32
  vp9_reader *mbc;
John Koleszar's avatar
John Koleszar committed
33
34
  int64_t last_time_stamp;
  int   ready_for_new_data;
John Koleszar's avatar
John Koleszar committed
35

36
  int refresh_frame_flags;
37
  vp9_prob prob_skip_false;
Scott LaVarnway's avatar
Scott LaVarnway committed
38

John Koleszar's avatar
John Koleszar committed
39
  int decoded_key_frame;
40

41
} VP9D_COMP;
John Koleszar's avatar
John Koleszar committed
42

43
int vp9_decode_frame(VP9D_COMP *cpi, const unsigned char **p_data_end);
John Koleszar's avatar
John Koleszar committed
44
45
46
47


#if CONFIG_DEBUG
#define CHECK_MEM_ERROR(lval,expr) do {\
John Koleszar's avatar
John Koleszar committed
48
49
50
51
52
53
    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
54
55
#else
#define CHECK_MEM_ERROR(lval,expr) do {\
John Koleszar's avatar
John Koleszar committed
56
57
58
59
60
    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
61
62
#endif

63
#endif  // VP9_DECODER_VP9_TREEREADER_H_