build: Stop building FAudio and jxrlib.

This commit is contained in:
Rémi Bernon
2022-01-19 11:29:54 +02:00
committed by Arkadiusz Hiler
parent 0f1f692c70
commit 0b729bded4
66 changed files with 1 additions and 37208 deletions
-3
View File
@@ -10,9 +10,6 @@
[submodule "fonts/liberation-fonts"]
path = fonts/liberation-fonts
url = https://github.com/liberationfonts/liberation-fonts
[submodule "FAudio"]
path = FAudio
url = https://github.com/FNA-XNA/FAudio
[submodule "gstreamer"]
path = gstreamer
url = https://gitlab.freedesktop.org/gstreamer/gstreamer.git
Submodule FAudio deleted from 0c352eb92d
+1 -27
View File
@@ -545,32 +545,6 @@ $(eval $(call rules-meson,gst_good,32))
$(eval $(call rules-meson,gst_good,64))
##
## FAudio
##
FAUDIO_CMAKE_ARGS = -DGSTREAMER=ON -DFORCE_ENABLE_DEBUGCONFIGURATION=ON -DLOG_ASSERTIONS=ON -DXNASONG=OFF
FAUDIO_DEPENDS = gst_orc gstreamer gst_base
$(eval $(call rules-source,faudio,$(SRCDIR)/FAudio))
$(eval $(call rules-cmake,faudio,32))
$(eval $(call rules-cmake,faudio,64))
##
## jxrlib
##
JXRLIB_CMAKE_ARGS64 = -DJXRLIB_INSTALL_LIB_DIR=lib64
JXRLIB_INCDIR32 = $(JXRLIB_DST32)/include/jxrlib
JXRLIB_INCDIR64 = $(JXRLIB_DST64)/include/jxrlib
$(eval $(call rules-source,jxrlib,$(SRCDIR)/jxrlib))
$(eval $(call rules-cmake,jxrlib,32))
$(eval $(call rules-cmake,jxrlib,64))
##
## Vulkan-Headers
##
@@ -700,7 +674,7 @@ WINE_CONFIGURE_ARGS = \
WINE_CONFIGURE_ARGS64 = --enable-win64
WINE_DEPENDS = gst_orc gstreamer gst_base faudio jxrlib
WINE_DEPENDS = gst_orc gstreamer gst_base
$(eval $(call rules-source,wine,$(SRCDIR)/wine))
$(eval $(call rules-autoconf,wine,32))
-135
View File
@@ -1,135 +0,0 @@
# Copyright Mathieu Malaterre <malat@debian.org>
# BSD (Same as jxrlib)
cmake_minimum_required(VERSION 2.8)
project(jxrlib C)
# Need shared libs for ABI
set(BUILD_SHARED_LIBS ON)
# helper macro to preserve original Makefile convention
macro(JXR_MAKE_OBJ SET_NAME)
foreach(src ${SRC_${SET_NAME}})
list(APPEND OBJ_${SET_NAME} ${DIR_${SET_NAME}}/${src})
endforeach()
endmacro()
include(TestBigEndian)
test_big_endian(ISBIGENDIAN)
if(ISBIGENDIAN)
set(DEF_ENDIAN _BIG__ENDIAN_)
endif()
set(DIR_SYS image/sys)
set(DIR_DEC image/decode)
set(DIR_ENC image/encode)
set(DIR_GLUE jxrgluelib)
set(DIR_TEST jxrtestlib)
set(DIR_EXEC jxrencoderdecoder)
if(NOT JXRLIB_INSTALL_BIN_DIR)
set(JXRLIB_INSTALL_BIN_DIR "bin")
endif()
if(NOT JXRLIB_INSTALL_LIB_DIR)
set(JXRLIB_INSTALL_LIB_DIR "lib")
endif()
if(NOT JXRLIB_INSTALL_INCLUDE_DIR)
set(JXRLIB_INSTALL_INCLUDE_DIR "include/jxrlib")
endif()
include_directories(
common/include
${DIR_SYS}
${DIR_GLUE}
${DIR_TEST}
)
# where is strlcpy ?
include(CheckSymbolExists)
check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY)
#set(CMAKE_REQUIRED_LIBRARIES bsd)
#CHECK_SYMBOL_EXISTS(strlcpy "string.h" HAVE_STRLCPY4)
# on linux, strlcpy is in -lbsd:
#if(NOT HAVE_STRLCPY)
# include(CheckLibraryExists)
# find_library(BSD_LIBRARY bsd)
# check_library_exists(bsd "strlcpy" ${BSD_LIBRARY} HAVE_STRLCPY_BSD)
#endif()
# JPEG-XR
set(SRC_SYS adapthuff.c image.c strcodec.c strPredQuant.c strTransform.c perfTimerANSI.c)
JXR_MAKE_OBJ(SYS)
set(SRC_DEC decode.c postprocess.c segdec.c strdec.c strInvTransform.c strPredQuantDec.c JXRTranscode.c)
JXR_MAKE_OBJ(DEC)
set(SRC_ENC encode.c segenc.c strenc.c strFwdTransform.c strPredQuantEnc.c)
JXR_MAKE_OBJ(ENC)
add_library(jpegxr ${OBJ_ENC} ${OBJ_DEC} ${OBJ_SYS})
set_property(TARGET jpegxr
PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN}
)
set_property(TARGET jpegxr PROPERTY LINK_INTERFACE_LIBRARIES "")
set_property(TARGET jpegxr PROPERTY COMPILE_FLAGS -w)
# VERSION/SOVERSION
set_property(TARGET jpegxr PROPERTY VERSION 1.1)
set_property(TARGET jpegxr PROPERTY SOVERSION 0)
install(TARGETS jpegxr
EXPORT JXRLibTargets
RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR} COMPONENT Applications
LIBRARY DESTINATION ${JXRLIB_INSTALL_LIB_DIR} COMPONENT Libraries
)
# JXR-GLUE
set(SRC_GLUE JXRGlue.c JXRMeta.c JXRGluePFC.c JXRGlueJxr.c)
JXR_MAKE_OBJ(GLUE)
set(SRC_TEST JXRTest.c JXRTestBmp.c JXRTestHdr.c JXRTestPnm.c JXRTestTif.c JXRTestYUV.c)
JXR_MAKE_OBJ(TEST)
add_library(jxrglue ${OBJ_GLUE} ${OBJ_TEST})
set_property(TARGET jxrglue
PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN}
)
#set_property(TARGET jxrglue PROPERTY LINK_INTERFACE_LIBRARIES "")
set_property(TARGET jxrglue PROPERTY COMPILE_FLAGS -w)
# VERSION/SOVERSION
set_property(TARGET jxrglue PROPERTY VERSION 1.1)
set_property(TARGET jxrglue PROPERTY SOVERSION 0)
install(TARGETS jxrglue
EXPORT JXRLibTargets
RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR} COMPONENT Applications
LIBRARY DESTINATION ${JXRLIB_INSTALL_LIB_DIR} COMPONENT Libraries
)
#if(HAVE_STRLCPY_BSD)
# target_link_libraries(jxrglue ${BSD_LIBRARY})
#endif()
#target_link_libraries(jxrglue m)
target_link_libraries(jxrglue PRIVATE jpegxr m)
# Enc app files
set(ENCAPP JxrEncApp)
add_executable(${ENCAPP} ${DIR_EXEC}/${ENCAPP}.c)
set_property(TARGET ${ENCAPP}
PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN}
)
#set_property(TARGET ${ENCAPP} PROPERTY COMPILE_FLAGS -w)
target_link_libraries(${ENCAPP} jxrglue) # jpegxr)
install(TARGETS ${ENCAPP} RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR})
# Dec app files
set(DECAPP JxrDecApp)
add_executable(${DECAPP} ${DIR_EXEC}/${DECAPP}.c)
set_property(TARGET ${DECAPP}
PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN}
)
set_property(TARGET ${DECAPP} PROPERTY COMPILE_FLAGS -w)
target_link_libraries(${DECAPP} jxrglue) # jpegxr)
install(TARGETS ${DECAPP} RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR})
# install rules
install(FILES jxrgluelib/JXRGlue.h jxrgluelib/JXRMeta.h jxrtestlib/JXRTest.h
image/sys/windowsmediaphoto.h
DESTINATION ${JXRLIB_INSTALL_INCLUDE_DIR} COMPONENT Headers
)
install(DIRECTORY common/include/ DESTINATION ${JXRLIB_INSTALL_INCLUDE_DIR}
FILES_MATCHING PATTERN "*.h"
)
-147
View File
@@ -1,147 +0,0 @@
##//*@@@+++@@@@******************************************************************
##//
##// Copyright © Microsoft Corp.
##// All rights reserved.
##//
##// Redistribution and use in source and binary forms, with or without
##// modification, are permitted provided that the following conditions are met:
##//
##// • Redistributions of source code must retain the above copyright notice,
##// this list of conditions and the following disclaimer.
##// • Redistributions in binary form must reproduce the above copyright notice,
##// this list of conditions and the following disclaimer in the documentation
##// and/or other materials provided with the distribution.
##//
##// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
##// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
##// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
##// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
##// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
##// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
##// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
##// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
##// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
##// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
##// POSSIBILITY OF SUCH DAMAGE.
##//
##//*@@@---@@@@******************************************************************
## Makefile for building JPEG XR Porting Kit
##
build: all
CC=cc
DIR_SYS=image/sys
DIR_DEC=image/decode
DIR_ENC=image/encode
DIR_GLUE=jxrgluelib
DIR_TEST=jxrtestlib
DIR_EXEC=jxrencoderdecoder
CFLAGS=-I. -Icommon/include -I$(DIR_SYS) -D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w -O
##
## Add following flag to CFLAGS above if target is a big endian machine
## -D_BIG__ENDIAN_
##
##--------------------------------
##
## Common files
##
OBJ_SYS=adapthuff.o image.o strcodec.o strPredQuant.o strTransform.o perfTimerANSI.o
$(OBJ_SYS):
$(CC) $(CFLAGS) -c $(DIR_SYS)/$*.c
##--------------------------------
##
## Decode files
##
OBJ_DEC=decode.o postprocess.o segdec.o strdec.o strInvTransform.o strPredQuantDec.o JXRTranscode.o
$(OBJ_DEC):
$(CC) $(CFLAGS) -c $(DIR_DEC)/$*.c
##--------------------------------
##
## Encode files
##
OBJ_ENC=encode.o segenc.o strenc.o strFwdTransform.o strPredQuantEnc.o
$(OBJ_ENC):
$(CC) $(CFLAGS) -c $(DIR_ENC)/$*.c
##--------------------------------
##
## JPEG XR library
##
libjpegxr.a: $(OBJ_ENC) $(OBJ_DEC) $(OBJ_SYS)
ar rvu $@ $(OBJ_ENC) $(OBJ_DEC) $(OBJ_SYS)
ranlib $@
##--------------------------------
##
## Glue files
##
OBJ_GLUE=JXRGlue.o JXRMeta.o JXRGluePFC.o JXRGlueJxr.o
$(OBJ_GLUE):
$(CC) $(CFLAGS) -I$(DIR_GLUE) -c $(DIR_GLUE)/$*.c
##--------------------------------
##
## Test files
##
OBJ_TEST=JXRTest.o JXRTestBmp.o JXRTestHdr.o JXRTestPnm.o JXRTestTif.o JXRTestYUV.o
$(OBJ_TEST):
$(CC) $(CFLAGS) -I$(DIR_GLUE) -I$(DIR_TEST) -c $(DIR_TEST)/$*.c
##--------------------------------
##
## JPEG XR Glue library
##
libjxrglue.a: $(OBJ_GLUE) $(OBJ_TEST)
ar rvu $@ $(OBJ_GLUE) $(OBJ_TEST)
ranlib $@
##--------------------------------
##
## Enc app files
##
LIBRARIES=libjxrglue.a libjpegxr.a
LIBS=-L. $(LIBRARIES) -lm
ENCAPP=JxrEncApp
$(ENCAPP): $(LIBRARIES)
$(CC) $(DIR_EXEC)/$(ENCAPP).c -o $(ENCAPP) $(CFLAGS) -I$(DIR_GLUE) -I$(DIR_TEST) $(LIBS)
##--------------------------------
##
## Dec app files
##
DECAPP=JxrDecApp
$(DECAPP): $(LIBRARIES)
$(CC) $(DIR_EXEC)/$(DECAPP).c -o $(DECAPP) $(CFLAGS) -I$(DIR_GLUE) -I$(DIR_TEST) $(LIBS)
##--------------------------------
##
## JPEG XR library
##
all: $(ENCAPP) $(DECAPP)
clean:
rm -rf *App *.o libj*.a
##
-230
View File
@@ -1,230 +0,0 @@
//+---------------------------------------------------------------------------
//
// Copyright © Microsoft Corp.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// • Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// • Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// File: guiddef.h
//
// Contents: GUID definition
//
//----------------------------------------------------------------------------
#ifndef GUID_DEFINED
#define GUID_DEFINED
#if defined(__midl)
typedef struct {
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
byte Data4[ 8 ];
} GUID;
#else
typedef struct _GUID {
#if defined(_WINDOWS_) || !__LP64__
unsigned long Data1;
#else
unsigned int Data1;
#endif
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[ 8 ];
} GUID;
#endif
#endif
#ifndef FAR
#if defined(_WIN32) || defined(__ANSI__)
#define FAR
#else
#define FAR _far
#endif
#endif
#ifndef DECLSPEC_SELECTANY
#if (_MSC_VER >= 1100)
#define DECLSPEC_SELECTANY __declspec(selectany)
#else
#define DECLSPEC_SELECTANY
#endif
#endif
#ifndef EXTERN_C
#ifdef __cplusplus
#define EXTERN_C extern "C"
#else
#define EXTERN_C extern
#endif
#endif
#ifdef DEFINE_GUID
#undef DEFINE_GUID
#endif
#ifdef INITGUID
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
const GUID DECLSPEC_SELECTANY name \
= { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
#else
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
EXTERN_C const GUID FAR name
#endif // INITGUID
#define DEFINE_OLEGUID(name, l, w1, w2) DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
#ifndef _GUIDDEF_H_
#define _GUIDDEF_H_
#ifndef __LPGUID_DEFINED__
#define __LPGUID_DEFINED__
typedef GUID *LPGUID;
#endif
#ifndef __LPCGUID_DEFINED__
#define __LPCGUID_DEFINED__
typedef const GUID *LPCGUID;
#endif
#ifndef __IID_DEFINED__
#define __IID_DEFINED__
typedef GUID IID;
typedef IID *LPIID;
#define IID_NULL GUID_NULL
#define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
typedef GUID CLSID;
typedef CLSID *LPCLSID;
#define CLSID_NULL GUID_NULL
#define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
typedef GUID FMTID;
typedef FMTID *LPFMTID;
#define FMTID_NULL GUID_NULL
#define IsEqualFMTID(rfmtid1, rfmtid2) IsEqualGUID(rfmtid1, rfmtid2)
#ifdef __midl_proxy
#define __MIDL_CONST
#else
#define __MIDL_CONST const
#endif
#ifndef _REFGUID_DEFINED
#define _REFGUID_DEFINED
#ifdef __cplusplus
#define REFGUID const GUID &
#else
#define REFGUID const GUID * __MIDL_CONST
#endif
#endif
#ifndef _REFIID_DEFINED
#define _REFIID_DEFINED
#ifdef __cplusplus
#define REFIID const IID &
#else
#define REFIID const IID * __MIDL_CONST
#endif
#endif
#ifndef _REFCLSID_DEFINED
#define _REFCLSID_DEFINED
#ifdef __cplusplus
#define REFCLSID const IID &
#else
#define REFCLSID const IID * __MIDL_CONST
#endif
#endif
#ifndef _REFFMTID_DEFINED
#define _REFFMTID_DEFINED
#ifdef __cplusplus
#define REFFMTID const IID &
#else
#define REFFMTID const IID * __MIDL_CONST
#endif
#endif
#endif // !__IID_DEFINED__
#if !defined (__midl)
#if !defined (_SYS_GUID_OPERATORS_)
#define _SYS_GUID_OPERATORS_
#include <string.h>
// Faster (but makes code fatter) inline version...use sparingly
#ifdef __cplusplus
__inline int InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2)
{
return (
((unsigned long *) &rguid1)[0] == ((unsigned long *) &rguid2)[0] &&
((unsigned long *) &rguid1)[1] == ((unsigned long *) &rguid2)[1] &&
((unsigned long *) &rguid1)[2] == ((unsigned long *) &rguid2)[2] &&
((unsigned long *) &rguid1)[3] == ((unsigned long *) &rguid2)[3]);
}
__inline int IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
{
return !memcmp(&rguid1, &rguid2, sizeof(GUID));
}
#else // ! __cplusplus
#define InlineIsEqualGUID(rguid1, rguid2) \
(((unsigned long *) rguid1)[0] == ((unsigned long *) rguid2)[0] && \
((unsigned long *) rguid1)[1] == ((unsigned long *) rguid2)[1] && \
((unsigned long *) rguid1)[2] == ((unsigned long *) rguid2)[2] && \
((unsigned long *) rguid1)[3] == ((unsigned long *) rguid2)[3])
#define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
#endif // __cplusplus
#ifdef __INLINE_ISEQUAL_GUID
#undef IsEqualGUID
#define IsEqualGUID(rguid1, rguid2) InlineIsEqualGUID(rguid1, rguid2)
#endif
// Same type, different name
#define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
#define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
#if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_
#define _SYS_GUID_OPERATOR_EQ_
// A couple of C++ helpers
#ifdef __cplusplus
__inline int operator==(REFGUID guidOne, REFGUID guidOther)
{
return IsEqualGUID(guidOne,guidOther);
}
__inline int operator!=(REFGUID guidOne, REFGUID guidOther)
{
return !(guidOne == guidOther);
}
#endif
#endif // _SYS_GUID_OPERATOR_EQ_
#endif // _SYS_GUID_OPERATORS_
#endif // __midl
#endif // _GUIDDEF_H_
File diff suppressed because it is too large Load Diff
-342
View File
@@ -1,342 +0,0 @@
//*@@@+++@@@@******************************************************************
//
// Copyright © Microsoft Corp.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// • Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// • Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//*@@@---@@@@******************************************************************
#ifndef _WMSPECSTRING_H_
#define _WMSPECSTRING_H_
#if (!defined UNDER_CE && !defined NO_WINDOWS && !defined SPECSTRINGS_H)
#define SPECSTRINGS_H
/*************************************************************************
* See specstrings_strict.h for documentation of all user visible macros.
*************************************************************************/
#if _MSC_VER
#pragma once
#endif
#include <wmsal.h>
#ifndef __SAL_H_FULL_VER
#define __SAL_H_FULL_VER 140050727
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* version specific fixes to bring sal.h upto date */
#if __SAL_H_FULL_VER <= 140050727
/* Missing from RTM sal.h */
#if !defined(__midl) && defined(_PREFAST_) && _MSC_VER >= 1000
#define __inexpressible_readableTo(size) __declspec("SAL_readableTo(inexpressibleCount('" SPECSTRINGIZE(size) "'))")
#define __inexpressible_writableTo(size) __declspec("SAL_writableTo(inexpressibleCount('" SPECSTRINGIZE(size) "'))")
#define __inner_bound __declspec("SAL_bound")
#define __inner_range(lb,ub) __declspec("SAL_range(" SPECSTRINGIZE(lb) "," SPECSTRINGIZE(ub) ")")
#define __inner_assume_bound_dec __inline __nothrow void __AssumeBoundInt(__post __inner_bound int i) {i;}
#define __inner_assume_bound(i) __AssumeBoundInt(i);
#define __inner_allocator __declspec("SAL_allocator")
#else
#define __inexpressible_readableTo(size)
#define __inexpressible_writableTo(size)
#define __inner_bound
#define __inner_range(lb,ub)
#define __inner_assume_bound_dec
#define __inner_assume_bound(i)
#define __inner_allocator
#endif
#define __xcount(size) __notnull __inexpressible_writableTo(size)
#define __in_xcount(size) __in __pre __inexpressible_readableTo(size)
#define __out_xcount(size) __xcount(size) __post __valid __refparam
#define __out_xcount_part(size,length) __out_xcount(size) __post __inexpressible_readableTo(length)
#define __out_xcount_full(size) __out_xcount_part(size,size)
#define __inout_xcount(size) __out_xcount(size) __pre __valid
#define __inout_xcount_part(size,length) __out_xcount_part(size,length) __pre __valid __pre __inexpressible_readableTo(length)
#define __inout_xcount_full(size) __inout_xcount_part(size,size)
#define __xcount_opt(size) __xcount(size) __exceptthat __maybenull
#define __in_xcount_opt(size) __in_xcount(size) __exceptthat __maybenull
#define __out_xcount_opt(size) __out_xcount(size) __exceptthat __maybenull
#define __out_xcount_part_opt(size,length) __out_xcount_part(size,length) __exceptthat __maybenull
#define __out_xcount_full_opt(size) __out_xcount_full(size) __exceptthat __maybenull
#define __inout_xcount_opt(size) __inout_xcount(size) __exceptthat __maybenull
#define __inout_xcount_part_opt(size,length) __inout_xcount_part(size,length) __exceptthat __maybenull
#define __inout_xcount_full_opt(size) __inout_xcount_full(size) __exceptthat __maybenull
#define __deref_xcount(size) __ecount(1) __post __elem_readableTo(1) __post __deref __notnull __post __deref __inexpressible_writableTo(size)
#define __deref_in __in __pre __deref __deref __readonly
#define __deref_in_ecount(size) __deref_in __pre __deref __elem_readableTo(size)
#define __deref_in_bcount(size) __deref_in __pre __deref __byte_readableTo(size)
#define __deref_in_xcount(size) __deref_in __pre __deref __inexpressible_readableTo(size)
#define __deref_out_xcount(size) __deref_xcount(size) __post __deref __valid __refparam
#define __deref_out_xcount_part(size,length) __deref_out_xcount(size) __post __deref __inexpressible_readableTo(length)
#define __deref_out_xcount_full(size) __deref_out_xcount_part(size,size)
#define __deref_out_xcount(size) __deref_xcount(size) __post __deref __valid __refparam
#define __inout_xcount_opt(size) __inout_xcount(size) __exceptthat __maybenull
#define __inout_xcount_part_opt(size,length) __inout_xcount_part(size,length) __exceptthat __maybenull
#define __inout_xcount_full_opt(size) __inout_xcount_full(size) __exceptthat __maybenull
#define __deref_xcount(size) __ecount(1) __post __elem_readableTo(1) __post __deref __notnull __post __deref __inexpressible_writableTo(size)
#define __deref_in __in __pre __deref __deref __readonly
#define __deref_in_ecount(size) __deref_in __pre __deref __elem_readableTo(size)
#define __deref_in_bcount(size) __deref_in __pre __deref __byte_readableTo(size)
#define __deref_in_xcount(size) __deref_in __pre __deref __inexpressible_readableTo(size)
#define __deref_out_xcount(size) __deref_xcount(size) __post __deref __valid __refparam
#define __deref_out_xcount_part(size,length) __deref_out_xcount(size) __post __deref __inexpressible_readableTo(length)
#define __deref_out_xcount_full(size) __deref_out_xcount_part(size,size)
#define __deref_out_xcount(size) __deref_xcount(size) __post __deref __valid __refparam
#define __deref_inout_xcount(size) __deref_inout __pre __deref __inexpressible_writableTo(size) __post __deref __inexpressible_writableTo(size)
#define __deref_inout_xcount_part(size,length) __deref_inout_xcount(size) __pre __deref __inexpressible_readableTo(length) __post __deref __inexpressible_readableTo(length)
#define __deref_inout_xcount_full(size) __deref_inout_xcount_part(size,size)
#define __deref_xcount_opt(size) __deref_xcount(size) __post __deref __exceptthat __maybenull
#define __deref_in_opt __deref_in __pre __deref __exceptthat __maybenull
#define __deref_in_ecount_opt(size) __deref_in_ecount(size) __pre __deref __exceptthat __maybenull
#define __deref_in_bcount_opt(size) __deref_in_bcount(size) __pre __deref __exceptthat __maybenull
#define __deref_in_xcount_opt(size) __deref_in_xcount(size) __pre __deref __exceptthat __maybenull
#define __deref_out_xcount_opt(size) __deref_out_xcount(size) __post __deref __exceptthat __maybenull
#define __deref_out_xcount_part_opt(size,length) __deref_out_xcount_part(size,length) __post __deref __exceptthat __maybenull
#define __deref_out_xcount_full_opt(size) __deref_out_xcount_full(size) __post __deref __exceptthat __maybenull
#define __deref_inout_xcount_opt(size) __deref_inout_xcount(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
#define __deref_inout_xcount_part_opt(size,length) __deref_inout_xcount_part(size,length) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
#define __deref_inout_xcount_full_opt(size) __deref_inout_xcount_full(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
#define __deref_opt_xcount(size) __deref_xcount(size) __exceptthat __maybenull
#define __deref_opt_in __deref_in __exceptthat __maybenull
#define __deref_opt_in_ecount(size) __deref_in_ecount(size) __exceptthat __maybenull
#define __deref_opt_in_bcount(size) __deref_in_bcount(size) __exceptthat __maybenull
#define __deref_opt_in_xcount(size) __deref_in_xcount(size) __exceptthat __maybenull
#define __deref_opt_out_xcount(size) __deref_out_xcount(size) __exceptthat __maybenull
#define __deref_opt_out_xcount_part(size,length) __deref_out_xcount_part(size,length) __exceptthat __maybenull
#define __deref_opt_out_xcount_full(size) __deref_out_xcount_full(size) __exceptthat __maybenull
#define __deref_opt_inout_xcount(size) __deref_inout_xcount(size) __exceptthat __maybenull
#define __deref_opt_inout_xcount_part(size,length) __deref_inout_xcount_part(size,length) __exceptthat __maybenull
#define __deref_opt_inout_xcount_full(size) __deref_inout_xcount_full(size) __exceptthat __maybenull
#define __deref_opt_xcount_opt(size) __deref_xcount_opt(size) __exceptthat __maybenull
#define __deref_opt_in_opt __deref_in_opt __exceptthat __maybenull
#define __deref_opt_in_ecount_opt(size) __deref_in_ecount_opt(size) __exceptthat __maybenull
#define __deref_opt_in_bcount_opt(size) __deref_in_bcount_opt(size) __exceptthat __maybenull
#define __deref_opt_in_xcount_opt(size) __deref_in_xcount_opt(size) __exceptthat __maybenull
#define __deref_opt_out_xcount_opt(size) __deref_out_xcount_opt(size) __exceptthat __maybenull
#define __deref_opt_out_xcount_part_opt(size,length) __deref_out_xcount_part_opt(size,length) __exceptthat __maybenull
#define __deref_opt_out_xcount_full_opt(size) __deref_out_xcount_full_opt(size) __exceptthat __maybenull
#define __deref_opt_inout_xcount_opt(size) __deref_inout_xcount_opt(size) __exceptthat __maybenull
#define __deref_opt_inout_xcount_part_opt(size,length) __deref_inout_xcount_part_opt(size,length) __exceptthat __maybenull
#define __deref_opt_inout_xcount_full_opt(size) __deref_inout_xcount_full_opt(size) __exceptthat __maybenull
/* Must protect redfinitions of macros to workaround rc.exe issues. */
#ifndef RC_INVOKED
#undef __nullnullterminated
#define __nullnullterminated __xcount("string terminated by two nulls")
#undef __checkReturn
#define __checkReturn __post __inner_checkReturn
#endif
#endif //__SAL_H_FULL_VER <= 140050727
/************************************************************************
New extensions to sal.h follow here.
*************************************************************************/
#if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_)
#define __file_parser(typ) __declspec("SAL_file_parser(function, " #typ ")")
#define __file_parser_class(typ) __declspec("SAL_file_parser(class, " #typ ")")
#define __file_parser_library(typ) extern int __declspec("SAL_file_parser(library, " #typ ")") __iSALFileParserLibrary##typ;
#define __source_code_content(typ) extern int __declspec("SAL_source_code_content(" #typ ")") __iSAL_Source_Code_Content##typ;
#define __class_code_content(typ) __declspec("SAL_class_code_content(" #typ ")")
#define __analysis_assert(e) __assume(e)
#define __analysis_hint(hint) __declspec("SAL_analysisHint(" #hint ")")
/* Internal defintions */
#define __inner_data_source(src_raw) __declspec("SAL_untrusted_data_source(" src_raw ")")
#define __inner_this_data_source(src_raw) __declspec("SAL_untrusted_data_source_this(" src_raw ")")
#define __inner_out_validated(typ_raw) __declspec("SAL_post") __declspec("SAL_validated(" typ_raw ")")
#define __inner_this_out_validated(typ_raw) __declspec("SAL_validated_this(" typ_raw ")")
#define __inner_assume_validated_dec __inline __nothrow void __AssumeValidated(__inner_out_validated("BY_DESIGN") const void *p) {p;}
#define __inner_assume_validated(p) __AssumeValidated(p)
#define __inner_transfer(formal) __declspec("SAL_transfer_adt_property_from(" SPECSTRINGIZE(formal) ")")
#define __inner_encoded __declspec("SAL_encoded")
#define __$adt_prop(adt,prop) __declspec("SAL_adt("#adt","#prop")")
#define __$adt_add_prop(adt,prop) __declspec("SAL_add_adt_property("#adt","#prop")")
#define __$adt_remove_prop(adt,prop) __declspec("SAL_remove_adt_property("#adt","#prop")")
#define __$adt_transfer_prop(arg) __declspec("SAL_transfer_adt_property_from("#arg")")
#define __$adt_type_props(typ) __declspec("SAL_post_type("#typ")")
#define __$volatile __declspec("SAL_volatile")
#define __$nonvolatile __declspec("SAL_nonvolatile")
#define __$possibly_notnulltermiated __declspec("SAL_RequiresZeroTermination(sometimes)")
#else
#define __file_parser(typ)
#define __file_parser_class(typ)
#define __file_parser_library(typ)
#define __source_code_content(typ)
#define __class_code_content(typ)
#define __analysis_assert(e)
#define __analysis_hint(hint)
/* Internal defintions */
#define __inner_data_source(src_raw)
#define __inner_this_data_source(src_raw)
#define __inner_out_validated(typ_raw)
#define __inner_this_out_validated(typ_raw)
#define __inner_assume_validated_dec
#define __inner_assume_validated(p)
#define __inner_transfer(formal)
#define __inner_encoded
#define __$adt_prop(adt,prop)
#define __$adt_add_prop(adt,prop)
#define __$adt_remove_prop(adt,prop)
#define __$adt_transfer_prop(arg)
#define __$adt_type_props(typ)
#define __$volatile
#define __$nonvolatile
#define __$possibly_notnulltermiated
#endif // #if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_)
#define __field_ecount(size) __notnull __elem_writableTo(size)
#define __field_bcount(size) __notnull __byte_writableTo(size)
#define __field_xcount(size) __notnull __inexpressible_writableTo(size)
#define __field_ecount_opt(size) __maybenull __elem_writableTo(size)
#define __field_bcount_opt(size) __maybenull __byte_writableTo(size)
#define __field_xcount_opt(size) __maybenull __inexpressible_writableTo(size)
#define __field_ecount_part(size,init) __notnull __elem_writableTo(size) __elem_readableTo(init)
#define __field_bcount_part(size,init) __notnull __byte_writableTo(size) __byte_readableTo(init)
#define __field_xcount_part(size,init) __notnull __inexpressible_writableTo(size) __inexpressible_readableTo(init)
#define __field_ecount_part_opt(size,init) __maybenull __elem_writableTo(size) __elem_readableTo(init)
#define __field_bcount_part_opt(size,init) __maybenull __byte_writableTo(size) __byte_readableTo(init)
#define __field_xcount_part_opt(size,init) __maybenull __inexpressible_writableTo(size) __inexpressible_readableTo(init)
#define __field_ecount_full(size) __field_ecount_part(size,size)
#define __field_bcount_full(size) __field_bcount_part(size,size)
#define __field_xcount_full(size) __field_xcount_part(size,size)
#define __field_ecount_full_opt(size) __field_ecount_part_opt(size,size)
#define __field_bcount_full_opt(size) __field_bcount_part_opt(size,size)
#define __field_xcount_full_opt(size) __field_xcount_part_opt(size,size)
#define __struct_bcount(size) __field_bcount(size)
#define __struct_xcount(size) __field_xcount(size)
#if !defined(__out_awcount)
#define __out_awcount(expr,size) __pre __notnull \
__byte_writableTo((expr) ? (size) : (size) * 2) \
__post __valid __refparam
#endif
#if !defined(__in_awcount)
#define __in_awcount(expr,size) __pre __valid \
__pre __deref __readonly \
__byte_readableTo((expr) ? (size) : (size) * 2)
#endif
/* integer related macros */
#define __allocator __inner_allocator
#define __bound __inner_bound
#define __range(lb,ub) __inner_range(lb,ub)
#define __in_bound __pre __inner_bound
#define __out_bound __post __inner_bound
#define __deref_out_bound __post __deref __inner_bound
#define __in_range(lb,ub) __pre __inner_range(lb,ub)
#define __out_range(lb,ub) __post __inner_range(lb,ub)
#define __deref_in_range(lb,ub) __pre __deref __inner_range(lb,ub)
#define __deref_out_range(lb,ub) __post __deref __inner_range(lb,ub)
#define __field_range(lb,ub) __range(lb,ub)
#define __field_data_source(src_sym) __inner_data_source(#src_sym)
/* Pentraion review macros */
#define __in_data_source(src_sym) __pre __inner_data_source(#src_sym)
#define __out_data_source(src_sym) __post __inner_data_source(#src_sym)
#define __out_validated(typ_sym) __inner_out_validated(#typ_sym)
#define __this_out_data_source(src_sym) __inner_this_data_source(#src_sym)
#define __this_out_validated(typ_sym) __inner_this_out_validated(#typ_sym)
#define __transfer(formal) __post __inner_transfer(formal)
#define __rpc_entry __inner_control_entrypoint(RPC)
#define __kernel_entry __inner_control_entrypoint(UserToKernel)
#define __gdi_entry __inner_control_entrypoint(GDI)
#define __encoded_pointer __inner_encoded
#define __encoded_array __inner_encoded
#define __field_encoded_pointer __inner_encoded
#define __field_encoded_array __inner_encoded
#define __type_has_adt_prop(adt,prop) __$adt_prop(adt,prop)
#define __out_has_adt_prop(adt,prop) __post __$adt_add_prop(adt,prop)
#define __out_not_has_adt_prop(adt,prop) __post __$adt_remove_prop(adt,prop)
#define __out_transfer_adt_prop(arg) __post __$adt_transfer_prop(arg)
#define __out_has_type_adt_props(typ) __post __$adt_type_props(typ)
/* useful PFD related macros */
#define __possibly_notnulltermiated __post __$possibly_notnulltermiated
#if defined(_WINDOWS_)
/* Windows Internal */
#define __volatile __$volatile
#define __nonvolatile __$nonvolatile
#define __deref_volatile __deref __volatile
#define __deref_nonvolatile __deref __nonvolatile
#endif
/* declare stub functions for macros */
__inner_assume_validated_dec
__inner_assume_bound_dec
#define __assume_validated(p) __inner_assume_validated(p)
#define __assume_bound(i) __inner_assume_bound(i)
#ifdef __cplusplus
}
#endif
#include <wmspecstrings_adt.h>
#ifdef _PREFIX_
/**************************************************************************
* Defintion of __pfx_assume and __pfx_assert. Thse should be the only
* defintions of these functions.
***************************************************************************/
#if __cplusplus
extern "C" void __pfx_assert(bool, const char *);
extern "C" void __pfx_assume(bool, const char *);
#else
void __pfx_assert(int, const char *);
void __pfx_assume(int, const char *);
#endif
/**************************************************************************
* Redefintion of __analysis_assume and __analysis_assert for PREFIX build
**************************************************************************/
#undef __analysis_assume
#undef __analysis_assert
#define __analysis_assume(e) (__pfx_assume(e,"pfx_assume"),__assume(e));
#define __analysis_assert(e) (__pfx_assert(e,"pfx_assert"),__assume(e));
#endif /* ifdef _PREFIX_ */
/**************************************************************************
* This include should always be the last thing in this file.
* Must avoid redfinitions of macros to workaround rc.exe issues.
***************************************************************************/
#if !(defined(RC_INVOKED) || defined(SORTPP_PASS))
#include <wmspecstrings_strict.h>
#endif /* if !(defined(RC_INVOKED) || defined(SORTPP_PASS)) */
#endif /* #ifndef SPECSTRINGS_H */
// Some CE versions don't have specstrings.h, some have very old version without
// __specstrings defined. So we handle CE separately in wmasalce.h
#if defined(UNDER_CE) || defined(NO_WINDOWS)
#include "wmspecstringce.h"
#endif
#endif //_WMSPECSTRING_H_
-71
View File
@@ -1,71 +0,0 @@
//*@@@+++@@@@******************************************************************
//
// Copyright © Microsoft Corp.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// • Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// • Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//*@@@---@@@@******************************************************************
#pragma once
/*************************************************************************
* DEFINITIONS OF NEW TYPES
*************************************************************************/
#if !defined(__midl)
#define __$compname_props \
__type_has_adt_prop(compname,nullterminated) \
__type_has_adt_prop(compname,valid_schars) \
__type_has_adt_prop(compname,correct_len) \
__nullterminated
#if defined(UNICODE) || defined(_UNICODE)
#define __$TCHAR unsigned short
#else
#define __$TCHAR char
#endif
typedef __$compname_props char* ValidCompNameA;
typedef __$compname_props unsigned short* ValidCompNameW;
typedef __$compname_props const unsigned short* ConstValidCompNameW;
typedef __$compname_props __$TCHAR* SAL_ValidCompNameT;
typedef __$compname_props const __$TCHAR* SAL_ConstValidCompNameT;
#undef __$compname_props
#undef __$TCHAR
#endif
/*************************************************************************
* DEFINITIONS OF INLINE FUNCTIONS FOR CASTING TO THE NEW TYPES : USER
*************************************************************************/
#if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_)
#ifdef __cplusplus
extern "C" {
#endif
void __inline __nothrow __SAL_ValidCompNameA(__out_has_type_adt_props(ValidCompNameA) const void *expr) { expr;}
void __inline __nothrow __SAL_ValidCompNameW(__out_has_type_adt_props(ValidCompNameW) const void *expr) { expr;}
#ifdef __cplusplus
}
#endif
#define __assume_ValidCompNameA(expr) __SAL_ValidCompNameA(expr)
#define __assume_ValidCompNameW(expr) __SAL_ValidCompNameW(expr)
#else
#define __assume_ValidCompNameA(expr)
#define __assume_ValidCompNameW(expr)
#endif
File diff suppressed because it is too large Load Diff
-406
View File
@@ -1,406 +0,0 @@
//*@@@+++@@@@******************************************************************
//
// Copyright © Microsoft Corp.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// • Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// • Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//*@@@---@@@@******************************************************************
#undef __$adt_add_prop
#undef __$adt_prop
#undef __$adt_remove_prop
#undef __$adt_transfer_prop
#undef __$adt_type_props
#undef __$nonvolatile
#undef __$possibly_notnulltermiated
#undef __$volatile
#undef __allocator
#undef __analysis_assert
#undef __analysis_assume
#undef __analysis_hint
#undef __assume_ValidCompNameA
#undef __assume_ValidCompNameW
#undef __assume_bound
#undef __assume_validated
#undef __bcount
#undef __bcount_opt
#undef __blocksOn
#undef __bound
#undef __byte_readableTo
#undef __byte_writableTo
#undef __callback
#undef __checkReturn
#undef __class_code_content
#undef __control_entrypoint
#undef __data_entrypoint
#undef __deref
#undef __deref_bcount
#undef __deref_bcount_opt
#undef __deref_ecount
#undef __deref_ecount_opt
#undef __deref_in
#undef __deref_in_bcount
#undef __deref_in_bcount_opt
#undef __deref_in_ecount
#undef __deref_in_ecount_opt
#undef __deref_in_opt
#undef __deref_in_range
#undef __deref_in_xcount
#undef __deref_in_xcount_opt
#undef __deref_inout
#undef __deref_inout_bcount
#undef __deref_inout_bcount_full
#undef __deref_inout_bcount_full_opt
#undef __deref_inout_bcount_nz
#undef __deref_inout_bcount_nz_opt
#undef __deref_inout_bcount_opt
#undef __deref_inout_bcount_part
#undef __deref_inout_bcount_part_opt
#undef __deref_inout_bcount_z
#undef __deref_inout_bcount_z_opt
#undef __deref_inout_ecount
#undef __deref_inout_ecount_full
#undef __deref_inout_ecount_full_opt
#undef __deref_inout_ecount_nz
#undef __deref_inout_ecount_nz_opt
#undef __deref_inout_ecount_opt
#undef __deref_inout_ecount_part
#undef __deref_inout_ecount_part_opt
#undef __deref_inout_ecount_z
#undef __deref_inout_ecount_z_opt
#undef __deref_inout_nz
#undef __deref_inout_nz_opt
#undef __deref_inout_opt
#undef __deref_inout_xcount
#undef __deref_inout_xcount_full
#undef __deref_inout_xcount_full_opt
#undef __deref_inout_xcount_opt
#undef __deref_inout_xcount_part
#undef __deref_inout_xcount_part_opt
#undef __deref_inout_z
#undef __deref_inout_z_opt
#undef __deref_nonvolatile
#undef __deref_opt_bcount
#undef __deref_opt_bcount_opt
#undef __deref_opt_ecount
#undef __deref_opt_ecount_opt
#undef __deref_opt_in
#undef __deref_opt_in_bcount
#undef __deref_opt_in_bcount_opt
#undef __deref_opt_in_ecount
#undef __deref_opt_in_ecount_opt
#undef __deref_opt_in_opt
#undef __deref_opt_in_xcount
#undef __deref_opt_in_xcount_opt
#undef __deref_opt_inout
#undef __deref_opt_inout_bcount
#undef __deref_opt_inout_bcount_full
#undef __deref_opt_inout_bcount_full_opt
#undef __deref_opt_inout_bcount_nz
#undef __deref_opt_inout_bcount_nz_opt
#undef __deref_opt_inout_bcount_opt
#undef __deref_opt_inout_bcount_part
#undef __deref_opt_inout_bcount_part_opt
#undef __deref_opt_inout_bcount_z
#undef __deref_opt_inout_bcount_z_opt
#undef __deref_opt_inout_ecount
#undef __deref_opt_inout_ecount_full
#undef __deref_opt_inout_ecount_full_opt
#undef __deref_opt_inout_ecount_nz
#undef __deref_opt_inout_ecount_nz_opt
#undef __deref_opt_inout_ecount_opt
#undef __deref_opt_inout_ecount_part
#undef __deref_opt_inout_ecount_part_opt
#undef __deref_opt_inout_ecount_z
#undef __deref_opt_inout_ecount_z_opt
#undef __deref_opt_inout_nz
#undef __deref_opt_inout_nz_opt
#undef __deref_opt_inout_opt
#undef __deref_opt_inout_xcount
#undef __deref_opt_inout_xcount_full
#undef __deref_opt_inout_xcount_full_opt
#undef __deref_opt_inout_xcount_opt
#undef __deref_opt_inout_xcount_part
#undef __deref_opt_inout_xcount_part_opt
#undef __deref_opt_inout_z
#undef __deref_opt_inout_z_opt
#undef __deref_opt_out
#undef __deref_opt_out_bcount
#undef __deref_opt_out_bcount_full
#undef __deref_opt_out_bcount_full_opt
#undef __deref_opt_out_bcount_nz_opt
#undef __deref_opt_out_bcount_opt
#undef __deref_opt_out_bcount_part
#undef __deref_opt_out_bcount_part_opt
#undef __deref_opt_out_bcount_z_opt
#undef __deref_opt_out_ecount
#undef __deref_opt_out_ecount_full
#undef __deref_opt_out_ecount_full_opt
#undef __deref_opt_out_ecount_nz_opt
#undef __deref_opt_out_ecount_opt
#undef __deref_opt_out_ecount_part
#undef __deref_opt_out_ecount_part_opt
#undef __deref_opt_out_ecount_z_opt
#undef __deref_opt_out_nz_opt
#undef __deref_opt_out_opt
#undef __deref_opt_out_xcount
#undef __deref_opt_out_xcount_full
#undef __deref_opt_out_xcount_full_opt
#undef __deref_opt_out_xcount_opt
#undef __deref_opt_out_xcount_part
#undef __deref_opt_out_xcount_part_opt
#undef __deref_opt_out_z_opt
#undef __deref_opt_xcount
#undef __deref_opt_xcount_opt
#undef __deref_out
#undef __deref_out_bcount
#undef __deref_out_bcount_full
#undef __deref_out_bcount_full_opt
#undef __deref_out_bcount_nz
#undef __deref_out_bcount_nz_opt
#undef __deref_out_bcount_opt
#undef __deref_out_bcount_part
#undef __deref_out_bcount_part_opt
#undef __deref_out_bcount_z
#undef __deref_out_bcount_z_opt
#undef __deref_out_bound
#undef __deref_out_ecount
#undef __deref_out_ecount_full
#undef __deref_out_ecount_full_opt
#undef __deref_out_ecount_nz
#undef __deref_out_ecount_nz_opt
#undef __deref_out_ecount_opt
#undef __deref_out_ecount_part
#undef __deref_out_ecount_part_opt
#undef __deref_out_ecount_z
#undef __deref_out_ecount_z_opt
#undef __deref_out_nz
#undef __deref_out_nz_opt
#undef __deref_out_opt
#undef __deref_out_range
#undef __deref_out_range
#undef __deref_out_xcount
#undef __deref_out_xcount
#undef __deref_out_xcount_full
#undef __deref_out_xcount_full_opt
#undef __deref_out_xcount_opt
#undef __deref_out_xcount_part
#undef __deref_out_xcount_part_opt
#undef __deref_out_z
#undef __deref_out_z_opt
#undef __deref_volatile
#undef __deref_xcount
#undef __deref_xcount_opt
#undef __ecount
#undef __ecount_opt
#undef __elem_readableTo
#undef __elem_writableTo
#undef __encoded_array
#undef __encoded_pointer
#undef __exceptthat
#undef __fallthrough
#undef __field_bcount
#undef __field_bcount_full
#undef __field_bcount_full_opt
#undef __field_bcount_opt
#undef __field_bcount_part
#undef __field_bcount_part_opt
#undef __field_data_source
#undef __field_ecount
#undef __field_ecount_full
#undef __field_ecount_full_opt
#undef __field_ecount_opt
#undef __field_ecount_part
#undef __field_ecount_part_opt
#undef __field_encoded_array
#undef __field_encoded_pointer
#undef __field_range
#undef __field_xcount
#undef __field_xcount_full
#undef __field_xcount_full_opt
#undef __field_xcount_opt
#undef __field_xcount_part
#undef __field_xcount_part_opt
#undef __file_parser
#undef __file_parser_class
#undef __file_parser_library
#undef __format_string
#undef __format_string
#undef __gdi_entry
#undef __in
#undef __in_awcount
#undef __in_bcount
#undef __in_bcount_nz
#undef __in_bcount_nz_opt
#undef __in_bcount_opt
#undef __in_bcount_z
#undef __in_bcount_z_opt
#undef __in_bound
#undef __in_data_source
#undef __in_ecount
#undef __in_ecount_nz
#undef __in_ecount_nz_opt
#undef __in_ecount_opt
#undef __in_ecount_z
#undef __in_ecount_z_opt
#undef __in_nz
#undef __in_nz_opt
#undef __in_opt
#undef __in_range
#undef __in_xcount
#undef __in_xcount_opt
#undef __in_z
#undef __in_z_opt
#undef __inexpressible_readableTo
#undef __inexpressible_writableTo
#undef __inner_assume_bound
#undef __inner_assume_bound_dec
#undef __inner_assume_validated
#undef __inner_assume_validated_dec
#undef __inner_blocksOn
#undef __inner_bound
#undef __inner_callback
#undef __inner_checkReturn
#undef __inner_control_entrypoint
#undef __inner_data_entrypoint
#undef __inner_data_source
#undef __inner_encoded
#undef __inner_fallthrough
#undef __inner_fallthrough_dec
#undef __inner_out_validated
#undef __inner_override
#undef __inner_range
#undef __inner_success
#undef __inner_transfer
#undef __inner_typefix
#undef __inout
#undef __inout_bcount
#undef __inout_bcount_full
#undef __inout_bcount_full_opt
#undef __inout_bcount_nz
#undef __inout_bcount_nz_opt
#undef __inout_bcount_opt
#undef __inout_bcount_part
#undef __inout_bcount_part_opt
#undef __inout_bcount_z
#undef __inout_bcount_z_opt
#undef __inout_ecount
#undef __inout_ecount_full
#undef __inout_ecount_full_opt
#undef __inout_ecount_nz
#undef __inout_ecount_nz_opt
#undef __inout_ecount_opt
#undef __inout_ecount_part
#undef __inout_ecount_part_opt
#undef __inout_ecount_z
#undef __inout_ecount_z_opt
#undef __inout_ecount_z_opt
#undef __inout_nz
#undef __inout_nz_opt
#undef __inout_opt
#undef __inout_xcount
#undef __inout_xcount_full
#undef __inout_xcount_full_opt
#undef __inout_xcount_opt
#undef __inout_xcount_part
#undef __inout_xcount_part_opt
#undef __inout_z
#undef __inout_z_opt
#undef __kernel_entry
#undef __maybenull
#undef __maybereadonly
#undef __maybevalid
#undef __nonvolatile
#undef __notnull
#undef __notreadonly
#undef __notvalid
#undef __null
#undef __nullnullterminated
#undef __nullterminated
#undef __out
#undef __out_awcount
#undef __out_bcount
#undef __out_bcount_full
#undef __out_bcount_full_opt
#undef __out_bcount_nz
#undef __out_bcount_nz_opt
#undef __out_bcount_opt
#undef __out_bcount_part
#undef __out_bcount_part_opt
#undef __out_bcount_z
#undef __out_bcount_z_opt
#undef __out_bound
#undef __out_data_source
#undef __out_ecount
#undef __out_ecount_full
#undef __out_ecount_full_opt
#undef __out_ecount_nz
#undef __out_ecount_nz_opt
#undef __out_ecount_opt
#undef __out_ecount_part
#undef __out_ecount_part_opt
#undef __out_ecount_z
#undef __out_ecount_z_opt
#undef __out_has_adt_prop
#undef __out_has_type_adt_props
#undef __out_not_has_adt_prop
#undef __out_nz
#undef __out_nz_opt
#undef __out_opt
#undef __out_range
#undef __out_transfer_adt_prop
#undef __out_validated
#undef __out_xcount
#undef __out_xcount_full
#undef __out_xcount_full_opt
#undef __out_xcount_opt
#undef __out_xcount_part
#undef __out_xcount_part_opt
#undef __out_z
#undef __override
#undef __possibly_notnulltermiated
#undef __post
#undef __postcond
#undef __pre
#undef __precond
#undef __range
#undef __readableTo
#undef __readonly
#undef __refparam
#undef __reserved
#undef __rpc_entry
#undef __source_code_content
#undef __struct_bcount
#undef __struct_xcount
#undef __success
#undef __this_out_data_source
#undef __this_out_validated
#undef __transfer
#undef __type_has_adt_prop
#undef __typefix
#undef __valid
#undef __volatile
#undef __writableTo
#undef __xcount
#undef __xcount_opt
Binary file not shown.
-95
View File
@@ -1,95 +0,0 @@
JPEG XR Device Porting Kit v1.0 - April 2013
---------------------------------------------------------------------------------
JPEG XR
-------
This device porting kit (DPK) supports the JPEG XR still image format, based on
technology originally developed by Mirosoft under the name HD Photo (formerly
Windows Media™ Photo). The JPEG XR format is similar, but not identical, to the
HD Photo/Windows Media™ Photo format.
The JPEG XR format replaces the HD Photo/Windows Media™ Photo format in both
Windows 8 and the Windows Image Component (WIC). WIC accompanies the Internet
Explorer 10 redistributable packages for down-level versions of Windows.
Some “Windows Media™ Photo” (WMP) naming conventions are still used internally
with this release of the DPK.
JPEG XR files use the .jxr extension. Applications that support the JPEG XR
file format should recognize and decode HD Photo/Windows Media™ Photo
.hdp/.wdp files, but only offer to create files with the .jxr extension.
Device Porting Kit Contents
---------------------------
This device porting kit contains documentation, reference source code, sample
applications and utilities for the evaluation and implementation of the JPEG XR
file format and compression technology.
Assuming the installation dir is C:\jxrlib, all the paths mentioned below are
relative to this base path.
The Visual Studio 2010 main solution is:
jxrencoderdecoder\JXR.sln
The Visual Studio 2012 main solution is:
jxrencoderdecoder\JXR_vc11.sln
Build JXR.sln Debug Configuration, you will get:
jxrencoderdecoder\Debug\JXRDecApp\JXRDecApp.exe
jxrencoderdecoder\Debug\JXREncApp\JXREncApp.exe
The main directory contains a Unix/Linux compatible make file for building the
encoder and decoder, including support for big endian or little endian processor
architecture. It is the developer's responsibility to properly organize all the
source files according to the paths defined in this make file for its correct
operation. This is provided as a convenience for cross-platform developers and
to demonstrate the correct operation of the encoder and decoder on big endian
systems.
The JPEG XR Image Coding Spectification provides a detailed specification of the
compression encoder and decoder algorithms plus the detailed structure of the
compressed data (elementary) bit stream. This document is designed to be used in
conjunction with the included source code. If you find instances where the code
differs from the documentation, the code implementation should be used as the
reference.
The JPEG XR Image Coding Spectification is an international standard and is
available at: http://www.itu.int/rec/T-REC-T.832 while the reference software is
available at: http://www.itu.int/rec/T-REC-T.835.
"JPEGXR_DPK_1.0.doc" documents the contents of this porting kit, the usage of
the command line file conversion utilities (JXREncApp.exe and JXRDecApp.exe), and
technical details of the API's and data structures between these sample command
line applications and the core codec.
The code and documentation in this release represent the final design and
specification of the 1.0 bit stream, and can be used as the reference for final
implementations of encoders and decoders for JPEG XR.
This release of the DPK has received extensive testing of all the various pixel
formats, encoder options and modes of operation. We are confident that most errors
and other bugs have been resolved. Any code bugs, documentation errors or other
discrepancies found in this release candidate should be reported to Microsoft as
promptly as possible. These can be submitted to hdview@microsoft.com.
This DPK provides basic support for big endian architectures. We have
successfully tested the encoder and decoder using a big endian processor. This
support is provided as a starting reference to be adapted to the specific
platform and hardware architecture of the target system.
Contact Information
-------------------
For any and all technical questions or feedback about any part of this Device
Porting Kit, including the documentation, please send email to:
hdview@microsoft.com
We will respond as promptly as possible with answers to your questions.
Additional information, best practices, tools, utilities, sample code, sample
image content, links to additional resources and community discussion can
currently be found at http://hdview.wordpress.com/.
- The Microsoft JPEG XR Development Team
---------------------------------------------------------------------------------
File diff suppressed because it is too large Load Diff
-200
View File
@@ -1,200 +0,0 @@
//*@@@+++@@@@******************************************************************
//
// Copyright © Microsoft Corp.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// • Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// • Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//*@@@---@@@@******************************************************************
/******************************************************************************
Module Name:
decode.c
Abstract:
Defines the entry point for the console application.
Author:
Revision History:
*******************************************************************************/
#include "strcodec.h"
#include "decode.h"
#ifdef MEM_TRACE
#define TRACE_MALLOC 1
#define TRACE_NEW 0
#define TRACE_HEAP 0
#include "memtrace.h"
#endif
/******************************************************************
Free Adaptive Huffman Table
******************************************************************/
static Void CleanAH(CAdaptiveHuffman **ppAdHuff)
{
CAdaptiveHuffman *pAdHuff;
if (NULL != ppAdHuff) {
pAdHuff = *ppAdHuff;
if (NULL != pAdHuff) {
free(pAdHuff);
}
*ppAdHuff = NULL;
}
}
static Void CleanAHDec(CCodingContext * pSC)
{
Int kk;
for (kk = 0; kk < NUMVLCTABLES; kk++) {
CleanAH(&(pSC->m_pAHexpt[kk]));
}
CleanAH(&(pSC->m_pAdaptHuffCBPCY));
CleanAH(&(pSC->m_pAdaptHuffCBPCY1));
}
/*************************************************************************
Initialize an adaptive huffman table
*************************************************************************/
static Int InitializeAH(CAdaptiveHuffman **ppAdHuff, Int iSym)
{
Int iMemStatus = 0;
CAdaptiveHuffman *pAdHuff = Allocate(iSym, DECODER);
if (pAdHuff == NULL) {
iMemStatus = -1; // out of memory
goto ErrorExit;
}
//Adapt(pAdHuff, bFixedTables);
//InitHuffman(pAdHuff->m_pHuffman);
//if (ICERR_OK != initHuff(pAdHuff->m_pHuffman, 1, pAdHuff->m_pTable, NULL)) {
// goto ErrorExit;
//}
*ppAdHuff = pAdHuff;
return ICERR_OK;
ErrorExit:
if (pAdHuff) {
free(pAdHuff);
}
*ppAdHuff = NULL;
if (-1 == iMemStatus) {
printf("Insufficient memory to init decoder.\n");
}
return ICERR_ERROR;
}
/*************************************************************************
Context allocation
*************************************************************************/
Int AllocateCodingContextDec(CWMImageStrCodec *pSC, Int iNumContexts)
{
Int i, iCBPSize, k;
static const Int aAlphabet[] = {5,4,8,7,7, 12,6,6,12,6,6,7,7, 12,6,6,12,6,6,7,7};
if (iNumContexts > MAX_TILES || iNumContexts < 1) // only between 1 and MAX_TILES allowed
return ICERR_ERROR;
if (pSC == NULL)
return ICERR_ERROR;
pSC->m_pCodingContext = malloc (iNumContexts * sizeof (CCodingContext));
if (pSC->m_pCodingContext == NULL) {
pSC->cNumCodingContext = 0;
return ICERR_ERROR;
}
memset (pSC->m_pCodingContext, 0, iNumContexts * sizeof (CCodingContext));
pSC->cNumCodingContext = iNumContexts;
iCBPSize = (pSC->m_param.cfColorFormat == Y_ONLY || pSC->m_param.cfColorFormat == NCOMPONENT
|| pSC->m_param.cfColorFormat == CMYK) ? 5 : 9;
/** allocate / initialize members **/
for (i = 0; i < iNumContexts; i++) {
CCodingContext *pContext = &(pSC->m_pCodingContext[i]);
/** allocate adaptive Huffman encoder **/
if (InitializeAH(&pContext->m_pAdaptHuffCBPCY, iCBPSize) != ICERR_OK) {
return ICERR_ERROR;
}
if (InitializeAH(&pContext->m_pAdaptHuffCBPCY1, 5) != ICERR_OK) {
return ICERR_ERROR;
}
for(k = 0; k < NUMVLCTABLES; k ++){
if (InitializeAH(&pContext->m_pAHexpt[k], aAlphabet[k]) != ICERR_OK) {
return ICERR_ERROR;
}
}
ResetCodingContextDec(pContext);
}
return ICERR_OK;
}
/*************************************************************************
Context reset on encoder
*************************************************************************/
Void ResetCodingContextDec(CCodingContext *pContext)
{
Int k;
/** set flags **/
pContext->m_pAdaptHuffCBPCY->m_bInitialize = FALSE;
pContext->m_pAdaptHuffCBPCY1->m_bInitialize = FALSE;
for(k = 0; k < NUMVLCTABLES; k ++)
pContext->m_pAHexpt[k]->m_bInitialize = FALSE;
// reset VLC tables
AdaptLowpassDec (pContext);
AdaptHighpassDec (pContext);
// reset zigzag patterns, totals
InitZigzagScan(pContext);
// reset bit reduction and cbp models
ResetCodingContext(pContext);
}
/*************************************************************************
Context deletion
*************************************************************************/
Void FreeCodingContextDec(CWMImageStrCodec *pSC)
{
Int iContexts = (Int)(pSC->cNumCodingContext), i, k;
if (iContexts > 0 && pSC->m_pCodingContext) {
for (i = 0; i < iContexts; i++) {
CCodingContext *pContext = &(pSC->m_pCodingContext[i]);
CleanAH (&pContext->m_pAdaptHuffCBPCY);
CleanAH (&pContext->m_pAdaptHuffCBPCY1);
for (k = 0; k < NUMVLCTABLES; k++)
CleanAH (&pContext->m_pAHexpt[k]);
}
free (pSC->m_pCodingContext);
}
}
-143
View File
@@ -1,143 +0,0 @@
//*@@@+++@@@@******************************************************************
//
// Copyright © Microsoft Corp.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// • Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// • Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//*@@@---@@@@******************************************************************
#ifndef WMI_DECODE_H
#define WMI_DECODE_H
typedef struct CWMDecoderParameters {
/** ROI decode **/
Bool bDecodeFullFrame;
Bool bDecodeFullWidth;
/** thumbnail decode **/
Bool bSkipFlexbits;
size_t cThumbnailScale; // 1: cThumbnailScale thumbnail, only supports cThumbnailScale = 2^m for now
Bool bDecodeHP;
Bool bDecodeLP;
// Region of interest decoding
size_t cROILeftX;
size_t cROIRightX;
size_t cROITopY;
size_t cROIBottomY;
// table lookups for rotation and flip
size_t * pOffsetX;
size_t * pOffsetY;
} CWMDecoderParameters;
Void predCBPDec(CWMImageStrCodec *, CCodingContext *);
Void predDCACDec(CWMImageStrCodec *);
Void predACDec(CWMImageStrCodec *);
Int dequantizeMacroblock(CWMImageStrCodec *);
Int invTransformMacroblock(CWMImageStrCodec * pSC);
Int invTransformMacroblock_alteredOperators_hard(CWMImageStrCodec * pSC);
Int DecodeMacroblockDC(CWMImageStrCodec * pSC, CCodingContext *pContext, Int iMBX, Int iMBY);
Int DecodeMacroblockLowpass(CWMImageStrCodec * pSC, CCodingContext *pContext, Int iMBX, Int iMBY);
Int DecodeMacroblockHighpass(CWMImageStrCodec * pSC, CCodingContext *pContext, Int iMBX, Int iMBY);
Int AdaptLowpassDec(struct CCodingContext *);
Int AdaptHighpassDec(struct CCodingContext *);
Void ResetCodingContextDec(CCodingContext *pContext);
Void FreeCodingContextDec(struct CWMImageStrCodec *pSC);
/*************************************************************************/
// Inverse transform functions
// 2-point post filter for boundaries (only used in 420 UV DC subband)
Void strPost2(PixelI *, PixelI *);
// 2x2 post filter (only used in 420 UV DC subband)
Void strPost2x2(PixelI *, PixelI *, PixelI *, PixelI *);
/** 4-point post filter for boundaries **/
Void strPost4(PixelI *, PixelI *, PixelI *, PixelI *);
/** data allocation in working buffer (first stage) **/
/** Y, 444 U and V **/
/** 0 1 2 3 **/
/** 32 33 34 35 **/
/** 64 65 66 67 **/
/** 96 97 98 99 **/
/** 420 U and V **/
/** 0 2 4 6 **/
/** 64 66 68 70 **/
/** 128 130 132 134 **/
/** 192 194 196 198 **/
/** 4x4 inverse DCT for first stage **/
Void strIDCT4x4FirstStage(PixelI *);
Void strIDCT4x4Stage1(PixelI*);
Void strIDCT4x4FirstStage420UV(PixelI *);
/** 4x4 post filter for first stage **/
Void strPost4x4FirstStage(PixelI *);
Void strPost4x4Stage1Split(PixelI*, PixelI*, Int, Int, Bool);
Void strPost4x4Stage1(PixelI*, Int, Int, Bool);
Void strPost4x4Stage1Split_alternate(PixelI*, PixelI*, Int);
Void strPost4x4Stage1_alternate(PixelI*, Int);
//Void strPost4x4Stage1Split_420(PixelI*, PixelI*);
//Void strPost4x4Stage1_420(PixelI*);
Void strPost4x4FirstStage420UV(PixelI *);
/** data allocation in working buffer (second stage)**/
/** Y, 444 U and V **/
/** 0 4 8 12 **/
/** 128 132 136 140 **/
/** 256 260 264 268 **/
/** 384 388 392 396 **/
/** 420 U and V **/
/** 0 8 **/
/** 256 264 **/
/** 4x4 invesr DCT for second stage **/
//Void strIDCT4x4SecondStage(PixelI *);
Void strIDCT4x4Stage2(PixelI*);
Void strNormalizeDec(PixelI*, Bool);
Void strDCT2x2dnDec(PixelI *, PixelI *, PixelI *, PixelI *);
/** 4x4 post filter for second stage **/
Void strPost4x4SecondStage(PixelI *);
Void strPost4x4Stage2Split(PixelI*, PixelI*);
Void strPost4x4Stage2Split_alternate(PixelI*, PixelI*);
/** Huffman decode related defines **/
#define HUFFMAN_DECODE_ROOT_BITS_LOG 3
#define HUFFMAN_DECODE_ROOT_BITS (5)
Int getHuff(const short *pDecodeTable, BitIOInfo* pIO);
#endif // WMI_DECODE_H
-288
View File
@@ -1,288 +0,0 @@
//*@@@+++@@@@******************************************************************
//
// Copyright © Microsoft Corp.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// • Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// • Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//*@@@---@@@@******************************************************************
#include "windowsmediaphoto.h"
#include "strcodec.h"
Void smoothMB(PixelI * p1, PixelI * p0, PixelI * q0, PixelI * q1)
{
// p1 p0 | q0 q1
PixelI delta = ((((*q0 - *p0) << 2) + (*p1 - *q1)) >> 3);
*q0 -= delta;
*p0 += delta;
}
Void smooth(PixelI * p2, PixelI * p1, PixelI * p0, PixelI * q0, PixelI * q1, PixelI * q2)
{
// p2 p1 p0 | q0 q1 q2
PixelI delta = ((((*q0 - *p0) << 2) + (*p1 - *q1)) >> 3);
*q0 -= delta;
*p0 += delta;
*p1 = (*p1 >> 1) + ((*p0 + *p2) >> 2);
*q1 = (*q1 >> 1) + ((*q0 + *q2) >> 2);
}
Int initPostProc(struct tagPostProcInfo * strPostProcInfo[MAX_CHANNELS][2], size_t mbWidth, size_t iNumChannels)
{
size_t i, j, k, l;
Bool b32bit = sizeof(int) == 4;
for(j = 0; j < iNumChannels; j ++){
for(i = 0; i < 2; i ++){
// 2 more are allocated to avoid boundary check
if(b32bit) // integer overlow/underflow check for 32-bit system
if((((mbWidth + 2) >> 16) * sizeof(struct tagPostProcInfo)) & 0xffff0000)
return ICERR_ERROR;
strPostProcInfo[j][i] = (struct tagPostProcInfo *)malloc((mbWidth + 2) * sizeof(struct tagPostProcInfo));
assert(strPostProcInfo[j][i] != NULL);
if(strPostProcInfo[j][i] == NULL){
return ICERR_ERROR;
}
strPostProcInfo[j][i] ++;
// initialize out-of-bound MBs as bumpy (no post at all) to avoid boundary check
// left boundary
strPostProcInfo[j][i][-1].ucMBTexture = 3;
for(l = 0; l < 4; l ++){
for(k = 0; k < 4; k ++){
strPostProcInfo[j][i][-1].ucBlockTexture[l][k] = 3;
}
}
// right boundary
strPostProcInfo[j][i][mbWidth] = strPostProcInfo[j][i][-1];
}
}
return ICERR_OK;
}
Void termPostProc(struct tagPostProcInfo * strPostProcInfo[MAX_CHANNELS][2], size_t iNumChannels)
{
size_t i, j;
for(j = 0; j < iNumChannels; j ++){
for(i = 0; i < 2; i ++){
if(strPostProcInfo[j][i] != NULL){
free(strPostProcInfo[j][i] - 1);
}
}
}
}
Void slideOneMBRow(struct tagPostProcInfo * strPostProcInfo[MAX_CHANNELS][2], size_t iNumChannels, size_t mbWidth, Bool top, Bool bottom)
{
size_t i, j;
struct tagPostProcInfo * bar;
for(i = 0; i < iNumChannels; i ++){
// swap previous row and current row
bar = strPostProcInfo[i][0];
strPostProcInfo[i][0] = strPostProcInfo[i][1];
strPostProcInfo[i][1] = bar;
if(top){ // if top row, previous row is out of boundary
for(j = 0; j < mbWidth; j ++){
strPostProcInfo[i][0][j] = strPostProcInfo[i][0][-1]; // set as bumpy
}
}
if(bottom){ // if bottom bottom row, set current row of MBs (out of boundary) as bumpy
for(j = 0; j < mbWidth; j ++){
strPostProcInfo[i][1][j] = strPostProcInfo[i][1][-1]; // set as bumpy
}
}
}
}
// get DC and texture infomation right before transform
Void updatePostProcInfo(struct tagPostProcInfo * strPostProcInfo[MAX_CHANNELS][2], PixelI * pMB, size_t mbX, size_t cc)
{
size_t i, j;
struct tagPostProcInfo * pMBInfo = strPostProcInfo[cc][1] + mbX;
// DC of MB
pMBInfo->iMBDC = pMB[0];
// texture of MB
pMBInfo->ucMBTexture = 0; // smooth
for(i = 16; i < 256; i += 16){
if(pMB[i] != 0){
pMBInfo->ucMBTexture = 3; // bumpy
break;
}
}
// DCs of blocks not available yet, will collect after demacroblocking
// textures of blocks
for(j = 0; j < 4; j ++)
for(i = 0; i < 4; i ++){
PixelI * p = pMB + i * 64 + j * 16;
size_t k;
for(k = 1, pMBInfo->ucBlockTexture[j][i] = 0; k < 16; k ++){
if(p[k] != 0){
pMBInfo->ucBlockTexture[j][i] = 3;
break;
}
}
}
}
// demacroblock critirion: two MBs have same texture other than bumpy and DCs differ less than 1
#define DMB(a, b) (a->ucMBTexture + b->ucMBTexture == 0) && (abs(a->iMBDC - b->iMBDC) <= threshold)
// demacroblock and get DCs of blocks
Void postProcMB(struct tagPostProcInfo * strPostProcInfo[MAX_CHANNELS][2], PixelI * p0, PixelI * p1, size_t mbX, size_t cc, Int threshold)
{
/* 4 MBs involved, current MB is d, we have 4 2-pixel boundary segments */
/* | */
/* a | b */
/* - - + + */
/* c ! d */
/* ! */
struct tagPostProcInfo * pMBb = strPostProcInfo[cc][0] + mbX, * pMBa = pMBb - 1, * pMBd = strPostProcInfo[cc][1] + mbX, * pMBc = pMBd - 1;
// demacroblock segment --
if(DMB(pMBa, pMBc)){
smoothMB(p0 - 256 + 10 * 16, p0 - 256 + 11 * 16, p1 - 256 + 8 * 16, p1 - 256 + 9 * 16);
smoothMB(p0 - 256 + 14 * 16, p0 - 256 + 15 * 16, p1 - 256 + 12 * 16, p1 - 256 + 13 * 16);
}
// demacroblock segment ++
if(DMB(pMBb, pMBd)){
smoothMB(p0 + 2 * 16, p0 + 3 * 16, p1 + 0 * 16, p1 + 1 * 16);
smoothMB(p0 + 6 * 16, p0 + 7 * 16, p1 + 4 * 16, p1 + 5 * 16);
}
// demacroblock segment |
if(DMB(pMBa, pMBb)){
smoothMB(p0 - 256 + 10 * 16, p0 - 256 + 14 * 16, p0 + 2 * 16, p0 + 6 * 16);
smoothMB(p0 - 256 + 11 * 16, p0 - 256 + 15 * 16, p0 + 3 * 16, p0 + 7 * 16);
}
// demacroblock segment !
if(DMB(pMBc, pMBd)){
smoothMB(p1 - 256 + 8 * 16, p1 - 256 + 12 * 16, p1 + 0 * 16, p1 + 4 * 16);
smoothMB(p1 - 256 + 9 * 16, p1 - 256 + 13 * 16, p1 + 1 * 16, p1 + 5 * 16);
}
/* update DCs of blocks */
// MB d
pMBd->iBlockDC[0][0] = p1[0 * 16];
pMBd->iBlockDC[0][1] = p1[4 * 16];
pMBd->iBlockDC[1][0] = p1[1 * 16];
pMBd->iBlockDC[1][1] = p1[5 * 16];
// MB b
pMBb->iBlockDC[2][0] = p0[2 * 16];
pMBb->iBlockDC[2][1] = p0[6 * 16];
pMBb->iBlockDC[3][0] = p0[3 * 16];
pMBb->iBlockDC[3][1] = p0[7 * 16];
// MB c
pMBc->iBlockDC[0][2] = p1[ 8 * 16 - 256];
pMBc->iBlockDC[0][3] = p1[12 * 16 - 256];
pMBc->iBlockDC[1][2] = p1[ 9 * 16 - 256];
pMBc->iBlockDC[1][3] = p1[13 * 16 - 256];
// MB a
pMBa->iBlockDC[2][2] = p0[10 * 16 - 256];
pMBa->iBlockDC[2][3] = p0[14 * 16 - 256];
pMBa->iBlockDC[3][2] = p0[11 * 16 - 256];
pMBa->iBlockDC[3][3] = p0[15 * 16 - 256];
}
/* deblock and destair blocks */
/* 4 MBs involved, need to process 16 blocks of a */
/* | */
/* a | b */
/* - - - - */
/* c | d */
/* | */
Void postProcBlock(struct tagPostProcInfo * strPostProcInfo[MAX_CHANNELS][2], PixelI * p0, PixelI * p1, size_t mbX, size_t cc, Int threshold)
{
size_t i, j, k;
Int dc[5][5];
U8 texture[5][5];
struct tagPostProcInfo * pMBb = strPostProcInfo[cc][0] + mbX, * pMBa = pMBb - 1, * pMBd = strPostProcInfo[cc][1] + mbX, * pMBc = pMBd - 1;
PixelI * pc, * pt;
/* copy DC and Texture info, can be optimized out */
for(j = 0; j < 4; j ++){
// from MB a
for(i = 0; i < 4; i ++){
dc[j][i] = pMBa->iBlockDC[j][i];
texture[j][i] = pMBa->ucBlockTexture[j][i];
}
// 4 blocks from MB c
dc[4][j] = pMBc->iBlockDC[0][j];
texture[4][j] = pMBc->ucBlockTexture[0][j];
// 4 blocks from MB b
dc[j][4] = pMBb->iBlockDC[j][0];
texture[j][4] = pMBb->ucBlockTexture[j][0];
}
// 1 block from MB d
dc[4][4] = pMBd->iBlockDC[0][0];
texture[4][4] = pMBd->ucBlockTexture[0][0];
/* block boundaries */
/* | */
/* | */
/* --- */
for(j = 0; j < 4; j ++){
for(i = 0; i < 4; i ++){
pc = p0 - 256 + i * 64 + j * 16;
// deblock
if(texture[j][i] + texture[j + 1][i] < 3 && abs(dc[j][i] - dc[j + 1][i]) <= threshold){
// smooth horizontal boundary ----
pt = (j < 3 ? pc + 16 : p1 - 256 + i * 64);
for(k = 0; k < 4; k ++){
smooth(pc + idxCC[1][k], pc + idxCC[2][k], pc + idxCC[3][k], pt + idxCC[0][k], pt + idxCC[1][k], pt + idxCC[2][k]);
}
}
// two horizontally adjacent blocks have same texture and similiar DCs
if(texture[j][i] + texture[j][i + 1] < 3 && abs(dc[j][i] - dc[j][i + 1]) <= threshold){
// smooth vertical boundary |
pt = pc + 64;
for(k = 0; k < 4; k ++){
smooth(pc + idxCC[k][1], pc + idxCC[k][2], pc + idxCC[k][3], pt + idxCC[k][0], pt + idxCC[k][1], pt + idxCC[k][2]);
}
}
}
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More