Skip to content

Commit 6c229fe

Browse files
committed
Lazily import numpy inside the qp_map method, just like in the motion vectors' to_ndarray method
1 parent 8769d13 commit 6c229fe

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎av/sidedata/encparams.pyx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ cimport libav as lib
22
from libc.stdint cimport uint8_t, int32_t
33

44
from enum import IntEnum
5-
import numpy as np
65

76

87
VideoEncParamsType = IntEnum(
@@ -85,6 +84,8 @@ cdef class VideoEncParams(SideData):
8584
Convenience method that creates a 2-D map with the quantization parameters per macroblock.
8685
Only for MPEG2 and H264 encoded videos.
8786
"""
87+
import numpy as np
88+
8889
cdef int mb_h = (self.frame.ptr.height + 15) // 16
8990
cdef int mb_w = (self.frame.ptr.width + 15) // 16
9091
cdef int nb_mb = mb_h * mb_w

0 commit comments

Comments
 (0)