BPEsourcecode
CCSDS 

所属分类:图形图像处理
开发工具:C/C++
文件大小:79KB
下载次数:74
上传日期:2009-09-03 17:49:28
上 传 者su30mk
说明:  CCSDS标准的源码实现,很不容易找的。是遥感图像压缩的国际标准
(CCSDS standard source implementation is not easy to find the)

文件列表:
clean (0, 2008-09-08)
clean\.DS_Store (6148, 2008-07-02)
clean\source (0, 2008-09-07)
clean\source\.DS_Store (6148, 2008-07-02)
clean\source\AC_BitPlaneCoding.c (14725, 2008-07-01)
clean\source\AdjustOutput.c (289668, 2008-06-25)
clean\source\bitsIO.c (5763, 2008-01-27)
clean\source\BPEBlockCoding.c (22960, 2006-11-07)
clean\source\bpe_decoder.c (17661, 2008-09-07)
clean\source\bpe_encoder.c (15700, 2008-07-02)
clean\source\CoeffGroup.c (12558, 2008-06-25)
clean\source\DC_EnDeCoding.c (22666, 2008-07-02)
clean\source\errorhandle.c (2328, 2008-06-25)
clean\source\getopt.c (22319, 2006-11-07)
clean\source\getopt.h (4390, 2006-11-07)
clean\source\global.h (7541, 2008-06-25)
clean\source\header.c (17725, 2008-03-09)
clean\source\lifting_97f.c (6224, 2008-06-25)
clean\source\lifting_97M.c (5373, 2006-11-07)
clean\source\main.c (10477, 2008-06-25)
clean\source\makefile (796, 2008-06-25)
clean\source\PatternCoding.c (24572, 2008-06-25)
clean\source\ricecoding.c (12210, 2006-11-07)
clean\source\StagesCodingGaggles.c (40680, 2008-06-25)
clean\source\tailor.h (7430, 2005-08-05)
clean\source\waveletbpe.c (9755, 2006-11-07)

{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf480 {\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fmodern\fcharset77 Courier; \f3\fmodern\fcharset77 Courier-Bold;} {\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red255\green0\blue0;\red39\green126\blue55; \red104\green56\blue33;\red211\green10\blue18;} \margl1440\margr1440\vieww14500\viewh17040\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0\fs24 \cf0 Aaron Kiely\ June-July 2008\ \ This file describes the modifications I made to get the Nebraska CCSDS image compression software to run on my (PPC) Mac and to fix several bugs. My starting point is the Linux version of the Nebraska software (the file date for the Linux package is April 29, 2008).\ \ In Part 1 I summarize bug fixes. In Part 2 I summarize changes that are either done primarily to get things working on a Mac, or for other reasons (like eliminating compiler warning errors).\ \ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f1\b\fs48 \cf2 Part 1: Bug Fixes\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0\b0\fs24 \cf0 \ Note that most of these bugs should affect both PC and Mac implementations.\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f1\b \cf3 Bug when a segment consists of a single block\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0\b0 \cf0 Decoding fails when the last segment consists of a single block. This can be demonstrated using a small 8-bit random noise image:\ bpe -e randimg8_48x24.raw -o testcomp.bpe -w 48 -h 24 -s 17\ Presumably this affects Mac and PC implementations.\ \ Here's the problem:\ In several places, the parameter "gaggles" is used. This parameter is set to the number of values to be encoded, not counting a reference sample. Thus, it's equal to the number of values in the gaggle, except for the first gaggle, when it's one less than this number, and therefore it's set to zero when a segment consists of a single block.\ But when gaggles is equal to zero, all of the following functions will return without doing anything, and thus encoding and decoding fail for a segment with a single block:\ ACGaggleEncoding, ACGaggleDecoding, DCGaggleDecoding, DCEncoder\ These functions are called by:\ ACDepthEncoder, ACDepthDecoder, DCEntropyDecoder, DCEntropyEncoder\ \ I've fixed this by rewriting all eight of the above functions. In the rewritten versions, the value of gaggles is always used to indicate the number of values in the gaggle. The new code is also a bit shorter than the original.\ \ \ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f1\b \cf3 Bug in coding additional bit planes of DC coefficients (section 4.3.3 of the recommendation):\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0\b0 \cf0 The software is not properly handling encoding and decoding of DC bit planes described in sec. 4.3.3 of the standard. (These are the bit planes of DC coefficients coded after Rice coding of quantized coefficients, but BEFORE any of the AC coefficients are coded.) This affects Mac and PC implementations. In addition to not conforming to the specification, the decoder loses synchronization with the encoder, and so decoding can fail catastrophically, causing a segmentation fault.\ \ (a) Encoding: For an integer DWT, in function DCEntropyEncoder, after calling DCEncoder (one or more times), it encodes q-WtLL3 bit planes, which is too many for some images. Instead, the number of DC bit planes encoded here should be\ q - max\{BitDepthAC, WtLL3\}.\ \ (b) Decoding: It looks like an attempt to decode section 4.3.3 bits was in file DC_EnDeCoding, function DCDeCoding, but it has been commented out. Instead, the decoding of section 4.3.3 bits seems to occur in file AC_BitPlaneCoding.c, function ACBpeDecoding. But this decoding appears AFTER calling function ACDepthDecoder, which is wrong.\ \ To fix (a), in file DC_EnDeCoding.c, function DCEntropyEncoder, I've commented out a large chunk of source code and replaced it with a smaller chunk.\ \ To fix (b), in file AC_BitPlaneCoding.c, function ACBpeDecoding, comment out large chunk of source code appearing right after \ // 3.2 Family tree scaning sequence in a segment. \ I've added a chunk of source code near the end of the DC_EnDeCoding.c file, in function DCDeCoding, to handle decoding of section 4.3.3 bits.\ \ \ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f1\b \cf3 Bug fix in AdjustOutput.c: \f0\b0 \cf0 \ (This bug probably only affects Mac implementations.)\ In the function 'AdjustOutPut' around line 50 of file AdjustOutput.c, change:\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f2 \cf0 *(*BlockCodingInfo[i].PtrBlockAddress) = DeConvTwosComp((DWORD32)(BlockCodingInfo[i].ShiftedDC + BlockCodingInfo[i].DecodingDCRemainder), PtrCoding->PtrHeader->Header.Part1.BitDepthDC_5Bits);\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0 \cf0 \ to: \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f2 \cf0 *(*BlockCodingInfo[i].PtrBlockAddress) = DeConvTwosComp((DWORD32)( \f3\b \cf3 (long int) \f2\b0 \cf0 BlockCodingInfo[i].ShiftedDC + \f3\b \cf3 (long int) \f2\b0 \cf0 BlockCodingInfo[i].DecodingDCRemainder), PtrCoding->PtrHeader->Header.Part1.BitDepthDC_5Bits);\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0 \cf0 \ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f1\b \cf3 Large Image Bug Fix:\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0\b0 \cf0 If the number of segments is 2^15 or more, a segmentation fault can arise on decoding. This probably affects Mac and PC implementations.\ \ In DCGaggleDecoding() (maybe elsewhere?), variable i is a short int. When the number of blocks exceeds 2^15-1, it overflows and points to a negative index. Should be able to fix this by just declaring it to be a long int.\ \ File DC_EnDeCoding.c, function DCGaggleDeccoding, ~line 345, change\ short i = 0;\ to\ long int i = 0;\ Also, in File AC_BitPlaneCoding.c, function ACGaggleDecoding, ~line 388, change short i to long int i.\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \cf2 [It's possible that other overflow problems arise when the number of segments in an image or the number of blocks in a segment is very large.]\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \cf0 \ \ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f1\b \cf3 Bug fix in file DC_EnDeCoding.c:\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0\b0 \cf0 (There's a bug in the DPCM mapping. This affects Mac and PC implementations.)\ In function DPCM_DCMapper, around line 508, change:\ \pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8***0\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20***0\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx2***00\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32***0\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx3***80\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx3***40\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44***0\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural \f2 \cf0 \CocoaLigature0 BlockInfo[\cf2 0\cf0 ].ShiftedDC = -(\cf4 short\cf0 )(((~(BlockInfo[\cf2 0\cf0 ].ShiftedDC - \cf2 1\cf0 )) & Bits1));\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0 \cf0 \CocoaLigature1 to\ \pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8***0\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20***0\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx2***00\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32***0\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx3***80\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx3***40\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44***0\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural \f2 \cf0 \CocoaLigature0 BlockInfo[\cf2 0\cf0 ].ShiftedDC = -(\cf4 short\cf0 )( ((BlockInfo[\cf2 0\cf0 ].ShiftedDC^Bits1) & Bits1) + \cf2 1\cf0 );\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0 \cf0 \CocoaLigature1 \ In function DPCM_DCMapper, around line 517, change:\ \pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8***0\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20***0\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx2***00\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32***0\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx3***80\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx3***40\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44***0\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural \f2 \cf0 \CocoaLigature0 BlockInfo[i].ShiftedDC = -(\cf4 short\cf0 )((~(BlockInfo[i].ShiftedDC - \cf2 1\cf0 )) & Bits1);\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0 \cf0 \CocoaLigature1 to\ \pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8***0\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20***0\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx2***00\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32***0\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx3***80\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx3***40\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44***0\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural \f2 \cf0 \CocoaLigature0 BlockInfo[i].ShiftedDC = -(\cf4 short\cf0 )( ((BlockInfo[i].ShiftedDC^Bits1) & Bits1) + \cf2 1\cf0 );\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0 \cf0 \CocoaLigature1 \ In function DPCM_DCDeMapper, around line 761, change:\ \pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8***0\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20***0\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx2***00\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32***0\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx3***80\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx3***40\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44***0\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural \f2 \cf0 \CocoaLigature0 BlockInfo[\cf2 0\cf0 ].ShiftedDC = -(\cf4 short\cf0 )(((~(BlockInfo[\cf2 0\cf0 ].ShiftedDC - \cf2 1\cf0 )) & Bits1));\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0 \cf0 \CocoaLigature1 to\ \pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8***0\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20***0\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx2***00\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32***0\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx3***80\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx3***40\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44***0\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural \f2 \cf0 \CocoaLigature0 BlockInfo[\cf2 0\cf0 ].ShiftedDC = -(\cf4 short\cf0 )( ((BlockInfo[\cf2 0\cf0 ].ShiftedDC^Bits1) & Bits1) + \cf2 1\cf0 );\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0 \cf0 \CocoaLigature1 \ In function DPCM_DCDeMapper, around line 769, change:\ \pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8***0\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20***0\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx2***00\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32***0\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx3***80\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx3***40\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44***0\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural \f2 \cf0 \CocoaLigature0 \cf4 if\cf0 ((\cf4 float\cf0 )BlockInfo[i].MappedDC / \cf2 2\cf0 == BlockInfo[i].MappedDC / \cf2 2\cf0 )\ \{\ diff_DC[i] = BlockInfo[i].MappedDC / \cf2 2\cf0 ;\ \cf4 if\cf0 (diff_DC[i] >= \cf2 0\cf0 && diff_DC[i] <= theta)\ \{\ BlockInfo[i].ShiftedDC = diff_DC[i] + BlockInfo[i - \cf2 1\cf0 ].ShiftedDC;\ \cf4 continue\cf0 ;\ \}\ \}\ \cf4 else\cf0 \ \{\ diff_DC[i] = -(\cf4 long\cf0 )(BlockInfo[i].MappedDC + \cf2 1\cf0 ) / \cf2 2\cf0 ;\ \cf4 if\cf0 (diff_DC[i] <= \cf2 0\cf0 && diff_DC[i] >= -theta)\ \{\ BlockInfo[i].ShiftedDC = diff_DC[i] + BlockInfo[i - \cf2 1\cf0 ].ShiftedDC;\ \cf4 continue\cf0 ;\ \}\ \} \ diff_DC[i] = BlockInfo[i].MappedDC - theta;\ BlockInfo[i].ShiftedDC = diff_DC[i] + BlockInfo[i - \cf2 1\cf0 ].ShiftedDC;\ \ \cf4 if\cf0 ( (\cf4 long\cf0 )BlockInfo[i].ShiftedDC < X_Min || BlockInfo[i].ShiftedDC > X_Max)\ \{\ diff_DC[i] = -diff_DC[i];\ BlockInfo[i].ShiftedDC = diff_DC[i] + BlockInfo[i - \cf2 1\cf0 ].ShiftedDC;\ \}\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0 \cf0 \CocoaLigature1 to\ \pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8***0\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20***0\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx2***00\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32***0\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx3***80\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx3***40\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44***0\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural \f2 \cf3 \CocoaLigature0 if (BlockInfo[i].MappedDC > 2*theta) \{\ if ((long int)BlockInfo[i - 1].ShiftedDC < 0)\ diff_DC[i] = BlockInfo[i].MappedDC - theta;\ else\ diff_DC[i] = theta - BlockInfo[i].MappedDC;\ \} else \{\ if((float)BlockInfo[i].MappedDC / 2 == BlockInfo[i].MappedDC / 2)\ diff_DC[i] = BlockInfo[i].MappedDC / 2;\ else\ diff_DC[i] = -(long)(BlockInfo[i].MappedDC + 1) / 2 ;\ \}\ BlockInfo[i].ShiftedDC = diff_DC[i] + BlockInfo[i - 1].ShiftedDC;\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0 \cf0 \CocoaLigature1 \ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f1\b \cf3 Another bug fix\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0\b0 \cf0 An image consisting of 15 blocks is not handled properly and a Segmentation Fault can arise. I believe that this affects PC and Mac implementations. Here's the fix:\ \ Change instances of \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f2 \cf0 while(PtrCoding->PtrHeader->Header.Part3.S_20Bits - GaggleStartIndex >= gaggles)\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0 \cf0 to\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f2 \cf0 while(PtrCoding->PtrHeader->Header.Part3.S_20Bits >= gaggles + GaggleStartIndex)\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural\pardirnatural \f0 \cf0 This occurs in four places:\ File DC_EnDeCoding.c: DCEntropyEncoder ~ line 282, DCEntropyDecoder ~line 471\ File AC_BitPlaneCoding.c: ACDepthEncoder ~line 256, ACDepthDecoder ~line 571\ \ In File AC_BitPlaneCoding.c change\ \pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8***0\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\t ... ...

近期下载者

相关文件


收藏者