@@ -13146,9 +13146,10 @@ void ComputeOutputDimensions(DECODER *decoder, int frame,
1314613146
1314713147#if (1 && DEBUG)
1314813148 FILE *logfile = decoder->logfile;
13149+ #endif
1314913150 CODEC_STATE *codec = &decoder->codec;
1315013151 int num_channels = codec->num_channels;
13151- #endif
13152+
1315213153 FRAME_INFO *info = &decoder->frame;
1315313154
1315413155 //int progressive = codec->progressive;
@@ -13177,21 +13178,27 @@ void ComputeOutputDimensions(DECODER *decoder, int frame,
1317713178 {
1317813179 case DECODED_RESOLUTION_FULL:
1317913180 case DECODED_RESOLUTION_HALF_HORIZONTAL:
13181+ #if DEBUG
1318013182 assert(AllTransformBandsValid(transform_array, num_channels, frame));
13183+ #endif
1318113184 decoded_scale = 2;
1318213185 wavelet = transform_array[0]->wavelet[0];
1318313186 break;
1318413187
1318513188 case DECODED_RESOLUTION_HALF:
13189+ #if DEBUG
1318613190 assert(AllLowpassBandsValid(transform_array, num_channels, frame));
13191+ #endif
1318713192 decoded_scale = 1;
1318813193 wavelet = transform_array[0]->wavelet[0];
1318913194 break;
1319013195
1319113196 case DECODED_RESOLUTION_QUARTER:
1319213197 if(decoder->codec.encoded_format == ENCODED_FORMAT_BAYER)
1319313198 {
13199+ #if DEBUG
1319413200 assert(AllLowpassBandsValid(transform_array, num_channels, frame));
13201+ #endif
1319513202 decoded_scale = 1;
1319613203 wavelet = transform_array[0]->wavelet[0];
1319713204 }
@@ -13390,7 +13397,9 @@ void ReconstructSampleFrameToBuffer(DECODER *decoder, int frame, uint8_t *output
1339013397 {
1339113398 case DECODED_RESOLUTION_FULL:
1339213399 case DECODED_RESOLUTION_HALF_HORIZONTAL_DEBAYER:
13400+ #if DEBUG
1339313401 assert(AllTransformBandsValid(transform_array, num_channels, frame));
13402+ #endif
1339413403 wavelet = transform_array[0]->wavelet[0];
1339513404 // Get the decoded frame dimensions
1339613405 assert(wavelet != NULL);
@@ -13401,7 +13410,9 @@ void ReconstructSampleFrameToBuffer(DECODER *decoder, int frame, uint8_t *output
1340113410 break;
1340213411
1340313412 case DECODED_RESOLUTION_HALF:
13413+ #if DEBUG
1340413414 assert(AllLowpassBandsValid(transform_array, num_channels, frame));
13415+ #endif
1340513416 wavelet = transform_array[0]->wavelet[0];
1340613417 // Get the decoded frame dimensions
1340713418 assert(wavelet != NULL);
@@ -13412,7 +13423,9 @@ void ReconstructSampleFrameToBuffer(DECODER *decoder, int frame, uint8_t *output
1341213423 break;
1341313424
1341413425 case DECODED_RESOLUTION_HALF_HORIZONTAL:
13426+ #if DEBUG
1341513427 assert(AllLowpassBandsValid(transform_array, num_channels, frame));
13428+ #endif
1341613429 wavelet = transform_array[0]->wavelet[0];
1341713430 // Get the decoded frame dimensions
1341813431 assert(wavelet != NULL);
@@ -13425,7 +13438,9 @@ void ReconstructSampleFrameToBuffer(DECODER *decoder, int frame, uint8_t *output
1342513438 case DECODED_RESOLUTION_QUARTER:
1342613439 if(decoder->codec.encoded_format == ENCODED_FORMAT_BAYER)
1342713440 {
13441+ #if DEBUG
1342813442 assert(AllLowpassBandsValid(transform_array, num_channels, frame));
13443+ #endif
1342913444 wavelet = transform_array[0]->wavelet[0];
1343013445 }
1343113446 else
@@ -16485,8 +16500,9 @@ void ReconstructQuarterFrame(DECODER *decoder, int num_channels,
1648516500 PIXEL *channel_row_ptr[CODEC_MAX_CHANNELS];
1648616501
1648716502 // Check that there is enough space for the intermediate results from each channel
16503+ #if DEBUG
1648816504 assert(output_width * sizeof(PIXEL) < buffer_size);
16489-
16505+ #endif
1649016506 ComputeCube(decoder);
1649116507
1649216508 // Get pointers into the wavelets for each channel
@@ -21309,7 +21325,9 @@ void TransformInverseFrameToYUV(TRANSFORM *transform[], int frame_index, int num
2130921325 assert(0 < num_channels && num_channels <= TRANSFORM_MAX_CHANNELS);
2131021326
2131121327 // Check that the buffer is large enough
21328+ #if DEBUG
2131221329 assert((2 * num_channels * temporal_row_size) <= buffer_size);
21330+ #endif
2131321331
2131421332 // Allocate buffers for a single row of lowpass and highpass temporal coefficients
2131521333 // and initialize the arrays of row pointers into the horizontal transform bands
@@ -21854,7 +21872,9 @@ void TransformInverseFrameToRow16u(DECODER *decoder, TRANSFORM *transform[], int
2185421872
2185521873 // Buffer must be large enough for two rows of temporal coefficients (lowpass and highpass)
2185621874 // plus the buffer used by the inverse horizontal transform for its intermediate results
21875+ #if DEBUG
2185721876 assert((2 * temporal_row_size) <= buffer_size);
21877+ #endif
2185821878
2185921879 // Allocate buffers for one row of lowpass and highpass temporal coefficients
2186021880 temporal_lowpass = (PIXEL *)&buffer[0];
@@ -22452,7 +22472,9 @@ void TransformInverseFrameToBuffer(TRANSFORM *transform[], int frame_index, int
2245222472 // Allocate buffer space for the intermediate YUV data
2245322473 yuv_buffer = buffer + temporal_buffer_size;
2245422474 yuv_buffer_size = buffer_size - temporal_buffer_size;
22475+ #if DEBUG
2245522476 assert(yuv_buffer_size >= 2 * yuv_row_size);
22477+ #endif
2245622478
2245722479 if (inverted)
2245822480 {
@@ -24171,19 +24193,25 @@ void GetDecodedFrameDimensions(TRANSFORM **transform_array,
2417124193 {
2417224194 case DECODED_RESOLUTION_FULL_DEBAYER:
2417324195 case DECODED_RESOLUTION_HALF_HORIZONTAL_DEBAYER:
24196+ #if DEBUG
2417424197 assert(AllTransformBandsValid(transform_array, num_channels, frame_index));
24198+ #endif
2417524199 decoded_scale = 2;
2417624200 wavelet = transform_array[0]->wavelet[0];
2417724201 break;
2417824202
2417924203 case DECODED_RESOLUTION_FULL:
24204+ #if DEBUG
2418024205 assert(AllTransformBandsValid(transform_array, num_channels, frame_index));
24206+ #endif
2418124207 decoded_scale = 2;
2418224208 wavelet = transform_array[0]->wavelet[0];
2418324209 break;
2418424210 case DECODED_RESOLUTION_HALF_NODEBAYER:
2418524211 case DECODED_RESOLUTION_HALF:
24212+ #if DEBUG
2418624213 assert(AllLowpassBandsValid(transform_array, num_channels, frame_index));
24214+ #endif
2418724215 decoded_scale = 1;
2418824216 wavelet = transform_array[0]->wavelet[0];
2418924217 break;
0 commit comments