readframe.m

来自「用matlab写的仿真H.263标准的程序」· M 代码 · 共 30 行

M
30
字号
function [FrameY,FrameU,FrameV] = ReadFrame(fid,format)
%从读取一帧


switch format
    case 'cif'
        FrameY = fread(fid, [352,288], 'uint8');
        FrameY = uint8(FrameY');
        FrameU = fread(fid, [176,144], 'uint8');
        FrameU = uint8(FrameU');
        FrameV = fread(fid, [176,144], 'uint8');
        FrameV = uint8(FrameV');
    case 'pal'
        FrameY = fread(fid, [720,576], 'uint8');
        FrameY = uint8(FrameY');
        FrameU = fread(fid, [360,288], 'uint8');
        FrameU = uint8(FrameU');
        FrameV = fread(fid, [360,288], 'uint8');
        FrameV = uint8(FrameV');
    case '360-288'
        FrameY = fread(fid, [360,288], 'uint8');
        FrameY = uint8(FrameY');
        FrameU = fread(fid, [180,144], 'uint8');
        FrameU = uint8(FrameU');
        FrameV = fread(fid, [180,144], 'uint8');
        FrameV = uint8(FrameV');
    otherwise
        disp('error format');
end

⌨️ 快捷键说明

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