void InitTmpBuffers(PB_INSTANCE * pbi){ /* clear any existing info */ ClearTmpBuffers(pbi); /* Adjust the position of all of our temporary */ pbi->ReconDataBuffer = _ogg_malloc(64*sizeof(*pbi->ReconDataBuffer)); pbi->DequantBuffer = _ogg_malloc(64 * sizeof(*pbi->DequantBuffer)); pbi->TmpDataBuffer = _ogg_malloc(64 * sizeof(*pbi->TmpDataBuffer)); pbi->TmpReconBuffer = _ogg_malloc(64 * sizeof(*pbi->TmpReconBuffer)); pbi->dequant_Y_coeffs = _ogg_malloc(64 * sizeof(*pbi->dequant_Y_coeffs)); pbi->dequant_UV_coeffs = _ogg_malloc(64 * sizeof(*pbi->dequant_UV_coeffs)); pbi->dequant_Inter_coeffs = _ogg_malloc(64 * sizeof(*pbi->dequant_Inter_coeffs)); pbi->dequant_InterUV_coeffs = _ogg_malloc(64 * sizeof(*pbi->dequant_InterUV_coeffs)); }
void ClearPBInstance(PB_INSTANCE *pbi){ if(pbi){ ClearTmpBuffers(pbi); if (pbi->opb) { _ogg_free(pbi->opb); } } }
void theora_encoder_clear (CP_INSTANCE * cpi){ if(cpi){ ClearHuffmanSet(&cpi->pb); ClearFragmentInfo(&cpi->pb); ClearFrameInfo(&cpi->pb); EClearFragmentInfo(cpi); EClearFrameInfo(cpi); ClearTmpBuffers(&cpi->pb); ClearPPInstance(&cpi->pp); oggpackB_writeclear(cpi->oggbuffer); _ogg_free(cpi->oggbuffer); _ogg_free(cpi); } }
static void theora_encode_clear (theora_state *th){ CP_INSTANCE *cpi; cpi=(CP_INSTANCE *)th->internal_encode; if(cpi){ ClearHuffmanSet(&cpi->pb); ClearFragmentInfo(&cpi->pb); ClearFrameInfo(&cpi->pb); EClearFragmentInfo(cpi); EClearFrameInfo(cpi); ClearTmpBuffers(&cpi->pb); ClearPPInstance(&cpi->pp); oggpackB_writeclear(cpi->oggbuffer); _ogg_free(cpi->oggbuffer); _ogg_free(cpi); } memset(th,0,sizeof(*th)); }