Home | History | Annotate | Download | only in src
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 1998-2009 PacketVideo
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
     13  * express or implied.
     14  * See the License for the specific language governing permissions
     15  * and limitations under the License.
     16  * -------------------------------------------------------------------
     17  */
     18 /**
     19 This file contains application function interfaces to the AVC decoder library
     20 and necessary type defitionitions and enumerations.
     21 Naming convention for variables:
     22 lower_case_with_under_line  is  syntax element in subclause 7.2 and 7.3
     23 noUnderLine or NoUnderLine  is  derived variables defined somewhere else in the draft
     24                                 or introduced by this decoder library.
     25 @publishedAll
     26 */
     27 
     28 #ifndef _AVCDEC_INT_H_
     29 #define _AVCDEC_INT_H_
     30 
     31 #include "avcint_common.h"
     32 #include "avcdec_api.h"
     33 
     34 
     35 /**
     36 Bitstream structure contains bitstream related parameters such as the pointer
     37 to the buffer, the current byte position and bit position.
     38 @publishedAll
     39 */
     40 typedef struct tagDecBitstream
     41 {
     42     uint8 *bitstreamBuffer; /* pointer to buffer memory   */
     43     int nal_size;       /* size of the current NAL unit */
     44     int data_end_pos;  /* bitstreamBuffer size in bytes */
     45     int read_pos;       /* next position to read from bitstreamBuffer  */
     46     uint curr_word; /* byte-swapped (MSB left) current word read from buffer */
     47     int bit_left;      /* number of bit left in current_word */
     48     uint next_word;     /* in case for old data in previous buffer hasn't been flushed. */
     49     int incnt;  /* bit left in the prev_word */
     50     int incnt_next;
     51     int bitcnt;
     52     void *userData;
     53 } AVCDecBitstream;
     54 
     55 /**
     56 This structure is the main object for AVC decoder library providing access to all
     57 global variables. It is allocated at PVAVCInitDecoder and freed at PVAVCCleanUpDecoder.
     58 @publishedAll
     59 */
     60 typedef struct tagDecObject
     61 {
     62 
     63     AVCCommonObj *common;
     64 
     65     AVCDecBitstream     *bitstream; /* for current NAL */
     66 
     67     /* sequence parameter set */
     68     AVCSeqParamSet *seqParams[32]; /* Array of pointers, get allocated at arrival of new seq_id */
     69 
     70     /* picture parameter set */
     71     AVCPicParamSet *picParams[256]; /* Array of pointers to picture param set structures */
     72 
     73     /* For internal operation, scratch memory for MV, prediction, transform, etc.*/
     74     uint    ref_idx_l0[4]; /* [mbPartIdx], te(v) */
     75     uint    ref_idx_l1[4];
     76 
     77     /* function pointers */
     78     AVCDec_Status(*residual_block)(struct tagDecObject*, int,  int,
     79                                    int *, int *, int *);
     80     /* Application control data */
     81     AVCHandle *avcHandle;
     82     void (*AVC_DebugLog)(AVCLogType type, char *string1, char *string2);
     83     /*bool*/
     84     uint    debugEnable;
     85 
     86 } AVCDecObject;
     87 
     88 #endif /* _AVCDEC_INT_H_ */
     89