matlab - MPEG-1 compression - producing macroblocks -


I'm stuck with a basic problem in my MPEG-1 compression I'll have to build macroblocks within an image The macroblock consists of 16 x 16 pixels - where 4x8x8 flash, 1x8x8cb and 1x8x8cr. In MATLAB, I want to create a cell matrix containing this. Any suggestions?

It looks like you have your various 8-by -8 matrix one In single variable. In some ways you can do this (the first option that I choose for your case):

  • Adding data to 3-D matrix:

    You can use the function to stack the matrix of the same size with a given dimension. For example, if your 4 8-by-8 luminesense matrix in <4> <8> , L3 in your variable> , And L4 , the following will insert them into a 8-by-8-by-4 matrix:

      luminance = cat (3 , L1, L2, L3, L4);  

    You can add additional CB and Cr matrix to create an 8-by-8-by-6 Matrix:

      macroblock = cat (3, L1, L2, L3, L4, CB, CR); % # Or ... macroblock = cat (3, glow, cb, cr);  

    By using the luminance variable above you can macroblock to access the following 8-by-8 matrix in the following way You may want:

      L2 = macroblock (:,:, 2); % # Second Luinance matrix c = b = macroblock (: ,,, 5); Receive CR matrix  
  • Storing data in a cell array:

    Since all of your metrics are the same size, the above mentioned insertion option might be the most Well, though, another option (which is especially useful if you want to store different size, type or dimension data) is to use. Creates a 1-by-6 cell table containing the matrix above:

      macroblock = {l1l2l3l4cb}};  

    You can index macroblock in the following essential ways to access the following 8-by-8 matrix:

      L2 = macroblock {2}; % # Second, Luine's matrix c = b = macroblock {5}; Get CD Matrix  
  • Storing data in a structure:

    Use one more option to store your 8 The advantage of a structure of the matrix-to-8 is that you can access the by field name data as a protest to remember the index value. Here is the macroblock = straight ('L1', L1, 'L2', L2, 'L3', L3, 'L4', L4, 'CB'):

      CB, 'CR', CR); % # Or ... macroblock =) (); Macroblock.l 1 = l1; Macroblock.l2 = l2; Macroblockl3 = l3; Macroblock.l4 = l4; Macroblock.cb = CB; Macroblock Cr = cr;  

    The above two syntax, field names 'L1' , 'L2' , 'L3' , 'L4' , 'cb' , and 'Cr' . You can make macroblock pointer to reach the following 8-by-8 matrix in the following manner:

      L2 = macroBlock.L2 ; % # Second Luinance Matrix CB = Macroblock CB; Get% CB metrics  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -