Skip to content

Instantly share code, notes, and snippets.

@alejandroave
Last active December 17, 2015 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alejandroave/5667120 to your computer and use it in GitHub Desktop.
Save alejandroave/5667120 to your computer and use it in GitHub Desktop.
def regr(mat):
global qa
new = np.zeros((8,8))
for i in range(8):
for j in range(8):
new[i][j] = mat[i][j]*qa[i][j]
c = idct(new, type=2, n=None, axis=-1, norm='ortho', overwrite_x=False)
for i in range(8):
for j in range(8):
c[i][j] = c[i][j] + 128
return c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment