⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sp54convert.diff

📁 Simple SunPlus SP54 codec converter and a more playable mode MJPG. untar the archive go to the r
💻 DIFF
字号:
diff -urN SP54convert/avilib.c SP54convert.new/avilib.c--- SP54convert/avilib.c	2001-02-23 13:22:37.000000000 +0100+++ SP54convert.new/avilib.c	2003-06-20 07:21:00.000000000 +0200@@ -31,6 +31,10 @@ #include <errno.h> #include "avilib.h" +#ifndef O_BINARY+#define O_BINARY 0+#endif+ /* The following variable indicates the kind of error */  long AVI_errno = 0;@@ -177,7 +181,7 @@       we do not truncate the file when we open it.       Instead it is truncated when the AVI file is closed */ -   AVI->fdes = open(filename,O_RDWR|O_CREAT,0600);+   AVI->fdes = open(filename,O_RDWR|O_CREAT|O_BINARY,0600);    if (AVI->fdes < 0)    {       AVI_errno = AVI_ERR_OPEN;@@ -467,7 +471,11 @@     if ( lseek(AVI->fdes,0,SEEK_SET)<0 ||         write(AVI->fdes,AVI_header,HEADERBYTES)!=HEADERBYTES ||+#ifdef __MINGW_H+        chsize(AVI->fdes,AVI->pos)<0 )+#else         ftruncate(AVI->fdes,AVI->pos)<0 )+#endif    {       AVI_errno = AVI_ERR_CLOSE;       return -1;@@ -628,7 +636,7 @@     /* Open the file */ -   AVI->fdes = open(filename,O_RDONLY);+   AVI->fdes = open(filename,O_RDONLY|O_BINARY);    if(AVI->fdes < 0)    {       AVI_errno = AVI_ERR_OPEN;diff -urN SP54convert/makefile.win32 SP54convert.new/makefile.win32--- SP54convert/makefile.win32	1970-01-01 01:00:00.000000000 +0100+++ SP54convert.new/makefile.win32	2003-06-20 07:02:02.000000000 +0200@@ -0,0 +1,20 @@+# Simple Win32 makefile for sp54convert+# 20/06/2003+# version 0.0.1++CC=i386-mingw32-gcc+RM=rm -f++all: sp54convert.exe+	+sp54convert.exe: sp54convert.o avilib.o+	$(CC) -o sp54convert.exe sp54convert.o avilib.o++avilib.o: avilib.c+	$(CC) -c avilib.c++sp54convert.o: sp54convert.c+	$(CC) -c sp54convert.c++clean:+	$(RM) sp54convert.o avilib.o sp54convert.exediff -urN SP54convert/sp54convert.c SP54convert.new/sp54convert.c--- SP54convert/sp54convert.c	2003-05-28 17:24:51.000000000 +0200+++ SP54convert.new/sp54convert.c	2003-06-20 06:44:27.000000000 +0200@@ -27,6 +27,7 @@ #include <stdlib.h> #include <string.h> #include <errno.h>+#include <stdint.h>  #include "avilib.h" #include "spca50x-jpeg-header.h"@@ -41,14 +42,14 @@ }  static void-create_jpeg_from_data (u_int8_t * dst, u_int8_t * src, int qIndex, int w,-		       int h, u_int8_t format, int o_size, int *size,+create_jpeg_from_data (uint8_t * dst, uint8_t * src, int qIndex, int w,+		       int h, uint8_t format, int o_size, int *size, 		       int omit_huffman_table, int omit_escape) {  	int i = 0;-	u_int8_t *start;-	u_int8_t value;+	uint8_t *start;+	uint8_t value;  	start = dst; 	/* copy the header from the template */diff -urN SP54convert/spca50x-jpeg-header.h SP54convert.new/spca50x-jpeg-header.h--- SP54convert/spca50x-jpeg-header.h	2003-05-25 16:10:44.000000000 +0200+++ SP54convert.new/spca50x-jpeg-header.h	2003-06-20 06:43:44.000000000 +0200@@ -11,7 +11,7 @@ #define SPCA50X_JPG_DEFAULT_HEADER_PART3_LENGTH 33 #define SPCA50X_JPG_DEFAULT_HEADER_LENGTH 589 -u_int8_t SPCA50xJPGDefaultHeaderPart1[SPCA50X_JPG_DEFAULT_HEADER_PART1_LENGTH] = {   +uint8_t SPCA50xJPGDefaultHeaderPart1[SPCA50X_JPG_DEFAULT_HEADER_PART1_LENGTH] = {    	//SOI(Start of Image) 	0xFF,0xD8, 	//DQT(Define Quantization Table)@@ -28,7 +28,7 @@ 	0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, 	0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22 };-u_int8_t SPCA50xJPGDefaultHeaderPart2[SPCA50X_JPG_DEFAULT_HEADER_PART2_LENGTH] = {   +uint8_t SPCA50xJPGDefaultHeaderPart2[SPCA50X_JPG_DEFAULT_HEADER_PART2_LENGTH] = {    	//DHT(Define Huffman Table) 	0xFF,0xC4, 	0x01,0xA2,@@ -63,7 +63,7 @@  *  5 - 6 : Image Height(H Byte,L Byte)  *  7 - 8 : Image Width(H Byte,L Byte)  */-u_int8_t SPCA50xJPGDefaultHeaderPart3[SPCA50X_JPG_DEFAULT_HEADER_PART3_LENGTH] = {+uint8_t SPCA50xJPGDefaultHeaderPart3[SPCA50X_JPG_DEFAULT_HEADER_PART3_LENGTH] = { 	//SOFn(Start of Frame) 	0xFF,0xC0, 	0x00,0x11,@@ -75,13 +75,13 @@ };  #define SPCA50X_AVI_FRAME_HEADER_LENGTH	8-u_int8_t SPCA50xAviFrameHeader[SPCA50X_AVI_FRAME_HEADER_LENGTH] = {+uint8_t SPCA50xAviFrameHeader[SPCA50X_AVI_FRAME_HEADER_LENGTH] = { 	0x30, 0x30, 0x64, 0x63, // 00dc 	0x00, 0x00, 0x00, 0x00 // size of frame };  -u_int8_t SPCA50xQTable[20][64]=+uint8_t SPCA50xQTable[20][64]= { 	// index 0, Q50 	{  16, 11, 12, 14, 12, 10, 16, 14, 13, 14, 18, 17, 16, 19, 24, 40,@@ -184,7 +184,7 @@ 	  124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124 } }; -u_int8_t SPCA50xOriginal_QTable_4NF_M[18][64]=		//not Z-Z+uint8_t SPCA50xOriginal_QTable_4NF_M[18][64]=		//not Z-Z { 	// index 0, Q50 	{  16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -