; Listing generated by Microsoft (R) Optimizing Compiler Version 15.00.21022.08 

	TITLE	c:\Develop\DScaler423a\DScaler\VBI_WSSdecode.cpp
	.686P
	.XMM
	include listing.inc
	.model	flat

INCLUDELIB OLDNAMES

PUBLIC	?WSS_Data@@3UTWSSDataStruct@@A			; WSS_Data
PUBLIC	?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A		; WSS_CtrlData
?WSS_Data@@3UTWSSDataStruct@@A DD 0ffffffffH		; WSS_Data
	DD	0ffffffffH
	DD	00H
	DD	00H
	DD	00H
	DD	00H
	DD	00H
	DD	00H
	DD	00H
	DD	00H
?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A DD 00H		; WSS_CtrlData
	DD	00H
	DD	00H
	DD	06H
	DD	0c8H
	DD	040H
	DD	00H
	DD	00H
	DD	0ffffffffH
	DD	0ffffffffH
	ORG $+2
_WSS625_runin DD 01H
	DD	01H
	DD	01H
	DD	01H
	DD	01H
	DD	00H
	DD	00H
	DD	00H
	DD	01H
	DD	01H
	DD	01H
	DD	00H
	DD	00H
	DD	00H
	DD	01H
	DD	01H
	DD	01H
	DD	00H
	DD	00H
	DD	00H
	DD	01H
	DD	01H
	DD	01H
	DD	00H
	DD	00H
	DD	00H
	DD	01H
	DD	01H
	DD	01H
	ORG $+2
_WSS625_start DD 00H
	DD	00H
	DD	00H
	DD	01H
	DD	01H
	DD	01H
	DD	01H
	DD	00H
	DD	00H
	DD	00H
	DD	01H
	DD	01H
	DD	01H
	DD	01H
	DD	00H
	DD	00H
	DD	00H
	DD	00H
	DD	00H
	DD	01H
	DD	01H
	DD	01H
	DD	01H
	DD	01H
_WSS625_0 DD	00H
	DD	00H
	DD	00H
	DD	01H
	DD	01H
	DD	01H
_WSS625_1 DD	01H
	DD	01H
	DD	01H
	DD	00H
	DD	00H
	DD	00H
PUBLIC	?WSS_GetRecommendedAR@@YAHPAH0@Z		; WSS_GetRecommendedAR
; Function compile flags: /Odtp
; File c:\develop\dscaler423a\dscaler\vbi_wssdecode.cpp
;	COMDAT ?WSS_GetRecommendedAR@@YAHPAH0@Z
_TEXT	SEGMENT
_pMode$ = 8						; size = 4
_pRatio$ = 12						; size = 4
?WSS_GetRecommendedAR@@YAHPAH0@Z PROC			; WSS_GetRecommendedAR, COMDAT

; 400  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp

; 401  :     if ((WSS_CtrlData.DecodeStatus == WSS_STATUS_ERROR)
; 402  :         || (WSS_Data.AspectMode == -1) )

  00003	83 3d 00 00 00
	00 00		 cmp	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A, 0
  0000a	74 09		 je	 SHORT $LN2@WSS_GetRec
  0000c	83 3d 04 00 00
	00 ff		 cmp	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+4, -1
  00013	75 06		 jne	 SHORT $LN3@WSS_GetRec
$LN2@WSS_GetRec:

; 403  :         return FALSE;

  00015	33 c0		 xor	 eax, eax
  00017	eb 1c		 jmp	 SHORT $LN4@WSS_GetRec

; 404  :     else

  00019	eb 1a		 jmp	 SHORT $LN4@WSS_GetRec
$LN3@WSS_GetRec:

; 405  :     {
; 406  :         *pMode = WSS_Data.AspectMode;

  0001b	8b 45 08	 mov	 eax, DWORD PTR _pMode$[ebp]
  0001e	8b 0d 04 00 00
	00		 mov	 ecx, DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+4
  00024	89 08		 mov	 DWORD PTR [eax], ecx

; 407  :         *pRatio = WSS_Data.AspectRatio;

  00026	8b 55 0c	 mov	 edx, DWORD PTR _pRatio$[ebp]
  00029	a1 00 00 00 00	 mov	 eax, DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A
  0002e	89 02		 mov	 DWORD PTR [edx], eax

; 408  :         return TRUE;

  00030	b8 01 00 00 00	 mov	 eax, 1
$LN4@WSS_GetRec:

; 409  :     }
; 410  : }

  00035	5d		 pop	 ebp
  00036	c3		 ret	 0
?WSS_GetRecommendedAR@@YAHPAH0@Z ENDP			; WSS_GetRecommendedAR
; Function compile flags: /Odtp
_TEXT	ENDS
;	COMDAT ?WSS525_DecodeLine@@YAHPAE@Z
_TEXT	SEGMENT
tv66 = -12						; size = 4
_packedbits$ = -8					; size = 4
_DecodeOk$ = -4						; size = 4
_vbiline$ = 8						; size = 4
?WSS525_DecodeLine@@YAHPAE@Z PROC			; WSS525_DecodeLine, COMDAT

; 320  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 0c	 sub	 esp, 12			; 0000000cH

; 321  :     BOOL    DecodeOk = FALSE;

  00006	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _DecodeOk$[ebp], 0

; 322  :     int     packedbits;
; 323  : 
; 324  :     // !!!!!!!!!!!!!!!!!!!!
; 325  :     // !!! Code missing !!!
; 326  :     // !!!!!!!!!!!!!!!!!!!!
; 327  : 
; 328  :     if (DecodeOk)

  0000d	83 7d fc 00	 cmp	 DWORD PTR _DecodeOk$[ebp], 0
  00011	74 60		 je	 SHORT $LN6@WSS525_Dec

; 329  :     {
; 330  :         packedbits = 0;

  00013	c7 45 f8 00 00
	00 00		 mov	 DWORD PTR _packedbits$[ebp], 0

; 331  :         switch (packedbits & 0x0003)

  0001a	8b 45 f8	 mov	 eax, DWORD PTR _packedbits$[ebp]
  0001d	83 e0 03	 and	 eax, 3
  00020	89 45 f4	 mov	 DWORD PTR tv66[ebp], eax
  00023	74 0e		 je	 SHORT $LN3@WSS525_Dec
  00025	83 7d f4 01	 cmp	 DWORD PTR tv66[ebp], 1
  00029	74 1e		 je	 SHORT $LN2@WSS525_Dec
  0002b	83 7d f4 02	 cmp	 DWORD PTR tv66[ebp], 2
  0002f	74 02		 je	 SHORT $LN3@WSS525_Dec
  00031	eb 2c		 jmp	 SHORT $LN1@WSS525_Dec
$LN3@WSS525_Dec:

; 332  :         {
; 333  :         case WSS525_RATIO_133:
; 334  :         case WSS525_RATIO_133_LETTERBOX:
; 335  :             WSS_Data.AspectMode = AR_NONANAMORPHIC;

  00033	c7 05 04 00 00
	00 01 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+4, 1

; 336  :             WSS_Data.AspectRatio = 1333;

  0003d	c7 05 00 00 00
	00 35 05 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A, 1333 ; 00000535H

; 337  :             break;

  00047	eb 2a		 jmp	 SHORT $LN6@WSS525_Dec
$LN2@WSS525_Dec:

; 338  :         case WSS525_RATIO_177_ANAMORPHIC:
; 339  :             WSS_Data.AspectMode = AR_ANAMORPHIC;

  00049	c7 05 04 00 00
	00 02 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+4, 2

; 340  :             WSS_Data.AspectRatio = 1778;

  00053	c7 05 00 00 00
	00 f2 06 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A, 1778 ; 000006f2H

; 341  :             break;

  0005d	eb 14		 jmp	 SHORT $LN6@WSS525_Dec
$LN1@WSS525_Dec:

; 342  :         default:
; 343  :             WSS_Data.AspectMode = -1;

  0005f	c7 05 04 00 00
	00 ff ff ff ff	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+4, -1

; 344  :             WSS_Data.AspectRatio = -1;

  00069	c7 05 00 00 00
	00 ff ff ff ff	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A, -1
$LN6@WSS525_Dec:

; 345  :             break;
; 346  :         }
; 347  :     }
; 348  : 
; 349  :     return DecodeOk;

  00073	8b 45 fc	 mov	 eax, DWORD PTR _DecodeOk$[ebp]

; 350  : }

  00076	8b e5		 mov	 esp, ebp
  00078	5d		 pop	 ebp
  00079	c3		 ret	 0
?WSS525_DecodeLine@@YAHPAE@Z ENDP			; WSS525_DecodeLine
; Function compile flags: /Odtp
_TEXT	ENDS
;	COMDAT ?WSS_clear_data@@YAXXZ
_TEXT	SEGMENT
?WSS_clear_data@@YAXXZ PROC				; WSS_clear_data, COMDAT

; 106  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp

; 107  :     WSS_Data.AspectRatio = -1;

  00003	c7 05 00 00 00
	00 ff ff ff ff	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A, -1

; 108  :     WSS_Data.AspectMode = -1;

  0000d	c7 05 04 00 00
	00 ff ff ff ff	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+4, -1

; 109  :     WSS_Data.FilmMode = FALSE;

  00017	c7 05 08 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+8, 0

; 110  :     WSS_Data.ColorPlus = FALSE;

  00021	c7 05 0c 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+12, 0

; 111  :     WSS_Data.HelperSignals = FALSE;

  0002b	c7 05 10 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+16, 0

; 112  :     WSS_Data.TeletextSubtitle = FALSE;

  00035	c7 05 14 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+20, 0

; 113  :     WSS_Data.OpenSubtitles = WSS625_SUBTITLE_NO;

  0003f	c7 05 18 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+24, 0

; 114  :     WSS_Data.SurroundSound = FALSE;

  00049	c7 05 1c 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+28, 0

; 115  :     WSS_Data.CopyrightAsserted = FALSE;

  00053	c7 05 20 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+32, 0

; 116  :     WSS_Data.CopyProtection = FALSE;

  0005d	c7 05 24 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+36, 0

; 117  : }

  00067	5d		 pop	 ebp
  00068	c3		 ret	 0
?WSS_clear_data@@YAXXZ ENDP				; WSS_clear_data
_TEXT	ENDS
PUBLIC	__real@4014000000000000
PUBLIC	?WSS_Init_Data@@YAXN@Z				; WSS_Init_Data
_BitOffsets DD	08cH DUP (?)
_BitLength DD	01H DUP (?)
;	COMDAT __real@4014000000000000
CONST	SEGMENT
__real@4014000000000000 DQ 04014000000000000r	; 5
; Function compile flags: /Odtp
CONST	ENDS
;	COMDAT ?WSS_Init_Data@@YAXN@Z
_TEXT	SEGMENT
_i$ = -4						; size = 4
_VBI_Frequency$ = 8					; size = 8
?WSS_Init_Data@@YAXN@Z PROC				; WSS_Init_Data, COMDAT

; 94   : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx

; 95   :     int i;
; 96   : 
; 97   :     BitLength = (int)(VBI_Frequency / 5.0);

  00004	dd 45 08	 fld	 QWORD PTR _VBI_Frequency$[ebp]
  00007	dc 35 00 00 00
	00		 fdiv	 QWORD PTR __real@4014000000000000
  0000d	e8 00 00 00 00	 call	 __ftol2_sse
  00012	a3 00 00 00 00	 mov	 DWORD PTR _BitLength, eax

; 98   :     for (i = 0 ; i < 140 ; i++)

  00017	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _i$[ebp], 0
  0001e	eb 09		 jmp	 SHORT $LN3@WSS_Init_D
$LN2@WSS_Init_D:
  00020	8b 45 fc	 mov	 eax, DWORD PTR _i$[ebp]
  00023	83 c0 01	 add	 eax, 1
  00026	89 45 fc	 mov	 DWORD PTR _i$[ebp], eax
$LN3@WSS_Init_D:
  00029	81 7d fc 8c 00
	00 00		 cmp	 DWORD PTR _i$[ebp], 140	; 0000008cH
  00030	7d 23		 jge	 SHORT $LN1@WSS_Init_D

; 99   :     {
; 100  :         BitOffsets[i] = (int)(VBI_Frequency / 5.0 * i + 0.5);

  00032	dd 45 08	 fld	 QWORD PTR _VBI_Frequency$[ebp]
  00035	dc 35 00 00 00
	00		 fdiv	 QWORD PTR __real@4014000000000000
  0003b	da 4d fc	 fimul	 DWORD PTR _i$[ebp]
  0003e	dc 05 00 00 00
	00		 fadd	 QWORD PTR __real@3fe0000000000000
  00044	e8 00 00 00 00	 call	 __ftol2_sse
  00049	8b 4d fc	 mov	 ecx, DWORD PTR _i$[ebp]
  0004c	89 04 8d 00 00
	00 00		 mov	 DWORD PTR _BitOffsets[ecx*4], eax
  00053	eb cb		 jmp	 SHORT $LN2@WSS_Init_D
$LN1@WSS_Init_D:

; 101  :     }
; 102  : }

  00055	8b e5		 mov	 esp, ebp
  00057	5d		 pop	 ebp
  00058	c3		 ret	 0
?WSS_Init_Data@@YAXN@Z ENDP				; WSS_Init_Data
; Function compile flags: /Odtp
;	COMDAT ?decode_sequence@@YAHPAEPAHHH1H@Z
_TEXT	SEGMENT
_i$ = -4						; size = 4
_vbiline$ = 8						; size = 4
_DecodedVals$ = 12					; size = 4
_NbVal$ = 16						; size = 4
_Threshold$ = 20					; size = 4
_Offsets$ = 24						; size = 4
_BitLength$ = 28					; size = 4
?decode_sequence@@YAHPAEPAHHH1H@Z PROC			; decode_sequence, COMDAT

; 139  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx

; 140  :     int i;
; 141  : 
; 142  :     for (i = 0 ; i < NbVal ; i++)

  00004	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _i$[ebp], 0
  0000b	eb 09		 jmp	 SHORT $LN4@decode_seq
$LN3@decode_seq:
  0000d	8b 45 fc	 mov	 eax, DWORD PTR _i$[ebp]
  00010	83 c0 01	 add	 eax, 1
  00013	89 45 fc	 mov	 DWORD PTR _i$[ebp], eax
$LN4@decode_seq:
  00016	8b 4d fc	 mov	 ecx, DWORD PTR _i$[ebp]
  00019	3b 4d 10	 cmp	 ecx, DWORD PTR _NbVal$[ebp]
  0001c	7d 31		 jge	 SHORT $LN2@decode_seq

