media/libvpx/vp8/encoder/x86/vp8_enc_stubs_mmx.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
michael@0 12 #include "vpx_config.h"
michael@0 13 #include "vp8_rtcd.h"
michael@0 14 #include "vpx_ports/x86.h"
michael@0 15 #include "vp8/encoder/block.h"
michael@0 16
michael@0 17 void vp8_short_fdct4x4_mmx(short *input, short *output, int pitch);
michael@0 18 void vp8_short_fdct8x4_mmx(short *input, short *output, int pitch)
michael@0 19 {
michael@0 20 vp8_short_fdct4x4_mmx(input, output, pitch);
michael@0 21 vp8_short_fdct4x4_mmx(input + 4, output + 16, pitch);
michael@0 22 }
michael@0 23
michael@0 24 int vp8_fast_quantize_b_impl_mmx(short *coeff_ptr, short *zbin_ptr,
michael@0 25 short *qcoeff_ptr, short *dequant_ptr,
michael@0 26 const short *scan_mask, short *round_ptr,
michael@0 27 short *quant_ptr, short *dqcoeff_ptr);
michael@0 28 void vp8_fast_quantize_b_mmx(BLOCK *b, BLOCKD *d)
michael@0 29 {
michael@0 30 const short *scan_mask = vp8_default_zig_zag_mask;
michael@0 31 short *coeff_ptr = b->coeff;
michael@0 32 short *zbin_ptr = b->zbin;
michael@0 33 short *round_ptr = b->round;
michael@0 34 short *quant_ptr = b->quant_fast;
michael@0 35 short *qcoeff_ptr = d->qcoeff;
michael@0 36 short *dqcoeff_ptr = d->dqcoeff;
michael@0 37 short *dequant_ptr = d->dequant;
michael@0 38
michael@0 39 *d->eob = (char)vp8_fast_quantize_b_impl_mmx(
michael@0 40 coeff_ptr,
michael@0 41 zbin_ptr,
michael@0 42 qcoeff_ptr,
michael@0 43 dequant_ptr,
michael@0 44 scan_mask,
michael@0 45
michael@0 46 round_ptr,
michael@0 47 quant_ptr,
michael@0 48 dqcoeff_ptr
michael@0 49 );
michael@0 50 }
michael@0 51
michael@0 52 int vp8_mbblock_error_mmx_impl(short *coeff_ptr, short *dcoef_ptr, int dc);
michael@0 53 int vp8_mbblock_error_mmx(MACROBLOCK *mb, int dc)
michael@0 54 {
michael@0 55 short *coeff_ptr = mb->block[0].coeff;
michael@0 56 short *dcoef_ptr = mb->e_mbd.block[0].dqcoeff;
michael@0 57 return vp8_mbblock_error_mmx_impl(coeff_ptr, dcoef_ptr, dc);
michael@0 58 }
michael@0 59
michael@0 60 int vp8_mbuverror_mmx_impl(short *s_ptr, short *d_ptr);
michael@0 61 int vp8_mbuverror_mmx(MACROBLOCK *mb)
michael@0 62 {
michael@0 63 short *s_ptr = &mb->coeff[256];
michael@0 64 short *d_ptr = &mb->e_mbd.dqcoeff[256];
michael@0 65 return vp8_mbuverror_mmx_impl(s_ptr, d_ptr);
michael@0 66 }
michael@0 67
michael@0 68 void vp8_subtract_b_mmx_impl(unsigned char *z, int src_stride,
michael@0 69 short *diff, unsigned char *predictor,
michael@0 70 int pitch);
michael@0 71 void vp8_subtract_b_mmx(BLOCK *be, BLOCKD *bd, int pitch)
michael@0 72 {
michael@0 73 unsigned char *z = *(be->base_src) + be->src;
michael@0 74 unsigned int src_stride = be->src_stride;
michael@0 75 short *diff = &be->src_diff[0];
michael@0 76 unsigned char *predictor = &bd->predictor[0];
michael@0 77 vp8_subtract_b_mmx_impl(z, src_stride, diff, predictor, pitch);
michael@0 78 }

mercurial