⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 umc_h264_dec_defs_dec.h

📁 这是在PCA下的基于IPP库示例代码例子,在网上下了IPP的库之后,设置相关参数就可以编译该代码.
💻 H
📖 第 1 页 / 共 3 页
字号:
/*////              INTEL CORPORATION PROPRIETARY INFORMATION//  This software is supplied under the terms of a license  agreement or//  nondisclosure agreement with Intel Corporation and may not be copied//  or disclosed except in  accordance  with the terms of that agreement.//        Copyright (c) 2003-2005 Intel Corporation. All Rights Reserved.////*/#ifndef __UMC_H264_DEC_DEFS_DEC_H__#define __UMC_H264_DEC_DEFS_DEC_H__#include <string.h>#include "ippdefs.h"#include "ippvc.h"#include "ipps.h"#include "umc_h264_dec_ipplevel.h"namespace UMC{#if defined (_ARM_) || defined (ARM) || defined (_WIN32_WCE)#define SMALL_MEMORY_USE#endif//#define USE_SEI since it's not always correct better turn this off//// Define some useful macros//#define MAX_NUM_SLICE_GROUPS 8#define MAX_SLICE_GROUP_MAP_TYPE 6#undef  MAX#define MAX(a, b)       (((a) > (b)) ? (a) : (b))#undef  MIN#define MIN(a, b)       (((a) < (b)) ? (a) : (b))#undef  ABS#define ABS(A) ((A)<(0) ? (-(A)):(A))#define    _ALIGN(p, n)    ((Ipp8u*)(p) + ((((Ipp8u*)(p) - (Ipp8u*)(0)) & ((n)-1)) ? \                            ((n) - (((Ipp8u*)(p) - (Ipp8u*)(0)) & ((n)-1))) : 0))#define    _IS_ALIGNED(p, n)    (!(((Ipp8u*)(p) - (Ipp8u*)(0)) & ((n)-1)))//#define REDUCE_DPB_TO_MAX_REF_FRAMES //NonStandart REDUCTION!!!    // Although the standard allows for a minimum width or height of 4, this// implementation restricts the minimum value to 32.#define FLD_STRUCTURE 0#define TOP_FLD_STRUCTURE 0#define BOTTOM_FLD_STRUCTURE 1#define FRM_STRUCTURE 2#define AFRM_STRUCTURE 3#ifndef SHARED_ENCDEC_STRUCTURES_DEFS#define SHARED_ENCDEC_STRUCTURES_DEFS#define NORMAL_FRAME_PROCESSING 0#define COMBINE_FIELDS 1#define REPEAT_LAST_FRAME  2// Valid QP rangeconst Ipp32s QP_MAX = 51;const Ipp32s QP_MIN = 0;// Note!  The Picture Code Type values below are no longer used in the// core encoder.   It only knows about slice types, and whether or not// the frame is IDR, Reference or Disposable.  See enum above.enum EnumSliceCodType        // Permitted MB Prediction Types{                        // ------------------------------------    PREDSLICE      = 0,    // I (Intra), P (Pred)    BPREDSLICE     = 1, // I, P, B (BiPred)    INTRASLICE       = 2,    // I    S_PREDSLICE    = 3,    // SP (SPred), I    S_INTRASLICE   = 4    // SI (SIntra), I};typedef enum {    MBTYPE_INTRA,            // 4x4    MBTYPE_INTRA_16x16,    MBTYPE_PCM,                // Raw Pixel Coding, qualifies as a INTRA type...    MBTYPE_INTER,            // 16x16    MBTYPE_INTER_16x8,    MBTYPE_INTER_8x16,    MBTYPE_INTER_8x8,    MBTYPE_INTER_8x8_REF0,    MBTYPE_FORWARD,    MBTYPE_BACKWARD,    MBTYPE_SKIPPED,    MBTYPE_DIRECT,    MBTYPE_BIDIR,    MBTYPE_FWD_FWD_16x8,    MBTYPE_FWD_FWD_8x16,    MBTYPE_BWD_BWD_16x8,    MBTYPE_BWD_BWD_8x16,    MBTYPE_FWD_BWD_16x8,    MBTYPE_FWD_BWD_8x16,    MBTYPE_BWD_FWD_16x8,    MBTYPE_BWD_FWD_8x16,    MBTYPE_BIDIR_FWD_16x8,    MBTYPE_BIDIR_FWD_8x16,    MBTYPE_BIDIR_BWD_16x8,    MBTYPE_BIDIR_BWD_8x16,    MBTYPE_FWD_BIDIR_16x8,    MBTYPE_FWD_BIDIR_8x16,    MBTYPE_BWD_BIDIR_16x8,    MBTYPE_BWD_BIDIR_8x16,    MBTYPE_BIDIR_BIDIR_16x8,    MBTYPE_BIDIR_BIDIR_8x16,    MBTYPE_B_8x8,    NUMBER_OF_MBTYPES} MB_Type;// 8x8 Macroblock subblock type definitionstypedef enum {    SBTYPE_8x8 = 0,        // P slice modes    SBTYPE_8x4 = 1,    SBTYPE_4x8 = 2,    SBTYPE_4x4 = 3,    SBTYPE_DIRECT = 4,            // B Slice modes    SBTYPE_FORWARD_8x8 = 5,        // Subtract 4 for mode #    SBTYPE_BACKWARD_8x8 = 6,    SBTYPE_BIDIR_8x8 = 7,    SBTYPE_FORWARD_8x4 = 8,    SBTYPE_FORWARD_4x8 = 9,    SBTYPE_BACKWARD_8x4 = 10,    SBTYPE_BACKWARD_4x8 = 11,    SBTYPE_BIDIR_8x4 = 12,    SBTYPE_BIDIR_4x8 = 13,    SBTYPE_FORWARD_4x4 = 14,    SBTYPE_BACKWARD_4x4 = 15,    SBTYPE_BIDIR_4x4 = 16} SB_Type;#endif /*SHARED_ENCDEC_STRUCTURES_DEFS*/#define IS_I_SLICE(SliceType) ((SliceType) == INTRASLICE)#define IS_P_SLICE(SliceType) ((SliceType) == PREDSLICE || (SliceType) == S_PREDSLICE)#define IS_B_SLICE(SliceType) ((SliceType) == BPREDSLICE)#define MAX_SKIP_REPEAT 4#define SKIP_DEBLOCKING_MODE 1#define SKIP_NONREF_FRAMES_MODE 10#define SKIP_THRESHOLD4 64#define SKIP_THRESHOLD3 8#define SKIP_THRESHOLD2 2#define SKIP_THRESHOLD1 1#define SKIP_PER_CYCLE 1#define NUM_SKIP_PER_CYCLE 1#define INCREASE_SKIP_REPEAT_COUNTER(value)(m_SkipRepeat+=(value))#define IS_SKIP_DEBLOCKING_MODE (m_PermanentTurnOffDeblocking>0)#define IS_SKIP_NONREF_FRAMES_MODE(mode) ((mode)>=SKIP_DEBLOCKING_MODE /*&& (mode)<SKIP_NONREF_FRAMES_MODE*/)#define IS_DECODE_ONLY_INTRA_REF_SLICES(mode) ((mode)>=SKIP_NONREF_FRAMES_MODE && 0)#define QPFromCode(x) ClipQPTable[x+52];// Macroblock type definitions// Keep these ordered such that intra types are first, followed by// inter types.  Otherwise you'll need to change the definitions// of IS_INTRA_MBTYPE and IS_INTER_MBTYPE.//// WARNING:  Because the decoder exposes macroblock types to the application,// these values cannot be changed without affecting users of the decoder.// If new macro block types need to be inserted in the middle of the list,// then perhaps existing types should retain their numeric value, the new// type should be given a new value, and for coding efficiency we should// perhaps decouple these values from the ones that are encoded in the// bitstream.////#define MAX_NUM_SEQ_PARAM_SETS 32#define MAX_NUM_PIC_PARAM_SETS 128// Possible values for disable_deblocking_filter_idc:#define DEBLOCK_FILTER_ON                   0#define DEBLOCK_FILTER_OFF                  1#define DEBLOCK_FILTER_ON_NO_SLICE_EDGES    2#define MAX_DEC_BATCH_MB 120*68//45*30#define MAX_SLICE_NUM 64 //INCREASE IF NEEDED OR SET to -1 for adaptive counting (increases memory usage)#define MAX_NUM_REF_FRAMES 32// macro - yields TRUE if a given MB type is INTRA#define IS_INTRA_MBTYPE(mbtype) ((mbtype) < MBTYPE_INTER)// macro - yields TRUE if a given MB type is INTER#define IS_INTER_MBTYPE(mbtype) ((mbtype) >= MBTYPE_INTER)// Sequence parameter set structure, corresponding to the H.264 bitstream definition.struct H264SeqParamSet{    Ipp8u        profile_idc;                        // baseline, main, etc.    Ipp8u        level_idc;    Ipp8u        constrained_set0_flag;    Ipp8u        constrained_set1_flag;    Ipp8u        constrained_set2_flag;    Ipp8u        constrained_set3_flag;    Ipp8u        gaps_in_frame_num_value_allowed_flag;    Ipp8u        frame_cropping_flag;    Ipp32u       frame_cropping_rect_left_offset;    Ipp32u       frame_cropping_rect_right_offset;    Ipp32u       frame_cropping_rect_top_offset;    Ipp32u       frame_cropping_rect_bottom_offset;    Ipp8u        more_than_one_slice_group_allowed_flag;    Ipp8u        arbitrary_slice_order_allowed_flag;    // If zero, slice order in pictures must                                                    // be in increasing MB address order.    Ipp8u        redundant_pictures_allowed_flag;    Ipp8u        seq_parameter_set_id;                // id of this sequence parameter set    Ipp8u        log2_max_frame_num;                    // Number of bits to hold the frame_num    Ipp8u        pic_order_cnt_type;                    // Picture order counting method    Ipp8u        delta_pic_order_always_zero_flag;    // If zero, delta_pic_order_cnt fields are                                                    // present in slice header.    Ipp8u        frame_mbs_only_flag;                // Nonzero indicates all pictures in sequence                                                    // are coded as frames (not fields).    Ipp8u        required_frame_num_update_behavior_flag;    Ipp8u        mb_adaptive_frame_field_flag;        // Nonzero indicates frame/field switch                                                    // at macroblock level    Ipp8u        direct_8x8_inference_flag;            // Direct motion vector derivation method    Ipp8u        vui_parameters_present_flag;        // Zero indicates default VUI parameters    Ipp32u       log2_max_pic_order_cnt_lsb;            // Value of MaxPicOrderCntLsb.    Ipp32s       offset_for_non_ref_pic;    Ipp32s       offset_for_top_to_bottom_field;        // Expected pic order count difference from                                                // top field to bottom field.    Ipp32u       num_ref_frames_in_pic_order_cnt_cycle;    Ipp32s       *poffset_for_ref_frame;                // pointer to array of stored frame offsets,                                                    // length num_stored_frames_in_pic_order_cnt_cycle,                                                    // for pic order cnt type 1    Ipp32u       num_ref_frames;                        // total number of pics in decoded pic buffer    Ipp32u       frame_width_in_mbs;    Ipp32u       frame_height_in_mbs;    // These fields are calculated from values above.  They are not written to the bitstream    Ipp32u       MaxMbAddress;    Ipp32u       MaxPicOrderCntLsb;    // vui part    Ipp8u        aspect_ratio_info_present_flag;    Ipp8u        aspect_ratio_idc;    Ipp16u       sar_width;    Ipp16u       sar_height;    Ipp8u        overscan_info_present_flag;    Ipp8u        overscan_appropriate_flag;    Ipp8u        video_signal_type_present_flag;    Ipp8u        video_format;    Ipp8u        video_full_range_flag;    Ipp8u        colour_description_present_flag;    Ipp8u        colour_primaries;    Ipp8u        transfer_characteristics;    Ipp8u        matrix_coefficients;    Ipp8u        chroma_loc_info_present_flag;    Ipp8u        chroma_sample_loc_type_top_field;    Ipp8u        chroma_sample_loc_type_bottom_field;    Ipp8u        timing_info_present_flag;    Ipp32u       num_units_in_tick;    Ipp32u       time_scale;    Ipp8u        fixed_frame_rate_flag;    Ipp8u        nal_hrd_parameters_present_flag;    Ipp8u        vcl_hrd_parameters_present_flag;    Ipp8u        low_delay_hrd_flag;    Ipp8u        pic_struct_present_flag;    Ipp8u        bitstream_restriction_flag;    Ipp8u        motion_vectors_over_pic_boundaries_flag;    Ipp8u        max_bytes_per_pic_denom;    Ipp8u        max_bits_per_mb_denom;    Ipp8u        log2_max_mv_length_horizontal;    Ipp8u        log2_max_mv_length_vertical;    Ipp8u        num_reorder_frames;    Ipp8u        max_dec_frame_buffering;    //hrd_parameters    Ipp8u        cpb_cnt;    Ipp8u        bit_rate_scale;    Ipp8u        cpb_size_scale;    Ipp32u        bit_rate_value[32];    Ipp8u        cpb_size_value[32];    Ipp8u        cbr_flag[32];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -