function [low, low_label, high, high_label, uncovered, motion_Vect] = lifting_view_haar_1_decomposition(input, label, D, intra, string2)

[r,c, number_of_images] = size(input);


%transform buffers
label(label == -1) = max(max(max(label)));

%init
output = zeros(size(input));

%uncovered pixels appear in frame 2
uncovered = zeros(r, c, number_of_images/2);

%covered pixels are not visible in frame 2
%covered = zeros(r, c, number_of_images/2);

if strcmp(string2, 'ceil') == 1
    disparity = ceil(([0:1: number_of_images-1])'*D');
else
    disparity = round(([0:1: number_of_images-1])'*D');
end

%Apply this to every 2 imagesc in the sequence
for i = 1:number_of_images/2
    
    image_1 = input(:,:,2*i-1);
    image_2 = input(:,:,2*i);
    
    label_buffer = label(:,:,2*i-1:2*i);
    disparity_buffer = disparity(2*i-1:2*i,:);
    
    [output(:,:,2*i-1), output(:,:,2*i), uncovered(:,:,i), motion_Vect{i}] = haar_decomposition_two_images(image_1, image_2, label_buffer, intra(:,:,i), D, disparity_buffer);
     
end
low = output(:,:,1:2:end);
low_label = label(:,:,1:2:end);
high = output(:,:,2:2:end);
high_label = label(:,:,2:2:end);
end

