Subject: [Cellar] [PATCH FFV1] Remove slice_count reference

From: Jerome Martinez <[email-masked]>
Date: Tue, 31 May 2016 21:17:36 +0200

slice_count is used but not defined.
It is actually not in the bistream, so we remove it from the spec.

I also remove "i" from "Slice ( i )" because the current usage is not 
coherent: either we use "i" everywhere (slice_y [ i ], picture_structure 
[ i ], slice_crc_parity [ i ]...) or nowhere, and avoiding it simplifies 
the spec without having misunderstanding (we explicitly say that slices 
are independent).

From 89508033906c9d93df9d797262d5bfbbce69a4c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= <[email-masked]>
Date: Tue, 31 May 2016 20:35:31 +0200
Subject: [PATCH] Remove slice_count reference

slice_count is used but not defined.
It is actually not in the bistream, so we remove it from the spec.

"i" in Slice ( i ) is also removed in order to have coherency
in the spec.
---
 ffv1.md | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/ffv1.md b/ffv1.md
index 84d96b4..a503d6c 100644
--- a/ffv1.md
+++ b/ffv1.md
@@ -518,23 +518,25 @@ See [NUT](#references) for more information about elements.
 
 ## Frame
 
+A frame consists of the keyframe field, parameters (if version <=1), and a sequence of independent slices.
+
 |                                                        |
 |---------------------------------------------------|---:|
 |Frame( ) {                                         |type|
 |    keyframe                                       |  br|
 |    if( keyframe && !ConfigurationRecordIsPresent )|    |
 |         Parameters( )                             |    |
-|    for( i = 0; i \< slice\_count; i++ )           |    |
-|        Slice( i )                                 |    |
+|    while ( remaining\_bits\_in\_bitstream() )     |    |
+|        Slice( )                                   |    |
 |}                                                  |    |
 
 ## Slice
 
 |                                                                    |
 |------------------------------------------------------------|:------|
-|Slice( i ) {                                                | type  |
+|Slice( ) {                                                  | type  |
 |    if( version \>= 3 )                                     |       |
-|        SliceHeader( i )                                    |       |
+|        SliceHeader( )                                      |       |
 |    SliceContent( )                                         |       |
 |    if ( coder\_type == 0 )                                 |       |
 |        while ( !byte\_aligned() )                          |       |
@@ -550,13 +552,13 @@ MUST be 0.
 
 |                                                            |    |
 |------------------------------------------------------------|---:|
-| SliceHeader( i ) {                                         |type|
+| SliceHeader( ) {                                           |type|
 |    slice\_x                                                | ur |
 |    slice\_y                                                | ur |
 |    slice\_width - 1                                        | ur |
 |    slice\_height - 1                                       | ur |
-|    for( j = 0; j \< quant\_table\_index\_count; j++ )      |    |
-|        quant\_table\_index [ i ][ j ]                      | ur |
+|    for( i = 0; i \< quant\_table\_index\_count; i++ )      |    |
+|        quant\_table\_index [ i ]                           | ur |
 |    picture\_structure                                      | ur |
 |    sar\_num                                                | ur |
 |    sar\_den                                                | ur |
@@ -808,8 +810,6 @@ Inferred to be 0 if not present.
 pred = j ? initial\_states[ i ][j - 1][ k ] : 128
 initial\_state[ i ][ j ][ k ] = ( pred + initial\_state\_delta[ i ][ j ][ k ] ) & 255
 
-**slice\_count** indicates the number of slices in the current frame, slice\_count is 1 if it is not explicitly coded.
-
 **ec** indicates the error detection/correction type.
 
 |value | error detection/correction type          |
-- 
2.7.0.windows.1