[x265] [PATCH] presets: Updating presets to improve coding efficiency and speed
Pradeep Ramachandran
pradeep at multicorewareinc.com
Tue Dec 22 04:47:17 CET 2015
# HG changeset patch
# User Pradeep Ramachandran <pradeep at multicorewareinc.com>
# Date 1450756004 -19800
# Tue Dec 22 09:16:44 2015 +0530
# Node ID 3a50008e7c938f2a0d86ddeddb2b232f337af766
# Parent f4eff2f13593627b674d0c5abed14c0f6c54863b
presets: Updating presets to improve coding efficiency and speed.
This commit results in vast improvements in encoding speed and efficiency for
several presests. Most important features are increasing # references for
some presets and enabling limit-refs and limit-mode to limit impact on speed.
diff -r f4eff2f13593 -r 3a50008e7c93 doc/reST/cli.rst
--- a/doc/reST/cli.rst Mon Dec 21 21:51:58 2015 +0000
+++ b/doc/reST/cli.rst Tue Dec 22 09:16:44 2015 +0530
@@ -685,7 +685,7 @@
(within your decoder level limits) if you enable one or
both of these flags.
- This feature is EXPERIMENTAL and functional at all RD levels.
+ Default 3.
.. option:: --limit-modes, --no-limit-modes
diff -r f4eff2f13593 -r 3a50008e7c93 doc/reST/presets.rst
--- a/doc/reST/presets.rst Mon Dec 21 21:51:58 2015 +0000
+++ b/doc/reST/presets.rst Tue Dec 22 09:16:44 2015 +0530
@@ -25,7 +25,7 @@
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
| |ultrafast |superfast |veryfast |faster |fast |medium |slow |slower |veryslow |placebo |
+=================+==========+==========+=========+=======+=====+=======+=====+=======+=========+========+
-| ctu | 32 | 32 | 32 | 64 | 64 | 64 | 64 | 64 | 64 | 64 |
+| ctu | 32 | 32 | 64 | 64 | 64 | 64 | 64 | 64 | 64 | 64 |
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
| min-cu-size | 16 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 |
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
@@ -39,7 +39,9 @@
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
| scenecut | 0 | 40 | 40 | 40 | 40 | 40 | 40 | 40 | 40 | 40 |
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
-| ref | 1 | 1 | 1 | 1 | 2 | 3 | 3 | 3 | 5 | 5 |
+| ref | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 | 5 |
++-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
+| limit-refs | 0 | 0 | 3 | 3 | 3 | 3 | 3 | 2 | 1 | 0 |
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
| me | dia | hex | hex | hex |hex | hex |star | star | star | star |
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
@@ -51,6 +53,8 @@
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
| amp | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
+| limit-modes | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 |
++-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
| max-merge | 2 | 2 | 2 | 2 | 2 | 2 | 3 | 3 | 4 | 5 |
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
| early-skip | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
@@ -69,7 +73,7 @@
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
| aq-mode | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
-| cuTree | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 |
+| cuTree | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
| rdLevel | 2 | 2 | 2 | 2 | 2 | 3 | 4 | 6 | 6 | 6 |
+-----------------+----------+----------+---------+-------+-----+-------+-----+-------+---------+--------+
diff -r f4eff2f13593 -r 3a50008e7c93 source/common/param.cpp
--- a/source/common/param.cpp Mon Dec 21 21:51:58 2015 +0000
+++ b/source/common/param.cpp Tue Dec 22 09:16:44 2015 +0530
@@ -159,7 +159,7 @@
param->subpelRefine = 2;
param->searchRange = 57;
param->maxNumMergeCand = 2;
- param->limitReferences = 0;
+ param->limitReferences = 3;
param->limitModes = 0;
param->bEnableWeightedPred = 1;
param->bEnableWeightedBiPred = 0;
@@ -279,9 +279,9 @@
param->bEnableWeightedPred = 0;
param->rdLevel = 2;
param->maxNumReferences = 1;
+ param->limitReferences = 0;
param->rc.aqStrength = 0.0;
param->rc.aqMode = X265_AQ_NONE;
- param->rc.cuTree = 0;
param->rc.qgSize = 32;
param->bEnableFastIntra = 1;
}
@@ -296,9 +296,9 @@
param->bEnableWeightedPred = 0;
param->rdLevel = 2;
param->maxNumReferences = 1;
+ param->limitReferences = 0;
param->rc.aqStrength = 0.0;
param->rc.aqMode = X265_AQ_NONE;
- param->rc.cuTree = 0;
param->rc.qgSize = 32;
param->bEnableSAO = 0;
param->bEnableFastIntra = 1;
@@ -306,13 +306,11 @@
else if (!strcmp(preset, "veryfast"))
{
param->lookaheadDepth = 15;
- param->maxCUSize = 32;
param->bFrameAdaptive = 0;
param->subpelRefine = 1;
param->bEnableEarlySkip = 1;
param->rdLevel = 2;
- param->maxNumReferences = 1;
- param->rc.cuTree = 0;
+ param->maxNumReferences = 2;
param->rc.qgSize = 32;
param->bEnableFastIntra = 1;
}
@@ -322,8 +320,7 @@
param->bFrameAdaptive = 0;
param->bEnableEarlySkip = 1;
param->rdLevel = 2;
- param->maxNumReferences = 1;
- param->rc.cuTree = 0;
+ param->maxNumReferences = 2;
param->bEnableFastIntra = 1;
}
else if (!strcmp(preset, "fast"))
@@ -331,7 +328,7 @@
param->lookaheadDepth = 15;
param->bFrameAdaptive = 0;
param->rdLevel = 2;
- param->maxNumReferences = 2;
+ param->maxNumReferences = 3;
param->bEnableFastIntra = 1;
}
else if (!strcmp(preset, "medium"))
@@ -348,6 +345,8 @@
param->subpelRefine = 3;
param->maxNumMergeCand = 3;
param->searchMethod = X265_STAR_SEARCH;
+ param->maxNumReferences = 4;
+ param->limitModes = 1;
param->lookaheadSlices = 4; // limit parallelism as already enough work exists
}
else if (!strcmp(preset, "slower"))
@@ -365,6 +364,9 @@
param->subpelRefine = 3;
param->maxNumMergeCand = 3;
param->searchMethod = X265_STAR_SEARCH;
+ param->maxNumReferences = 4;
+ param->limitReferences = 2;
+ param->limitModes = 1;
param->bIntraInBFrames = 1;
param->lookaheadSlices = 4; // limit parallelism as already enough work exists
}
@@ -384,6 +386,8 @@
param->maxNumMergeCand = 4;
param->searchMethod = X265_STAR_SEARCH;
param->maxNumReferences = 5;
+ param->limitReferences = 1;
+ param->limitModes = 1;
param->bIntraInBFrames = 1;
param->lookaheadSlices = 0; // disabled for best quality
}
@@ -405,6 +409,7 @@
param->searchMethod = X265_STAR_SEARCH;
param->bEnableTransformSkip = 1;
param->maxNumReferences = 5;
+ param->limitReferences = 0;
param->rc.bEnableSlowFirstPass = 1;
param->bIntraInBFrames = 1;
param->lookaheadSlices = 0; // disabled for best quality
More information about the x265-devel
mailing list