[XviD-devel] [PATCH] Trivial style thingies

Edouard Gomez ed.gomez at free.fr
Thu Jul 14 16:38:04 CEST 2005


During merges, i noticed some style inconsistencies for
code recently pushed to CVS.

Here is a tiny patch that should fix TabvsSpace, indentation...
The only exception is a part of the patch that clears a bit
the qpel;c file, no need to have two times the same array
declarations.

diff -ur xvidcore.cvshead/examples/xvid_encraw.c xvidcore.tlahead/examples/xvid_encraw.c
--- xvidcore.cvshead/examples/xvid_encraw.c	2005-07-11 00:15:47.000000000 +0200
+++ xvidcore.tlahead/examples/xvid_encraw.c	2005-07-14 16:10:07.000000000 +0200
@@ -240,7 +240,7 @@
 	int stats_type;
 	int stats_quant;
 	int stats_length;
-	int use_assembler = 1;  // this default changed!
+	int use_assembler = 1;
 
 	int input_num;
 	int output_num;
@@ -351,11 +351,9 @@
 			ARG_OUTPUTFILE = argv[i];
 		} else if (strcmp("-vop_debug", argv[i]) == 0) {
 			ARG_VOPDEBUG = 1;
-		} 
-		else if (strcmp("-grey", argv[i]) == 0) {
+		} else if (strcmp("-grey", argv[i]) == 0) {
 			ARG_GREYSCALE = 1;
-		} 
-		else if (strcmp("-qpel", argv[i]) == 0) {
+		} else if (strcmp("-qpel", argv[i]) == 0) {
 			ARG_QPEL = 1;
 		} else if (strcmp("-gmc", argv[i]) == 0) {
 			ARG_GMC = 1;
diff -ur xvidcore.cvshead/src/bitstream/bitstream.c xvidcore.tlahead/src/bitstream/bitstream.c
--- xvidcore.cvshead/src/bitstream/bitstream.c	2005-06-26 16:28:09.000000000 +0200
+++ xvidcore.tlahead/src/bitstream/bitstream.c	2005-06-26 16:49:02.000000000 +0200
@@ -1180,12 +1180,12 @@
 
 	WRITE_MARKER();
 
-  if (pParam->fincr>0) {
-    BitstreamPutBit(bs, 1);		/* fixed_vop_rate = 1 */
-    BitstreamPutBits(bs, pParam->fincr, MAX(log2bin(pParam->fbase-1),1));	/* fixed_vop_time_increment */
-  }else{
-    BitstreamPutBit(bs, 0);		/* fixed_vop_rate = 0 */
-  }
+    if (pParam->fincr>0) {
+		BitstreamPutBit(bs, 1);		/* fixed_vop_rate = 1 */
+		BitstreamPutBits(bs, pParam->fincr, MAX(log2bin(pParam->fbase-1),1));	/* fixed_vop_time_increment */
+    }else{
+        BitstreamPutBit(bs, 0);		/* fixed_vop_rate = 0 */
+    }
 
 	WRITE_MARKER();
 	BitstreamPutBits(bs, pParam->width, 13);	/* width */
diff -ur xvidcore.cvshead/src/dct/x86_asm/fdct_sse2_skal.asm xvidcore.tlahead/src/dct/x86_asm/fdct_sse2_skal.asm
--- xvidcore.cvshead/src/dct/x86_asm/fdct_sse2_skal.asm	2005-06-26 16:28:09.000000000 +0200
+++ xvidcore.tlahead/src/dct/x86_asm/fdct_sse2_skal.asm	2005-06-26 16:41:48.000000000 +0200
@@ -104,7 +104,7 @@
 ; Inverse DCT tables
 ;-----------------------------------------------------------------------------
 
-align 16
+ALIGN 16
 iTab1:
   dw 0x4000, 0x539f, 0x4000, 0x22a3
   dw 0x4000, 0xdd5d, 0x4000, 0xac61
@@ -145,7 +145,7 @@
   dw 0x3b21, 0x14c3, 0x979e, 0xc4df
   dw 0x14c3, 0x587e, 0x587e, 0x979e
 
-align 16
+ALIGN 16
 Walken_Idct_Rounders:
   dd  65536, 65536, 65536, 65536
   dd   3597,  3597,  3597,  3597
@@ -400,7 +400,7 @@
 ;-----------------------------------------------------------------------------
 ; IEEE1180 and Walken compatible version
 
-align 16
+ALIGN 16
 idct_sse2_skal:
 
   mov ecx, [esp+ 4]  ; Src
diff -ur xvidcore.cvshead/src/encoder.c xvidcore.tlahead/src/encoder.c
--- xvidcore.cvshead/src/encoder.c	2005-06-26 16:28:09.000000000 +0200
+++ xvidcore.tlahead/src/encoder.c	2005-06-26 16:52:59.000000000 +0200
@@ -173,7 +173,7 @@
 	pEnc->mbParam.fbase = create->fincr <= 0 ? 25 : create->fbase;
 	if (pEnc->mbParam.fincr>0)
 		simplify_time((int*)&pEnc->mbParam.fincr, (int*)&pEnc->mbParam.fbase);
-  
+
 	/* zones */
 	if(create->num_zones > 0) {
 		pEnc->num_zones = create->num_zones;
diff -ur xvidcore.cvshead/src/image/qpel.c xvidcore.tlahead/src/image/qpel.c
--- xvidcore.cvshead/src/image/qpel.c	2005-07-14 16:08:08.000000000 +0200
+++ xvidcore.tlahead/src/image/qpel.c	2005-07-14 16:19:45.000000000 +0200
@@ -408,43 +408,29 @@
  * Using Symmetries (and bswap) could reduce further
  * the memory to 7 tables (->14K). */
 #ifdef ARCH_IS_X86_64
-extern int16_t xvid_FIR_1_0_0_0[256][4];
-extern int16_t xvid_FIR_3_1_0_0[256][4];
-extern int16_t xvid_FIR_6_3_1_0[256][4];
-extern int16_t xvid_FIR_14_3_2_1[256][4];
-extern int16_t xvid_FIR_20_6_3_1[256][4];
-extern int16_t xvid_FIR_20_20_6_3[256][4];
-extern int16_t xvid_FIR_23_19_6_3[256][4];
-extern int16_t xvid_FIR_7_20_20_6[256][4];
-extern int16_t xvid_FIR_6_20_20_6[256][4];
-extern int16_t xvid_FIR_6_20_20_7[256][4];
-extern int16_t xvid_FIR_3_6_20_20[256][4];
-extern int16_t xvid_FIR_3_6_19_23[256][4];
-extern int16_t xvid_FIR_1_3_6_20[256][4];
-extern int16_t xvid_FIR_1_2_3_14[256][4];
-extern int16_t xvid_FIR_0_1_3_6[256][4];
-extern int16_t xvid_FIR_0_0_1_3[256][4];
-extern int16_t xvid_FIR_0_0_0_1[256][4];
+#define __SCOPE extern
 #else
-int16_t xvid_FIR_1_0_0_0[256][4];
-int16_t xvid_FIR_3_1_0_0[256][4];
-int16_t xvid_FIR_6_3_1_0[256][4];
-int16_t xvid_FIR_14_3_2_1[256][4];
-int16_t xvid_FIR_20_6_3_1[256][4];
-int16_t xvid_FIR_20_20_6_3[256][4];
-int16_t xvid_FIR_23_19_6_3[256][4];
-int16_t xvid_FIR_7_20_20_6[256][4];
-int16_t xvid_FIR_6_20_20_6[256][4];
-int16_t xvid_FIR_6_20_20_7[256][4];
-int16_t xvid_FIR_3_6_20_20[256][4];
-int16_t xvid_FIR_3_6_19_23[256][4];
-int16_t xvid_FIR_1_3_6_20[256][4];
-int16_t xvid_FIR_1_2_3_14[256][4];
-int16_t xvid_FIR_0_1_3_6[256][4];
-int16_t xvid_FIR_0_0_1_3[256][4];
-int16_t xvid_FIR_0_0_0_1[256][4];
+#define __SCOPE
 #endif
 
+__SCOPE int16_t xvid_FIR_1_0_0_0[256][4];
+__SCOPE int16_t xvid_FIR_3_1_0_0[256][4];
+__SCOPE int16_t xvid_FIR_6_3_1_0[256][4];
+__SCOPE int16_t xvid_FIR_14_3_2_1[256][4];
+__SCOPE int16_t xvid_FIR_20_6_3_1[256][4];
+__SCOPE int16_t xvid_FIR_20_20_6_3[256][4];
+__SCOPE int16_t xvid_FIR_23_19_6_3[256][4];
+__SCOPE int16_t xvid_FIR_7_20_20_6[256][4];
+__SCOPE int16_t xvid_FIR_6_20_20_6[256][4];
+__SCOPE int16_t xvid_FIR_6_20_20_7[256][4];
+__SCOPE int16_t xvid_FIR_3_6_20_20[256][4];
+__SCOPE int16_t xvid_FIR_3_6_19_23[256][4];
+__SCOPE int16_t xvid_FIR_1_3_6_20[256][4];
+__SCOPE int16_t xvid_FIR_1_2_3_14[256][4];
+__SCOPE int16_t xvid_FIR_0_1_3_6[256][4];
+__SCOPE int16_t xvid_FIR_0_0_1_3[256][4];
+__SCOPE int16_t xvid_FIR_0_0_0_1[256][4];
+
 static void Init_FIR_Table(int16_t Tab[][4],
                            int A, int B, int C, int D)
 {
diff -ur xvidcore.cvshead/src/utils/mem_transfer.c xvidcore.tlahead/src/utils/mem_transfer.c
--- xvidcore.cvshead/src/utils/mem_transfer.c	2005-06-26 16:28:09.000000000 +0200
+++ xvidcore.tlahead/src/utils/mem_transfer.c	2005-06-26 16:57:43.000000000 +0200
@@ -70,7 +70,7 @@
 	for (j = 0; j < 8; j++) {
 		for (i = 0; i < 8; i++) {
 			dst[j * 8 + i] = (int16_t) src[j * stride + i];
-    }
+		}
 	}
 }
 
diff -ur xvidcore.cvshead/vfw/src/config.c xvidcore.tlahead/vfw/src/config.c
--- xvidcore.cvshead/vfw/src/config.c	2005-07-14 16:08:08.000000000 +0200
+++ xvidcore.tlahead/vfw/src/config.c	2005-07-14 16:24:13.000000000 +0200
@@ -866,7 +866,7 @@
 		EnableDlgWindow(hDlg, IDC_MAXBFRAMES_S,	 bvops);
 		EnableDlgWindow(hDlg, IDC_BQUANTRATIO_S,	bvops);
 		EnableDlgWindow(hDlg, IDC_BQUANTOFFSET_S,   bvops);
-    EnableDlgWindow(hDlg, IDC_PACKED,		   bvops && !(profiles[profile].flags & PROFILE_DXN));
+		EnableDlgWindow(hDlg, IDC_PACKED,		   bvops && !(profiles[profile].flags & PROFILE_DXN));
 		break;
 
 	case IDD_AR:

-- 
Edouard Gomez


More information about the XviD-devel mailing list