onyxc_int.h 4.7 KB

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