0

How can I modify the code so that when decoding an h265 video stream using HM, it captures the number of bits occupied by the transform coefficients of each CTU in the bitstream?

I found that the transform coefficients are decoded in the parseCoeffNxN function in xDecodeTransform. So I added a variable in parseCoeffNxN to record the number of times decodeBin is called, trying to record the number of decoded bits. But the number differs a lot from what I see in HEVCanalyzer.enter image description here

John Z
  • 1
  • 1
  • I just wanna know the size (in bits) of the transform coefficients for each CTU after entropy coding – John Z Aug 20 '23 at 12:56

1 Answers1

0

There must be better solutions, but what I once did was to modify the parsing stage at the CTU-level (iirc) of HM, so I could figure out how many bits have been fed to the CABAC decoder since the last flush. It sounds complicated, but it's doable.

Mosen
  • 403
  • 2
  • 7