Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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 "vp8/encoder/block.h" |
michael@0 | 15 | #include <math.h> |
michael@0 | 16 | #include "vpx_mem/vpx_mem.h" |
michael@0 | 17 | #include "vp8/encoder/quantize.h" |
michael@0 | 18 | #include "vp8/common/entropy.h" |
michael@0 | 19 | |
michael@0 | 20 | |
michael@0 | 21 | #if HAVE_NEON |
michael@0 | 22 | |
michael@0 | 23 | /* vp8_quantize_mbX functions here differs from corresponding ones in |
michael@0 | 24 | * quantize.c only by using quantize_b_pair function pointer instead of |
michael@0 | 25 | * the regular quantize_b function pointer */ |
michael@0 | 26 | void vp8_quantize_mby_neon(MACROBLOCK *x) |
michael@0 | 27 | { |
michael@0 | 28 | int i; |
michael@0 | 29 | int has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED |
michael@0 | 30 | && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV); |
michael@0 | 31 | |
michael@0 | 32 | for (i = 0; i < 16; i+=2) |
michael@0 | 33 | x->quantize_b_pair(&x->block[i], &x->block[i+1], |
michael@0 | 34 | &x->e_mbd.block[i], &x->e_mbd.block[i+1]); |
michael@0 | 35 | |
michael@0 | 36 | if(has_2nd_order) |
michael@0 | 37 | x->quantize_b(&x->block[24], &x->e_mbd.block[24]); |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | void vp8_quantize_mb_neon(MACROBLOCK *x) |
michael@0 | 41 | { |
michael@0 | 42 | int i; |
michael@0 | 43 | int has_2nd_order=(x->e_mbd.mode_info_context->mbmi.mode != B_PRED |
michael@0 | 44 | && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV); |
michael@0 | 45 | |
michael@0 | 46 | for (i = 0; i < 24; i+=2) |
michael@0 | 47 | x->quantize_b_pair(&x->block[i], &x->block[i+1], |
michael@0 | 48 | &x->e_mbd.block[i], &x->e_mbd.block[i+1]); |
michael@0 | 49 | |
michael@0 | 50 | if (has_2nd_order) |
michael@0 | 51 | x->quantize_b(&x->block[24], &x->e_mbd.block[24]); |
michael@0 | 52 | } |
michael@0 | 53 | |
michael@0 | 54 | |
michael@0 | 55 | void vp8_quantize_mbuv_neon(MACROBLOCK *x) |
michael@0 | 56 | { |
michael@0 | 57 | int i; |
michael@0 | 58 | |
michael@0 | 59 | for (i = 16; i < 24; i+=2) |
michael@0 | 60 | x->quantize_b_pair(&x->block[i], &x->block[i+1], |
michael@0 | 61 | &x->e_mbd.block[i], &x->e_mbd.block[i+1]); |
michael@0 | 62 | } |
michael@0 | 63 | |
michael@0 | 64 | #endif /* HAVE_NEON */ |