00001 00002 /*! 00003 ************************************************************************************** 00004 * \file 00005 * parset.c 00006 * \brief 00007 * Picture and Sequence Parameter set generation and handling 00008 * \date 25 November 2002 00009 * \author 00010 * Main contributors (see contributors.h for copyright, address and affiliation details) 00011 * - Stephan Wenger <stewe@cs.tu-berlin.de> 00012 * 00013 ************************************************************************************** 00014 */ 00015 #include "global.h" 00016 #include "memalloc.h" 00017 00018 /*! 00019 ************************************************************************************* 00020 * \brief 00021 * Allocates memory for a pps 00022 * 00023 * \return 00024 * pointer to a pps 00025 ************************************************************************************* 00026 */ 00027 pic_parameter_set_rbsp_t *AllocPPS () 00028 { 00029 pic_parameter_set_rbsp_t *p; 00030 00031 if ((p=calloc (sizeof (pic_parameter_set_rbsp_t), 1)) == NULL) 00032 no_mem_exit ("AllocPPS: PPS"); 00033 p->slice_group_id = NULL; 00034 return p; 00035 } 00036 00037 00038 /*! 00039 ************************************************************************************* 00040 * \brief 00041 * Allocates memory for am sps 00042 * 00043 * \return 00044 * pointer to a sps 00045 ************************************************************************************* 00046 */ 00047 seq_parameter_set_rbsp_t *AllocSPS () 00048 { 00049 seq_parameter_set_rbsp_t *p; 00050 00051 if ((p=calloc (sizeof (seq_parameter_set_rbsp_t), 1)) == NULL) 00052 no_mem_exit ("AllocSPS: SPS"); 00053 return p; 00054 } 00055 00056 00057 /*! 00058 ************************************************************************************* 00059 * \brief 00060 * Frees a pps 00061 * 00062 * \param pps 00063 * pps to be freed 00064 * 00065 * \return 00066 * none 00067 ************************************************************************************* 00068 */ 00069 00070 void FreePPS (pic_parameter_set_rbsp_t *pps) 00071 { 00072 assert (pps != NULL); 00073 if (pps->slice_group_id != NULL) 00074 free (pps->slice_group_id); 00075 free (pps); 00076 } 00077 00078 00079 /*! 00080 ************************************************************************************* 00081 * \brief 00082 * Frees a sps 00083 * 00084 * \param sps 00085 * sps to be freed 00086 * 00087 * \return 00088 * none 00089 ************************************************************************************* 00090 */ 00091 00092 void FreeSPS (seq_parameter_set_rbsp_t *sps) 00093 { 00094 assert (sps != NULL); 00095 free (sps); 00096 }