================精选公文范文,管理类,工作总结类,工作计划类文档,欢迎阅读下载==============
g_ac_cnt=g_ac_cnt+1;
g_AC(1,2*g_ac_cnt-1)=g_n;
g_AC(1,2*g_ac_cnt)=Gdcts_c_z(i); g_n=0; end end g_huff=cell(g_ac_cnt+1,3);
g_code_bit=0; for j=0:1:g_ac_cnt; if j==0 [siz,code]=vli(g_dc_diff); %[siz,code]=vli(r_dc);
g_huff(1,1)=cellstr(dec2bin(0)); g_huff(1,2)=cellstr(dec2bin(siz,4)); g_huff(1,3)=cellstr(dec2bin(code,siz)); g_code_bit=g_code_bit+siz; else if g_AC(2*j)==0
g_huff(j+1,1)=cellstr(dec2bin(g_AC(2*j-1),4));
g_huff(j+1,2)=cellstr(dec2bin(0)); g_huff(j+1,3)=cellstr(dec2bin(0)); else g_huff(j+1,1)=cellstr(dec2bin(g_AC(2*j-1
),4)); [siz,code]=vli(g_AC(2*j)); g_huff(j+1,2)=cellstr(dec2bin(siz,4)); g_huff(j+1,3)=cellstr(dec2bin(code,siz)); g_code_bit=g_code_bit+siz; end end end
--------------------精选公文范文,管理类,工作总结类,工作计划类文档,感谢阅读下载---------------------
~ 21 ~
================精选公文范文,管理类,工作总结类,工作计划类文档,欢迎阅读下载==============
g_all_bit=g_all_bit+g_ac_cnt*8+4+g_code_bit; i_n=1; for k=1:1:g_ac_cnt+1; if k==1 [i_value]=i_vli(g_huff(1,2),g_huff(1,3)) i_Gdcts_c_z(1,i_n)=g_dc+i_value; %i_Rdcts_c_z(1,i_n)=r_huff(1,3);
i_n=i_n+1; g_dc=Gdcts_c_z(1); else if
bin2dec(g_huff(k,1))==15&&bin2dec(g_huff(k,2))==0
i_Gdcts_c_z(1,i_n:i_n+15)=0; i_n=i_n+16; elseif bin2dec(g_huff(k,1))==0&&bin2dec(g_hu
ff(k,2))==0 i_Gdcts_c_z(1,i_n)=0; i_n=i_n+1; else i_Gdcts_c_z(1,i_n:i_n+bin2dec(g_huff(k,1))-1)=0;
i_n=i_n+bin2dec(g_huff(k,1));
i_value=i_vli(g_huff(k,2),g_huff(k,3)); i_Gdcts_c_z(1,i_n)=i_value; i_n=i_n+1; end end end i_Gdcts_c=i_Gdcts_c_z(i_zig);
--------------------精选公文范文,管理类,工作总结类,工作计划类文档,感谢阅读下载---------------------
~ 22 ~
================精选公文范文,管理类,工作总结类,工作计划类文档,欢迎阅读下载==============
i_Gdct_s(1,1:8)=i_Gdcts_c(1:8); i_Gdct_s(2,1:8)=i_Gdcts_c(9:16); i_Gdct_s(3,1:8)=i_Gdcts_c(17:24); i_Gdct_s(4,1:8)=i_Gdcts_c(25:32); i_Gdct_s(5,1:8)=i_Gdcts_c(33:40); i_Gdct_s(6,1:8)=i_Gdcts_c(41:48); i_Gdct_s(7,1:8)=i_Gdcts_c(49:56);
i_Gdct_s(8,1:8)=i_Gdcts_c(57:64); i_Gdct=round(i_Gdct_s.*S);
i_G_8_8=round(idct2(i_Gdct));
i_G(i_r*8-7:i_r*8,i_c*8-7:i_c*8)=i_G_8_
8; end end i_GG=i_G+128; b_dc=0; b_n=0; b_AC=zeros; b_all_bit=0; for i_r=1:1:37; for i_c=1:1:50; b_ac_cnt=0; B_8_8=B(i_r*8-7:i_r*8,i_c*8-7:i_c*8); B_DCT=dct2(B_8_8);
B_dct_s=round(B_DCT./S);
Bdcts_c=reshape(B_dct_s’,1,64); Bdcts_c_z=Bdcts_c(zig);
b_dc_diff=Bdcts_c_z(1)-b_dc; %b_dc=Bdcts_c_z(1); for i=2:1:64; if
--------------------精选公文范文,管理类,工作总结类,工作计划类文档,感谢阅读下载---------------------
~ 23 ~
================精选公文范文,管理类,工作总结类,工作计划类文档,欢迎阅读下载==============
Bdcts_c_z(i)==0&&b_n elseif Bdcts_c_z(i)==0&&b_n
b_AC(1,2*b_ac_cnt-1)=b_n;
b_AC(1,2*b_ac_cnt)=Bdcts_c_z(i); b_n=0; elseif Bdcts_c_z(i)~=0&&b_n
b_AC(1,2*b_ac_cnt-1)=b_n;
b_AC(1,2*b_ac_cnt)=Bdcts_c_z(i); b_n=0; elseif Bdcts_c_z(i)~=0&&b_n==15 b_ac_cnt=b_ac_cnt+1;
b_AC(1,2*b_ac_cnt-1)=b_n;
b_AC(1,2*b_ac_cnt)=Bdcts_c_z(i); b_n=0; elseif Bdcts_c_z(i)==0&&b_n==15 b_ac_cnt=b_ac_cnt+1;
b_AC(1,2*b_ac_cnt-1)=b_n;
b_AC(1,2*b_ac_cnt)=Bdcts_c_z(i); b_n=0; end end b_huff=cell(b_ac_cnt+1,3); b_code_bit=0; for j=0:1:b_ac_cnt; if j==0 [siz,code]=vli(b_dc_diff); %[siz,code]=vli(
--------------------精选公文范文,管理类,工作总结类,工作计划类文档,感谢阅读下载---------------------
~ 24 ~
================精选公文范文,管理类,工作总结类,工作计划类文档,欢迎阅读下载==============
r_dc);
b_huff(1,1)=cellstr(dec2bin(0)); b_huff(1,2)=cellstr(dec2bin(siz,4)); b_huff(1,3)=cellstr(dec2bin(code,siz)); b_code_bit=b_code_bit+siz; else if b_AC(2*j)==0
b_huff(j+1,1)=cellstr(dec2bin(b_AC(2*j-1),4));
b_huff(j+1,2)=cellstr(dec2bin(0)); b_huff(j+1,3)=cellstr(dec2bin(0)); else b_huff(j+1,1)=cellstr(dec2bin(b_AC(2*j-1),4)); [siz,code]=vli(b_AC(2*j)); b_huff(j+1,2)=cellstr(dec2bin(siz,4)); b_huff(j+1,3)=cellstr(dec2bin(code,siz)); b_code_bit=b_code_bit+siz; end end end b_all_bit=b_all_bit+b_ac_cnt*8+4+b_code_bit; i_n=1; for k=1:1:b_ac_cnt+1; if k==1 [i_value]=i_vli(b_huff(1,2),b_huff(1,3)) i_Bdcts_c_z(1,i_n)=b_dc+i_value; %i_Rdcts_c_z(1,i_n)=r_huff(1,3);
i_n=i_n+1; b_dc=Bdcts_c_z(1); else
~ 25 ~
--------------------精选公文范文,管理类,工作总结类,工作计划类文档,感谢阅读下载---------------------