[MN-dev] [mndiff]: r49 - in trunk/2010: 2010.cc 2_crypt.cc 2_grafix.cc 2_hw.cc 2_hw_mem.cc 2_hw_mem.h 2_nag.cc makefile
michael
subversion at mplayerhq.hu
Wed Jul 4 09:06:09 CEST 2007
Author: michael
Date: Wed Jul 4 09:06:09 2007
New Revision: 49
Log:
next version (unknown date)
Modified:
trunk/2010/2010.cc
trunk/2010/2_crypt.cc
trunk/2010/2_grafix.cc
trunk/2010/2_hw.cc
trunk/2010/2_hw_mem.cc
trunk/2010/2_hw_mem.h
trunk/2010/2_nag.cc
trunk/2010/makefile
Modified: trunk/2010/2010.cc
==============================================================================
--- trunk/2010/2010.cc (original)
+++ trunk/2010/2010.cc Wed Jul 4 09:06:09 2007
@@ -423,7 +423,7 @@ int main(int argc, char **argv){
case '5' : TVStd= PAL;
cryptStd= nag;
if(yuvmode==0) yuvmode=1;
- if(oneField && yuvmode==2) error(MemAlloc);
+ //if(oneField && yuvmode==2) error(MemAlloc);
vSmoothState=false;
setStdScale();
contGrab();
Modified: trunk/2010/2_crypt.cc
==============================================================================
--- trunk/2010/2_crypt.cc (original)
+++ trunk/2010/2_crypt.cc Wed Jul 4 09:06:09 2007
@@ -43,7 +43,6 @@ static void decomb(void){
int linep, llinep, line, i;
int j, k;
int temp[max_x];
- int amp[max_x];
const int outy1= outy>>1;
const int stride=oneField ? (vgax<<1) : (vgax<<2);
@@ -56,38 +55,12 @@ static void decomb(void){
for(i=0; i<wndx; i++){
temp[i]=0;
- amp[i]=0;
- }
-
- linep= startp;
- if(o) linep+=vgax<<1;
- for(line=0; line<segSize; line++){
- for(i=0; i<wndx; i+=2){
- j = char(actVid2MemBufp->b[linep + (i<<1) ]);
- j= (j + j) - temp[i];
- temp[i] = j;
- if(line & 1) amp[i]-=j;
- else amp[i]+=j;
- }
- linep+=stride;
- }
-
- for(i=0; i<wndx; i++){
- temp[i]= amp[i]/segSize;
}
linep= startp;
if(o) linep+=vgax<<1;
for(line=0; line<segSize; line++){
for(i=0; i<wndx; i++){
-/*
- j = char(actVid2MemBufp->b[linep + (i<<1)]);
- j=(j + j) - temp[i];
- temp[i] = j;
- if (j> 127) j= 127;
- else if(j<-128) j=-128;
- actVid2MemBufp->b[linep + (i<<1)] = (char)(j);
- */
j = char(actVid2MemBufp->b[linep + (i<<1)]);
j=(j + j) - temp[i];
@@ -96,10 +69,6 @@ static void decomb(void){
else if(j<-128) j=-128;
temp[i] = j;
actVid2MemBufp->b[linep + (i<<1)] = (char)(j);
-
-
-
-
}
linep+=stride;
}
@@ -146,22 +115,9 @@ static void decomb(void){
}
static void vSmooth(void){
-/*
- for(int x=0; x < wndx; x++){
- ((s_rgb*)actVid2MemBufp.b)[x + y*vgax].r=( (((s_rgb*)actVid2MemBufp.b)[x + y *vgax].r >> 1)
- + (((s_rgb*)actVid2MemBufp.b)[x + (y+1)*vgax].r )
- + (((s_rgb*)actVid2MemBufp.b)[x + (y+2)*vgax].r >> 1) ) >> 1;
- ((s_rgb*)actVid2MemBufp.b)[x + y*vgax].g=( (((s_rgb*)actVid2MemBufp.b)[x + y *vgax].g >> 1)
- + (((s_rgb*)actVid2MemBufp.b)[x + (y+1)*vgax].g )
- + (((s_rgb*)actVid2MemBufp.b)[x + (y+2)*vgax].g >> 1) ) >> 1;
- ((s_rgb*)actVid2MemBufp.b)[x + y*vgax].b=( (((s_rgb*)actVid2MemBufp.b)[x + y *vgax].b >> 1)
- + (((s_rgb*)actVid2MemBufp.b)[x + (y+1)*vgax].b )
- + (((s_rgb*)actVid2MemBufp.b)[x + (y+2)*vgax].b >> 1) ) >> 1;
- }
- */
-/*
+
if(yuvmode==0){
- asm(//"int $3 \n\t"
+ /* asm(//"int $3 \n\t"
"1: \n\t"
"movl (%%esi ), %%eax \n\t" //U LINE
"movl (%%esi,%%edi,2), %%ebx \n\t" // V 1 LINE + 2
@@ -183,7 +139,7 @@ static void vSmooth(void){
: "D" (vgax<<2), "S" (actVid2MemBufp->b),
"c" (vgax * (wndy-2) )
: "%eax", "%ebx", "%ecx", "%esi");
-
+ */
}
else{
asm(//"int $3 \n\t"
@@ -219,5 +175,5 @@ static void vSmooth(void){
}
- */
+
}
Modified: trunk/2010/2_grafix.cc
==============================================================================
--- trunk/2010/2_grafix.cc (original)
+++ trunk/2010/2_grafix.cc Wed Jul 4 09:06:09 2007
@@ -21,6 +21,7 @@
extern int bright, contr, satur;
extern MENULEVEL menuLevel;
extern int infoPosY;
+ extern VID2MEMBUF *vid2MemBuf;
bool helpState=true;
bool iState=false;
@@ -71,10 +72,14 @@ void showStuff(void){
long T1=uclock();
if(iState){
- sprintf(textbuf,"%2.2f Fps",1/((float)(T1-T2)/UCLOCKS_PER_SEC));
c.init(255, 0, 0, yuvmode);
+
+ sprintf(textbuf,"%2.2f Fps",1/((float)(T1-T2)/UCLOCKS_PER_SEC));
gprint(10, infoPosY+=10, c.col, textbuf);
+ sprintf(textbuf,"%d Buffers", vid2MemBuf[0].num);
+ gprint(150, infoPosY , c.col, textbuf);
+
sprintf(textbuf,"%d Corrupted Fields", corr_errors);
gprint(10, infoPosY+=10, c.col, textbuf);
Modified: trunk/2010/2_hw.cc
==============================================================================
--- trunk/2010/2_hw.cc (original)
+++ trunk/2010/2_hw.cc Wed Jul 4 09:06:09 2007
@@ -38,7 +38,6 @@
extern bool strangeRgb16;
int g_mode=0;
- int m_mode=0;
extern u_short my_cs, my_ds;
asm("__esp: .long 0\n\t");
@@ -174,153 +173,6 @@ void mem2vid(byte *to, byte *from, int n
: "b" (yuv2RgbLut), "S" (from), "D" (to), "c" (num<<1)
: "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi");
-
-
-/*
- num>>=1;
- if(bpp==32){
- U Y1 V Y2
-
- esi from
- ebp to
- edi lut
- ecx counter
- eax (Y1 Y1 Y1 Y1 + LUT[ U ] + LUT[ V ]) | (Y2 Y2 Y2 Y2 + LUT[ U ] + LUT[ V ])
- ebx Y1 Y1 Y1 Y1 + LUT[ U ] + LUT[ V ]
- edx Y2 Y2 Y2 Y2 + LUT[ U ] + LUT[ V ]
- esp
- asm(//"int $3 \n\t"
- "pushl %%ebp \n\t"
- "movl %%eax, %%ebp \n\t"
- "movl %%esp, (__esp) \n\t"
-
- "1: \n\t"
- "nop \n\t" // U
- "movl (%%esi), %%eax \n\t" // V 1
- "movl %%eax, %%ebx \n\t" // U
- "movl %%eax, %%edx \n\t" // V 1
- "shrl $16, %%ebx \n\t" // U
- "andl $0x000000FF, %%eax \n\t" // V 1
- "andl $0x000000FF, %%ebx \n\t" // U
- "andl $0xFE00FE00, %%edx \n\t" // V 1
- "shrl $1, %%edx \n\t" // U
- "movl (%%edi, %%eax, 4), %%eax \n\t" // V 1
- "movl 1024(%%edi, %%ebx, 4), %%ebx \n\t" // U
- "movl %%edx, %%esp \n\t" // V 1
- "shrl $8, %%edx \n\t" // U
- "addl %%ebx, %%eax \n\t" // V 1
- "orl %%edx, %%esp \n\t" // U
- "addl $8, %%ebp \n\t" // V 1
- "movl %%esp, %%ebx \n\t" // U
- "movl %%esp, %%edx \n\t" // V 1
- "shll $16, %%ebx \n\t" // U
- "andl $0x0000FFFF, %%edx \n\t" // V 1
- "orl %%edx, %%ebx \n\t" // U
- "movl %%esp, %%edx \n\t" // V 1
- "shrl $16, %%edx \n\t" // U
- "andl $0xFFFF0000, %%esp \n\t" // V 1
- "orl %%esp, %%edx \n\t" // U
- "addl %%eax, %%ebx \n\t" // V 1
- "addl %%eax, %%edx \n\t" // U
- "movl %%ebx, %%eax \n\t" // V 1
- "orl %%edx, %%eax \n\t" // U
- "addl $4, %%esi \n\t" // V 1
- "test $0x00808080, %%eax \n\t" // U
- " jz 2f \n\t" // V 1
-
- "movl %%ebx, %%eax \n\t" // U
- "nop \n\t" // V 1
- "test $0x00800000, %%eax \n\t" // U
- " jz 10f \n\t" // V 1
- "test $0x00400000, %%eax \n\t" // U
- " jz 11f \n\t" // V 1
- "andl $0xFF00FFFF, %%ebx \n\t" // U
- "jmp 10f \n\t" // V 1
- "11: \n\t"
- "orl $0x00FF0000, %%ebx \n\t" // U
- "10: \n\t"
- "test $0x00008000, %%eax \n\t" // U
- " jz 20f \n\t" // V 1
- "test $0x00004000, %%eax \n\t" // U
- " jz 21f \n\t" // V 1
- "andl $0xFFFF00FF, %%ebx \n\t" // U
- "jmp 20f \n\t" // V 1
- "21: \n\t"
- "orl $0x0000FF00, %%ebx \n\t" // U
- "20: \n\t"
- "test $0x00000080, %%eax \n\t" // U
- " jz 30f \n\t" // V 1
- "test $0x00000040, %%eax \n\t" // U
- " jz 31f \n\t" // V 1
- "andl $0xFFFFFF00, %%ebx \n\t" // U
- "jmp 30f \n\t" // V 1
- "31: \n\t"
- "orl $0x000000FF, %%ebx \n\t" // U
- "30: \n\t"
- "movl %%edx, %%eax \n\t" // U
- "nop \n\t" // V 1
- "test $0x00800000, %%eax \n\t" // U
- " jz 40f \n\t" // V 1
- "test $0x00400000, %%eax \n\t" // U
- " jz 41f \n\t" // V 1
- "andl $0xFF00FFFF, %%edx \n\t" // U
- "jmp 40f \n\t" // V 1
- "41: \n\t"
- "orl $0x00FF0000, %%edx \n\t" // U
- "40: \n\t"
- "test $0x00008000, %%eax \n\t" // U
- " jz 50f \n\t" // V 1
- "test $0x00004000, %%eax \n\t" // U
- " jz 51f \n\t" // V 1
- "andl $0xFFFF00FF, %%edx \n\t" // U
- "jmp 50f \n\t" // V 1
- "51: \n\t"
- "orl $0x0000FF00, %%edx \n\t" // U
- "50: \n\t"
- "test $0x00000080, %%eax \n\t" // U
- " jz 60f \n\t" // V 1
- "test $0x00000040, %%eax \n\t" // U
- " jz 61f \n\t" // V 1
- "andl $0xFFFFFF00, %%edx \n\t" // U
- "jmp 60f \n\t" // V 1
- "61: \n\t"
- "orl $0x000000FF, %%edx \n\t" // U
- "60: \n\t"
-
- "andl $0xFF7F7F7F, %%ebx \n\t" // U
- "andl $0xFF7F7F7F, %%edx \n\t" // V 1
-
- "2: \n\t"
- "addl %%ebx, %%ebx \n\t" // U
- "addl %%edx, %%edx \n\t" // V 1
- "movl %%ebx, -8(%%ebp) \n\t" // U
- "movl %%edx, -4(%%ebp) \n\t" // V 1
- "decl %%ecx \n\t" // U
- " jnz 1b \n\t" // V 1
- "movl (__esp), %%esp \n\t"
- "popl %%ebp \n\t"
- :
- : "m" (vgax<<1),
- "D" (yuv2rgb_lut), "S" (from), "a" (to), "c" (num)
- : "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi");
-
-
-
-
-
- }
- else{
- for(i=0; i<num; i++){
- to[i*6 ]= (byte)( from[i].y1 + yuv2rgb_lut[(int(from[i].u)<<1) + 1 ] );
- to[i*6+1]= (byte)( from[i].y1 + yuv2rgb_lut[(int(from[i].v)<<1) + 512] + yuv2rgb_lut[int(from[i].u)<<1] );
- to[i*6+2]= (byte)( from[i].y1 + yuv2rgb_lut[(int(from[i].v)<<1) + 513] );
- to[i*6+3]= (byte)( from[i].y2 + yuv2rgb_lut[(int(from[i].u)<<1) + 1 ] );
- to[i*6+4]= (byte)( from[i].y2 + yuv2rgb_lut[(int(from[i].v)<<1) + 512] + yuv2rgb_lut[int(from[i].u)<<1] );
- to[i*6+5]= (byte)( from[i].y2 + yuv2rgb_lut[(int(from[i].v)<<1) + 513] );
- }
- }
- */
-
}else{
if(strangeRgb16){
asm("addl %%ecx, %%esi \n\t"
@@ -354,7 +206,6 @@ void mem2vid(byte *to, byte *from, int n
void close_hw(void){
__dpmi_regs r;
- __dpmi_paddr address;
close_meteor();
unlockall();
@@ -383,8 +234,6 @@ void sig_handler(int i){
void end_func(void){}
void init_hw(void){
- __dpmi_regs r;
- __dpmi_paddr address;
my_cs=_go32_my_cs();
my_ds=_go32_my_ds();
@@ -443,7 +292,6 @@ void set_start_disp(int x, int y){
}
void copy_vidbuffer(void){
- int i, j;
if(page_flip==0){
int p=0;
Modified: trunk/2010/2_hw_mem.cc
==============================================================================
--- trunk/2010/2_hw_mem.cc (original)
+++ trunk/2010/2_hw_mem.cc Wed Jul 4 09:06:09 2007
@@ -18,6 +18,24 @@
extern volatile VdsList *vdslist;
extern volatile MapList *maplist;
+bool checkAlign(void *p, int align){
+ if(int(p) & (align-1)) return false;
+ else return true;
+}
+
+void *newAlign(int size, int align){
+ int v= int(new char[size + align + 3]);
+ printf("anew %d\n", v);
+ int v2= ( (v+align-1+4) & ~(align-1) );
+ ((int*)v2)[-1]= v;
+ return (void*)v2;
+}
+
+void deleteAlign(void *v){
+ printf("adel %d\n", int(((char**)v)[-1]) );
+ delete [] ((char**)v)[-1];
+}
+
void locklin(void *start, void *end){
volatile LockList *llp, *llp2;
__dpmi_meminfo meminfo;
Modified: trunk/2010/2_hw_mem.h
==============================================================================
--- trunk/2010/2_hw_mem.h (original)
+++ trunk/2010/2_hw_mem.h Wed Jul 4 09:06:09 2007
@@ -35,6 +35,9 @@ struct AllocList{
volatile AllocList *next;
};
+bool checkAlign(void *p, int align);
+void *newAlign(int size, int align);
+void deleteAlign(void *v);
void locklin(void *, void *);
void unlocklin(void *, void *);
void lock(void *, void *);
Modified: trunk/2010/2_nag.cc
==============================================================================
--- trunk/2010/2_nag.cc (original)
+++ trunk/2010/2_nag.cc Wed Jul 4 09:06:09 2007
@@ -12,6 +12,7 @@
#include "2_gfunc.h"
#include "2_mmx.h"
#include "2_nag_a.h"
+#include "2_hw_mem.h"
#include "2010.h"
#define dwnSmp 1
@@ -41,25 +42,6 @@ static int nagSize1;
static int nagSize2;
static int nagSizeAll;
-bool checkAlign(void *p, int align){ // FIX SHOULD BE SOMEWHERE ELSE
- if(int(p) & (align-1)) return false;
- else return true;
-}
-
-
-void *newAlign(int size, int align){ // FIX SHOULD BE SOMEWHERE ELSE
- int v= int(new char[size + align + 3]);
- printf("anew %d\n", v);
- int v2= ( (v+align-1+4) & ~(align-1) );
- ((int*)v2)[-1]= v;
- return (void*)v2;
-}
-
-void deleteAlign(void *v){ // FIX SHOULD BE SOMEWHERE ELSE
- printf("adel %d\n", int(((char**)v)[-1]) );
- delete [] ((char**)v)[-1];
-}
-
static inline void getPerm(const int key, int * const perm){
int keyNdx= (key >> 7) & 0xFF;
const int keyInc= ((key & 0x7F) << 1) + 1;
@@ -564,7 +546,8 @@ void nag_decrypt(void){
else vPhase=0;
- byte *lowDriftLinep= NULL;
+ byte *lowDriftLinep= actVid2MemBufp->b; // initalize in case nothing found else PF
+ int firstI=0;
for(int i=0; i<NAG_LINES; i++){
if(perm[i]>=32 && mabs(perm[i]-32 - i)<5){
const cleMod4= (i + vPhase ) & 3;
@@ -575,6 +558,7 @@ void nag_decrypt(void){
if(cleMod4!=encMod4) mod4Fix(lowDriftLinep, type);
+ firstI= i;
break;
}
}
@@ -582,7 +566,8 @@ void nag_decrypt(void){
for(int clearLine=0 ;clearLine<NAG_LINES; clearLine++){
byte * const linep= actVid2MemBufp->b + nagLineLogi2Phys( perm[clearLine] ) * (vgax<<1);
- if(perm[clearLine]>=32 && mabs(perm[clearLine]-32 - clearLine)<5){
+ if(perm[clearLine]>=32 && mabs(perm[clearLine]-32 - clearLine)<5
+ && firstI!=clearLine){
const cleMod4= (clearLine + vPhase ) & 3;
const encMod4= (perm[clearLine] + vPhase ) & 3;
const type= cleMod4 ^ encMod4;
@@ -624,7 +609,7 @@ void nag_decrypt(void){
actVid2MemBufp->b[p3*(vgax<<1)+i*20+101+j]=255;
}
}
-*/
+ */
delete [] bestCoeffs;
int enc2cleVec[max_x];
Modified: trunk/2010/makefile
==============================================================================
--- trunk/2010/makefile (original)
+++ trunk/2010/makefile Wed Jul 4 09:06:09 2007
@@ -31,7 +31,7 @@ clean: ; del $(O) 2010
2_crypt.o : 2_crypt.cc 2_all.h 2_crypt.h 2_71x6.h 2_vc.h 2_nag.h
2_vc.o : 2_vc.cc 2_all.h 2_vc.h 2_crypt.h 2_gfunc.h 2_vc_a.h
2_nag.o : 2_nag.cc 2_all.h 2_nag.h 2_crypt.h 2_gfunc.h 2_mmx.h 2_nag_a.h\
- 2010.h
+ 2010.h 2_hw_mem.h
2_hw_asm.o : 2_hw_asm.s
More information about the Mndiff-dev
mailing list