main441.m
上传用户:cxsjwj
上传日期:2022-08-09
资源大小:34k
文件大小:3k
源码类别:

matlab例程

开发平台:

Matlab

  1. %main441
  2. I1=double(I1);
  3. JQ=forwardDCT(I1,array);
  4. bufferI1 = inverseDCT(JQ,array);
  5. c= makeLayers(JQ);
  6. %%calling decoder
  7. identifier=1;
  8. decoder(c,motionVect,identifier,flag);
  9. %%%this loop is for accessing frame from actual movie
  10.     if i~=1
  11.         j=i-round(i/10);
  12.         [B2,B3,P4,B5,B6,P7,B8,B9,I10]=GOP1(j,resize,long,wide);
  13.     elseif i==1
  14.         j=i;
  15.         [B2,B3,P4,B5,B6,P7,B8,B9,I10]=GOP1(j,resize,long,wide);
  16.     end
  17.         %processing on P4 frame
  18.         [bufferP4,streamP4,motionVect]=compensatedFrame(P4,bufferI1,mbSize,p,array); 
  19.         c= makeLayers(streamP4);
  20.         %calling decoder
  21.         identifier=4;
  22.         %decoder(diffDC,valVectorBase,lenVectorBase,valVectorEnhan,lenVectorEnhan,identifier,flag,motionVect);
  23.         decoder(c,motionVect,identifier,flag);
  24. % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%        
  25.         
  26.         %for B2    
  27.         [B2t ,motionVect, flag] = bFrameProc(B2,bufferI1,bufferP4,0.5*array,mbSize,p);
  28.         c= makeLayers(B2t);
  29.         
  30.         %calling decoder
  31.         identifier=2;
  32.         decoder(c,motionVect,identifier,flag);
  33.         
  34.         %for B3    
  35.         [B3t ,motionVect ,flag] = bFrameProc(B3,bufferI1,bufferP4,0.5*array,mbSize,p);
  36.         c= makeLayers(B3t);
  37.         
  38.         %calling decoder
  39.         identifier=3;
  40.         decoder(c,motionVect,identifier,flag);
  41.  
  42.         %predicting p7 from p4
  43.         [bufferP7,streamP7,motionVect]=compensatedFrame(P7,bufferP4,mbSize,p,array);
  44.         c= makeLayers(streamP7);
  45.         
  46.         %calling decoder
  47.         identifier=7;
  48.         decoder(c,motionVect,identifier,flag);
  49. %          
  50.         %for B5    
  51.         [B5t motionVect flag] = bFrameProc(B5,bufferP4,bufferP7,0.5*array,mbSize,p);
  52.         c= makeLayers(B5t);
  53.         
  54.         %calling decoder
  55.         identifier=5;
  56.         decoder(c,motionVect,identifier,flag);
  57.    
  58.         %for B6    
  59.         [B6t motionVect flag] = bFrameProc(B6,bufferP4,bufferP7,0.5*array,mbSize,p);
  60.         c= makeLayers(B6t);
  61.         
  62.         %calling decoder
  63.         identifier=6;
  64.         decoder(c,motionVect,identifier,flag);
  65.  
  66.         %processing on I10 frame
  67.         streamI10=forwardDCT(I10,array);
  68.         bufferI10 = inverseDCT(streamI10,array);
  69.         c= makeLayers(streamI10);
  70.         %%calling decoder
  71.         identifier=10;
  72.         decoder(c,motionVect,identifier,flag);
  73. %         
  74.         %for B8    
  75.         [B8t motionVect flag] = bFrameProc(B8,bufferP7,bufferI10,0.5*array,mbSize,p);
  76.         c= makeLayers(B8t);
  77.         
  78.         %calling decoder
  79.         identifier=8;
  80.         decoder(c,motionVect,identifier,flag);
  81.         %for B9    
  82.         [B9t motionVect flag] = bFrameProc(B9,bufferP7,bufferI10,0.5*array,mbSize,p);
  83.         c= makeLayers(B9t);
  84.         
  85.         %calling decoder
  86.         identifier=9;
  87.         decoder(c,motionVect,identifier,flag);
  88.     
  89.