算术编码算法[3]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 nwen 的 blog

          begin

            endc := startc + g * (ca + ce + ci + co);

            startc := startc + g * (ca + ce + ci);

         end;

       'u':

          begin

            endc := startc + g * (ca + ce + ci + co + cu);

            startc := startc + g * (ca + ce + ci + co);

         end;

       else

           begin

            showmessage(' 输入的字符串有误 ');

            exit;

           end;

      end;

    end;

end;

procedure nemuricaltostr(var s: string; var startc, endc: extended);

{将数值转换为字符串}

const eps = -1e-5;

begin

  if startc-0.2 < -eps  then

    if (endc- 0.2<= -eps) and (endc > startc) then

    begin

       startc := startc / 0.2;

       endc := endc / 0.2;

       s := s + 'a';

       if (startc <>0) or (endc <> 1) then

          nemuricaltostr(s,startc,endc);

   end;

  if (startc- 0.2 >= eps) and (startc-0.5 < -eps) then

    if (endc-0.5<= -eps) and (endc>startc) then

    begin

本文关键:编码
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top