Prev: matrix search or comparison
Next: Transparent pixels in images: outputing a .png file with transparent area
From: talal hammouri on 17 Mar 2010 09:50 Hi all, if any body have source code (m-files) for video compression using matlab that help me so much in my research. Thanx
From: Steven Lord on 17 Mar 2010 13:01
"talal hammouri" <talalah(a)yahoo.com> wrote in message news:hnqmn2$po1$1(a)fred.mathworks.com... > Hi all, > > if any body have source code (m-files) for video compression using matlab > that help me so much in my research. Here's my super-duper compression routine for a general matrix. Decompression is left as an exercise to the reader; I will NOT help write that routine, as I've given too much help already :) function y = compression(M) if ndims(M) > 2 error('compression:matrixOnly', 'COMPRESSION can only accept a matrix.'); end [rows, cols] = size(M); % Determine the minimum space required to store the compressed matrix minrc = min(rows-cols, cols-rows); indices1 = rows:minrc:cols; indices2 = cols:minrc:rows; % Use the shorter set of indices for better compression if length(indices1) > length(indices2) RCI = indices2; else RCI = indices1; end % Use FFTrig-based compression for best results y = cos(ifft2(sin(fft2(M(RCI, RCI))))); -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ |