quantize_arm.c 1.79 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */


#include <math.h>
#include "vpx_mem/vpx_mem.h"

#include "vp8/encoder/quantize.h"
#include "vp8/common/entropy.h"


19
#if HAVE_NEON
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48

/* vp8_quantize_mbX functions here differs from corresponding ones in
 * quantize.c only by using quantize_b_pair function pointer instead of
 * the regular quantize_b function pointer */
void vp8_quantize_mby_neon(MACROBLOCK *x)
{
    int i;
    int has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED
        && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);

    for (i = 0; i < 16; i+=2)
        x->quantize_b_pair(&x->block[i], &x->block[i+1],
                           &x->e_mbd.block[i], &x->e_mbd.block[i+1]);

    if(has_2nd_order)
        x->quantize_b(&x->block[24], &x->e_mbd.block[24]);
}

void vp8_quantize_mb_neon(MACROBLOCK *x)
{
    int i;
    int has_2nd_order=(x->e_mbd.mode_info_context->mbmi.mode != B_PRED
        && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);

    for (i = 0; i < 24; i+=2)
        x->quantize_b_pair(&x->block[i], &x->block[i+1],
                           &x->e_mbd.block[i], &x->e_mbd.block[i+1]);

    if (has_2nd_order)
49
        x->quantize_b(&x->block[24], &x->e_mbd.block[24]);
50 51 52 53 54 55 56 57 58 59 60 61
}


void vp8_quantize_mbuv_neon(MACROBLOCK *x)
{
    int i;

    for (i = 16; i < 24; i+=2)
        x->quantize_b_pair(&x->block[i], &x->block[i+1],
                           &x->e_mbd.block[i], &x->e_mbd.block[i+1]);
}

62
#endif /* HAVE_NEON */