diff --git a/src/libs/zmbv/drvproc.cpp b/src/libs/zmbv/drvproc.cpp new file mode 100644 index 00000000..b6c37540 --- /dev/null +++ b/src/libs/zmbv/drvproc.cpp @@ -0,0 +1,212 @@ +/* + * Copyright (C) 2002-2005 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +// +// Zipped Motion Block Video +// +// Based on Huffyuv by Ben Rudiak-Gould. +// which was based on MSYUV sample code, which is: +// Copyright (c) 1993 Microsoft Corporation. +// All Rights Reserved. +// + +#include "zmbv_vfw.h" + +/*************************************************************************** + * DriverProc - The entry point for an installable driver. + * + * PARAMETERS + * dwDriverId: For most messages, is the DWORD + * value that the driver returns in response to a message. + * Each time that the driver is opened, through the API, + * the driver receives a message and can return an + * arbitrary, non-zero value. The installable driver interface + * saves this value and returns a unique driver handle to the + * application. Whenever the application sends a message to the + * driver using the driver handle, the interface routes the message + * to this entry point and passes the corresponding . + * This mechanism allows the driver to use the same or different + * identifiers for multiple opens but ensures that driver handles + * are unique at the application interface layer. + * + * The following messages are not related to a particular open + * instance of the driver. For these messages, the dwDriverId + * will always be zero. + * + * DRV_LOAD, DRV_FREE, DRV_ENABLE, DRV_DISABLE, DRV_OPEN + * + * hDriver: This is the handle returned to the application by the + * driver interface. + * + * uiMessage: The requested action to be performed. Message + * values below are used for globally defined messages. + * Message values from to are used for + * defined driver protocols. Messages above are used + * for driver specific messages. + * + * lParam1: Data for this message. Defined separately for + * each message + * + * lParam2: Data for this message. Defined separately for + * each message + * + * RETURNS + * Defined separately for each message. + * + ***************************************************************************/ +LRESULT PASCAL DriverProc(DWORD dwDriverID, HDRVR hDriver, UINT uiMessage, LPARAM lParam1, LPARAM lParam2) { + CodecInst* pi = (CodecInst*)dwDriverID; + + switch (uiMessage) { + case DRV_LOAD: + return (LRESULT)1L; + + case DRV_FREE: + return (LRESULT)1L; + + case DRV_OPEN: + // GAAH! This used to return a pointer to 0xFFFF0000 when lParam==0! + return (LRESULT)(DWORD)(UINT) Open((ICOPEN*) lParam2); + + case DRV_CLOSE: + if (pi) Close(pi); + return (LRESULT)1L; + + /********************************************************************* + + state messages + + *********************************************************************/ + + // cwk + case DRV_QUERYCONFIGURE: // configuration from drivers applet + return (LRESULT)1L; + + case DRV_CONFIGURE: + pi->Configure((HWND)lParam1); + return DRV_OK; + + case ICM_CONFIGURE: + // + // return ICERR_OK if you will do a configure box, error otherwise + // + if (lParam1 == -1) + return pi->QueryConfigure() ? ICERR_OK : ICERR_UNSUPPORTED; + else + return pi->Configure((HWND)lParam1); + + case ICM_ABOUT: + // + // return ICERR_OK if you will do a about box, error otherwise + // + if (lParam1 == -1) + return pi->QueryAbout() ? ICERR_OK : ICERR_UNSUPPORTED; + else + return pi->About((HWND)lParam1); + + case ICM_GETSTATE: + return pi->GetState((LPVOID)lParam1, (DWORD)lParam2); + + case ICM_SETSTATE: + return pi->SetState((LPVOID)lParam1, (DWORD)lParam2); + + case ICM_GETINFO: + return pi->GetInfo((ICINFO*)lParam1, (DWORD)lParam2); + + case ICM_GETDEFAULTQUALITY: + if (lParam1) { + *((LPDWORD)lParam1) = 10000; + return ICERR_OK; + } + break; + + /********************************************************************* + + compression messages + + *********************************************************************/ + + case ICM_COMPRESS_QUERY: + return pi->CompressQuery((LPBITMAPINFOHEADER)lParam1, (LPBITMAPINFOHEADER)lParam2); + + case ICM_COMPRESS_BEGIN: + return pi->CompressBegin((LPBITMAPINFOHEADER)lParam1, (LPBITMAPINFOHEADER)lParam2); + + case ICM_COMPRESS_GET_FORMAT: + return pi->CompressGetFormat((LPBITMAPINFOHEADER)lParam1, (LPBITMAPINFOHEADER)lParam2); + + case ICM_COMPRESS_GET_SIZE: + return pi->CompressGetSize((LPBITMAPINFOHEADER)lParam1, (LPBITMAPINFOHEADER)lParam2); + + case ICM_COMPRESS: + return pi->Compress((ICCOMPRESS*)lParam1, (DWORD)lParam2); + + case ICM_COMPRESS_END: + return pi->CompressEnd(); + + /********************************************************************* + + decompress messages + + *********************************************************************/ + + case ICM_DECOMPRESS_QUERY: + return pi->DecompressQuery((LPBITMAPINFOHEADER)lParam1, (LPBITMAPINFOHEADER)lParam2); + + case ICM_DECOMPRESS_BEGIN: + return pi->DecompressBegin((LPBITMAPINFOHEADER)lParam1, (LPBITMAPINFOHEADER)lParam2); + + case ICM_DECOMPRESS_GET_FORMAT: + return pi->DecompressGetFormat((LPBITMAPINFOHEADER)lParam1, (LPBITMAPINFOHEADER)lParam2); + + case ICM_DECOMPRESS_GET_PALETTE: + return pi->DecompressGetPalette((LPBITMAPINFOHEADER)lParam1, (LPBITMAPINFOHEADER)lParam2); + + case ICM_DECOMPRESS: + return pi->Decompress((ICDECOMPRESS*)lParam1, (DWORD)lParam2); + + case ICM_DECOMPRESS_END: + return pi->DecompressEnd(); + + /********************************************************************* + + standard driver messages + + *********************************************************************/ + + case DRV_DISABLE: + case DRV_ENABLE: + return (LRESULT)1L; + + case DRV_INSTALL: + case DRV_REMOVE: + return (LRESULT)DRV_OK; + } + + if (uiMessage < DRV_USER) + return DefDriverProc(dwDriverID, hDriver, uiMessage, lParam1, lParam2); + else + return ICERR_UNSUPPORTED; +} + + +HMODULE hmoduleCodec=0; + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) { + hmoduleCodec = (HMODULE) hinstDLL; + return TRUE; +} diff --git a/src/libs/zmbv/resource.h b/src/libs/zmbv/resource.h new file mode 100644 index 00000000..f4830af1 --- /dev/null +++ b/src/libs/zmbv/resource.h @@ -0,0 +1,21 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by zmbv_vfw.rc +// +#define IDD_ABOUT 101 +#define IDD_CONFIGURE 102 +#define IDC_HOMEPAGE 1000 +#define IDC_EMAIL 1001 +#define IDC_SLIDER1 1008 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1009 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/src/libs/zmbv/zmbv.cpp b/src/libs/zmbv/zmbv.cpp new file mode 100644 index 00000000..b697934c --- /dev/null +++ b/src/libs/zmbv/zmbv.cpp @@ -0,0 +1,516 @@ +/* + * Copyright (C) 2002-2005 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include + +#include "zmbv.h" + +#define DBZV_VERSION_HIGH 0 +#define DBZV_VERSION_LOW 1 + +#define COMPRESSION_NONE 0 +#define COMPRESSION_ZLIB 1 + +#define MAX_VECTOR 16 + +#define Mask_KeyFrame 0x01 +#define Mask_DeltaPalette 0x02 + +zmbv_format_t BPPFormat( int bpp ) { + switch (bpp) { + case 8: + return ZMBV_FORMAT_8BPP; + case 15: + return ZMBV_FORMAT_15BPP; + case 16: + return ZMBV_FORMAT_16BPP; + case 32: + return ZMBV_FORMAT_32BPP; + } + return ZMBV_FORMAT_NONE; +} +int VideoCodec::NeededSize( int _width, int _height, zmbv_format_t _format) { + int f; + switch (_format) { + case ZMBV_FORMAT_8BPP:f = 1;break; + case ZMBV_FORMAT_15BPP:f = 2;break; + case ZMBV_FORMAT_16BPP:f = 2;break; + case ZMBV_FORMAT_32BPP:f = 4;break; + default: + return -1; + } + f = f*_width*_height + 2*(1+(_width/8)) * (1+(_height/8))+1024; + return f + f/1000; +} + +bool VideoCodec::SetupBuffers(zmbv_format_t _format, int blockwidth, int blockheight) { + FreeBuffers(); + palsize = 0; + switch (_format) { + case ZMBV_FORMAT_8BPP: + pixelsize = 1; + palsize = 256; + break; + case ZMBV_FORMAT_15BPP: + pixelsize = 2; + break; + case ZMBV_FORMAT_16BPP: + pixelsize = 2; + break; + case ZMBV_FORMAT_32BPP: + pixelsize = 4; + break; + default: + return false; + }; + bufsize = (height+2*MAX_VECTOR)*pitch*pixelsize+2048; + + buf1 = new unsigned char[bufsize]; + buf2 = new unsigned char[bufsize]; + work = new unsigned char[bufsize]; + + int xblocks = (width/blockwidth); + int xleft = width % blockwidth; + if (xleft) xblocks++; + int yblocks = (height/blockheight); + int yleft = height % blockheight; + if (yleft) yblocks++; + blockcount=yblocks*xblocks; + blocks=new FrameBlock[blockcount]; + + if (!buf1 || !buf2 || !work || !blocks) { + FreeBuffers(); + return false; + } + int y,x,i; + i=0; + for (y=0;y +INLINE int VideoCodec::PossibleBlock(int vx,int vy,FrameBlock * block) { + int ret=0; + P * pold=((P*)oldframe)+block->start+(vy*pitch)+vx; + P * pnew=((P*)newframe)+block->start;; + for (int y=0;ydy;y+=4) { + for (int x=0;xdx;x+=4) { + int test=0-((pold[x]-pnew[x])&0x00ffffff); + ret-=(test>>31); + } + pold+=pitch*4; + pnew+=pitch*4; + } + return ret; +} + +template +INLINE int VideoCodec::CompareBlock(int vx,int vy,FrameBlock * block) { + int ret=0; + P * pold=((P*)oldframe)+block->start+(vy*pitch)+vx; + P * pnew=((P*)newframe)+block->start;; + for (int y=0;ydy;y++) { + for (int x=0;xdx;x++) { + int test=0-((pold[x]-pnew[x])&0x00ffffff); + ret-=(test>>31); + } + pold+=pitch; + pnew+=pitch; + } + return ret; +} + +template +INLINE void VideoCodec::AddXorBlock(int vx,int vy,FrameBlock * block) { + P * pold=((P*)oldframe)+block->start+(vy*pitch)+vx; + P * pnew=((P*)newframe)+block->start; + for (int y=0;ydy;y++) { + for (int x=0;xdx;x++) { + *((P*)&work[workUsed])=pnew[x] ^ pold[x]; + workUsed+=sizeof(P); + } + pold+=pitch; + pnew+=pitch; + } +} + +template +void VideoCodec::AddXorFrame(void) { + int written=0; + int lastvector=0; + signed char * vectors=(signed char*)&work[workUsed]; + /* Align the following xor data on 4 byte boundary*/ + workUsed=(workUsed + blockcount*2 +3) & ~3; + int totalx=0; + int totaly=0; + for (int b=0;b(0,0, block); + int possibles=64; + for (int v=0;v(vx, vy, block) < 4) { + possibles--; +// if (!possibles) Msg("Ran out of possibles, at %d of %d best %d\n",v,VectorCount,bestchange); + int testchange=CompareBlock

(vx,vy, block); + if (testchange(bestvx, bestvy, block); + } + } +} + +bool VideoCodec::SetupCompress( int _width, int _height ) { + width = _width; + height = _height; + pitch = _width + 2*MAX_VECTOR; + format = ZMBV_FORMAT_NONE; + if (deflateInit (&zstream, 4) != Z_OK) + return false; + return true; +} + +bool VideoCodec::SetupDecompress( int _width, int _height) { + width = _width; + height = _height; + pitch = _width + 2*MAX_VECTOR; + format = ZMBV_FORMAT_NONE; + if (inflateInit (&zstream) != Z_OK) + return false; + return true; +} + +bool VideoCodec::PrepareCompressFrame(int flags, zmbv_format_t _format, char * pal, void *writeBuf, int writeSize) { + int i; + unsigned char *firstByte; + + if (_format != format) { + if (!SetupBuffers( _format, 16, 16)) + return false; + flags|=1; //Force a keyframe + } + /* replace oldframe with new frame */ + unsigned char *copyFrame = newframe; + newframe = oldframe; + oldframe = copyFrame; + + compress.linesDone = 0; + compress.writeSize = writeSize; + compress.writeDone = 1; + compress.writeBuf = (unsigned char *)writeBuf; + /* Set a pointer to the first byte which will contain info about this frame */ + firstByte = compress.writeBuf; + *firstByte = 0; + //Reset the work buffer + workUsed = 0;workPos = 0; + if (flags & 1) { + /* Make a keyframe */ + *firstByte |= Mask_KeyFrame; + KeyframeHeader * header = (KeyframeHeader *)(compress.writeBuf + compress.writeDone); + header->high_version = DBZV_VERSION_HIGH; + header->low_version = DBZV_VERSION_LOW; + header->compression = COMPRESSION_ZLIB; + header->format = format; + header->blockwidth = 16; + header->blockheight = 16; + compress.writeDone += sizeof(KeyframeHeader); + /* Copy the new frame directly over */ + if (palsize) { + if (pal) + memcpy(&palette, pal, sizeof(palette)); + else + memset(&palette,0, sizeof(palette)); + /* keyframes get the full palette */ + for (i=0;i(); + break; + case ZMBV_FORMAT_15BPP: + case ZMBV_FORMAT_16BPP: + AddXorFrame(); + break; + case ZMBV_FORMAT_32BPP: + AddXorFrame(); + break; + } + } + /* Create the actual frame with compression */ + zstream.next_in = (Bytef *)work; + zstream.avail_in = workUsed; + zstream.total_in = 0; + + zstream.next_out = (Bytef *)(compress.writeBuf + compress.writeDone); + zstream.avail_out = compress.writeSize - compress.writeDone; + zstream.total_out = 0; + int res = deflate(&zstream, Z_SYNC_FLUSH); + return compress.writeDone + zstream.total_out; +} + +template +INLINE void VideoCodec::UnXorBlock(int vx,int vy,FrameBlock * block) { + P * pold=((P*)oldframe)+block->start+(vy*pitch)+vx; + P * pnew=((P*)newframe)+block->start; + for (int y=0;ydy;y++) { + for (int x=0;xdx;x++) { + pnew[x]=pold[x]^*((P*)&work[workPos]); + workPos+=sizeof(P); + } + pold+=pitch; + pnew+=pitch; + } +} + +template +INLINE void VideoCodec::CopyBlock(int vx,int vy,FrameBlock * block) { + P * pold=((P*)oldframe)+block->start+(vy*pitch)+vx; + P * pnew=((P*)newframe)+block->start; + for (int y=0;ydy;y++) { + for (int x=0;xdx;x++) { + pnew[x]=pold[x]; + } + pold+=pitch; + pnew+=pitch; + } +} + +template +void VideoCodec::UnXorFrame(void) { + signed char * vectors=(signed char *)&work[workPos]; + workPos=(workPos + blockcount*2 + 3) & ~3; + for (int b=0;b> 1; + int vy = vectors[b*2+1] >> 1; + if (xor) UnXorBlock

(vx,vy,block); + else CopyBlock

(vx,vy,block); + } +} + +bool VideoCodec::DecompressFrame(void * framedata, int size) { + unsigned char *data=(unsigned char *)framedata; + unsigned char tag;int i; + + tag = *data++; + if (--size<=0) + return false; + if (tag & Mask_KeyFrame) { + KeyframeHeader * header = (KeyframeHeader *)data; + size -= sizeof(KeyframeHeader);data += sizeof(KeyframeHeader); + if (size<=0) + return false; + if (header->low_version != DBZV_VERSION_LOW || header->high_version != DBZV_VERSION_HIGH) + return false; + if (format != (zmbv_format_t)header->format && !SetupBuffers((zmbv_format_t)header->format, header->blockwidth, header->blockheight)) + return false; + inflateReset(&zstream); + } + zstream.next_in = (Bytef *)data; + zstream.avail_in = size; + zstream.total_in = 0; + + zstream.next_out = (Bytef *)work; + zstream.avail_out = bufsize; + zstream.total_out = 0; + int res = inflate(&zstream, Z_FINISH); + workUsed= zstream.total_out; + workPos = 0; + if (tag & Mask_KeyFrame) { + if (palsize) { + for (i=0;i(); + break; + case ZMBV_FORMAT_15BPP: + case ZMBV_FORMAT_16BPP: + UnXorFrame(); + break; + case ZMBV_FORMAT_32BPP: + UnXorFrame(); + break; + } + } + return true; +} + +void VideoCodec::Output_UpsideDown_24(void *output) { + int i; + unsigned char *r; + unsigned char *w = (unsigned char *)output; + for (i=height-1;i>=0;i--) { + r = newframe + pixelsize*(MAX_VECTOR+(i+MAX_VECTOR)*pitch); + for (int j=0;j + void AddXorFrame(void); + template + void UnXorFrame(void); + template + INLINE int PossibleBlock(int vx,int vy,FrameBlock * block); + template + INLINE int CompareBlock(int vx,int vy,FrameBlock * block); + template + INLINE void AddXorBlock(int vx,int vy,FrameBlock * block); + template + INLINE void UnXorBlock(int vx,int vy,FrameBlock * block); + template + INLINE void CopyBlock(int vx, int vy,FrameBlock * block); +public: + VideoCodec(); + bool SetupCompress( int _width, int _height); + bool SetupDecompress( int _width, int _height); + zmbv_format_t BPPFormat( int bpp ); + int NeededSize( int _width, int _height, zmbv_format_t _format); + + void CompressLines(int lineCount, void *lineData[]); + bool PrepareCompressFrame(int flags, zmbv_format_t _format, char * pal, void *writeBuf, int writeSize); + int FinishCompressFrame( void ); + bool DecompressFrame(void * framedata, int size); + void Output_UpsideDown_24(void * output); +}; diff --git a/src/libs/zmbv/zmbv.inf b/src/libs/zmbv/zmbv.inf new file mode 100644 index 00000000..d1b81c98 --- /dev/null +++ b/src/libs/zmbv/zmbv.inf @@ -0,0 +1,54 @@ +; +; Zip Motion Block Video AVI codec +; +; Copyright (c) 2000 Ben Rudiak-Gould +; +; This Windows 9x Installation INF File by Rainbow Software +; +[version] +signature="$CHICAGO$" + +[DefaultInstall] +CopyFiles=ZMBV.Files.Inf,ZMBV.Files.Dll +AddReg=ZMBV.Reg +UpdateInis=ZMBV.INIs + +[DefaultUnInstall] +DelFiles=ZMBV.Files.Dll,ZMBV.Files.Inf,ZMBV.Files.Ini +DelReg=ZMBV.Reg +UpdateInis=ZMBV.INIs.Del + +[SourceDisksNames] +1="Zip Motion Block Video codec","",1 + +[SourceDisksFiles] +ZMBV.INF=1 + +[DestinationDirs] +ZMBV.Files.Inf=17 +ZMBV.Files.Dll=11 +ZMBV.Files.Ini=25 + +[ZMBV.Files.Inf] +zmbv.inf + +[ZMBV.Files.Dll] +zmbv.dll + +[ZMBV.Files.Ini] +zmbv.ini + +[ZMBV.Reg] +HKLM,SYSTEM\CurrentControlSet\Control\MediaResources\icm\VIDC.ZMBV,Description,,"Zip Motion Block Video [ZMBV]" +HKLM,SYSTEM\CurrentControlSet\Control\MediaResources\icm\VIDC.ZMBV,Driver,,"zmbv.dll" +HKLM,SYSTEM\CurrentControlSet\Control\MediaResources\icm\VIDC.ZMBV,FriendlyName,,"Zip Motion Block Video [ZMBV]" + +HKLM,Software\Microsoft\Windows\CurrentVersion\Uninstall\ZMBV +HKLM,Software\Microsoft\Windows\CurrentVersion\Uninstall\ZMBV,DisplayName,,"Zip Motion Block Video codec (Remove Only)" +HKLM,Software\Microsoft\Windows\CurrentVersion\Uninstall\ZMBV,UninstallString,,"rundll.exe setupx.dll,InstallHinfSection DefaultUninstall 132 %17%\ZMBV.INF" + +[ZMBV.INIs] +system.ini, drivers32,, "VIDC.ZMBV=zmbv.dll" + +[ZMBV.INIs.Del] +system.ini, drivers32, "VIDC.ZMBV=zmbv.dll" \ No newline at end of file diff --git a/src/libs/zmbv/zmbv.sln b/src/libs/zmbv/zmbv.sln new file mode 100644 index 00000000..aea19d7c --- /dev/null +++ b/src/libs/zmbv/zmbv.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zmbv", "zmbv.vcproj", "{619CF3F9-C373-4BD5-93DA-025F5E16F8FA}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {619CF3F9-C373-4BD5-93DA-025F5E16F8FA}.Debug.ActiveCfg = Debug|Win32 + {619CF3F9-C373-4BD5-93DA-025F5E16F8FA}.Debug.Build.0 = Debug|Win32 + {619CF3F9-C373-4BD5-93DA-025F5E16F8FA}.Release.ActiveCfg = Release|Win32 + {619CF3F9-C373-4BD5-93DA-025F5E16F8FA}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/src/libs/zmbv/zmbv.vcproj b/src/libs/zmbv/zmbv.vcproj new file mode 100644 index 00000000..ce973b86 --- /dev/null +++ b/src/libs/zmbv/zmbv.vcproj @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/zmbv/zmbv_vfw.h b/src/libs/zmbv/zmbv_vfw.h new file mode 100644 index 00000000..9f50656b --- /dev/null +++ b/src/libs/zmbv/zmbv_vfw.h @@ -0,0 +1,61 @@ +// +// Huffyuv v2.1.1, by Ben Rudiak-Gould. +// http://www.math.berkeley.edu/~benrg/huffyuv.html +// +// This file is copyright 2000 Ben Rudiak-Gould, and distributed under +// the terms of the GNU General Public License, v2 or later. See +// http://www.gnu.org/copyleft/gpl.html. +// +// I edit these files in 10-point Verdana, a proportionally-spaced font. +// You may notice formatting oddities if you use a monospaced font. +// + + +#include +#include +#include +#include "zmbv.h" +#pragma hdrstop + +extern HMODULE hmoduleCodec; + + +// huffyuv.cpp + +class CodecInst { +private: + VideoCodec * codec; +public: + CodecInst(); + ~CodecInst(); + + BOOL QueryAbout(); + DWORD About(HWND hwnd); + + BOOL QueryConfigure(); + DWORD Configure(HWND hwnd); + + DWORD GetState(LPVOID pv, DWORD dwSize); + DWORD SetState(LPVOID pv, DWORD dwSize); + + DWORD GetInfo(ICINFO* icinfo, DWORD dwSize); + + DWORD CompressQuery(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); + DWORD CompressGetFormat(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); + DWORD CompressBegin(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); + DWORD CompressGetSize(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); + DWORD Compress(ICCOMPRESS* icinfo, DWORD dwSize); + DWORD CompressEnd(); + + DWORD DecompressQuery(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); + DWORD DecompressGetFormat(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); + DWORD DecompressBegin(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); + + DWORD Decompress(ICDECOMPRESS* icinfo, DWORD dwSize); + DWORD DecompressGetPalette(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); + DWORD DecompressEnd(); +}; + +CodecInst* Open(ICOPEN* icinfo); +DWORD Close(CodecInst* pinst); + diff --git a/src/libs/zmbv/zmbv_vfw.rc b/src/libs/zmbv/zmbv_vfw.rc new file mode 100644 index 00000000..6678d1a5 --- /dev/null +++ b/src/libs/zmbv/zmbv_vfw.rc @@ -0,0 +1,123 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUT DIALOGEX 0, 0, 167, 55 +STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "DOSBox Video Codec v0.1" +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + DEFPUSHBUTTON "OK",IDOK,131,34,29,14 + CTEXT "Zipped Motion Block Video v 0.1\nCopyright 2005, DOSBox Team", + IDC_STATIC,7,7,153,25,SS_NOPREFIX + PUSHBUTTON "Email author",IDC_EMAIL,7,34,50,14 + PUSHBUTTON "Visit home page",IDC_HOMEPAGE,59,34,58,14 +END + +IDD_CONFIGURE DIALOGEX 0, 0, 213, 146 +STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "ZMBV configuration dialog" +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + PUSHBUTTON "Email author",IDC_EMAIL,44,86,50,14 + PUSHBUTTON "Visit home page",IDC_HOMEPAGE,109,87,58,14 + DEFPUSHBUTTON "OK",IDOK,44,125,50,14 + PUSHBUTTON "Cancel",IDCANCEL,117,125,50,14 + CONTROL "",IDC_SLIDER1,"msctls_trackbar32",TBS_BOTH | + TBS_NOTICKS | WS_TABSTOP,57,30,92,18 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 160 + TOPMARGIN, 7 + BOTTOMMARGIN, 48 + END + + IDD_CONFIGURE, DIALOG + BEGIN + LEFTMARGIN, 44 + RIGHTMARGIN, 167 + TOPMARGIN, 6 + BOTTOMMARGIN, 139 + END +END +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED +