onyxc_int.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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 VPX_VP8_COMMON_ONYXC_INT_H_
  11. #define VPX_VP8_COMMON_ONYXC_INT_H_
  12. #include "vpx_config.h"
  13. #include "vp8_rtcd.h"
  14. #include "vpx/internal/vpx_codec_internal.h"
  15. #include "loopfilter.h"
  16. #include "entropymv.h"
  17. #include "entropy.h"
  18. #if CONFIG_POSTPROC
  19. #include "postproc.h"
  20. #endif
  21. /*#ifdef PACKET_TESTING*/
  22. #include "header.h"
  23. /*#endif*/
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #define MINQ 0
  28. #define MAXQ 127
  29. #define QINDEX_RANGE (MAXQ + 1)
  30. #define NUM_YV12_BUFFERS 4
  31. #define MAX_PARTITIONS 9
  32. typedef struct frame_contexts {
  33. vp8_prob bmode_prob[VP8_BINTRAMODES - 1];
  34. vp8_prob ymode_prob[VP8_YMODES - 1]; /* interframe intra mode probs */
  35. vp8_prob uv_mode_prob[VP8_UV_MODES - 1];
  36. vp8_prob sub_mv_ref_prob[VP8_SUBMVREFS - 1];
  37. vp8_prob coef_probs[BLOCK_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS]
  38. [ENTROPY_NODES];
  39. MV_CONTEXT mvc[2];
  40. } FRAME_CONTEXT;
  41. typedef enum {
  42. ONE_PARTITION = 0,
  43. TWO_PARTITION = 1,
  44. FOUR_PARTITION = 2,
  45. EIGHT_PARTITION = 3
  46. } TOKEN_PARTITION;
  47. typedef enum {
  48. RECON_CLAMP_REQUIRED = 0,
  49. RECON_CLAMP_NOTREQUIRED = 1
  50. } CLAMP_TYPE;
  51. typedef struct VP8Common {
  52. struct vpx_internal_error_info error;
  53. DECLARE_ALIGNED(16, short, Y1dequant[QINDEX_RANGE][2]);
  54. DECLARE_ALIGNED(16, short, Y2dequant[QINDEX_RANGE][2]);
  55. DECLARE_ALIGNED(16, short, UVdequant[QINDEX_RANGE][2]);
  56. int Width;
  57. int Height;
  58. int horiz_scale;
  59. int vert_scale;
  60. CLAMP_TYPE clamp_type;
  61. YV12_BUFFER_CONFIG *frame_to_show;
  62. YV12_BUFFER_CONFIG yv12_fb[NUM_YV12_BUFFERS];
  63. int fb_idx_ref_cnt[NUM_YV12_BUFFERS];
  64. int new_fb_idx, lst_fb_idx, gld_fb_idx, alt_fb_idx;
  65. YV12_BUFFER_CONFIG temp_scale_frame;
  66. #if CONFIG_POSTPROC
  67. YV12_BUFFER_CONFIG post_proc_buffer;
  68. YV12_BUFFER_CONFIG post_proc_buffer_int;
  69. int post_proc_buffer_int_used;
  70. unsigned char *pp_limits_buffer; /* post-processing filter coefficients */
  71. #endif
  72. FRAME_TYPE
  73. last_frame_type; /* Save last frame's frame type for motion search. */
  74. FRAME_TYPE frame_type;
  75. int show_frame;
  76. int frame_flags;
  77. int MBs;
  78. int mb_rows;
  79. int mb_cols;
  80. int mode_info_stride;
  81. /* profile settings */
  82. int mb_no_coeff_skip;
  83. int no_lpf;
  84. int use_bilinear_mc_filter;
  85. int full_pixel;
  86. int base_qindex;
  87. int y1dc_delta_q;
  88. int y2dc_delta_q;
  89. int y2ac_delta_q;
  90. int uvdc_delta_q;
  91. int uvac_delta_q;
  92. /* We allocate a MODE_INFO struct for each macroblock, together with
  93. an extra row on top and column on the left to simplify prediction. */
  94. MODE_INFO *mip; /* Base of allocated array */
  95. MODE_INFO *mi; /* Corresponds to upper left visible macroblock */
  96. #if CONFIG_ERROR_CONCEALMENT
  97. MODE_INFO *prev_mip; /* MODE_INFO array 'mip' from last decoded frame */
  98. MODE_INFO *prev_mi; /* 'mi' from last frame (points into prev_mip) */
  99. #endif
  100. /* MODE_INFO for the last decoded frame to show */
  101. MODE_INFO *show_frame_mi;
  102. LOOPFILTERTYPE filter_type;
  103. loop_filter_info_n lf_info;
  104. int filter_level;
  105. int last_sharpness_level;
  106. int sharpness_level;
  107. int refresh_last_frame; /* Two state 0 = NO, 1 = YES */
  108. int refresh_golden_frame; /* Two state 0 = NO, 1 = YES */
  109. int refresh_alt_ref_frame; /* Two state 0 = NO, 1 = YES */
  110. int copy_buffer_to_gf; /* 0 none, 1 Last to GF, 2 ARF to GF */
  111. int copy_buffer_to_arf; /* 0 none, 1 Last to ARF, 2 GF to ARF */
  112. int refresh_entropy_probs; /* Two state 0 = NO, 1 = YES */
  113. int ref_frame_sign_bias[MAX_REF_FRAMES]; /* Two state 0, 1 */
  114. /* Y,U,V,Y2 */
  115. ENTROPY_CONTEXT_PLANES *above_context; /* row of context for each plane */
  116. ENTROPY_CONTEXT_PLANES left_context; /* (up to) 4 contexts "" */
  117. FRAME_CONTEXT lfc; /* last frame entropy */
  118. FRAME_CONTEXT fc; /* this frame entropy */
  119. unsigned int current_video_frame;
  120. int version;
  121. TOKEN_PARTITION multi_token_partition;
  122. #ifdef PACKET_TESTING
  123. VP8_HEADER oh;
  124. #endif
  125. #if CONFIG_MULTITHREAD
  126. int processor_core_count;
  127. #endif
  128. #if CONFIG_POSTPROC
  129. struct postproc_state postproc_state;
  130. #endif
  131. int cpu_caps;
  132. } VP8_COMMON;
  133. #ifdef __cplusplus
  134. } // extern "C"
  135. #endif
  136. #endif // VPX_VP8_COMMON_ONYXC_INT_H_