function [ frame_encoded ] = encode_I_frame( frame_in, B_size, MB_size, Q)
% encodes a frame as I frame
%
% frame_in: the frame to be encoded
% B_size: block size (in pixels)
% MB_size: macro block (MB) size (in pixels)
% Q: quantization matrix to apply

[Y,chroma] = RGB_to_YCbCr(frame_in);

Nmb = size(Y)/MB_size; % number of MBs

Y_mb = mat2cell(Y, repmat(MB_size,1,Nmb(1)), repmat(MB_size,1,Nmb(2)));
Y_encoded = cell(size(Y_mb));

chroma_mb = mat2cell(chroma, repmat(MB_size/2,1,Nmb(1)), repmat(MB_size/2,1,Nmb(2)),2);
chroma_encoded = cell(size(chroma_mb));

for m = 1 : Nmb(1)
    for n = 1 : Nmb(2)

        % This part has to be completed
        
    end
end

Y_encoded = cell2mat(Y_encoded);
chroma_encoded = cell2mat(chroma_encoded);
frame_encoded = struct('encoded_luma',Y_encoded,'encoded_chroma',chroma_encoded);

end

