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