| 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 VP9_ENCODER_VP9_ONYX_INT_H_ | 12 #ifndef VP9_ENCODER_VP9_ONYX_INT_H_ |
| 13 #define VP9_ENCODER_VP9_ONYX_INT_H_ | 13 #define VP9_ENCODER_VP9_ONYX_INT_H_ |
| 14 | 14 |
| 15 #include <stdio.h> | 15 #include <stdio.h> |
| 16 #include "vpx_ports/config.h" | 16 #include "./vpx_config.h" |
| 17 #include "vp9/common/vp9_onyx.h" | 17 #include "vp9/common/vp9_onyx.h" |
| 18 #include "vp9/encoder/vp9_treewriter.h" | 18 #include "vp9/encoder/vp9_treewriter.h" |
| 19 #include "vp9/encoder/vp9_tokenize.h" | 19 #include "vp9/encoder/vp9_tokenize.h" |
| 20 #include "vp9/common/vp9_onyxc_int.h" | 20 #include "vp9/common/vp9_onyxc_int.h" |
| 21 #include "vp9/encoder/vp9_variance.h" | 21 #include "vp9/encoder/vp9_variance.h" |
| 22 #include "vp9/encoder/vp9_encodemb.h" | 22 #include "vp9/encoder/vp9_encodemb.h" |
| 23 #include "vp9/encoder/vp9_quantize.h" | 23 #include "vp9/encoder/vp9_quantize.h" |
| 24 #include "vp9/common/vp9_entropy.h" | 24 #include "vp9/common/vp9_entropy.h" |
| 25 #include "vp9/common/vp9_entropymode.h" | 25 #include "vp9/common/vp9_entropymode.h" |
| 26 #include "vpx_ports/mem.h" | 26 #include "vpx_ports/mem.h" |
| 27 #include "vpx/internal/vpx_codec_internal.h" | 27 #include "vpx/internal/vpx_codec_internal.h" |
| 28 #include "vp9/encoder/vp9_mcomp.h" | 28 #include "vp9/encoder/vp9_mcomp.h" |
| 29 #include "vp9/common/vp9_findnearmv.h" | 29 #include "vp9/common/vp9_findnearmv.h" |
| 30 #include "vp9/encoder/vp9_lookahead.h" | 30 #include "vp9/encoder/vp9_lookahead.h" |
| 31 | 31 |
| 32 // #define SPEEDSTATS 1 | 32 // #define SPEEDSTATS 1 |
| 33 #define MIN_GF_INTERVAL 4 | 33 #define MIN_GF_INTERVAL 4 |
| 34 #define DEFAULT_GF_INTERVAL 7 | 34 #define DEFAULT_GF_INTERVAL 7 |
| 35 | 35 |
| 36 #define KEY_FRAME_CONTEXT 5 | 36 #define KEY_FRAME_CONTEXT 5 |
| 37 | 37 |
| 38 #define MAX_LAG_BUFFERS 25 | 38 #define MAX_LAG_BUFFERS 25 |
| 39 | 39 |
| 40 #define AF_THRESH 25 | 40 #define AF_THRESH 25 |
| 41 #define AF_THRESH2 100 | 41 #define AF_THRESH2 100 |
| 42 #define ARF_DECAY_THRESH 12 | 42 #define ARF_DECAY_THRESH 12 |
| 43 | 43 |
| 44 #if CONFIG_PRED_FILTER | |
| 45 #if CONFIG_COMP_INTERINTRA_PRED | |
| 46 #define MAX_MODES 66 | |
| 47 #else | |
| 48 #define MAX_MODES 54 | |
| 49 #endif | |
| 50 #else // CONFIG_PRED_FILTER | |
| 51 #if CONFIG_COMP_INTERINTRA_PRED | 44 #if CONFIG_COMP_INTERINTRA_PRED |
| 52 #define MAX_MODES 54 | 45 #define MAX_MODES 54 |
| 53 #else | 46 #else |
| 54 #define MAX_MODES 42 | 47 #define MAX_MODES 42 |
| 55 #endif | 48 #endif |
| 56 #endif // CONFIG_PRED_FILTER | |
| 57 | 49 |
| 58 #define MIN_THRESHMULT 32 | 50 #define MIN_THRESHMULT 32 |
| 59 #define MAX_THRESHMULT 512 | 51 #define MAX_THRESHMULT 512 |
| 60 | 52 |
| 61 #define GF_ZEROMV_ZBIN_BOOST 12 | 53 #define GF_ZEROMV_ZBIN_BOOST 12 |
| 62 #define LF_ZEROMV_ZBIN_BOOST 6 | 54 #define LF_ZEROMV_ZBIN_BOOST 6 |
| 63 #define MV_ZBIN_BOOST 4 | 55 #define MV_ZBIN_BOOST 4 |
| 64 #define ZBIN_OQ_MAX 192 | 56 #define ZBIN_OQ_MAX 192 |
| 65 | 57 |
| 66 #define VP9_TEMPORAL_ALT_REF 1 | 58 #define VP9_TEMPORAL_ALT_REF 1 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 87 vp9_prob ref_pred_probs[PREDICTION_PROBS]; | 79 vp9_prob ref_pred_probs[PREDICTION_PROBS]; |
| 88 vp9_prob prob_comppred[COMP_PRED_CONTEXTS]; | 80 vp9_prob prob_comppred[COMP_PRED_CONTEXTS]; |
| 89 | 81 |
| 90 unsigned char *last_frame_seg_map_copy; | 82 unsigned char *last_frame_seg_map_copy; |
| 91 | 83 |
| 92 // 0 = Intra, Last, GF, ARF | 84 // 0 = Intra, Last, GF, ARF |
| 93 signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS]; | 85 signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS]; |
| 94 // 0 = BPRED, ZERO_MV, MV, SPLIT | 86 // 0 = BPRED, ZERO_MV, MV, SPLIT |
| 95 signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS]; | 87 signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS]; |
| 96 | 88 |
| 97 vp9_prob coef_probs[BLOCK_TYPES] | 89 vp9_coeff_probs coef_probs_4x4[BLOCK_TYPES_4X4]; |
| 98 [COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES]; | 90 vp9_coeff_probs hybrid_coef_probs_4x4[BLOCK_TYPES_4X4]; |
| 99 vp9_prob hybrid_coef_probs[BLOCK_TYPES] | 91 vp9_coeff_probs coef_probs_8x8[BLOCK_TYPES_8X8]; |
| 100 [COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES]; | 92 vp9_coeff_probs hybrid_coef_probs_8x8[BLOCK_TYPES_8X8]; |
| 93 vp9_coeff_probs coef_probs_16x16[BLOCK_TYPES_16X16]; |
| 94 vp9_coeff_probs hybrid_coef_probs_16x16[BLOCK_TYPES_16X16]; |
| 95 vp9_coeff_probs coef_probs_32x32[BLOCK_TYPES_32X32]; |
| 101 | 96 |
| 102 vp9_prob coef_probs_8x8[BLOCK_TYPES_8X8] | |
| 103 [COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES]; | |
| 104 vp9_prob hybrid_coef_probs_8x8[BLOCK_TYPES_8X8] | |
| 105 [COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES]; | |
| 106 | |
| 107 vp9_prob coef_probs_16x16[BLOCK_TYPES_16X16] | |
| 108 [COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES]; | |
| 109 vp9_prob hybrid_coef_probs_16x16[BLOCK_TYPES_16X16] | |
| 110 [COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES]; | |
| 111 | |
| 112 #if CONFIG_SUPERBLOCKS | |
| 113 vp9_prob sb_ymode_prob[VP9_I32X32_MODES - 1]; | 97 vp9_prob sb_ymode_prob[VP9_I32X32_MODES - 1]; |
| 114 #endif | |
| 115 vp9_prob ymode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */ | 98 vp9_prob ymode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */ |
| 116 vp9_prob uv_mode_prob[VP9_YMODES][VP9_UV_MODES - 1]; | 99 vp9_prob uv_mode_prob[VP9_YMODES][VP9_UV_MODES - 1]; |
| 117 vp9_prob bmode_prob[VP9_NKF_BINTRAMODES - 1]; | 100 vp9_prob bmode_prob[VP9_NKF_BINTRAMODES - 1]; |
| 118 vp9_prob i8x8_mode_prob[VP9_I8X8_MODES - 1]; | 101 vp9_prob i8x8_mode_prob[VP9_I8X8_MODES - 1]; |
| 119 vp9_prob sub_mv_ref_prob[SUBMVREF_COUNT][VP9_SUBMVREFS - 1]; | 102 vp9_prob sub_mv_ref_prob[SUBMVREF_COUNT][VP9_SUBMVREFS - 1]; |
| 120 vp9_prob mbsplit_prob[VP9_NUMMBSPLITS - 1]; | 103 vp9_prob mbsplit_prob[VP9_NUMMBSPLITS - 1]; |
| 121 | 104 |
| 122 vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1] | 105 vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1] |
| 123 [VP9_SWITCHABLE_FILTERS - 1]; | 106 [VP9_SWITCHABLE_FILTERS - 1]; |
| 124 #if CONFIG_COMP_INTERINTRA_PRED | 107 #if CONFIG_COMP_INTERINTRA_PRED |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 int_mv mv; | 156 int_mv mv; |
| 174 MB_PREDICTION_MODE mode; | 157 MB_PREDICTION_MODE mode; |
| 175 } m; | 158 } m; |
| 176 } ref[MAX_REF_FRAMES]; | 159 } ref[MAX_REF_FRAMES]; |
| 177 } MBGRAPH_MB_STATS; | 160 } MBGRAPH_MB_STATS; |
| 178 | 161 |
| 179 typedef struct { | 162 typedef struct { |
| 180 MBGRAPH_MB_STATS *mb_stats; | 163 MBGRAPH_MB_STATS *mb_stats; |
| 181 } MBGRAPH_FRAME_STATS; | 164 } MBGRAPH_FRAME_STATS; |
| 182 | 165 |
| 183 #if CONFIG_PRED_FILTER | |
| 184 typedef enum { | 166 typedef enum { |
| 185 THR_ZEROMV, | 167 THR_ZEROMV, |
| 186 THR_ZEROMV_FILT, | |
| 187 THR_DC, | 168 THR_DC, |
| 188 | 169 |
| 189 THR_NEARESTMV, | 170 THR_NEARESTMV, |
| 190 THR_NEARESTMV_FILT, | |
| 191 THR_NEARMV, | 171 THR_NEARMV, |
| 192 THR_NEARMV_FILT, | |
| 193 | 172 |
| 194 THR_ZEROG, | 173 THR_ZEROG, |
| 195 THR_ZEROG_FILT, | |
| 196 THR_NEARESTG, | 174 THR_NEARESTG, |
| 197 THR_NEARESTG_FILT, | |
| 198 | 175 |
| 199 THR_ZEROA, | 176 THR_ZEROA, |
| 200 THR_ZEROA_FILT, | |
| 201 THR_NEARESTA, | 177 THR_NEARESTA, |
| 202 THR_NEARESTA_FILT, | |
| 203 | 178 |
| 204 THR_NEARG, | 179 THR_NEARG, |
| 205 THR_NEARG_FILT, | |
| 206 THR_NEARA, | 180 THR_NEARA, |
| 207 THR_NEARA_FILT, | |
| 208 | 181 |
| 209 THR_V_PRED, | 182 THR_V_PRED, |
| 210 THR_H_PRED, | 183 THR_H_PRED, |
| 211 THR_D45_PRED, | 184 THR_D45_PRED, |
| 212 THR_D135_PRED, | 185 THR_D135_PRED, |
| 213 THR_D117_PRED, | 186 THR_D117_PRED, |
| 214 THR_D153_PRED, | 187 THR_D153_PRED, |
| 215 THR_D27_PRED, | 188 THR_D27_PRED, |
| 216 THR_D63_PRED, | 189 THR_D63_PRED, |
| 217 THR_TM, | 190 THR_TM, |
| 218 | 191 |
| 219 THR_NEWMV, | 192 THR_NEWMV, |
| 220 THR_NEWMV_FILT, | |
| 221 THR_NEWG, | 193 THR_NEWG, |
| 222 THR_NEWG_FILT, | |
| 223 THR_NEWA, | 194 THR_NEWA, |
| 224 THR_NEWA_FILT, | |
| 225 | 195 |
| 226 THR_SPLITMV, | 196 THR_SPLITMV, |
| 227 THR_SPLITG, | 197 THR_SPLITG, |
| 228 THR_SPLITA, | 198 THR_SPLITA, |
| 229 | 199 |
| 230 THR_B_PRED, | 200 THR_B_PRED, |
| 231 THR_I8X8_PRED, | 201 THR_I8X8_PRED, |
| 232 | 202 |
| 233 THR_COMP_ZEROLG, | 203 THR_COMP_ZEROLG, |
| 234 THR_COMP_NEARESTLG, | 204 THR_COMP_NEARESTLG, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 260 THR_COMP_INTERINTRA_NEARG, | 230 THR_COMP_INTERINTRA_NEARG, |
| 261 THR_COMP_INTERINTRA_NEWG, | 231 THR_COMP_INTERINTRA_NEWG, |
| 262 | 232 |
| 263 THR_COMP_INTERINTRA_ZEROA, | 233 THR_COMP_INTERINTRA_ZEROA, |
| 264 THR_COMP_INTERINTRA_NEARESTA, | 234 THR_COMP_INTERINTRA_NEARESTA, |
| 265 THR_COMP_INTERINTRA_NEARA, | 235 THR_COMP_INTERINTRA_NEARA, |
| 266 THR_COMP_INTERINTRA_NEWA, | 236 THR_COMP_INTERINTRA_NEWA, |
| 267 #endif | 237 #endif |
| 268 } | 238 } |
| 269 THR_MODES; | 239 THR_MODES; |
| 270 #else | |
| 271 typedef enum { | |
| 272 THR_ZEROMV, | |
| 273 THR_DC, | |
| 274 | |
| 275 THR_NEARESTMV, | |
| 276 THR_NEARMV, | |
| 277 | |
| 278 THR_ZEROG, | |
| 279 THR_NEARESTG, | |
| 280 | |
| 281 THR_ZEROA, | |
| 282 THR_NEARESTA, | |
| 283 | |
| 284 THR_NEARG, | |
| 285 THR_NEARA, | |
| 286 | |
| 287 THR_V_PRED, | |
| 288 THR_H_PRED, | |
| 289 THR_D45_PRED, | |
| 290 THR_D135_PRED, | |
| 291 THR_D117_PRED, | |
| 292 THR_D153_PRED, | |
| 293 THR_D27_PRED, | |
| 294 THR_D63_PRED, | |
| 295 THR_TM, | |
| 296 | |
| 297 THR_NEWMV, | |
| 298 THR_NEWG, | |
| 299 THR_NEWA, | |
| 300 | |
| 301 THR_SPLITMV, | |
| 302 THR_SPLITG, | |
| 303 THR_SPLITA, | |
| 304 | |
| 305 THR_B_PRED, | |
| 306 THR_I8X8_PRED, | |
| 307 | |
| 308 THR_COMP_ZEROLG, | |
| 309 THR_COMP_NEARESTLG, | |
| 310 THR_COMP_NEARLG, | |
| 311 | |
| 312 THR_COMP_ZEROLA, | |
| 313 THR_COMP_NEARESTLA, | |
| 314 THR_COMP_NEARLA, | |
| 315 | |
| 316 THR_COMP_ZEROGA, | |
| 317 THR_COMP_NEARESTGA, | |
| 318 THR_COMP_NEARGA, | |
| 319 | |
| 320 THR_COMP_NEWLG, | |
| 321 THR_COMP_NEWLA, | |
| 322 THR_COMP_NEWGA, | |
| 323 | |
| 324 THR_COMP_SPLITLG, | |
| 325 THR_COMP_SPLITLA, | |
| 326 THR_COMP_SPLITGA, | |
| 327 #if CONFIG_COMP_INTERINTRA_PRED | |
| 328 THR_COMP_INTERINTRA_ZEROL, | |
| 329 THR_COMP_INTERINTRA_NEARESTL, | |
| 330 THR_COMP_INTERINTRA_NEARL, | |
| 331 THR_COMP_INTERINTRA_NEWL, | |
| 332 | |
| 333 THR_COMP_INTERINTRA_ZEROG, | |
| 334 THR_COMP_INTERINTRA_NEARESTG, | |
| 335 THR_COMP_INTERINTRA_NEARG, | |
| 336 THR_COMP_INTERINTRA_NEWG, | |
| 337 | |
| 338 THR_COMP_INTERINTRA_ZEROA, | |
| 339 THR_COMP_INTERINTRA_NEARESTA, | |
| 340 THR_COMP_INTERINTRA_NEARA, | |
| 341 THR_COMP_INTERINTRA_NEWA, | |
| 342 #endif | |
| 343 } | |
| 344 THR_MODES; | |
| 345 #endif | |
| 346 | 240 |
| 347 typedef enum { | 241 typedef enum { |
| 348 DIAMOND = 0, | 242 DIAMOND = 0, |
| 349 NSTEP = 1, | 243 NSTEP = 1, |
| 350 HEX = 2 | 244 HEX = 2 |
| 351 } SEARCH_METHODS; | 245 } SEARCH_METHODS; |
| 352 | 246 |
| 353 typedef struct { | 247 typedef struct { |
| 354 int RD; | 248 int RD; |
| 355 SEARCH_METHODS search_method; | 249 SEARCH_METHODS search_method; |
| 356 int improved_dct; | 250 int improved_dct; |
| 357 int auto_filter; | 251 int auto_filter; |
| 358 int recode_loop; | 252 int recode_loop; |
| 359 int iterative_sub_pixel; | 253 int iterative_sub_pixel; |
| 360 int half_pixel_search; | 254 int half_pixel_search; |
| 361 int quarter_pixel_search; | 255 int quarter_pixel_search; |
| 362 int thresh_mult[MAX_MODES]; | 256 int thresh_mult[MAX_MODES]; |
| 363 int max_step_search_steps; | 257 int max_step_search_steps; |
| 364 int first_step; | 258 int first_step; |
| 365 int optimize_coefficients; | 259 int optimize_coefficients; |
| 366 int no_skip_block4x4_search; | 260 int no_skip_block4x4_search; |
| 367 int improved_mv_pred; | |
| 368 int search_best_filter; | 261 int search_best_filter; |
| 369 | 262 |
| 370 } SPEED_FEATURES; | 263 } SPEED_FEATURES; |
| 371 | 264 |
| 372 typedef struct { | 265 typedef struct { |
| 373 MACROBLOCK mb; | 266 MACROBLOCK mb; |
| 374 int totalrate; | 267 int totalrate; |
| 375 } MB_ROW_COMP; | 268 } MB_ROW_COMP; |
| 376 | 269 |
| 377 typedef struct { | 270 typedef struct { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 390 } LPFTHREAD_DATA; | 283 } LPFTHREAD_DATA; |
| 391 | 284 |
| 392 enum BlockSize { | 285 enum BlockSize { |
| 393 BLOCK_16X8 = PARTITIONING_16X8, | 286 BLOCK_16X8 = PARTITIONING_16X8, |
| 394 BLOCK_8X16 = PARTITIONING_8X16, | 287 BLOCK_8X16 = PARTITIONING_8X16, |
| 395 BLOCK_8X8 = PARTITIONING_8X8, | 288 BLOCK_8X8 = PARTITIONING_8X8, |
| 396 BLOCK_4X4 = PARTITIONING_4X4, | 289 BLOCK_4X4 = PARTITIONING_4X4, |
| 397 BLOCK_16X16, | 290 BLOCK_16X16, |
| 398 BLOCK_MAX_SEGMENTS, | 291 BLOCK_MAX_SEGMENTS, |
| 399 BLOCK_32X32 = BLOCK_MAX_SEGMENTS, | 292 BLOCK_32X32 = BLOCK_MAX_SEGMENTS, |
| 293 BLOCK_64X64, |
| 400 BLOCK_MAX_SB_SEGMENTS, | 294 BLOCK_MAX_SB_SEGMENTS, |
| 401 }; | 295 }; |
| 402 | 296 |
| 403 typedef struct VP9_COMP { | 297 typedef struct VP9_COMP { |
| 404 | 298 |
| 405 DECLARE_ALIGNED(16, short, Y1quant[QINDEX_RANGE][16]); | 299 DECLARE_ALIGNED(16, short, Y1quant[QINDEX_RANGE][16]); |
| 406 DECLARE_ALIGNED(16, unsigned char, Y1quant_shift[QINDEX_RANGE][16]); | 300 DECLARE_ALIGNED(16, unsigned char, Y1quant_shift[QINDEX_RANGE][16]); |
| 407 DECLARE_ALIGNED(16, short, Y1zbin[QINDEX_RANGE][16]); | 301 DECLARE_ALIGNED(16, short, Y1zbin[QINDEX_RANGE][16]); |
| 408 DECLARE_ALIGNED(16, short, Y1round[QINDEX_RANGE][16]); | 302 DECLARE_ALIGNED(16, short, Y1round[QINDEX_RANGE][16]); |
| 409 | 303 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 428 DECLARE_ALIGNED(64, short, zrun_zbin_boost_y2_8x8[QINDEX_RANGE][64]); | 322 DECLARE_ALIGNED(64, short, zrun_zbin_boost_y2_8x8[QINDEX_RANGE][64]); |
| 429 DECLARE_ALIGNED(64, short, zrun_zbin_boost_uv_8x8[QINDEX_RANGE][64]); | 323 DECLARE_ALIGNED(64, short, zrun_zbin_boost_uv_8x8[QINDEX_RANGE][64]); |
| 430 | 324 |
| 431 DECLARE_ALIGNED(16, short, Y1zbin_16x16[QINDEX_RANGE][256]); | 325 DECLARE_ALIGNED(16, short, Y1zbin_16x16[QINDEX_RANGE][256]); |
| 432 DECLARE_ALIGNED(16, short, Y2zbin_16x16[QINDEX_RANGE][256]); | 326 DECLARE_ALIGNED(16, short, Y2zbin_16x16[QINDEX_RANGE][256]); |
| 433 DECLARE_ALIGNED(16, short, UVzbin_16x16[QINDEX_RANGE][256]); | 327 DECLARE_ALIGNED(16, short, UVzbin_16x16[QINDEX_RANGE][256]); |
| 434 DECLARE_ALIGNED(16, short, zrun_zbin_boost_y1_16x16[QINDEX_RANGE][256]); | 328 DECLARE_ALIGNED(16, short, zrun_zbin_boost_y1_16x16[QINDEX_RANGE][256]); |
| 435 DECLARE_ALIGNED(16, short, zrun_zbin_boost_y2_16x16[QINDEX_RANGE][256]); | 329 DECLARE_ALIGNED(16, short, zrun_zbin_boost_y2_16x16[QINDEX_RANGE][256]); |
| 436 DECLARE_ALIGNED(16, short, zrun_zbin_boost_uv_16x16[QINDEX_RANGE][256]); | 330 DECLARE_ALIGNED(16, short, zrun_zbin_boost_uv_16x16[QINDEX_RANGE][256]); |
| 437 | 331 |
| 332 DECLARE_ALIGNED(16, short, Y1zbin_32x32[QINDEX_RANGE][1024]); |
| 333 DECLARE_ALIGNED(16, short, Y2zbin_32x32[QINDEX_RANGE][1024]); |
| 334 DECLARE_ALIGNED(16, short, UVzbin_32x32[QINDEX_RANGE][1024]); |
| 335 DECLARE_ALIGNED(16, short, zrun_zbin_boost_y1_32x32[QINDEX_RANGE][1024]); |
| 336 DECLARE_ALIGNED(16, short, zrun_zbin_boost_y2_32x32[QINDEX_RANGE][1024]); |
| 337 DECLARE_ALIGNED(16, short, zrun_zbin_boost_uv_32x32[QINDEX_RANGE][1024]); |
| 338 |
| 438 MACROBLOCK mb; | 339 MACROBLOCK mb; |
| 439 VP9_COMMON common; | 340 VP9_COMMON common; |
| 440 VP9_CONFIG oxcf; | 341 VP9_CONFIG oxcf; |
| 441 | 342 |
| 442 struct lookahead_ctx *lookahead; | 343 struct lookahead_ctx *lookahead; |
| 443 struct lookahead_entry *source; | 344 struct lookahead_entry *source; |
| 444 struct lookahead_entry *alt_ref_source; | 345 struct lookahead_entry *alt_ref_source; |
| 445 | 346 |
| 446 YV12_BUFFER_CONFIG *Source; | 347 YV12_BUFFER_CONFIG *Source; |
| 447 YV12_BUFFER_CONFIG *un_scaled_source; | 348 YV12_BUFFER_CONFIG *un_scaled_source; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 476 unsigned int mode_chosen_counts[MAX_MODES]; | 377 unsigned int mode_chosen_counts[MAX_MODES]; |
| 477 | 378 |
| 478 int rd_thresh_mult[MAX_MODES]; | 379 int rd_thresh_mult[MAX_MODES]; |
| 479 int rd_baseline_thresh[MAX_MODES]; | 380 int rd_baseline_thresh[MAX_MODES]; |
| 480 int rd_threshes[MAX_MODES]; | 381 int rd_threshes[MAX_MODES]; |
| 481 int64_t rd_comp_pred_diff[NB_PREDICTION_TYPES]; | 382 int64_t rd_comp_pred_diff[NB_PREDICTION_TYPES]; |
| 482 int rd_prediction_type_threshes[4][NB_PREDICTION_TYPES]; | 383 int rd_prediction_type_threshes[4][NB_PREDICTION_TYPES]; |
| 483 int comp_pred_count[COMP_PRED_CONTEXTS]; | 384 int comp_pred_count[COMP_PRED_CONTEXTS]; |
| 484 int single_pred_count[COMP_PRED_CONTEXTS]; | 385 int single_pred_count[COMP_PRED_CONTEXTS]; |
| 485 // FIXME contextualize | 386 // FIXME contextualize |
| 486 int txfm_count[TX_SIZE_MAX]; | 387 int txfm_count_32x32p[TX_SIZE_MAX_SB]; |
| 487 int txfm_count_8x8p[TX_SIZE_MAX - 1]; | 388 int txfm_count_16x16p[TX_SIZE_MAX_MB]; |
| 389 int txfm_count_8x8p[TX_SIZE_MAX_MB - 1]; |
| 488 int64_t rd_tx_select_diff[NB_TXFM_MODES]; | 390 int64_t rd_tx_select_diff[NB_TXFM_MODES]; |
| 489 int rd_tx_select_threshes[4][NB_TXFM_MODES]; | 391 int rd_tx_select_threshes[4][NB_TXFM_MODES]; |
| 490 | 392 |
| 491 int RDMULT; | 393 int RDMULT; |
| 492 int RDDIV; | 394 int RDDIV; |
| 493 | 395 |
| 494 CODING_CONTEXT coding_context; | 396 CODING_CONTEXT coding_context; |
| 495 | 397 |
| 496 // Rate targetting variables | 398 // Rate targetting variables |
| 497 int64_t prediction_error; | 399 int64_t prediction_error; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 int64_t total_actual_bits; | 461 int64_t total_actual_bits; |
| 560 int total_target_vs_actual; // debug stats | 462 int total_target_vs_actual; // debug stats |
| 561 | 463 |
| 562 int worst_quality; | 464 int worst_quality; |
| 563 int active_worst_quality; | 465 int active_worst_quality; |
| 564 int best_quality; | 466 int best_quality; |
| 565 int active_best_quality; | 467 int active_best_quality; |
| 566 | 468 |
| 567 int cq_target_quality; | 469 int cq_target_quality; |
| 568 | 470 |
| 569 #if CONFIG_SUPERBLOCKS | 471 int sb32_count[2]; |
| 570 int sb_count; | 472 int sb64_count[2]; |
| 571 int sb_ymode_count [VP9_I32X32_MODES]; | 473 int sb_ymode_count [VP9_I32X32_MODES]; |
| 572 #endif | |
| 573 int ymode_count[VP9_YMODES]; /* intra MB type cts this frame */ | 474 int ymode_count[VP9_YMODES]; /* intra MB type cts this frame */ |
| 574 int bmode_count[VP9_NKF_BINTRAMODES]; | 475 int bmode_count[VP9_NKF_BINTRAMODES]; |
| 575 int i8x8_mode_count[VP9_I8X8_MODES]; | 476 int i8x8_mode_count[VP9_I8X8_MODES]; |
| 576 int sub_mv_ref_count[SUBMVREF_COUNT][VP9_SUBMVREFS]; | 477 int sub_mv_ref_count[SUBMVREF_COUNT][VP9_SUBMVREFS]; |
| 577 int mbsplit_count[VP9_NUMMBSPLITS]; | 478 int mbsplit_count[VP9_NUMMBSPLITS]; |
| 578 int y_uv_mode_count[VP9_YMODES][VP9_UV_MODES]; | 479 int y_uv_mode_count[VP9_YMODES][VP9_UV_MODES]; |
| 579 #if CONFIG_COMP_INTERINTRA_PRED | 480 #if CONFIG_COMP_INTERINTRA_PRED |
| 580 unsigned int interintra_count[2]; | 481 unsigned int interintra_count[2]; |
| 581 unsigned int interintra_select_count[2]; | 482 unsigned int interintra_select_count[2]; |
| 582 #endif | 483 #endif |
| 583 | 484 |
| 584 nmv_context_counts NMVcount; | 485 nmv_context_counts NMVcount; |
| 585 | 486 |
| 586 unsigned int coef_counts [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [MAX_
ENTROPY_TOKENS]; /* for this frame */ | 487 vp9_coeff_count coef_counts_4x4[BLOCK_TYPES_4X4]; |
| 587 vp9_prob frame_coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENT
ROPY_NODES]; | 488 vp9_coeff_probs frame_coef_probs_4x4[BLOCK_TYPES_4X4]; |
| 588 unsigned int frame_branch_ct [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [
ENTROPY_NODES][2]; | 489 vp9_coeff_stats frame_branch_ct_4x4[BLOCK_TYPES_4X4]; |
| 589 unsigned int hybrid_coef_counts [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS
] [MAX_ENTROPY_TOKENS]; /* for this frame */ | 490 vp9_coeff_count hybrid_coef_counts_4x4[BLOCK_TYPES_4X4]; |
| 590 vp9_prob frame_hybrid_coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXT
S] [ENTROPY_NODES]; | 491 vp9_coeff_probs frame_hybrid_coef_probs_4x4[BLOCK_TYPES_4X4]; |
| 591 unsigned int frame_hybrid_branch_ct [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONT
EXTS] [ENTROPY_NODES][2]; | 492 vp9_coeff_stats frame_hybrid_branch_ct_4x4[BLOCK_TYPES_4X4]; |
| 592 | 493 |
| 593 unsigned int coef_counts_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] [PREV_COEF_CONTEXT
S] [MAX_ENTROPY_TOKENS]; /* for this frame */ | 494 vp9_coeff_count coef_counts_8x8[BLOCK_TYPES_8X8]; |
| 594 vp9_prob frame_coef_probs_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] [PREV_COEF_CONTEX
TS] [ENTROPY_NODES]; | 495 vp9_coeff_probs frame_coef_probs_8x8[BLOCK_TYPES_8X8]; |
| 595 unsigned int frame_branch_ct_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] [PREV_COEF_CON
TEXTS] [ENTROPY_NODES][2]; | 496 vp9_coeff_stats frame_branch_ct_8x8[BLOCK_TYPES_8X8]; |
| 596 unsigned int hybrid_coef_counts_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] [PREV_COEF_
CONTEXTS] [MAX_ENTROPY_TOKENS]; /* for this frame */ | 497 vp9_coeff_count hybrid_coef_counts_8x8[BLOCK_TYPES_8X8]; |
| 597 vp9_prob frame_hybrid_coef_probs_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] [PREV_COEF
_CONTEXTS] [ENTROPY_NODES]; | 498 vp9_coeff_probs frame_hybrid_coef_probs_8x8[BLOCK_TYPES_8X8]; |
| 598 unsigned int frame_hybrid_branch_ct_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] [PREV_C
OEF_CONTEXTS] [ENTROPY_NODES][2]; | 499 vp9_coeff_stats frame_hybrid_branch_ct_8x8[BLOCK_TYPES_8X8]; |
| 599 | 500 |
| 600 unsigned int coef_counts_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS] [PREV_COEF_CON
TEXTS] [MAX_ENTROPY_TOKENS]; /* for this frame */ | 501 vp9_coeff_count coef_counts_16x16[BLOCK_TYPES_16X16]; |
| 601 vp9_prob frame_coef_probs_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS] [PREV_COEF_CO
NTEXTS] [ENTROPY_NODES]; | 502 vp9_coeff_probs frame_coef_probs_16x16[BLOCK_TYPES_16X16]; |
| 602 unsigned int frame_branch_ct_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS] [PREV_COEF
_CONTEXTS] [ENTROPY_NODES][2]; | 503 vp9_coeff_stats frame_branch_ct_16x16[BLOCK_TYPES_16X16]; |
| 603 unsigned int hybrid_coef_counts_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS] [PREV_C
OEF_CONTEXTS] [MAX_ENTROPY_TOKENS]; /* for this frame */ | 504 vp9_coeff_count hybrid_coef_counts_16x16[BLOCK_TYPES_16X16]; |
| 604 vp9_prob frame_hybrid_coef_probs_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS] [PREV_
COEF_CONTEXTS] [ENTROPY_NODES]; | 505 vp9_coeff_probs frame_hybrid_coef_probs_16x16[BLOCK_TYPES_16X16]; |
| 605 unsigned int frame_hybrid_branch_ct_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS] [PR
EV_COEF_CONTEXTS] [ENTROPY_NODES][2]; | 506 vp9_coeff_stats frame_hybrid_branch_ct_16x16[BLOCK_TYPES_16X16]; |
| 507 |
| 508 vp9_coeff_count coef_counts_32x32[BLOCK_TYPES_32X32]; |
| 509 vp9_coeff_probs frame_coef_probs_32x32[BLOCK_TYPES_32X32]; |
| 510 vp9_coeff_stats frame_branch_ct_32x32[BLOCK_TYPES_32X32]; |
| 606 | 511 |
| 607 int gfu_boost; | 512 int gfu_boost; |
| 608 int last_boost; | 513 int last_boost; |
| 609 int kf_boost; | 514 int kf_boost; |
| 610 int kf_zeromotion_pct; | 515 int kf_zeromotion_pct; |
| 611 | 516 |
| 612 int target_bandwidth; | 517 int target_bandwidth; |
| 613 struct vpx_codec_pkt_list *output_pkt_list; | 518 struct vpx_codec_pkt_list *output_pkt_list; |
| 614 | 519 |
| 615 #if 0 | 520 #if 0 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 /* force next frame to intra when kf_auto says so */ | 681 /* force next frame to intra when kf_auto says so */ |
| 777 int force_next_frame_intra; | 682 int force_next_frame_intra; |
| 778 | 683 |
| 779 int droppable; | 684 int droppable; |
| 780 | 685 |
| 781 // TODO Do we still need this?? | 686 // TODO Do we still need this?? |
| 782 int update_context; | 687 int update_context; |
| 783 | 688 |
| 784 int dummy_packing; /* flag to indicate if packing is dummy */ | 689 int dummy_packing; /* flag to indicate if packing is dummy */ |
| 785 | 690 |
| 786 #if CONFIG_PRED_FILTER | |
| 787 int pred_filter_on_count; | |
| 788 int pred_filter_off_count; | |
| 789 #endif | |
| 790 unsigned int switchable_interp_count[VP9_SWITCHABLE_FILTERS + 1] | 691 unsigned int switchable_interp_count[VP9_SWITCHABLE_FILTERS + 1] |
| 791 [VP9_SWITCHABLE_FILTERS]; | 692 [VP9_SWITCHABLE_FILTERS]; |
| 693 unsigned int best_switchable_interp_count[VP9_SWITCHABLE_FILTERS]; |
| 694 |
| 792 #if CONFIG_NEW_MVREF | 695 #if CONFIG_NEW_MVREF |
| 793 unsigned int best_ref_index_counts[MAX_REF_FRAMES][MAX_MV_REFS]; | 696 unsigned int mb_mv_ref_count[MAX_REF_FRAMES][MAX_MV_REF_CANDIDATES]; |
| 794 #endif | 697 #endif |
| 795 | 698 |
| 796 } VP9_COMP; | 699 } VP9_COMP; |
| 797 | 700 |
| 798 void vp9_encode_frame(VP9_COMP *cpi); | 701 void vp9_encode_frame(VP9_COMP *cpi); |
| 799 | 702 |
| 800 void vp9_pack_bitstream(VP9_COMP *cpi, unsigned char *dest, | 703 void vp9_pack_bitstream(VP9_COMP *cpi, unsigned char *dest, |
| 801 unsigned long *size); | 704 unsigned long *size); |
| 802 | 705 |
| 803 void vp9_activity_masking(VP9_COMP *cpi, MACROBLOCK *x); | 706 void vp9_activity_masking(VP9_COMP *cpi, MACROBLOCK *x); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 818 __FILE__,__LINE__);\ | 721 __FILE__,__LINE__);\ |
| 819 } while(0) | 722 } while(0) |
| 820 #else | 723 #else |
| 821 #define CHECK_MEM_ERROR(lval,expr) do {\ | 724 #define CHECK_MEM_ERROR(lval,expr) do {\ |
| 822 lval = (expr); \ | 725 lval = (expr); \ |
| 823 if(!lval) \ | 726 if(!lval) \ |
| 824 vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,\ | 727 vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,\ |
| 825 "Failed to allocate "#lval);\ | 728 "Failed to allocate "#lval);\ |
| 826 } while(0) | 729 } while(0) |
| 827 #endif | 730 #endif |
| 828 #endif // __INC_ONYX_INT_H | 731 |
| 732 #endif // VP9_ENCODER_VP9_ONYX_INT_H_ |
| OLD | NEW |