Initial community commit

This commit is contained in:
Jef 2024-09-24 14:54:57 +02:00
parent 537bcbc862
commit fc06254474
16440 changed files with 4239995 additions and 2 deletions

View file

@ -0,0 +1,101 @@
/****************************************************************************
*
* Module Title : Codec_common.h
*
* Description : Common codec definitions header file.
*
****************************************************************************/
#ifndef __INC_COMCODEC_H
#define __INC_COMCODEC_H
/****************************************************************************
* Include Files
****************************************************************************/
#include <string.h>
#include "type_aliases.h"
/****************************************************************************
* Macros
****************************************************************************/
// Platform Specific Inlines
#ifdef _MSC_VER
#ifndef INLINE
#define INLINE __inline
#endif
#ifndef FORCEINLINE
#define FORCEINLINE __forceinline
#endif
#else
#ifndef INLINE
#define INLINE inline
#endif
#ifndef FORCEINLINE
#define FORCEINLINE inline
#endif
#endif
// Platform specific math function defines
#define LIMIT(x) ( (x)<0 ? 0: (x)>255 ? 255: (x) )
/****************************************************************************
* Module constants.
****************************************************************************/
#define BASE_FRAME 0
#define NORMAL_FRAME 1
#define Q_TABLE_SIZE 64
#define BLOCK_HEIGHT_WIDTH 8
#define BLOCK_SIZE (BLOCK_HEIGHT_WIDTH * BLOCK_HEIGHT_WIDTH)
/****************************************************************************
* Types
****************************************************************************/
/* Type defining YUV data elements. */
typedef UINT8 YUV_BUFFER_ENTRY;
typedef UINT8 *YUV_BUFFER_ENTRY_PTR;
typedef struct CONFIG_TYPE
{
// The size of the surface we want to draw to
UINT32 VideoFrameWidth;
UINT32 VideoFrameHeight;
INT32 YStride;
INT32 UVStride;
// The number of horizontal and vertical blocks encoded
UINT32 HFragPixels;
UINT32 VFragPixels;
// The Intended Horizontal Scale
UINT32 HScale;
UINT32 HRatio;
// The Intended Vertical Scale
UINT32 VScale;
UINT32 VRatio;
// The way in which we intended
UINT32 ScalingMode;
// Interlaced (0) means no (1) means Yes
UINT32 Interlaced;
UINT32 ExpandedFrameWidth;
UINT32 ExpandedFrameHeight;
} CONFIG_TYPE;
typedef struct
{
INT16 x;
INT16 y;
} MOTION_VECTOR;
typedef MOTION_VECTOR COORDINATE;
typedef INT16 Q_LIST_ENTRY;
typedef Q_LIST_ENTRY Q_LIST[64];
#endif

View file

@ -0,0 +1,108 @@
/****************************************************************************
*
* Module Title : codec_common_if.H
*
* Description : Interface to video codec demo decompressor DLL
*
* AUTHOR : Paul Wilkins
*
*****************************************************************************
* Revision History
*
* 1.01 PGW 21/07/99 Added FR_INVALID_MODE_TOKEN.
* 1.00 PGW 14/06/99 Configuration baseline
*
*****************************************************************************
*/
#ifndef CODEC_COMMON_INTERFACE_H
#define CODEC_COMMON_INTERFACE_H
#define __export
#define _export
#define DllExport __declspec( dllexport )
#define DllImport __declspec( dllimport )
// Playback ERROR Codes.
#define NO_DECODER_ERROR 0
#define REMOTE_DECODER_ERROR -1
#define DFR_BAD_DCT_COEFF -100
#define DFR_ZERO_LENGTH_FRAME -101
#define DFR_FRAME_SIZE_INVALID -102
#define DFR_OUTPUT_BUFFER_OVERFLOW -103
#define DFR_INVALID_FRAME_HEADER -104
#define FR_INVALID_MODE_TOKEN -110
#define ETR_ALLOCATION_ERROR -200
#define ETR_INVALID_ROOT_PTR -201
#define SYNCH_ERROR -400
#define BUFFER_UNDERFLOW_ERROR -500
#define PB_IB_OVERFLOW_ERROR -501
// External error triggers
#define PB_HEADER_CHECKSUM_ERROR -601
#define PB_DATA_CHECKSUM_ERROR -602
// DCT Error Codes
#define DDCT_EXPANSION_ERROR -700
#define DDCT_INVALID_TOKEN_ERROR -701
// ExceptionErrors
#define GEN_EXCEPTIONS -800
#define EX_UNQUAL_ERROR -801
// Unrecoverable error codes
#define FATAL_PLAYBACK_ERROR -1000
#define GEN_ERROR_CREATING_CDC -1001
#define GEN_THREAD_CREATION_ERROR -1002
#define DFR_CREATE_BMP_FAILED -1003
// YUV buffer configuration structure
typedef struct
{
int YWidth;
int YHeight;
int YStride;
int UVWidth;
int UVHeight;
int UVStride;
char * YBuffer;
char * UBuffer;
char * VBuffer;
} YUV_BUFFER_CONFIG;
typedef enum
{
C_SET_KEY_FRAME,
C_SET_FIXED_Q,
C_SET_FIRSTPASS_FILE,
C_SET_EXPERIMENTAL_MIN,
C_SET_EXPERIMENTAL_MAX = C_SET_EXPERIMENTAL_MIN + 255,
C_SET_CHECKPROTECT,
C_SET_TESTMODE,
C_SET_INTERNAL_SIZE,
C_SET_RECOVERY_FRAME,
C_SET_REFERENCEFRAME,
C_SET_GOLDENFRAME
#ifndef VP50_COMP_INTERFACE
// Specialist test facilities.
// C_VCAP_PARAMS, // DO NOT USE FOR NOW WITH VFW CODEC
#endif
} C_SETTING;
typedef enum
{
MAINTAIN_ASPECT_RATIO = 0x0,
SCALE_TO_FIT = 0x1,
CENTER = 0x2,
OTHER = 0x3
} SCALE_MODE;
#endif

View file

@ -0,0 +1,75 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#ifndef _dxl_plugin_h
#define _dxl_plugin_h
#include "duck_dxl.h"
#if defined(__cplusplus)
extern "C" {
#endif
/* max number of algorithms to be supported at one time */
#define NUM_ALG 16
typedef void * DXL_HANDLE;
typedef unsigned int DXL_OBJECT_VERSION;
DXL_HANDLE
DXL_GetAlgorithmBasePtr(DXL_XIMAGE_HANDLE src);
unsigned char *
DXL_GetXImageCDataAddr(DXL_XIMAGE_HANDLE src);
typedef DXL_HANDLE (*CREATE_FUNC)(DXL_XIMAGE_HANDLE, unsigned char *);
typedef DXL_HANDLE (*RECREATE_FUNC)(DXL_XIMAGE_HANDLE,void *,int,int,int,int);
typedef int (*DESTROY_FUNC)(DXL_XIMAGE_HANDLE);
typedef int (*SEED_DATA_FUNC)(DXL_XIMAGE_HANDLE);
typedef int (*DX_FUNC)(DXL_XIMAGE_HANDLE, DXL_VSCREEN_HANDLE);
typedef void (*SET_PARAMETER_FUNC)(DXL_XIMAGE_HANDLE, int , unsigned int);
//typedef int (*SET_PARAMETER_FUNC)(DXL_XIMAGE_HANDLE, int , unsigned int);
typedef int (*GET_PARAMETER_FUNC)(DXL_XIMAGE_HANDLE, int , unsigned int);
typedef int (*SEND_VMSG_FUNC)(DXL_XIMAGE_HANDLE, void *, unsigned int);
int DXL_GetAlgHandle(unsigned int fourcc);
int DXL_RegisterXImage(CREATE_FUNC creator, unsigned int fourcc);
int DXL_RegisterXImageRecreate(DXL_XIMAGE_HANDLE src, RECREATE_FUNC thisFunc);
int DXL_RegisterXImageDestroy(DXL_XIMAGE_HANDLE src, DESTROY_FUNC thisFunc);
int DXL_RegisterXImageDx(DXL_XIMAGE_HANDLE src, DX_FUNC thisFunc);
int DXL_RegisterXImageSetParameter(DXL_XIMAGE_HANDLE src, SET_PARAMETER_FUNC thisFunc);
int DXL_RegisterXImageGetParameter(DXL_XIMAGE_HANDLE src, GET_PARAMETER_FUNC thisFunc);
int DXL_RegisterXImageSendVideoMessage(DXL_XIMAGE_HANDLE src, SEND_VMSG_FUNC thisFunc);
#define DXL_MKFOURCC( ch0, ch1, ch2, ch3 ) \
( (unsigned int)(unsigned char)(ch0) | ( (unsigned int)(unsigned char)(ch1) << 8 ) | \
( (unsigned int)(unsigned char)(ch2) << 16 ) | ( (unsigned int)(unsigned char)(ch3) << 24 ) )
#if defined(__cplusplus)
}
#endif
#endif

View file

@ -0,0 +1,151 @@
/****************************************************************************
*
* Module Title : postproc_if.h
*
* Description : Post-processor interface header file.
*
****************************************************************************/
#ifndef __INC_POSTPROC_IF_H
#define __INC_POSTPROC_IF_H
/****************************************************************************
* Header Files
****************************************************************************/
#include "codec_common.h"
#include "codec_common_interface.h"
/****************************************************************************
* Typedefs
****************************************************************************/
typedef struct POSTPROC_INSTANCE * POSTPROC_INST;
/****************************************************************************
* Imported Functions.
****************************************************************************/
extern void InitPostProcessing
(
UINT32 *DCQuantScaleV2p,
UINT32 *DCQuantScaleUVp,
UINT32 *DCQuantScaleV1p,
UINT32 Version
);
extern void DeInitPostProcessing ();
extern POSTPROC_INST CreatePostProcInstance
(
CONFIG_TYPE *ConfigurationInit // configuration to setup
);
extern void DeletePostProcInstance
(
POSTPROC_INST *pbi // postprocessor instance to delete
);
extern void SetPPInterlacedMode(POSTPROC_INST ppi, int Interlaced);
extern void SetDeInterlaceMode(POSTPROC_INST ppi, int DeInterlaceMode);
extern void SetAddNoiseMode(POSTPROC_INST ppi, int AddNoiseMode);
extern void ChangePostProcConfiguration
(
POSTPROC_INST pbi, // postprocessor instance to use
CONFIG_TYPE *Configuration // configuration to change to
);
extern void PostProcess
(
POSTPROC_INST pbi, // postprocessor instance to use
INT32 Vp3VersionNo, // version of frame
INT32 FrameType, // key or non key
INT32 PostProcessingLevel, // level of post processing to perform
INT32 FrameQIndex, // q index value used on passed in frame
UINT8 *LastFrameRecon, // reconstruction buffer : passed in
UINT8 *PostProcessBuffer, // postprocessing buffer : passed in
UINT8 *FragInfo, // blocks coded : passed in
UINT32 FragInfoElementSize, // size of each element
UINT32 FragInfoCodedMask // mask to get at whether fragment is coded
);
extern void (*ClampLevels)
(
POSTPROC_INST pbi,
INT32 BlackClamp, // number of values to clamp from 0
INT32 WhiteClamp, // number of values to clamp from 255
UINT8 *Src, // reconstruction buffer : passed in
UINT8 *Dst // postprocessing buffer : passed in
);
extern void LoopFilter
(
POSTPROC_INST pbi, // postprocessor instance to use
INT32 FrameQIndex, // q index value used on passed in frame
UINT8 *LastFrameRecon, // reconstruction buffer : passed in
UINT8 *PostProcessBuffer, // postprocessing buffer : passed in
UINT8 *FragInfo, // blocks coded : passed in
UINT32 FragInfoElementSize, // size of each element
UINT32 FragInfoCodedMask // mask to get at whether fragment is coded
);
extern void ApplyReconLoopFilter
(
POSTPROC_INST pbi, // postprocessor instance to use
INT32 FrameQIndex, // q index value used on passed in frame
UINT8 *LastFrameRecon, // reconstruction buffer : passed in
UINT8 *PostProcessBuffer, // postprocessing buffer : passed in
UINT8 *FragInfo, // blocks coded : passed in
UINT32 FragInfoElementSize, // size of each element
UINT32 FragInfoCodedMask // mask to get at whether fragment is coded
);
extern void ScaleOrCenter
(
POSTPROC_INST pbi, // postprocessor instance to use
UINT8 *FrameBuffer, // buffer to use passed in
YUV_BUFFER_CONFIG * YuvConfig // size you want to output buffer to
);
/****************************************************************************
* Exported Functions.
****************************************************************************/
extern void UpdateUMVBorder
(
POSTPROC_INST pbi,
UINT8 * DestReconPtr
);
extern void (*FilteringVert_12)
(
UINT32 QValue,
UINT8 * Src,
INT32 Pitch
);
extern void (*FilteringHoriz_12)
(
UINT32 QValue,
UINT8 * Src,
INT32 Pitch
);
extern void (*FilteringVert_8)
(
UINT32 QValue,
UINT8 * Src,
INT32 Pitch
);
extern void (*FilteringHoriz_8)
(
UINT32 QValue,
UINT8 * Src,
INT32 Pitch
);
extern void CopyFrame( POSTPROC_INST pbi, YUV_BUFFER_CONFIG *b, UINT8 *DestReconPtr);
/****************************************************************************
* Exported Data.
****************************************************************************/
extern UINT8 LimitVal_VP31[VAL_RANGE * 3];
#endif

