Giter Site home page Giter Site logo

gpr's Introduction

GPR Introduction

The General Purpose Raw (GPR) is 12-bit raw image coding format that is based on Adobe DNG® standard. Image compression is a balance of speed, file size and photo quality, and typically one can only choose two. GPR was designed to provide a better tradeoff for all three parameters than what's possible with DNG or any other raw format. The intention of GPR is not to compete with DNG, rather to be as close as possible to DNG. This guarantees compatibility with applications that already understand DNG, but provide an alternate compression scheme in situations where compression and encoding/decoding speed matter.

Action cameras, like that from GoPro, have limited computing resources, so ability to compress data using fewest CPU cycles matters. File sizes matter because GoPro cameras can record thousands of images very quickly using timelapse and burst mode features. As the world shifts from desktop to mobile, people now shoot and process more and more photos on smartphones which are always limited on storage space and bandwidth. And last but not the least, image quality matters because we want GPR to provide visually transparent image quality when compared to uncompressed DNG. All this combined enables customers to capture DSLR-class image quality in a GPR file that has nearly same size as JPEG, on a camera that is as small and rugged as a GoPro.

DNG allows storage of RAW sensor data in three main formats: uncompressed, lossless JPEG or lossy JPEG. Lossless mode typically achieves 2:1 compression that is clearly not enough in the mobile-first age. Lossy mode uses the 8x8 DCT transform that was developed for JPEG more than 25 years ago (when photo resolutions were much smaller), achieving compression ratios around 4:1. In comparison, GPR achieves typical compression ratios between 10:1 and 4:1. This is due to Full-Frame Wavelet Transform (FFWT). FFWT has a few nice properties compared to DCT:

  • The compression performance increases as image resolutions go up - making it more future proof
  • Better image quality as it does not suffer from ringing or blocky artifacts observed in JPEG files.

The wavelet codec in GPR is not new, but has been a SMPTE® standard under the name VC-5. VC-5 shares a lot of technical barebones with the CineForm®, an open and cross-platform intermediate codec designed for high-resolution video editing.

File Types

Following file types are discussed in this document:

  • RAW or CFA RAW - The Bayer RAW format is typically composed of 50% green, 25% red and 25% blue samples captured from sensor, e.g. RGGB and GBRG. The RAW image doesn't carry metadata about image development e.g. exposure, white balance or noise etc, thus cannot easily be turned into a well developed image.

  • DNG - Widely regarded as a defacto standard, a DNG file can be opened natively on most operating systems and image development tools. As mentioned earlier, DNG stores compressed or uncompressed RAW sensor data along with accompanying metadata that is needed to properly develop image.

  • GPR - General purpose RAW format file. GoPro cameras including Hero5/6 and Fusion record photos in this format. GPR is an extension of DNG, enabling high performance VC-5 compression for faster storage and smaller files without impacting image quality. Today, GPR files can be opened in Adobe products like Camera Raw®, Photoshop® and Lightroom®.

  • VC5 - A file with VC5 extension stores RAW sensor image data in a compressed format that is compatible with VC-5. Similar to RAW file, VC5 file does not store metadata needed for proper image development.

  • PPM - Portable Pixel Map is one of the simplest storage formats of uncompressed debayered RGB image. It is very easy to write and analyze programs to process this format, and that is why it is used here.

  • JPG or JPEG One of the simplest formats for lossy compression of debayered RGB image.

Included Within This Repository

  • The complete source of GPR-SDK, a library that implements conversion of RAW, DNG, GPR, PPM or JPG formats. GPR-SDK has C-99 interface for maximum portability, yet is implemented in C/C++ for programming effectiveness.

  • Source of VC-5 encoder and decoder library. Encoder is hand-optimized with NEON intrinsics for ARM processors.

  • gpr_tools - a sample demo code that uses GPR-SDK to convert between GPR, DNG and RAW formats.

  • vc5_encoder_app - a sample VC5 encoder application that encodes a RAW frame to VC5 file.

  • vc5_decoder_app - a sample VC5 decoder application that decodes VC5 file to RAW file.

  • CMake support for building all projects.

  • Tested on:

    • macOS High Sierra with XCode v8 & v9, El Capitan with XCode v8
    • Windows 10 with Visual Studio 2015 & 2017
    • Ubuntu 16.04 with gcc v5.4

License Terms

GPR is licensed under either:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Quick Start for Developers

Setup Source Code

