--- common/video/iso-mpeg4/src/vtc_main_vtcdec.cpp.orig 2005-05-04 13:56:00.000000000 -0600 +++ common/video/iso-mpeg4/src/vtc_main_vtcdec.cpp 2009-11-19 02:31:58.000000000 -0700 @@ -174,9 +174,9 @@ get_err_resilience_header(); if (TU_first != 0) - errorHandler("Reading incorrect TU_first in the first packet.\n"); + errorHandler((char*)"Reading incorrect TU_first in the first packet.\n"); if (get_X_bits(1) != 1) - errorHandler("Reading incorrect HEC in the first packet.\n"); + errorHandler((char*)"Reading incorrect HEC in the first packet.\n"); if (mzte_codec.m_iScanDirection==1) /* BB */ ; @@ -209,7 +209,7 @@ still_texture_object_start_code = get_X_bits(32); if (still_texture_object_start_code != STILL_TEXTURE_OBJECT_START_CODE) - errorHandler("Wrong texture_object_layer_start_code."); + errorHandler((char*)"Wrong texture_object_layer_start_code."); texture_object_id = get_X_bits(16); marker_bit = get_X_bits(1); @@ -278,7 +278,7 @@ // hjlee 0901 filters = (FILTER **)malloc(sizeof(FILTER *)*mzte_codec.m_iWvtDecmpLev); if(filters==NULL) - errorHandler("Memory allocation error\n"); + errorHandler((char*)"Memory allocation error\n"); if (wavelet_download == 1) { mzte_codec.m_iWvtUniform=wavelet_uniform = get_X_bits(1); if(wavelet_uniform) { @@ -331,7 +331,7 @@ /* decode the shape info from bitstream */ if(mzte_codec.m_iAlphaChannel) - noteProgress("Decoding Shape Information..."); + noteProgress((char*)"Decoding Shape Information..."); *Image = (PICTURE *)malloc(sizeof(PICTURE)*3); @@ -358,7 +358,7 @@ still_texture_object_start_code = get_X_bits(32); if (still_texture_object_start_code != STILL_TEXTURE_OBJECT_START_CODE) - errorHandler("Wrong texture_object_layer_start_code."); + errorHandler((char*)"Wrong texture_object_layer_start_code."); h_size += 32; mzte_codec.m_tiling_disable = get_X_bits(1); @@ -511,7 +511,7 @@ // hjlee 0901 filters = (FILTER **)malloc(sizeof(FILTER *)*mzte_codec.m_iWvtDecmpLev); if(filters==NULL) - errorHandler("Memory allocation error\n"); + errorHandler((char*)"Memory allocation error\n"); if (wavelet_download == 1) { mzte_codec.m_iWvtUniform=wavelet_uniform = get_X_bits(1); h_size += 1; // added by Sharp (99/2/16) @@ -619,7 +619,7 @@ /* decode the shape info from bitstream */ if(mzte_codec.m_iAlphaChannel) - noteProgress("Decoding Shape Information..."); + noteProgress((char*)"Decoding Shape Information..."); *Image = (PICTURE *)malloc(sizeof(PICTURE)*3); //begin: added by SL @Sarnoff (03/03/99) mzte_codec.m_iTargetSpatialLev = MIN(mzte_codec.m_iSpatialLev, mzte_codec.m_iTargetSpatialLev); @@ -643,7 +643,7 @@ filters); //modified by SL @Sarnoff (03/03/99) //begin: added by SL @Sarnoff (03/03/99) if(target_shape_layer > target_spatial_layer) { - noteWarning("Shape has less spatial layers than target,\n forced to use shape spatial layers.\n"); + noteWarning((char*)"Shape has less spatial layers than target,\n forced to use shape spatial layers.\n"); if(mzte_codec.m_iQuantType == 2) { for(i=0;i< mzte_codec.m_iSpatialLev;i++) { if( mzte_codec.m_lastWvtDecompInSpaLayer[i][0] > mzte_codec.m_iWvtDecmpLev -1 - target_shape_layer){ @@ -733,7 +733,7 @@ { Int col, err; - noteProgress("Decoding DC coefficients...."); + noteProgress((char*)"Decoding DC coefficients...."); for (col=0; col<mzte_codec.m_iColors; col++) { /* initilize all wavelet coefficients */ @@ -746,7 +746,7 @@ /* dequantize DC coefficients */ err=decIQuantizeDC(col); } - noteProgress("Completed decoding of DC coefficients."); + noteProgress((char*)"Completed decoding of DC coefficients."); } @@ -768,14 +768,14 @@ } for (col=0; col<mzte_codec.m_iColors; col++){ - noteProgress("Single-Quant Mode (Band by Band) - Spatial %d, SNR 0, "\ + noteProgress((char*)"Single-Quant Mode (Band by Band) - Spatial %d, SNR 0, "\ "Color %d",spa_lev,col); fflush(stderr); mzte_codec.m_iCurColor = col; if(spa_lev !=0 || col == 0){ wavelet_higher_bands_decode_SQ_band(col); if(decIQuantizeAC_spa(spa_lev,col)) - errorHandler("decIQuantizeAC_spa"); + errorHandler((char*)"decIQuantizeAC_spa"); } } @@ -807,12 +807,12 @@ texture_spatial_layer_start_code = get_X_bits(32); if (texture_spatial_layer_start_code != TEXTURE_SPATIAL_LAYER_START_CODE) - errorHandler("Wrong texture_spatial_layer_start_code %x.", + errorHandler((char*)"Wrong texture_spatial_layer_start_code %x.", texture_spatial_layer_start_code); texture_spatial_layer_id = get_X_bits(5); if (texture_spatial_layer_id != spa_lev) - errorHandler("Incorrect texture_spatial_layer_id"); + errorHandler((char*)"Incorrect texture_spatial_layer_id"); mzte_codec.m_SPlayer[0].SNR_scalability_levels = 1; TextureSpatialLayerSQNSC_dec(spa_lev); @@ -828,7 +828,7 @@ Int col, err, spa_lev; SNR_IMAGE *snr_image; - noteProgress("Decoding AC coefficients - Single-Quant Mode...."); + noteProgress((char*)"Decoding AC coefficients - Single-Quant Mode...."); /* added for compatability with MQ spatial layer flexability - ph 7/16 */ setSpatialLayerDimsSQ(0); // hjlee 0901 @@ -845,7 +845,7 @@ /* initialize AC coefficient info */ if ((err=ztqInitAC(1, col))) - errorHandler("ztqInitAC"); + errorHandler((char*)"ztqInitAC"); snr_image=&(mzte_codec.m_SPlayer[col].SNRlayer.snr_image); } @@ -867,7 +867,7 @@ { /* Inverse quantize AC coefficients */ if ((err=decIQuantizeAC(col))) - errorHandler("decIQuantizeAC"); + errorHandler((char*)"decIQuantizeAC"); } } @@ -902,7 +902,7 @@ } } - noteProgress("Completed decoding AC coefficients - Single-Quant Mode."); + noteProgress((char*)"Completed decoding AC coefficients - Single-Quant Mode."); } @@ -915,16 +915,16 @@ mzte_codec.m_iCurSpatialLev=spa_lev; if(mzte_codec.m_bStartCodeEnable){ - noteProgress("Decoding Multi-Quant Mode Layer with SNR start code...."); + noteProgress((char*)"Decoding Multi-Quant Mode Layer with SNR start code...."); /* header info */ if(get_X_bits(32) != texture_snr_layer_start_code) - errorHandler("Error in decoding texture_snr_layer_start_code"); + errorHandler((char*)"Error in decoding texture_snr_layer_start_code"); texture_snr_layer_id=get_X_bits(5); } else - noteProgress("Decoding Multi-Quant Mode Layer without SNR start code...."); + noteProgress((char*)"Decoding Multi-Quant Mode Layer without SNR start code...."); - noteProgress("Multi-Quant Mode - Spatial %d, SNR %d", spa_lev,snr_lev); + noteProgress((char*)"Multi-Quant Mode - Spatial %d, SNR %d", spa_lev,snr_lev); for(col=0; col < NCOL; @@ -941,7 +941,7 @@ Get_Quant_and_Max(snr_image,spa_lev,col); // hjlee 0901 updateResidMaxAndAssignSkips(col); - noteDebug("resid_max=%d\n",snr_image->residual_max); + noteDebug((char*)"resid_max=%d\n",snr_image->residual_max); } wavelet_higher_bands_decode_MQ(mzte_codec.m_iScanDirection); @@ -955,15 +955,15 @@ /* quantize and mark zerotree structure for AC coefficients */ if (decIQuantizeAC(col)) - errorHandler("decQuantizeAndMarkAC"); + errorHandler((char*)"decQuantizeAndMarkAC"); - noteDebug("max_root=%d max_valz=%d max_valnz=%d max_resi=%d", + noteDebug((char*)"max_root=%d max_valz=%d max_valnz=%d max_resi=%d", ROOT_MAX(col),VALZ_MAX(col),VALNZ_MAX(col), RESID_MAX(col)); /* Update states of ac coefficients */ if (decUpdateStateAC(col)) - errorHandler("decUpdateStateAC"); + errorHandler((char*)"decUpdateStateAC"); } } @@ -989,27 +989,27 @@ /*------- AC: Initialize QList Structure -------*/ if ((err=ztqQListInit())) - errorHandler("Allocating memory for QList information."); + errorHandler((char*)"Allocating memory for QList information."); // hjlee 0901 /* Initialize coeffs */ setSpatialLevelAndDimensions(0,0); if ((err=ztqInitAC(1,0))) - errorHandler("ztqInitAC"); + errorHandler((char*)"ztqInitAC"); if (mzte_codec.m_lastWvtDecompInSpaLayer[0][1]<0) setSpatialLevelAndDimensions(1,1); else setSpatialLevelAndDimensions(0,1); if ((err=ztqInitAC(1,1))) - errorHandler("ztqInitAC"); + errorHandler((char*)"ztqInitAC"); if (mzte_codec.m_lastWvtDecompInSpaLayer[0][2]<0) setSpatialLevelAndDimensions(1,2); else setSpatialLevelAndDimensions(0,2); if ((err=ztqInitAC(1,2))) - errorHandler("ztqInitAC"); + errorHandler((char*)"ztqInitAC"); /* Loop through spatial layers */ @@ -1067,7 +1067,7 @@ mzte_codec.m_iCurSpatialLev,mzte_codec.m_iCurSNRLev); #endif if ((bitfile=fopen(fname,"rb"))==NULL) - errorHandler("Can't open file '%s' for reading.",fname); + errorHandler((char*)"Can't open file '%s' for reading.",fname); /* initialize the buffer */ init_bit_packing_fp(bitfile,1); @@ -1080,12 +1080,12 @@ texture_spatial_layer_start_code = get_X_bits(32); if (texture_spatial_layer_start_code != TEXTURE_SPATIAL_LAYER_START_CODE) - errorHandler("Wrong texture_spatial_layer_start_code3 %x.", + errorHandler((char*)"Wrong texture_spatial_layer_start_code3 %x.", texture_spatial_layer_start_code); texture_spatial_layer_id = get_X_bits(5); if(texture_spatial_layer_id !=spa_lev) - errorHandler("Incorrect texture_spatial_layer_id"); + errorHandler((char*)"Incorrect texture_spatial_layer_id"); snr_scalability_levels = get_X_bits(5); mzte_codec.m_SPlayer[0].SNR_scalability_levels = snr_scalability_levels; @@ -1135,7 +1135,7 @@ /*------- DC: Open and initialize bitstream file -------*/ if ((bitfile=fopen(m_cInBitsFile,"rb"))==NULL) - errorHandler("Can't open file '%s' for reading.",m_cInBitsFile); + errorHandler((char*)"Can't open file '%s' for reading.",m_cInBitsFile); /* initialize variables */ init_bit_packing_fp(bitfile,1); @@ -1145,7 +1145,7 @@ wvtfilter = *pwvtfilter; // hjlee 0901 /*--------------- CREATE DATA STRUCTURES -----------------*/ - noteDetail("Creating and initializing data structures...."); + noteDetail((char*)"Creating and initializing data structures...."); mzte_codec.m_iColors = 3; mzte_codec.m_iBitDepth = 8; usemask = mzte_codec.m_iAlphaChannel = 0; @@ -1190,7 +1190,7 @@ } - noteDetail("Completed creating and initializing data structures."); + noteDetail((char*)"Completed creating and initializing data structures."); mzte_codec.m_iDCHeight = mzte_codec.m_iHeight >> mzte_codec.m_iWvtDecmpLev; mzte_codec.m_iDCWidth = mzte_codec.m_iWidth >> mzte_codec.m_iWvtDecmpLev; @@ -1222,7 +1222,7 @@ Width[col], Height[col], nLevels[col], &(wvtfilter[col==0?0:1])); if (ret!= DWT_OK) - errorHandler("DWT Error Code %d\n", ret); + errorHandler((char*)"DWT Error Code %d\n", ret); for (k=0,y=0; y<Height[col]; y++) for (x=0; x<Width[col]; x++) @@ -1233,7 +1233,7 @@ if (target_spatial_levels<=0 || target_snr_levels<= 0) - errorHandler("Neither target_spatial_levels nor target_snr_levels" \ + errorHandler((char*)"Neither target_spatial_levels nor target_snr_levels" \ "can be zero"); /*------- DC: Decode and inverse quantize all color components -------*/ @@ -1351,7 +1351,7 @@ wvtfilter = *pwvtfilter; // hjlee 0901 /*--------------- CREATE DATA STRUCTURES -----------------*/ - noteDetail("Creating and initializing data structures...."); + noteDetail((char*)"Creating and initializing data structures...."); mzte_codec.m_iColors = 3; mzte_codec.m_iBitDepth = 8; usemask = mzte_codec.m_iAlphaChannel;//= 0; // modified by SL@Sarnoff (03/03/99) @@ -1394,7 +1394,7 @@ } } - noteDetail("Completed creating and initializing data structures."); + noteDetail((char*)"Completed creating and initializing data structures."); } // added by Sharp (99/2/16) mzte_codec.m_iDCHeight = mzte_codec.m_iHeight >> mzte_codec.m_iWvtDecmpLev; @@ -1427,7 +1427,7 @@ Width[col], Height[col], nLevels[col], &(wvtfilter[col==0?0:1])); if (ret!= DWT_OK) - errorHandler("DWT Error Code %d\n", ret); + errorHandler((char*)"DWT Error Code %d\n", ret); for (k=0,y=0; y<Height[col]; y++) for (x=0; x<Width[col]; x++) @@ -1438,7 +1438,7 @@ if (target_spatial_levels<=0 || target_snr_levels<= 0) - errorHandler("Neither target_spatial_levels nor target_snr_levels" \ + errorHandler((char*)"Neither target_spatial_levels nor target_snr_levels" \ "can be zero"); /*------- DC: Decode and inverse quantize all color components -------*/ @@ -1529,7 +1529,7 @@ } } - noteDetail("Completed creating and initializing data structures."); + noteDetail((char*)"Completed creating and initializing data structures."); } // added by Sharp (99/2/16) if (mzte_codec.m_iSingleBitFile==0){ @@ -1568,7 +1568,7 @@ Int MinLevel = 0, TileX = 0, TileY = 0; // end: added by Sharp (99/5/10) - noteProgress("\n----- MPEG-4 Visual Texture Coding: Decoding -----\n"); + noteProgress((char*)"\n----- MPEG-4 Visual Texture Coding: Decoding -----\n"); mzte_codec.m_visual_object_verid = 2; //VERSION; // This value is set to 2 tentatively @@ -1581,7 +1581,7 @@ if ( mzte_codec.m_visual_object_verid != 1 ){ - noteProgress("Version 2 bitstream\n"); + noteProgress((char*)"Version 2 bitstream\n"); //Added by Sarnoff for error resilience, 3/5/99 if(!mzte_codec.m_usErrResiDisable) @@ -1612,7 +1612,7 @@ // begin: added by Sharp (99/2/16) if ((bitfile=fopen(m_cInBitsFile,"rb"))==NULL) - errorHandler("Can't open file '%s' for reading.",m_cInBitsFile); + errorHandler((char*)"Can't open file '%s' for reading.",m_cInBitsFile); /* initialize variables */ init_bit_packing_fp(bitfile,1); @@ -1751,7 +1751,7 @@ // begin: added by Sharp (99/4/7) if ( mzte_codec.m_tiling_disable == 0 ){ if ( mzte_codec.m_tiling_jump_table_enable == 1 ){ - noteProgress("Jump to %d", jump_table[ii]); + noteProgress((char*)"Jump to %d", jump_table[ii]); relative_jump(jump_table[ii]); } else search_tile(decode_tile_id[ii]); @@ -1772,7 +1772,7 @@ mzte_codec.m_iTargetSNRLev, &wvtfilter, (mzte_codec.m_tiling_disable?ii:decode_tile_id[ii]), ii, bitfile, &table, Image); //modified by SL 03/03/99 // FPDAM : added by SAIT (99/09/03) // begin: added by Sharp (99/5/10) - noteProgress("\nInverse Wavelet Transform...."); + noteProgress((char*)"\nInverse Wavelet Transform...."); if ( mzte_codec.m_tiling_disable == 0 ) { // FPDAM : added by SAIT if ( !mzte_codec.m_iAlphaChannel || mzte_codec.m_iTextureTileType != TRANSP_TILE) // FPDAM modified by Sharp @@ -1780,7 +1780,7 @@ } // FPDAM : added by SAIT else perform_IDWT(wvtfilter, m_cRecImageFile); // hjlee 0901 - noteProgress("Completed inverse wavelet transform."); + noteProgress((char*)"Completed inverse wavelet transform."); // end: added by Sharp (99/5/10) // begin: added by Sharp (99/4/7) @@ -1836,7 +1836,7 @@ // noteProgress("Completed inverse wavelet transform."); // end: deleted by Sharp (99/5/10) - noteDetail("Freeing up decoding data structures...."); + noteDetail((char*)"Freeing up decoding data structures...."); /*----- free up coeff data structure -----*/ for (col=0; col<mzte_codec.m_iColors; col++) { if (mzte_codec.m_SPlayer[col].coeffinfo[0] != NULL) @@ -1846,12 +1846,12 @@ delete (mzte_codec.m_SPlayer[col].coeffinfo); mzte_codec.m_SPlayer[col].coeffinfo = NULL; } - noteDetail("Completed freeing up decoding data structures."); + noteDetail((char*)"Completed freeing up decoding data structures."); } else { // version 1 code is copied from here - noteProgress("Version 1 bitstream\n"); + noteProgress((char*)"Version 1 bitstream\n"); strcpy(m_cInBitsFile, InBitsFile); strcpy(m_cRecImageFile, RecImageFile); @@ -1877,11 +1877,11 @@ /* DISCRETE INVERSE WAVELET TRANSFORM */ - noteProgress("\nInverse Wavelet Transform...."); + noteProgress((char*)"\nInverse Wavelet Transform...."); perform_IDWT(wvtfilter, m_cRecImageFile); // hjlee 0901 - noteProgress("Completed inverse wavelet transform."); + noteProgress((char*)"Completed inverse wavelet transform."); - noteDetail("Freeing up decoding data structures...."); + noteDetail((char*)"Freeing up decoding data structures...."); /*----- free up coeff data structure -----*/ for (col=0; col<mzte_codec.m_iColors; col++) { if (mzte_codec.m_SPlayer[col].coeffinfo[0] != NULL) @@ -1891,11 +1891,11 @@ delete (mzte_codec.m_SPlayer[col].coeffinfo); mzte_codec.m_SPlayer[col].coeffinfo = NULL; } - noteDetail("Completed freeing up decoding data structures."); + noteDetail((char*)"Completed freeing up decoding data structures."); } - noteProgress("\n----- Decoding Completed. -----\n"); + noteProgress((char*)"\n----- Decoding Completed. -----\n"); } // begin: added by Sharp (99/2/16) @@ -2039,10 +2039,10 @@ if ( mzte_codec.m_tiling_disable == 0 ){ still_tile_start_code = get_X_bits(32); if (still_tile_start_code != TEXTURE_TILE_START_CODE) - errorHandler("Wrong texture_tile_start_code."); + errorHandler((char*)"Wrong texture_tile_start_code."); tile_id = get_X_bits(16); - noteProgress("Current Tile ID is '%d'\n", tile_id); + noteProgress((char*)"Current Tile ID is '%d'\n", tile_id); if ( mzte_codec.m_extension_type == 1 ){ ref_tile_id1 = get_X_bits(16); ref_tile_id2 = get_X_bits(16); @@ -2059,7 +2059,7 @@ fprintf(stderr,"..............texture_tile_type=%d\n",mzte_codec.m_iTextureTileType); #endif - noteProgress("Decoding Tile Shape Information..."); + noteProgress((char*)"Decoding Tile Shape Information..."); } if ( count == 0 ){ @@ -2076,9 +2076,9 @@ w = mzte_codec.m_iWidth >> (col>0 ? 1 : 0); if ((picptr[col].data = (unsigned char *)malloc(sizeof(unsigned char)*h*w)) == NULL ) - errorHandler("Couldn't allocate memory to image data\n"); + errorHandler((char*)"Couldn't allocate memory to image data\n"); if ((picptr[col].mask = (unsigned char *)malloc(sizeof(unsigned char)*h*w)) == NULL ) - errorHandler("Couldn't allocate memory to image data\n"); + errorHandler((char*)"Couldn't allocate memory to image data\n"); } *Image = picptr; @@ -2109,7 +2109,7 @@ wvtfilter); if(target_shape_layer > target_spatial_layer) { - noteWarning("Shape has less spatial layers than target,\n forced to use shape spatial layers.\n"); + noteWarning((char*)"Shape has less spatial layers than target,\n forced to use shape spatial layers.\n"); if(mzte_codec.m_iQuantType == 2) { for(i=0;i< mzte_codec.m_iSpatialLev;i++) { if( mzte_codec.m_lastWvtDecompInSpaLayer[i][0] > mzte_codec.m_iWvtDecmpLev -1 - target_shape_layer){