media/libvpx/vp8/common/idct_blk.c

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 #include "vpx_config.h"
michael@0 12 #include "vp8_rtcd.h"
michael@0 13 #include "vpx_mem/vpx_mem.h"
michael@0 14
michael@0 15 void vp8_dequant_idct_add_c(short *input, short *dq,
michael@0 16 unsigned char *dest, int stride);
michael@0 17 void vp8_dc_only_idct_add_c(short input_dc, unsigned char * pred,
michael@0 18 int pred_stride, unsigned char *dst_ptr,
michael@0 19 int dst_stride);
michael@0 20
michael@0 21 void vp8_dequant_idct_add_y_block_c
michael@0 22 (short *q, short *dq,
michael@0 23 unsigned char *dst, int stride, char *eobs)
michael@0 24 {
michael@0 25 int i, j;
michael@0 26
michael@0 27 for (i = 0; i < 4; i++)
michael@0 28 {
michael@0 29 for (j = 0; j < 4; j++)
michael@0 30 {
michael@0 31 if (*eobs++ > 1)
michael@0 32 vp8_dequant_idct_add_c (q, dq, dst, stride);
michael@0 33 else
michael@0 34 {
michael@0 35 vp8_dc_only_idct_add_c (q[0]*dq[0], dst, stride, dst, stride);
michael@0 36 vpx_memset(q, 0, 2 * sizeof(q[0]));
michael@0 37 }
michael@0 38
michael@0 39 q += 16;
michael@0 40 dst += 4;
michael@0 41 }
michael@0 42
michael@0 43 dst += 4*stride - 16;
michael@0 44 }
michael@0 45 }
michael@0 46
michael@0 47 void vp8_dequant_idct_add_uv_block_c
michael@0 48 (short *q, short *dq,
michael@0 49 unsigned char *dstu, unsigned char *dstv, int stride, char *eobs)
michael@0 50 {
michael@0 51 int i, j;
michael@0 52
michael@0 53 for (i = 0; i < 2; i++)
michael@0 54 {
michael@0 55 for (j = 0; j < 2; j++)
michael@0 56 {
michael@0 57 if (*eobs++ > 1)
michael@0 58 vp8_dequant_idct_add_c (q, dq, dstu, stride);
michael@0 59 else
michael@0 60 {
michael@0 61 vp8_dc_only_idct_add_c (q[0]*dq[0], dstu, stride, dstu, stride);
michael@0 62 vpx_memset(q, 0, 2 * sizeof(q[0]));
michael@0 63 }
michael@0 64
michael@0 65 q += 16;
michael@0 66 dstu += 4;
michael@0 67 }
michael@0 68
michael@0 69 dstu += 4*stride - 8;
michael@0 70 }
michael@0 71
michael@0 72 for (i = 0; i < 2; i++)
michael@0 73 {
michael@0 74 for (j = 0; j < 2; j++)
michael@0 75 {
michael@0 76 if (*eobs++ > 1)
michael@0 77 vp8_dequant_idct_add_c (q, dq, dstv, stride);
michael@0 78 else
michael@0 79 {
michael@0 80 vp8_dc_only_idct_add_c (q[0]*dq[0], dstv, stride, dstv, stride);
michael@0 81 vpx_memset(q, 0, 2 * sizeof(q[0]));
michael@0 82 }
michael@0 83
michael@0 84 q += 16;
michael@0 85 dstv += 4;
michael@0 86 }
michael@0 87
michael@0 88 dstv += 4*stride - 8;
michael@0 89 }
michael@0 90 }

mercurial