?? spiht_main.m
字號:
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
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -