1 /****************************************************************************** 2 * 3 * Copyright (C) 2015 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at: 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 ***************************************************************************** 18 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore 19 */ 20 /** 21 ******************************************************************************* 22 * @file 23 * ime_statistics.h 24 * 25 * @brief 26 * This file presents some useful statistics associated with me 27 * 28 * @remarks 29 * None 30 * 31 ******************************************************************************* 32 */ 33 #ifndef _IME_STATISTICS_H_ 34 #define _IME_STATISTICS_H_ 35 36 #define DEBUG_HISTOGRAM_ENABLE 0 37 #define SAD_EXIT_STATS 0 38 39 #if SAD_EXIT_STATS 40 41 /** 42 ****************************************************************************** 43 * @brief While computing sad, if we want to do a early exit, how often we 44 * should check if the sad computed till now has exceeded min sad param is 45 * chosen statistically. 46 * ****************************************************************************** 47 */ 48 extern UWORD32 gu4_16x16_sad_ee_stats[16+1]; 49 extern UWORD32 gu4_16x8_sad_ee_stats[8+1]; 50 51 /** 52 ****************************************************************************** 53 * @brief print sad early exit stats 54 ****************************************************************************** 55 */ 56 extern void print_sad_ee_stats(void); 57 58 #define GATHER_16x16_SAD_EE_STATS(gu4_16x16_sad_ee_stats, i) \ 59 gu4_16x16_sad_ee_stats[i]++; 60 #define GATHER_16x8_SAD_EE_STATS(gu4_16x8_sad_ee_stats, i) \ 61 gu4_16x8_sad_ee_stats[i]++; 62 63 #else 64 65 #define GATHER_16x16_SAD_EE_STATS(gu4_16x16_sad_ee_stats, i) 66 #define GATHER_16x8_SAD_EE_STATS(gu4_16x8_sad_ee_stats, i) 67 68 #endif 69 70 71 #if DEBUG_HISTOGRAM_ENABLE 72 #define DEBUG_HISTOGRAM_INIT() debug_histogram_init() 73 #define DEBUG_HISTOGRAM_DUMP(condition) if(condition) debug_histogram_dump() 74 #define DEBUG_MV_HISTOGRAM_ADD(mv_x, mv_y) debug_mv_histogram_add(mv_x, mv_y) 75 #define DEBUG_SAD_HISTOGRAM_ADD(sad, level) debug_sad_histogram_add(sad, level) 76 #else 77 #define DEBUG_HISTOGRAM_INIT() 78 #define DEBUG_HISTOGRAM_DUMP(condition) 79 #define DEBUG_MV_HISTOGRAM_ADD(mv_x, mv_y) 80 #define DEBUG_SAD_HISTOGRAM_ADD(sad, level) 81 #endif 82 83 84 85 #endif /*_IME_STATISTICS_H_*/ 86