

<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.amigaos.net/w/index.php?action=history&amp;feed=atom&amp;title=YUVN_IFF_YUV_Image_Data</id>
	<title>YUVN IFF YUV Image Data - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.amigaos.net/w/index.php?action=history&amp;feed=atom&amp;title=YUVN_IFF_YUV_Image_Data"/>
	<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=YUVN_IFF_YUV_Image_Data&amp;action=history"/>
	<updated>2026-05-06T17:20:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=YUVN_IFF_YUV_Image_Data&amp;diff=2099&amp;oldid=prev</id>
		<title>Steven Solie: Created page with &quot;= YUVN =  &lt;pre&gt; For storage of Y:U:V image data (MacroSystem)   yuvn.doc: ---------------------------------------------------------------------------                          ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=YUVN_IFF_YUV_Image_Data&amp;diff=2099&amp;oldid=prev"/>
		<updated>2012-05-10T19:33:59Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= YUVN =  &amp;lt;pre&amp;gt; For storage of Y:U:V image data (MacroSystem)   yuvn.doc: ---------------------------------------------------------------------------                          ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= YUVN =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
For storage of Y:U:V image data (MacroSystem)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
yuvn.doc:&lt;br /&gt;
---------------------------------------------------------------------------&lt;br /&gt;
                                 FORM YUVN&lt;br /&gt;
                               developed by:&lt;br /&gt;
                  MS MacroSystem Computer GmbH (Germany)&lt;br /&gt;
                              Henning Friedl&lt;br /&gt;
                                 (18.4.92)&lt;br /&gt;
