History

cosmetics: Remove unnecessary {} around if/for blocks; move statements after if/for to the next line.

Originally committed as revision 19378 to svn://svn.ffmpeg.org/ffmpeg/trunk

Diego Biurrun committed 17 years ago

Commit c8f47d81 parent 99d61d34 files · +36 −51Browse files

Showing the changes to libavcodec/aaccoder.c (1 of 4 files). Show all

Unified · Split

libavcodec/aaccoder.c+17−22
@@ -84,9 +84,8 @@ static void abs_pow34_v(float *out, const float *in, const int size) · 83 unmodified lines
8484 {
8585 #ifndef USE_REALLY_FULL_SEARCH
8686 int i;
87− for (i = 0; i < size; i++) {
87+ for (i = 0; i < size; i++)
8888 out[i] = pow(fabsf(in[i]), 0.75);
89− }
9089 #endif /* USE_REALLY_FULL_SEARCH */
9190 }
9291
@@ -141,9 +140,8 @@ static float quantize_band_cost(struct AACEncContext *s, const float *in, · 48 unmodified lines
141140 #ifndef USE_REALLY_FULL_SEARCH
142141 int (*quants)[2] = &s->qcoefs[i];
143142 mincost = 0.0f;
144− for (j = 0; j < dim; j++) {
143+ for (j = 0; j < dim; j++)
145144 mincost += in[i+j]*in[i+j]*lambda;
146− }
147145 minidx = IS_CODEBOOK_UNSIGNED(cb) ? 0 : 40;
148146 minbits = ff_aac_spectral_bits[cb-1][minidx];
149147 mincost += minbits;
@@ -256,9 +254,8 @@ static void quantize_and_encode_band(struct AACEncContext *s, PutBitContext *pb, · 106 unmodified lines
256254 #ifndef USE_REALLY_FULL_SEARCH
257255 int (*quants)[2] = &s->qcoefs[i];
258256 mincost = 0.0f;
259− for (j = 0; j < dim; j++) {
257+ for (j = 0; j < dim; j++)
260258 mincost += in[i+j]*in[i+j]*lambda;
261− }
262259 minidx = IS_CODEBOOK_UNSIGNED(cb) ? 0 : 40;
263260 minbits = ff_aac_spectral_bits[cb-1][minidx];
264261 mincost += minbits;
@@ -429,10 +426,9 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce · 164 unmodified lines
429426 //convert resulting path from backward-linked list
430427 stack_len = 0;
431428 idx = 0;
432− for (cb = 1; cb < 12; cb++) {
429+ for (cb = 1; cb < 12; cb++)
433430 if (path[max_sfb][cb].cost < path[max_sfb][idx].cost)
434431 idx = cb;
435− }
436432 ppos = max_sfb;
437433 while (ppos > 0) {
438434 cb = idx;
@@ -523,7 +519,8 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s, · 84 unmodified lines
523519 nz = 1;
524520 for (i = 0; i < sce->ics.swb_sizes[g]; i++) {
525521 float t = fabsf(coefs[w2*128+i]);
526− if (t > 0.0f) qmin = fminf(qmin, t);
522+ if (t > 0.0f)
523+ qmin = fminf(qmin, t);
527524 qmax = fmaxf(qmax, t);
528525 }
529526 }
@@ -540,10 +537,9 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s, · 10 unmodified lines
540537 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
541538 FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
542539 int cb;
543− for (cb = 0; cb <= ESC_BT; cb++) {
540+ for (cb = 0; cb <= ESC_BT; cb++)
544541 dists[cb] += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g],
545542 q, cb, lambda / band->threshold, INFINITY, NULL);
546− }
547543 }
548544 dist = dists[0];
549545 for (i = 1; i <= ESC_BT; i++)
@@ -725,22 +721,19 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx, · 175 unmodified lines
725721 }
726722 }
727723 if (tbits > destbits) {
728− for (i = 0; i < 128; i++) {
729− if (sce->sf_idx[i] < 218 - qstep) {
724+ for (i = 0; i < 128; i++)
725+ if (sce->sf_idx[i] < 218 - qstep)
730726 sce->sf_idx[i] += qstep;
731− }
732− }
733727 } else {
734− for (i = 0; i < 128; i++) {
735− if (sce->sf_idx[i] > 60 - qstep) {
728+ for (i = 0; i < 128; i++)
729+ if (sce->sf_idx[i] > 60 - qstep)
736730 sce->sf_idx[i] -= qstep;
737− }
738− }
739731 }
740732 qstep >>= 1;
741733 if (!qstep && tbits > destbits*1.02)
742734 qstep = 1;
743− if (sce->sf_idx[0] >= 217)break;
735+ if (sce->sf_idx[0] >= 217)
736+ break;
744737 } while (qstep);
745738
746739 fflag = 0;
@@ -916,7 +909,8 @@ static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s, · 169 unmodified lines
916909 else
917910 minq = FFMIN(minq, sce->sf_idx[i]);
918911 }
919− if (minq == INT_MAX) minq = 0;
912+ if (minq == INT_MAX)
913+ minq = 0;
920914 minq = FFMIN(minq, SCALE_MAX_POS);
921915 maxsf = FFMIN(minq + SCALE_MAX_DIFF, SCALE_MAX_POS);
922916 for (i = 126; i >= 0; i--) {
@@ -951,7 +945,8 @@ static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s, · 28 unmodified lines
951945 }
952946 }
953947 for (i = 0; i < 128; i++) {
954− sce->sf_idx[i] = 140;//av_clip(sce->sf_idx[i], minq, minq + SCALE_MAX_DIFF - 1);
948+ sce->sf_idx[i] = 140;
949+ //av_clip(sce->sf_idx[i], minq, minq + SCALE_MAX_DIFF - 1);
955950 }
956951 //set the same quantizers inside window groups
957952 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t