function y = invperm_zigzag(x)
% invperm_zigzag.m
%   perform inverse zigzag-scan-based permutation
% 
% Requirement:
%   ZIGZAG_SCAN: zigzag.m and invzigzag.m
% Input:
%   x: permutated matrix
% Output:
%   y: matrix befor zigzag-scan-based permutation
%
% Written: Hao Fang
% Created: Mar. 2012

[m n] = size(x);
xT = x';
y = invzigzag(xT(:), m, n);
