Commit e63f25b4 authored by Loren Merritt's avatar Loren Merritt

--sps-id, to allow concatenating streams with different settings.



git-svn-id: svn://svn.videolan.org/x264/trunk@518 df754926-b1dd-0310-bc7b-ec298dee348c
parent 609deaf5
......@@ -434,6 +434,8 @@ static int x264_validate_parameters( x264_t *h )
if( h->param.rc.f_complexity_blur < 0 )
h->param.rc.f_complexity_blur = 0;
h->param.i_sps_id &= 31;
/* ensure the booleans are 0 or 1 so they can be used in math */
#define BOOLIFY(x) h->param.x = !!h->param.x
BOOLIFY( b_cabac );
......@@ -530,10 +532,10 @@ x264_t *x264_encoder_open ( x264_param_t *param )
h->i_idr_pic_id = 0;
h->sps = &h->sps_array[0];
x264_sps_init( h->sps, 0, &h->param );
x264_sps_init( h->sps, h->param.i_sps_id, &h->param );
h->pps = &h->pps_array[0];
x264_pps_init( h->pps, 0, &h->param, h->sps);
x264_pps_init( h->pps, h->param.i_sps_id, &h->param, h->sps);
x264_validate_levels( h );
......
......@@ -275,6 +275,7 @@ static void Help( x264_param_t *defaults )
" -v, --verbose Print stats for each frame\n"
" --progress Show a progress indicator while encoding\n"
" --visualize Show MB types overlayed on the encoded video\n"
" --sps-id <integer> Set SPS and PPS id numbers [%d]\n"
" --aud Use access unit delimiters\n"
"\n",
X264_BUILD, X264_VERSION,
......@@ -324,7 +325,8 @@ static void Help( x264_param_t *defaults )
strtable_lookup( colorprim_str, defaults->vui.i_colorprim ),
strtable_lookup( transfer_str, defaults->vui.i_transfer ),
strtable_lookup( colmatrix_str, defaults->vui.i_colmatrix ),
defaults->vui.i_chroma_loc
defaults->vui.i_chroma_loc,
defaults->i_sps_id
);
}
......@@ -449,6 +451,7 @@ static int Parse( int argc, char **argv,
#define OPT_NR 319
#define OPT_THREAD_INPUT 320
#define OPT_NO_DCT_DECIMATE 321
#define OPT_SPS_ID 322
static struct option long_options[] =
{
......@@ -512,6 +515,7 @@ static int Parse( int argc, char **argv,
{ "verbose", no_argument, NULL, 'v' },
{ "progress",no_argument, NULL, OPT_PROGRESS },
{ "visualize",no_argument, NULL, OPT_VISUALIZE },
{ "sps-id", required_argument, NULL, OPT_SPS_ID },
{ "aud", no_argument, NULL, OPT_AUD },
{ "nr", required_argument, NULL, OPT_NR },
{ "cqm", required_argument, NULL, OPT_CQM },
......@@ -808,6 +812,9 @@ static int Parse( int argc, char **argv,
case 'v':
param->i_log_level = X264_LOG_DEBUG;
break;
case OPT_SPS_ID:
param->i_sps_id = atoi(optarg);
break;
case OPT_AUD:
param->b_aud = 1;
break;
......
......@@ -35,7 +35,7 @@
#include <stdarg.h>
#define X264_BUILD 46
#define X264_BUILD 47
/* x264_t:
* opaque handler for decoder and encoder */
......@@ -243,8 +243,10 @@ typedef struct
char *psz_zones; /* alternate method of specifying zones */
} rc;
/* Muxing parameters */
int b_aud; /* generate access unit delimiters */
int b_repeat_headers; /* put SPS/PPS before each keyframe */
int i_sps_id; /* SPS and PPS id number */
} x264_param_t;
typedef struct {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment