.clang-format: update to clang-format-11

only store the deltas from --style Google in the file and reapply using
Debian clang-format version 11.1.0-6+build1

Bug: b/229626362
Change-Id: I3e18a2e7c17a90a48405b3cf1b37ebc652aba0db
This commit is contained in:
clang-format
2022-08-13 10:33:56 -07:00
committed by James Zern
parent a689fe68a3
commit a3c9b9126d
18 changed files with 129 additions and 270 deletions

View File

@@ -1,149 +1,9 @@
---
Language: Cpp
# BasedOnStyle: Google
# Generated with clang-format 7.0.1
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
BasedOnStyle: Google
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakTemplateDeclaration: 10
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Right
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
CanonicalDelimiter: ''
BasedOnStyle: google
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 8
UseTab: Never
...

View File

@@ -1146,7 +1146,9 @@ int main(int argc, const char **argv) {
cx_pkt->data.twopass_stats.sz);
break;
}
default: { break; }
default: {
break;
}
}
#if CONFIG_VP9_DECODER && !SIMULCAST_MODE

View File

@@ -816,8 +816,8 @@ void vp8_filter_block2d_first_pass16_0(unsigned char *RESTRICT src_ptr,
: [Temp1] "=&r"(Temp1), [Temp2] "=&r"(Temp2), [Temp3] "=&r"(Temp3),
[Temp4] "=&r"(Temp4), [src_ptr] "+r"(src_ptr)
: [src_pixels_per_line] "r"(src_pixels_per_line),
[output_ptr] "r"(output_ptr));
: [src_pixels_per_line] "r"(src_pixels_per_line), [output_ptr] "r"(
output_ptr));
__asm__ __volatile__(
"ulw %[Temp1], 0(%[src_ptr]) \n\t"
@@ -832,8 +832,8 @@ void vp8_filter_block2d_first_pass16_0(unsigned char *RESTRICT src_ptr,
: [Temp1] "=&r"(Temp1), [Temp2] "=&r"(Temp2), [Temp3] "=&r"(Temp3),
[Temp4] "=&r"(Temp4), [src_ptr] "+r"(src_ptr)
: [src_pixels_per_line] "r"(src_pixels_per_line),
[output_ptr] "r"(output_ptr));
: [src_pixels_per_line] "r"(src_pixels_per_line), [output_ptr] "r"(
output_ptr));
__asm__ __volatile__(
"ulw %[Temp1], 0(%[src_ptr]) \n\t"
@@ -848,8 +848,8 @@ void vp8_filter_block2d_first_pass16_0(unsigned char *RESTRICT src_ptr,
: [Temp1] "=&r"(Temp1), [Temp2] "=&r"(Temp2), [Temp3] "=&r"(Temp3),
[Temp4] "=&r"(Temp4), [src_ptr] "+r"(src_ptr)
: [src_pixels_per_line] "r"(src_pixels_per_line),
[output_ptr] "r"(output_ptr));
: [src_pixels_per_line] "r"(src_pixels_per_line), [output_ptr] "r"(
output_ptr));
output_ptr += 48;
}

View File

@@ -122,7 +122,8 @@
const uint8_t *psrc_m = (const uint8_t *)(psrc); \
uint32_t val_m; \
\
asm volatile("lwr %[val_m], 0(%[psrc_m]) \n\t" \
asm volatile( \
"lwr %[val_m], 0(%[psrc_m]) \n\t" \
"lwl %[val_m], 3(%[psrc_m]) \n\t" \
: [val_m] "=&r"(val_m) \
: [psrc_m] "r"(psrc_m)); \
@@ -136,7 +137,8 @@
const uint8_t *psrc_m = (const uint8_t *)(psrc); \
uint64_t val_m = 0; \
\
asm volatile("ldr %[val_m], 0(%[psrc_m]) \n\t" \
asm volatile( \
"ldr %[val_m], 0(%[psrc_m]) \n\t" \
"ldl %[val_m], 7(%[psrc_m]) \n\t" \
: [val_m] "=&r"(val_m) \
: [psrc_m] "r"(psrc_m)); \

View File

@@ -31,17 +31,15 @@ static void encode_mvcomponent(vp8_writer *const w, const int v,
vp8_write(w, 1, p[mvpis_short]);
do
do {
vp8_write(w, (x >> i) & 1, p[MVPbits + i]);
while (++i < 3);
} while (++i < 3);
i = mvlong_width - 1; /* Skip bit 3, which is sometimes implicit */
do
do {
vp8_write(w, (x >> i) & 1, p[MVPbits + i]);
while (--i > 3);
} while (--i > 3);
if (x & 0xFFF0) vp8_write(w, (x >> 3) & 1, p[MVPbits + 3]);
}

View File

@@ -903,9 +903,9 @@ static double calc_correction_factor(double err_per_mb, double err_devisor,
correction_factor = pow(error_term, power_term);
/* Clip range */
correction_factor = (correction_factor < 0.05)
? 0.05
: (correction_factor > 5.0) ? 5.0 : correction_factor;
correction_factor = (correction_factor < 0.05) ? 0.05
: (correction_factor > 5.0) ? 5.0
: correction_factor;
return correction_factor;
}
@@ -947,8 +947,7 @@ static int estimate_max_q(VP8_COMP *cpi, FIRSTPASS_STATS *fpstats,
}
cpi->twopass.est_max_qcorrection_factor =
(cpi->twopass.est_max_qcorrection_factor < 0.1)
? 0.1
(cpi->twopass.est_max_qcorrection_factor < 0.1) ? 0.1
: (cpi->twopass.est_max_qcorrection_factor > 10.0)
? 10.0
: cpi->twopass.est_max_qcorrection_factor;
@@ -1178,10 +1177,9 @@ static int estimate_kf_group_q(VP8_COMP *cpi, double section_err,
} else {
current_spend_ratio = (double)cpi->long_rolling_actual_bits /
(double)cpi->long_rolling_target_bits;
current_spend_ratio =
(current_spend_ratio > 10.0)
? 10.0
: (current_spend_ratio < 0.1) ? 0.1 : current_spend_ratio;
current_spend_ratio = (current_spend_ratio > 10.0) ? 10.0
: (current_spend_ratio < 0.1) ? 0.1
: current_spend_ratio;
}
/* Calculate a correction factor based on the quality of prediction in
@@ -1968,8 +1966,7 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) {
}
cpi->twopass.gf_group_bits =
(cpi->twopass.gf_group_bits < 0)
? 0
(cpi->twopass.gf_group_bits < 0) ? 0
: (cpi->twopass.gf_group_bits > cpi->twopass.kf_group_bits)
? cpi->twopass.kf_group_bits
: cpi->twopass.gf_group_bits;

View File

@@ -206,7 +206,8 @@ void vp8_init3smotion_compensation(MACROBLOCK *x, int stride) {
/* checks if (r,c) has better score than previous best */
#define CHECK_BETTER(v, r, c) \
do { \
IFMVCV(r, c, \
IFMVCV( \
r, c, \
{ \
thismse = DIST(r, c); \
if ((v = (MVC(r, c) + thismse)) < besterr) { \

View File

@@ -4202,10 +4202,9 @@ static void encode_frame_to_data_rate(VP8_COMP *cpi, size_t *size,
}
/* Clamp cpi->zbin_over_quant */
cpi->mb.zbin_over_quant = (cpi->mb.zbin_over_quant < zbin_oq_low)
? zbin_oq_low
: (cpi->mb.zbin_over_quant > zbin_oq_high)
? zbin_oq_high
cpi->mb.zbin_over_quant =
(cpi->mb.zbin_over_quant < zbin_oq_low) ? zbin_oq_low
: (cpi->mb.zbin_over_quant > zbin_oq_high) ? zbin_oq_high
: cpi->mb.zbin_over_quant;
Loop = Q != last_q;

View File

@@ -426,7 +426,9 @@ static INLINE int assign_mv(VP9_COMMON *cm, MACROBLOCKD *xd,
zero_mv_pair(mv);
break;
}
default: { return 0; }
default: {
return 0;
}
}
return ret;
}

View File

@@ -133,15 +133,16 @@ static int decode_coefs(const MACROBLOCKD *xd, PLANE_TYPE type,
int16_t dqv = dq[0];
const uint8_t *const cat6_prob =
#if CONFIG_VP9_HIGHBITDEPTH
(xd->bd == VPX_BITS_12)
? vp9_cat6_prob_high12
: (xd->bd == VPX_BITS_10) ? vp9_cat6_prob_high12 + 2 :
(xd->bd == VPX_BITS_12) ? vp9_cat6_prob_high12
: (xd->bd == VPX_BITS_10) ? vp9_cat6_prob_high12 + 2
:
#endif // CONFIG_VP9_HIGHBITDEPTH
vp9_cat6_prob;
const int cat6_bits =
#if CONFIG_VP9_HIGHBITDEPTH
(xd->bd == VPX_BITS_12) ? 18
: (xd->bd == VPX_BITS_10) ? 16 :
: (xd->bd == VPX_BITS_10) ? 16
:
#endif // CONFIG_VP9_HIGHBITDEPTH
14;
// Keep value, range, and count as locals. The compiler produces better

View File

@@ -134,9 +134,9 @@ static void pack_mb_tokens(vpx_writer *w, TOKENEXTRA **tp,
const TOKENEXTRA *p;
const vp9_extra_bit *const extra_bits =
#if CONFIG_VP9_HIGHBITDEPTH
(bit_depth == VPX_BITS_12)
? vp9_extra_bits_high12
: (bit_depth == VPX_BITS_10) ? vp9_extra_bits_high10 : vp9_extra_bits;
(bit_depth == VPX_BITS_12) ? vp9_extra_bits_high12
: (bit_depth == VPX_BITS_10) ? vp9_extra_bits_high10
: vp9_extra_bits;
#else
vp9_extra_bits;
(void)bit_depth;

View File

@@ -764,8 +764,9 @@ int64_t vp9_scale_acskip_thresh(int64_t threshold,
VP9_DENOISER_LEVEL noise_level, int abs_sumdiff,
int temporal_layer_id) {
if (noise_level >= kDenLow && abs_sumdiff < 5)
return threshold *=
(noise_level == kDenLow) ? 2 : (temporal_layer_id == 2) ? 10 : 6;
return threshold *= (noise_level == kDenLow) ? 2
: (temporal_layer_id == 2) ? 10
: 6;
else
return threshold;
}

View File

@@ -2113,8 +2113,7 @@ static int64_t calculate_total_gf_group_bits(VP9_COMP *cpi,
}
// Clamp odd edge cases.
total_group_bits = (total_group_bits < 0)
? 0
total_group_bits = (total_group_bits < 0) ? 0
: (total_group_bits > twopass->kf_group_bits)
? twopass->kf_group_bits
: total_group_bits;

View File

@@ -777,16 +777,16 @@ void vp9_temporal_filter_iterate_row_c(VP9_COMP *cpi, ThreadData *td,
// Assign higher weight to matching MB if it's error
// score is lower. If not applying MC default behavior
// is to weight all MBs equal.
blk_fw[0] = err < (thresh_low << THR_SHIFT)
? 2
: err < (thresh_high << THR_SHIFT) ? 1 : 0;
blk_fw[0] = err < (thresh_low << THR_SHIFT) ? 2
: err < (thresh_high << THR_SHIFT) ? 1
: 0;
blk_fw[1] = blk_fw[2] = blk_fw[3] = blk_fw[0];
} else {
use_32x32 = 0;
for (k = 0; k < 4; k++)
blk_fw[k] = blk_bestsme[k] < thresh_low
? 2
: blk_bestsme[k] < thresh_high ? 1 : 0;
blk_fw[k] = blk_bestsme[k] < thresh_low ? 2
: blk_bestsme[k] < thresh_high ? 1
: 0;
}
for (k = 0; k < 4; k++) {

View File

@@ -88,7 +88,8 @@
const uint8_t *psrc_lw_m = (const uint8_t *)(psrc); \
uint32_t val_lw_m; \
\
__asm__ __volatile__("lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \
__asm__ __volatile__( \
"lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \
"lwl %[val_lw_m], 3(%[psrc_lw_m]) \n\t" \
: [val_lw_m] "=&r"(val_lw_m) \
: [psrc_lw_m] "r"(psrc_lw_m)); \
@@ -102,7 +103,8 @@
const uint8_t *psrc_ld_m = (const uint8_t *)(psrc); \
uint64_t val_ld_m = 0; \
\
__asm__ __volatile__("ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \
__asm__ __volatile__( \
"ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \
"ldl %[val_ld_m], 7(%[psrc_ld_m]) \n\t" \
: [val_ld_m] "=&r"(val_ld_m) \
: [psrc_ld_m] "r"(psrc_ld_m)); \

View File

@@ -17,37 +17,32 @@ int y4m_write_file_header(char *buf, size_t len, int width, int height,
const char *color;
switch (bit_depth) {
case 8:
color = fmt == VPX_IMG_FMT_I444
? "C444\n"
: fmt == VPX_IMG_FMT_I422 ? "C422\n" : "C420jpeg\n";
color = fmt == VPX_IMG_FMT_I444 ? "C444\n"
: fmt == VPX_IMG_FMT_I422 ? "C422\n"
: "C420jpeg\n";
break;
case 9:
color = fmt == VPX_IMG_FMT_I44416
? "C444p9 XYSCSS=444P9\n"
color = fmt == VPX_IMG_FMT_I44416 ? "C444p9 XYSCSS=444P9\n"
: fmt == VPX_IMG_FMT_I42216 ? "C422p9 XYSCSS=422P9\n"
: "C420p9 XYSCSS=420P9\n";
break;
case 10:
color = fmt == VPX_IMG_FMT_I44416
? "C444p10 XYSCSS=444P10\n"
color = fmt == VPX_IMG_FMT_I44416 ? "C444p10 XYSCSS=444P10\n"
: fmt == VPX_IMG_FMT_I42216 ? "C422p10 XYSCSS=422P10\n"
: "C420p10 XYSCSS=420P10\n";
break;
case 12:
color = fmt == VPX_IMG_FMT_I44416
? "C444p12 XYSCSS=444P12\n"
color = fmt == VPX_IMG_FMT_I44416 ? "C444p12 XYSCSS=444P12\n"
: fmt == VPX_IMG_FMT_I42216 ? "C422p12 XYSCSS=422P12\n"
: "C420p12 XYSCSS=420P12\n";
break;
case 14:
color = fmt == VPX_IMG_FMT_I44416
? "C444p14 XYSCSS=444P14\n"
color = fmt == VPX_IMG_FMT_I44416 ? "C444p14 XYSCSS=444P14\n"
: fmt == VPX_IMG_FMT_I42216 ? "C422p14 XYSCSS=422P14\n"
: "C420p14 XYSCSS=420P14\n";
break;
case 16:
color = fmt == VPX_IMG_FMT_I44416
? "C444p16 XYSCSS=444P16\n"
color = fmt == VPX_IMG_FMT_I44416 ? "C444p16 XYSCSS=444P16\n"
: fmt == VPX_IMG_FMT_I42216 ? "C422p16 XYSCSS=422P16\n"
: "C420p16 XYSCSS=420P16\n";
break;