Commit c11f95d187 for ffmpeg

commit c11f95d1878dc35c5618326c83c0c70090eb9713
Author: ohah <bookyoon173@gmail.com>
Date:   Mon Oct 26 10:05:43 2026 +0000

    avcodec/hevc: initialize inverse quantization tables through QP 75

    rem6 and div6 each have room for 76 entries but only initialize the
    first 74. The remaining entries are implicitly zero, so QP 74 and 75
    use an inverse quantization scale of 40 instead of 51 << 12 and
    57 << 12, respectively.

    These indices are valid for 12-bit HEVC, where the bit-depth offset is
    24. Append the missing remainder and quotient entries so high-QP
    12-bit residuals use the scaling specified in H.265 section 8.6.3.

    Synthetic 12-bit 4:4:4 inputs exercising each index differ from x265's
    reconstruction in 16377 and 16379 samples before this change. Both
    outputs match the encoder reconstruction exactly after the fix.

    Signed-off-by: ohah <16170776+ohah@users.noreply.github.com>

diff --git a/libavcodec/hevc/cabac.c b/libavcodec/hevc/cabac.c
index fa4c7ebf86..f028b75214 100644
--- a/libavcodec/hevc/cabac.c
+++ b/libavcodec/hevc/cabac.c
@@ -1124,14 +1124,14 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, const HEVCPPS *pps,
             0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2,
             3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
             0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3,
-            4, 5, 0, 1, 2, 3, 4, 5, 0, 1
+            4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3
         };

         static const uint8_t div6[51 + 4 * 6 + 1] = {
             0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3,  3,  3,
             3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6,  6,  6,
             7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10,
-            10, 10, 11, 11, 11, 11, 11, 11, 12, 12
+            10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12
         };
         int qp_y = lc->sub.qp_y;