Skip to content

Commit 9e69854

Browse files
authored
Merge pull request #35 from mpeg5/revert-34-xeve_vui_support
Revert "Xeve vui support"
2 parents f00184f + 02a3f75 commit 9e69854

File tree

4 files changed

+12
-197
lines changed

4 files changed

+12
-197
lines changed

app/xeve_app.c

+1-93
Original file line numberDiff line numberDiff line change
@@ -633,90 +633,6 @@ static int update_rc_param(ARGS_PARSER * args, XEVE_PARAM * param)
633633
return 0;
634634
}
635635

636-
static int vui_param_check(XEVE_PARAM * param)
637-
{
638-
int ret = 0;
639-
if (param->sar < 0 || (param->sar > 16 && param->sar != 255))
640-
{
641-
ret = 1;
642-
logerr("SAR value is out of range\n");
643-
644-
}
645-
else if (param->sar == 0)
646-
{
647-
param->aspect_ratio_info_present_flag = 0;
648-
}
649-
else
650-
{
651-
param->aspect_ratio_info_present_flag = 1;
652-
}
653-
if (param->sar == 255)
654-
{
655-
if (param->sar_height == 0 && param->sar_width == 0)
656-
{
657-
ret = 1;
658-
logerr("SAR width/height must be set with SAR value 255\n");
659-
660-
}
661-
}
662-
if (param->videoformat < 0 || param->videoformat > 5)
663-
{
664-
ret = 1;
665-
logerr("Video-format value is out of range \n");
666-
667-
}
668-
else if (param->videoformat == 5)
669-
{
670-
param->video_signal_type_present_flag = 0;
671-
}
672-
else
673-
{
674-
param->video_signal_type_present_flag = 1;
675-
}
676-
if (param->range < 0 || param->range >1)
677-
{
678-
ret = 1;
679-
logerr("Black level value is out of range\n");
680-
681-
}
682-
else if (param->range == 0)
683-
{
684-
param->video_signal_type_present_flag = param->video_signal_type_present_flag || 0;
685-
}
686-
else
687-
{
688-
param->video_signal_type_present_flag = 1;
689-
}
690-
if(param->colorprim <0 || (param->colorprim >12 && param->colorprim!=22))
691-
{
692-
ret = 1;
693-
logerr("Colorprimaries value is out of range\n");
694-
}
695-
else if (param->colorprim == 2)
696-
{
697-
param->colour_description_present_flag = 0;
698-
}
699-
else
700-
{
701-
param->colour_description_present_flag = 1;
702-
}
703-
if (param->transfer < 0 || param->transfer > 13)
704-
{
705-
ret = 1;
706-
logerr("Transfer Characteristics value is out of range\n");
707-
}
708-
else if (param->transfer == 2)
709-
{
710-
param->colour_description_present_flag = param->colour_description_present_flag || 0;
711-
}
712-
else
713-
{
714-
param->colour_description_present_flag = 1;
715-
}
716-
717-
return ret;
718-
}
719-
720636
int main(int argc, const char **argv)
721637
{
722638
STATES state = STATE_ENCODING;
@@ -817,14 +733,6 @@ int main(int argc, const char **argv)
817733
ret = -1; goto ERR;
818734
}
819735

820-
/* VUI parameter Range Checking*/
821-
822-
if (vui_param_check(param))
823-
{
824-
logerr("VUI Parameter out of range\n");
825-
ret = -1; goto ERR;
826-
}
827-
828736
/* y4m header parsing */
829737
is_y4m = y4m_test(fp_inp);
830738
if (is_y4m)
@@ -851,7 +759,7 @@ int main(int argc, const char **argv)
851759
(csp == 3 ? XEVE_CF_YCBCR444 : XEVE_CF_UNKNOWN))));
852760
if (color_format == XEVE_CF_UNKNOWN)
853761
{
854-
logerr("Unknown color format\n");
762+
logerr("Unknow color format\n");
855763
ret = -1; goto ERR;
856764
}
857765
}

app/xeve_app_args.h

-73
Original file line numberDiff line numberDiff line change
@@ -512,44 +512,6 @@ static const ARGS_OPT args_opt_table[] = \
512512
ARGS_NO_KEY, "ref", ARGS_VAL_TYPE_INTEGER, 0, NULL,
513513
"Number of reference pictures"
514514
},
515-
{
516-
ARGS_NO_KEY, "sar", ARGS_VAL_TYPE_INTEGER, 0, NULL,
517-
"sar <width:height|int> possible values 1 to 16 and 255"
518-
},
519-
{
520-
ARGS_NO_KEY, "sar-width", ARGS_VAL_TYPE_INTEGER, 0, NULL,
521-
"sar <width:height|int>"
522-
},
523-
{
524-
ARGS_NO_KEY, "sar-height", ARGS_VAL_TYPE_INTEGER, 0, NULL,
525-
"sar <width:height|int>"
526-
},
527-
{
528-
ARGS_NO_KEY, "videoformat", ARGS_VAL_TYPE_INTEGER, 0, NULL,
529-
" 0-component, 1-pal, 2-ntsc, 3-secam, 4-mac. 5-unspecified default 5"
530-
},
531-
{
532-
ARGS_NO_KEY, "range", ARGS_VAL_TYPE_INTEGER, 0, NULL,
533-
"black level and range of luma and chroma signals as 1- full or 0- limited Default 0-limited"
534-
},
535-
{
536-
ARGS_NO_KEY, "colorprim", ARGS_VAL_TYPE_INTEGER, 0, NULL,
537-
"1- bt709, 2-unspecified, 3- reserved, 4- bt470m, 5- bt470bg, 6- smpte170m,\
538-
7- smpte240m, 8- Generic film, 9- bt2020, 10-smpte428, 11-smpte431, 12-smpte432, 22-EBU Tech. 3213 Default 2-unspecified"
539-
},
540-
{
541-
ARGS_NO_KEY, "transfer", ARGS_VAL_TYPE_INTEGER, 0, NULL,
542-
"1- transfer characteristics from bt709, 2-unspecified, 3-reserved, 4-bt470m, 5-bt470bg, 6-smpte170m,\
543-
7-smpte240m, 8-linear, 9-log100, 10-log316, 11-iec61966-2-4, 12-bt1361e, 13-iec61966-2-1,\
544-
14-bt2020-10, 15-bt2020-12, 16-smpte2084, 17-smpte428, 198-arib-std-b67. Default 2-unspecified"
545-
},
546-
{
547-
ARGS_NO_KEY, "master-display", ARGS_VAL_TYPE_INTEGER, 0, NULL,
548-
"SMPTE ST 2086 master display color volume info SEI (HDR)\
549-
format: G(x,y)B(x,y)R(x,y)WP(x,y)L(max,min)"
550-
},
551-
552-
553515
{ARGS_END_KEY, "", ARGS_VAL_TYPE_NONE, 0, NULL, ""} /* termination */
554516
};
555517

@@ -586,15 +548,6 @@ struct _ARGS_PARSER
586548
char tune[32];
587549
char bitrate[64];
588550
char vbv_bufsize[64];
589-
590-
/* VUI options*/
591-
int sar;
592-
int sar_width, sar_height;
593-
int videoformat;
594-
int range;
595-
int colorprim;
596-
int transfer;
597-
int master_display;
598551
};
599552

600553
static int args_search_long_key(ARGS_OPT * opts, const char * key)
@@ -920,24 +873,6 @@ static int args_init(ARGS_PARSER * args, XEVE_PARAM* param)
920873
args_set_variable_by_key_long(opts, "bitrate", args->bitrate);
921874
strcpy(args->vbv_bufsize, ""); /* default */
922875
args_set_variable_by_key_long(opts, "vbv-bufsize", args->vbv_bufsize);
923-
args->sar = 0;
924-
args_set_variable_by_key_long(opts, "sar", &args->sar);
925-
args->sar_width = 0;
926-
args_set_variable_by_key_long(opts, "sar-width", &args->sar_width);
927-
args->sar_height = 0;
928-
args_set_variable_by_key_long(opts, "sar-height", &args->sar_height);
929-
args->videoformat = 2; /* default */
930-
args_set_variable_by_key_long(opts, "videoformat", args->videoformat);
931-
args->range = 0; /* default */
932-
args_set_variable_by_key_long(opts, "range", args->range);
933-
args->colorprim = 2; /* default */
934-
args_set_variable_by_key_long(opts, "colorprim", args->colorprim);
935-
args->transfer = 2; /* default */
936-
args_set_variable_by_key_long(opts, "transfer", args->transfer);
937-
args->master_display = 2; /* default */
938-
args_set_variable_by_key_long(opts, "master-display", args->master_display);
939-
940-
941876

