Skip to content

Commit

Permalink
.clang-format: update to clang-format-11
Browse files Browse the repository at this point in the history
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
  • Loading branch information
clang-format authored and jzern committed Aug 23, 2022
1 parent a689fe6 commit a3c9b91
Show file tree
Hide file tree
Showing 18 changed files with 129 additions and 270 deletions.
142 changes: 1 addition & 141 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -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
...

4 changes: 3 additions & 1 deletion examples/vp9_spatial_svc_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions vp8/common/mips/dspr2/filter_dspr2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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;
}
Expand Down
18 changes: 10 additions & 8 deletions vp8/common/mips/msa/vp8_macros_msa.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@
const uint8_t *psrc_m = (const uint8_t *)(psrc); \
uint32_t val_m; \
\
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)); \
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)); \
\
val_m; \
})
Expand All @@ -136,10 +137,11 @@
const uint8_t *psrc_m = (const uint8_t *)(psrc); \
uint64_t val_m = 0; \
\
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)); \
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)); \
\
val_m; \
})
Expand Down
10 changes: 4 additions & 6 deletions vp8/encoder/encodemv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down
31 changes: 14 additions & 17 deletions vp8/encoder/firstpass.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -947,11 +947,10 @@ 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 > 10.0)
? 10.0
: cpi->twopass.est_max_qcorrection_factor;
(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;
}

/* Corrections for higher compression speed settings
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1968,11 +1966,10 @@ 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 > cpi->twopass.kf_group_bits)
? cpi->twopass.kf_group_bits
: cpi->twopass.gf_group_bits;
(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;

/* Clip cpi->twopass.gf_group_bits based on user supplied data rate
* variability limit (cpi->oxcf.two_pass_vbrmax_section)
Expand Down
29 changes: 15 additions & 14 deletions vp8/encoder/mcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,21 @@ void vp8_init3smotion_compensation(MACROBLOCK *x, int stride) {
/* returns distortion + motion vector cost */
#define ERR(r, c) (MVC(r, c) + DIST(r, c))
/* checks if (r,c) has better score than previous best */
#define CHECK_BETTER(v, r, c) \
do { \
IFMVCV(r, c, \
{ \
thismse = DIST(r, c); \
if ((v = (MVC(r, c) + thismse)) < besterr) { \
besterr = v; \
br = r; \
bc = c; \
*distortion = thismse; \
*sse1 = sse; \
} \
}, \
v = UINT_MAX;) \
#define CHECK_BETTER(v, r, c) \
do { \
IFMVCV( \
r, c, \
{ \
thismse = DIST(r, c); \
if ((v = (MVC(r, c) + thismse)) < besterr) { \
besterr = v; \
br = r; \
bc = c; \
*distortion = thismse; \
*sse1 = sse; \
} \
}, \
v = UINT_MAX;) \
} while (0)

int vp8_find_best_sub_pixel_step_iteratively(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
Expand Down
9 changes: 4 additions & 5 deletions vp8/encoder/onyx_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -4202,11 +4202,10 @@ 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 =
(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;
} else {
Expand Down
2 changes: 1 addition & 1 deletion vp8/encoder/rdopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ static int evaluate_inter_mode_rd(int mdcounts[4], RATE_DISTORTION *rd,
unsigned int q2dc = xd->block[24].dequant[0];
/* If theres is no codeable 2nd order dc
or a very small uniform pixel change change */
if ((sse - var<q2dc * q2dc>> 4) || (sse / 2 > var && sse - var < 64)) {
if ((sse - var < q2dc * q2dc >> 4) || (sse / 2 > var && sse - var < 64)) {
/* Check u and v to make sure skip is ok */
unsigned int sse2 = VP8_UVSSE(x);
if (sse2 * 2 < threshold) {
Expand Down
4 changes: 3 additions & 1 deletion vp9/decoder/vp9_decodemv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading

0 comments on commit a3c9b91

Please sign in to comment.