[x265] [PATCH] api: drop param.vui.bEnableVuiParametersPresentFlag and bEnableAspectRatioIdc
Steve Borho
steve at borho.org
Sat Apr 5 23:56:55 CEST 2014
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1396734992 18000
# Sat Apr 05 16:56:32 2014 -0500
# Node ID c1300ae4e7ba8d503f6772bfa0253da9f643658a
# Parent ac1bcf04c144fd602cdabf0499a6e47773242c37
api: drop param.vui.bEnableVuiParametersPresentFlag and bEnableAspectRatioIdc
These two params can be implied from other parameters, and having them present
only makes the VUI configuration more complicated than it needs to be.
This commit also drops the debugging --vui CLI option
diff -r ac1bcf04c144 -r c1300ae4e7ba doc/reST/cli.rst
--- a/doc/reST/cli.rst Fri Apr 04 16:34:51 2014 -0500
+++ b/doc/reST/cli.rst Sat Apr 05 16:56:32 2014 -0500
@@ -623,12 +623,6 @@
of the VUI fields (:option:`--sar`, :option:`--range`, etc) the VUI is
implicitly enabled.
-.. option:: --vui, --no-vui
-
- Enable video usability information with all fields in the SPS. This
- is a debugging feature and will likely be removed in a later
- release. Default disabled
-
.. option:: --sar <integer|w:h>
Sample Aspect Ratio, the ratio of width to height of an individual
diff -r ac1bcf04c144 -r c1300ae4e7ba source/CMakeLists.txt
--- a/source/CMakeLists.txt Fri Apr 04 16:34:51 2014 -0500
+++ b/source/CMakeLists.txt Sat Apr 05 16:56:32 2014 -0500
@@ -19,7 +19,7 @@
include(CheckCXXCompilerFlag)
# X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 14)
+set(X265_BUILD 15)
configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
"${PROJECT_BINARY_DIR}/x265.def")
configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
diff -r ac1bcf04c144 -r c1300ae4e7ba source/common/param.cpp
--- a/source/common/param.cpp Fri Apr 04 16:34:51 2014 -0500
+++ b/source/common/param.cpp Sat Apr 05 16:56:32 2014 -0500
@@ -177,8 +177,6 @@
param->bEnableSsim = 0;
/* Video Usability Information (VUI) */
- param->vui.bEnableVuiParametersPresentFlag = 0;
- param->vui.bEnableAspectRatioIdc = 0;
param->vui.aspectRatioIdc = 0;
param->vui.sarWidth = 0;
param->vui.sarHeight = 0;
@@ -582,7 +580,6 @@
bError = false;
p->interlaceMode = parseName(value, x265_interlace_names, bError);
}
- p->vui.bEnableVuiParametersPresentFlag |= !!p->interlaceMode;
}
OPT("ref") p->maxNumReferences = atoi(value);
OPT("weightp") p->bEnableWeightedPred = atobool(value);
@@ -624,23 +621,8 @@
OPT("input-csp") p->internalCsp = parseName(value, x265_source_csp_names, bError);
OPT("me") p->searchMethod = parseName(value, x265_motion_est_names, bError);
OPT("cutree") p->rc.cuTree = atobool(value);
- OPT("vui")
- {
- int bvalue = atobool(value);
-
- p->vui.bEnableVuiParametersPresentFlag = bvalue;
- p->vui.bEnableAspectRatioIdc = bvalue;
- p->vui.bEnableOverscanInfoPresentFlag = bvalue;
- p->vui.bEnableVideoSignalTypePresentFlag = bvalue;
- p->vui.bEnableColorDescriptionPresentFlag = bvalue;
- p->vui.bEnableChromaLocInfoPresentFlag = bvalue;
- p->vui.bEnableDefaultDisplayWindowFlag = bvalue;
- p->vui.bEnableVuiTimingInfoPresentFlag = bvalue;
- }
OPT("sar")
{
- p->vui.bEnableVuiParametersPresentFlag = 1;
- p->vui.bEnableAspectRatioIdc = 1;
p->vui.aspectRatioIdc = parseName(value, x265_sar_names, bError);
if (bError)
{
@@ -650,7 +632,6 @@
}
OPT("overscan")
{
- p->vui.bEnableVuiParametersPresentFlag = 1;
if (!strcmp(value, "show"))
p->vui.bEnableOverscanInfoPresentFlag = 1;
else if (!strcmp(value, "crop"))
@@ -665,47 +646,40 @@
}
OPT("videoformat")
{
- p->vui.bEnableVuiParametersPresentFlag = 1;
p->vui.bEnableVideoSignalTypePresentFlag = 1;
p->vui.videoFormat = parseName(value, x265_video_format_names, bError);
}
OPT("range")
{
- p->vui.bEnableVuiParametersPresentFlag = 1;
p->vui.bEnableVideoSignalTypePresentFlag = 1;
p->vui.bEnableVideoFullRangeFlag = parseName(value, x265_fullrange_names, bError);
}
OPT("colorprim")
{
- p->vui.bEnableVuiParametersPresentFlag = 1;
p->vui.bEnableVideoSignalTypePresentFlag = 1;
p->vui.bEnableColorDescriptionPresentFlag = 1;
p->vui.colorPrimaries = parseName(value, x265_colorprim_names, bError);
}
OPT("transfer")
{
- p->vui.bEnableVuiParametersPresentFlag = 1;
p->vui.bEnableVideoSignalTypePresentFlag = 1;
p->vui.bEnableColorDescriptionPresentFlag = 1;
p->vui.transferCharacteristics = parseName(value, x265_transfer_names, bError);
}
OPT("colormatrix")
{
- p->vui.bEnableVuiParametersPresentFlag = 1;
p->vui.bEnableVideoSignalTypePresentFlag = 1;
p->vui.bEnableColorDescriptionPresentFlag = 1;
p->vui.matrixCoeffs = parseName(value, x265_colmatrix_names, bError);
}
OPT("chromaloc")
{
- p->vui.bEnableVuiParametersPresentFlag = 1;
p->vui.bEnableChromaLocInfoPresentFlag = 1;
p->vui.chromaSampleLocTypeTopField = atoi(value);
p->vui.chromaSampleLocTypeBottomField = p->vui.chromaSampleLocTypeTopField;
}
OPT("crop-rect")
{
- p->vui.bEnableVuiParametersPresentFlag = 1;
p->vui.bEnableDefaultDisplayWindowFlag = 1;
bError |= sscanf(value, "%d,%d,%d,%d",
&p->vui.defDispWinLeftOffset,
@@ -715,7 +689,6 @@
}
OPT("timinginfo")
{
- p->vui.bEnableVuiParametersPresentFlag = 1;
p->vui.bEnableVuiTimingInfoPresentFlag = atobool(value);
}
else
@@ -805,8 +778,6 @@
void setParamAspectRatio(x265_param *p, int width, int height)
{
- p->vui.bEnableVuiParametersPresentFlag = 1;
- p->vui.bEnableAspectRatioIdc = 1;
p->vui.aspectRatioIdc = X265_EXTENDED_SAR;
p->vui.sarWidth = width;
p->vui.sarHeight = height;
@@ -822,7 +793,7 @@
void getParamAspectRatio(x265_param *p, int& width, int& height)
{
- if (!p->vui.bEnableVuiParametersPresentFlag || !p->vui.bEnableAspectRatioIdc || !p->vui.aspectRatioIdc)
+ if (!p->vui.aspectRatioIdc)
{
width = height = 0;
}
diff -r ac1bcf04c144 -r c1300ae4e7ba source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp Fri Apr 04 16:34:51 2014 -0500
+++ b/source/encoder/encoder.cpp Sat Apr 05 16:56:32 2014 -0500
@@ -1075,16 +1075,24 @@
sps->setUseStrongIntraSmoothing(param->bEnableStrongIntraSmoothing);
- sps->setVuiParametersPresentFlag(param->vui.bEnableVuiParametersPresentFlag);
+ bool bVui = param->vui.aspectRatioIdc ||
+ param->vui.bEnableVideoSignalTypePresentFlag ||
+ param->vui.bEnableOverscanInfoPresentFlag ||
+ param->vui.bEnableVuiTimingInfoPresentFlag ||
+ param->interlaceMode;
+ sps->setVuiParametersPresentFlag(bVui);
+
if (sps->getVuiParametersPresentFlag())
{
TComVUI* vui = sps->getVuiParameters();
- vui->setAspectRatioInfoPresentFlag(param->vui.bEnableAspectRatioIdc);
+ vui->setAspectRatioInfoPresentFlag(!!param->vui.aspectRatioIdc);
vui->setAspectRatioIdc(param->vui.aspectRatioIdc);
vui->setSarWidth(param->vui.sarWidth);
vui->setSarHeight(param->vui.sarHeight);
+
vui->setOverscanInfoPresentFlag(param->vui.bEnableOverscanInfoPresentFlag);
vui->setOverscanAppropriateFlag(param->vui.bEnableOverscanAppropriateFlag);
+
vui->setVideoSignalTypePresentFlag(param->vui.bEnableVideoSignalTypePresentFlag);
vui->setVideoFormat(param->vui.videoFormat);
vui->setVideoFullRangeFlag(param->vui.bEnableVideoFullRangeFlag);
@@ -1097,6 +1105,7 @@
vui->setChromaSampleLocTypeBottomField(param->vui.chromaSampleLocTypeBottomField);
vui->setNeutralChromaIndicationFlag(m_neutralChromaIndicationFlag);
vui->setDefaultDisplayWindow(m_defaultDisplayWindow);
+
vui->setFrameFieldInfoPresentFlag(!!param->interlaceMode);
vui->setFieldSeqFlag(!!param->interlaceMode);
diff -r ac1bcf04c144 -r c1300ae4e7ba source/x265.cpp
--- a/source/x265.cpp Fri Apr 04 16:34:51 2014 -0500
+++ b/source/x265.cpp Sat Apr 05 16:56:32 2014 -0500
@@ -156,8 +156,6 @@
{ "strong-intra-smoothing", no_argument, NULL, 0 },
{ "no-cutree", no_argument, NULL, 0 },
{ "cutree", no_argument, NULL, 0 },
- { "vui", no_argument, NULL, 0 },
- { "no-vui", no_argument, NULL, 0 },
{ "sar", required_argument, NULL, 0 },
{ "overscan", required_argument, NULL, 0 },
{ "videoformat", required_argument, NULL, 0 },
@@ -375,7 +373,6 @@
H0(" --sao-lcu-bounds <integer> 0: right/bottom boundary areas skipped 1: non-deblocked pixels are used. Default %d\n", param->saoLcuBoundary);
H0(" --sao-lcu-opt <integer> 0: SAO picture-based optimization, 1: SAO LCU-based optimization. Default %d\n", param->saoLcuBasedOptimization);
H0("\nVUI options:\n");
- H0(" --[no-]vui Add Video Useability Information with all fields to the SPS. Default %s\n", OPT(param->vui.bEnableVuiParametersPresentFlag));
H0(" --sar <width:height|int> Sample Aspect Ratio, the ratio of width to height of an individual pixel.\n");
H0(" Choose from 0=undef, 1=1:1(\"square\"), 2=12:11, 3=10:11, 4=16:11,\n");
H0(" 5=40:33, 6=24:11, 7=20:11, 8=32:11, 9=80:33, 10=18:11, 11=15:11,\n");
@@ -597,7 +594,7 @@
param->fpsDenom = info.fpsDenom;
param->fpsNum = info.fpsNum;
}
- if (!param->vui.bEnableAspectRatioIdc && info.sarWidth && info.sarHeight)
+ if (!param->vui.aspectRatioIdc && info.sarWidth && info.sarHeight)
setParamAspectRatio(param, info.sarWidth, info.sarHeight);
if (this->framesToBeEncoded == 0 && info.frameCount > (int)seek)
diff -r ac1bcf04c144 -r c1300ae4e7ba source/x265.h
--- a/source/x265.h Fri Apr 04 16:34:51 2014 -0500
+++ b/source/x265.h Sat Apr 05 16:56:32 2014 -0500
@@ -704,14 +704,6 @@
/*== Video Usability Information ==*/
struct
{
- /* Enable the generation of a VUI with all fields in the SPS. VUI fields
- * that are not specified on the command line will have default values */
- int bEnableVuiParametersPresentFlag;
-
- /* Enable aspect ratio in VUI. Causes the aspect_ratio_idc to be added
- * to the VUI. The default is false */
- int bEnableAspectRatioIdc;
-
/* Aspect ratio idc to be added to the VUI. The default is 0 indicating
* the apsect ratio is unspecified. If set to X265_EXTENDED_SAR then
* sarWidth and sarHeight must also be set */
More information about the x265-devel
mailing list