import huffman
import numpy as np
# Create a 2D array (8x8) with DCT coefficients (replace with your actual coefficients)
= np.array([
dct_coefficients 20, 30, 10, 25, 30, 0, 0, 0],
[0, 5, 0, 0, 0, 0, 5, 0],
[0, 0, 15, 0, 0, 0, 20, 0],
[0, 0, 0, 0, 1, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0]
[=np.int32)
], dtypeprint("Initial DCT matrix")
print(dct_coefficients)
Initial DCT matrix
[[20 30 10 25 30 0 0 0]
[ 0 5 0 0 0 0 5 0]
[ 0 0 15 0 0 0 20 0]
[ 0 0 0 0 1 0 0 0]
[ 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0]]