This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 71db1317822e8f1fb530fe44530da47f0e91afef
Author:     Lynne <[email protected]>
AuthorDate: Sun Sep 20 23:39:32 2026 +0900
Commit:     Lynne <[email protected]>
CommitDate: Thu Sep 24 08:02:22 2026 +0900

    simple_idct: add a 16-bit output variant with 32-bit intermediates
    
    For coefficients and output that both span 16 bits, like those of ProRes
    RAW. The template's 16-bit intermediates cannot hold more fractional
    bits than the output needs, and the constants of the 12-bit transform,
    scaled to 15 bits, make W4 32767 rather than 32768, which alone costs
    0.8 LSB RMS of a 16-bit output.
    
    The new variant uses the 10-bit transform's constants, scaled to 14
    bits and exact at W4, with a row shift of 13 and a column shift of 15,
    the most fractional bits the 32-bit sums of a 16-bit result allow.
    Against an exact transform, it is within 0.49 LSB RMS and 2.3 LSB peak
    on real content, with no bias, and passes every IEEE 1180 criterion in
    the standard's 8-bit units by three orders of magnitude.
    
    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
    Claude-Session: https://claude.ai/code/session_016LFnYMstwe4woBzpxfzDzg
---
 libavcodec/simple_idct_template.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/libavcodec/simple_idct_template.c 
b/libavcodec/simple_idct_template.c
index e189ef1a8e..051ce17a3b 100644
--- a/libavcodec/simple_idct_template.c
+++ b/libavcodec/simple_idct_template.c
@@ -60,9 +60,9 @@
 #define MUL(a, b)    MUL16(a, b)
 #define MAC(a, b, c) MAC16(a, b, c)
 
-#elif BIT_DEPTH == 10 || BIT_DEPTH == 12
+#elif BIT_DEPTH == 10 || BIT_DEPTH == 12 || BIT_DEPTH == 16
 
-# if BIT_DEPTH == 10
+# if BIT_DEPTH == 10 || BIT_DEPTH == 16
 #define W1 22725 // 90901
 #define W2 21407 //  85627
 #define W3 19265 //  77062
@@ -71,7 +71,17 @@
 #define W6  8867 //  35468
 #define W7  4520 //  18081
 
-#   ifdef EXTRA_SHIFT
+#   if BIT_DEPTH == 16
+/* 16-bit output from 16-bit coefficients. The rows keep two more
+ * fractional bits than 16-bit intermediates could hold, and the columns
+ * are shifted by as little as the 32-bit sums of a 16-bit result allow */
+#    if IN_IDCT_DEPTH != 32
+#error "The 16-bit iDCT needs 32-bit intermediates"
+#    endif
+#define ROW_SHIFT 13
+#define COL_SHIFT 15
+#define DC_SHIFT  1
+#   elif defined(EXTRA_SHIFT)
 #define ROW_SHIFT 13
 #define COL_SHIFT 18
 #define DC_SHIFT  1

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to