isoiff_hevc

Author:
Armin Trattnig
Version:
1.0
Includes:
"MP4Movies.h"
"MP4Atoms.h"

Introduction

Provides structs for HEVC Images in ISO Image File Format

Updated:
Friday, November 21, 2014


Functions

ISOIFF_AddNALUnitToHEVCDecConfRec
ISOIFF_AddNALUnitToHEVCItemData
ISOIFF_CreateHEVCConfigurationAtom
ISOIFF_CreateHEVCDecConfRecFromHandle
ISOIFF_CreateHEVCDecoderConfigRecord
ISOIFF_CreateHEVCItemData
ISOIFF_CreateHEVCItemDataFromHandle
ISOIFF_CreateImageSpatialExtentsPropertyAtom
ISOIFF_FreeHEVCDecoderConfigRecord
ISOIFF_FreeHEVCItemData
ISOIFF_GetHEVCDecConfRecordSize
ISOIFF_GetHEVCDecoderConfigRecordFromProperty
ISOIFF_GetHEVCItemDataLengthSizeMinusOne
ISOIFF_GetHEVCItemDataSize
ISOIFF_GetNALUDataHandlesFromHEVCItemData
ISOIFF_GetNALUnitsWithTypeFromHEVCDecConf
ISOIFF_ParseImageSpatialExtends
ISOIFF_PutHEVCDecConfRecordIntoHandle
ISOIFF_PutHEVCItemDataIntoHandle

ISOIFF_AddNALUnitToHEVCDecConfRec


MP4Err ISOIFF_AddNALUnitToHEVCDecConfRec (
    ISOIFF_HEVCDecoderConfigRecord hevcDecConfRec,
    u8 type,
    MP4Handle nalUnitData);  
Parameters
hevcDecConfRec

The HEVC decoder configuration record, the NAL unit will be added to

type

The type of the NAL Unit (VPS, SPS, PPS or SEI)

nalUnitData

A MP4Handle that contents will be copied and added

Discussion

Adds a NAL unit to a HEVC decoder configuration record (VPS, SPS, PPS or SEI NAL unit)


ISOIFF_AddNALUnitToHEVCItemData


MP4Err ISOIFF_AddNALUnitToHEVCItemData (
    ISOIFF_HEVCItemData hevcItemData,
    MP4Handle nalUnitData);  
Parameters
hevcItemData

The HEVC item data, the NAL unit will be added to

nalUnitData

A MP4Handle that contents will be copied and added

Discussion

Adds a NAL unit to a HEVC item data. (This will update the lengthSizeMinusOne field)


ISOIFF_CreateHEVCConfigurationAtom


Parameters
outAtom

Pointer that will hold a reference to the created HEVCConfigurationAtom

configRecord

HEVCDecoderConfigRecord that will be put into the atom

Discussion

Creates a HEVCConfigurationAtom (Allocates memory and initializes fields)


ISOIFF_CreateHEVCDecConfRecFromHandle


MP4Err ISOIFF_CreateHEVCDecConfRecFromHandle (
    MP4Handle recordDataHandle,
    ISOIFF_HEVCDecoderConfigRecord *outRecord);  
Parameters
recordDataHandle

MP4Handle that contains the HEVC decoder configuration record's item data

outRecord

Will be allocated and filled with contents parsed from the recordDataHandle

Discussion

Creates a HEVC decoder configuration record from a MP4Handle (This is the counterpart to ISOIFF_PutHEVCItemDataIntoHandle)


ISOIFF_CreateHEVCDecoderConfigRecord


Parameters
hevcDecConfRec

This ISOIFF_HEVCDecoderConfigRecord will be allocated and initialized

Discussion

Creates a HEVC decoder configuration record (Allocates memory and initializes fields)


ISOIFF_CreateHEVCItemData


Parameters
hevcItemData

This ISOIFF_HEVCItemData will be allocated and initialized

Discussion

Creates a HEVC item data (Allocates memory and initializes fields)


ISOIFF_CreateHEVCItemDataFromHandle


MP4Err ISOIFF_CreateHEVCItemDataFromHandle (
    MP4Handle itemDataHandle,
    ISOIFF_HEVCItemData *outHevcItemData,
    u8 lengthSizeMinusOne);  
Parameters
itemDataHandle

MP4Handle that contains the HEVC imgaes' item data

outHevcItemData

Will be allocated and filled with contents parsed from the itemDataHandle

lengthSizeMinusOne

This is needed to determine the size of the lenght field. (Can be found in the HEVC decoder configuration record)

Discussion

Creates a HEVC item data from a MP4Handle (This is the counterpart to ISOIFF_PutHEVCItemDataIntoHandle)


ISOIFF_CreateImageSpatialExtentsPropertyAtom


Parameters
outAtom

Pointer that will hold a reference to the created ImageSpatialExtentsPropertyAtom

Discussion

Creates a ImageSpatialExtentsPropertyAtom (Allocates memory and initializes fields)


ISOIFF_FreeHEVCDecoderConfigRecord


Parameters
hevcDecConfRec

HEVC decoder configuration record that will be deallocated

Discussion

Deallocates the memory used by HEVC decoder configuration record


ISOIFF_FreeHEVCItemData


Parameters
hevcItemData

HEVC item data that will be deallocated

Discussion

Deallocates the memory used by an HEVC item data


ISOIFF_GetHEVCDecConfRecordSize


MP4Err ISOIFF_GetHEVCDecConfRecordSize (
    ISOIFF_HEVCDecoderConfigRecord hevcDecConfRec,
    u32 *outSize);  
Parameters
hevcDecConfRec

The HEVC decoder configuration record

outSize

Will contain the size, must be allocated before calling the function

Discussion

Gets the size of an HEVC decoder configuration record.


ISOIFF_GetHEVCDecoderConfigRecordFromProperty


Parameters
property

Property atom that is of type hvcC

decoderConfig

HEVC decoder configuration record, which will be parsed

Discussion

Parses a HEVCDecoderConfigRecord from a property atom


ISOIFF_GetHEVCItemDataLengthSizeMinusOne


MP4Err ISOIFF_GetHEVCItemDataLengthSizeMinusOne (
    ISOIFF_HEVCItemData hevcItemData,
    u8 *lengthSizeMinusOne);  
Parameters
hevcItemData

The HEVC item data, that contains the lengthSizeMinusOne field

lengthSizeMinusOne

Will contain the value

Discussion

