[Scummvm-cvs-logs] scummvm master -> 30498bfbf025919e512985b84e347e3974b5ab2c

sev- sev at scummvm.org
Sun Jul 31 08:29:11 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
30498bfbf0 AUDIO: Fix indentation


Commit: 30498bfbf025919e512985b84e347e3974b5ab2c
    https://github.com/scummvm/scummvm/commit/30498bfbf025919e512985b84e347e3974b5ab2c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-07-31T09:28:46+03:00

Commit Message:
AUDIO: Fix indentation

Changed paths:
    audio/decoders/qdm2.cpp



diff --git a/audio/decoders/qdm2.cpp b/audio/decoders/qdm2.cpp
index 97d73b3..4e24e7f 100644
--- a/audio/decoders/qdm2.cpp
+++ b/audio/decoders/qdm2.cpp
@@ -1498,7 +1498,7 @@ void QDM2Stream::fill_coding_method_array(sb_int8_array tone_level_idx, sb_int8_
 		return;
 	if (!superblocktype_2_3) {
 		warning("QDM2 This case is untested, no samples available");
-		for (ch = 0; ch < nb_channels; ch++)
+		for (ch = 0; ch < nb_channels; ch++) {
 			for (sb = 0; sb < 30; sb++) {
 				for (j = 1; j < 63; j++) {  // The loop only iterates to 63 so the code doesn't overflow the buffer
 					add1 = tone_level_idx[ch][sb][j] - 10;
@@ -1527,67 +1527,73 @@ void QDM2Stream::fill_coding_method_array(sb_int8_array tone_level_idx, sb_int8_
 				}
 				tone_level_idx_temp[ch][sb][0] = tone_level_idx_temp[ch][sb][1];
 			}
-			acc = 0;
-			for (ch = 0; ch < nb_channels; ch++)
-				for (sb = 0; sb < 30; sb++)
-					for (j = 0; j < 64; j++)
-						acc += tone_level_idx_temp[ch][sb][j];
-
-			multres = 0x66666667 * (acc * 10);
-			esp_40 = (multres >> 32) / 8 + ((multres & 0xffffffff) >> 31);
-			for (ch = 0;  ch < nb_channels; ch++)
-				for (sb = 0; sb < 30; sb++)
-					for (j = 0; j < 64; j++) {
-						comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10;
-						if (comp < 0)
-							comp += 0xff;
-						comp /= 256; // signed shift
-						switch(sb) {
-							case 0:
-								if (comp < 30)
-									comp = 30;
-								comp += 15;
-								break;
-							case 1:
-								if (comp < 24)
-									comp = 24;
-								comp += 10;
-								break;
-							case 2:
-							case 3:
-							case 4:
-								if (comp < 16)
-									comp = 16;
-						}
-						if (comp <= 5)
-							tmp = 0;
-						else if (comp <= 10)
-							tmp = 10;
-						else if (comp <= 16)
-							tmp = 16;
-						else if (comp <= 24)
-							tmp = -1;
-						else
-							tmp = 0;
-						coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )& 0xff;
-					}
+		}
+		acc = 0;
+		for (ch = 0; ch < nb_channels; ch++)
 			for (sb = 0; sb < 30; sb++)
-				fix_coding_method_array(sb, nb_channels, coding_method);
-			for (ch = 0; ch < nb_channels; ch++)
-				for (sb = 0; sb < 30; sb++)
-					for (j = 0; j < 64; j++)
-						if (sb >= 10) {
-							if (coding_method[ch][sb][j] < 10)
-								coding_method[ch][sb][j] = 10;
+				for (j = 0; j < 64; j++)
+					acc += tone_level_idx_temp[ch][sb][j];
+
+		multres = 0x66666667 * (acc * 10);
+		esp_40 = (multres >> 32) / 8 + ((multres & 0xffffffff) >> 31);
+		for (ch = 0;  ch < nb_channels; ch++) {
+			for (sb = 0; sb < 30; sb++) {
+				for (j = 0; j < 64; j++) {
+					comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10;
+					if (comp < 0)
+						comp += 0xff;
+					comp /= 256; // signed shift
+					switch(sb) {
+						case 0:
+							if (comp < 30)
+								comp = 30;
+							comp += 15;
+							break;
+						case 1:
+							if (comp < 24)
+								comp = 24;
+							comp += 10;
+							break;
+						case 2:
+						case 3:
+						case 4:
+							if (comp < 16)
+								comp = 16;
+					}
+					if (comp <= 5)
+						tmp = 0;
+					else if (comp <= 10)
+						tmp = 10;
+					else if (comp <= 16)
+						tmp = 16;
+					else if (comp <= 24)
+						tmp = -1;
+					else
+						tmp = 0;
+					coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )& 0xff;
+				}
+			}
+		}
+		for (sb = 0; sb < 30; sb++)
+			fix_coding_method_array(sb, nb_channels, coding_method);
+		for (ch = 0; ch < nb_channels; ch++) {
+			for (sb = 0; sb < 30; sb++) {
+				for (j = 0; j < 64; j++) {
+					if (sb >= 10) {
+						if (coding_method[ch][sb][j] < 10)
+							coding_method[ch][sb][j] = 10;
+					} else {
+						if (sb >= 2) {
+							if (coding_method[ch][sb][j] < 16)
+								coding_method[ch][sb][j] = 16;
 						} else {
-							if (sb >= 2) {
-								if (coding_method[ch][sb][j] < 16)
-									coding_method[ch][sb][j] = 16;
-							} else {
-								if (coding_method[ch][sb][j] < 30)
-									coding_method[ch][sb][j] = 30;
-							}
+							if (coding_method[ch][sb][j] < 30)
+								coding_method[ch][sb][j] = 30;
 						}
+					}
+				}
+			}
+		}
 	} else { // superblocktype_2_3 != 0
 		for (ch = 0; ch < nb_channels; ch++)
 			for (sb = 0; sb < 30; sb++)
@@ -1658,9 +1664,10 @@ void QDM2Stream::synthfilt_build_sb_samples(Common::BitStream *gb, int length, i
 						if ((length - gb->pos()) >= 10) {
 							if (zero_encoding) {
 								for (k = 0; k < 5; k++) {
-								if ((j + 2 * k) >= 128)
-									break;
-									samples[2 * k] = gb->getBit() ? dequant_1bit[joined_stereo][2 * gb->getBit()] : 0;
+									if ((j + 2 * k) >= 128)
+										break;
+										samples[2 * k] = gb->getBit() ? dequant_1bit[joined_stereo][2 * gb->getBit()] : 0;
+									}
 								}
 							} else {
 								n = gb->getBits(8);






More information about the Scummvm-git-logs mailing list