Home | History | Annotate | Download | only in decoder
      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 #ifndef _IH264D_DEFS_H_
     21 #define _IH264D_DEFS_H_
     22 
     23 /**
     24  ************************************************************************
     25  * \file ih264d_defs.h
     26  *
     27  * \brief
     28  *    Type definitions used in the code
     29  *
     30  * \date
     31  *    19/11/2002
     32  *
     33  * \author  Sriram Sethuraman
     34  *
     35  ************************************************************************
     36  */
     37 #define H264_MAX_FRAME_WIDTH                3840
     38 #define H264_MAX_FRAME_HEIGHT               2176
     39 
     40 #define H264_MIN_FRAME_WIDTH                16
     41 #define H264_MIN_FRAME_HEIGHT               16
     42 
     43 #define FMT_CONV_NUM_ROWS       16
     44 
     45 /** Bit manipulation macros */
     46 #define CHECKBIT(a,i) ((a) &  (1 << i))
     47 #define CLEARBIT(a,i) ((a) &= ~(1 << i))
     48 
     49 /** Macro to convert a integer to a boolean value */
     50 #define BOOLEAN(x) (!!(x))
     51 
     52 /** Arithmetic operations */
     53 #define MOD(x,y) ((x)%(y))
     54 #define DIV(x,y) ((x)/(y))
     55 #define MUL(x,y) ((x)*(y))
     56 #define SIGN_POW2_DIV(x, y) (((x) < 0) ? (-((-(x)) >> (y))) : ((x) >> (y)))
     57 
     58 #define MB_ENABLE_FILTERING           0x00
     59 #define MB_DISABLE_FILTERING          0x01
     60 #define MB_DISABLE_TOP_EDGE           0x02
     61 #define MB_DISABLE_LEFT_EDGE          0x04
     62 
     63 /** Maximum number of reference pics */
     64 #define MAX_REF_BUFS    32
     65 #define MAX_DISP_BUFS_NEW 64
     66 #define MAX_FRAMES              16
     67 
     68 #define INVALID_FRAME_NUM       0x0fffffff
     69 #define GAP_FRAME_NUM           0x1fffffff
     70 
     71 /** macros for reference picture lists, refIdx to POC mapping */
     72 // 1 extra entry into reference picture lists for refIdx = -1.
     73 // this entry is always 0. this saves conditional checks in
     74 // FillBs modules.
     75 #define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
     76 #define POC_LIST_L0_TO_L1_DIFF_1  ((MAX_FRAMES) + 1)
     77 
     78 #define FRM_LIST_L0             0                                               //0
     79 #define FRM_LIST_L1             1 * POC_LIST_L0_TO_L1_DIFF//FRM_LIST_L0 + POC_LIST_L0_TO_L1_DIFF        //0+33                  //(1 * POC_LIST_L0_TO_L1_DIFF)
     80 #define TOP_LIST_FLD_L0         2 * POC_LIST_L0_TO_L1_DIFF//FRM_LIST_L1 + POC_LIST_L0_TO_L1_DIFF        //0+33+33                   //(2 * POC_LIST_L0_TO_L1_DIFF)
     81 #define TOP_LIST_FLD_L1         3 * POC_LIST_L0_TO_L1_DIFF//TOP_LIST_FLD_L0 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17                //(3 * POC_LIST_L0_TO_L1_DIFF)
     82 #define BOT_LIST_FLD_L0         4 * POC_LIST_L0_TO_L1_DIFF//TOP_LIST_FLD_L1 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17
     83 #define BOT_LIST_FLD_L1         5 * POC_LIST_L0_TO_L1_DIFF//BOT_LIST_FLD_L0 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17+17
     84 #define TOTAL_LIST_ENTRIES      6 * POC_LIST_L0_TO_L1_DIFF//BOT_LIST_FLD_L1 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17+17+17
     85 #define PAD_MV_BANK_ROW             64
     86 #define OFFSET_MV_BANK_ROW          ((PAD_MV_BANK_ROW)>>1)
     87 #define PAD_PUC_CURNNZ              32
     88 #define OFFSET_PUC_CURNNZ           (PAD_PUC_CURNNZ)
     89 #define PAD_MAP_IDX_POC             (1)
     90 #define OFFSET_MAP_IDX_POC          (1)
     91 
     92 #define OFFSET_MAP_IDX_POC          (1)
     93 
     94 #define NAL_REF_IDC(nal_first_byte)       ((nal_first_byte >> 5) & 0x3)
     95 #define NAL_FORBIDDEN_BIT(nal_first_byte) (nal_first_byte>>7)
     96 #define NAL_UNIT_TYPE(nal_first_byte)     (nal_first_byte & 0x1F)
     97 
     98 #define INT_PIC_TYPE_I        (0x00)
     99 
    100 #define YIELD_CNT_THRESHOLD  8
    101 
    102 
    103 #define OK        0
    104 #define END       1
    105 #define NOT_OK    -1
    106 
    107 /* For 420SP */
    108 #define YUV420SP_FACTOR 2
    109 
    110 
    111 /**
    112  ***************************************************************************
    113  * Enum to hold various mem records being request
    114  ****************************************************************************
    115  */
    116 enum
    117 {
    118     /**
    119      * Codec Object at API level
    120      */
    121     MEM_REC_IV_OBJ,
    122 
    123     /**
    124      * Codec context
    125      */
    126     MEM_REC_CODEC,
    127 
    128     /**
    129      * Bitstream buffer which holds emulation prevention removed bytes
    130      */
    131     MEM_REC_BITSBUF,
    132 
    133     /**
    134      * Buffer to hold  coeff data
    135      */
    136     MEM_REC_COEFF_DATA,
    137 
    138     /**
    139      * Motion vector bank
    140      */
    141     MEM_REC_MVBANK,
    142 
    143     /**
    144      * Holds mem records passed to the codec.
    145      */
    146     MEM_REC_BACKUP,
    147 
    148     /**
    149      * Holds SPS
    150      */
    151     MEM_REC_SPS,
    152 
    153     /**
    154      * Holds PPS
    155      */
    156     MEM_REC_PPS,
    157 
    158     /**
    159      * Holds Slice Headers
    160      */
    161     MEM_REC_SLICE_HDR,
    162 
    163     /**
    164      * Holds thread handles
    165      */
    166     MEM_REC_THREAD_HANDLE,
    167 
    168     /**
    169      * Contains i4_status map indicating parse i4_status per MB basis
    170      */
    171     MEM_REC_PARSE_MAP,
    172 
    173     /**
    174      * Contains i4_status map indicating processing i4_status per MB basis
    175      */
    176     MEM_REC_PROC_MAP,
    177 
    178     /**
    179      * Contains slice number info for each MB
    180      */
    181 
    182     MEM_REC_SLICE_NUM_MAP,
    183 
    184     /**
    185      * Holds dpb manager context
    186      */
    187     MEM_REC_DPB_MGR,
    188 
    189     /**
    190      * Holds neighbors' info
    191      */
    192     MEM_REC_NEIGHBOR_INFO,
    193 
    194     /**
    195      * Holds neighbors' info
    196      */
    197     MEM_REC_PRED_INFO,
    198 
    199 
    200     /**
    201      * Holds inter pred inforamation on packed format info
    202      */
    203     MEM_REC_PRED_INFO_PKD,
    204     /**
    205      * Holds neighbors' info
    206      */
    207     MEM_REC_MB_INFO,
    208 
    209     /**
    210      * Holds deblock Mb info structure frame level)
    211      */
    212     MEM_REC_DEBLK_MB_INFO,
    213 
    214     /**
    215      * Holds  reference picture buffers in non-shared mode
    216      */
    217     MEM_REC_REF_PIC,
    218 
    219     /**
    220      * Holds  some misc intermediate_buffers
    221      */
    222     MEM_REC_EXTRA_MEM,
    223 
    224     /**
    225      * Holds  some misc intermediate_buffers
    226      */
    227     MEM_REC_INTERNAL_SCRATCH,
    228 
    229     /**
    230      * Holds  some misc intermediate_buffers
    231      */
    232     MEM_REC_INTERNAL_PERSIST,
    233 
    234     /* holds structures related to picture buffer manager*/
    235     MEM_REC_PIC_BUF_MGR,
    236 
    237     /*holds structure related to MV buffer manager*/
    238     MEM_REC_MV_BUF_MGR,
    239 
    240     /**
    241      * Place holder to compute number of memory records.
    242      */
    243     MEM_REC_CNT
    244 /* Do not add anything below */
    245 };
    246 
    247 #ifdef DEBLOCK_THREAD
    248 #define H264_MUTEX_LOCK(lock) ithread_mutex_lock(lock)
    249 #define H264_MUTEX_UNLOCK(lock) ithread_mutex_unlock(lock)
    250 #else //DEBLOCK_THREAD
    251 #define H264_MUTEX_LOCK(lock)
    252 #define H264_MUTEX_UNLOCK(lock)
    253 
    254 #define DEBUG_THREADS_PRINTF(...)
    255 #define DEBUG_PERF_PRINTF(...)
    256 
    257 /** Profile Types*/
    258 #define BASE_PROFILE_IDC    66
    259 #define MAIN_PROFILE_IDC    77
    260 #define HIGH_PROFILE_IDC   100
    261 
    262 
    263 #define MB_SIZE             16
    264 #define BLK8x8SIZE           8
    265 #define BLK_SIZE             4
    266 #define NUM_BLKS_PER_MB     24
    267 #define NUM_LUM_BLKS_PER_MB 16
    268 #define LUM_BLK              0
    269 #define CHROM_BLK            1
    270 #define NUM_PELS_IN_MB      64
    271 
    272 /* Level Types */
    273 #define H264_LEVEL_1_0     10
    274 #define H264_LEVEL_1_1     11
    275 #define H264_LEVEL_1_2     12
    276 #define H264_LEVEL_1_3     13
    277 #define H264_LEVEL_2_0     20
    278 #define H264_LEVEL_2_1     21
    279 #define H264_LEVEL_2_2     22
    280 #define H264_LEVEL_3_0     30
    281 #define H264_LEVEL_3_1     31
    282 #define H264_LEVEL_3_2     32
    283 #define H264_LEVEL_4_0     40
    284 #define H264_LEVEL_4_1     41
    285 #define H264_LEVEL_4_2     42
    286 #define H264_LEVEL_5_0     50
    287 #define H264_LEVEL_5_1     51
    288 
    289 #define MAX_MBS_LEVEL_51 36864
    290 #define MAX_MBS_LEVEL_50 22080
    291 #define MAX_MBS_LEVEL_42 8704
    292 #define MAX_MBS_LEVEL_41 8192
    293 #define MAX_MBS_LEVEL_40 8192
    294 #define MAX_MBS_LEVEL_32 5120
    295 #define MAX_MBS_LEVEL_31 3600
    296 #define MAX_MBS_LEVEL_30 1620
    297 #define MAX_MBS_LEVEL_22 1620
    298 #define MAX_MBS_LEVEL_21 792
    299 #define MAX_MBS_LEVEL_20 396
    300 #define MAX_MBS_LEVEL_13 396
    301 #define MAX_MBS_LEVEL_12 396
    302 #define MAX_MBS_LEVEL_11 396
    303 #define MAX_MBS_LEVEL_10 99
    304 
    305 
    306 /*
    307  |  Legend:
    308  |  LVL Level*10
    309  |  MPR Macroblk processing rate
    310  |  MMF Max Mbs/Frm
    311  |  MDK Max DbpSize (in kB)
    312  |  MDB max DbpSize (in bytes)
    313  |  MFS FrmSizeYUV (in bytes)
    314  |  MDP Max DBPics
    315  |  MDC Ceiling DBPics
    316  |  FPS Frame/Second
    317  |
    318  |  LVL MPR   MMF   MDK     MDB     MFS     MDP   MDC   FPS
    319  |  10  1485  99    148.5   152064  38016   4.00  4.00  15.00
    320  |  11  3000  396   337.5   345600  152064  2.27  3.00  7.58
    321  |  12  6000  396   891     912384  152064  6.00  6.00  15.15
    322  |  13  11880 396   891     912384  152064  6.00  6.00  30.00
    323  |  20  11880 396   891     912384  152064  6.00  6.00  30.00
    324  |  21  19800 792   1782    1824768 304128  6.00  6.00  25.00
    325  |  22  20250 1620  3037.5  3110400 622080  5.00  5.00  12.50
    326  |  30  40500 1620  3037.5  3110400 622080  5.00  5.00  25.00
    327  */
    328 #define MAX_REF_LEVEL_1_0     4
    329 #define MAX_REF_LEVEL_1_1     3
    330 #define MAX_REF_LEVEL_1_2     6
    331 #define MAX_REF_LEVEL_1_3     6
    332 #define MAX_REF_LEVEL_2_0     6
    333 #define MAX_REF_LEVEL_2_1     6
    334 #define MAX_REF_LEVEL_2_2     5
    335 #define MAX_REF_LEVEL_3_0     5
    336 #define H264_MAX_REF_PICS     16
    337 
    338 #define MIN_LEVEL_SUPPORTED 10
    339 #define MAX_LEVEL_SUPPORTED 64
    340 
    341 /** NAL Types */
    342 #define SLICE_NAL                       1
    343 #define SLICE_DATA_PARTITION_A_NAL      2
    344 #define SLICE_DATA_PARTITION_B_NAL      3
    345 #define SLICE_DATA_PARTITION_C_NAL      4
    346 #define IDR_SLICE_NAL                   5
    347 #define SEI_NAL                         6
    348 #define SEQ_PARAM_NAL                   7
    349 #define PIC_PARAM_NAL                   8
    350 #define ACCESS_UNIT_DELIMITER_RBSP      9
    351 #define END_OF_SEQ_RBSP                 10
    352 #define END_OF_STREAM_RBSP              11
    353 #define FILLER_DATA_NAL                 12
    354 
    355 /** Entropy coding modes */
    356 #define CAVLC  0
    357 #define CABAC  1
    358 
    359 /** Picture Types */
    360 #define I_PIC       0
    361 #define IP_PIC      1
    362 #define IPB_PIC     2
    363 #define SI_PIC      3
    364 #define SIP_PIC     4
    365 #define ISI_PIC     5
    366 #define ISI_PSP_PIC 6
    367 #define ALL_PIC     7
    368 
    369 /* Frame or field picture type */
    370 #define FRM_PIC         0x00
    371 #define TOP_FLD         0x01
    372 #define BOT_FLD         0x02
    373 #define COMP_FLD_PAIR   0x03 /* TOP_FLD | BOT_FLD */
    374 #define AFRM_PIC        0x04
    375 #define TOP_REF         0x08
    376 #define BOT_REF         0x10
    377 #define PIC_MASK        0x03
    378 #define NON_EXISTING    0xff
    379 
    380 /* field picture type for display */
    381 #define DISP_TOP_FLD    0x00
    382 #define DISP_BOT_FLD    0x01
    383 
    384 /** Slice Types */
    385 #define P_SLICE  0
    386 #define B_SLICE  1
    387 #define I_SLICE  2
    388 #define SP_SLICE 3
    389 #define SI_SLICE 4
    390 
    391 /* Definition for picture skip */
    392 #define SKIP_NONE  (0x0)
    393 #define I_SLC_BIT  (0x1)
    394 #define P_SLC_BIT  (0x2)
    395 #define B_SLC_BIT  (0x4)
    396 
    397 /** Macros used for Deblocking */
    398 #define D_INTER_MB        0
    399 #define D_INTRA_MB        1
    400 #define D_PRED_NON_16x16  2
    401 #define D_B_SLICE         4
    402 #define D_B_SUBMB         6 //D_B_SLICE | D_PRED_NON_16x16 | D_INTER_MB
    403 #define D_FLD_MB          0x80
    404 
    405 /** Macros for Cabac checks */
    406 /** MbType */
    407 /** |x|x|I_PCM|SKIP|
    408  |S|Inter/Intra|P/B|NON-BD16x16/BD16x16,I16x16/I4x4| */
    409 #define CAB_INTRA         0x00 /* 0000 00xx */
    410 #define CAB_INTER         0x04 /* 0000 01xx */
    411 #define CAB_I4x4          0x00 /* 0000 00x0 */
    412 #define CAB_I16x16        0x01 /* 0000 00x1 */
    413 #define CAB_BD16x16       0x04 /* 0000 0100 */
    414 #define CAB_NON_BD16x16   0x05 /* 0000 0101 */
    415 #define CAB_P             0x07 /* 0000 0111 */
    416 #define CAB_SI4x4         0x08 /* 0000 10x0 */
    417 #define CAB_SI16x16       0x09 /* 0000 10x1 */
    418 #define CAB_SKIP_MASK     0x10 /* 0001 0000 */
    419 #define CAB_SKIP          0x10 /* 0001 0000 */
    420 #define CAB_P_SKIP        0x16 /* 0001 x11x */
    421 #define CAB_B_SKIP        0x14 /* 0001 x100 */
    422 #define CAB_BD16x16_MASK  0x07 /* 0000 0111 */
    423 #define CAB_INTRA_MASK    0x04 /* 0000 0100 */
    424 #define CAB_I_PCM         0x20 /* 001x xxxx */
    425 
    426 /**< Binarization types for CABAC */
    427 /* |x|x|x|x|MSB_FIRST_FLC|FLC|TUNARY|UNARY| */
    428 #define UNARY           1
    429 #define TUNARY          2
    430 #define FLC             4
    431 #define MSB_FIRST_FLC   12
    432 
    433 /** Macroblock Types */
    434 #define I_4x4_MB    0
    435 #define I_16x16_MB  1
    436 #define P_MB        2
    437 #define B_MB        3
    438 #define SI_MB       4
    439 #define SP_MB       5
    440 #define I_PCM_MB    6
    441 
    442 #define SI4x4_MB 0xFF
    443 
    444 /** Intra luma 16x16 and chroma 8x8 prediction modes */
    445 #define NUM_INTRA_PRED_MODES  4
    446 #define VERT    0
    447 #define HORIZ   1
    448 #define DC      2
    449 #define PLANE   3
    450 #define NOT_VALID -1
    451 #define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
    452 
    453 /** Intra luma 4x4 prediction modes */
    454 #define NUM_INTRA4x4_PRED_MODES 9
    455 
    456 /** VERT, HORIZ, DC are applicable to 4x4 as well */
    457 /** D - Down; U - Up; L - Left; R - Right */
    458 #define DIAG_DL   3
    459 #define DIAG_DR   4
    460 #define VERT_R    5
    461 #define HORIZ_D   6
    462 #define VERT_L    7
    463 #define HORIZ_U   8
    464 
    465 /** P_MB prediction modes */
    466 #define NUM_INTER_MB_PRED_MODES 5
    467 #define PRED_16x16  0
    468 #define PRED_16x8   1
    469 #define PRED_8x16   2
    470 #define PRED_8x8    3
    471 #define PRED_8x8R0  4
    472 #define MAGIC_16x16 5
    473 #define MB_SKIP     255
    474 
    475 /* P_MB submb modes */
    476 #define P_L0_8x8    0
    477 #define P_L0_8x4    1
    478 #define P_L0_4x8    2
    479 #define P_L0_4x4    3
    480 
    481 /* B_MB submb modes */
    482 #define B_DIRECT_8x8    0
    483 #define B_L0_8x8        1
    484 #define B_L1_8x8        2
    485 #define B_BI_8x8        3
    486 #define B_L0_8x4        4
    487 #define B_L0_4x8        5
    488 #define B_L1_8x4        6
    489 #define B_L1_4x8        7
    490 #define B_BI_8x4        8
    491 #define B_BI_4x8        9
    492 #define B_L0_4x4        10
    493 #define B_L1_4x4        11
    494 #define B_BI_4x4        12
    495 
    496 /** B_MB prediction modes */
    497 #define B_8x8    22
    498 #define PRED_INVALID  -1
    499 #define B_DIRECT  0
    500 #define PRED_L0   1
    501 #define PRED_L1   2
    502 #define BI_PRED   3
    503 #define B_DIRECT_BI_PRED  23
    504 #define B_DIRECT_PRED_L0  24
    505 #define B_DIRECT_PRED_L1  25
    506 #define B_DIRECT_SPATIAL  26
    507 
    508 #define B_DIRECT8x8_BI_PRED  13
    509 #define B_DIRECT8x8_PRED_L0  14
    510 #define B_DIRECT8x8_PRED_L1  15
    511 
    512 #define ONE_TO_ONE  0
    513 #define FRM_TO_FLD  1
    514 #define FLD_TO_FRM  2
    515 
    516 /** Inter Sub MB Pred modes */
    517 #define NUM_INTER_SUBMB_PRED_MODES 4
    518 #define SUBMB_8x8    0
    519 #define SUBMB_8x4    1
    520 #define SUBMB_4x8    2
    521 #define SUBMB_4x4    3
    522 
    523 /** Coded Block Pattern - Chroma */
    524 #define CBPC_ALLZERO    0
    525 #define CBPC_ACZERO     1
    526 #define CBPC_NONZERO    2
    527 
    528 /** Index for accessing the left MB in the MV predictor array */
    529 #define LEFT  0
    530 /** Index for accessing the top MB in the MV predictor array */
    531 #define TOP   1
    532 /** Index for accessing the top right MB in the MV predictor array */
    533 #define TOP_R 2
    534 /** Index for accessing the top Left MB in the MV predictor array */
    535 #define TOP_L 3
    536 
    537 /** Maximum number of Sequence Parameter sets */
    538 #define MAX_NUM_SEQ_PARAMS 32
    539 
    540 /** Maximum number of Picture Parameter sets */
    541 #define MAX_NUM_PIC_PARAMS 256
    542 
    543 #define MASK_ERR_SEQ_SET_ID   (0xFFFFFFE0)
    544 #define MASK_ERR_PIC_SET_ID   (0xFFFFFF00)
    545 
    546 #define MAX_PIC_ORDER_CNT_TYPE    2
    547 
    548 #define MAX_BITS_IN_FRAME_NUM     16
    549 #define MAX_BITS_IN_POC_LSB       16
    550 
    551 #define H264_MAX_REF_PICS         16
    552 #define H264_MAX_REF_IDX          32
    553 #define MAX_WEIGHT_BIPRED_IDC     2
    554 #define MAX_CABAC_INIT_IDC        2
    555 
    556 #define H264_DEFAULT_NUM_CORES 1
    557 #define DEFAULT_SEPARATE_PARSE (H264_DEFAULT_NUM_CORES == 2)? 1 :0
    558 
    559 /** Maximum number of Slice groups */
    560 #define MAX_NUM_SLICE_GROUPS 8
    561 #define MAX_NUM_REF_FRAMES_OFFSET 255
    562 
    563 /** Deblocking modes for a slice */
    564 #define SLICE_BOUNDARY_DBLK_DISABLED  2
    565 #define DBLK_DISABLED                 1
    566 #define DBLK_ENABLED                  0
    567 #define MIN_DBLK_FIL_OFF              -12
    568 #define MAX_DBLK_FIL_OFF              12
    569 
    570 /** Width of the predictor buffers used for MC */
    571 #define MB_SIZE             16
    572 #define BLK8x8SIZE          8
    573 #define BLK_SIZE             4
    574 #define NUM_BLKS_PER_MB     24
    575 #define NUM_LUM_BLKS_PER_MB 16
    576 
    577 #define SUB_BLK_WIDTH                 4
    578 #define SUB_SUB_BLK_SIZE              4 /* 2x2 pixel i4_size */
    579 #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
    580 #define MB_LUM_SIZE                   256
    581 #define MB_CHROM_SIZE                 64
    582 
    583 /**< Width to pad the luminance frame buff    */
    584 /**< Height to pad the luminance frame buff   */
    585 /**< Width to pad the chrominance frame buff  */
    586 /**< Height to pad the chrominance frame buff */
    587 
    588 #define PAD_LEN_Y_H                   32
    589 #define PAD_LEN_Y_V                   20
    590 #define PAD_LEN_UV_H                  16
    591 #define PAD_LEN_UV_V                  8
    592 
    593 #define PAD_MV_BANK_ROW             64
    594 
    595 /**< Maimum u4_ofst by which the Mvs could point outside the frame buffers
    596  horizontally in the left and vertically in the top direction */
    597 #define MAX_OFFSET_OUTSIDE_X_FRM      -20
    598 #define MAX_OFFSET_OUTSIDE_Y_FRM      -20
    599 #define MAX_OFFSET_OUTSIDE_UV_FRM     -8
    600 
    601 /** UVLC parsing macros */
    602 #define   UEV     1
    603 #define   SEV     2
    604 #define   TEV     3
    605 
    606 /** Defines for Boolean values */
    607 #ifndef TRUE
    608 #define TRUE    1
    609 #define FALSE   0
    610 #endif
    611 
    612 #define UNUSED_FOR_REF 0
    613 #define IS_SHORT_TERM  1
    614 #define IS_LONG_TERM   2
    615 
    616 /** Defines for which field gets displayed first */
    617 #define MAX_FRAMES              16
    618 #define INVALID_FRAME_NUM       0x0fffffff
    619 #define DO_NOT_DISP             254
    620 #define DISP_FLD_FIRST_UNDEF  0
    621 #define DISP_TOP_FLD_FIRST   1
    622 #define DISP_BOT_FLD_FIRST   2
    623 
    624 /** Misc error resilience requirements*/
    625 #define MASK_LOG2_WEIGHT_DENOM      0xFFFFFFF8
    626 #define MASK_PRED_WEIGHT_OFFSET     0xFFFFFF00
    627 #define MAX_REDUNDANT_PIC_CNT       127
    628 
    629 
    630 
    631 #endif //DEBLOCK_THREAD
    632 
    633 #define NUM_COEFFS_IN_4x4BLK 16
    634 
    635 
    636 #define MEMSET_16BYTES(pu4_start,value)                         \
    637 {                                                               \
    638     memset(pu4_start,value,16);                                 \
    639 }
    640 
    641 #define MEMCPY_16BYTES(dst,src)                                 \
    642 {                                                               \
    643     memcpy(dst,src,16);                                         \
    644 }
    645 
    646 
    647 #endif /*_IH264D_DEFS_H_*/
    648