media/libvpx/vp8/encoder/x86/vp8_enc_stubs_mmx.c

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/libvpx/vp8/encoder/x86/vp8_enc_stubs_mmx.c	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,78 @@
     1.4 +/*
     1.5 + *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
     1.6 + *
     1.7 + *  Use of this source code is governed by a BSD-style license
     1.8 + *  that can be found in the LICENSE file in the root of the source
     1.9 + *  tree. An additional intellectual property rights grant can be found
    1.10 + *  in the file PATENTS.  All contributing project authors may
    1.11 + *  be found in the AUTHORS file in the root of the source tree.
    1.12 + */
    1.13 +
    1.14 +
    1.15 +#include "vpx_config.h"
    1.16 +#include "vp8_rtcd.h"
    1.17 +#include "vpx_ports/x86.h"
    1.18 +#include "vp8/encoder/block.h"
    1.19 +
    1.20 +void vp8_short_fdct4x4_mmx(short *input, short *output, int pitch);
    1.21 +void vp8_short_fdct8x4_mmx(short *input, short *output, int pitch)
    1.22 +{
    1.23 +    vp8_short_fdct4x4_mmx(input,   output,    pitch);
    1.24 +    vp8_short_fdct4x4_mmx(input + 4, output + 16, pitch);
    1.25 +}
    1.26 +
    1.27 +int vp8_fast_quantize_b_impl_mmx(short *coeff_ptr, short *zbin_ptr,
    1.28 +                                 short *qcoeff_ptr, short *dequant_ptr,
    1.29 +                                 const short *scan_mask, short *round_ptr,
    1.30 +                                 short *quant_ptr, short *dqcoeff_ptr);
    1.31 +void vp8_fast_quantize_b_mmx(BLOCK *b, BLOCKD *d)
    1.32 +{
    1.33 +    const short *scan_mask   = vp8_default_zig_zag_mask;
    1.34 +    short *coeff_ptr   = b->coeff;
    1.35 +    short *zbin_ptr    = b->zbin;
    1.36 +    short *round_ptr   = b->round;
    1.37 +    short *quant_ptr   = b->quant_fast;
    1.38 +    short *qcoeff_ptr  = d->qcoeff;
    1.39 +    short *dqcoeff_ptr = d->dqcoeff;
    1.40 +    short *dequant_ptr = d->dequant;
    1.41 +
    1.42 +    *d->eob = (char)vp8_fast_quantize_b_impl_mmx(
    1.43 +                                                 coeff_ptr,
    1.44 +                                                 zbin_ptr,
    1.45 +                                                 qcoeff_ptr,
    1.46 +                                                 dequant_ptr,
    1.47 +                                                 scan_mask,
    1.48 +
    1.49 +                                                 round_ptr,
    1.50 +                                                 quant_ptr,
    1.51 +                                                 dqcoeff_ptr
    1.52 +                                                 );
    1.53 +}
    1.54 +
    1.55 +int vp8_mbblock_error_mmx_impl(short *coeff_ptr, short *dcoef_ptr, int dc);
    1.56 +int vp8_mbblock_error_mmx(MACROBLOCK *mb, int dc)
    1.57 +{
    1.58 +    short *coeff_ptr =  mb->block[0].coeff;
    1.59 +    short *dcoef_ptr =  mb->e_mbd.block[0].dqcoeff;
    1.60 +    return vp8_mbblock_error_mmx_impl(coeff_ptr, dcoef_ptr, dc);
    1.61 +}
    1.62 +
    1.63 +int vp8_mbuverror_mmx_impl(short *s_ptr, short *d_ptr);
    1.64 +int vp8_mbuverror_mmx(MACROBLOCK *mb)
    1.65 +{
    1.66 +    short *s_ptr = &mb->coeff[256];
    1.67 +    short *d_ptr = &mb->e_mbd.dqcoeff[256];
    1.68 +    return vp8_mbuverror_mmx_impl(s_ptr, d_ptr);
    1.69 +}
    1.70 +
    1.71 +void vp8_subtract_b_mmx_impl(unsigned char *z,  int src_stride,
    1.72 +                             short *diff, unsigned char *predictor,
    1.73 +                             int pitch);
    1.74 +void vp8_subtract_b_mmx(BLOCK *be, BLOCKD *bd, int pitch)
    1.75 +{
    1.76 +    unsigned char *z = *(be->base_src) + be->src;
    1.77 +    unsigned int  src_stride = be->src_stride;
    1.78 +    short *diff = &be->src_diff[0];
    1.79 +    unsigned char *predictor = &bd->predictor[0];
    1.80 +    vp8_subtract_b_mmx_impl(z, src_stride, diff, predictor, pitch);
    1.81 +}

mercurial