Subject: [Cellar] [PATCH FFV1] Multi-threading support and independence of slices

From: Jerome Martinez <[email-masked]>
Date: Tue, 24 May 2016 22:58:44 +0200

This patch adds an appendix with some sentences about how to have 
multi-thread support in the decoder.
From 00d69887bedc5d92bd1df7529e67a500a9d78040 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= <[email-masked]>
Date: Tue, 24 May 2016 22:53:27 +0200
Subject: [PATCH] Multi-threading support and independence of slices

Add an appendix with suggestion about how to parse slices in order
to have Multi-threading support and independence of slices.
---
 ffv1.md | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/ffv1.md b/ffv1.md
index cf26a10..50c9966 100644
--- a/ffv1.md
+++ b/ffv1.md
@@ -856,6 +856,32 @@ For each frame, each position in the slice raster MUST be filled by one and only
 
 For each Frame with keyframe value of 0, each slice MUST have the same value of slice\_x, slice\_y, slice\_width, slice\_height as a slice in the previous frame, except if reset\_contexts is 1.
 
+# Appendixes
+
+## Decoder implementation suggestions
+
+### Multi-threading support and independence of slices
+
+The bitstream is parsable in two ways: in sequential order as described in this document or with the pre-analysis of slice\_size fields. slice\_size fields pre-analysis allows multi-threading as well as independence of slice content (a bitstream error in a slice content has no impact on the decoding of the other slices).
+
+After having checked keyframe field, a decoder SHOULD parse slice_size fields, from slice\_size of the last slice at the end of the frame up to slice\_size of the first slice at the beginning of the frame, before parsing slices, in order to have slices boundaries. A decoder MAY fallback on sequential order e.g. in case of corrupted frame (frame size unknown, slice\_size of slices not coherant...) or if there is no possibility of seek into the stream.
+
+Architecture overwiew of slices in a frame:
+
+|                                                               |
+|:--------------------------------------------------------------|
+| first slice content                                           |
+| first slice slice\_size + error\_status + slice\_crc\_parity  |
+|---------------------------------------------------------------|
+| second slice content                                          |
+| second slice slice\_size + error\_status + slice\_crc\_parity |
+|---------------------------------------------------------------|
+| ...                                                           |
+|---------------------------------------------------------------|
+| last slice content                                            |
+| last slice slice\_size + error\_status + slice\_crc\_parity   |
+
+
 # Changelog
 
 See <https://github.com/FFmpeg/FFV1/commits/master>
-- 
2.7.0.windows.1

---

From: Michael Niedermayer <[email-masked]>
Date: Wed, 25 May 2016 03:39:28 +0200

> dd63bcdf45a5687d57be9cf6b344ff7f38044c6b  0001-Multi-threading-support-and-independence-of-slices.patch

applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway