/*! ************************************************************************ * \brief * delete structure for storing coding state ************************************************************************ */ void delete_coding_state (CSobj *cs) { if (cs != NULL) { //=== structures of data partition array === if (cs->encenv != NULL) { free (cs->encenv); cs->encenv = NULL; } if (cs->bitstream != NULL) { free (cs->bitstream); cs->bitstream = NULL; } //=== contexts for binary arithmetic coding === delete_contexts_MotionInfo (cs->mot_ctx); delete_contexts_TextureInfo (cs->tex_ctx); if (cs->cbp_bits_8x8 != NULL) { free (cs->cbp_bits_8x8); cs->cbp_bits_8x8 = NULL; } //=== coding state structure === free (cs); cs=NULL; } }
/*! ************************************************************************ * \brief * Memory frees of the Slice structure and of its dependent * data structures * * \par Input: * Input Parameters struct inp_par *inp, struct img_par *img ************************************************************************ */ void free_slice(struct inp_par *inp, struct img_par *img) { Slice *currSlice = img->currentSlice; FreePartition (currSlice->partArr, 3); // if (inp->symbol_mode == CABAC) if (1) { // delete all context models delete_contexts_MotionInfo(currSlice->mot_ctx); delete_contexts_TextureInfo(currSlice->tex_ctx); } free(img->currentSlice); currSlice = NULL; }
/*! ************************************************************************ * \brief * Free allocated memory of frame size related global buffers * buffers are defined in global.h, allocated memory is allocated in * int init_global_buffers() * * \par Input: * Input Parameters struct inp_par *inp, Image Parameters struct img_par *img * * \par Output: * none * *----------------------------------------------------------------------- * Function Argument List Changed [Removing Global Variables] * Input parameters added are * - h264_decoder* dec_params * * <*****@*****.**> ************************************************************************ */ void free_global_buffers_baseline( h264_decoder* dec_params ) { ImageParameters* img = dec_params->img; // h264_free (dec_params->img->nz_coeff); h264_free (dec_params->img->nz_coeff1); // free mem, allocated for structure img // if (img->mb_data != NULL) // h264_free(img->mb_data); // faisal h264_free(img->slice_nr); h264_free(img->ei_flag); /////////////////////////////////////////////////////////////////////////////////// // memory deallocation for the new mb_data structure in the ImageParam structure // /////////////////////////////////////////////////////////////////////////////////// h264_free(img->mb_data1.cbp_blk); h264_free(img->mb_data1.LFAlphaC0Offset); h264_free(img->mb_data1.LFBetaOffset); h264_free(img->mb_data1.LFDisableIdc); h264_free(img->mb_data1.mb_type); h264_free(img->mb_data1.partition); h264_free(img->mb_data1.mbAvailA); h264_free(img->mb_data1.mbAvailB); h264_free(img->mb_data1.NoMbPartLessThan8x8Flag); h264_free(img->mb_data1.qp); /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// h264_free (dec_params->img->intra_block); free_mem2D ( (byte **) dec_params->img->ipredmode); free_mem3Dint(dec_params->img->wp_weight, 2); free_mem3Dint(dec_params->img->wp_offset, 6); free_mem4Dint(dec_params->img->wbp_weight, 6, MAX_REFERENCE_PICTURES); /* End of Change*/ // h264_free (dec_params->img->quad); delete_contexts_MotionInfo(dec_params->mot_ctx); delete_contexts_TextureInfo(dec_params->tex_ctx); dec_params->global_init_done = 0; }