942877
ARGS_SET_PARAM_VAR_KEY(opts, param, w);
943878
ARGS_SET_PARAM_VAR_KEY(opts, param, h);
@@ -956,14 +891,6 @@ static int args_init(ARGS_PARSER * args, XEVE_PARAM* param)
956891
ARGS_SET_PARAM_VAR_KEY_LONG(opts, param, use_filler);
957892
ARGS_SET_PARAM_VAR_KEY_LONG(opts, param, lookahead);
958893
ARGS_SET_PARAM_VAR_KEY_LONG(opts, param, ref);
959-
ARGS_SET_PARAM_VAR_KEY_LONG(opts, param, sar);
960-
ARGS_SET_PARAM_VAR_KEY_LONG(opts, param, sar_width);
961-
ARGS_SET_PARAM_VAR_KEY_LONG(opts, param, sar_height);
962-
ARGS_SET_PARAM_VAR_KEY_LONG(opts, param, videoformat);
963-
ARGS_SET_PARAM_VAR_KEY_LONG(opts, param, range);
964-
ARGS_SET_PARAM_VAR_KEY_LONG(opts, param, colorprim);
965-
ARGS_SET_PARAM_VAR_KEY_LONG(opts, param, transfer);
966-
ARGS_SET_PARAM_VAR_KEY_LONG(opts, param, master_display);
967894

968895

969896
#if 0

inc/xeve.h

-14
Original file line numberDiff line numberDiff line change
@@ -492,20 +492,6 @@ typedef struct _XEVE_PARAM
492492
/* preset parameter */
493493
int ats_intra_fast;
494494
int me_fast;
495-
496-
/* VUI options*/
497-
int sar;
498-
int sar_width, sar_height;
499-
int videoformat;
500-
int range;
501-
int colorprim;
502-
int transfer;
503-
int master_display;
504-
505-
int aspect_ratio_info_present_flag;
506-
int video_signal_type_present_flag;
507-
int colour_description_present_flag;
508-
509495
} XEVE_PARAM;
510496

511497
/*****************************************************************************

src_base/xeve_util.c

+11-17
Original file line numberDiff line numberDiff line change
@@ -2728,23 +2728,18 @@ void xeve_set_nalu(XEVE_NALU * nalu, int nalu_type, int nuh_temporal_id)
27282728

27292729
void xeve_set_vui(XEVE_CTX * ctx, XEVE_VUI * vui)
27302730
{
2731-
vui->aspect_ratio_info_present_flag = ctx->param.aspect_ratio_info_present_flag;
2732-
vui->aspect_ratio_idc = ctx->param.sar;
2733-
2734-
if (vui->aspect_ratio_idc == EXTENDED_SAR)
2735-
{
2736-
vui->sar_width = ctx->param.sar_width;
2737-
vui->sar_height = ctx->param.sar_height;
2738-
}
2739-
2731+
vui->aspect_ratio_info_present_flag = 1;
2732+
vui->aspect_ratio_idc = 1;
2733+
vui->sar_width = 1;
2734+
vui->sar_height = 1;
27402735
vui->overscan_info_present_flag = 1;
27412736
vui->overscan_appropriate_flag = 1;
2742-
vui->video_signal_type_present_flag = ctx->param.video_signal_type_present_flag;
2743-
vui->video_format = ctx->param.videoformat;
2744-
vui->video_full_range_flag = ctx->param.range;
2745-
vui->colour_description_present_flag = ctx->param.colour_description_present_flag;
2746-
vui->colour_primaries = ctx->param.colorprim;
2747-
vui->transfer_characteristics = ctx->param.transfer;
2737+
vui->video_signal_type_present_flag = 1;
2738+
vui->video_format = 1;
2739+
vui->video_full_range_flag = 1;
2740+
vui->colour_description_present_flag = 1;
2741+
vui->colour_primaries = 1;
2742+
vui->transfer_characteristics = 1;
27482743
vui->matrix_coefficients = 1;
27492744
vui->chroma_loc_info_present_flag = 1;
27502745
vui->chroma_sample_loc_type_top_field = 1;
@@ -2808,8 +2803,7 @@ void xeve_set_sps(XEVE_CTX * ctx, XEVE_SPS * sps)
28082803
sps->log2_sub_gop_length = (int)(log2(ctx->param.gop_size) + .5);
28092804
sps->log2_ref_pic_gap_length = (int)(log2(ctx->param.ref_pic_gap_length) + .5);
28102805
sps->long_term_ref_pics_flag = 0;
2811-
sps->vui_parameters_present_flag = ctx->param.aspect_ratio_info_present_flag || ctx->param.video_signal_type_present_flag || \
2812-
ctx->param.colour_description_present_flag;
2806+
sps->vui_parameters_present_flag = 0;
28132807
xeve_set_vui(ctx, &(sps->vui_parameters));
28142808

28152809
if (ctx->chroma_qp_table_struct.chroma_qp_table_present_flag)

0 commit comments

Comments
 (0)