Code covered by the BSD License  

Highlights from
3D-SPIHT

from 3D-SPIHT by DIONYSIOS ATHANASOPOULOS
The 3D Set Partitioning In Hierarchical Trees Matlab Code

SPIHT_main(nFrame,filename)
function Y_new = SPIHT_main(nFrame,filename)
%
% This function implements the 3D-SPIHT algorithm. 
% input:    filename: the video sequence in CIF,QCIF or SIF format
%           nFrame: number of frames to read from the filename specified
% output:   Y_new: the reconstructed video sequence
%
%
% Athanasopoulos Dionysios 
% Postgraduate Student
% Computer Engineering and Informatics Dept.
% University of Patras, Greece
%


% reads the luminance (Y) component from the filename specified. The file must
% be of the format CIF, QCIF, SIF. It reads nFrame frames.
Y = myfunc_read_cif(nFrame,filename);

% 3D - SPIHT encoder
type = 'bior4.4'; % type of filters for the decomposition
spatial_levels = 3; % levels of decomposition

%---------Wavelet Decomposition-----------------
for i=1:size(Y,3)
    [video_seq(:,:,i) , S] = func_DWT(Y(:,:,i), spatial_levels, type);
end

% maximum bits for the 3D-SPIHT encoding
max_bits = 675840; % for exaple if we have 16 frames each 240x352 and use 0.5 bits per pixel max_bits = 675840
out = func_SPIHT_Enc(video_seq, max_bits,spatial_levels);

% 3D - SPIHT decoder
in = func_SPIHT_Dec(out,size(Y));
video_seq2 = in;
%--------------Wavelet Reconstruction------------
for i=1:size(video_seq2,3)
    Y_new(:,:,i) = func_InvDWT(video_seq2(:,:,i), S, type, spatial_levels);
end


Contact us at files@mathworks.com