Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license |
michael@0 | 5 | * that can be found in the LICENSE file in the root of the source |
michael@0 | 6 | * tree. An additional intellectual property rights grant can be found |
michael@0 | 7 | * in the file PATENTS. All contributing project authors may |
michael@0 | 8 | * be found in the AUTHORS file in the root of the source tree. |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | |
michael@0 | 12 | #ifndef VP9_ENCODER_VP9_MCOMP_H_ |
michael@0 | 13 | #define VP9_ENCODER_VP9_MCOMP_H_ |
michael@0 | 14 | |
michael@0 | 15 | #include "vp9/encoder/vp9_block.h" |
michael@0 | 16 | #include "vp9/encoder/vp9_variance.h" |
michael@0 | 17 | |
michael@0 | 18 | // The maximum number of steps in a step search given the largest |
michael@0 | 19 | // allowed initial step |
michael@0 | 20 | #define MAX_MVSEARCH_STEPS 11 |
michael@0 | 21 | // Max full pel mv specified in 1 pel units |
michael@0 | 22 | #define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS)) - 1) |
michael@0 | 23 | // Maximum size of the first step in full pel units |
michael@0 | 24 | #define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1)) |
michael@0 | 25 | // Allowed motion vector pixel distance outside image border |
michael@0 | 26 | // for Block_16x16 |
michael@0 | 27 | #define BORDER_MV_PIXELS_B16 (16 + VP9_INTERP_EXTEND) |
michael@0 | 28 | |
michael@0 | 29 | |
michael@0 | 30 | void vp9_clamp_mv_min_max(MACROBLOCK *x, MV *mv); |
michael@0 | 31 | int vp9_mv_bit_cost(const MV *mv, const MV *ref, |
michael@0 | 32 | const int *mvjcost, int *mvcost[2], int weight); |
michael@0 | 33 | void vp9_init_dsmotion_compensation(MACROBLOCK *x, int stride); |
michael@0 | 34 | void vp9_init3smotion_compensation(MACROBLOCK *x, int stride); |
michael@0 | 35 | |
michael@0 | 36 | struct VP9_COMP; |
michael@0 | 37 | int vp9_init_search_range(struct VP9_COMP *cpi, int size); |
michael@0 | 38 | |
michael@0 | 39 | // Runs sequence of diamond searches in smaller steps for RD |
michael@0 | 40 | int vp9_full_pixel_diamond(struct VP9_COMP *cpi, MACROBLOCK *x, |
michael@0 | 41 | int_mv *mvp_full, int step_param, |
michael@0 | 42 | int sadpb, int further_steps, int do_refine, |
michael@0 | 43 | vp9_variance_fn_ptr_t *fn_ptr, |
michael@0 | 44 | int_mv *ref_mv, int_mv *dst_mv); |
michael@0 | 45 | |
michael@0 | 46 | int vp9_hex_search(MACROBLOCK *x, |
michael@0 | 47 | MV *ref_mv, |
michael@0 | 48 | int search_param, |
michael@0 | 49 | int error_per_bit, |
michael@0 | 50 | int do_init_search, |
michael@0 | 51 | const vp9_variance_fn_ptr_t *vf, |
michael@0 | 52 | int use_mvcost, |
michael@0 | 53 | const MV *center_mv, |
michael@0 | 54 | MV *best_mv); |
michael@0 | 55 | int vp9_bigdia_search(MACROBLOCK *x, |
michael@0 | 56 | MV *ref_mv, |
michael@0 | 57 | int search_param, |
michael@0 | 58 | int error_per_bit, |
michael@0 | 59 | int do_init_search, |
michael@0 | 60 | const vp9_variance_fn_ptr_t *vf, |
michael@0 | 61 | int use_mvcost, |
michael@0 | 62 | const MV *center_mv, |
michael@0 | 63 | MV *best_mv); |
michael@0 | 64 | int vp9_square_search(MACROBLOCK *x, |
michael@0 | 65 | MV *ref_mv, |
michael@0 | 66 | int search_param, |
michael@0 | 67 | int error_per_bit, |
michael@0 | 68 | int do_init_search, |
michael@0 | 69 | const vp9_variance_fn_ptr_t *vf, |
michael@0 | 70 | int use_mvcost, |
michael@0 | 71 | const MV *center_mv, |
michael@0 | 72 | MV *best_mv); |
michael@0 | 73 | |
michael@0 | 74 | typedef int (fractional_mv_step_fp) ( |
michael@0 | 75 | MACROBLOCK *x, |
michael@0 | 76 | MV *bestmv, const MV *ref_mv, |
michael@0 | 77 | int allow_hp, |
michael@0 | 78 | int error_per_bit, |
michael@0 | 79 | const vp9_variance_fn_ptr_t *vfp, |
michael@0 | 80 | int forced_stop, // 0 - full, 1 - qtr only, 2 - half only |
michael@0 | 81 | int iters_per_step, |
michael@0 | 82 | int *mvjcost, |
michael@0 | 83 | int *mvcost[2], |
michael@0 | 84 | int *distortion, |
michael@0 | 85 | unsigned int *sse); |
michael@0 | 86 | extern fractional_mv_step_fp vp9_find_best_sub_pixel_iterative; |
michael@0 | 87 | extern fractional_mv_step_fp vp9_find_best_sub_pixel_tree; |
michael@0 | 88 | |
michael@0 | 89 | typedef int (fractional_mv_step_comp_fp) ( |
michael@0 | 90 | MACROBLOCK *x, |
michael@0 | 91 | MV *bestmv, const MV *ref_mv, |
michael@0 | 92 | int allow_hp, |
michael@0 | 93 | int error_per_bit, |
michael@0 | 94 | const vp9_variance_fn_ptr_t *vfp, |
michael@0 | 95 | int forced_stop, // 0 - full, 1 - qtr only, 2 - half only |
michael@0 | 96 | int iters_per_step, |
michael@0 | 97 | int *mvjcost, int *mvcost[2], |
michael@0 | 98 | int *distortion, unsigned int *sse1, |
michael@0 | 99 | const uint8_t *second_pred, |
michael@0 | 100 | int w, int h); |
michael@0 | 101 | extern fractional_mv_step_comp_fp vp9_find_best_sub_pixel_comp_iterative; |
michael@0 | 102 | extern fractional_mv_step_comp_fp vp9_find_best_sub_pixel_comp_tree; |
michael@0 | 103 | |
michael@0 | 104 | typedef int (*vp9_full_search_fn_t)(MACROBLOCK *x, |
michael@0 | 105 | int_mv *ref_mv, int sad_per_bit, |
michael@0 | 106 | int distance, vp9_variance_fn_ptr_t *fn_ptr, |
michael@0 | 107 | int *mvjcost, int *mvcost[2], |
michael@0 | 108 | int_mv *center_mv, int n); |
michael@0 | 109 | |
michael@0 | 110 | typedef int (*vp9_refining_search_fn_t)(MACROBLOCK *x, |
michael@0 | 111 | int_mv *ref_mv, int sad_per_bit, |
michael@0 | 112 | int distance, |
michael@0 | 113 | vp9_variance_fn_ptr_t *fn_ptr, |
michael@0 | 114 | int *mvjcost, int *mvcost[2], |
michael@0 | 115 | int_mv *center_mv); |
michael@0 | 116 | |
michael@0 | 117 | typedef int (*vp9_diamond_search_fn_t)(MACROBLOCK *x, |
michael@0 | 118 | int_mv *ref_mv, int_mv *best_mv, |
michael@0 | 119 | int search_param, int sad_per_bit, |
michael@0 | 120 | int *num00, |
michael@0 | 121 | vp9_variance_fn_ptr_t *fn_ptr, |
michael@0 | 122 | int *mvjcost, int *mvcost[2], |
michael@0 | 123 | int_mv *center_mv); |
michael@0 | 124 | |
michael@0 | 125 | int vp9_refining_search_8p_c(MACROBLOCK *x, |
michael@0 | 126 | int_mv *ref_mv, int error_per_bit, |
michael@0 | 127 | int search_range, vp9_variance_fn_ptr_t *fn_ptr, |
michael@0 | 128 | int *mvjcost, int *mvcost[2], |
michael@0 | 129 | int_mv *center_mv, const uint8_t *second_pred, |
michael@0 | 130 | int w, int h); |
michael@0 | 131 | #endif // VP9_ENCODER_VP9_MCOMP_H_ |