youcheng.m

来自「将一幅多媒体图像根据各个块的不同特性蔡用不同的编码方式」· M 代码 · 共 44 行

M
44
字号



%a1='11111000011';
%for i=1:11
    %a(i)=str2num(a1(i));
    %end
%a=[1 0 1 0 0 0 0 0 1 1 1 0 1 1 1 1 1 0 0];
function youcheng(ovic88)
global bit_count cell_count total_cell point


c=ovic88(1);e(1,1)=1;e(1,2)=c;e(1,3)=1;%游程长度
 t1=1;
                            for k=2:64
                                 if ovic88(k)==c
                                    e(t1,2)=c;
                                    e(t1,3)=e(t1,3)+1;
                                    
                                else
                                    t1=t1+1;
                                    e(t1,1)=k;
                                    e(t1,2)=ovic88(k);
                                    e(t1,3)=1;
                                    c=ovic88(k);
                                   
                               end
                            end
                            for i=1:t1
                                for j=1:3
                                    total_cell(point+1)=uint8(e(i,j)); 
                                    
                                        point=point+1;
                                   
                                end
                            end 
                            bit_count=bit_count+24*t1;cell_count=cell_count+3*t1;%ok 07/05/23
                            
                            
                            
 
   

                            

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?