---------------------------------------------------------------------------&lt;br /&gt;
FORM YUVN&lt;br /&gt;
&lt;br /&gt;
The IFF-format YUVN is designed to store YUV-pictures which mainly are used&lt;br /&gt;
in  broadcast  television.   YUVN  supports CCIR-601-2 which is a worldwide&lt;br /&gt;
standard for PAL- and NTSC-television.&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------------------------------&lt;br /&gt;
Chunk &amp;#039;YCHD&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The  required property &amp;#039;YCHD&amp;#039; holds a header which describes the dimensions&lt;br /&gt;
of  the  image and some other information which are necessary to understand&lt;br /&gt;
the data in the following data-chunks.  The chunk &amp;#039;YCHD&amp;#039; must appear before&lt;br /&gt;
the first data-chunk (&amp;#039;DATY&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
You will find all definitions of this chunk in the file &amp;#039;yuvn.i&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Explanations on the components of the chunk &amp;#039;YCHD&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ychd_Width&lt;br /&gt;
&lt;br /&gt;
ychd_Width  indicates  the  width of the stored image.  Using YUV_MODE_411,&lt;br /&gt;
the width must be a multiple of four, usind YUV_MODE_422 or YUV_MODE_211 it&lt;br /&gt;
must  be a multiple of two!  Using YUV_MODE_444, YUV_MODE_400, YUV_MODE_222&lt;br /&gt;
or YUV_MODE_200 width may be any value.&lt;br /&gt;
&lt;br /&gt;
The  number  of U- and V-pixels per line depends on the used YUV_MODE.  See&lt;br /&gt;
the table below for details.&lt;br /&gt;
&lt;br /&gt;
            Mode             |    Y-pixels    |    U-pixels    |    V-pixels&lt;br /&gt;
-----------------------------+----------------+----------------+---------------&lt;br /&gt;
YCHD_MODE_400, YCHD_MODE_200 | ychd_Width     |       -        |       -&lt;br /&gt;
YCHD_MODE_411                | ychd_Width (4) | ychd_Width / 4 | ychd_Width / 4&lt;br /&gt;
YCHD_MODE_422, YCHD_MODE_211 | ychd_Width (2) | ychd_Width / 2 | ychd_Width / 2&lt;br /&gt;
YCHD_MODE_444, YCHD_MODE_222 | ychd_Width     |   ychd_Width   |   ychd_Width&lt;br /&gt;
&lt;br /&gt;
(2) means, in this mode ychd_Width MUST be a multiple of two!&lt;br /&gt;
(4) means, in this mode ychd_Width MUST be a multiple of four!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ychd_Height&lt;br /&gt;
&lt;br /&gt;
ychd_Height  indicates  the  height  (number  of  rows) of the image.  If a&lt;br /&gt;
full-frame picture is stored, ychd_Height must be a multiple of two!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ychd_PageWidth, ychd_PageHeight&lt;br /&gt;
&lt;br /&gt;
These  fields describe the dimensions of the source page.  The image itself&lt;br /&gt;
can  be  smaller  or  larger.   If  not  used,  set  this to ychd_Width and&lt;br /&gt;
ychd_Height.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ychd_LeftEdge, ychd_TopEdge&lt;br /&gt;
&lt;br /&gt;
These  fields  indicate  the  desired  position  of  this  image within the&lt;br /&gt;
destination picture.  If not used, set to 0,0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ychd_xAspect, ychd_yAspect&lt;br /&gt;
&lt;br /&gt;
The aspect ratio of a single pixel in the stored image.  If you do not know&lt;br /&gt;
the correct values (you should know them) use the following:&lt;br /&gt;
&lt;br /&gt;
PAL-nonlace:   22/44           NTSC-nonlace:  22/52&lt;br /&gt;
PAL-lace:      22/22           NTSC-lace:     22/26&lt;br /&gt;
&lt;br /&gt;
See also: &amp;#039;Finding the Aspect Ratio&amp;#039; by Carolyn Scheppner (AmigaMail 9/10-91)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ychd_Compress&lt;br /&gt;
&lt;br /&gt;
Type of compression.  0, if none.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ychd_Flags&lt;br /&gt;
&lt;br /&gt;
Different  Flags.  Currently only bit-0 (YCHDB_LACE) is defined.  It should&lt;br /&gt;
be  set if the stored image has been a full-frame image within an interlace&lt;br /&gt;
video-source (TV, VTR, ...).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ychd_Mode&lt;br /&gt;
&lt;br /&gt;
The type of YUV-format.  If you only want to save the luminance information&lt;br /&gt;
(black-and-white)   set  ychd_Mode  to  YCHD_MODE_400.   If  you  save  the&lt;br /&gt;
additional color-difference-signals U and V set ychd_Mode to YCHD_MODE_411,&lt;br /&gt;
YCHD_MODE_422  or  YCHD_MODE_444  depending  what  format you want to save.&lt;br /&gt;
With lores-pictures use YCHD_MODE_200, YCHD_MODE_211 or YCHD_MODE_222.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ychd_Norm&lt;br /&gt;
&lt;br /&gt;
Information  on  the TV-system you got this picture from.  If you really do&lt;br /&gt;
not  know  set ychd_Norm to YCHD_NORM_UNKNOWN.  The better way is to set it&lt;br /&gt;
to the correct value YCHD_NORM_PAL or YCHD_NORM_NTSC!&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
The data-chunks DATY, DATU and DATV&lt;br /&gt;
&lt;br /&gt;
In  the  IFF-file the chunks DATY, DATU and DATV must appear in this order.&lt;br /&gt;
The optional chunks DATU and DATV are both needed in color-pictures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The data-chunk DATY&lt;br /&gt;
&lt;br /&gt;
The  chunk  DATY  contains the luminance-data (Y) of the YUV-picture.  Each&lt;br /&gt;
pixel  is stored in one byte (8 bits), the values follow the CCIR-standard.&lt;br /&gt;
Y  ranges  from  16 (black) to 235 (white).  Isolated pixels may go lightly&lt;br /&gt;
beyond the limits but 0 and 255 must not appear!&lt;br /&gt;
&lt;br /&gt;
The number of pixels in one line is given in ychd_Width.  One line directly&lt;br /&gt;
follows  the  other,  there  are  no  pad-bytes  between  two lines even if&lt;br /&gt;
ychd_Width  is odd.  Only at the end of the chunk a pad-byte ($00) might be&lt;br /&gt;
inserted according the IFF guidelines.&lt;br /&gt;
&lt;br /&gt;
Within  a  full-frame- (interlaced-) picture the lines are ordered as if it&lt;br /&gt;
was  a  non-lace  picture  (first line, first frame then first line, second&lt;br /&gt;
frame  then second line first frame, ...).  This is the same in IFF-ILBM or&lt;br /&gt;
the order of the bitmaps in Amiga-memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The data-chunks DATU and DATV&lt;br /&gt;
&lt;br /&gt;
The   chunks   DATU   and  DATV  are  optional,  they  have  to  appear  in&lt;br /&gt;
color-pictures because they contain the color-difference-signals.&lt;br /&gt;
&lt;br /&gt;
Each  pixel  is  stored  in  one  byte  (8  bits),  the  values  follow the&lt;br /&gt;
CCIR-standard.   The  values  range  from  16  to  240  (128 means 0).  For&lt;br /&gt;
calculations you have to subtract 128 so U or V are in a range from -112 to&lt;br /&gt;
112  where  0  means  no  color.  Isolated pixels may go lightly beyond the&lt;br /&gt;
limits but 0 and 255 must not appear!&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
yuvn.i:&lt;br /&gt;
---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               IFND      YUVN_I&lt;br /&gt;
YUVN_I         SET       1&lt;br /&gt;
;---------------------------------------------------------------------------&lt;br /&gt;
             IFND        EXEC_TYPES_I&lt;br /&gt;
               INCLUDE   &amp;quot;exec/types.i&amp;quot;&lt;br /&gt;
             ENDC&lt;br /&gt;
;---------------------------------------------------------------------------&lt;br /&gt;
;---- ID&amp;#039;s used in FORM YUVN&lt;br /&gt;
&lt;br /&gt;
ID_YUVN:       equ       &amp;#039;YUVN&amp;#039;             ;the FORM-ID&lt;br /&gt;
ID_YCHD:       equ       &amp;#039;YCHD&amp;#039;             ;the header-chunk-ID&lt;br /&gt;
ID_DATY:       equ       &amp;#039;DATY&amp;#039;             ;the Y-data-chunk-ID&lt;br /&gt;
ID_DATU:       equ       &amp;#039;DATU&amp;#039;             ;the U-data-chunk-ID&lt;br /&gt;
ID_DATV:       equ       &amp;#039;DATV&amp;#039;             ;the V-data-chunk-ID&lt;br /&gt;
&lt;br /&gt;
;---- values for ychd_Compress&lt;br /&gt;
&lt;br /&gt;
COMPRESS_NONE  equ       0                  ;no comression&lt;br /&gt;
&lt;br /&gt;
;---- values for ychd_Flags&lt;br /&gt;
&lt;br /&gt;
YCHDB_LACE     equ       0                  ;if set the data-chunks contain&lt;br /&gt;
YCHDF_LACE     equ       1                  ;a full-frame (interlaced) picture&lt;br /&gt;
&lt;br /&gt;
;---- values for ychd_Mode&lt;br /&gt;
&lt;br /&gt;
YCHD_MODE_400     equ    0       ;a black-and-white picture (no DATU and DATV)&lt;br /&gt;
YCHD_MODE_411     equ    1       ;a YUV-411 picture&lt;br /&gt;
YCHD_MODE_422     equ    2       ;a YUV-422 picture&lt;br /&gt;
YCHD_MODE_444     equ    3       ;a YUV-444 picture&lt;br /&gt;
&lt;br /&gt;
YCHD_MODE_200     equ    8       ;a lores black-and-white picture&lt;br /&gt;
YCHD_MODE_211     equ    9       ;a lores color picture (422, but lores)&lt;br /&gt;
YCHD_MODE_222     equ    10      ;a lores color picture (444, but lores)&lt;br /&gt;
&lt;br /&gt;
YCHD_MODEB_LORES  equ    3       ;test this bit to check for lores/hires&lt;br /&gt;
YCHD_MODEF_LORES  equ    8&lt;br /&gt;
&lt;br /&gt;
;---- values for ychd_Norm&lt;br /&gt;
&lt;br /&gt;
YCHD_NORM_UNKNOWN equ    0       ;unknown, try to avoid this&lt;br /&gt;
YCHD_NORM_PAL     equ    1       ;PAL 4.433 MHz&lt;br /&gt;
YCHD_NORM_NTSC    equ    2       ;NTSC 3.579 MHz&lt;br /&gt;
&lt;br /&gt;
;---- the FORM-YUVN DataHeader: &amp;#039;YCHD&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 STRUCTURE __YCHD_Header,0&lt;br /&gt;
&lt;br /&gt;
               UWORD     ychd_Width        ;picture width in Y-pixels&lt;br /&gt;
               UWORD     ychd_Height       ;picture height (rows)&lt;br /&gt;
&lt;br /&gt;
               UWORD     ychd_PageWidth    ;source page width &amp;amp; height,&lt;br /&gt;
               UWORD     ychd_PageHeight   ;  normally same as Width and Height&lt;br /&gt;
&lt;br /&gt;
               UWORD     ychd_LeftEdge     ;position within the source page,&lt;br /&gt;
               UWORD     ychd_TopEdge      ;  normally 0,0&lt;br /&gt;
&lt;br /&gt;
               UBYTE     ychd_AspectX      ;pixel aspect (width : height)&lt;br /&gt;
               UBYTE     ychd_AspectY      ;&lt;br /&gt;
               UBYTE     ychd_Compress     ;(see above)&lt;br /&gt;
               UBYTE     ychd_Flags        ;(see above)&lt;br /&gt;
&lt;br /&gt;
               UBYTE     ychd_Mode         ;(see above)&lt;br /&gt;
               UBYTE     ychd_Norm         ;(see above)&lt;br /&gt;
&lt;br /&gt;
               WORD      ychd_reserved2    ;must be 0&lt;br /&gt;
&lt;br /&gt;
               LONG      ychd_reserved3    ;must be 0&lt;br /&gt;
&lt;br /&gt;
               LABEL     ychd_SIZEOF&lt;br /&gt;
;---------------------------------------------------------------------------&lt;br /&gt;
; Warning, the UBYTE fields are byte-packed, C-compilers should not add pad&lt;br /&gt;
; bytes!&lt;br /&gt;
;---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
               ENDC      ; YUVN_I&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steven Solie</name></author>
	</entry>
</feed>