function soc_video_flipping_set_parameters(resolution)
mdlName = 'soc_video_flipping_top';

bytesPerPixel = 4; % 32bit for AXI4 Master R/W

switch lower(resolution)
    case "480p"
        imageWidth = 640;
        imageHeight = 480;
        dt = 1/(800*525*60);
        set_param([mdlName,'/HDMI Rx'],'FrameSize','640x480p');
        set_param([mdlName,'/HDMI Tx'],'FrameSize','640x480p');
    case "720p"
        imageWidth = 1280;
        imageHeight = 720;
        dt = 1/(1650*750*60);
        set_param([mdlName,'/HDMI Rx'],'FrameSize','720p HDTV (1280x720p)');
        set_param([mdlName,'/HDMI Tx'],'FrameSize','720p HDTV (1280x720p)');
    case "1080p"
        imageWidth = 1920;
        imageHeight = 1080;
        dt = 1/(2200*1125*60);
        set_param([mdlName,'/HDMI Rx'],'FrameSize','1080p HDTV (1920x1080p)');
        set_param([mdlName,'/HDMI Tx'],'FrameSize','1080p HDTV (1920x1080p)');
    otherwise
        assert(false,'only "480p", "720p", "1080p" supported.');
end

ChBurstLength = 2048;
TimeBetweenBursts = ChBurstLength/(imageWidth*imageHeight*60*2);

set_param([mdlName,'/AXI4 Random Access Memory'],'MRBufferSize',num2str(imageWidth*imageHeight*3*bytesPerPixel*2));
set_param([mdlName,'/Contention Read'],'BurstSize',num2str(ChBurstLength));
set_param([mdlName,'/Contention Write'],'BurstSize',num2str(ChBurstLength));
set_param([mdlName,'/Contention Read'], 'MinMaxTimeBetweenBursts',['[',num2str(TimeBetweenBursts),'  ', num2str(TimeBetweenBursts),']']);
set_param([mdlName,'/Contention Write'],'MinMaxTimeBetweenBursts',['[',num2str(TimeBetweenBursts),'  ', num2str(TimeBetweenBursts),']']);

assignin('base','imageWidth',imageWidth);
assignin('base','imageHeight',imageHeight);
assignin('base','dt',dt);
assignin('base','ChBurstLength',ChBurstLength);
assignin('base','TimeBetweenBursts',TimeBetweenBursts);
assignin('base','bytesPerPixel',bytesPerPixel);
end