Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAF: extract more details when printing structure #2824

Merged
merged 3 commits into from
Nov 13, 2023
Merged

Conversation

kmilos
Copy link
Collaborator

@kmilos kmilos commented Nov 9, 2023

Going by https://libopenraw.freedesktop.org/formats/raf/ some bytes after the first meta and CFA offset and length were unknown. @hfiguiere

However, I think these are to describe the file layout when the RAF has two sub-images (like the ones from EXR sensors), so I posit it is a specification of some interleaving scheme w/ skip? (haven't seen anything other than 0), chunk size, and stride....

For the FinePix F700 sample from RPU, this now outputs:

STRUCTURE OF RAF FILE: Fujifilm - FinePix F700 - double width 16-bit unpacked little-endian (4_3).RAF
   Address |    Length | Payload
         0 |        16 |        magic : FUJIFILMCCD-RAW
        16 |         4 |        data1 : 0201
        20 |         8 |        data2 : FF390101
        28 |        32 |       camera : FinePix F700
        60 |         4 |      version : 0264
        64 |        20 |      unknown : ...................
        84 |         4 |  JPEG offset : 148
        88 |         4 |  JPEG length : 482850
        92 |         4 | meta offset1 : 483000
        96 |         4 | meta length1 : 2148
       100 |         4 |  CFA offset1 : 487296
       104 |         4 |  CFA length1 : 6382592
       108 |         4 |    CFA skip1 : 0
       112 |         4 |   CFA chunk1 : 2944
       116 |         4 |  CFA stride1 : 5888
       120 |         4 | meta offset2 : 485148
       124 |         4 | meta length2 : 2148
       128 |         4 |  CFA offset2 : 490240
       132 |         4 |  CFA length2 : 6382592
       136 |         4 |    CFA skip2 : 0
       140 |         4 |   CFA chunk2 : 2944
       144 |         4 |  CFA stride2 : 5888
       148 |    482850 |    JPEG data : ....%"Exif..II*
    483000 |      2148 |   meta data1 : ...).....x......
    485148 |      2148 |   meta data2 : ...).....x......
    487296 |   6382592 |    CFA data1 : ...............
    490240 |   6382592 |    CFA data2 : ...............

Note how the offset of the 2nd CFA data payload is one CFA chunk size of 2944 after the 1st one, giving the hint about interleaved chunks.

NB: "CFA length" seems to be the effective one, after deinterleaving.

@kmilos kmilos added the imageHandler Anything related to specific ImageHandlers label Nov 9, 2023
@ghost
Copy link

ghost commented Nov 9, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #2824 (8979e51) into main (3e977c5) will decrease coverage by 0.11%.
Report is 2 commits behind head on main.
The diff coverage is 0.00%.

❗ Current head 8979e51 differs from pull request most recent head 3536e0d. Consider uploading reports for the commit 3536e0d to get more accurate results

@@            Coverage Diff             @@
##             main    #2824      +/-   ##
==========================================
- Coverage   64.00%   63.89%   -0.11%     
==========================================
  Files         103      103              
  Lines       22324    22361      +37     
  Branches    10827    10861      +34     
==========================================
  Hits        14288    14288              
- Misses       5818     5855      +37     
  Partials     2218     2218              
Files Coverage Δ
src/rafimage.cpp 17.15% <0.00%> (-3.15%) ⬇️

src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
src/rafimage.cpp Outdated Show resolved Hide resolved
@kmilos
Copy link
Collaborator Author

kmilos commented Nov 13, 2023

Thanks for all the changes @kevinbackhouse

@kmilos kmilos force-pushed the kmilos/raf_printstruct branch from 60cc144 to 3536e0d Compare November 13, 2023 13:44
@kmilos kmilos merged commit e9ba894 into main Nov 13, 2023
63 checks passed
@mergify mergify bot deleted the kmilos/raf_printstruct branch November 13, 2023 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imageHandler Anything related to specific ImageHandlers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants