/media/libvpx/vp8/decoder/onyxd_int.h

http://github.com/zpao/v8monkey · C Header · 164 lines · 117 code · 35 blank · 12 comment · 4 complexity · 043750e496f2e3bb65ebcf0ddfe905a4 MD5 · raw file

  1. /*
  2. * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * 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.
  9. */
  10. #ifndef __INC_VP8D_INT_H
  11. #define __INC_VP8D_INT_H
  12. #include "vpx_ports/config.h"
  13. #include "vp8/common/onyxd.h"
  14. #include "treereader.h"
  15. #include "vp8/common/onyxc_int.h"
  16. #include "vp8/common/threading.h"
  17. #include "dequantize.h"
  18. #if CONFIG_ERROR_CONCEALMENT
  19. #include "ec_types.h"
  20. #endif
  21. typedef struct
  22. {
  23. int ithread;
  24. void *ptr1;
  25. void *ptr2;
  26. } DECODETHREAD_DATA;
  27. typedef struct
  28. {
  29. MACROBLOCKD mbd;
  30. int mb_row;
  31. int current_mb_col;
  32. short *coef_ptr;
  33. } MB_ROW_DEC;
  34. typedef struct
  35. {
  36. int64_t time_stamp;
  37. int size;
  38. } DATARATE;
  39. typedef struct
  40. {
  41. int const *scan;
  42. UINT8 const *ptr_block2leftabove;
  43. vp8_tree_index const *vp8_coef_tree_ptr;
  44. unsigned char *norm_ptr;
  45. UINT8 *ptr_coef_bands_x;
  46. ENTROPY_CONTEXT_PLANES *A;
  47. ENTROPY_CONTEXT_PLANES *L;
  48. INT16 *qcoeff_start_ptr;
  49. BOOL_DECODER *current_bc;
  50. vp8_prob const *coef_probs[4];
  51. UINT8 eob[25];
  52. } DETOK;
  53. typedef struct VP8Decompressor
  54. {
  55. DECLARE_ALIGNED(16, MACROBLOCKD, mb);
  56. DECLARE_ALIGNED(16, VP8_COMMON, common);
  57. vp8_reader bc, bc2;
  58. VP8D_CONFIG oxcf;
  59. const unsigned char *Source;
  60. unsigned int source_sz;
  61. const unsigned char *partitions[MAX_PARTITIONS];
  62. unsigned int partition_sizes[MAX_PARTITIONS];
  63. unsigned int num_partitions;
  64. #if CONFIG_MULTITHREAD
  65. /* variable for threading */
  66. volatile int b_multithreaded_rd;
  67. int max_threads;
  68. int current_mb_col_main;
  69. int decoding_thread_count;
  70. int allocated_decoding_thread_count;
  71. int mt_baseline_filter_level[MAX_MB_SEGMENTS];
  72. int sync_range;
  73. int *mt_current_mb_col; /* Each row remembers its already decoded column. */
  74. unsigned char **mt_yabove_row; /* mb_rows x width */
  75. unsigned char **mt_uabove_row;
  76. unsigned char **mt_vabove_row;
  77. unsigned char **mt_yleft_col; /* mb_rows x 16 */
  78. unsigned char **mt_uleft_col; /* mb_rows x 8 */
  79. unsigned char **mt_vleft_col; /* mb_rows x 8 */
  80. MB_ROW_DEC *mb_row_di;
  81. DECODETHREAD_DATA *de_thread_data;
  82. pthread_t *h_decoding_thread;
  83. sem_t *h_event_start_decoding;
  84. sem_t h_event_end_decoding;
  85. /* end of threading data */
  86. #endif
  87. vp8_reader *mbc;
  88. int64_t last_time_stamp;
  89. int ready_for_new_data;
  90. DATARATE dr[16];
  91. DETOK detoken;
  92. #if CONFIG_RUNTIME_CPU_DETECT
  93. vp8_dequant_rtcd_vtable_t dequant;
  94. #endif
  95. vp8_prob prob_intra;
  96. vp8_prob prob_last;
  97. vp8_prob prob_gf;
  98. vp8_prob prob_skip_false;
  99. #if CONFIG_ERROR_CONCEALMENT
  100. MB_OVERLAP *overlaps;
  101. /* the mb num from which modes and mvs (first partition) are corrupt */
  102. unsigned int mvs_corrupt_from_mb;
  103. #endif
  104. int ec_enabled;
  105. int ec_active;
  106. int input_partition;
  107. int decoded_key_frame;
  108. int independent_partitions;
  109. int frame_corrupt_residual;
  110. } VP8D_COMP;
  111. int vp8_decode_frame(VP8D_COMP *cpi);
  112. void vp8_dmachine_specific_config(VP8D_COMP *pbi);
  113. #if CONFIG_DEBUG
  114. #define CHECK_MEM_ERROR(lval,expr) do {\
  115. lval = (expr); \
  116. if(!lval) \
  117. vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\
  118. "Failed to allocate "#lval" at %s:%d", \
  119. __FILE__,__LINE__);\
  120. } while(0)
  121. #else
  122. #define CHECK_MEM_ERROR(lval,expr) do {\
  123. lval = (expr); \
  124. if(!lval) \
  125. vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\
  126. "Failed to allocate "#lval);\
  127. } while(0)
  128. #endif
  129. #endif