View file

@ -0,0 +1,40 @@
/****************************************************************************
*
* Module Title : preproc.h
*
* Description : simple preprocessor
*
****************************************************************************/
#ifndef __INC_PREPROC_H
#define __INC_PREPROC_H
/****************************************************************************
* Header Files
****************************************************************************/
#include "duck_mem.h"
/****************************************************************************
* Types
****************************************************************************/
typedef struct
{
unsigned char* frameBuffer;
int frame;
unsigned int *fixedDivide;
unsigned char*frameBufferAlloc;
unsigned int *fixedDivideAlloc;
} PreProcInstance;
/****************************************************************************
* Functions.
****************************************************************************/
void DeletePreProc( PreProcInstance *ppi);
int InitPreProc( PreProcInstance *ppi, int FrameSize);
extern void spatialFilter_c( PreProcInstance *ppi,unsigned char *s,unsigned char *d,int width,int height,int pitch,int strength);
extern void (*tempFilter)( PreProcInstance *ppi,unsigned char *s,unsigned char *d,int bytes,int strength);
#endif

View file

@ -0,0 +1,64 @@
/****************************************************************************
*
* Module Title : preproc_if.h
*
* Description : Pre-processor interface header file.
*
****************************************************************************/
#ifndef __PREPROC_IF_H
#define __PREPROC_IF_H
/****************************************************************************
* Header Files
****************************************************************************/
#include "type_aliases.h"
/****************************************************************************
* Types
****************************************************************************/
typedef struct
{
UINT8 * Yuv0ptr;
UINT8 * Yuv1ptr;
UINT8 *FragInfo; // blocks coded : passed in
UINT32 FragInfoElementSize; // size of each element
UINT32 FragInfoCodedMask; // mask to get at whether fragment is coded
UINT32 * RegionIndex; // Gives pixel index for top left of each block
UINT32 VideoFrameHeight;
UINT32 VideoFrameWidth;
UINT8 HFragPixels;
UINT8 VFragPixels;
} SCAN_CONFIG_DATA;
typedef enum
{ SCP_FILTER_ON_OFF,
SCP_SET_SRF_OFFSET,
SCP_SET_EBO_ON_OFF,
SCP_SET_VCAP_LEVEL_OFFSET,
SCP_SET_SHOW_LOCAL
} SCP_SETTINGS;
typedef struct PP_INSTANCE * xPP_INST;
/****************************************************************************
* Module statics
****************************************************************************/
/* Controls whether Early break out is on or off in default case */
#define EARLY_BREAKOUT_DEFAULT TRUE
/****************************************************************************
* Functions
****************************************************************************/
extern void SetScanParam ( xPP_INST ppi, UINT32 ParamId, INT32 ParamValue );
extern UINT32 YUVAnalyseFrame ( xPP_INST ppi, UINT32 * KFIndicator );
extern xPP_INST CreatePPInstance ( void );
extern void DeletePPInstance ( xPP_INST * );
extern BOOL ScanYUVInit ( xPP_INST, SCAN_CONFIG_DATA *ScanConfigPtr );
#endif

