@@ -1467,6 +1467,50 @@ ZSTD_adjustCParams_internal(ZSTD_compressionParameters cPar,
1467
1467
const U64 maxWindowResize = 1ULL << (ZSTD_WINDOWLOG_MAX - 1 );
1468
1468
assert (ZSTD_checkCParams (cPar )== 0 );
1469
1469
1470
+ /* Cascade the selected strategy down to the next-highest one built into
1471
+ * this binary. */
1472
+ #if ZSTD_EXCLUDE_BTULTRA2_BLOCK_COMPRESSOR
1473
+ if (cPar .strategy == ZSTD_btultra2 ) {
1474
+ cPar .strategy = ZSTD_btultra ;
1475
+ }
1476
+ #endif
1477
+ #if ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR
1478
+ if (cPar .strategy == ZSTD_btultra ) {
1479
+ cPar .strategy = ZSTD_btopt ;
1480
+ }
1481
+ #endif
1482
+ #if ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR
1483
+ if (cPar .strategy == ZSTD_btopt ) {
1484
+ cPar .strategy = ZSTD_btlazy2 ;
1485
+ }
1486
+ #endif
1487
+ #if ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR
1488
+ if (cPar .strategy == ZSTD_btlazy2 ) {
1489
+ cPar .strategy = ZSTD_lazy2 ;
1490
+ }
1491
+ #endif
1492
+ #if ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR
1493
+ if (cPar .strategy == ZSTD_lazy2 ) {
1494
+ cPar .strategy = ZSTD_lazy ;
1495
+ }
1496
+ #endif
1497
+ #if ZSTD_EXCLUDE_LAZY_BLOCK_COMPRESSOR
1498
+ if (cPar .strategy == ZSTD_lazy ) {
1499
+ cPar .strategy = ZSTD_greedy ;
1500
+ }
1501
+ #endif
1502
+ #if ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR
1503
+ if (cPar .strategy == ZSTD_greedy ) {
1504
+ cPar .strategy = ZSTD_dfast ;
1505
+ }
1506
+ #endif
1507
+ #if ZSTD_EXCLUDE_DFAST_BLOCK_COMPRESSOR
1508
+ if (cPar .strategy == ZSTD_dfast ) {
1509
+ cPar .strategy = ZSTD_fast ;
1510
+ cPar .targetLength = 0 ;
1511
+ }
1512
+ #endif
1513
+
1470
1514
switch (mode ) {
1471
1515
case ZSTD_cpm_unknown :
1472
1516
case ZSTD_cpm_noAttachDict :
0 commit comments