/****************************************************************************** * * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ***************************************************************************** * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore */ /*! ************************************************************************** * \file isvcd_nal.h * * \brief * Contains routines that resample for SVC resampling * * Detailed_description * * \date * * * \author : Kishore ************************************************************************** */ #ifndef _SVCD_NAL_H_ #define _SVCD_NAL_H_ /*****************************************************************************/ /* File Includes */ /*****************************************************************************/ /*****************************************************************************/ /* Constant Macros */ /*****************************************************************************/ #define START_CODE_NOT_FOUND -1 #define END_OF_STREAM_BUFFER -2 #define END_OF_STREAM -1 #define SC_NOT_FOUND (-1) #define SC_FOUND 1 #define NUM_OF_ZERO_BYTES_BEFORE_START_CODE (2) #define START_CODE_BYTE (0x01) #define EMULATION_PREVENTION_BYTE (0x03) /*****************************************************************************/ /* Function Macros */ /*****************************************************************************/ /*****************************************************************************/ /* Typedefs */ /*****************************************************************************/ /*****************************************************************************/ /* Enums */ /*****************************************************************************/ typedef enum { NON_VCL_NAL, VCL_NAL } DERIVED_NAL_UNIT_TYPE_T; typedef enum { NAL_START = 0, FIND_NAL_END, NAL_END } NAL_BOUND_DETECT_STATE_T; typedef enum { STUFFED_BYTE = 0, /* Should be used for reset purposes */ NOT_STUFFED_BYTE } EMULATION_STATE_T; typedef enum { NAL_INSUFFICIENT_DATA = (WORD32) 0x80000000, NAL_CORRUPT_DATA = (WORD32) 0x80000001 } NAL_PARSE_ERR_CODES_T; /*****************************************************************************/ /* Structure */ /*****************************************************************************/ typedef struct { WORD32 i4_nal_ref_idc; /*!< NAL ref idc - decoded prm from the bitstream */ WORD32 i4_nal_unit_type; /*!< NAL unit type - decoded prm from the bitstream */ WORD32 i4_priority_id; /*!< Priority id of NAL - decoded prm from the bitstream. If not present then set to 0 */ WORD32 i4_dependency_id; /*!< dependency id of NAL - decoded prm from the bitstream. If not present then set to 0 */ WORD32 i4_quality_id; /*!< Quality id of NAL - decoded prm from the bitstream. If not present then set to 0 */ WORD32 i4_temporal_id; /*!< Temporal id of NAL - decoded prm from the bitstream. If not present then set to 0 */ WORD32 i4_no_int_lyr_pred; /*!< No inter layer predictiion flag of NAL - decoded prm from the bitstream. if not present then it is set to 0 */ WORD32 i4_use_ref_base_pic_flag; /*!