| 1 | Preset Options |
| 2 | -------------- |
| 3 | |
| 4 | Presets |
| 5 | ======= |
| 6 | |
| 7 | .. _preset-tune-ref: |
| 8 | |
| 9 | x265 has a number of predefined :option:`--preset` options that make |
| 10 | trade-offs between encode speed (encoded frames per second) and |
| 11 | compression efficiency (quality per bit in the bitstream). The default |
| 12 | preset is medium, it does a reasonably good job of finding the best |
| 13 | possible quality without spending enormous CPU cycles looking for the |
| 14 | absolute most efficient way to achieve that quality. As you go higher |
| 15 | than medium, the encoder takes shortcuts to improve performance at the |
| 16 | expense of quality and compression efficiency. As you go lower than |
| 17 | medium, the encoder tries harder and harder to achieve the best quailty |
| 18 | per bit compression ratio. |
| 19 | |
| 20 | The presets adjust encoder parameters to affect these trade-offs. |
| 21 | |
| 22 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 23 | | | ultrafast | superfast | veryfast | faster | fast | medium | slow | slower | veryslow | placebo | |
| 24 | +==============+===========+===========+==========+========+======+========+======+========+==========+=========+ |
| 25 | | ctu | 32 | 32 | 32 | 64 | 64 | 64 | 64 | 64 | 64 | 64 | |
| 26 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 27 | | bframes | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 8 | 8 | 8 | |
| 28 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 29 | | b-adapt | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | |
| 30 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 31 | | rc-lookahead | 10 | 10 | 15 | 15 | 15 | 20 | 25 | 30 | 40 | 60 | |
| 32 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 33 | | scenecut | 0 | 40 | 40 | 40 | 40 | 40 | 40 | 40 | 40 | 40 | |
| 34 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 35 | | refs | 1 | 1 | 1 | 1 | 3 | 3 | 3 | 3 | 5 | 5 | |
| 36 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 37 | | me | dia | hex | hex | hex | hex | hex | star | star | star | star | |
| 38 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 39 | | merange | 25 | 44 | 57 | 57 | 57 | 57 | 57 | 57 | 57 | 92 | |
| 40 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 41 | | subme | 0 | 1 | 1 | 2 | 2 | 2 | 3 | 3 | 4 | 5 | |
| 42 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 43 | | rect | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | |
| 44 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 45 | | amp | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |
| 46 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 47 | | max-merge | 2 | 2 | 2 | 2 | 2 | 2 | 3 | 3 | 4 | 5 | |
| 48 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 49 | | early-skip | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 50 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 51 | | fast-intra | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | |
| 52 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 53 | | b-intra | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |
| 54 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 55 | | sao | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| 56 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 57 | | signhide | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| 58 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 59 | | weightp | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| 60 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 61 | | weightb | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |
| 62 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 63 | | aq-mode | 0 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | |
| 64 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 65 | | cuTree | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | |
| 66 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 67 | | rdLevel | 2 | 2 | 2 | 2 | 2 | 3 | 4 | 6 | 6 | 6 | |
| 68 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 69 | | lft | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| 70 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 71 | | tu-intra | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 | 4 | |
| 72 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 73 | | tu-inter | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 | 4 | |
| 74 | +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+ |
| 75 | |
| 76 | Placebo mode enables transform-skip prediction evaluation. |
| 77 | |
| 78 | Tuning |
| 79 | ====== |
| 80 | |
| 81 | There are a few :option:`--tune` options available, which are applied |
| 82 | after the preset. |
| 83 | |
| 84 | .. Note:: |
| 85 | |
| 86 | The *psnr* and *ssim* tune options disable all optimizations that |
| 87 | sacrafice metric scores for perceived visual quality (also known as |
| 88 | psycho-visual optimizations). By default x265 always tunes for |
| 89 | highest perceived visual quality but if one intends to measure an |
| 90 | encode using PSNR or SSIM for the purpose of benchmarking, we highly |
| 91 | recommend you configure x265 to tune for that particular metric. |
| 92 | |
| 93 | +--------------+-----------------------------------------------------+ |
| 94 | | --tune | effect | |
| 95 | +==============+=====================================================+ |
| 96 | | psnr | disables adaptive quant, psy-rd, and cutree | |
| 97 | +--------------+-----------------------------------------------------+ |
| 98 | | ssim | enables adaptive quant auto-mode, disables psy-rd | |
| 99 | +--------------+-----------------------------------------------------+ |
| 100 | | fastdecode | no loop filters, no weighted pred, no intra in B | |
| 101 | +--------------+-----------------------------------------------------+ |
| 102 | | zerolatency | no lookahead, no B frames, no cutree | |
| 103 | +--------------+-----------------------------------------------------+ |