videoeditorengine/avcedit/inc/globals.h
changeset 0 951a5db380a0
equal deleted inserted replaced
-1:000000000000 0:951a5db380a0
       
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 * Ixonos Plc
       
    14 *
       
    15 * Description:
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef _GLOBALS_H_
       
    21 #define _GLOBALS_H_
       
    22 
       
    23 #include <s32file.h>
       
    24 #include "nrctyp32.h"
       
    25 //#include "rdtsc.h"
       
    26 
       
    27 
       
    28 /*
       
    29  * General defines
       
    30  */
       
    31 
       
    32 #ifdef __TMS320C55X__
       
    33 /* If this is defined, int is 16 bits */
       
    34 #define INT_IS_16_BITS
       
    35 #endif
       
    36 
       
    37 // Define the debug printing
       
    38 #ifdef _DEBUG
       
    39 #include <e32svr.h>
       
    40 #define PRINT(x) RDebug::Print x;
       
    41 #else
       
    42 #define PRINT(x)
       
    43 #endif
       
    44 
       
    45 /* If this is defined as 1, input bitstream is encapsulated in NAL packets */
       
    46 /* and contians start code emulation prevention bytes                      */
       
    47 #define ENCAPSULATED_NAL_PAYLOAD 1
       
    48 
       
    49 /* Minimum and maximum QP value */
       
    50 #define MIN_QP 0
       
    51 #define MAX_QP 51
       
    52 
       
    53 /* If this is defined, pixel clipping will use loop-up table */
       
    54 #ifndef __TMS320C55X__
       
    55 #define USE_CLIPBUF
       
    56 #endif
       
    57 
       
    58 #ifndef min
       
    59 #define min(a, b) ((a) < (b) ? (a) : (b))
       
    60 #endif
       
    61 #ifndef max
       
    62 #define max(a, b) ((a) > (b) ? (a) : (b))
       
    63 #endif
       
    64 
       
    65 /* This macro clips value val to the range of [min, max] */
       
    66 #define  clip(min, max, val) (((val)<(min))? (min):(((val)>(max))? (max):(val)))
       
    67 
       
    68 
       
    69 /*
       
    70  * Defines for assembly functions
       
    71  */
       
    72 
       
    73 #ifdef AVC_ARM_ASSEMBLY
       
    74 #define AVC_RECO_BLOCK_ASM
       
    75 #define AVC_LOOP_FILTER_ASM
       
    76 #define AVC_MOTION_COMP_ASM
       
    77 #endif
       
    78 
       
    79 #ifdef __TMS320C55X__
       
    80 #define AVC_RECO_BLOCK_ASM
       
    81 #endif
       
    82 
       
    83 
       
    84 /*
       
    85  * Defines for error concealment
       
    86  */
       
    87 
       
    88 /*#ifndef ERROR_CONCEALMENT
       
    89 #define ERROR_CONCEALMENT
       
    90 #endif*/
       
    91 
       
    92 #ifndef BACKCHANNEL_INFO
       
    93 #define BACKCHANNEL_INFO
       
    94 #endif
       
    95 
       
    96 /*
       
    97  * Defines for slice
       
    98  */
       
    99 
       
   100 /* All possible slice types */
       
   101 #define SLICE_MIN 0
       
   102 #define SLICE_P   0 // P (P slice)
       
   103 #define SLICE_B   1 // B (B slice)
       
   104 #define SLICE_I   2 // I (I slice)
       
   105 #define SLICE_SP  3 // SP (SP slice)
       
   106 #define SLICE_SI  4 // SI (SI slice)
       
   107 #define SLICE_P1  5	// P (P slice)
       
   108 #define SLICE_B1  6	// B (B slice)
       
   109 #define SLICE_I1  7	// I (I slice)
       
   110 #define SLICE_SP1 8	// SP (SP slice)
       
   111 #define SLICE_SI1 9	// SI (SI slice)
       
   112 #define SLICE_MAX 9
       
   113 
       
   114 /* Macros for testing whether slice is I slice, P slice or B slice */
       
   115 #define IS_SLICE_I(x) ((x) == SLICE_I || (x) == SLICE_I1 || (x) == SLICE_SI || (x) == SLICE_SI1)
       
   116 #define IS_SLICE_P(x) ((x) == SLICE_P || (x) == SLICE_P1 || (x) == SLICE_SP || (x) == SLICE_SP1)
       
   117 #define IS_SLICE_B(x) ((x) == SLICE_B || (x) == SLICE_B1)
       
   118 
       
   119 
       
   120 /*
       
   121  * Defines for macroblock
       
   122  */
       
   123 
       
   124 #define MBK_SIZE        16
       
   125 #define BLK_SIZE        4
       
   126 #define BLK_PER_MB      (MBK_SIZE/BLK_SIZE)
       
   127 #define MBK_SIZE_LOG2   4
       
   128 #define BLK_SIZE_LOG2   2
       
   129 
       
   130 /* Macroblock type */
       
   131 #define MBK_INTRA  0
       
   132 #define MBK_INTER  1
       
   133 
       
   134 /* Intra macroblock sub-type */
       
   135 #define MBK_INTRA_TYPE1     0
       
   136 #define MBK_INTRA_TYPE2     1
       
   137 #define MBK_INTRA_TYPE_PCM  2
       
   138 
       
   139 
       
   140 /*
       
   141  * Defines for entropy coder
       
   142  */
       
   143 
       
   144 /* These 2 macros are needed even if ENABLE_CABAC is not defined */
       
   145 #define ENTROPY_CAVLC       0
       
   146 #define ENTROPY_CABAC       1
       
   147 
       
   148 
       
   149 
       
   150 /*
       
   151  * Global structures
       
   152  */
       
   153 
       
   154 typedef struct _motVec_s {
       
   155   int16 x;
       
   156   int16 y;
       
   157 } motVec_s;
       
   158 
       
   159 
       
   160 /* Chrominance QP mapping table. Has to be static on Symbian. */
       
   161 /* Chroma QP = qpChroma[Luma QP]                              */
       
   162 #ifndef __SYMBIAN32__
       
   163 extern const u_int8 qpChroma[52];
       
   164 #else
       
   165 static const u_int8 qpChroma[52] = {
       
   166     0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,
       
   167    12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,
       
   168    28,29,29,30,31,32,32,33,34,34,35,35,36,36,37,37,
       
   169    37,38,38,38,39,39,39,39
       
   170 }; 
       
   171 #endif
       
   172 
       
   173 
       
   174 #endif