2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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.
12 #ifndef __INC_ONYX_INT_H
13 #define __INC_ONYX_INT_H
16 #include "vpx_ports/config.h"
17 #include "vp9/common/vp9_onyx.h"
18 #include "vp9_treewriter.h"
19 #include "vp9_tokenize.h"
20 #include "vp9/common/vp9_onyxc_int.h"
21 #include "vp9_variance.h"
22 #include "vp9_encodemb.h"
23 #include "vp9_quantize.h"
24 #include "vp9/common/vp9_entropy.h"
25 #include "vp9/common/vp9_entropymode.h"
26 #include "vpx_ports/mem.h"
27 #include "vpx/internal/vpx_codec_internal.h"
28 #include "vp9_mcomp.h"
29 #include "vp9/common/vp9_findnearmv.h"
30 #include "vp9_lookahead.h"
32 // #define SPEEDSTATS 1
33 #define MIN_GF_INTERVAL 4
34 #define DEFAULT_GF_INTERVAL 7
36 #define KEY_FRAME_CONTEXT 5
38 #define MAX_LAG_BUFFERS 25
41 #define AF_THRESH2 100
42 #define ARF_DECAY_THRESH 12
44 #if CONFIG_PRED_FILTER
45 #if CONFIG_COMP_INTERINTRA_PRED
50 #else // CONFIG_PRED_FILTER
51 #if CONFIG_COMP_INTERINTRA_PRED
56 #endif // CONFIG_PRED_FILTER
58 #define MIN_THRESHMULT 32
59 #define MAX_THRESHMULT 512
61 #define GF_ZEROMV_ZBIN_BOOST 12
62 #define LF_ZEROMV_ZBIN_BOOST 6
63 #define MV_ZBIN_BOOST 4
64 #define ZBIN_OQ_MAX 192
66 #define VP9_TEMPORAL_ALT_REF 1
70 int nmvjointcost
[MV_JOINTS
];
71 int nmvcosts
[2][MV_VALS
];
72 int nmvcosts_hp
[2][MV_VALS
];
76 int y_modes
[VP9_YMODES
];
77 int uv_modes
[VP9_UV_MODES
];
78 int i8x8_modes
[VP9_I8X8_MODES
];
79 int b_modes
[B_MODE_COUNT
];
80 int inter_y_modes
[MB_MODE_COUNT
];
81 int inter_uv_modes
[VP9_UV_MODES
];
82 int inter_b_modes
[B_MODE_COUNT
];
85 vp9_prob segment_pred_probs
[PREDICTION_PROBS
];
86 unsigned char ref_pred_probs_update
[PREDICTION_PROBS
];
87 vp9_prob ref_pred_probs
[PREDICTION_PROBS
];
88 vp9_prob prob_comppred
[COMP_PRED_CONTEXTS
];
90 unsigned char *last_frame_seg_map_copy
;
92 // 0 = Intra, Last, GF, ARF
93 signed char last_ref_lf_deltas
[MAX_REF_LF_DELTAS
];
94 // 0 = BPRED, ZERO_MV, MV, SPLIT
95 signed char last_mode_lf_deltas
[MAX_MODE_LF_DELTAS
];
97 vp9_prob coef_probs
[BLOCK_TYPES
]
98 [COEF_BANDS
][PREV_COEF_CONTEXTS
][ENTROPY_NODES
];
99 vp9_prob hybrid_coef_probs
[BLOCK_TYPES
]
100 [COEF_BANDS
][PREV_COEF_CONTEXTS
][ENTROPY_NODES
];
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
];
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
];
112 #if CONFIG_SUPERBLOCKS
113 vp9_prob sb_ymode_prob
[VP9_I32X32_MODES
- 1];
115 vp9_prob ymode_prob
[VP9_YMODES
- 1]; /* interframe intra mode probs */
116 vp9_prob uv_mode_prob
[VP9_YMODES
][VP9_UV_MODES
- 1];
117 vp9_prob bmode_prob
[VP9_NKF_BINTRAMODES
- 1];
118 vp9_prob i8x8_mode_prob
[VP9_I8X8_MODES
- 1];
119 vp9_prob sub_mv_ref_prob
[SUBMVREF_COUNT
][VP9_SUBMVREFS
- 1];
120 vp9_prob mbsplit_prob
[VP9_NUMMBSPLITS
- 1];
122 vp9_prob switchable_interp_prob
[VP9_SWITCHABLE_FILTERS
+ 1]
123 [VP9_SWITCHABLE_FILTERS
- 1];
124 #if CONFIG_COMP_INTERINTRA_PRED
125 vp9_prob interintra_prob
;
128 int mv_ref_ct
[INTER_MODE_CONTEXTS
][4][2];
129 int vp9_mode_contexts
[INTER_MODE_CONTEXTS
][4];
137 double sr_coded_error
;
138 double ssim_weighted_pred_err
;
141 double pcnt_second_ref
;
149 double mv_in_out_count
;
158 double frame_intra_error
;
159 double frame_coded_error
;
160 double frame_pcnt_inter
;
161 double frame_pcnt_motion
;
163 double frame_mvr_abs
;
165 double frame_mvc_abs
;
167 } ONEPASS_FRAMESTATS
;
174 MB_PREDICTION_MODE mode
;
176 } ref
[MAX_REF_FRAMES
];
180 MBGRAPH_MB_STATS
*mb_stats
;
181 } MBGRAPH_FRAME_STATS
;
183 #if CONFIG_PRED_FILTER
252 #if CONFIG_COMP_INTERINTRA_PRED
253 THR_COMP_INTERINTRA_ZEROL
,
254 THR_COMP_INTERINTRA_NEARESTL
,
255 THR_COMP_INTERINTRA_NEARL
,
256 THR_COMP_INTERINTRA_NEWL
,
258 THR_COMP_INTERINTRA_ZEROG
,
259 THR_COMP_INTERINTRA_NEARESTG
,
260 THR_COMP_INTERINTRA_NEARG
,
261 THR_COMP_INTERINTRA_NEWG
,
263 THR_COMP_INTERINTRA_ZEROA
,
264 THR_COMP_INTERINTRA_NEARESTA
,
265 THR_COMP_INTERINTRA_NEARA
,
266 THR_COMP_INTERINTRA_NEWA
,
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
,
333 THR_COMP_INTERINTRA_ZEROG
,
334 THR_COMP_INTERINTRA_NEARESTG
,
335 THR_COMP_INTERINTRA_NEARG
,
336 THR_COMP_INTERINTRA_NEWG
,
338 THR_COMP_INTERINTRA_ZEROA
,
339 THR_COMP_INTERINTRA_NEARESTA
,
340 THR_COMP_INTERINTRA_NEARA
,
341 THR_COMP_INTERINTRA_NEWA
,
355 SEARCH_METHODS search_method
;
359 int iterative_sub_pixel
;
360 int half_pixel_search
;
361 int quarter_pixel_search
;
362 int thresh_mult
[MAX_MODES
];
363 int max_step_search_steps
;
365 int optimize_coefficients
;
366 int no_skip_block4x4_search
;
367 int improved_mv_pred
;
368 int search_best_filter
;
393 typedef struct VP9_ENCODER_RTCD
{
394 VP9_COMMON_RTCD
*common
;
398 BLOCK_16X8
= PARTITIONING_16X8
,
399 BLOCK_8X16
= PARTITIONING_8X16
,
400 BLOCK_8X8
= PARTITIONING_8X8
,
401 BLOCK_4X4
= PARTITIONING_4X4
,
404 BLOCK_32X32
= BLOCK_MAX_SEGMENTS
,
405 BLOCK_MAX_SB_SEGMENTS
,
408 typedef struct VP9_COMP
{
410 DECLARE_ALIGNED(16, short, Y1quant
[QINDEX_RANGE
][16]);
411 DECLARE_ALIGNED(16, unsigned char, Y1quant_shift
[QINDEX_RANGE
][16]);
412 DECLARE_ALIGNED(16, short, Y1zbin
[QINDEX_RANGE
][16]);
413 DECLARE_ALIGNED(16, short, Y1round
[QINDEX_RANGE
][16]);
415 DECLARE_ALIGNED(16, short, Y2quant
[QINDEX_RANGE
][16]);
416 DECLARE_ALIGNED(16, unsigned char, Y2quant_shift
[QINDEX_RANGE
][16]);
417 DECLARE_ALIGNED(16, short, Y2zbin
[QINDEX_RANGE
][16]);
418 DECLARE_ALIGNED(16, short, Y2round
[QINDEX_RANGE
][16]);
420 DECLARE_ALIGNED(16, short, UVquant
[QINDEX_RANGE
][16]);
421 DECLARE_ALIGNED(16, unsigned char, UVquant_shift
[QINDEX_RANGE
][16]);
422 DECLARE_ALIGNED(16, short, UVzbin
[QINDEX_RANGE
][16]);
423 DECLARE_ALIGNED(16, short, UVround
[QINDEX_RANGE
][16]);
425 DECLARE_ALIGNED(16, short, zrun_zbin_boost_y1
[QINDEX_RANGE
][16]);
426 DECLARE_ALIGNED(16, short, zrun_zbin_boost_y2
[QINDEX_RANGE
][16]);
427 DECLARE_ALIGNED(16, short, zrun_zbin_boost_uv
[QINDEX_RANGE
][16]);
429 DECLARE_ALIGNED(64, short, Y1zbin_8x8
[QINDEX_RANGE
][64]);
430 DECLARE_ALIGNED(64, short, Y2zbin_8x8
[QINDEX_RANGE
][64]);
431 DECLARE_ALIGNED(64, short, UVzbin_8x8
[QINDEX_RANGE
][64]);
432 DECLARE_ALIGNED(64, short, zrun_zbin_boost_y1_8x8
[QINDEX_RANGE
][64]);
433 DECLARE_ALIGNED(64, short, zrun_zbin_boost_y2_8x8
[QINDEX_RANGE
][64]);
434 DECLARE_ALIGNED(64, short, zrun_zbin_boost_uv_8x8
[QINDEX_RANGE
][64]);
436 DECLARE_ALIGNED(16, short, Y1zbin_16x16
[QINDEX_RANGE
][256]);
437 DECLARE_ALIGNED(16, short, Y2zbin_16x16
[QINDEX_RANGE
][256]);
438 DECLARE_ALIGNED(16, short, UVzbin_16x16
[QINDEX_RANGE
][256]);
439 DECLARE_ALIGNED(16, short, zrun_zbin_boost_y1_16x16
[QINDEX_RANGE
][256]);
440 DECLARE_ALIGNED(16, short, zrun_zbin_boost_y2_16x16
[QINDEX_RANGE
][256]);
441 DECLARE_ALIGNED(16, short, zrun_zbin_boost_uv_16x16
[QINDEX_RANGE
][256]);
447 struct lookahead_ctx
*lookahead
;
448 struct lookahead_entry
*source
;
449 struct lookahead_entry
*alt_ref_source
;
451 YV12_BUFFER_CONFIG
*Source
;
452 YV12_BUFFER_CONFIG
*un_scaled_source
;
453 YV12_BUFFER_CONFIG scaled_source
;
455 int source_alt_ref_pending
; // frame in src_buffers has been identified to be encoded as an alt ref
456 int source_alt_ref_active
; // an alt ref frame has been encoded and is usable
458 int is_src_frame_alt_ref
; // source of frame to encode is an exact copy of an alt ref frame
460 int gold_is_last
; // golden frame same as last frame ( short circuit gold searches)
461 int alt_is_last
; // Alt reference frame same as last ( short circuit altref search)
462 int gold_is_alt
; // don't do both alt and gold search ( just do gold).
464 // int refresh_alt_ref_frame;
465 YV12_BUFFER_CONFIG last_frame_uf
;
468 unsigned int tok_count
;
471 unsigned int frames_since_key
;
472 unsigned int key_frame_frequency
;
473 unsigned int this_key_frame_forced
;
474 unsigned int next_key_frame_forced
;
476 // Ambient reconstruction err target for force key frames
479 unsigned int mode_check_freq
[MAX_MODES
];
480 unsigned int mode_test_hit_counts
[MAX_MODES
];
481 unsigned int mode_chosen_counts
[MAX_MODES
];
483 int rd_thresh_mult
[MAX_MODES
];
484 int rd_baseline_thresh
[MAX_MODES
];
485 int rd_threshes
[MAX_MODES
];
486 int64_t rd_comp_pred_diff
[NB_PREDICTION_TYPES
];
487 int rd_prediction_type_threshes
[4][NB_PREDICTION_TYPES
];
488 int comp_pred_count
[COMP_PRED_CONTEXTS
];
489 int single_pred_count
[COMP_PRED_CONTEXTS
];
490 // FIXME contextualize
491 int txfm_count
[TX_SIZE_MAX
];
492 int txfm_count_8x8p
[TX_SIZE_MAX
- 1];
493 int64_t rd_tx_select_diff
[NB_TXFM_MODES
];
494 int rd_tx_select_threshes
[4][NB_TXFM_MODES
];
499 CODING_CONTEXT coding_context
;
501 // Rate targetting variables
502 int64_t prediction_error
;
503 int64_t last_prediction_error
;
505 int64_t last_intra_error
;
507 int this_frame_target
;
508 int projected_frame_size
;
509 int last_q
[2]; // Separate values for Intra/Inter
510 int last_boosted_qindex
; // Last boosted GF/KF/ARF q
512 double rate_correction_factor
;
513 double key_frame_rate_correction_factor
;
514 double gf_rate_correction_factor
;
516 int frames_till_gf_update_due
; // Count down till next GF
517 int current_gf_interval
; // GF interval chosen when we coded the last GF
519 int gf_overspend_bits
; // Total bits overspent becasue of GF boost (cumulative)
521 int non_gf_bitrate_adjustment
; // Used in the few frames following a GF to recover the extra bits spent in that GF
523 int kf_overspend_bits
; // Extra bits spent on key frames that need to be recovered on inter frames
524 int kf_bitrate_adjustment
; // Current number of bit s to try and recover on each inter frame.
526 int baseline_gf_interval
;
527 int active_arnr_frames
; // <= cpi->oxcf.arnr_max_frames
529 int64_t key_frame_count
;
530 int prior_key_frame_distance
[KEY_FRAME_CONTEXT
];
531 int per_frame_bandwidth
; // Current section per frame bandwidth target
532 int av_per_frame_bandwidth
; // Average frame size target for clip
533 int min_frame_bandwidth
; // Minimum allocation that should be used for any frame
534 int inter_frame_target
;
535 double output_frame_rate
;
536 int64_t last_time_stamp_seen
;
537 int64_t last_end_time_stamp_seen
;
538 int64_t first_time_stamp_ever
;
543 int avg_frame_qindex
;
549 int zbin_mode_boost_enabled
;
551 int64_t total_byte_count
;
558 int rolling_target_bits
;
559 int rolling_actual_bits
;
561 int long_rolling_target_bits
;
562 int long_rolling_actual_bits
;
564 int64_t total_actual_bits
;
565 int total_target_vs_actual
; // debug stats
568 int active_worst_quality
;
570 int active_best_quality
;
572 int cq_target_quality
;
574 #if CONFIG_SUPERBLOCKS
576 int sb_ymode_count
[VP9_I32X32_MODES
];
578 int ymode_count
[VP9_YMODES
]; /* intra MB type cts this frame */
579 int bmode_count
[VP9_NKF_BINTRAMODES
];
580 int i8x8_mode_count
[VP9_I8X8_MODES
];
581 int sub_mv_ref_count
[SUBMVREF_COUNT
][VP9_SUBMVREFS
];
582 int mbsplit_count
[VP9_NUMMBSPLITS
];
583 int y_uv_mode_count
[VP9_YMODES
][VP9_UV_MODES
];
584 #if CONFIG_COMP_INTERINTRA_PRED
585 int interintra_count
[2];
586 int interintra_select_count
[2];
589 nmv_context_counts NMVcount
;
591 unsigned int coef_counts
[BLOCK_TYPES
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [MAX_ENTROPY_TOKENS
]; /* for this frame */
592 vp9_prob frame_coef_probs
[BLOCK_TYPES
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [ENTROPY_NODES
];
593 unsigned int frame_branch_ct
[BLOCK_TYPES
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [ENTROPY_NODES
][2];
594 unsigned int hybrid_coef_counts
[BLOCK_TYPES
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [MAX_ENTROPY_TOKENS
]; /* for this frame */
595 vp9_prob frame_hybrid_coef_probs
[BLOCK_TYPES
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [ENTROPY_NODES
];
596 unsigned int frame_hybrid_branch_ct
[BLOCK_TYPES
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [ENTROPY_NODES
][2];
598 unsigned int coef_counts_8x8
[BLOCK_TYPES_8X8
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [MAX_ENTROPY_TOKENS
]; /* for this frame */
599 vp9_prob frame_coef_probs_8x8
[BLOCK_TYPES_8X8
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [ENTROPY_NODES
];
600 unsigned int frame_branch_ct_8x8
[BLOCK_TYPES_8X8
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [ENTROPY_NODES
][2];
601 unsigned int hybrid_coef_counts_8x8
[BLOCK_TYPES_8X8
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [MAX_ENTROPY_TOKENS
]; /* for this frame */
602 vp9_prob frame_hybrid_coef_probs_8x8
[BLOCK_TYPES_8X8
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [ENTROPY_NODES
];
603 unsigned int frame_hybrid_branch_ct_8x8
[BLOCK_TYPES_8X8
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [ENTROPY_NODES
][2];
605 unsigned int coef_counts_16x16
[BLOCK_TYPES_16X16
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [MAX_ENTROPY_TOKENS
]; /* for this frame */
606 vp9_prob frame_coef_probs_16x16
[BLOCK_TYPES_16X16
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [ENTROPY_NODES
];
607 unsigned int frame_branch_ct_16x16
[BLOCK_TYPES_16X16
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [ENTROPY_NODES
][2];
608 unsigned int hybrid_coef_counts_16x16
[BLOCK_TYPES_16X16
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [MAX_ENTROPY_TOKENS
]; /* for this frame */
609 vp9_prob frame_hybrid_coef_probs_16x16
[BLOCK_TYPES_16X16
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [ENTROPY_NODES
];
610 unsigned int frame_hybrid_branch_ct_16x16
[BLOCK_TYPES_16X16
] [COEF_BANDS
] [PREV_COEF_CONTEXTS
] [ENTROPY_NODES
][2];
615 int kf_zeromotion_pct
;
617 int target_bandwidth
;
618 struct vpx_codec_pkt_list
*output_pkt_list
;
621 // Experimental code for lagged and one pass
622 ONEPASS_FRAMESTATS one_pass_frame_stats
[MAX_LAG_BUFFERS
];
623 int one_pass_frame_index
;
625 MBGRAPH_FRAME_STATS mbgraph_stats
[MAX_LAG_BUFFERS
];
626 int mbgraph_n_frames
; // number of frames filled in the above
627 int static_mb_pct
; // % forced skip mbs by segmentation
628 int seg0_progress
, seg0_idx
, seg0_cnt
;
629 int ref_pred_count
[3][2];
631 int decimation_factor
;
632 int decimation_count
;
634 // for real time encoding
635 int avg_encode_time
; // microsecond
636 int avg_pick_mode_time
; // microsecond
638 unsigned int cpu_freq
; // Mhz
639 int compressor_speed
;
649 vp9_prob last_skip_false_probs
[3][MBSKIP_CONTEXTS
];
650 int last_skip_probs_q
[3];
652 int recent_ref_frame_usage
[MAX_REF_FRAMES
];
653 int count_mb_ref_frame_usage
[MAX_REF_FRAMES
];
656 unsigned char ref_pred_probs_update
[PREDICTION_PROBS
];
659 int error_bins
[1024];
661 // Data used for real time conferencing mode to help determine if it would be good to update the gf
664 int gf_update_recommended
;
665 int skip_true_count
[3];
666 int skip_false_count
[3];
668 unsigned char *segmentation_map
;
670 // segment threashold for encode breakout
671 int segment_encode_breakout
[MAX_MB_SEGMENTS
];
673 unsigned char *active_map
;
674 unsigned int active_map_enabled
;
678 fractional_mv_step_fp
*find_fractional_mv_step
;
679 vp9_full_search_fn_t full_search_sad
;
680 vp9_refining_search_fn_t refining_search_sad
;
681 vp9_diamond_search_fn_t diamond_search_sad
;
682 vp9_variance_fn_ptr_t fn_ptr
[BLOCK_MAX_SB_SEGMENTS
];
683 uint64_t time_receive_data
;
684 uint64_t time_compress_data
;
685 uint64_t time_pick_lpf
;
686 uint64_t time_encode_mb_row
;
688 int base_skip_false_prob
[QINDEX_RANGE
][3];
691 unsigned int section_intra_rating
;
692 unsigned int next_iiratio
;
693 unsigned int this_iiratio
;
694 FIRSTPASS_STATS
*total_stats
;
695 FIRSTPASS_STATS
*this_frame_stats
;
696 FIRSTPASS_STATS
*stats_in
, *stats_in_end
, *stats_in_start
;
697 FIRSTPASS_STATS
*total_left_stats
;
700 int64_t clip_bits_total
;
702 double modified_error_total
;
703 double modified_error_used
;
704 double modified_error_left
;
705 double kf_intra_err_min
;
706 double gf_intra_err_min
;
710 int static_scene_max_gf_interval
;
712 // Remaining error from uncoded frames in a gf group. Two pass use only
713 int64_t gf_group_error_left
;
715 // Projected total bits available for a key frame group of frames
716 int64_t kf_group_bits
;
718 // Error score of frames still to be coded in kf group
719 int64_t kf_group_error_left
;
721 // Projected Bits available for a group of frames including 1 GF or ARF
722 int64_t gf_group_bits
;
723 // Bits for the golden frame or ARF - 2 pass only
728 double est_max_qcorrection_factor
;
731 #if CONFIG_RUNTIME_CPU_DETECT
732 VP9_ENCODER_RTCD rtcd
;
734 #if VP9_TEMPORAL_ALT_REF
735 YV12_BUFFER_CONFIG alt_ref_buffer
;
736 YV12_BUFFER_CONFIG
*frames
[MAX_LAG_BUFFERS
];
737 int fixed_divide
[512];
740 #if CONFIG_INTERNAL_STATS
746 double total_sq_error
;
751 double total_sq_error2
;
753 double summed_quality
;
754 double summed_weights
;
755 unsigned int tot_recode_hits
;
758 double total_ssimg_y
;
759 double total_ssimg_u
;
760 double total_ssimg_v
;
761 double total_ssimg_all
;
763 int b_calculate_ssimg
;
765 int b_calculate_psnr
;
767 // Per MB activity measurement
768 unsigned int activity_avg
;
769 unsigned int *mb_activity_map
;
770 int *mb_norm_activity_map
;
772 // Record of which MBs still refer to last golden frame either
773 // directly or through 0,0
774 unsigned char *gf_active_flags
;
777 int output_partition
;
779 // Store last frame's MV info for next frame MV prediction
781 int *lf_ref_frame_sign_bias
;
784 /* force next frame to intra when kf_auto says so */
785 int force_next_frame_intra
;
789 // TODO Do we still need this??
792 int dummy_packing
; /* flag to indicate if packing is dummy */
794 #if CONFIG_PRED_FILTER
795 int pred_filter_on_count
;
796 int pred_filter_off_count
;
798 unsigned int switchable_interp_count
[VP9_SWITCHABLE_FILTERS
+ 1]
799 [VP9_SWITCHABLE_FILTERS
];
801 unsigned int best_ref_index_counts
[MAX_REF_FRAMES
][MAX_MV_REFS
];
806 void vp9_encode_frame(VP9_COMP
*cpi
);
808 void vp9_pack_bitstream(VP9_COMP
*cpi
, unsigned char *dest
,
809 unsigned long *size
);
811 void vp9_activity_masking(VP9_COMP
*cpi
, MACROBLOCK
*x
);
813 void vp9_set_speed_features(VP9_COMP
*cpi
);
815 extern int vp9_calc_ss_err(YV12_BUFFER_CONFIG
*source
,
816 YV12_BUFFER_CONFIG
*dest
);
818 extern void vp9_alloc_compressor_data(VP9_COMP
*cpi
);
821 #define CHECK_MEM_ERROR(lval,expr) do {\
824 vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,\
825 "Failed to allocate "#lval" at %s:%d", \
829 #define CHECK_MEM_ERROR(lval,expr) do {\
832 vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,\
833 "Failed to allocate "#lval);\
836 #endif // __INC_ONYX_INT_H