Commit a4ddbf0a authored by Mathieu Malaterre's avatar Mathieu Malaterre

Import Upstream version 1.1

parent 054ac943
...@@ -119,7 +119,7 @@ libjxrglue.a: $(OBJ_GLUE) $(OBJ_TEST) ...@@ -119,7 +119,7 @@ libjxrglue.a: $(OBJ_GLUE) $(OBJ_TEST)
## ##
LIBRARIES=libjxrglue.a libjpegxr.a LIBRARIES=libjxrglue.a libjpegxr.a
JPEG XR Device Porting Kit v1.0 - April 2013
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:
The Visual Studio 2012 main solution is:
Build JXR.sln Debug Configuration, you will get:
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
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
The JPEG XR Image Coding Spectification is an international standard and is
available at: while the reference software is
available at:
"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
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:
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
- The Microsoft JPEG XR Development Team
...@@ -195,10 +195,14 @@ void WmpDecAppUsage(const char* szExe) ...@@ -195,10 +195,14 @@ void WmpDecAppUsage(const char* szExe)
void WmpDecAppShowArgs(WMPDECAPPARGS* args) void WmpDecAppShowArgs(WMPDECAPPARGS* args)
{ {
GUID guidPF = args->guidPixFormat;
printf("================================" CRLF); printf("================================" CRLF);
printf("Input file: %s" CRLF, args->szInputFile); printf("Input file: %s" CRLF, args->szInputFile);
printf("Output file: %s" CRLF, args->szOutputFile); printf("Output file: %s" CRLF, args->szOutputFile);
printf("Color format: %x" CRLF, args->guidPixFormat); printf("Color format: %08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X" CRLF,
guidPF.Data1, guidPF.Data2, guidPF.Data3, guidPF.Data4[0], guidPF.Data4[1], guidPF.Data4[2],
guidPF.Data4[3], guidPF.Data4[4], guidPF.Data4[5], guidPF.Data4[6], guidPF.Data4[7]);
printf("Post processing strength: %d" CRLF, args->cPostProcStrength); printf("Post processing strength: %d" CRLF, args->cPostProcStrength);
printf("Thumbnail: %d" CRLF, (int) args->tThumbnailFactor); printf("Thumbnail: %d" CRLF, (int) args->tThumbnailFactor);
printf("================================" CRLF); printf("================================" CRLF);
...@@ -638,81 +642,3 @@ Cleanup: ...@@ -638,81 +642,3 @@ Cleanup:
return (int)err; return (int)err;
} }
#ifdef _WIN32_WCE
#define DEFDIR "\\Temp\\"
int GetArguments(int* pc, char** ppv[])
size_t i = 0;
static char line[132];
static char* args[20] =
DEFDIR "test.jxr",
DEFDIR "test.bmp",
FILE* pfIn = fopen(DEFDIR "WMPIni.txt", "r");
// default arguments to return
*pc = 9;
*ppv = args;
while (fgets(line, sizeof2(line), pfIn))
// search for the matching line
if (0 == strcmp(strtok(line, " \t"), args[0]))
// extract each argument from the matching line
for (i = 1; i < sizeof2(args) - 1 && (args[i] = strtok(NULL, " \t\n\r")); ++i);
*pc = i;
printf("Args from WMPIni.txt" CRLF);
for (i = 0; i < (size_t)*pc; printf("%s ", args[i++]));
return 0;
// Windows CE App entry
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
int argc = 0;
char** argv = NULL;
// redirect stdou and stderr
fopen(DEFDIR "stdout.txt", "wb");
fopen(DEFDIR "stderr.txt", "wb");
GetArguments(&argc, &argv);
return main(argc, argv);
This diff is collapsed.
...@@ -46,8 +46,7 @@ extern "C" { ...@@ -46,8 +46,7 @@ extern "C" {
#define min(b,a) ((a) < (b) ? (a) : (b)) #define min(b,a) ((a) < (b) ? (a) : (b))
#endif #endif
#ifdef __ANSI__ #ifdef __ANSI__
//#define STRCPY_SAFE(pszDest, cbDest, pszSrc) (strcpy((pszDest), (pszSrc)) == (pszDest) ? 0 : 1) #define STRCPY_SAFE(pszDest, cbDest, pszSrc) (strncpy((pszDest), (pszSrc), (cbDest)) == (pszDest) ? 0 : 1)
#define STRCPY_SAFE(pszDest, cbDest, pszSrc) (strlcpy((pszDest), (pszSrc), (cbDest)) < (cbDest) ? 0 : 1) // Macintosh impl, not ANSI
#else #else
#define STRCPY_SAFE(pszDest, cbDest, pszSrc) (strcpy_s((pszDest), (cbDest), (pszSrc))) #define STRCPY_SAFE(pszDest, cbDest, pszSrc) (strcpy_s((pszDest), (cbDest), (pszSrc)))
#endif // __ANSI__ #endif // __ANSI__
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment