def _parse_mask(mask):
r"""
Interprets a string mask to return the number of coefficients to be kept
and the indices of the first and last ones in the zig-zagged flattened DCT matrix
Example: '1-44' returns 44, first=1, last=44
Parameters
----------
mask
Returns
-------
"""
tmp = mask.split('-')
first = int(tmp[0])
last = int(tmp[1])
ncoeffs = last-first+1
return ncoeffs, first, last
评论列表
文章目录