Author: wmb
Date: Wed Jan 19 08:05:12 2011
New Revision: 2119
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2119
Log:
inflate.c - removed a small vestige of GPL code (a single #define) so the code is clean - based on stuff that Mark Adler's put in the public domain.
Modified:
forth/wrapper/zip/inflate.c
Modified: forth/wrapper/zip/inflate.c
==============================================================================
--- forth/wrapper/zip/inflate.c Tue Jan 18 22:41:32 2011 (r2118)
+++ forth/wrapper/zip/inflate.c Wed Jan 19 08:05:12 2011 (r2119)
@@ -70,12 +70,6 @@
[OK: Changes for Open Firmware by Mike Tuciarone, June 1994.]
*/
-/* gzip.h -- common declarations for all gzip modules
- * Copyright (C) 1992-1993 Jean-loup Gailly.
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License, see the file COPYING.
- */
-
#define u_long unsigned long
#define u_short unsigned short
#define u_char unsigned char
@@ -86,8 +80,7 @@
static int huft_fixed();
static int huft_dynamic();
-/* gzip flag byte */
-#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
+#define FILENAME_PRESENT 0x08 /* flag byte bit meaning filename follows */
/* ROM
* Workspace definitions
@@ -207,7 +200,7 @@
flags = NEXTBYTE;
for (n = 0; n < 6; ++n)
(void) NEXTBYTE;
- if (flags & ORIG_NAME)
+ if (flags & FILENAME_PRESENT)
while (NEXTBYTE)
;
}
Author: wmb
Date: Tue Jan 18 21:33:01 2011
New Revision: 2114
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2114
Log:
IDE driver - added a delay in the probe loop, helpful for some devices.
Modified:
dev/ide/generic.fth
Modified: dev/ide/generic.fth
==============================================================================
--- dev/ide/generic.fth Tue Jan 18 21:28:04 2011 (r2113)
+++ dev/ide/generic.fth Tue Jan 18 21:33:01 2011 (r2114)
@@ -393,6 +393,7 @@
first-open? if
max#drives 0 do
+ d# 80 ms
0 i set-address get-drive-parms if set-drive-cfg then loop
false to first-open?
then
Author: wmb
Date: Mon Jan 17 22:58:06 2011
New Revision: 2111
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2111
Log:
Initial revision of color space converstion code.
Added:
dev/olpc/viacamera/ycrcbtorgb.fth
Added: dev/olpc/viacamera/ycrcbtorgb.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dev/olpc/viacamera/ycrcbtorgb.fth Mon Jan 17 22:58:06 2011 (r2111)
@@ -0,0 +1,141 @@
+\ See license at end of file
+purpose: Color space conversion from YCbCr to RGB
+
+\ R = clip (Y + 1.402 * Cr)
+\ G = clip (Y - 0.344 * Cb - 0.714 * Cr)
+\ B = clip (Y + 1.772 * Cb)
+
+\ This is for full-range YCbCr, where the Y anc Cb/Cr values ranges from 0-255.
+\ For restricted-range YCbCr (16 <= Y <= 235, 16 <= Cr,Cb <= 240), the Y value
+\ would need to be adjusted to Ysc = (Y - 16) * 1.164 (1.164 = 298 / 256 = 149 / 128)
+\ and the multipliers change from (1.402, -0.343, -0.711, 1.765) to (1.596, -0.392, -0.813, 2.017)
+
+code ycrcb444>rgb888 ( y cr cb -- r g b )
+ \ y: 8 [sp]
+ \ u: 4 [sp] = Cr
+ \ v: 0 [sp] = Cb
+
+ d# 128 # 0 [sp] sub \ convert Cb to signed
+ d# 128 # 4 [sp] sub \ convert Cr to signed
+ 8 [sp] bx mov \ Get Y into register
+
+ d# 90 # 4 [sp] ax imul-imm \ Multiply Cr by 1.402 * 64 (actually 1.406)
+ d# 6 # ax sar \ Scale down by 64
+ bx ax add \ Add to Y
+ 0< if ax ax xor then \ Clip to 0
+ d# 255 # ax cmp > if d# 255 # ax mov then \ Clip to 255
+
+ ax 8 [sp] mov \ Put R in place on stack
+
+ d# -46 # 4 [sp] ax imul-imm \ Multiply Cr by -0.714 * 64 (actually -0.719)
+ d# 6 # ax sar \ Scale down by 64
+ ax cx mov
+ d# -22 # 0 [sp] ax imul-imm \ Multiply Cr by -0.344 * 64 (actually -0.344)
+ d# 6 # ax sar \ Scale down by 64
+ ax cx add
+ bx cx add \ Now we have G
+ 0< if cx cx xor then \ Clip to 0
+ d# 255 # cx cmp > if d# 255 # cx mov then \ Clip to 255
+
+ d# 113 # 0 [sp] ax imul-imm \ Multiply Cr by 1.772 * 64 (actually 1.766)
+ d# 6 # ax sar \ Scale down by 64
+ bx ax add \ Add to Y
+ 0< if ax ax xor then \ Clip to 0
+ d# 255 # ax cmp > if d# 255 # ax mov then \ Clip to 255
+ ax 0 [sp] mov \ Put B in place on stack
+
+ cx 4 [sp] mov \ Put G in place on stack
+c;
+
+
+\ This version operates on pixel values in memory
+\ Src bytes are Cb Y1 Cr Y2 (2 pixels)
+\ Dst bytes are R G B A R G B A (2 pixels)
+
+code ycbcr422>rgba8888 ( src dst count -- )
+ 4 [sp] di xchg \ di: dst
+ 8 [sp] si xchg \ si: src
+
+ ax push ax push \ Space on stack for Cr and Cb values
+
+ begin
+ \ src: Cb Y1 Cr Y2 dst: R1 G1 B1 A1 R2 G2 B2 A2
+ ax ax xor al lods d# 128 # ax sub ax 0 [sp] mov \ Get Cb, make signed, save on stack
+ ax ax xor al lods ax bx mov \ Get Y1, save in BX
+ ax ax xor al lods d# 128 # ax sub ax 4 [sp] mov \ Get Cr, make signed, save on stack
+
+ d# 90 # 4 [sp] ax imul-imm \ Multiply Cr by 1.402 * 64 (actually 1.406)
+ d# 6 # ax sar \ Scale down by 64
+ bx ax add \ Add to Y
+
+ 0< if ax ax xor then \ Clip to 0
+ d# 255 # ax cmp > if d# 255 # ax mov then \ Clip to 255
+
+ al stos \ Output R
+
+ d# -46 # 4 [sp] ax imul-imm \ Multiply Cr by -0.714 * 64 (actually -0.719)
+ d# 6 # ax sar \ Scale down by 64
+ ax dx mov
+ d# -22 # 0 [sp] ax imul-imm \ Multiply Cr by -0.344 * 64 (actually -0.344)
+ d# 6 # ax sar \ Scale down by 64
+ dx ax add
+ bx ax add \ Now we have G
+
+ 0< if ax ax xor then \ Clip to 0
+ d# 255 # ax cmp > if d# 255 # ax mov then \ Clip to 255
+
+ al stos \ Output G
+
+ d# 113 # 0 [sp] ax imul-imm \ Multiply Cr by 1.772 * 64 (actually 1.766)
+ d# 6 # ax sar \ Scale down by 64
+ bx ax add \ Add to Y
+
+ 0< if ax ax xor then \ Clip to 0
+ d# 255 # ax cmp > if d# 255 # ax mov then \ Clip to 255
+
+ al stos \ Output B
+ d# 255 # al mov
+ al stos \ Output A
+
+ ax ax xor al lods ax bx mov \ Get Y2 into BX
+
+ d# 90 # 4 [sp] ax imul-imm \ Multiply Cr by 1.402 * 64 (actually 1.406)
+ d# 6 # ax sar \ Scale down by 64
+ bx ax add \ Add to Y
+
+ 0< if ax ax xor then \ Clip to 0
+ d# 255 # ax cmp > if d# 255 # ax mov then \ Clip to 255
+
+ al stos \ Output R
+
+ d# -46 # 4 [sp] ax imul-imm \ Multiply Cr by -0.714 * 64 (actually -0.719)
+ d# 6 # ax sar \ Scale down by 64
+ ax dx mov
+ d# -22 # 0 [sp] ax imul-imm \ Multiply Cr by -0.344 * 64 (actually -0.344)
+ d# 6 # ax sar \ Scale down by 64
+ dx ax add
+ bx ax add \ Now we have G
+
+ 0< if ax ax xor then \ Clip to 0
+ d# 255 # ax cmp > if d# 255 # ax mov then \ Clip to 255
+
+ al stos \ Output G
+
+ d# 113 # 0 [sp] ax imul-imm \ Multiply Cr by 1.772 * 64 (actually 1.766)
+ d# 6 # ax sar \ Scale down by 64
+ bx ax add \ Add to Y
+
+ 0< if ax ax xor then \ Clip to 0
+ d# 255 # ax cmp > if d# 255 # ax mov then \ Clip to 255
+
+ al stos \ Output B
+ d# 255 # al mov
+ al stos \ Output A
+
+ 8 [sp] dec
+ 0= until
+
+ d# 12 [sp] sp lea \ Clean stack
+ 0 [sp] di xchg \ Restore EDI
+ 4 [sp] si xchg \ Restore ESI
+c;