param->b_pic_struct = 0;
param->b_fake_interlaced = 0;
param->i_frame_packing = -1;
+ param->i_alternative_transfer = 2; /* undef */
param->b_opencl = 0;
param->i_opencl_device = 0;
param->opencl_device_id = NULL;
p->vui.i_chroma_loc = atoi(value);
b_error = ( p->vui.i_chroma_loc < 0 || p->vui.i_chroma_loc > 5 );
}
+ OPT("alternative-transfer")
+ b_error |= parse_enum( value, x264_transfer_names, &p->i_alternative_transfer );
OPT("fps")
{
if( sscanf( value, "%u/%u", &p->i_fps_num, &p->i_fps_den ) != 2 )
SEI_RECOVERY_POINT = 6,
SEI_DEC_REF_PIC_MARKING = 7,
SEI_FRAME_PACKING = 45,
+ SEI_ALTERNATIVE_TRANSFER = 147,
};
#define X264_BFRAME_MAX 16
overhead += h->out.nal[h->out.i_nal-1].i_payload + SEI_OVERHEAD;
}
+ if( h->param.i_alternative_transfer != 2 )
+ {
+ nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
+ x264_sei_alternative_transfer_write( h, &h->out.bs );
+ if( nal_end( h ) )
+ return -1;
+ overhead += h->out.nal[h->out.i_nal-1].i_payload + SEI_OVERHEAD;
+ }
+
/* generate sei pic timing */
if( h->sps->vui.b_pic_struct_present || h->sps->vui.b_nal_hrd_parameters_present )
{
x264_sei_write( s, tmp_buf, bs_pos( &q ) / 8, SEI_FRAME_PACKING );
}
+void x264_sei_alternative_transfer_write( x264_t *h, bs_t *s )
+{
+ bs_t q;
+ ALIGNED_4( uint8_t tmp_buf[100] );
+ M32( tmp_buf ) = 0; // shut up gcc
+ bs_init( &q, tmp_buf, 100 );
+
+ bs_realign( &q );
+
+ bs_write ( &q, 8, h->param.i_alternative_transfer ); // preferred_transfer_characteristics
+
+ bs_align_10( &q );
+ bs_flush( &q );
+
+ x264_sei_write( s, tmp_buf, bs_pos( &q ) / 8, SEI_ALTERNATIVE_TRANSFER );
+}
+
void x264_filler_write( x264_t *h, bs_t *s, int filler )
{
bs_realign( s );
void x264_sei_dec_ref_pic_marking_write( x264_t *h, bs_t *s );
#define x264_sei_frame_packing_write x264_template(sei_frame_packing_write)
void x264_sei_frame_packing_write( x264_t *h, bs_t *s );
+#define x264_sei_alternative_transfer_write x264_template(sei_alternative_transfer_write)
+void x264_sei_alternative_transfer_write( x264_t *h, bs_t *s );
#define x264_sei_avcintra_umid_write x264_template(sei_avcintra_umid_write)
int x264_sei_avcintra_umid_write( x264_t *h, bs_t *s );
#define x264_sei_avcintra_vanc_write x264_template(sei_avcintra_vanc_write)
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 );
-
+ H2( " --alternative-transfer <string> Specify an alternative transfer\n"
+ " characteristics [\"%s\"]\n"
+ " - same values as --transfer\n",
+ strtable_lookup( x264_transfer_names, defaults->i_alternative_transfer ) );
H2( " --nal-hrd <string> Signal HRD information (requires vbv-bufsize)\n"
" - none, vbr, cbr (cbr not allowed in .mp4)\n" );
H2( " --filler Force hard-CBR and generate filler (implied by\n"
{ "pulldown", required_argument, NULL, OPT_PULLDOWN },
{ "fake-interlaced", no_argument, NULL, 0 },
{ "frame-packing", required_argument, NULL, 0 },
+ { "alternative-transfer", required_argument, NULL, 0 },
{ "vf", required_argument, NULL, OPT_VIDEO_FILTER },
{ "video-filter", required_argument, NULL, OPT_VIDEO_FILTER },
{ "input-fmt", required_argument, NULL, OPT_INPUT_FMT },
#include "x264_config.h"
-#define X264_BUILD 154
+#define X264_BUILD 155
/* Application developers planning to link against a shared library version of
* libx264 from a Microsoft Visual Studio or similar development environment
/* frame packing arrangement flag */
int i_frame_packing;
+ /* alternative transfer SEI */
+ int i_alternative_transfer;
+
/* Muxing parameters */
int b_aud; /* generate access unit delimiters */
int b_repeat_headers; /* put SPS/PPS before each keyframe */