Discussion:
Support 04/2017 color matrix and transfer values
(too old to reply)
Vittorio Giovara
2017-12-25 19:39:46 UTC
Permalink
x264 | branch: master | Vittorio Giovara <***@gmail.com> | Tue Aug 8 14:56:43 2017 +0200| [c98d02bebd6dd04b61306ee27712aeff96f19f29] | committer: Anton Mitrofanov

Support 04/2017 color matrix and transfer values
http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=c98d02bebd6dd04b61306ee27712aeff96f19f29
---

encoder/set.c | 4 ++--
x264.c | 6 ++++--
x264.h | 6 +++---
3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/encoder/set.c b/encoder/set.c
index 07cb4c44..79014e68 100644
--- a/encoder/set.c
+++ b/encoder/set.c
@@ -197,8 +197,8 @@ void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param )
sps->vui.b_color_description_present = 0;

sps->vui.i_colorprim = ( param->vui.i_colorprim >= 0 && param->vui.i_colorprim <= 12 ? param->vui.i_colorprim : 2 );
- sps->vui.i_transfer = ( param->vui.i_transfer >= 0 && param->vui.i_transfer <= 17 ? param->vui.i_transfer : 2 );
- sps->vui.i_colmatrix = ( param->vui.i_colmatrix >= 0 && param->vui.i_colmatrix <= 11 ? param->vui.i_colmatrix :
+ sps->vui.i_transfer = ( param->vui.i_transfer >= 0 && param->vui.i_transfer <= 18 ? param->vui.i_transfer : 2 );
+ sps->vui.i_colmatrix = ( param->vui.i_colmatrix >= 0 && param->vui.i_colmatrix <= 14 ? param->vui.i_colmatrix :
( csp >= X264_CSP_BGR ? 0 : 2 ) );
if( sps->vui.i_colorprim != 2 ||
sps->vui.i_transfer != 2 ||
diff --git a/x264.c b/x264.c
index a48c17e5..b9669ddc 100644
--- a/x264.c
+++ b/x264.c
@@ -857,12 +857,14 @@ static void help( x264_param_t *defaults, int longhelp )
" - undef, bt709, bt470m, bt470bg, smpte170m,\n"
" smpte240m, linear, log100, log316,\n"
" iec61966-2-4, bt1361e, iec61966-2-1,\n"
- " bt2020-10, bt2020-12, smpte2084, smpte428\n",
+ " bt2020-10, bt2020-12, smpte2084, smpte428,\n"
+ " arib-std-b67\n",
strtable_lookup( x264_transfer_names, defaults->vui.i_transfer ) );
H2( " --colormatrix <string> Specify color matrix setting [\"%s\"]\n"
" - undef, bt709, fcc, bt470bg, smpte170m,\n"
" smpte240m, GBR, YCgCo, bt2020nc, bt2020c,\n"
- " smpte2085\n",
+ " smpte2085, chroma-derived-nc,\n"
+ " chroma-derived-c, ICtCp\n",
strtable_lookup( x264_colmatrix_names, defaults->vui.i_colmatrix ) );
H2( " --chromaloc <integer> Specify chroma sample location (0 to 5) [%d]\n",
defaults->vui.i_chroma_loc );
diff --git a/x264.h b/x264.h
index 9f1057db..a9775400 100644
--- a/x264.h
+++ b/x264.h
@@ -45,7 +45,7 @@ extern "C" {

#include "x264_config.h"

-#define X264_BUILD 153
+#define X264_BUILD 154

/* Application developers planning to link against a shared library version of
* libx264 from a Microsoft Visual Studio or similar development environment
@@ -211,9 +211,9 @@ static const char * const x264_fullrange_names[] = { "off", "on", 0 };
static const char * const x264_colorprim_names[] = { "", "bt709", "undef", "", "bt470m", "bt470bg", "smpte170m", "smpte240m", "film", "bt2020", "smpte428",
"smpte431", "smpte432", 0 };
static const char * const x264_transfer_names[] = { "", "bt709", "undef", "", "bt470m", "bt470bg", "smpte170m", "smpte240m", "linear", "log100", "log316",
- "iec61966-2-4", "bt1361e", "iec61966-2-1", "bt2020-10", "bt2020-12", "smpte2084", "smpte428", 0 };
+ "iec61966-2-4", "bt1361e", "iec61966-2-1", "bt2020-10", "bt2020-12", "smpte2084", "smpte428", "arib-std-b67", 0 };
static const char * const x264_colmatrix_names[] = { "GBR", "bt709", "undef", "", "fcc", "bt470bg", "smpte170m", "smpte240m", "YCgCo", "bt2020nc", "bt2020c",
- "smpte2085", 0 };
+ "smpte2085", "chroma-derived-nc", "chroma-derived-c", "ICtCp", 0 };
static const char * const x264_nal_hrd_names[] = { "none", "vbr", "cbr", 0 };

/* Colorspace type */

Loading...