media/libvpx/vp8/encoder/block.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

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_BLOCK_H
michael@0 13 #define __INC_BLOCK_H
michael@0 14
michael@0 15 #include "vp8/common/onyx.h"
michael@0 16 #include "vp8/common/blockd.h"
michael@0 17 #include "vp8/common/entropymv.h"
michael@0 18 #include "vp8/common/entropy.h"
michael@0 19 #include "vpx_ports/mem.h"
michael@0 20
michael@0 21 #define MAX_MODES 20
michael@0 22 #define MAX_ERROR_BINS 1024
michael@0 23
michael@0 24 /* motion search site */
michael@0 25 typedef struct
michael@0 26 {
michael@0 27 MV mv;
michael@0 28 int offset;
michael@0 29 } search_site;
michael@0 30
michael@0 31 typedef struct block
michael@0 32 {
michael@0 33 /* 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries */
michael@0 34 short *src_diff;
michael@0 35 short *coeff;
michael@0 36
michael@0 37 /* 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries */
michael@0 38 short *quant;
michael@0 39 short *quant_fast;
michael@0 40 short *quant_shift;
michael@0 41 short *zbin;
michael@0 42 short *zrun_zbin_boost;
michael@0 43 short *round;
michael@0 44
michael@0 45 /* Zbin Over Quant value */
michael@0 46 short zbin_extra;
michael@0 47
michael@0 48 unsigned char **base_src;
michael@0 49 int src;
michael@0 50 int src_stride;
michael@0 51 } BLOCK;
michael@0 52
michael@0 53 typedef struct
michael@0 54 {
michael@0 55 int count;
michael@0 56 struct
michael@0 57 {
michael@0 58 B_PREDICTION_MODE mode;
michael@0 59 int_mv mv;
michael@0 60 } bmi[16];
michael@0 61 } PARTITION_INFO;
michael@0 62
michael@0 63 typedef struct macroblock
michael@0 64 {
michael@0 65 DECLARE_ALIGNED(16, short, src_diff[400]); /* 25 blocks Y,U,V,Y2 */
michael@0 66 DECLARE_ALIGNED(16, short, coeff[400]); /* 25 blocks Y,U,V,Y2 */
michael@0 67 DECLARE_ALIGNED(16, unsigned char, thismb[256]);
michael@0 68
michael@0 69 unsigned char *thismb_ptr;
michael@0 70 /* 16 Y, 4 U, 4 V, 1 DC 2nd order block */
michael@0 71 BLOCK block[25];
michael@0 72
michael@0 73 YV12_BUFFER_CONFIG src;
michael@0 74
michael@0 75 MACROBLOCKD e_mbd;
michael@0 76 PARTITION_INFO *partition_info; /* work pointer */
michael@0 77 PARTITION_INFO *pi; /* Corresponds to upper left visible macroblock */
michael@0 78 PARTITION_INFO *pip; /* Base of allocated array */
michael@0 79
michael@0 80 int ref_frame_cost[MAX_REF_FRAMES];
michael@0 81
michael@0 82 search_site *ss;
michael@0 83 int ss_count;
michael@0 84 int searches_per_step;
michael@0 85
michael@0 86 int errorperbit;
michael@0 87 int sadperbit16;
michael@0 88 int sadperbit4;
michael@0 89 int rddiv;
michael@0 90 int rdmult;
michael@0 91 unsigned int * mb_activity_ptr;
michael@0 92 int * mb_norm_activity_ptr;
michael@0 93 signed int act_zbin_adj;
michael@0 94 signed int last_act_zbin_adj;
michael@0 95
michael@0 96 int *mvcost[2];
michael@0 97 int *mvsadcost[2];
michael@0 98 int (*mbmode_cost)[MB_MODE_COUNT];
michael@0 99 int (*intra_uv_mode_cost)[MB_MODE_COUNT];
michael@0 100 int (*bmode_costs)[10][10];
michael@0 101 int *inter_bmode_costs;
michael@0 102 int (*token_costs)[COEF_BANDS][PREV_COEF_CONTEXTS]
michael@0 103 [MAX_ENTROPY_TOKENS];
michael@0 104
michael@0 105 /* These define limits to motion vector components to prevent
michael@0 106 * them from extending outside the UMV borders.
michael@0 107 */
michael@0 108 int mv_col_min;
michael@0 109 int mv_col_max;
michael@0 110 int mv_row_min;
michael@0 111 int mv_row_max;
michael@0 112
michael@0 113 int skip;
michael@0 114
michael@0 115 unsigned int encode_breakout;
michael@0 116
michael@0 117 signed char *gf_active_ptr;
michael@0 118
michael@0 119 unsigned char *active_ptr;
michael@0 120 MV_CONTEXT *mvc;
michael@0 121
michael@0 122 int optimize;
michael@0 123 int q_index;
michael@0 124
michael@0 125 #if CONFIG_TEMPORAL_DENOISING
michael@0 126 MB_PREDICTION_MODE best_sse_inter_mode;
michael@0 127 int_mv best_sse_mv;
michael@0 128 MV_REFERENCE_FRAME best_reference_frame;
michael@0 129 MV_REFERENCE_FRAME best_zeromv_reference_frame;
michael@0 130 unsigned char need_to_clamp_best_mvs;
michael@0 131 #endif
michael@0 132
michael@0 133 int skip_true_count;
michael@0 134 unsigned int coef_counts [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS];
michael@0 135 unsigned int MVcount [2] [MVvals]; /* (row,col) MV cts this frame */
michael@0 136 int ymode_count [VP8_YMODES]; /* intra MB type cts this frame */
michael@0 137 int uv_mode_count[VP8_UV_MODES]; /* intra MB type cts this frame */
michael@0 138 int64_t prediction_error;
michael@0 139 int64_t intra_error;
michael@0 140 int count_mb_ref_frame_usage[MAX_REF_FRAMES];
michael@0 141
michael@0 142 int rd_thresh_mult[MAX_MODES];
michael@0 143 int rd_threshes[MAX_MODES];
michael@0 144 unsigned int mbs_tested_so_far;
michael@0 145 unsigned int mode_test_hit_counts[MAX_MODES];
michael@0 146 int zbin_mode_boost_enabled;
michael@0 147 int zbin_mode_boost;
michael@0 148 int last_zbin_mode_boost;
michael@0 149
michael@0 150 int last_zbin_over_quant;
michael@0 151 int zbin_over_quant;
michael@0 152 int error_bins[MAX_ERROR_BINS];
michael@0 153
michael@0 154 void (*short_fdct4x4)(short *input, short *output, int pitch);
michael@0 155 void (*short_fdct8x4)(short *input, short *output, int pitch);
michael@0 156 void (*short_walsh4x4)(short *input, short *output, int pitch);
michael@0 157 void (*quantize_b)(BLOCK *b, BLOCKD *d);
michael@0 158 void (*quantize_b_pair)(BLOCK *b1, BLOCK *b2, BLOCKD *d0, BLOCKD *d1);
michael@0 159
michael@0 160 } MACROBLOCK;
michael@0 161
michael@0 162
michael@0 163 #endif

mercurial