Skip to content

Commit

Permalink
Invert Level Coding and Scalar Mode
Browse files Browse the repository at this point in the history
Level Coding references Scalar Mode so should come after
  • Loading branch information
JeromeMartinez committed May 26, 2020
1 parent 7872906 commit b1fbc64
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions ffv1.md
Original file line number Diff line number Diff line change
Expand Up @@ -689,19 +689,6 @@ if (run_count == 0 && run_mode == 1) { |

The `log2_run` array is also used within [@ISO.14495-1.1999].

##### Level Coding

Level coding is identical to the normal difference coding with the exception that the 0 value is removed as it cannot occur:

```c
diff = get_vlc_symbol(context_state);
if (diff >= 0) {
diff++;
}
```
Note, this is different from JPEG-LS, which doesn’t use prediction in run mode and uses a different encoding and context model for the last difference. On a small set of test `Samples` the use of prediction slightly improved the compression rate.
#### Scalar Mode

Each difference is coded with the per context mean prediction removed and a per context value for k.
Expand Down Expand Up @@ -747,6 +734,19 @@ get_vlc_symbol(state) {
}
```
##### Level Coding
Level coding is identical to the normal difference coding with the exception that the 0 value is removed as it cannot occur:
```c
diff = get_vlc_symbol(context_state);
if (diff >= 0) {
diff++;
}
```

Note, this is different from JPEG-LS, which doesn’t use prediction in run mode and uses a different encoding and context model for the last difference. On a small set of test `Samples` the use of prediction slightly improved the compression rate.

#### Initial Values for the VLC context state

At keyframes all coder state variables are set to their initial state.
Expand Down

0 comments on commit b1fbc64

Please sign in to comment.