Clone the project from Github (git clone https://github.com/gopro/gpr). You will need CMake version 3.5.1 or better to compile source code.

Compiling Source Code

Run following commands:

$ mkdir build
$ cd build
$ cmake ../

For Xcode, use command line switch -G Xcode. On Windows, CMake should automatically figure out installed version of Visual Studio and generate corresponding project files.

Mac build instructions, after running the above:

$ make .
$ ./source/app/gpr_tools/gpr_tools

Linux build instructions, after running the above:

$ make 
$ ./source/app/gpr_tools/gpr_tools

Using gpr_tools

Some example commands are shown below:

Convert GPR to DNG:

$ gpr_tools -i INPUT.GPR -o OUTPUT.DNG

Extract RAW from GPR:

$ gpr_tools -i INPUT.GPR -o OUTPUT.RAW

Convert DNG to GPR:

$ gpr_tools -i INPUT.DNG -o OUTPUT.GPR

Analyze a GPR (or even DNG) and output parameters that define DNG metadata to a file:

$ gpr_tools -i INPUT.GPR -d 1 > PARAMETERS.TXT

Read RAW pixel data, along with parameters that define DNG metadata and apply to an output GPR (or DNG) file:

$ gpr_tools -i INPUT.RAW -o OUTPUT.DNG -a PARAMETERS.TXT

Read GPR file and output PPM preview:

$ gpr_tools -i INPUT.GPR -o OUTPUT.PPM

Read GPR file and output JPG preview:

$ gpr_tools -i INPUT.GPR -o OUTPUT.JPG

For a complete list of commands, please refer to data/tests/run_tests.sh

Using vc5_encoder_app

vc5_encoder_app is an optional tool that can be used to convert RAW image data to VC5 essence, as shown below:

$ vc5_encoder_app -i INPUT.RAW -o OUTPUT.VC5 -w 4000 -h 3000 -p 8000

Using vc5_decoder_app

vc5_decoder_app is an optional tool that can be used to decode VC5 essence into RAW image data, as shown below:

$ vc5_decoder_app -i INPUT.VC5 -o OUTPUT.RAW

Source code organization

Folder structure

Source code is organized inside source folder. All library and sdk code is located in lib folder, while all tools and applications that use lib are located in app folder.

The lib folder is made up of following folders:

  • common - common source code that is accessable to all libraries and applications
  • dng_sdk - mostly borrowed from Adobe DNG SDK version 1.4.
  • xmp_core - Extensible Metadata Platform, mostly borrowed from Adobe DNG SDK version 1.4
  • expat_lib - A stream-oriented XML parser borrowed from Adobe DNG SDK version 1.4
  • vc5_decoder - vc5 decoder. If this is not present, cmake won't use it (and define GPR_READING=0); otherwise cmake uses it (and defines GPR_READING=1).
  • vc5_encoder - vc5 encoder. If this is not present, cmake won't use it (and define GPR_WRITING=0); otherwise cmake uses it (and defines GPR_WRITING=1).
  • vc5_common - common source code that is shared between vc5_encoder and vc5_decoder
  • md5_lib - md5 checksum calculation library
  • tiny_jpeg - lightweight jpeg encoder available here. If this folder is not present, cmake will not use it (and define GPR_JPEG_AVAILABLE=0); otherwise cmake defines GPR_JPEG_AVAILABLE=1 and uses it.
  • gpr_sdk - uses all modules above to read/write GPR files.

The app folder is made up of following folders:

  • common - common application level source code that is accessable to sample applications
  • vc5_decoder_app - sample vc5 decoder application
  • vc5_encoder_app - sample vc5 encoder application
  • gpr_tools - utility to convert to/from various formats mentioned above and measure runtime

Important Defines

Here are some important compile time definitions:

  • GPR_TIMING enables timing code that prints out time spent (in milliseconds) in different functions. In production builds, applications should define GPR_TIMING=0. Set to a higher value to output greater timing information.

  • GPR_WRITING enables all code that writes GPR files. If application does not need to write GPR, set GPR_WRITING=0 to reduce code size.

  • GPR_READING enables all code that reads GPR files. If application does not need to read GPR, set GPR_READING=0 to reduce code size.

  • GPR_JPEG_AVAILABLE enables lightweight jpeg encoder located in source/lib/tiny_jpeg. This is used to write a small thumbnail inside GPR file. If GPR_JPEG_AVAILABLE=0, thumbnail is not written, although you can still set pre-encoded jpeg file as thumbnail, by using -P, -W and -H command line options in gpr_tools.

  • NEON enables arm neon intrinsics (disabled by default). This can be enabled from CMake by -DNEON=1 switch.

GPR-SDK API

GPR-SDK API is defined in header files in the following folders:

  • source/lib/common/public
  • source/lib/gpr_sdk/public

An application needs to include above two folders in order to access API. API defines various functions named gpr_convert_XXX_to_XXX which convert from one format to another. As an example, GPR to DNG conversion is done from gpr_convert_gpr_to_dng. When output file is GPR or DNR, gpr_parameters structure has to be specified. Fields in this structure map to DNG metadata tags, and we have tried to abstract low-level DNG details in a very clean and easy to use structure.

Compression Technology

Wavelet Transforms

The wavelet used within VC-5 is a 2D three-level 2-6 Wavelet. If you look up wavelets on Wikipedia, prepare to get confused fast. Wavelet compression of images is fairly simple if you don't get distracted by the theory. The wavelet is a one dimensional filter that separates low frequency data from high frequency data, and the math is simple. For each two pixels in an image simply add them (low frequency):

  • low frequency sample = pixel[x] + pixel[x+1]
  • two inputs, is the '2' part of 2-6 Wavelet.

For high frequency it can be as simple as the difference of the same two pixels:

  • high frequency sample = pixel[x] - pixel[x+1]

For a 2-6 wavelet this math is for the high frequency:

  • high frequency sample = pixel[x] - pixel[x+1] + (-pixel[x-2] - pixel[x-1] + pixel[x+2] + pixel[x+3])/8
  • i.e 6 inputs for the high frequency, the '6' part of 2-6 Wavelet.

The math doesn't get much more complex than that.

To wavelet compress a monochrome frame (color can be compressed as separate monochrome channels), we start with a 2D array of pixels (a.k.a image.)

If you store data with low frequencies (low pass) on the left and the high frequencies (high pass) on the right you get the image below. A low pass image is basically the average, and high pass image is like an edge enhance.

You repeat the same operation vertically using the previous output as the input image.

Resulting in a 1 level 2D wavelet:

For a two level wavelet, you repeat the same horizontal and vertical wavelet operations of the top left quadrant to provide:

Repeating again for the third level.

Quantization

All that grey is easy to compress. The reason there is very little information in these high frequency regions is that the high frequency data of the image has been quantized. The human eye is not very good at seeing subtle changes in high frequency regions, so this is exploited by scaling the high-frequency samples before they are stored:

  • high frequency sample = (wavelet output) / quantizer

Entropy Coding

After the wavelet and quantization stages, you have the same number of samples as the original source. The compression is achieved as the samples are no longer evenly distributed (after wavelet and quantization.) There are many many zeros and ones, than higher values, so we can store all these values more efficiently, often up to 10 times more so.

Run length

The output of the quantization stage has a lot of zeros, and many in a row. Additional compression is achieved by counting runs of zeros, and storing them like: a "z15" for 15 zeros, rather than "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"

Variable length coding

After all previous steps, the high frequency samples are stored with a variable length coding scheme using Huffman coding. A table then maps sample values to codewords with differing bit lengths where most common codewords are expressed in few bits and rare codewords are expressed in larger bits.

The lack of complexity is what makes VC-5 fast. Low pass filter is just addition. High pass filter is 6 tap where all coefficients are rational numbers and no multiplication or division is required. Variable length coding can be implemented with a lookup table, an approach that is faster than other entropy coding techniques.

To Decode

Reverse all the steps.

Thumbnail and Preview Generation

A nice property of the Wavelet codec is scalability support: i.e. various resolutions ranging from original coded resolution to one-sixteenth resolution are encoded and can be retrieved efficiently. Scalability means that extracting lowest resolution is fastest and cost of extracting resolutions increases as resolution goes up. For application scenarios where rendering a smaller resolution suffices, a decoder can very cheaply extract lower resolution. Common examples of this use case are thumbnail previews in file browsers or rendering image on devices with smaller resolution e.g. mobile phones.

Scalability is more efficient than decoding full resolution image, performing demosaicing and downsampling. To avoid demosaic, DNG allows mechanism to store a separate thumbnail and preview image (often encoded in JPG). File browers use thumbnail, while preview is useful for rendering higher resolution version of image. Since these are separately enoded images and do not exploit compression amongst each other or with original RAW image, file sizes add up quickly.

As an example, GoPro Hero6 Black captures 4000x3000 RAW image in Bayer RGGB format. Red, blue and two green channels are split up and separately encoded into wavelet resolutions of 2000x1500 (or 2:1), 1000x750 (or 4:1), 500x375 (or 8:1). The Low-Low band of lowest resolution wavelet is a 250x188 (or 16:1) image, and it is stored uncompressed (generating thumbnail is essentially a memory copy). RGB images at other resolutions can be obtained at successive complexity levels, without performing demosaicing. To illustrate this, decoding speed of various resolutions is measured and shown using gpr_tools (in milliseconds inside square brackets).

Decode GPR to 8-bit PPM (250x188)
[    6-ms] [BEG] gpr_convert_gpr_to_rgb() gpr.cpp (line 1695)
[   16-ms] [END] gpr_convert_gpr_to_rgb() gpr.cpp (line 1738)
Decode GPR to 8-bit PPM (500x375)
[    6-ms] [BEG] gpr_convert_gpr_to_rgb() gpr.cpp (line 1695)
[   37-ms] [END] gpr_convert_gpr_to_rgb() gpr.cpp (line 1738)
Decode GPR to 8-bit PPM (1000x750)
[    5-ms] [BEG] gpr_convert_gpr_to_rgb() gpr.cpp (line 1695)
[  130-ms] [END] gpr_convert_gpr_to_rgb() gpr.cpp (line 1738)
Decode GPR to 8-bit PPM (2000x1500)
[    5-ms] [BEG] gpr_convert_gpr_to_rgb() gpr.cpp (line 1695)
[  357-ms] [END] gpr_convert_gpr_to_rgb() gpr.cpp (line 1738)

And here is the output of full GPR to DNG decoding.

Decode GPR to DNG
[    6-ms] [BEG] gpr_convert_gpr_to_dng() gpr.cpp (line 1748)
[  422-ms] [END] gpr_convert_gpr_to_dng() gpr.cpp (line 1768)

To summarize, here are speed gain factors over full resolution DNG decoding:

Resolution 250x188 500x375 1000x750 2000x1500
Speed factor 41.6x 13.4x 3.3x 1.2x

Demosaicing has a higher complexity than GPR decoding, so numbers for RGB output after demosaic will be higher. Similar speed improvements can also be seen when writing JPG file.

GoPro and CineForm are trademarks of GoPro, Inc.
DNG, Photoshop and Lightroom is trademarks of Adobe Inc.

gpr's People

Contributors

aabbas-gpfw avatar dnewman-gpsw avatar echasseur-gpfw avatar eligithub1 avatar farhadabed avatar konradit avatar ldomenzain-gpfw avatar tcullum-gpsw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gpr's Issues

VC-5 compression

Hi, I would like to make my own decoder for .GPR files.

Is it possible to find a public description of the VC-5 compression format? Could you provide some link?

Assertion failed Error when trying to run DNG->GPR with CR2 converted to DNG

Hey,

Is it possible to convert DNG made from CR2 to GPR?
When trying to run the command, I got this error:

Assertion failed: (src_exif->fSoftware.Length() < sizeof(dst_exif->software_version)), function convert_dng_exif_to_dng_exif_info, file gpr.cpp, line 446.
[1]    63753 abort      build/source/app/gpr_tools/gpr_tools -i ./60d_orig.DNG -o converted.GPR

Full size conversion crashes

gpr_tools -i GOPR0001.GPR -o GOPR0001.jpg -r 1:1

cashes with:

Could not decode input vc5 bitstream. Error number 20
gpr_tools: /home/zp/code/gpr/source/lib/gpr_sdk/private/gpr.cpp:1735: bool gpr_convert_gpr_to_rgb(const gpr_allocator*, GPR_RGB_RESOLUTION, int, gpr_buffer*, gpr_rgb_buffer*): Assertion `0' failed.
Aborted (core dumped)

Error number 20 is CODEC_ERROR_UNSUPPORTED_FORMAT

The problem is parameters->rgb_resolution == GPR_RGB_RESOLUTION_FULL case havn't been implemented here: https://github.com/gopro/gpr/blob/master/source/lib/vc5_decoder/decoder.c#L201

Example for RAW to DNG conversion

Could you provide an example for RGGB (or any other pattern) RAW CFA conversion that is related to
$ gpr_tools -i INPUT.RAW -o OUTPUT.DNG -a PARAMETERS.TXT

How should the parameters.TXT file be structured?

Crash when parsing a malformed GPR file

Hi folks,

A crash was found while fuzz testing of the gpr_tools binary which can be triggered via a malformed GPR file. Although this malformed file only crashes the program as-is, it might have the potential to be crafted further and create a security issue where these kinds of files would be able compromise the process's memory through taking advantage of affordances given by memory corruption. It's recommend to harden the code to prevent these kinds of bugs as it could greatly mitigate such this issue and even future bugs.

You can download the crashing gpr file (~3mb file size) from Ufile to debug and understand where the code is crashing.

$ ./gpr_tools -i crash.gpr -o test.dng
[    0-ms]  GPR Tools Version 1.0.0 [master @ 96b11fc] [Linux][GCC 9.3.0][64 bit] 
[    0-ms]  Input File: crash.gpr 
[    0-ms]  Output File: test.dng 
[    4-ms] [BEG] gpr_convert_gpr_to_dng() source/lib/gpr_sdk/private/gpr.cpp (line 1748)
Segmentation fault (core dumped)

(gdb) r -i crash.gpr -o test.dng
Starting program: gpr_tools -i crash.gpr -o test.dng
[    0-ms]  GPR Tools Version 1.0.0 [master @ 96b11fc] [Linux][GCC 9.3.0][64 bit] 
[    0-ms]  Input File: crash.gpr 
[    0-ms]  Output File: test.dng 
[    5-ms] [BEG] gpr_convert_gpr_to_dng() source/lib/gpr_sdk/private/gpr.cpp (line 1748)

Program received signal SIGSEGV, Segmentation fault.
0x000055555567b31a in UpdateCodecState ()
(gdb) i r
rax            0x7ffffffec2b0      140737488274096
rbx            0x2ea2c0            3056320
rcx            0x2                 2
rdx            0xaf0e              44814
rsi            0x3                 3
rdi            0x2d                45
rbp            0x7ffffffec1a0      0x7ffffffec1a0
rsp            0x7ffffffec140      0x7ffffffec140
r8             0x5555591b8240      93825055556160
r9             0x7ffff7c59c20      140737350310944
r10            0x5555591d9000      93825055690752
r11            0xfffffffffffff000  -4096
r12            0x555555938f70      93824996314992
r13            0x555555595e30      93824992501296
r14            0x3                 3
r15            0x7fffffffe190      140737488347536
rip            0x55555567b31a      0x55555567b31a <UpdateCodecState+1906>
eflags         0x10202             [ IF RF ]
cs             0x33                51
ss             0x2b                43
ds             0x0                 0
es             0x0                 0
fs             0x0                 0
gs             0x0                 0

(gdb) x/i $rip
=> 0x55555567b31a <UpdateCodecState+1906>:	movzbl 0x11(%rax,%rdx,8),%eax

(gdb) bt
#0  0x000055555567b31a in UpdateCodecState ()
#1  0x0000555555679e08 in DecodeSingleImage ()
#2  0x0000555555679d5b in DecodingProcess ()
#3  0x000055555567981c in DecodeImage ()
#4  0x0000555555679280 in vc5_decoder_process ()
#5  0x0000555555586e3a in DecodeVC5(dng_image&, gpr_buffer_auto&, VC5_DECODER_PIXEL_FORMAT) ()
#6  0x00005555555870a8 in gpr_read_image::ReadTile(dng_host&, dng_ifd const&, dng_stream&, dng_image&, dng_rect const&, unsigned int, unsigned int, unsigned int, AutoPtr<dng_memory_block>&, AutoPtr<dng_memory_block>&, AutoPtr<dng_memory_block>&) ()
#7  0x00005555555ef397 in dng_read_image::Read(dng_host&, dng_ifd const&, dng_stream&, dng_image&, dng_jpeg_image*, dng_fingerprint*) ()
#8  0x00005555555d989d in dng_negative::ReadVc5Image(dng_host&, dng_stream&, dng_info&, dng_read_image&) ()
#9  0x000055555557c9e1 in read_dng(gpr_allocator const*, dng_stream*, gpr_buffer_auto*, gpr_buffer_auto*, gpr_parameters*, bool*) ()
#10 0x0000555555581df1 in gpr_convert_gpr_to_dng ()
#11 0x000055555557a9c4 in dng_convert_main ()
#12 0x0000555555577885 in main ()

(gdb) exploitable
Description: Access violation
Short description: AccessViolation (21/22)
Hash: 7b9a2f770e5e19c99d35e5d33ef3baf3.7ded8a2db954fdc92d946a58e3a35451
Exploitability Classification: UNKNOWN
Explanation: The target crashed due to an access violation but there is not enough additional information available to determine exploitability.

build fails

Hey,

I have been trying to install gpr_toolsand I am stuck at building the app in VS. I am not really familiar with C/C++ so fixing this issue may be trivial, but I have the following log (sorry for the log dump, not sure what is important to you):

1>------ Build started: Project: argument_parser, Configuration: Debug Win32 ------
2>------ Build started: Project: cJSON, Configuration: Debug Win32 ------
2>cl : Command line warning D9002: ignoring unknown option '-std=c99'
2>cJSON.c
2>cJSON_Utils.c
2>C:\Users\schidani\Desktop\gpr\source\app\common\cJSON\cJSON_Utils.c(23): warning C4068: unknown pragma
2>C:\Users\schidani\Desktop\gpr\source\app\common\cJSON\cJSON_Utils.c(29): warning C4068: unknown pragma
2>Generating Code...
2>cJSON.vcxproj -> C:\Users\schidani\Desktop\gpr\build\source\app\common\cJSON\Debug\cJSON.lib
2>Done building project "cJSON.vcxproj".
3>------ Build started: Project: common, Configuration: Debug Win32 ------
3>gpr_allocator.c
3>gpr_buffer.c
3>log.c
3>timer.c
3>Generating Code...
3>gpr_buffer_auto.cpp
3>common.vcxproj -> C:\Users\schidani\Desktop\gpr\build\source\lib\common\Debug\common.lib
4>------ Build started: Project: dng_sdk, Configuration: Debug Win32 ------
1>argument_parser.cpp
1>program_options_lite.cpp
1>Generating Code...
1>argument_parser.vcxproj -> C:\Users\schidani\Desktop\gpr\build\source\app\common\argument_parser\Debug\argument_parser.lib
5>------ Build started: Project: expat_lib, Configuration: Debug Win32 ------
5>cl : Command line warning D9002: ignoring unknown option '-std=c99'
5>xmlparse.c
5>xmlrole.c
5>xmltok.c
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(234): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(241): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(393): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(400): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(506): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(515): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(538): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(653): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(699): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(726): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(750): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(896): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(906): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(925): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(932): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(1155): error C2065: 'fallthrough': undeclared identifier
5>C:\Users\schidani\Desktop\gpr\source\lib\expat_lib\xmltok.c(632): error C2065: 'fallthrough': undeclared identifier
5>C:\Users\schidani\Desktop\gpr\source\lib\expat_lib\xmltok.c(644): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(234): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(241): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(393): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(400): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(506): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(515): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(538): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(653): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(699): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(726): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(750): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(896): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(906): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(925): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(932): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(1155): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(234): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(241): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(393): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(400): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(506): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(515): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(538): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(653): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(699): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(726): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(750): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(896): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(906): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(925): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(932): error C2065: 'fallthrough': undeclared identifier
5>c:\users\schidani\desktop\gpr\source\lib\expat_lib\xmltok_impl.c(1155): error C2065: 'fallthrough': undeclared identifier
5>C:\Users\schidani\Desktop\gpr\source\lib\expat_lib\xmltok.c(1543): error C2065: 'fallthrough': undeclared identifier
5>xmltok_impl.c
5>xmltok_ns.c
5>Generating Code...
5>Done building project "expat_lib.vcxproj" -- FAILED.
6>------ Build started: Project: gpr_sdk, Configuration: Debug Win32 ------
6>gpr.cpp
6>C:\Users\schidani\Desktop\gpr\source\lib\gpr_sdk\private\gpr.cpp(90): warning C4244: '=': conversion from 'float' to 'int', possible loss of data
6>C:\Users\schidani\Desktop\gpr\source\lib\gpr_sdk\private\gpr.cpp(692): warning C4244: '=': conversion from 'real64' to 'float_t', possible loss of data
6>C:\Users\schidani\Desktop\gpr\source\lib\gpr_sdk\private\gpr.cpp(693): warning C4244: '=': conversion from 'real64' to 'float_t', possible loss of data
6>C:\Users\schidani\Desktop\gpr\source\lib\gpr_sdk\private\gpr.cpp(694): warning C4244: '=': conversion from 'real64' to 'float_t', possible loss of data
6>C:\Users\schidani\Desktop\gpr\source\lib\gpr_sdk\private\gpr.cpp(702): warning C4244: '=': conversion from 'const real64' to 'int32_t', possible loss of data
6>C:\Users\schidani\Desktop\gpr\source\lib\gpr_sdk\private\gpr.cpp(703): warning C4244: '=': conversion from 'const real64' to 'int32_t', possible loss of data
6>C:\Users\schidani\Desktop\gpr\source\lib\gpr_sdk\private\gpr.cpp(704): warning C4244: '=': conversion from 'const real64' to 'int32_t', possible loss of data
6>C:\Users\schidani\Desktop\gpr\source\lib\gpr_sdk\private\gpr.cpp(705): warning C4244: '=': conversion from 'const real64' to 'int32_t', possible loss of data
6>C:\Users\schidani\Desktop\gpr\source\lib\gpr_sdk\private\gpr.cpp(711): warning C4244: '=': conversion from 'const real64' to 'int32_t', possible loss of data
6>C:\Users\schidani\Desktop\gpr\source\lib\gpr_sdk\private\gpr.cpp(798): warning C4244: '=': conversion from 'uint64' to 'uint32_t', possible loss of data
6>C:\Users\schidani\Desktop\gpr\source\lib\gpr_sdk\private\gpr.cpp(1446): warning C4244: 'initializing': conversion from 'uint64' to 'size_t', possible loss of data
6>C:\Users\schidani\Desktop\gpr\source\lib\gpr_sdk\private\gpr.cpp(1840): warning C4305: 'return': truncation from 'int' to 'bool'
6>gpr_exif_info.cpp
6>gpr_image_writer.cpp
6>gpr_profile_info.cpp
6>gpr_read_image.cpp
6>gpr_tuning_info.cpp
6>gpr_utils.cpp
6>Generating Code...
6>gpr_sdk.vcxproj -> C:\Users\schidani\Desktop\gpr\build\source\lib\gpr_sdk\Debug\gpr_sdk.lib
6>Done building project "gpr_sdk.vcxproj".
7>------ Build started: Project: md5_lib, Configuration: Debug Win32 ------
7>cl : Command line warning D9002: ignoring unknown option '-std=c99'
7>md5.c
7>md5_lib.vcxproj -> C:\Users\schidani\Desktop\gpr\build\source\lib\md5_lib\Debug\md5_lib.lib
7>Done building project "md5_lib.vcxproj".
8>------ Build started: Project: tiny_jpeg, Configuration: Debug Win32 ------
8>cl : Command line warning D9002: ignoring unknown option '-std=c99'
8>jpeg.c
8>tiny_jpeg.vcxproj -> C:\Users\schidani\Desktop\gpr\build\source\lib\tiny_jpeg\Debug\tiny_jpeg.lib
8>Done building project "tiny_jpeg.vcxproj".
9>------ Build started: Project: vc5_common, Configuration: Debug Win32 ------
4>dng_1d_function.cpp
4>dng_1d_table.cpp
4>dng_abort_sniffer.cpp
4>dng_area_task.cpp
4>dng_bad_pixels.cpp
4>dng_bottlenecks.cpp
4>dng_camera_profile.cpp
4>dng_color_space.cpp
4>dng_color_spec.cpp
4>dng_date_time.cpp
4>dng_exceptions.cpp
4>dng_exif.cpp
4>dng_file_stream.cpp
4>dng_filter_task.cpp
4>dng_fingerprint.cpp
4>dng_gain_map.cpp
4>dng_globals.cpp
4>dng_host.cpp
4>dng_hue_sat_map.cpp
4>dng_ifd.cpp
4>Generating Code...
4>Compiling...
4>dng_image.cpp
4>dng_image_writer.cpp
4>dng_info.cpp
4>dng_iptc.cpp
4>dng_jpeg_image.cpp
4>dng_lens_correction.cpp
4>dng_linearization_info.cpp
4>dng_lossless_jpeg.cpp
4>dng_matrix.cpp
9>cl : Command line warning D9002: ignoring unknown option '-std=c99'
4>dng_memory.cpp
4>dng_memory_stream.cpp
9>bitstream.c
9>codec.c
9>companding.c
9>image.c
9>logcurve.c
9>stream.c
9>syntax.c
9>utilities.c
9>wavelet.c
9>Generating Code...
9>vc5_common.vcxproj -> C:\Users\schidani\Desktop\gpr\build\source\lib\vc5_common\Debug\vc5_common.lib
4>dng_misc_opcodes.cpp
9>Done building project "vc5_common.vcxproj".
10>------ Build started: Project: vc5_decoder, Configuration: Debug Win32 ------
4>dng_mosaic_info.cpp
10>cl : Command line warning D9002: ignoring unknown option '-std=c99'
10>codebooks.c
4>dng_mutex.cpp
10>component.c
10>decoder.c
4>dng_negative.cpp
10>dequantize.c
10>inverse.c
10>parameters.c
10>raw.c
10>syntax.c
10>vc5_decoder.c
10>vlc.c
10>wavelet.c
10>Generating Code...
4>dng_opcode_list.cpp
4>dng_opcodes.cpp
4>dng_orientation.cpp
4>dng_parse_utils.cpp
4>dng_pixel_buffer.cpp
4>Generating Code...
4>Compiling...
10>vc5_decoder.vcxproj -> C:\Users\schidani\Desktop\gpr\build\source\lib\vc5_decoder\Debug\vc5_decoder.lib
4>dng_point.cpp
10>Done building project "vc5_decoder.vcxproj".
11>------ Build started: Project: vc5_encoder, Configuration: Debug Win32 ------
4>dng_preview.cpp
11>cl : Command line warning D9002: ignoring unknown option '-std=c99'
4>dng_pthread.cpp
11>codebooks.c
11>component.c
11>encoder.c
11>forward.c
11>parameters.c
11>raw.c
11>sections.c
11>syntax.c
11>vc5_encoder.c
11>vlc.c
11>Generating Code...
4>dng_rational.cpp
4>dng_read_image.cpp
11>vc5_encoder.vcxproj -> C:\Users\schidani\Desktop\gpr\build\source\lib\vc5_encoder\Debug\vc5_encoder.lib
11>Done building project "vc5_encoder.vcxproj".
12>------ Build started: Project: xmp_core, Configuration: Debug Win32 ------
12>ExpatAdapter.cpp
4>dng_rect.cpp
4>dng_ref_counted_block.cpp
4>dng_reference.cpp
4>dng_render.cpp
4>dng_resample.cpp
4>dng_shared.cpp
12>ParseRDF.cpp
4>dng_simple_image.cpp
4>dng_spline.cpp
4>dng_stream.cpp
4>dng_string.cpp
4>dng_string_list.cpp
4>dng_tag_types.cpp
12>UnicodeConversions.cpp
4>dng_temperature.cpp
4>dng_tile_iterator.cpp
4>dng_tone_curve.cpp
4>Generating Code...
12>WXMPIterator.cpp
4>Compiling...
4>dng_utils.cpp
4>dng_validate.cpp
4>dng_xmp.cpp
12>WXMPMeta.cpp
4>dng_xmp_sdk.cpp
4>dng_xy_coord.cpp
4>Generating Code...
12>WXMPUtils.cpp
12>XML_Node.cpp
12>XMPCore_Impl.cpp
12>XMPIterator.cpp
12>XMPMeta-GetSet.cpp
12>XMPMeta-Parse.cpp
12>XMPMeta-Serialize.cpp
12>XMPMeta.cpp
12>XMPUtils-FileInfo.cpp
12>XMPUtils.cpp
12>XMP_LibUtils.cpp
12>C:\Users\schidani\Desktop\gpr\source\lib\xmp_core\XMP_LibUtils.cpp(421): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
12>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\stdio.h(1961): note: see declaration of '_snprintf'
12>C:\Users\schidani\Desktop\gpr\source\lib\xmp_core\XMP_LibUtils.cpp(504): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
12>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\stdio.h(1961): note: see declaration of '_snprintf'
12>Generating Code...
4>dng_sdk.vcxproj -> C:\Users\schidani\Desktop\gpr\build\source\lib\dng_sdk\Debug\dng_sdk.lib
13>------ Build started: Project: vc5_decoder_app, Configuration: Debug Win32 ------
12>xmp_core.vcxproj -> C:\Users\schidani\Desktop\gpr\build\source\lib\xmp_core\Debug\xmp_core.lib
12>Done building project "xmp_core.vcxproj".
14>------ Build started: Project: gpr_tools, Configuration: Debug Win32 ------
14>gpr_parse_utils.cpp
13>main.cpp
14>gpr_print_utils.cpp
13>vc5_decoder_app.vcxproj -> C:\Users\schidani\Desktop\gpr\build\source\app\vc5_decoder_app\Debug\vc5_decoder_app.exe
15>------ Build started: Project: vc5_encoder_app, Configuration: Debug Win32 ------
14>main.cpp
14>Generating Code...
15>main.cpp
14>main_c.c
15>vc5_encoder_app.vcxproj -> C:\Users\schidani\Desktop\gpr\build\source\app\vc5_encoder_app\Debug\vc5_encoder_app.exe
14>LINK : fatal error LNK1104: cannot open file '..\..\lib\expat_lib\Debug\expat_lib.lib'
14>Done building project "gpr_tools.vcxproj" -- FAILED.
16>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ------
16>Project not selected to build for this solution configuration 
========== Build: 13 succeeded, 2 failed, 0 up-to-date, 1 skipped ==========

My system:
Windows Server 2022 Standard
Visual Studio 2017 Professional (trial version)

Please let me know if you require more information.

Thank you,
dsethz

rggb12p pixel format issues

Has this been verified working? if so what format does it expect for a RAW input file?

I've created a 12bit packed byte array and all my outputs have tons of artifacting due to what I imagine is incorrect demosaicing?

my camera's bayer sensor is BGGR so its flipped to match the expected input of RGGB.

It's 3280 x 2464 packed at 12bpp

I can verify my output is correct when I view the same byte array within a custom encoded dng
sample.zip

gpr_buffer.c int32_t cast

On line 37 of gpr_buffer.c, there's this line:

`buffer->size = (int32_t) ftell(fIN);`

However, buffer->size is a size_t and ftell returns a size_t. I am not sure why there is a cast to a int32_t here.

generate .exe

Hello, i am quite new to programming, somehow managed to run cmake to compile in a windows 10 computer, then have no idea what to do next to generate a .exe file, any instructions?

PS, just want to convert use gpr_tools to convert .gpr to .dng.

Many thanks!

Could not decode

Some of the images captured with a GoPro Hero 7 Black aren't converting.

Doing:
gpr_tools -i GOPR0141.GPR -o GOPR0141.DNG

Some I get:
"Could not decode input vc5 bitstream. Error number 5"
And others:
"Could not decode input vc5 bitstream. Error number 11"

On 24 images I had 6 with errors.

Where are the binaries?

Hi,

I've run the 3 steps

$ mkdir build
$ cd build
$ cmake ../

written in your README to build the Project. Where can I now find the binaries?

Here is the output from my git clone and cmake:

$ git clone https://github.com/gopro/gpr
Klone nach 'gpr' ...
remote: Counting objects: 410, done.
remote: Total 410 (delta 0), reused 0 (delta 0), pack-reused 410
Empfange Objekte: 100% (410/410), 9.81 MiB | 4.20 MiB/s, Fertig.
Löse Unterschiede auf: 100% (67/67), Fertig.
gpr/build$ cmake ../
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Git current branch: master
-- Git commit hash: af95987
-- Found source/lib/vc5_decoder - enabling vc5 decoder and setting GPR_READING=1
-- Found source/lib/vc5_encoder - enabling vc5 encoder and setting GPR_WRITING=1
-- Found source/lib/tiny_jpeg - enabling jpeg writing and setting GPR_JPEG_AVAILABLE=1
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tobias/dev/gpr/build
tobias@tobias-Precision-M2800:~/dev/gpr/build$ ls
CMakeCache.txt  CMakeFiles  cmake_install.cmake  Makefile  source

"gpr_tools -i GOPR0020.GPR -o GOPR0020.JPG -r 1:1" failed

The command "gpr_tools -i GOPR0020.GPR -o GOPR0020.JPG -r 1:1" failed:

$ ./gpr_tools -i GOPR0020.GPR -o GOPR0020.JPG -r 1:1
[    0-ms]  GPR Tools Version 1.0.0 [master @ af95987] [Linux][GCC 7.3.0][64 bit] 
[    0-ms]  Input File: GOPR0020.GPR 
[    0-ms]  Output File: GOPR0020.JPG 
[   12-ms] [BEG] gpr_convert_gpr_to_rgb() /home/tobias/dev/gpr/source/lib/gpr_sdk/private/gpr.cpp (line 1695)
Could not decode input vc5 bitstream. Error number 20
gpr_tools: /home/tobias/dev/gpr/source/lib/gpr_sdk/private/gpr.cpp:1735: bool gpr_convert_gpr_to_rgb(const gpr_allocator*, GPR_RGB_RESOLUTION, int, gpr_buffer*, gpr_rgb_buffer*): Assertion `0' failed.

Debian arm64 compile runs into "unable to figure out byte order"

After running the make command.

After composing most of this issue, I tested on an x86 machine with success, and that would satisfy my use case, but the world is going more towards arm64

Honestly, with my limited level of competence with CMake et all, title is most of what I can provide at this time. But I have done all the googling I can. Please let me know if I can elaborate.

[ 31%] Building CXX object source/lib/dng_sdk/CMakeFiles/dng_sdk.dir/dng_1d_function.cpp.o
In file included from /home/reid/code/gpr/source/lib/dng_sdk/dng_types.h:21,
                 from /home/reid/code/gpr/source/lib/dng_sdk/dng_1d_function.h:26,
                 from /home/reid/code/gpr/source/lib/dng_sdk/dng_1d_function.cpp:16:
/home/reid/code/gpr/source/lib/dng_sdk/dng_flags.h:145:2: error: #error Unable to figure out byte order.
 #error Unable to figure out byte order.
  ^~~~~
make[2]: *** [source/lib/dng_sdk/CMakeFiles/dng_sdk.dir/build.make:63: source/lib/dng_sdk/CMakeFiles/dng_sdk.dir/dng_1d_function.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:429: source/lib/dng_sdk/CMakeFiles/dng_sdk.dir/all] Error 2
make: *** [Makefile:84: all] Error 2```

Publish to homebrew

It will be useful to have gprtools as homebrew formula to simplify installation on Mac OS X. To do that this repository should have at least one release with tagged version. Could you make it?

GoPro Fusion lens info

Hi!

I have a question about GoPro Fusion camera. I want to process raw files in my software, so users will have ability to use this camera more simple way. I interested in some kind of API or documentation about EXIF data. Тo be precise I searching info about lens calibration, location of center of photo, and size of fisheye image for both front and back camera.

Can I get this information from GPR file with EXIF or other tool?
Can I find explanation of EXIF date, for example, SHFX, CTRX, SIZW and other.

Thanks!

Feature Request: Support for Other Cameras

Would be nice to extend GPR for other cameras. For instance, each raw file from my Nikon D600 is 33MB. Files this big are slow to load, because their loading is I/O bound. If GPR can store RAW files that are significantly smaller that what is possible with DNG, they would load faster and take less space.

cmake installation in windows 11 failing

Hi,
I've been trying to get this running on windows 11 but without any luck. Can someone help me to figure out what is happening? The step to generate the makefiles seem to be going fine. But after that when I'm using mingw32-make it's throwing a bunch of errors.

PS C:\Users\Debadri\gpr\build> mingw32-make
[  4%] Built target common
[ 10%] Built target vc5_common
[ 18%] Built target vc5_decoder
[ 19%] Built target md5_lib
[ 20%] Built target argument_parser
[ 21%] Built target vc5_decoder_app
[ 28%] Built target vc5_encoder
[ 30%] Built target vc5_encoder_app
[ 31%] Building CXX object source/lib/dng_sdk/CMakeFiles/dng_sdk.dir/dng_pthread.cpp.obj
In file included from C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp:14:
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:174:24: error: conflicting declaration 'typedef long int dng_pthread_once_t'
  174 | #define pthread_once_t dng_pthread_once_t
      |                        ^~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:89:36: note: previous declaration as 'typedef struct _dng_pthread_once_t dng_pthread_once_t'
   89 | typedef struct _dng_pthread_once_t dng_pthread_once_t;
      |                                    ^~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:175:23: error: conflicting declaration 'typedef unsigned int dng_pthread_key_t'
  175 | #define pthread_key_t dng_pthread_key_t
      |                       ^~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:78:23: note: previous declaration as 'typedef long unsigned int dng_pthread_key_t'
   78 | typedef unsigned long dng_pthread_key_t;
      |                       ^~~~~~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32/bits/gthr-default.h:35,
                 from C:/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32/bits/gthr.h:148,
                 from C:/msys64/mingw64/include/c++/11.2.0/ext/atomicity.h:35,
                 from C:/msys64/mingw64/include/c++/11.2.0/bits/shared_ptr_base.h:61,
                 from C:/msys64/mingw64/include/c++/11.2.0/bits/shared_ptr.h:53,
                 from C:/msys64/mingw64/include/c++/11.2.0/memory:77,
                 from C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp:42:
C:/msys64/mingw64/include/pthread.h:186:13: error: conflicting declaration 'typedef int pthread_rwlockattr_t'
  186 | typedef int pthread_rwlockattr_t;
      |             ^~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp:14:
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:145:15: note: previous declaration as 'typedef void* pthread_rwlockattr_t'
  145 | typedef void *pthread_rwlockattr_t;
      |               ^~~~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:171:19: error: conflicting declaration 'typedef uintptr_t dng_pthread_t'
  171 | #define pthread_t dng_pthread_t
      |                   ^~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:74:23: note: previous declaration as 'typedef long unsigned int dng_pthread_t'
   74 | typedef unsigned long dng_pthread_t;
      |                       ^~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:193:24: error: using typedef-name 'dng_pthread_attr_t' after 'struct'
  193 | #define pthread_attr_t dng_pthread_attr_t
      |                        ^~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:94:39: note: 'dng_pthread_attr_t' has a previous declaration here
   94 | typedef struct dng_pthread_attr_impl *dng_pthread_attr_t;
      |                                       ^~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:193:24: error: conflicting declaration 'typedef int dng_pthread_attr_t'
  193 | #define pthread_attr_t dng_pthread_attr_t
      |                        ^~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:94:39: note: previous declaration as 'typedef struct dng_pthread_attr_impl* dng_pthread_attr_t'
   94 | typedef struct dng_pthread_attr_impl *dng_pthread_attr_t;
      |                                       ^~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:193:24: error: using typedef-name 'dng_pthread_attr_t' after 'struct'
  193 | #define pthread_attr_t dng_pthread_attr_t
      |                        ^~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:94:39: note: 'dng_pthread_attr_t' has a previous declaration here
   94 | typedef struct dng_pthread_attr_impl *dng_pthread_attr_t;
      |                                       ^~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:172:25: error: conflicting declaration 'typedef intptr_t dng_pthread_mutex_t'
  172 | #define pthread_mutex_t dng_pthread_mutex_t
      |                         ^~~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:76:40: note: previous declaration as 'typedef struct dng_pthread_mutex_impl* dng_pthread_mutex_t'
   76 | typedef struct dng_pthread_mutex_impl *dng_pthread_mutex_t;
      |                                        ^~~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:173:24: error: conflicting declaration 'typedef intptr_t dng_pthread_cond_t'
  173 | #define pthread_cond_t dng_pthread_cond_t
      |                        ^~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:77:39: note: previous declaration as 'typedef struct dng_pthread_cond_impl* dng_pthread_cond_t'
   77 | typedef struct dng_pthread_cond_impl *dng_pthread_cond_t;
      |                                       ^~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:226:26: error: conflicting declaration 'typedef intptr_t dng_pthread_rwlock_t'
  226 | #define pthread_rwlock_t dng_pthread_rwlock_t
      |                          ^~~~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:144:41: note: previous declaration as 'typedef struct dng_pthread_rwlock_impl* dng_pthread_rwlock_t'
  144 | typedef struct dng_pthread_rwlock_impl *dng_pthread_rwlock_t;
      |                                         ^~~~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:191:23: error: expected ')' before 't1'
  191 | #define pthread_equal dng_pthread_equal
      |                       ^~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:92:36: note: to match this '('
   92 | #define dng_pthread_equal(t1, t2) ((t1) == (t2))
      |                                    ^
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:191:23: error: expected ')' before 't1'
  191 | #define pthread_equal dng_pthread_equal
      |                       ^~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:92:35: note: to match this '('
   92 | #define dng_pthread_equal(t1, t2) ((t1) == (t2))
      |                                   ^
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:212:27: error: conflicting declaration of C function 'int dng_pthread_cond_init(dng_pthread_cond_impl**, const pthread_condattr_t*)'
  212 | #define pthread_cond_init dng_pthread_cond_init
      |                           ^~~~~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:119:5: note: previous declaration 'int dng_pthread_cond_init(dng_pthread_cond_impl**, void*)'
  119 | int dng_pthread_cond_init(dng_pthread_cond_t *cond, void * /* attrs */);
      |     ^~~~~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:215:32: error: conflicting declaration of C function 'int dng_pthread_cond_timedwait(dng_pthread_cond_impl**, dng_pthread_mutex_impl**, const dng_timespec*)'
  215 | #define pthread_cond_timedwait dng_pthread_cond_timedwait
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:122:5: note: previous declaration 'int dng_pthread_cond_timedwait(dng_pthread_cond_impl**, dng_pthread_mutex_impl**, dng_timespec*)'
  122 | int dng_pthread_cond_timedwait(dng_pthread_cond_t *cond, dng_pthread_mutex_t *mutex, timespec *latest_time);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:207:28: error: conflicting declaration of C function 'int dng_pthread_mutex_init(dng_pthread_mutex_impl**, const pthread_mutexattr_t*)'
  207 | #define pthread_mutex_init dng_pthread_mutex_init
      |                            ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:114:5: note: previous declaration 'int dng_pthread_mutex_init(dng_pthread_mutex_impl**, void*)'
  114 | int dng_pthread_mutex_init(dng_pthread_mutex_t *mutex, void * /* attrs */);
      |     ^~~~~~~~~~~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32/bits/gthr.h:148,
                 from C:/msys64/mingw64/include/c++/11.2.0/ext/atomicity.h:35,
                 from C:/msys64/mingw64/include/c++/11.2.0/bits/shared_ptr_base.h:61,
                 from C:/msys64/mingw64/include/c++/11.2.0/bits/shared_ptr.h:53,
                 from C:/msys64/mingw64/include/c++/11.2.0/memory:77,
                 from C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp:42:
C:/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32/bits/gthr-default.h: In function 'int __gthread_cond_timedwait(dng_pthread_cond_impl**, dng_pthread_mutex_impl**, const __gthread_time_t*)':
C:/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32/bits/gthr-default.h:872:61: error: invalid conversion from 'const __gthread_time_t*' {aka 'const dng_timespec*'} to 'dng_timespec*' [-fpermissive]
  872 |   return __gthrw_(pthread_cond_timedwait) (__cond, __mutex, __abs_timeout);
      |                                                             ^~~~~~~~~~~~~
      |                                                             |
      |                                                             const __gthread_time_t* {aka const dng_timespec*}
In file included from C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp:14:
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.h:122:96: note:   initializing argument 3 of 'int dng_pthread_cond_timedwait(dng_pthread_cond_impl**, dng_pthread_mutex_impl**, dng_timespec*)'
  122 | int dng_pthread_cond_timedwait(dng_pthread_cond_t *cond, dng_pthread_mutex_t *mutex, timespec *latest_time);
      |                                                                                                ^
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp: In member function 'dng_pthread_mutex_impl& dng_pthread_mutex_impl::operator=(const dng_pthread_mutex_impl&)':
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp:78:77: warning: no return statement in function returning non-void [-Wreturn-type]
   78 |         dng_pthread_mutex_impl &operator=(const dng_pthread_mutex_impl &) { }
      |                                                                             ^
      |                                                                             return *this;
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp: In member function 'dng_pthread_cond_impl& dng_pthread_cond_impl::operator=(const dng_pthread_cond_impl&)':
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp:98:75: warning: no return statement in function returning non-void [-Wreturn-type]
   98 |         dng_pthread_cond_impl &operator=(const dng_pthread_cond_impl &) { }
      |                                                                           ^
      |                                                                           return *this;
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp: In member function '{anonymous}::ScopedLock& {anonymous}::ScopedLock::operator=(const {anonymous}::ScopedLock&)':
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp:125:61: warning: no return statement in function returning non-void [-Wreturn-type]
  125 |                 ScopedLock &operator=(const ScopedLock &) { }
      |                                                             ^
      |                                                             return *this;
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp: In function 'int dng_pthread_create(dng_pthread_t*, dng_pthread_attr_impl* const*, void* (*)(void*), void*)':
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp:316:22: warning: 'template<class> class std::auto_ptr' is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations]
  316 |                 std::auto_ptr<trampoline_args> args(new (std::nothrow) trampoline_args);
      |                      ^~~~~~~~
In file included from C:/msys64/mingw64/include/c++/11.2.0/memory:76,
                 from C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp:42:
C:/msys64/mingw64/include/c++/11.2.0/bits/unique_ptr.h:57:28: note: declared here
   57 |   template<typename> class auto_ptr;
      |                            ^~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp:317:22: warning: 'template<class> class std::auto_ptr' is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations]
  317 |                 std::auto_ptr<void *> resultHolder(new (std::nothrow) (void *));
      |                      ^~~~~~~~
In file included from C:/msys64/mingw64/include/c++/11.2.0/memory:76,
                 from C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp:42:
C:/msys64/mingw64/include/c++/11.2.0/bits/unique_ptr.h:57:28: note: declared here
   57 |   template<typename> class auto_ptr;
      |                            ^~~~~~~~
C:\Users\Debadri\gpr\source\lib\dng_sdk\dng_pthread.cpp:334:39: warning: NULL used in arithmetic [-Wpointer-arith]
  334 |                         if (result == NULL)
      |                                       ^~~~
mingw32-make[2]: *** [source\lib\dng_sdk\CMakeFiles\dng_sdk.dir\build.make:706: source/lib/dng_sdk/CMakeFiles/dng_sdk.dir/dng_pthread.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:513: source/lib/dng_sdk/CMakeFiles/dng_sdk.dir/all] Error 2
mingw32-make: *** [Makefile:90: all] Error 2

Please let me know if any further information is required.
OS - Windows 11
VS - 2022

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.