Commit 0f420c7890 for ffmpeg

commit 0f420c7890bc394a7cf64c46daebb380a89ca8a8
Author: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Date:   Sun Nov 15 14:18:59 2026 -0800

    avcodec/mpeg4audio: read the output rate of low-delay SBR

    MOV reported dual-rate ELD at its core rate, half the output rate. Parse
    the LD-SBR flags, count ELD frame lengths in output samples, and skip
    the sync extension scan for ELD.

    ELD signals LD-SBR in ELDSpecificConfig, so the sync extension scan
    could override it (ISO/IEC 14496-3 1.6.5.1). Matroska best_fit_ts uses
    the output rate since the frame length now counts output samples.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
    Signed-off-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>

diff --git a/libavcodec/mpeg4audio.c b/libavcodec/mpeg4audio.c
index 0430568b63..46d238d3c6 100644
--- a/libavcodec/mpeg4audio.c
+++ b/libavcodec/mpeg4audio.c
@@ -143,9 +143,26 @@ int ff_mpeg4audio_get_config_gb(MPEG4AudioConfig *c, GetBitContext *gb,
         c->frame_length = c->frame_length_short ? 960 : 1024;
         break;
     case AOT_ER_AAC_LD:
+        c->frame_length_short = get_bits1(gb);
+        c->frame_length = c->frame_length_short ? 480 : 512;
+        break;
     case AOT_ER_AAC_ELD:
+        if (get_bits_left(gb) < 5)
+            return AVERROR_INVALIDDATA;
         c->frame_length_short = get_bits1(gb);
         c->frame_length = c->frame_length_short ? 480 : 512;
+        skip_bits(gb, 3); /* resilience flags */
+        c->sbr = get_bits1(gb);
+        if (c->sbr) {
+            int dual_rate;
+
+            if (get_bits_left(gb) < 1)
+                return AVERROR_INVALIDDATA;
+            dual_rate = get_bits1(gb);
+            c->ext_object_type = AOT_SBR;
+            c->ext_sample_rate = c->sample_rate << dual_rate;
+            c->frame_length <<= dual_rate;
+        }
         break;
     case AOT_USAC: {
         int core_sbr_frame_len_idx, sbr_ratio;
@@ -181,7 +198,8 @@ int ff_mpeg4audio_get_config_gb(MPEG4AudioConfig *c, GetBitContext *gb,
     }
     }

-    if (c->ext_object_type != AOT_SBR && sync_extension) {
+    if (c->ext_object_type != AOT_SBR && c->object_type != AOT_ER_AAC_ELD &&
+        sync_extension) {
         while (get_bits_left(gb) > 15) {
             if (show_bits(gb, 11) == 0x2b7) { // sync extension
                 get_bits(gb, 11);
diff --git a/libavcodec/mpeg4audio.h b/libavcodec/mpeg4audio.h
index 089d6abf9f..a1845c238c 100644
--- a/libavcodec/mpeg4audio.h
+++ b/libavcodec/mpeg4audio.h
@@ -39,7 +39,7 @@ typedef struct MPEG4AudioConfig {
     int channels;
     int ps;  ///< -1 implicit, 1 presence
     int frame_length_short;
-    int frame_length; ///< derived value
+    int frame_length; ///< Samples per frame. For ELD with LD-SBR, counted at ext_sample_rate.
 } MPEG4AudioConfig;

 extern const int     ff_mpeg4audio_sample_rates[16];
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index dc5194fd23..1cad8994c8 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -3250,7 +3250,7 @@ static void mka_setup_exact_timestamps(MatroskaTrack *track, AVStream *st,
         goto keep_clock;
     case AV_CODEC_ID_AAC: {
         MPEG4AudioConfig cfg = { 0 };
-        int frame_length;
+        int frame_length, frame_rate;

         if (avpriv_mpeg4audio_get_config2(&cfg, par->extradata,
                                           par->extradata_size, 1,
@@ -3260,14 +3260,18 @@ static void mka_setup_exact_timestamps(MatroskaTrack *track, AVStream *st,
             goto keep_clock;
         }
         // A frame holds its samples at the core rate, whatever the SBR
-        // signalling.
+        // signalling, except low-delay SBR, whose frame length counts
+        // output samples.
         frame_length = cfg.frame_length;
+        frame_rate   = cfg.sample_rate;
+        if (cfg.object_type == AOT_ER_AAC_ELD && cfg.sbr == 1)
+            frame_rate = cfg.ext_sample_rate;
         if (frame_length <= 0 ||
-            (int64_t)frame_length * rate % cfg.sample_rate) {
+            (int64_t)frame_length * rate % frame_rate) {
             reason = "frame length unknown";
             goto keep_clock;
         }
-        samples = (int64_t)frame_length * rate / cfg.sample_rate;
+        samples = (int64_t)frame_length * rate / frame_rate;
         break;
     }
     default:
diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak
index 259b7f699e..0f50ae5e1d 100644
--- a/tests/fate/matroska.mak
+++ b/tests/fate/matroska.mak
@@ -32,6 +32,10 @@ fate-matroska-opus-best-fit-ts-sample-gap: CMD = transcode matroska $(TARGET_SAM
 FATE_MATROSKA_FFMPEG_FFPROBE-$(call REMUX, MATROSKA, MOV_DEMUXER AAC_DECODER) += fate-matroska-aac-eld-best-fit-ts
 fate-matroska-aac-eld-best-fit-ts: CMD = transcode mov $(TARGET_SAMPLES)/aac/er_eld2000np_48_ep0.mp4 matroska "-c copy -frames:a 16 -timestamp_scale 1000000" "-c copy" "" "" "-best_fit_ts 1"

+# Test the complete LD-SBR timestamp grid independently of MOV edit-list trimming.
+FATE_MATROSKA-$(call REMUX, MATROSKA, MOV_DEMUXER) += fate-matroska-aac-eld-dual-rate-best-fit-ts
+fate-matroska-aac-eld-dual-rate-best-fit-ts: CMD = transcode mov $(TARGET_SAMPLES)/mov/aac-eld-dual-rate.mp4 matroska "-c copy -timestamp_scale 1000000" "-c copy" "" "" "-nofind_stream_info -best_fit_ts 1" "-nofind_stream_info -ignore_editlist 1"
+
 FATE_MATROSKA-$(call FRAMECRC, MATROSKA,, VORBIS_PARSER) += fate-matroska-vorbis-best-fit-ts
 fate-matroska-vorbis-best-fit-ts: CMD = framecrc -best_fit_ts 1 -i $(TARGET_SAMPLES)/vp8/RRSF49-short.webm -map 0:a -c copy -frames:a 50

diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index 81b315fdde..c48e47135a 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -185,6 +185,10 @@ fate-mov-aac-he-core-rate-mid-packet: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -rea
 FATE_MOV-$(call FRAMECRC, MOV, AAC, PCM_S16LE_ENCODER ARESAMPLE_FILTER VOLUME_FILTER) += fate-mov-aac-2048-priming-seek
 fate-mov-aac-2048-priming-seek: CMD = framecrc -ss 2.3 -t 0.15 -i $(TARGET_SAMPLES)/mov/aac-2048-priming.mov -af volume=0,aresample -c:a pcm_s16le

+# Dual-rate low-delay SBR ELD: check the output rate independently of edit-list trimming.
+FATE_MOV-$(call DEMMUX, MOV, FRAMECRC, PIPE_PROTOCOL) += fate-mov-aac-eld-dual-rate
+fate-mov-aac-eld-dual-rate: CMD = framecrc -nofind_stream_info -ignore_editlist 1 -i $(TARGET_SAMPLES)/mov/aac-eld-dual-rate.mp4 -c:a copy
+
 fate-mov-zombie: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_streams -show_packets -show_frames -bitexact -print_format compact $(TARGET_SAMPLES)/mov/white_zombie_scrunch-part.mov

 fate-mov-init-nonkeyframe: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_packets -print_format compact -select_streams v $(TARGET_SAMPLES)/mov/mp4-init-nonkeyframe.mp4
diff --git a/tests/ref/fate/matroska-aac-eld-dual-rate-best-fit-ts b/tests/ref/fate/matroska-aac-eld-dual-rate-best-fit-ts
new file mode 100644
index 0000000000..08b0509590
--- /dev/null
+++ b/tests/ref/fate/matroska-aac-eld-dual-rate-best-fit-ts
@@ -0,0 +1,225 @@
+3cb3ff1e727eccdd167e5827510573cc *tests/data/fate/matroska-aac-eld-dual-rate-best-fit-ts.matroska
+18389 tests/data/fate/matroska-aac-eld-dual-rate-best-fit-ts.matroska
+#extradata 0:       11, 0x23ea04e3
+#tb 0: 1/44100
+#media_type 0: audio
+#codec_id 0: aac
+#sample_rate 0: 44100
+#channel_layout_name 0: mono
+0,          0,          0,     1024,       98, 0x8cdc2f18
+0,       1024,       1024,     1024,       68, 0x3f891e6f
+0,       2048,       2048,     1024,       58, 0xf2af17ef
+0,       3072,       3072,     1024,       60, 0x56eb19fe
+0,       4096,       4096,     1024,       63, 0xfd511aeb
+0,       5120,       5120,     1024,       79, 0x404922ab
+0,       6144,       6144,     1024,       71, 0xd8ff2060
+0,       7168,       7168,     1024,       67, 0xed3a1c6f
+0,       8192,       8192,     1024,       60, 0x5072193a
+0,       9216,       9216,     1024,       59, 0x66c919f3
+0,      10240,      10240,     1024,       64, 0x3e641ebb
+0,      11264,      11264,     1024,       55, 0xc99017c0
+0,      12288,      12288,     1024,       68, 0x591b1c50
+0,      13312,      13312,     1024,       79, 0xff7e21ba
+0,      14336,      14336,     1024,       76, 0x5ce420a2
+0,      15360,      15360,     1024,       77, 0xb2652260
+0,      16384,      16384,     1024,       77, 0xa3a9211f
+0,      17408,      17408,     1024,       70, 0x1638208c
+0,      18432,      18432,     1024,       74, 0xcf9e1e35
+0,      19456,      19456,     1024,       67, 0x90a51ff7
+0,      20480,      20480,     1024,       69, 0x63ec1c13
+0,      21504,      21504,     1024,       72, 0x976f21d0
+0,      22528,      22528,     1024,       87, 0xaf572687
+0,      23552,      23552,     1024,       71, 0x047f1f05
+0,      24576,      24576,     1024,       76, 0x041a246f
+0,      25600,      25600,     1024,       71, 0x9ac91fbd
+0,      26624,      26624,     1024,       75, 0x161324e3
+0,      27648,      27648,     1024,       76, 0x324a25da
+0,      28672,      28672,     1024,       72, 0x39392203
+0,      29696,      29696,     1024,       75, 0xe7c12365
+0,      30720,      30720,     1024,       69, 0xba941fbe
+0,      31744,      31744,     1024,       85, 0xf2bc2bda
+0,      32768,      32768,     1024,       75, 0x21701ea6
+0,      33792,      33792,     1024,       76, 0x0d0e241c
+0,      34816,      34816,     1024,       76, 0x3e7c1ee6
+0,      35840,      35840,     1024,       73, 0xc5a523e0
+0,      36864,      36864,     1024,       76, 0x8ab72398
+0,      37888,      37888,     1024,       81, 0x831023a0
+0,      38912,      38912,     1024,       84, 0xfdcc28d4
+0,      39936,      39936,     1024,       64, 0xd1811940
+0,      40960,      40960,     1024,       84, 0xe4fc250c
+0,      41984,      41984,     1024,       71, 0xbc961ea1
+0,      43008,      43008,     1024,       75, 0x83ef2272
+0,      44032,      44032,     1024,       68, 0x74ca1ca6
+0,      45056,      45056,     1024,       81, 0x41a82517
+0,      46080,      46080,     1024,       84, 0xddd52481
+0,      47104,      47104,     1024,       75, 0xd1c3239d
+0,      48128,      48128,     1024,       84, 0xbbeb2540
+0,      49152,      49152,     1024,       79, 0xa2531f9e
+0,      50176,      50176,     1024,       86, 0x34df2546
+0,      51200,      51200,     1024,       63, 0xe7481c36
+0,      52224,      52224,     1024,       81, 0x884e2590
+0,      53248,      53248,     1024,       62, 0xec261c4c
+0,      54272,      54272,     1024,       76, 0xc5ff2294
+0,      55296,      55296,     1024,       69, 0xa7982010
+0,      56320,      56320,     1024,       74, 0x250125fd
+0,      57344,      57344,     1024,       76, 0x89612209
+0,      58368,      58368,     1024,       70, 0xd7bd1ea9
+0,      59392,      59392,     1024,       79, 0x2e23241e
+0,      60416,      60416,     1024,       75, 0x7a0b2091
+0,      61440,      61440,     1024,       92, 0xa85129ea
+0,      62464,      62464,     1024,       74, 0x6f3921b5
+0,      63488,      63488,     1024,       80, 0x5a6423cb
+0,      64512,      64512,     1024,       78, 0x32442370
+0,      65536,      65536,     1024,       81, 0x1cf22416
+0,      66560,      66560,     1024,       74, 0xcc01247f
+0,      67584,      67584,     1024,       76, 0x19d92409
+0,      68608,      68608,     1024,       80, 0xba9b2055
+0,      69632,      69632,     1024,       71, 0x113d203c
+0,      70656,      70656,     1024,       85, 0x867127a4
+0,      71680,      71680,     1024,       77, 0xa6ed235f
+0,      72704,      72704,     1024,       86, 0x86f72718
+0,      73728,      73728,     1024,       77, 0x7f8c24d1
+0,      74752,      74752,     1024,       84, 0xa87d297f
+0,      75776,      75776,     1024,       66, 0xa3132065
+0,      76800,      76800,     1024,       82, 0xd8bb2703
+0,      77824,      77824,     1024,       69, 0x5e591cdd
+0,      78848,      78848,     1024,       78, 0xc51728c6
+0,      79872,      79872,     1024,       80, 0xdaea26b5
+0,      80896,      80896,     1024,       72, 0x7c751c89
+0,      81920,      81920,     1024,       85, 0xba9c29e3
+0,      82944,      82944,     1024,       75, 0xeade22a5
+0,      83968,      83968,     1024,       86, 0x787226c6
+0,      84992,      84992,     1024,       65, 0x49661e43
+0,      86016,      86016,     1024,       74, 0xac9f2190
+0,      87040,      87040,     1024,       64, 0xded91a8e
+0,      88064,      88064,     1024,       91, 0x7d8931e0
+0,      89088,      89088,     1024,       72, 0x8c661c7f
+0,      90112,      90112,     1024,       76, 0xa94e2042
+0,      91136,      91136,     1024,       76, 0x9afe227c
+0,      92160,      92160,     1024,       76, 0x1e4d244d
+0,      93184,      93184,     1024,       72, 0x53fe2008
+0,      94208,      94208,     1024,       66, 0x68da1ea6
+0,      95232,      95232,     1024,       74, 0x92df21ee
+0,      96256,      96256,     1024,       76, 0xa3d022e4
+0,      97280,      97280,     1024,       71, 0x84a81dbd
+0,      98304,      98304,     1024,       79, 0x3fae22ac
+0,      99328,      99328,     1024,       80, 0x4a371ea4
+0,     100352,     100352,     1024,       85, 0xab8b296a
+0,     101376,     101376,     1024,       99, 0x2fe030d2
+0,     102400,     102400,     1024,       70, 0xe51120d6
+0,     103424,     103424,     1024,       74, 0x46472075
+0,     104448,     104448,     1024,       72, 0x7aea220f
+0,     105472,     105472,     1024,       84, 0xca5d2497
+0,     106496,     106496,     1024,       73, 0xa7d52446
+0,     107520,     107520,     1024,       83, 0xa19525c3
+0,     108544,     108544,     1024,       74, 0xbbaa21bf
+0,     109568,     109568,     1024,       92, 0xa77b2abe
+0,     110592,     110592,     1024,       85, 0xe1af1f37
+0,     111616,     111616,     1024,       75, 0x309824b3
+0,     112640,     112640,     1024,       79, 0x0c80241d
+0,     113664,     113664,     1024,       69, 0xf423200c
+0,     114688,     114688,     1024,       91, 0x3b2d2c74
+0,     115712,     115712,     1024,       65, 0x169d1b97
+0,     116736,     116736,     1024,       83, 0xd3f023fe
+0,     117760,     117760,     1024,       74, 0x8e9721a1
+0,     118784,     118784,     1024,       90, 0xf4512bad
+0,     119808,     119808,     1024,       73, 0x4706204a
+0,     120832,     120832,     1024,       84, 0x0050253a
+0,     121856,     121856,     1024,       71, 0x041c21af
+0,     122880,     122880,     1024,       75, 0xb71722f7
+0,     123904,     123904,     1024,       74, 0xb6762371
+0,     124928,     124928,     1024,       69, 0xd15d1fba
+0,     125952,     125952,     1024,       81, 0xbfa72001
+0,     126976,     126976,     1024,       71, 0x2cd22858
+0,     128000,     128000,     1024,       81, 0x79c92668
+0,     129024,     129024,     1024,       60, 0x89611b41
+0,     130048,     130048,     1024,       83, 0x2750278b
+0,     131072,     131072,     1024,       65, 0x3f051dad
+0,     132096,     132096,     1024,       85, 0xa6062a4a
+0,     133120,     133120,     1024,       79, 0xa3cf2594
+0,     134144,     134144,     1024,       73, 0x047f2047
+0,     135168,     135168,     1024,       84, 0xd75329dd
+0,     136192,     136192,     1024,       73, 0xbb4f1ed5
+0,     137216,     137216,     1024,       89, 0x89ca2813
+0,     138240,     138240,     1024,       64, 0xfbcc1bf8
+0,     139264,     139264,     1024,       90, 0xcbaa284a
+0,     140288,     140288,     1024,       75, 0x5dd6203f
+0,     141312,     141312,     1024,       71, 0x07221fbb
+0,     142336,     142336,     1024,       74, 0x66131f08
+0,     143360,     143360,     1024,       68, 0xb59e1fca
+0,     144384,     144384,     1024,       79, 0x46d32367
+0,     145408,     145408,     1024,       82, 0x94832626
+0,     146432,     146432,     1024,       77, 0xb9be27d4
+0,     147456,     147456,     1024,       80, 0x771023fb
+0,     148480,     148480,     1024,       86, 0xbf832615
+0,     149504,     149504,     1024,       75, 0x54a2253b
+0,     150528,     150528,     1024,       85, 0xb5cf289f
+0,     151552,     151552,     1024,       71, 0x242b2090
+0,     152576,     152576,     1024,       74, 0x6f9a2227
+0,     153600,     153600,     1024,       75, 0x57a1210a
+0,     154624,     154624,     1024,       74, 0xb1902331
+0,     155648,     155648,     1024,       82, 0x05bb2580
+0,     156672,     156672,     1024,       75, 0xdff52606
+0,     157696,     157696,     1024,       78, 0x8a9725b2
+0,     158720,     158720,     1024,       80, 0x5cbf24ea
+0,     159744,     159744,     1024,       78, 0x18c5250a
+0,     160768,     160768,     1024,       70, 0x86831e81
+0,     161792,     161792,     1024,       75, 0x1b981f32
+0,     162816,     162816,     1024,       72, 0x211a207c
+0,     163840,     163840,     1024,       72, 0x01fd1ffc
+0,     164864,     164864,     1024,       81, 0x172b218c
+0,     165888,     165888,     1024,       91, 0x22ef2a8c
+0,     166912,     166912,     1024,       87, 0xe46b2c2e
+0,     167936,     167936,     1024,       75, 0xcbfe24bf
+0,     168960,     168960,     1024,       77, 0x039822aa
+0,     169984,     169984,     1024,       69, 0x1036218c
+0,     171008,     171008,     1024,       73, 0x47ed1fc3
+0,     172032,     172032,     1024,       70, 0x323a1c1b
+0,     173056,     173056,     1024,       74, 0x0c7e256f
+0,     174080,     174080,     1024,       81, 0xaa8623db
+0,     175104,     175104,     1024,       74, 0xc2471e10
+0,     176128,     176128,     1024,       83, 0xb61b254c
+0,     177152,     177152,     1024,       83, 0x990227fd
+0,     178176,     178176,     1024,       73, 0x5f942114
+0,     179200,     179200,     1024,       76, 0xdb76236c
+0,     180224,     180224,     1024,       74, 0x8acd2330
+0,     181248,     181248,     1024,       83, 0x78eb241e
+0,     182272,     182272,     1024,       79, 0x33ef240f
+0,     183296,     183296,     1024,       85, 0x12c926b7
+0,     184320,     184320,     1024,       79, 0xa4fe2032
+0,     185344,     185344,     1024,       82, 0x3f5228f1
+0,     186368,     186368,     1024,       76, 0xc86d234d
+0,     187392,     187392,     1024,       78, 0x230f239f
+0,     188416,     188416,     1024,       76, 0xbbb922d0
+0,     189440,     189440,     1024,       75, 0x96d4220d
+0,     190464,     190464,     1024,       81, 0x4da525ac
+0,     191488,     191488,     1024,       69, 0x295f1abb
+0,     192512,     192512,     1024,       80, 0x1e3224ee
+0,     193536,     193536,     1024,       78, 0xd0da2302
+0,     194560,     194560,     1024,       88, 0x74dd2b12
+0,     195584,     195584,     1024,       87, 0xc4832121
+0,     196608,     196608,     1024,       86, 0x75a827b3
+0,     197632,     197632,     1024,       76, 0xc5cf224c
+0,     198656,     198656,     1024,       70, 0x796122a1
+0,     199680,     199680,     1024,       84, 0x349d2674
+0,     200704,     200704,     1024,       64, 0x3b461d81
+0,     201728,     201728,     1024,       80, 0x6d5c2480
+0,     202752,     202752,     1024,       81, 0x34992620
+0,     203776,     203776,     1024,       81, 0x5e7d24dc
+0,     204800,     204800,     1024,       74, 0x297a1e98
+0,     205824,     205824,     1024,       82, 0xcf542a44
+0,     206848,     206848,     1024,       72, 0x53e921ae
+0,     207872,     207872,     1024,       78, 0x182b23a7
+0,     208896,     208896,     1024,       86, 0x055c26e3
+0,     209920,     209920,     1024,       64, 0xa04f2237
+0,     210944,     210944,     1024,       79, 0x7166246b
+0,     211968,     211968,     1024,       68, 0x9aa91e57
+0,     212992,     212992,     1024,       80, 0x8dc024d7
+0,     214016,     214016,     1024,       65, 0x47f11d7c
+0,     215040,     215040,     1024,       73, 0x6ab6229d
+0,     216064,     216064,     1024,       67, 0x9d601d79
+0,     217088,     217088,     1024,       79, 0xd4a525f2
+0,     218112,     218112,     1024,       81, 0x219b225a
+0,     219136,     219136,     1024,       67, 0xba7c2151
+0,     220160,     220160,     1024,       82, 0x20df2b25
+0,     221184,     221184,     1024,      128, 0x4dee3bea
diff --git a/tests/ref/fate/mov-aac-eld-dual-rate b/tests/ref/fate/mov-aac-eld-dual-rate
new file mode 100644
index 0000000000..820cb75e7e
--- /dev/null
+++ b/tests/ref/fate/mov-aac-eld-dual-rate
@@ -0,0 +1,223 @@
+#extradata 0:       11, 0x23ea04e3
+#tb 0: 1/22050
+#media_type 0: audio
+#codec_id 0: aac
+#sample_rate 0: 44100
+#channel_layout_name 0: mono
+0,          0,          0,      512,       98, 0x8cdc2f18
+0,        512,        512,      512,       68, 0x3f891e6f
+0,       1024,       1024,      512,       58, 0xf2af17ef
+0,       1536,       1536,      512,       60, 0x56eb19fe
+0,       2048,       2048,      512,       63, 0xfd511aeb
+0,       2560,       2560,      512,       79, 0x404922ab
+0,       3072,       3072,      512,       71, 0xd8ff2060
+0,       3584,       3584,      512,       67, 0xed3a1c6f
+0,       4096,       4096,      512,       60, 0x5072193a
+0,       4608,       4608,      512,       59, 0x66c919f3
+0,       5120,       5120,      512,       64, 0x3e641ebb
+0,       5632,       5632,      512,       55, 0xc99017c0
+0,       6144,       6144,      512,       68, 0x591b1c50
+0,       6656,       6656,      512,       79, 0xff7e21ba
+0,       7168,       7168,      512,       76, 0x5ce420a2
+0,       7680,       7680,      512,       77, 0xb2652260
+0,       8192,       8192,      512,       77, 0xa3a9211f
+0,       8704,       8704,      512,       70, 0x1638208c
+0,       9216,       9216,      512,       74, 0xcf9e1e35
+0,       9728,       9728,      512,       67, 0x90a51ff7
+0,      10240,      10240,      512,       69, 0x63ec1c13
+0,      10752,      10752,      512,       72, 0x976f21d0
+0,      11264,      11264,      512,       87, 0xaf572687
+0,      11776,      11776,      512,       71, 0x047f1f05
+0,      12288,      12288,      512,       76, 0x041a246f
+0,      12800,      12800,      512,       71, 0x9ac91fbd
+0,      13312,      13312,      512,       75, 0x161324e3
+0,      13824,      13824,      512,       76, 0x324a25da
+0,      14336,      14336,      512,       72, 0x39392203
+0,      14848,      14848,      512,       75, 0xe7c12365
+0,      15360,      15360,      512,       69, 0xba941fbe
+0,      15872,      15872,      512,       85, 0xf2bc2bda
+0,      16384,      16384,      512,       75, 0x21701ea6
+0,      16896,      16896,      512,       76, 0x0d0e241c
+0,      17408,      17408,      512,       76, 0x3e7c1ee6
+0,      17920,      17920,      512,       73, 0xc5a523e0
+0,      18432,      18432,      512,       76, 0x8ab72398
+0,      18944,      18944,      512,       81, 0x831023a0
+0,      19456,      19456,      512,       84, 0xfdcc28d4
+0,      19968,      19968,      512,       64, 0xd1811940
+0,      20480,      20480,      512,       84, 0xe4fc250c
+0,      20992,      20992,      512,       71, 0xbc961ea1
+0,      21504,      21504,      512,       75, 0x83ef2272
+0,      22016,      22016,      512,       68, 0x74ca1ca6
+0,      22528,      22528,      512,       81, 0x41a82517
+0,      23040,      23040,      512,       84, 0xddd52481
+0,      23552,      23552,      512,       75, 0xd1c3239d
+0,      24064,      24064,      512,       84, 0xbbeb2540
+0,      24576,      24576,      512,       79, 0xa2531f9e
+0,      25088,      25088,      512,       86, 0x34df2546
+0,      25600,      25600,      512,       63, 0xe7481c36
+0,      26112,      26112,      512,       81, 0x884e2590
+0,      26624,      26624,      512,       62, 0xec261c4c
+0,      27136,      27136,      512,       76, 0xc5ff2294
+0,      27648,      27648,      512,       69, 0xa7982010
+0,      28160,      28160,      512,       74, 0x250125fd
+0,      28672,      28672,      512,       76, 0x89612209
+0,      29184,      29184,      512,       70, 0xd7bd1ea9
+0,      29696,      29696,      512,       79, 0x2e23241e
+0,      30208,      30208,      512,       75, 0x7a0b2091
+0,      30720,      30720,      512,       92, 0xa85129ea
+0,      31232,      31232,      512,       74, 0x6f3921b5
+0,      31744,      31744,      512,       80, 0x5a6423cb
+0,      32256,      32256,      512,       78, 0x32442370
+0,      32768,      32768,      512,       81, 0x1cf22416
+0,      33280,      33280,      512,       74, 0xcc01247f
+0,      33792,      33792,      512,       76, 0x19d92409
+0,      34304,      34304,      512,       80, 0xba9b2055
+0,      34816,      34816,      512,       71, 0x113d203c
+0,      35328,      35328,      512,       85, 0x867127a4
+0,      35840,      35840,      512,       77, 0xa6ed235f
+0,      36352,      36352,      512,       86, 0x86f72718
+0,      36864,      36864,      512,       77, 0x7f8c24d1
+0,      37376,      37376,      512,       84, 0xa87d297f
+0,      37888,      37888,      512,       66, 0xa3132065
+0,      38400,      38400,      512,       82, 0xd8bb2703
+0,      38912,      38912,      512,       69, 0x5e591cdd
+0,      39424,      39424,      512,       78, 0xc51728c6
+0,      39936,      39936,      512,       80, 0xdaea26b5
+0,      40448,      40448,      512,       72, 0x7c751c89
+0,      40960,      40960,      512,       85, 0xba9c29e3
+0,      41472,      41472,      512,       75, 0xeade22a5
+0,      41984,      41984,      512,       86, 0x787226c6
+0,      42496,      42496,      512,       65, 0x49661e43
+0,      43008,      43008,      512,       74, 0xac9f2190
+0,      43520,      43520,      512,       64, 0xded91a8e
+0,      44032,      44032,      512,       91, 0x7d8931e0
+0,      44544,      44544,      512,       72, 0x8c661c7f
+0,      45056,      45056,      512,       76, 0xa94e2042
+0,      45568,      45568,      512,       76, 0x9afe227c
+0,      46080,      46080,      512,       76, 0x1e4d244d
+0,      46592,      46592,      512,       72, 0x53fe2008
+0,      47104,      47104,      512,       66, 0x68da1ea6
+0,      47616,      47616,      512,       74, 0x92df21ee
+0,      48128,      48128,      512,       76, 0xa3d022e4
+0,      48640,      48640,      512,       71, 0x84a81dbd
+0,      49152,      49152,      512,       79, 0x3fae22ac
+0,      49664,      49664,      512,       80, 0x4a371ea4
+0,      50176,      50176,      512,       85, 0xab8b296a
+0,      50688,      50688,      512,       99, 0x2fe030d2
+0,      51200,      51200,      512,       70, 0xe51120d6
+0,      51712,      51712,      512,       74, 0x46472075
+0,      52224,      52224,      512,       72, 0x7aea220f
+0,      52736,      52736,      512,       84, 0xca5d2497
+0,      53248,      53248,      512,       73, 0xa7d52446
+0,      53760,      53760,      512,       83, 0xa19525c3
+0,      54272,      54272,      512,       74, 0xbbaa21bf
+0,      54784,      54784,      512,       92, 0xa77b2abe
+0,      55296,      55296,      512,       85, 0xe1af1f37
+0,      55808,      55808,      512,       75, 0x309824b3
+0,      56320,      56320,      512,       79, 0x0c80241d
+0,      56832,      56832,      512,       69, 0xf423200c
+0,      57344,      57344,      512,       91, 0x3b2d2c74
+0,      57856,      57856,      512,       65, 0x169d1b97
+0,      58368,      58368,      512,       83, 0xd3f023fe
+0,      58880,      58880,      512,       74, 0x8e9721a1
+0,      59392,      59392,      512,       90, 0xf4512bad
+0,      59904,      59904,      512,       73, 0x4706204a
+0,      60416,      60416,      512,       84, 0x0050253a
+0,      60928,      60928,      512,       71, 0x041c21af
+0,      61440,      61440,      512,       75, 0xb71722f7
+0,      61952,      61952,      512,       74, 0xb6762371
+0,      62464,      62464,      512,       69, 0xd15d1fba
+0,      62976,      62976,      512,       81, 0xbfa72001
+0,      63488,      63488,      512,       71, 0x2cd22858
+0,      64000,      64000,      512,       81, 0x79c92668
+0,      64512,      64512,      512,       60, 0x89611b41
+0,      65024,      65024,      512,       83, 0x2750278b
+0,      65536,      65536,      512,       65, 0x3f051dad
+0,      66048,      66048,      512,       85, 0xa6062a4a
+0,      66560,      66560,      512,       79, 0xa3cf2594
+0,      67072,      67072,      512,       73, 0x047f2047
+0,      67584,      67584,      512,       84, 0xd75329dd
+0,      68096,      68096,      512,       73, 0xbb4f1ed5
+0,      68608,      68608,      512,       89, 0x89ca2813
+0,      69120,      69120,      512,       64, 0xfbcc1bf8
+0,      69632,      69632,      512,       90, 0xcbaa284a
+0,      70144,      70144,      512,       75, 0x5dd6203f
+0,      70656,      70656,      512,       71, 0x07221fbb
+0,      71168,      71168,      512,       74, 0x66131f08
+0,      71680,      71680,      512,       68, 0xb59e1fca
+0,      72192,      72192,      512,       79, 0x46d32367
+0,      72704,      72704,      512,       82, 0x94832626
+0,      73216,      73216,      512,       77, 0xb9be27d4
+0,      73728,      73728,      512,       80, 0x771023fb
+0,      74240,      74240,      512,       86, 0xbf832615
+0,      74752,      74752,      512,       75, 0x54a2253b
+0,      75264,      75264,      512,       85, 0xb5cf289f
+0,      75776,      75776,      512,       71, 0x242b2090
+0,      76288,      76288,      512,       74, 0x6f9a2227
+0,      76800,      76800,      512,       75, 0x57a1210a
+0,      77312,      77312,      512,       74, 0xb1902331
+0,      77824,      77824,      512,       82, 0x05bb2580
+0,      78336,      78336,      512,       75, 0xdff52606
+0,      78848,      78848,      512,       78, 0x8a9725b2
+0,      79360,      79360,      512,       80, 0x5cbf24ea
+0,      79872,      79872,      512,       78, 0x18c5250a
+0,      80384,      80384,      512,       70, 0x86831e81
+0,      80896,      80896,      512,       75, 0x1b981f32
+0,      81408,      81408,      512,       72, 0x211a207c
+0,      81920,      81920,      512,       72, 0x01fd1ffc
+0,      82432,      82432,      512,       81, 0x172b218c
+0,      82944,      82944,      512,       91, 0x22ef2a8c
+0,      83456,      83456,      512,       87, 0xe46b2c2e
+0,      83968,      83968,      512,       75, 0xcbfe24bf
+0,      84480,      84480,      512,       77, 0x039822aa
+0,      84992,      84992,      512,       69, 0x1036218c
+0,      85504,      85504,      512,       73, 0x47ed1fc3
+0,      86016,      86016,      512,       70, 0x323a1c1b
+0,      86528,      86528,      512,       74, 0x0c7e256f
+0,      87040,      87040,      512,       81, 0xaa8623db
+0,      87552,      87552,      512,       74, 0xc2471e10
+0,      88064,      88064,      512,       83, 0xb61b254c
+0,      88576,      88576,      512,       83, 0x990227fd
+0,      89088,      89088,      512,       73, 0x5f942114
+0,      89600,      89600,      512,       76, 0xdb76236c
+0,      90112,      90112,      512,       74, 0x8acd2330
+0,      90624,      90624,      512,       83, 0x78eb241e
+0,      91136,      91136,      512,       79, 0x33ef240f
+0,      91648,      91648,      512,       85, 0x12c926b7
+0,      92160,      92160,      512,       79, 0xa4fe2032
+0,      92672,      92672,      512,       82, 0x3f5228f1
+0,      93184,      93184,      512,       76, 0xc86d234d
+0,      93696,      93696,      512,       78, 0x230f239f
+0,      94208,      94208,      512,       76, 0xbbb922d0
+0,      94720,      94720,      512,       75, 0x96d4220d
+0,      95232,      95232,      512,       81, 0x4da525ac
+0,      95744,      95744,      512,       69, 0x295f1abb
+0,      96256,      96256,      512,       80, 0x1e3224ee
+0,      96768,      96768,      512,       78, 0xd0da2302
+0,      97280,      97280,      512,       88, 0x74dd2b12
+0,      97792,      97792,      512,       87, 0xc4832121
+0,      98304,      98304,      512,       86, 0x75a827b3
+0,      98816,      98816,      512,       76, 0xc5cf224c
+0,      99328,      99328,      512,       70, 0x796122a1
+0,      99840,      99840,      512,       84, 0x349d2674
+0,     100352,     100352,      512,       64, 0x3b461d81
+0,     100864,     100864,      512,       80, 0x6d5c2480
+0,     101376,     101376,      512,       81, 0x34992620
+0,     101888,     101888,      512,       81, 0x5e7d24dc
+0,     102400,     102400,      512,       74, 0x297a1e98
+0,     102912,     102912,      512,       82, 0xcf542a44
+0,     103424,     103424,      512,       72, 0x53e921ae
+0,     103936,     103936,      512,       78, 0x182b23a7
+0,     104448,     104448,      512,       86, 0x055c26e3
+0,     104960,     104960,      512,       64, 0xa04f2237
+0,     105472,     105472,      512,       79, 0x7166246b
+0,     105984,     105984,      512,       68, 0x9aa91e57
+0,     106496,     106496,      512,       80, 0x8dc024d7
+0,     107008,     107008,      512,       65, 0x47f11d7c
+0,     107520,     107520,      512,       73, 0x6ab6229d
+0,     108032,     108032,      512,       67, 0x9d601d79
+0,     108544,     108544,      512,       79, 0xd4a525f2
+0,     109056,     109056,      512,       81, 0x219b225a
+0,     109568,     109568,      512,       67, 0xba7c2151
+0,     110080,     110080,      512,       82, 0x20df2b25
+0,     110592,     110592,      512,      128, 0x4dee3bea