; 143  :     {
; 144  :         if (decodebit (vbiline + Offsets[i] - Offsets[0], Threshold, BitLength) != DecodedVals[i])

  0001e	8b 55 1c	 mov	 edx, DWORD PTR _BitLength$[ebp]
  00021	52		 push	 edx
  00022	8b 45 14	 mov	 eax, DWORD PTR _Threshold$[ebp]
  00025	50		 push	 eax
  00026	8b 4d fc	 mov	 ecx, DWORD PTR _i$[ebp]
  00029	8b 55 18	 mov	 edx, DWORD PTR _Offsets$[ebp]
  0002c	8b 45 08	 mov	 eax, DWORD PTR _vbiline$[ebp]
  0002f	03 04 8a	 add	 eax, DWORD PTR [edx+ecx*4]
  00032	8b 4d 18	 mov	 ecx, DWORD PTR _Offsets$[ebp]
  00035	2b 01		 sub	 eax, DWORD PTR [ecx]
  00037	50		 push	 eax
  00038	e8 00 00 00 00	 call	 ?decodebit@@YAHPAEHH@Z	; decodebit
  0003d	83 c4 0c	 add	 esp, 12			; 0000000cH
  00040	8b 55 fc	 mov	 edx, DWORD PTR _i$[ebp]
  00043	8b 4d 0c	 mov	 ecx, DWORD PTR _DecodedVals$[ebp]
  00046	3b 04 91	 cmp	 eax, DWORD PTR [ecx+edx*4]
  00049	74 02		 je	 SHORT $LN1@decode_seq

; 145  :             break;

  0004b	eb 02		 jmp	 SHORT $LN2@decode_seq
$LN1@decode_seq:

; 146  :     }

  0004d	eb be		 jmp	 SHORT $LN3@decode_seq
$LN2@decode_seq:

; 147  :     return ( (i == NbVal) ? TRUE : FALSE );

  0004f	8b 55 fc	 mov	 edx, DWORD PTR _i$[ebp]
  00052	33 c0		 xor	 eax, eax
  00054	3b 55 10	 cmp	 edx, DWORD PTR _NbVal$[ebp]
  00057	0f 94 c0	 sete	 al

; 148  : }

  0005a	8b e5		 mov	 esp, ebp
  0005c	5d		 pop	 ebp
  0005d	c3		 ret	 0
?decode_sequence@@YAHPAEPAHHH1H@Z ENDP			; decode_sequence
_TEXT	ENDS
PUBLIC	?WSS_init@@YAXXZ				; WSS_init
; Function compile flags: /Odtp
;	COMDAT ?WSS_init@@YAXXZ
_TEXT	SEGMENT
?WSS_init@@YAXXZ PROC					; WSS_init, COMDAT

; 121  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp

; 122  :     // Clear WSS control data
; 123  :     WSS_CtrlData.DecodeStatus = WSS_STATUS_ERROR;

  00003	c7 05 00 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A, 0

; 124  :     WSS_CtrlData.NbDecodeErr = 0;

  0000d	c7 05 04 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+4, 0

; 125  :     WSS_CtrlData.NbDecodeOk = 0;

  00017	c7 05 08 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+8, 0

; 126  :     WSS_CtrlData.NbSuccessiveErr = WSS_MAX_SUCCESSIVE_ERR;

  00021	c7 05 0c 00 00
	00 06 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+12, 6

; 127  :     WSS_CtrlData.MinPos = WSS625_START_POS_MAX;

  0002b	c7 05 10 00 00
	00 c8 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+16, 200 ; 000000c8H

; 128  :     WSS_CtrlData.MaxPos = WSS625_START_POS_MIN;

  00035	c7 05 14 00 00
	00 40 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+20, 64 ; 00000040H

; 129  :     WSS_CtrlData.TotalPos = 0;

  0003f	c7 05 18 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+24, 0

; 130  :     WSS_CtrlData.NbErrPos = 0;

  00049	c7 05 1c 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+28, 0

; 131  :     WSS_CtrlData.AspectRatioWhenErr = -1;

  00053	c7 05 20 00 00
	00 ff ff ff ff	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+32, -1

; 132  :     WSS_CtrlData.AspectModeWhenErr = -1;

  0005d	c7 05 24 00 00
	00 ff ff ff ff	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+36, -1

; 133  : 
; 134  :     // Clear WSS decoded data
; 135  :     WSS_clear_data ();

  00067	e8 00 00 00 00	 call	 ?WSS_clear_data@@YAXXZ	; WSS_clear_data

; 136  : }

  0006c	5d		 pop	 ebp
  0006d	c3		 ret	 0
?WSS_init@@YAXXZ ENDP					; WSS_init
; Function compile flags: /Odtp
;	COMDAT ?WSS625_DecodeLine@@YAHPAE@Z
_TEXT	SEGMENT
tv185 = -92						; size = 4
_j$ = -88						; size = 4
_nb$ = -84						; size = 4
_packedbits$ = -80					; size = 4
_k$ = -76						; size = 4
_bits$ = -72						; size = 56
_Threshold$ = -16					; size = 4
_StartPos$ = -12					; size = 4
_i$ = -8						; size = 4
_DecodeOk$ = -4						; size = 4
_vbiline$ = 8						; size = 4
?WSS625_DecodeLine@@YAHPAE@Z PROC			; WSS625_DecodeLine, COMDAT

; 151  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 5c	 sub	 esp, 92			; 0000005cH

; 152  :     int     i, j, k;
; 153  :     BOOL    DecodeOk = FALSE;

  00006	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _DecodeOk$[ebp], 0

; 154  :     int     Threshold = 0;

  0000d	c7 45 f0 00 00
	00 00		 mov	 DWORD PTR _Threshold$[ebp], 0

; 155  :     int     StartPos;
; 156  :     int     bits[WSS625_NB_DATA_BITS];
; 157  :     int     packedbits;
; 158  :     int     nb;
; 159  : 
; 160  :     Threshold = VBI_thresh;

  00014	0f b6 05 00 00
	00 00		 movzx	 eax, BYTE PTR ?VBI_thresh@@3EA ; VBI_thresh
  0001b	89 45 f0	 mov	 DWORD PTR _Threshold$[ebp], eax

; 161  : //  LOG(1, _T("threshold %x"), Threshold);
; 162  : 
; 163  :     if (Threshold < WSS625_MIN_THRESHOLD)

  0001e	83 7d f0 55	 cmp	 DWORD PTR _Threshold$[ebp], 85 ; 00000055H
  00022	7d 07		 jge	 SHORT $LN29@WSS625_Dec

; 164  :     {
; 165  : //        LOG(1, _T("WSS signal threshold too low (%x)"), Threshold);
; 166  :         return FALSE;

  00024	33 c0		 xor	 eax, eax
  00026	e9 87 03 00 00	 jmp	 $LN30@WSS625_Dec
$LN29@WSS625_Dec:

; 167  :     }
; 168  : 
; 169  :     for (i = WSS625_START_POS_MIN ; i <= WSS625_START_POS_MAX ; i++)

  0002b	c7 45 f8 40 00
	00 00		 mov	 DWORD PTR _i$[ebp], 64	; 00000040H
  00032	eb 09		 jmp	 SHORT $LN28@WSS625_Dec
$LN27@WSS625_Dec:
  00034	8b 4d f8	 mov	 ecx, DWORD PTR _i$[ebp]
  00037	83 c1 01	 add	 ecx, 1
  0003a	89 4d f8	 mov	 DWORD PTR _i$[ebp], ecx
$LN28@WSS625_Dec:
  0003d	81 7d f8 c8 00
	00 00		 cmp	 DWORD PTR _i$[ebp], 200	; 000000c8H
  00044	0f 8f a9 01 00
	00		 jg	 $LN26@WSS625_Dec

; 170  :     {
; 171  :         if (vbiline[i] < Threshold)

  0004a	8b 55 08	 mov	 edx, DWORD PTR _vbiline$[ebp]
  0004d	03 55 f8	 add	 edx, DWORD PTR _i$[ebp]
  00050	0f b6 02	 movzx	 eax, BYTE PTR [edx]
  00053	3b 45 f0	 cmp	 eax, DWORD PTR _Threshold$[ebp]
  00056	7d 02		 jge	 SHORT $LN25@WSS625_Dec

; 172  :             continue;

  00058	eb da		 jmp	 SHORT $LN27@WSS625_Dec
$LN25@WSS625_Dec:

; 173  : 
; 174  :         StartPos = i;

  0005a	8b 4d f8	 mov	 ecx, DWORD PTR _i$[ebp]
  0005d	89 4d f4	 mov	 DWORD PTR _StartPos$[ebp], ecx

; 175  : //        LOG(1, _T("WSS decoding at start position = %d"), StartPos);
; 176  : 
; 177  :         // run-in code decoding
; 178  :         k = 0;

  00060	c7 45 b4 00 00
	00 00		 mov	 DWORD PTR _k$[ebp], 0

; 179  :         if (decode_sequence (vbiline + i + BitOffsets[k], WSS625_runin, WSS625_RUNIN_CODE_LENGTH, Threshold, &BitOffsets[k], BitLength))

  00067	8b 15 00 00 00
	00		 mov	 edx, DWORD PTR _BitLength
  0006d	52		 push	 edx
  0006e	8b 45 b4	 mov	 eax, DWORD PTR _k$[ebp]
  00071	8d 0c 85 00 00
	00 00		 lea	 ecx, DWORD PTR _BitOffsets[eax*4]
  00078	51		 push	 ecx
  00079	8b 55 f0	 mov	 edx, DWORD PTR _Threshold$[ebp]
  0007c	52		 push	 edx
  0007d	6a 1d		 push	 29			; 0000001dH
  0007f	68 00 00 00 00	 push	 OFFSET _WSS625_runin
  00084	8b 45 08	 mov	 eax, DWORD PTR _vbiline$[ebp]
  00087	03 45 f8	 add	 eax, DWORD PTR _i$[ebp]
  0008a	8b 4d b4	 mov	 ecx, DWORD PTR _k$[ebp]
  0008d	03 04 8d 00 00
	00 00		 add	 eax, DWORD PTR _BitOffsets[ecx*4]
  00094	50		 push	 eax
  00095	e8 00 00 00 00	 call	 ?decode_sequence@@YAHPAEPAHHH1H@Z ; decode_sequence
  0009a	83 c4 18	 add	 esp, 24			; 00000018H
  0009d	85 c0		 test	 eax, eax
  0009f	0f 84 3a 01 00
	00		 je	 $LN24@WSS625_Dec

; 180  :         {
; 181  : //            LOG(1, _T("WSS run-in code detected (start pos = %d, Threshold = %x)"), i, Threshold);
; 182  :             k += WSS625_RUNIN_CODE_LENGTH;

  000a5	8b 55 b4	 mov	 edx, DWORD PTR _k$[ebp]
  000a8	83 c2 1d	 add	 edx, 29			; 0000001dH
  000ab	89 55 b4	 mov	 DWORD PTR _k$[ebp], edx

; 183  : 
; 184  :             // Start code decoding
; 185  :             if (decode_sequence (vbiline + i + BitOffsets[k], WSS625_start, WSS625_START_CODE_LENGTH, Threshold, &BitOffsets[k], BitLength))

  000ae	a1 00 00 00 00	 mov	 eax, DWORD PTR _BitLength
  000b3	50		 push	 eax
  000b4	8b 4d b4	 mov	 ecx, DWORD PTR _k$[ebp]
  000b7	8d 14 8d 00 00
	00 00		 lea	 edx, DWORD PTR _BitOffsets[ecx*4]
  000be	52		 push	 edx
  000bf	8b 45 f0	 mov	 eax, DWORD PTR _Threshold$[ebp]
  000c2	50		 push	 eax
  000c3	6a 18		 push	 24			; 00000018H
  000c5	68 00 00 00 00	 push	 OFFSET _WSS625_start
  000ca	8b 4d 08	 mov	 ecx, DWORD PTR _vbiline$[ebp]
  000cd	03 4d f8	 add	 ecx, DWORD PTR _i$[ebp]
  000d0	8b 55 b4	 mov	 edx, DWORD PTR _k$[ebp]
  000d3	03 0c 95 00 00
	00 00		 add	 ecx, DWORD PTR _BitOffsets[edx*4]
  000da	51		 push	 ecx
  000db	e8 00 00 00 00	 call	 ?decode_sequence@@YAHPAEPAHHH1H@Z ; decode_sequence
  000e0	83 c4 18	 add	 esp, 24			; 00000018H
  000e3	85 c0		 test	 eax, eax
  000e5	0f 84 f4 00 00
	00		 je	 $LN24@WSS625_Dec

; 186  :             {
; 187  : //                LOG(1, _T("WSS start code detected"));
; 188  :                 k += WSS625_START_CODE_LENGTH;

  000eb	8b 45 b4	 mov	 eax, DWORD PTR _k$[ebp]
  000ee	83 c0 18	 add	 eax, 24			; 00000018H
  000f1	89 45 b4	 mov	 DWORD PTR _k$[ebp], eax

; 189  : 
; 190  :                 // Data bits decoding
; 191  :                 nb = 0;

  000f4	c7 45 ac 00 00
	00 00		 mov	 DWORD PTR _nb$[ebp], 0

; 192  :                 for (j = 0 ; j < WSS625_NB_DATA_BITS ; j++)

  000fb	c7 45 a8 00 00
	00 00		 mov	 DWORD PTR _j$[ebp], 0
  00102	eb 09		 jmp	 SHORT $LN22@WSS625_Dec
$LN21@WSS625_Dec:
  00104	8b 4d a8	 mov	 ecx, DWORD PTR _j$[ebp]
  00107	83 c1 01	 add	 ecx, 1
  0010a	89 4d a8	 mov	 DWORD PTR _j$[ebp], ecx
$LN22@WSS625_Dec:
  0010d	83 7d a8 0e	 cmp	 DWORD PTR _j$[ebp], 14	; 0000000eH
  00111	0f 8d b9 00 00
	00		 jge	 $LN20@WSS625_Dec

; 193  :                 {
; 194  :                     if (decode_sequence (vbiline + i + BitOffsets[k], WSS625_0, WSS625_DATA_BIT_LENGTH, Threshold, &BitOffsets[k], BitLength))

  00117	8b 15 00 00 00
	00		 mov	 edx, DWORD PTR _BitLength
  0011d	52		 push	 edx
  0011e	8b 45 b4	 mov	 eax, DWORD PTR _k$[ebp]
  00121	8d 0c 85 00 00
	00 00		 lea	 ecx, DWORD PTR _BitOffsets[eax*4]
  00128	51		 push	 ecx
  00129	8b 55 f0	 mov	 edx, DWORD PTR _Threshold$[ebp]
  0012c	52		 push	 edx
  0012d	6a 06		 push	 6
  0012f	68 00 00 00 00	 push	 OFFSET _WSS625_0
  00134	8b 45 08	 mov	 eax, DWORD PTR _vbiline$[ebp]
  00137	03 45 f8	 add	 eax, DWORD PTR _i$[ebp]
  0013a	8b 4d b4	 mov	 ecx, DWORD PTR _k$[ebp]
  0013d	03 04 8d 00 00
	00 00		 add	 eax, DWORD PTR _BitOffsets[ecx*4]
  00144	50		 push	 eax
  00145	e8 00 00 00 00	 call	 ?decode_sequence@@YAHPAEPAHHH1H@Z ; decode_sequence
  0014a	83 c4 18	 add	 esp, 24			; 00000018H
  0014d	85 c0		 test	 eax, eax
  0014f	74 16		 je	 SHORT $LN19@WSS625_Dec

; 195  :                     {
; 196  :                         bits[j] = 0;

  00151	8b 55 a8	 mov	 edx, DWORD PTR _j$[ebp]
  00154	c7 44 95 b8 00
	00 00 00	 mov	 DWORD PTR _bits$[ebp+edx*4], 0

; 197  :                         nb++;

  0015c	8b 45 ac	 mov	 eax, DWORD PTR _nb$[ebp]
  0015f	83 c0 01	 add	 eax, 1
  00162	89 45 ac	 mov	 DWORD PTR _nb$[ebp], eax
  00165	eb 5b		 jmp	 SHORT $LN18@WSS625_Dec
$LN19@WSS625_Dec:

; 198  : //                        LOG(1, _T("WSS b%d = 0 (start pos = %d, Threshold = %x)"), j, i, Threshold);
; 199  :                     }
; 200  :                     else if (decode_sequence (vbiline + i + BitOffsets[k], WSS625_1, WSS625_DATA_BIT_LENGTH, Threshold, &BitOffsets[k], BitLength))

  00167	8b 0d 00 00 00
	00		 mov	 ecx, DWORD PTR _BitLength
  0016d	51		 push	 ecx
  0016e	8b 55 b4	 mov	 edx, DWORD PTR _k$[ebp]
  00171	8d 04 95 00 00
	00 00		 lea	 eax, DWORD PTR _BitOffsets[edx*4]
  00178	50		 push	 eax
  00179	8b 4d f0	 mov	 ecx, DWORD PTR _Threshold$[ebp]
  0017c	51		 push	 ecx
  0017d	6a 06		 push	 6
  0017f	68 00 00 00 00	 push	 OFFSET _WSS625_1
  00184	8b 55 08	 mov	 edx, DWORD PTR _vbiline$[ebp]
  00187	03 55 f8	 add	 edx, DWORD PTR _i$[ebp]
  0018a	8b 45 b4	 mov	 eax, DWORD PTR _k$[ebp]
  0018d	03 14 85 00 00
	00 00		 add	 edx, DWORD PTR _BitOffsets[eax*4]
  00194	52		 push	 edx
  00195	e8 00 00 00 00	 call	 ?decode_sequence@@YAHPAEPAHHH1H@Z ; decode_sequence
  0019a	83 c4 18	 add	 esp, 24			; 00000018H
  0019d	85 c0		 test	 eax, eax
  0019f	74 16		 je	 SHORT $LN17@WSS625_Dec

; 201  :                     {
; 202  :                         bits[j] = 1;

  001a1	8b 4d a8	 mov	 ecx, DWORD PTR _j$[ebp]
  001a4	c7 44 8d b8 01
	00 00 00	 mov	 DWORD PTR _bits$[ebp+ecx*4], 1

; 203  :                         nb++;

  001ac	8b 55 ac	 mov	 edx, DWORD PTR _nb$[ebp]
  001af	83 c2 01	 add	 edx, 1
  001b2	89 55 ac	 mov	 DWORD PTR _nb$[ebp], edx

; 204  : //                        LOG(1, _T("WSS b%d = 1 (start pos = %d, Threshold = %x)"), j, i, Threshold);
; 205  :                     }
; 206  :                     else

  001b5	eb 0b		 jmp	 SHORT $LN18@WSS625_Dec
$LN17@WSS625_Dec:

; 207  :                     {
; 208  :                         bits[j] = -1;

  001b7	8b 45 a8	 mov	 eax, DWORD PTR _j$[ebp]
  001ba	c7 44 85 b8 ff
	ff ff ff	 mov	 DWORD PTR _bits$[ebp+eax*4], -1
$LN18@WSS625_Dec:

; 209  : //                        LOG(1, _T("WSS b%d = ?"), j);
; 210  :                     }
; 211  :                     k += WSS625_DATA_BIT_LENGTH;

  001c2	8b 4d b4	 mov	 ecx, DWORD PTR _k$[ebp]
  001c5	83 c1 06	 add	 ecx, 6
  001c8	89 4d b4	 mov	 DWORD PTR _k$[ebp], ecx

; 212  :                 }

  001cb	e9 34 ff ff ff	 jmp	 $LN21@WSS625_Dec
$LN20@WSS625_Dec:

; 213  :                 if (nb == WSS625_NB_DATA_BITS)

  001d0	83 7d ac 0e	 cmp	 DWORD PTR _nb$[ebp], 14	; 0000000eH
  001d4	75 09		 jne	 SHORT $LN24@WSS625_Dec

; 214  :                 {
; 215  :                     DecodeOk = TRUE;

  001d6	c7 45 fc 01 00
	00 00		 mov	 DWORD PTR _DecodeOk$[ebp], 1

; 216  :                     break;

  001dd	eb 14		 jmp	 SHORT $LN26@WSS625_Dec
$LN24@WSS625_Dec:

; 217  :                 }
; 218  :             }
; 219  :         }
; 220  :         WSS_CtrlData.NbErrPos++;

  001df	8b 15 1c 00 00
	00		 mov	 edx, DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+28
  001e5	83 c2 01	 add	 edx, 1
  001e8	89 15 1c 00 00
	00		 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+28, edx

; 221  :     }

  001ee	e9 41 fe ff ff	 jmp	 $LN27@WSS625_Dec