Gets the lengthSizeMinusOne (This is used for setting the HEVC decoder configuration record's field to the correct value)


ISOIFF_GetHEVCItemDataSize


MP4Err ISOIFF_GetHEVCItemDataSize (
    ISOIFF_HEVCItemData hevcItemData,
    u32 *outSize);  
Parameters
hevcItemData

The HEVC item data

outSize

Will contain the size, must be allocated before calling the function

Discussion

Gets the size of an HEVC item data.


ISOIFF_GetNALUDataHandlesFromHEVCItemData


MP4Err ISOIFF_GetNALUDataHandlesFromHEVCItemData (
    ISOIFF_HEVCItemData hevcItemData,
    MP4LinkedList naluDataHandles);  
Parameters
hevcItemData

The HEVC item data, that contains the NAL units

naluDataHandles

This is a MP4LinkedList containing MP4Handles of the HEVC NAL units

Discussion

Collects all HEVC NAL units from a HEVC item data


ISOIFF_GetNALUnitsWithTypeFromHEVCDecConf


MP4Err ISOIFF_GetNALUnitsWithTypeFromHEVCDecConf (
    ISOIFF_HEVCDecoderConfigRecord hevcDecConfRec,
    u8 type,
    MP4LinkedList nalUnits);  
Parameters
hevcDecConfRec

The HEVC decoder configuration record, that contains the NAL units

type

This is a MP4LinkedList containing MP4Handles of the HEVC NAL units

nalUnits

This is a MP4LinkedList containing MP4Handles of the HEVC NAL units

Discussion

Collects all HEVC NAL units of a certain type from a HEVC decoder configuration record (VPS, SPS, PPS or SEI NAL unit)


ISOIFF_ParseImageSpatialExtends


MP4Err ISOIFF_ParseImageSpatialExtends (
    MP4AtomPtr property);  
Parameters
property

Property atom that is of type ispe

Discussion

Parses an ImageSpatialExtentsProperty from a property atom and prints width and height


ISOIFF_PutHEVCDecConfRecordIntoHandle


MP4Err ISOIFF_PutHEVCDecConfRecordIntoHandle (
    ISOIFF_HEVCDecoderConfigRecord hevcDecConfRec,
    MP4Handle recordDataHandle);  
Parameters
hevcDecConfRec

The HEVC item data

recordDataHandle

Will contain the HEVC decoder configuration record in bytestream form (Must be created with MP4NewHandle before calling this function)

Discussion

Puts the HEVC decoder configuration record into a MP4Handle


ISOIFF_PutHEVCItemDataIntoHandle


MP4Err ISOIFF_PutHEVCItemDataIntoHandle (
    ISOIFF_HEVCItemData hevcItemData,
    MP4Handle itemDataHandle);  
Parameters
hevcItemData

The HEVC item data

itemDataHandle

Will contain the HEVC item data in bytestream form (Must be created with MP4NewHandle before calling this function)

Discussion

Puts the HEVC item data into a MP4Handle


Typedefs

ISOIFF_HEVCConfigurationAtom

HEVCConfigurationBox

ISOIFF_HEVCConfigurationAtomPtr

HEVCConfigurationBox

ISOIFF_HEVCDecoderConfigRecord

HEVC decoder configuration record

ISOIFF_HEVCItemData

Struct that holds HEVC NAL units for usage as an ISOIFF_Image's data

ISOIFF_ImageSpatialExtentsPropertyAtom

ImageSpatialExtentsPropertyAtom

ISOIFF_ImageSpatialExtentsPropertyAtomPtr

ImageSpatialExtentsPropertyAtom


ISOIFF_HEVCConfigurationAtom


HEVCConfigurationBox

typedef struct ISOIFF_HEVCConfigurationAtom { 
    MP4_BASE_ATOM  ISOIFF_HEVCDecoderConfigRecord configRecord; 
    MP4Handle configRecordHandle; 
} ISOIFF_HEVCConfigurationAtom, *ISOIFF_HEVCConfigurationAtomPtr;  

See Also


ISOIFF_HEVCConfigurationAtomPtr


HEVCConfigurationBox

typedef struct ISOIFF_HEVCConfigurationAtom { 
    MP4_BASE_ATOM  ISOIFF_HEVCDecoderConfigRecord configRecord; 
    MP4Handle configRecordHandle; 
} ISOIFF_HEVCConfigurationAtom, *ISOIFF_HEVCConfigurationAtomPtr;  

See Also


ISOIFF_HEVCDecoderConfigRecord


HEVC decoder configuration record

typedef struct ISOIFF_HEVCDecoderConfigRecordS { 
    u8 configurationVersion; 
    u8 general_profile_space; 
    u8 general_tier_flag; 
    u8 general_profile_idc; 
    u32 general_profile_compatibility_flags; 
    u64 general_constraint_indicator_flags; 
    u8 general_level_idc; 
    u16 min_spatial_segmentation_idc; 
    u8 parallelismType; 
    u8 chromaFormat; 
    u8 bitDepthLumaMinus8; 
    u8 bitDepthChromaMinus8; 
    u16 avgFrameRate; 
    u8 constantFrameRate; 
    u8 numTemporalLayers; 
    u8 temporalIdNested; 
    u8 lengthSizeMinusOne; 
    u8 numOfArrays; 
    MP4LinkedList arrays;  
} *ISOIFF_HEVCDecoderConfigRecord;  

See Also


ISOIFF_HEVCItemData


Struct that holds HEVC NAL units for usage as an ISOIFF_Image's data

typedef struct ISOIFF_HEVCItemDataS *ISOIFF_HEVCItemData;  

ISOIFF_ImageSpatialExtentsPropertyAtom


ImageSpatialExtentsPropertyAtom

typedef struct ISOIFF_ImageSpatialExtentsPropertyAtom { 
    MP4_FULL_ATOM u32 image_width; 
    u32 image_height; 
} ISOIFF_ImageSpatialExtentsPropertyAtom, *ISOIFF_ImageSpatialExtentsPropertyAtomPtr;  

See Also


ISOIFF_ImageSpatialExtentsPropertyAtomPtr


ImageSpatialExtentsPropertyAtom

typedef struct ISOIFF_ImageSpatialExtentsPropertyAtom { 
    MP4_FULL_ATOM u32 image_width; 
    u32 image_height; 
} ISOIFF_ImageSpatialExtentsPropertyAtom, *ISOIFF_ImageSpatialExtentsPropertyAtomPtr;  

See Also


Structs and Unions

ISOIFF_HEVCDecoderConfigRecordS

HEVC decoder configuration record


ISOIFF_HEVCDecoderConfigRecordS


HEVC decoder configuration record

typedef struct ISOIFF_HEVCDecoderConfigRecordS { 
    u8 configurationVersion; 
    u8 general_profile_space; 
    u8 general_tier_flag; 
    u8 general_profile_idc; 
    u32 general_profile_compatibility_flags; 
    u64 general_constraint_indicator_flags; 
    u8 general_level_idc; 
    u16 min_spatial_segmentation_idc; 
    u8 parallelismType; 
    u8 chromaFormat; 
    u8 bitDepthLumaMinus8; 
    u8 bitDepthChromaMinus8; 
    u16 avgFrameRate; 
    u8 constantFrameRate; 
    u8 numTemporalLayers; 
    u8 temporalIdNested; 
    u8 lengthSizeMinusOne; 
    u8 numOfArrays; 
    MP4LinkedList arrays;  
} *ISOIFF_HEVCDecoderConfigRecord;  

See Also