[x264-devel] Add new Color Primaries, Transfer Characteristics and Matrix Coefficients

Harfe Leier astrataro at gmail.com
Sat Jun 15 16:05:57 CEST 2013


Oops, seems the attachment was not converted to text.... Resend the
patch in text format:

 From 4b32fbf9a95d158d62c06fbf93a97bba56d478be Mon Sep 17 00:00:00 2001
From: Lucien <astrataro at gmail.com>
Date: Sat, 15 Jun 2013 13:42:31 +0000
Subject: [PATCH] Add new Color Primaries, Transfer Characteristics and Matrix
 Coefficients
---
 encoder/set.c | 6 +++---
 x264.h        | 7 ++++---
 2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/encoder/set.c b/encoder/set.c
index fdedf98..1f97281 100644
--- a/encoder/set.c
+++ b/encoder/set.c
@@ -208,9 +208,9 @@ void x264_sps_init( x264_sps_t *sps, int i_id,
x264_param_t *param )
                            ( csp >= X264_CSP_BGR ? 1 : 0 ) );
     sps->vui.b_color_description_present = 0;

-    sps->vui.i_colorprim = ( param->vui.i_colorprim >= 0 &&
param->vui.i_colorprim <=  8 ? param->vui.i_colorprim : 2 );
-    sps->vui.i_transfer  = ( param->vui.i_transfer  >= 0 &&
param->vui.i_transfer  <= 10 ? param->vui.i_transfer  : 2 );
-    sps->vui.i_colmatrix = ( param->vui.i_colmatrix >= 0 &&
param->vui.i_colmatrix <=  8 ? param->vui.i_colmatrix :
+    sps->vui.i_colorprim = ( param->vui.i_colorprim >= 0 &&
param->vui.i_colorprim <=  9 ? param->vui.i_colorprim : 2 );
+    sps->vui.i_transfer  = ( param->vui.i_transfer  >= 0 &&
param->vui.i_transfer  <= 15 ? param->vui.i_transfer  : 2 );
+    sps->vui.i_colmatrix = ( param->vui.i_colmatrix >= 0 &&
param->vui.i_colmatrix <= 10 ? 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.h b/x264.h
index b32db8d..7a27ba1 100644
--- a/x264.h
+++ b/x264.h
@@ -198,9 +198,10 @@ static const char * const x264_b_pyramid_names[]
= { "none", "strict", "normal",
 static const char * const x264_overscan_names[] = { "undef", "show",
"crop", 0 };
 static const char * const x264_vidformat_names[] = { "component",
"pal", "ntsc", "secam", "mac", "undef", 0 };
 static const char * const x264_fullrange_names[] = { "off", "on", 0 };
-static const char * const x264_colorprim_names[] = { "", "bt709",
"undef", "", "bt470m", "bt470bg", "smpte170m", "smpte240m", "film", 0
};
-static const char * const x264_transfer_names[] = { "", "bt709",
"undef", "", "bt470m", "bt470bg", "smpte170m", "smpte240m", "linear",
"log100", "log316", 0 };
-static const char * const x264_colmatrix_names[] = { "GBR", "bt709",
"undef", "", "fcc", "bt470bg", "smpte170m", "smpte240m", "YCgCo", 0 };
+static const char * const x264_colorprim_names[] = { "", "bt709",
"undef", "", "bt470m", "bt470bg", "smpte170m", "smpte240m", "film",
"bt2020", 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", 0 };
+static const char * const x264_colmatrix_names[] = { "GBR", "bt709",
"undef", "", "fcc", "bt470bg", "smpte170m", "smpte240m", "YCgCo",
"bt2020nc", "bt2020c", 0 };
 static const char * const x264_nal_hrd_names[] = { "none", "vbr", "cbr", 0 };

 /* Colorspace type */
--
1.8.1.msysgit.1

On 15 June 2013 13:58, Harfe Leier <astrataro at gmail.com> wrote:
> According to http://www.itu.int/rec/T-REC-H.264-201304-I/


More information about the x264-devel mailing list