| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 | 11 |
| 12 #ifndef __INC_VP8C_INT_H | 12 #ifndef __INC_VP8C_INT_H |
| 13 #define __INC_VP8C_INT_H | 13 #define __INC_VP8C_INT_H |
| 14 | 14 |
| 15 #include "vpx_config.h" | 15 #include "vpx_config.h" |
| 16 #include "vpx/internal/vpx_codec_internal.h" | 16 #include "vpx/internal/vpx_codec_internal.h" |
| 17 #include "loopfilter.h" | 17 #include "loopfilter.h" |
| 18 #include "entropymv.h" | 18 #include "entropymv.h" |
| 19 #include "entropy.h" | 19 #include "entropy.h" |
| 20 #include "idct.h" | 20 #include "idct.h" |
| 21 #include "recon.h" | 21 #include "recon.h" |
| 22 #if CONFIG_POSTPROC |
| 22 #include "postproc.h" | 23 #include "postproc.h" |
| 24 #endif |
| 23 | 25 |
| 24 /*#ifdef PACKET_TESTING*/ | 26 /*#ifdef PACKET_TESTING*/ |
| 25 #include "header.h" | 27 #include "header.h" |
| 26 /*#endif*/ | 28 /*#endif*/ |
| 27 | 29 |
| 28 /* Create/destroy static data structures. */ | 30 /* Create/destroy static data structures. */ |
| 29 | 31 |
| 30 void vp8_initialize_common(void); | 32 void vp8_initialize_common(void); |
| 31 | 33 |
| 32 #define MINQ 0 | 34 #define MINQ 0 |
| 33 #define MAXQ 127 | 35 #define MAXQ 127 |
| 34 #define QINDEX_RANGE (MAXQ + 1) | 36 #define QINDEX_RANGE (MAXQ + 1) |
| 35 | 37 |
| 36 #define NUM_YV12_BUFFERS 4 | 38 #define NUM_YV12_BUFFERS 4 |
| 37 | 39 |
| 40 #define MAX_PARTITIONS 9 |
| 41 |
| 38 typedef struct frame_contexts | 42 typedef struct frame_contexts |
| 39 { | 43 { |
| 40 vp8_prob bmode_prob [VP8_BINTRAMODES-1]; | 44 vp8_prob bmode_prob [VP8_BINTRAMODES-1]; |
| 41 vp8_prob ymode_prob [VP8_YMODES-1]; /* interframe intra mode probs */ | 45 vp8_prob ymode_prob [VP8_YMODES-1]; /* interframe intra mode probs */ |
| 42 vp8_prob uv_mode_prob [VP8_UV_MODES-1]; | 46 vp8_prob uv_mode_prob [VP8_UV_MODES-1]; |
| 43 vp8_prob sub_mv_ref_prob [VP8_SUBMVREFS-1]; | 47 vp8_prob sub_mv_ref_prob [VP8_SUBMVREFS-1]; |
| 44 vp8_prob coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [vp8_coe
f_tokens-1]; | 48 vp8_prob coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY
_NODES]; |
| 45 MV_CONTEXT mvc[2]; | 49 MV_CONTEXT mvc[2]; |
| 46 MV_CONTEXT pre_mvc[2]; /* not to caculate the mvcost for the frame if mvc d
oesn't change. */ | 50 MV_CONTEXT pre_mvc[2]; /* not to caculate the mvcost for the frame if mvc d
oesn't change. */ |
| 47 } FRAME_CONTEXT; | 51 } FRAME_CONTEXT; |
| 48 | 52 |
| 49 typedef enum | 53 typedef enum |
| 50 { | 54 { |
| 51 ONE_PARTITION = 0, | 55 ONE_PARTITION = 0, |
| 52 TWO_PARTITION = 1, | 56 TWO_PARTITION = 1, |
| 53 FOUR_PARTITION = 2, | 57 FOUR_PARTITION = 2, |
| 54 EIGHT_PARTITION = 3 | 58 EIGHT_PARTITION = 3 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 66 BILINEAR = 1 | 70 BILINEAR = 1 |
| 67 } INTERPOLATIONFILTERTYPE; | 71 } INTERPOLATIONFILTERTYPE; |
| 68 | 72 |
| 69 typedef struct VP8_COMMON_RTCD | 73 typedef struct VP8_COMMON_RTCD |
| 70 { | 74 { |
| 71 #if CONFIG_RUNTIME_CPU_DETECT | 75 #if CONFIG_RUNTIME_CPU_DETECT |
| 72 vp8_idct_rtcd_vtable_t idct; | 76 vp8_idct_rtcd_vtable_t idct; |
| 73 vp8_recon_rtcd_vtable_t recon; | 77 vp8_recon_rtcd_vtable_t recon; |
| 74 vp8_subpix_rtcd_vtable_t subpix; | 78 vp8_subpix_rtcd_vtable_t subpix; |
| 75 vp8_loopfilter_rtcd_vtable_t loopfilter; | 79 vp8_loopfilter_rtcd_vtable_t loopfilter; |
| 80 #if CONFIG_POSTPROC |
| 76 vp8_postproc_rtcd_vtable_t postproc; | 81 vp8_postproc_rtcd_vtable_t postproc; |
| 82 #endif |
| 77 int flags; | 83 int flags; |
| 78 #else | 84 #else |
| 79 int unused; | 85 int unused; |
| 80 #endif | 86 #endif |
| 81 } VP8_COMMON_RTCD; | 87 } VP8_COMMON_RTCD; |
| 82 | 88 |
| 83 typedef struct VP8Common | 89 typedef struct VP8Common |
| 90 |
| 84 { | 91 { |
| 85 struct vpx_internal_error_info error; | 92 struct vpx_internal_error_info error; |
| 86 | 93 |
| 87 DECLARE_ALIGNED(16, short, Y1dequant[QINDEX_RANGE][16]); | 94 DECLARE_ALIGNED(16, short, Y1dequant[QINDEX_RANGE][16]); |
| 88 DECLARE_ALIGNED(16, short, Y2dequant[QINDEX_RANGE][16]); | 95 DECLARE_ALIGNED(16, short, Y2dequant[QINDEX_RANGE][16]); |
| 89 DECLARE_ALIGNED(16, short, UVdequant[QINDEX_RANGE][16]); | 96 DECLARE_ALIGNED(16, short, UVdequant[QINDEX_RANGE][16]); |
| 90 | 97 |
| 91 int Width; | 98 int Width; |
| 92 int Height; | 99 int Height; |
| 93 int horiz_scale; | 100 int horiz_scale; |
| 94 int vert_scale; | 101 int vert_scale; |
| 95 | 102 |
| 96 YUV_TYPE clr_type; | 103 YUV_TYPE clr_type; |
| 97 CLAMP_TYPE clamp_type; | 104 CLAMP_TYPE clamp_type; |
| 98 | 105 |
| 99 YV12_BUFFER_CONFIG *frame_to_show; | 106 YV12_BUFFER_CONFIG *frame_to_show; |
| 100 | 107 |
| 101 YV12_BUFFER_CONFIG yv12_fb[NUM_YV12_BUFFERS]; | 108 YV12_BUFFER_CONFIG yv12_fb[NUM_YV12_BUFFERS]; |
| 102 int fb_idx_ref_cnt[NUM_YV12_BUFFERS]; | 109 int fb_idx_ref_cnt[NUM_YV12_BUFFERS]; |
| 103 int new_fb_idx, lst_fb_idx, gld_fb_idx, alt_fb_idx; | 110 int new_fb_idx, lst_fb_idx, gld_fb_idx, alt_fb_idx; |
| 104 | 111 |
| 105 YV12_BUFFER_CONFIG post_proc_buffer; | 112 YV12_BUFFER_CONFIG post_proc_buffer; |
| 106 YV12_BUFFER_CONFIG temp_scale_frame; | 113 YV12_BUFFER_CONFIG temp_scale_frame; |
| 107 | 114 |
| 108 FRAME_TYPE last_frame_type; /* Save last frame's frame type for loopfilter
init checking and motion search. */ | 115 |
| 116 FRAME_TYPE last_frame_type; /* Save last frame's frame type for motion sear
ch. */ |
| 109 FRAME_TYPE frame_type; | 117 FRAME_TYPE frame_type; |
| 110 | 118 |
| 111 int show_frame; | 119 int show_frame; |
| 112 | 120 |
| 113 int frame_flags; | 121 int frame_flags; |
| 114 int MBs; | 122 int MBs; |
| 115 int mb_rows; | 123 int mb_rows; |
| 116 int mb_cols; | 124 int mb_cols; |
| 117 int mode_info_stride; | 125 int mode_info_stride; |
| 118 | 126 |
| 119 /* profile settings */ | 127 /* profile settings */ |
| 120 int mb_no_coeff_skip; | 128 int mb_no_coeff_skip; |
| 121 int no_lpf; | 129 int no_lpf; |
| 122 int simpler_lpf; | |
| 123 int use_bilinear_mc_filter; | 130 int use_bilinear_mc_filter; |
| 124 int full_pixel; | 131 int full_pixel; |
| 125 | 132 |
| 126 int base_qindex; | 133 int base_qindex; |
| 127 int last_kf_gf_q; /* Q used on the last GF or KF */ | 134 int last_kf_gf_q; /* Q used on the last GF or KF */ |
| 128 | 135 |
| 129 int y1dc_delta_q; | 136 int y1dc_delta_q; |
| 130 int y2dc_delta_q; | 137 int y2dc_delta_q; |
| 131 int y2ac_delta_q; | 138 int y2ac_delta_q; |
| 132 int uvdc_delta_q; | 139 int uvdc_delta_q; |
| 133 int uvac_delta_q; | 140 int uvac_delta_q; |
| 134 | 141 |
| 135 unsigned int frames_since_golden; | 142 unsigned int frames_since_golden; |
| 136 unsigned int frames_till_alt_ref_frame; | 143 unsigned int frames_till_alt_ref_frame; |
| 137 | 144 |
| 138 /* We allocate a MODE_INFO struct for each macroblock, together with | 145 /* We allocate a MODE_INFO struct for each macroblock, together with |
| 139 an extra row on top and column on the left to simplify prediction. */ | 146 an extra row on top and column on the left to simplify prediction. */ |
| 140 | 147 |
| 141 MODE_INFO *mip; /* Base of allocated array */ | 148 MODE_INFO *mip; /* Base of allocated array */ |
| 142 MODE_INFO *mi; /* Corresponds to upper left visible macroblock */ | 149 MODE_INFO *mi; /* Corresponds to upper left visible macroblock */ |
| 150 MODE_INFO *prev_mip; /* MODE_INFO array 'mip' from last decoded frame */ |
| 151 MODE_INFO *prev_mi; /* 'mi' from last frame (points into prev_mip) */ |
| 143 | 152 |
| 144 | 153 |
| 145 INTERPOLATIONFILTERTYPE mcomp_filter_type; | 154 INTERPOLATIONFILTERTYPE mcomp_filter_type; |
| 146 LOOPFILTERTYPE last_filter_type; | |
| 147 LOOPFILTERTYPE filter_type; | 155 LOOPFILTERTYPE filter_type; |
| 148 loop_filter_info lf_info[MAX_LOOP_FILTER+1]; | 156 |
| 149 prototype_loopfilter_block((*lf_mbv)); | 157 loop_filter_info_n lf_info; |
| 150 prototype_loopfilter_block((*lf_mbh)); | 158 |
| 151 prototype_loopfilter_block((*lf_bv)); | |
| 152 prototype_loopfilter_block((*lf_bh)); | |
| 153 int filter_level; | 159 int filter_level; |
| 154 int last_sharpness_level; | 160 int last_sharpness_level; |
| 155 int sharpness_level; | 161 int sharpness_level; |
| 156 | 162 |
| 157 int refresh_last_frame; /* Two state 0 = NO, 1 = YES */ | 163 int refresh_last_frame; /* Two state 0 = NO, 1 = YES */ |
| 158 int refresh_golden_frame; /* Two state 0 = NO, 1 = YES */ | 164 int refresh_golden_frame; /* Two state 0 = NO, 1 = YES */ |
| 159 int refresh_alt_ref_frame; /* Two state 0 = NO, 1 = YES */ | 165 int refresh_alt_ref_frame; /* Two state 0 = NO, 1 = YES */ |
| 160 | 166 |
| 161 int copy_buffer_to_gf; /* 0 none, 1 Last to GF, 2 ARF to GF */ | 167 int copy_buffer_to_gf; /* 0 none, 1 Last to GF, 2 ARF to GF */ |
| 162 int copy_buffer_to_arf; /* 0 none, 1 Last to ARF, 2 GF to ARF */ | 168 int copy_buffer_to_arf; /* 0 none, 1 Last to ARF, 2 GF to ARF */ |
| (...skipping 26 matching lines...) Expand all Loading... |
| 189 | 195 |
| 190 #ifdef PACKET_TESTING | 196 #ifdef PACKET_TESTING |
| 191 VP8_HEADER oh; | 197 VP8_HEADER oh; |
| 192 #endif | 198 #endif |
| 193 double bitrate; | 199 double bitrate; |
| 194 double framerate; | 200 double framerate; |
| 195 | 201 |
| 196 #if CONFIG_RUNTIME_CPU_DETECT | 202 #if CONFIG_RUNTIME_CPU_DETECT |
| 197 VP8_COMMON_RTCD rtcd; | 203 VP8_COMMON_RTCD rtcd; |
| 198 #endif | 204 #endif |
| 205 #if CONFIG_MULTITHREAD |
| 206 int processor_core_count; |
| 207 #endif |
| 208 #if CONFIG_POSTPROC |
| 199 struct postproc_state postproc_state; | 209 struct postproc_state postproc_state; |
| 210 #endif |
| 200 } VP8_COMMON; | 211 } VP8_COMMON; |
| 201 | 212 |
| 202 | |
| 203 int vp8_adjust_mb_lf_value(MACROBLOCKD *mbd, int filter_level); | |
| 204 void vp8_init_loop_filter(VP8_COMMON *cm); | |
| 205 void vp8_frame_init_loop_filter(loop_filter_info *lfi, int frame_type); | |
| 206 extern void vp8_loop_filter_frame(VP8_COMMON *cm, MACROBLOCKD *mbd, int filt
_val); | |
| 207 | |
| 208 #endif | 213 #endif |
| OLD | NEW |