View file

@ -0,0 +1,149 @@
/****************************************************************************
*
* Module Title : vputil_if.h
*
* Description : Codec utilities header file.
*
****************************************************************************/
#ifndef __VPUTIL_IF_H
#define __VPUTIL_IF_H
/****************************************************************************
* Header Files
****************************************************************************/
#include "codec_common_interface.h"
/****************************************************************************
* Exports
****************************************************************************/
extern void InitVPUtil ( void );
extern void (*ReconIntra)
(
INT16 *tmpBuffer,
UINT8 *ReconPtr,
UINT16 *ChangePtr,
UINT32 LineStep
);
extern void (*ReconInter)
(
INT16 * tmpBuffer,
UINT8 * ReconPtr,
UINT8 * RefPtr,
INT16 * ChangePtr,
UINT32 LineStep
);
extern void (*ReconInterHalfPixel2)
(
INT16 * tmpBuffer,
UINT8 * ReconPtr,
UINT8 * RefPtr1,
UINT8 * RefPtr2,
INT16 * ChangePtr,
UINT32 LineStep
);
extern void (*idct[65])
(
INT16 *InputData,
INT16 *QuantMatrix,
INT16 *OutputData
);
extern void (*idctc[65])
(
INT16 *InputData,
INT16 *QuantMatrix,
INT16 * OutputData
);
extern void (*ClearSysState) ( void );
extern void (*ReconBlock)
(
INT16 *SrcBlock,
INT16 *ReconRefPtr,
UINT8 *DestBlock,
UINT32 LineStep
);
extern void (*SubtractBlock)
(
UINT8 *SrcBlock,
INT16 *DestPtr,
UINT32 LineStep
);
extern void (*UnpackBlock)
(
UINT8 *ReconPtr,
INT16 *ReconRefPtr,
UINT32 ReconPixelsPerLine
);
extern void (*AverageBlock)
(
UINT8 *ReconPtr1,
UINT8 *ReconPtr2,
UINT16 *ReconRefPtr,
UINT32 ReconPixelsPerLine
);
extern void (*CopyBlock)
(
unsigned char *src,
unsigned char *dest,
unsigned int srcstride
);
extern void (*fdct_short)
(
INT16 * InputData,
INT16 * OutputData
);
extern void (*Copy12x12)
(
const unsigned char *src,
unsigned char *dest,
unsigned int srcstride,
unsigned int deststride
);
extern void (*FilterBlockBil_8)
(
UINT8 *ReconPtr1,
UINT8 *ReconPtr2,
UINT8 *ReconRefPtr,
UINT32 ReconPixelsPerLine,
INT32 ModX,
INT32 ModY
);
extern void (*FilterBlock)
(
UINT8 *ReconPtr1,
UINT8 *ReconPtr2,
UINT16 *ReconRefPtr,
UINT32 PixelsPerLine,
INT32 ModX,
INT32 ModY,
BOOL UseBicubic,
UINT8 BicubicAlpha
);
extern UINT32 (*FiltBlockBilGetSad)
(
UINT8 *SrcPtr,
INT32 SrcStride,
UINT8 *ReconPtr1,
UINT8 *ReconPtr2,
INT32 PixelsPerLine,
INT32 ModX,
INT32 ModY,
UINT32 BestSoFar
);
#endif