Subject: [Cellar] [PATCH] Add definition of Line()

From: Jerome Martinez <[email-masked]>
Date: Sat, 18 Jun 2016 16:17:39 +0200

the algorithm is similar for both colorspaces, but I preferred to 
separate them in order to have coherency with the descriptions in 
SliceContent().
From 931321787dd3699bc671cb0dee6016d8126612cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= <[email-masked]>
Date: Sat, 18 Jun 2016 16:17:05 +0200
Subject: [PATCH] Add definition of Line()

Also define slice_pixel_width, slice_pixel_x
and plane_pixel_width[ p ]
---
 ffv1.md | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/ffv1.md b/ffv1.md
index 395fecc..cb79ab3 100644
--- a/ffv1.md
+++ b/ffv1.md
@@ -652,6 +652,30 @@ Its value is &lfloor;( slice\_y + slice\_height ) * slice\_pixel\_height / num\_
 **slice\_pixel\_y** is the slice vertical position in pixels.  
 Its value is &lfloor;slice_y * frame\_pixel\_height / num\_v\_slices&rfloor;
 
+## Line
+
+|                                                                      |
+|--------------------------------------------------------------|:------|
+|Line( p, y ) {                                                | type  |
+|    if( colorspace\_type == 0) {                              |       |
+|        for( x = 0; x \< plane\_pixel\_width[ p ]; x++ )      |       |
+|            Pixel( p, y, x )                                  |       |
+|    } else if( colorspace\_type == 1 ) {                      |       |
+|        for( x = 0; x \< slice\_pixel\_width; x++ )           |       |
+|            Pixel( p, y, x )                                  |       |
+|    }                                                         |       |
+|}                                                             |       |
+
+**plane\_pixel\_width[ p ]** is the width in pixels of plane p of the slice.  
+plane\_pixel\_width[ 0 ] and plane\_pixel\_width[ 1 + ( chroma\_planes ? 2 : 0 ) ] value is slice\_pixel\_width  
+if chroma\_planes is set to 1, plane\_pixel\_width[ 1 ] and plane\_pixel\_width[ 2 ] value is &lceil;slice\_pixel\_width / v\_chroma\_subsample&rceil;
+
+**slice\_pixel\_width** is the width in pixels of the slice.  
+Its value is &lfloor;( slice\_x + slice\_width ) * slice\_pixel\_width / num\_h\_slices&rfloor; - slice\_pixel\_x  
+
+**slice\_pixel\_x** is the slice horizontal position in pixels.  
+Its value is &lfloor;slice_x * frame\_pixel\_width / num\_h\_slices&rfloor;
+
 ## Slice Footer
 
 Note: slice footer is always byte aligned.
-- 
2.7.0.windows.1

---

From: Michael Niedermayer <[email-masked]>
Date: Sat, 18 Jun 2016 17:42:29 +0200

> beffc7fb6d5128a2ef8d1232dead12b7c187c1b7  0001-Add-definition-of-Line.patch

applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.