clear
clc
cd('C:\Users\Administrator\Desktop\output');
fid = fopen('akko_640x480_30p_0.yuv', 'rb');
[a, count] = fread(fid, [16 16], 'uchar');
fclose(fid);
具体将一帧图像读入,如下:
fid=fopen('akko_640x480_30p_0.yuv','r');
[Y1,count]=fread(fid,inf,'uchar');
fclose(fid);
Q=width*hight*1.5;
Y1=reshape(Y1,Q,[]);
这样,第一列就代表第一帧,第二列就代表第二帧,第一行第一列是第一个宏块的值,第二行第一列是第二个宏块的值,依次类推,这里就不在赘述。