$LN26@WSS625_Dec:

; 222  : 
; 223  :     if (DecodeOk)

  001f3	83 7d fc 00	 cmp	 DWORD PTR _DecodeOk$[ebp], 0
  001f7	0f 84 a9 01 00
	00		 je	 $LN14@WSS625_Dec

; 224  :     {
; 225  : //      LOG(3, _T("WSS decode OK start pos = %d, Threshold = %x"), StartPos, Threshold);
; 226  : //      k = WSS625_RUNIN_CODE_LENGTH + WSS625_START_CODE_LENGTH;
; 227  : //      for (i = 0 ; i < WSS625_NB_DATA_BITS ; i++)
; 228  : //      {
; 229  : //          for (j = 0 ; j < WSS625_DATA_BIT_LENGTH ; j++)
; 230  : //          {
; 231  : //              int pos = StartPos + BitOffsets[k];
; 232  : //                if (BitLength == 5)
; 233  : //                    LOG(3, _T("WSS bit b%d => %x %x %x %x %x"), i, vbiline[pos], vbiline[pos+1], vbiline[pos+2], vbiline[pos+3], vbiline[pos+4]);
; 234  : //                else if (BitLength == 7)
; 235  : //                    LOG(3, _T("WSS bit b%d => %x %x %x %x %x %x %x"), i, vbiline[pos], vbiline[pos+1], vbiline[pos+2], vbiline[pos+3], vbiline[pos+4], vbiline[pos+5], vbiline[pos+6]);
; 236  : //              k++;
; 237  : //          }
; 238  : //          LOG(3, _T("WSS bit b%d = %d"), i, bits[i]);
; 239  : //      }
; 240  : 
; 241  :         // Decoding statistics
; 242  :         WSS_CtrlData.TotalPos += StartPos;

  001fd	a1 18 00 00 00	 mov	 eax, DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+24
  00202	03 45 f4	 add	 eax, DWORD PTR _StartPos$[ebp]
  00205	a3 18 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+24, eax

; 243  :         if (StartPos < WSS_CtrlData.MinPos)

  0020a	8b 4d f4	 mov	 ecx, DWORD PTR _StartPos$[ebp]
  0020d	3b 0d 10 00 00
	00		 cmp	 ecx, DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+16
  00213	7d 09		 jge	 SHORT $LN13@WSS625_Dec

; 244  :             WSS_CtrlData.MinPos = StartPos;

  00215	8b 55 f4	 mov	 edx, DWORD PTR _StartPos$[ebp]
  00218	89 15 10 00 00
	00		 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+16, edx
$LN13@WSS625_Dec:

; 245  :         if (StartPos > WSS_CtrlData.MaxPos)

  0021e	8b 45 f4	 mov	 eax, DWORD PTR _StartPos$[ebp]
  00221	3b 05 14 00 00
	00		 cmp	 eax, DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+20
  00227	7e 09		 jle	 SHORT $LN12@WSS625_Dec

; 246  :             WSS_CtrlData.MaxPos = StartPos;

  00229	8b 4d f4	 mov	 ecx, DWORD PTR _StartPos$[ebp]
  0022c	89 0d 14 00 00
	00		 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+20, ecx
$LN12@WSS625_Dec:

; 247  : 
; 248  :         packedbits = 0;

  00232	c7 45 b0 00 00
	00 00		 mov	 DWORD PTR _packedbits$[ebp], 0

; 249  :         for (j = 0 ; j < WSS625_NB_DATA_BITS ; j++)

  00239	c7 45 a8 00 00
	00 00		 mov	 DWORD PTR _j$[ebp], 0
  00240	eb 09		 jmp	 SHORT $LN11@WSS625_Dec
$LN10@WSS625_Dec:
  00242	8b 55 a8	 mov	 edx, DWORD PTR _j$[ebp]
  00245	83 c2 01	 add	 edx, 1
  00248	89 55 a8	 mov	 DWORD PTR _j$[ebp], edx
$LN11@WSS625_Dec:
  0024b	83 7d a8 0e	 cmp	 DWORD PTR _j$[ebp], 14	; 0000000eH
  0024f	7d 14		 jge	 SHORT $LN9@WSS625_Dec

; 250  :         {
; 251  :             packedbits |= bits[j]<<j;

  00251	8b 45 a8	 mov	 eax, DWORD PTR _j$[ebp]
  00254	8b 54 85 b8	 mov	 edx, DWORD PTR _bits$[ebp+eax*4]
  00258	8b 4d a8	 mov	 ecx, DWORD PTR _j$[ebp]
  0025b	d3 e2		 shl	 edx, cl
  0025d	0b 55 b0	 or	 edx, DWORD PTR _packedbits$[ebp]
  00260	89 55 b0	 mov	 DWORD PTR _packedbits$[ebp], edx

; 252  :         }

  00263	eb dd		 jmp	 SHORT $LN10@WSS625_Dec
$LN9@WSS625_Dec:

; 253  :         switch (packedbits & 0x000f)

  00265	8b 45 b0	 mov	 eax, DWORD PTR _packedbits$[ebp]
  00268	83 e0 0f	 and	 eax, 15			; 0000000fH
  0026b	89 45 a4	 mov	 DWORD PTR tv185[ebp], eax
  0026e	8b 4d a4	 mov	 ecx, DWORD PTR tv185[ebp]
  00271	83 e9 01	 sub	 ecx, 1
  00274	89 4d a4	 mov	 DWORD PTR tv185[ebp], ecx
  00277	83 7d a4 0d	 cmp	 DWORD PTR tv185[ebp], 13 ; 0000000dH
  0027b	77 7f		 ja	 SHORT $LN1@WSS625_Dec
  0027d	8b 55 a4	 mov	 edx, DWORD PTR tv185[ebp]
  00280	0f b6 82 00 00
	00 00		 movzx	 eax, BYTE PTR $LN32@WSS625_Dec[edx]
  00287	ff 24 85 00 00
	00 00		 jmp	 DWORD PTR $LN33@WSS625_Dec[eax*4]
$LN6@WSS625_Dec:

; 254  :         {
; 255  :         case WSS625_RATIO_133:
; 256  :             WSS_Data.AspectMode = AR_NONANAMORPHIC;

  0028e	c7 05 04 00 00
	00 01 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+4, 1

; 257  :             WSS_Data.AspectRatio = 1333;

  00298	c7 05 00 00 00
	00 35 05 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A, 1333 ; 00000535H

; 258  :             break;

  002a2	eb 6c		 jmp	 SHORT $LN7@WSS625_Dec
$LN5@WSS625_Dec:

; 259  :         case WSS625_RATIO_177_ANAMORPHIC:
; 260  :             WSS_Data.AspectMode = AR_ANAMORPHIC;

  002a4	c7 05 04 00 00
	00 02 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+4, 2

; 261  :             WSS_Data.AspectRatio = 1778;

  002ae	c7 05 00 00 00
	00 f2 06 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A, 1778 ; 000006f2H

; 262  :             break;

  002b8	eb 56		 jmp	 SHORT $LN7@WSS625_Dec
$LN4@WSS625_Dec:

; 263  :         case WSS625_RATIO_155:
; 264  :         case WSS625_RATIO_155_LETTERBOX_CENTER:
; 265  :         case WSS625_RATIO_155_LETTERBOX_TOP:
; 266  :             WSS_Data.AspectMode = AR_NONANAMORPHIC;

  002ba	c7 05 04 00 00
	00 01 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+4, 1

; 267  :             WSS_Data.AspectRatio = 1555;

  002c4	c7 05 00 00 00
	00 13 06 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A, 1555 ; 00000613H

; 268  :             break;

  002ce	eb 40		 jmp	 SHORT $LN7@WSS625_Dec
$LN3@WSS625_Dec:

; 269  :         case WSS625_RATIO_177_LETTERBOX_CENTER:
; 270  :         case WSS625_RATIO_177_LETTERBOX_TOP:
; 271  :             WSS_Data.AspectMode = AR_NONANAMORPHIC;

  002d0	c7 05 04 00 00
	00 01 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+4, 1

; 272  :             WSS_Data.AspectRatio = 1778;

  002da	c7 05 00 00 00
	00 f2 06 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A, 1778 ; 000006f2H

; 273  :             break;

  002e4	eb 2a		 jmp	 SHORT $LN7@WSS625_Dec
$LN2@WSS625_Dec:

; 274  :         case WSS625_RATIO_BIG_LETTERBOX_CENTER:
; 275  :             WSS_Data.AspectMode = AR_NONANAMORPHIC;

  002e6	c7 05 04 00 00
	00 01 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+4, 1

; 276  :             WSS_Data.AspectRatio = -1;

  002f0	c7 05 00 00 00
	00 ff ff ff ff	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A, -1

; 277  :             break;

  002fa	eb 14		 jmp	 SHORT $LN7@WSS625_Dec
$LN1@WSS625_Dec:

; 278  :         default:
; 279  :             WSS_Data.AspectMode = -1;

  002fc	c7 05 04 00 00
	00 ff ff ff ff	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+4, -1

; 280  :             WSS_Data.AspectRatio = -1;

  00306	c7 05 00 00 00
	00 ff ff ff ff	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A, -1
$LN7@WSS625_Dec:

; 281  :             break;
; 282  :         }
; 283  :         WSS_Data.FilmMode = (packedbits & 0x0010) ? TRUE : FALSE;

  00310	8b 4d b0	 mov	 ecx, DWORD PTR _packedbits$[ebp]
  00313	83 e1 10	 and	 ecx, 16			; 00000010H
  00316	f7 d9		 neg	 ecx
  00318	1b c9		 sbb	 ecx, ecx
  0031a	f7 d9		 neg	 ecx
  0031c	89 0d 08 00 00
	00		 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+8, ecx

; 284  :         WSS_Data.ColorPlus = (packedbits & 0x0020) ? TRUE : FALSE;

  00322	8b 55 b0	 mov	 edx, DWORD PTR _packedbits$[ebp]
  00325	83 e2 20	 and	 edx, 32			; 00000020H
  00328	f7 da		 neg	 edx
  0032a	1b d2		 sbb	 edx, edx
  0032c	f7 da		 neg	 edx
  0032e	89 15 0c 00 00
	00		 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+12, edx

; 285  :         WSS_Data.HelperSignals = (packedbits & 0x0040) ? TRUE : FALSE;

  00334	8b 45 b0	 mov	 eax, DWORD PTR _packedbits$[ebp]
  00337	83 e0 40	 and	 eax, 64			; 00000040H
  0033a	f7 d8		 neg	 eax
  0033c	1b c0		 sbb	 eax, eax
  0033e	f7 d8		 neg	 eax
  00340	a3 10 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+16, eax

; 286  :         WSS_Data.TeletextSubtitle = (packedbits & 0x0100) ? TRUE : FALSE;

  00345	8b 4d b0	 mov	 ecx, DWORD PTR _packedbits$[ebp]
  00348	81 e1 00 01 00
	00		 and	 ecx, 256		; 00000100H
  0034e	f7 d9		 neg	 ecx
  00350	1b c9		 sbb	 ecx, ecx
  00352	f7 d9		 neg	 ecx
  00354	89 0d 14 00 00
	00		 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+20, ecx

; 287  :         WSS_Data.OpenSubtitles = packedbits & 0x0600;

  0035a	8b 55 b0	 mov	 edx, DWORD PTR _packedbits$[ebp]
  0035d	81 e2 00 06 00
	00		 and	 edx, 1536		; 00000600H
  00363	89 15 18 00 00
	00		 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+24, edx

; 288  :         WSS_Data.SurroundSound = (packedbits & 0x0800) ? TRUE : FALSE;

  00369	8b 45 b0	 mov	 eax, DWORD PTR _packedbits$[ebp]
  0036c	25 00 08 00 00	 and	 eax, 2048		; 00000800H
  00371	f7 d8		 neg	 eax
  00373	1b c0		 sbb	 eax, eax
  00375	f7 d8		 neg	 eax
  00377	a3 1c 00 00 00	 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+28, eax

; 289  :         WSS_Data.CopyrightAsserted = (packedbits & 0x1000) ? TRUE : FALSE;

  0037c	8b 4d b0	 mov	 ecx, DWORD PTR _packedbits$[ebp]
  0037f	81 e1 00 10 00
	00		 and	 ecx, 4096		; 00001000H
  00385	f7 d9		 neg	 ecx
  00387	1b c9		 sbb	 ecx, ecx
  00389	f7 d9		 neg	 ecx
  0038b	89 0d 20 00 00
	00		 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+32, ecx

; 290  :         WSS_Data.CopyProtection = (packedbits & 0x2000) ? TRUE : FALSE;

  00391	8b 55 b0	 mov	 edx, DWORD PTR _packedbits$[ebp]
  00394	81 e2 00 20 00
	00		 and	 edx, 8192		; 00002000H
  0039a	f7 da		 neg	 edx
  0039c	1b d2		 sbb	 edx, edx
  0039e	f7 da		 neg	 edx
  003a0	89 15 24 00 00
	00		 mov	 DWORD PTR ?WSS_Data@@3UTWSSDataStruct@@A+36, edx
$LN14@WSS625_Dec:

; 291  :     }
; 292  : //    else
; 293  : //    {
; 294  : //        LOG(1, _T("WSS decode ERROR Threshold = %x"), Threshold);
; 295  : //        StartPos = 0;
; 296  : //        while (vbiline[StartPos] < Threshold && StartPos <= WSS625_START_POS_MAX)
; 297  :             StartPos++;

  003a6	8b 45 f4	 mov	 eax, DWORD PTR _StartPos$[ebp]
  003a9	83 c0 01	 add	 eax, 1
  003ac	89 45 f4	 mov	 DWORD PTR _StartPos$[ebp], eax

; 298  : //        for (j = 0 ; j < 100 ; j++)
; 299  : //        {
; 300  : //            k = StartPos + j * BitLength;
; 301  : //            if (BitLength == 5)
; 302  : //                LOG(1, _T("WSS pos = %d : %x %x %x %x %x"), k, vbiline[k], vbiline[k + 1], vbiline[k + 2], vbiline[k + 3], vbiline[k + 4]);
; 303  : //            else if (BitLength == 7)
; 304  : //                LOG(1, _T("WSS pos = %d : %x %x %x %x %x %x %x"), k, vbiline[k], vbiline[k + 1], vbiline[k + 2], vbiline[k + 3], vbiline[k + 4], vbiline[k + 5], vbiline[k + 6]);
; 305  : //        }
; 306  : //        for (j = 0 ; j < 100 ; j++)
; 307  : //        {
; 308  : //            k = StartPos + BitOffsets[j];
; 309  : //            if (BitLength == 5)
; 310  : //                LOG(1, _T("WSS pos = %d : %x %x %x %x %x"), k, vbiline[k], vbiline[k + 1], vbiline[k + 2], vbiline[k + 3], vbiline[k + 4]);
; 311  : //            else if (BitLength == 7)
; 312  : //                LOG(1, _T("WSS pos = %d : %x %x %x %x %x %x %x"), k, vbiline[k], vbiline[k + 1], vbiline[k + 2], vbiline[k + 3], vbiline[k + 4], vbiline[k + 5], vbiline[k + 6]);
; 313  : //        }
; 314  : //    }
; 315  : 
; 316  :     return DecodeOk;

  003af	8b 45 fc	 mov	 eax, DWORD PTR _DecodeOk$[ebp]
$LN30@WSS625_Dec:

; 317  : }

  003b2	8b e5		 mov	 esp, ebp
  003b4	5d		 pop	 ebp
  003b5	c3		 ret	 0
  003b6	8b ff		 npad	 2
$LN33@WSS625_Dec:
  003b8	00 00 00 00	 DD	 $LN4@WSS625_Dec
  003bc	00 00 00 00	 DD	 $LN3@WSS625_Dec
  003c0	00 00 00 00	 DD	 $LN5@WSS625_Dec
  003c4	00 00 00 00	 DD	 $LN6@WSS625_Dec
  003c8	00 00 00 00	 DD	 $LN2@WSS625_Dec
  003cc	00 00 00 00	 DD	 $LN1@WSS625_Dec
$LN32@WSS625_Dec:
  003d0	00		 DB	 0
  003d1	00		 DB	 0
  003d2	05		 DB	 5
  003d3	01		 DB	 1
  003d4	05		 DB	 5
  003d5	05		 DB	 5
  003d6	02		 DB	 2
  003d7	03		 DB	 3
  003d8	05		 DB	 5
  003d9	05		 DB	 5
  003da	01		 DB	 1
  003db	05		 DB	 5
  003dc	04		 DB	 4
  003dd	00		 DB	 0
?WSS625_DecodeLine@@YAHPAE@Z ENDP			; WSS625_DecodeLine
PUBLIC	?VBI_DecodeLine_WSS@@YAHPAE@Z			; VBI_DecodeLine_WSS
; Function compile flags: /Odtp
;	COMDAT ?VBI_DecodeLine_WSS@@YAHPAE@Z
_TEXT	SEGMENT
tv73 = -16						; size = 4
tv67 = -12						; size = 4
_bResuDecoding$ = -8					; size = 4
_TVFormat$ = -4						; size = 4
_vbiline$ = 8						; size = 4
?VBI_DecodeLine_WSS@@YAHPAE@Z PROC			; VBI_DecodeLine_WSS, COMDAT

; 353  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 10	 sub	 esp, 16			; 00000010H

; 354  :     BOOL    bResuDecoding;
; 355  :     TTVFormat* TVFormat = GetTVFormat(Providers_GetCurrentSource()->GetFormat());

  00006	e8 00 00 00 00	 call	 ?Providers_GetCurrentSource@@YAPAVCSource@@XZ ; Providers_GetCurrentSource
  0000b	89 45 f4	 mov	 DWORD PTR tv67[ebp], eax
  0000e	8b 45 f4	 mov	 eax, DWORD PTR tv67[ebp]
  00011	8b 10		 mov	 edx, DWORD PTR [eax]
  00013	8b 4d f4	 mov	 ecx, DWORD PTR tv67[ebp]
  00016	8b 42 64	 mov	 eax, DWORD PTR [edx+100]
  00019	ff d0		 call	 eax
  0001b	50		 push	 eax
  0001c	e8 00 00 00 00	 call	 ?GetTVFormat@@YAPAUTTVFormat@@W4eVideoFormat@@@Z ; GetTVFormat
  00021	83 c4 04	 add	 esp, 4
  00024	89 45 fc	 mov	 DWORD PTR _TVFormat$[ebp], eax

; 356  : 
; 357  :     switch (TVFormat->wCropHeight)

  00027	8b 4d fc	 mov	 ecx, DWORD PTR _TVFormat$[ebp]
  0002a	0f b7 11	 movzx	 edx, WORD PTR [ecx]
  0002d	89 55 f0	 mov	 DWORD PTR tv73[ebp], edx
  00030	81 7d f0 90 01
	00 00		 cmp	 DWORD PTR tv73[ebp], 400 ; 00000190H
  00037	74 1c		 je	 SHORT $LN7@VBI_Decode@4
  00039	81 7d f0 40 02
	00 00		 cmp	 DWORD PTR tv73[ebp], 576 ; 00000240H
  00040	74 02		 je	 SHORT $LN8@VBI_Decode@4
  00042	eb 22		 jmp	 SHORT $LN6@VBI_Decode@4
$LN8@VBI_Decode@4:

; 358  :     {
; 359  :     // 625-line systems
; 360  :     case 576:
; 361  :         bResuDecoding = WSS625_DecodeLine(vbiline);

  00044	8b 45 08	 mov	 eax, DWORD PTR _vbiline$[ebp]
  00047	50		 push	 eax
  00048	e8 00 00 00 00	 call	 ?WSS625_DecodeLine@@YAHPAE@Z ; WSS625_DecodeLine
  0004d	83 c4 04	 add	 esp, 4
  00050	89 45 f8	 mov	 DWORD PTR _bResuDecoding$[ebp], eax

; 362  :         break;

  00053	eb 18		 jmp	 SHORT $LN9@VBI_Decode@4
$LN7@VBI_Decode@4:

; 363  : 
; 364  :     // 525-line systems
; 365  :     case 400:
; 366  :         bResuDecoding = WSS525_DecodeLine(vbiline);

  00055	8b 4d 08	 mov	 ecx, DWORD PTR _vbiline$[ebp]
  00058	51		 push	 ecx
  00059	e8 00 00 00 00	 call	 ?WSS525_DecodeLine@@YAHPAE@Z ; WSS525_DecodeLine
  0005e	83 c4 04	 add	 esp, 4
  00061	89 45 f8	 mov	 DWORD PTR _bResuDecoding$[ebp], eax

; 367  :         break;

  00064	eb 07		 jmp	 SHORT $LN9@VBI_Decode@4
$LN6@VBI_Decode@4:

; 368  : 
; 369  :     default:
; 370  :         bResuDecoding = FALSE;

  00066	c7 45 f8 00 00
	00 00		 mov	 DWORD PTR _bResuDecoding$[ebp], 0
$LN9@VBI_Decode@4:

; 371  :         break;
; 372  :     }
; 373  : 
; 374  :     if (! bResuDecoding)

  0006d	83 7d f8 00	 cmp	 DWORD PTR _bResuDecoding$[ebp], 0
  00071	75 4b		 jne	 SHORT $LN5@VBI_Decode@4

; 375  :     {
; 376  :         WSS_CtrlData.NbDecodeErr++;

  00073	8b 15 04 00 00
	00		 mov	 edx, DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+4
  00079	83 c2 01	 add	 edx, 1
  0007c	89 15 04 00 00
	00		 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+4, edx

; 377  :         WSS_CtrlData.NbSuccessiveErr++;

  00082	a1 0c 00 00 00	 mov	 eax, DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+12
  00087	83 c0 01	 add	 eax, 1
  0008a	a3 0c 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+12, eax

; 378  :         // Clear WSS decoded data
; 379  :         // after two many successive decoding errors
; 380  :         if (WSS_CtrlData.NbSuccessiveErr >= WSS_MAX_SUCCESSIVE_ERR)

  0008f	83 3d 0c 00 00
	00 06		 cmp	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+12, 6
  00096	7c 0c		 jl	 SHORT $LN4@VBI_Decode@4

; 381  :             WSS_CtrlData.DecodeStatus = WSS_STATUS_ERROR;

  00098	c7 05 00 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A, 0

; 382  :         else

  000a2	eb 0a		 jmp	 SHORT $LN3@VBI_Decode@4
$LN4@VBI_Decode@4:

; 383  :             WSS_CtrlData.DecodeStatus = WSS_STATUS_PONCTUAL_ERROR;

  000a4	c7 05 00 00 00
	00 02 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A, 2
$LN3@VBI_Decode@4:

; 384  :         if (WSS_CtrlData.NbSuccessiveErr == WSS_MAX_SUCCESSIVE_ERR)

  000ae	83 3d 0c 00 00
	00 06		 cmp	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+12, 6
  000b5	75 05		 jne	 SHORT $LN2@VBI_Decode@4

; 385  :         {
; 386  :             WSS_clear_data();

  000b7	e8 00 00 00 00	 call	 ?WSS_clear_data@@YAXXZ	; WSS_clear_data
$LN2@VBI_Decode@4:

; 387  :         }
; 388  :     }
; 389  :     else

  000bc	eb 23		 jmp	 SHORT $LN1@VBI_Decode@4
$LN5@VBI_Decode@4:

; 390  :     {
; 391  :         WSS_CtrlData.DecodeStatus = WSS_STATUS_OK;

  000be	c7 05 00 00 00
	00 01 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A, 1

; 392  :         WSS_CtrlData.NbDecodeOk++;

  000c8	8b 0d 08 00 00
	00		 mov	 ecx, DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+8
  000ce	83 c1 01	 add	 ecx, 1
  000d1	89 0d 08 00 00
	00		 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+8, ecx

; 393  :         WSS_CtrlData.NbSuccessiveErr = 0;

  000d7	c7 05 0c 00 00
	00 00 00 00 00	 mov	 DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A+12, 0
$LN1@VBI_Decode@4:

; 394  :     }
; 395  : 
; 396  :     return ((WSS_CtrlData.DecodeStatus == WSS_STATUS_OK) ? 0 : -1);

  000e1	a1 00 00 00 00	 mov	 eax, DWORD PTR ?WSS_CtrlData@@3UTWSSCtrlDataStruct@@A
  000e6	83 e8 01	 sub	 eax, 1
  000e9	f7 d8		 neg	 eax
  000eb	1b c0		 sbb	 eax, eax

; 397  : }

  000ed	8b e5		 mov	 esp, ebp
  000ef	5d		 pop	 ebp
  000f0	c3		 ret	 0
?VBI_DecodeLine_WSS@@YAHPAE@Z ENDP			; VBI_DecodeLine_WSS
END
