OLD | NEW |
---|---|
(Empty) | |
1 function writeYUV420file(filename, Y, U, V) | |
2 % writeYUV420file(filename, Y, U, V) | |
3 | |
4 fid = fopen(filename,'wb'); | |
5 if fid==-1 | |
6 error(['Cannot open file ' filename]); | |
7 end | |
8 | |
9 numFrames=size(Y,3); | |
10 | |
11 for k=1:numFrames | |
12 % Write luminance | |
13 fwrite(fid,uint8(Y(:,:,k).'), 'uchar'); | |
14 | |
15 % Write U channel | |
16 fwrite(fid,uint8(U(:,:,k).'), 'uchar'); | |
17 | |
18 % Write V channel | |
19 fwrite(fid,uint8(V(:,:,k).'), 'uchar'); | |
20 end | |
21 | |
22 fclose(fid); | |
OLD | NEW |