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.

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

mercurial