31 January 2008, 15:50 | #81 | |||||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
|
Quote:
Quote:
Quote:
Quote:
Quote:
|
|||||
31 January 2008, 16:52 | #82 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
|
Quote:
Code:
; upsample 2 horizontal, 1 vertical ; a5=input_data, a6=output_data, d7=nb cols, d6=nb rows h2v1_fancy_upsample subq.w #3,d7 ; for dbf, and minus 1st/last col. .yloop move.l (a5)+,a0 ; a0 = input_data[inrow] move.l (a6)+,a1 ; a1 = output_data[outrow] ; special case of 1st column moveq #0,d1 moveq #0,d0 move.b (a0)+,d1 move.b (a0)+,d0 move.b d1,(a1)+ ; 1st pix : as is move.l d1,d2 add.l d2,d2 add.l d1,d2 ; *3 add.l d0,d2 ; + next addq.l #2,d2 ; round with +2 lsr.l #2,d2 ; /4 move.b d2,(a1)+ ; 2nd pix ; general case ; d0 current pixel (do *3) ; d1 previous pixel ; d2 next pixel (the one we read within the loop) ; d3 tmp move.w d7,d5 moveq #0,d2 ; can be out of the loop .xloop move.l d0,d3 add.l d3,d3 add.l d0,d3 ; 3c add.l d3,d1 ; 3c + 1l addq.l #1,d1 ; round with +1 lsr.l #2,d1 ; /4 move.b d1,(a1)+ ; 1st pix move.l d0,d1 ; save center pix for next left pix move.b (a0)+,d2 move.l d2,d0 ; save right pix for next center pix add.l d2,d3 addq.l #2,d3 ; round with +2 lsr.l #2,d3 ; /4 move.b d3,(a1)+ ; 2nd pix dbf d5,.xloop ; special case of last column move.l d0,d2 add.l d2,d2 add.l d0,d2 ; *3 add.l d1,d2 ; +old addq.l #1,d2 ; round with +1 lsr.l #2,d2 ; /4 move.b d2,(a1)+ ; 1 before last pix move.b d0,(a1)+ ; last pix (sent directly) ; line loop subq.w #1,d6 bne .yloop rts Don't underestimate yourself |
|
01 February 2008, 17:31 | #83 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
|
That code sure looks hard to beat. But I have a question: What are the rounding adds for? They are present in your 2x2 code, too, and seeing what you have to do, I just don't get why you need those rounding adds
|
01 February 2008, 17:38 | #84 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
|
Quote:
In jdsample.c it was explained like this : Quote:
Anyway removing those adds won't accelerate the program by much so they're ok for me. |
||
01 February 2008, 17:56 | #85 | |||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
|
Quote:
Quote:
|
|||
04 February 2008, 10:01 | #86 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
|
Quote:
Quote:
Anyway here is the project file for StormC 3.0. You may wish to manually edit it (it's a text file) to change the paths in it (for now it goes in ram:src/). Included is a reference executable file (a.out) built by it. Note : as a bonus you'll get a slightly faster version of the viewer because it produced better code (not to mention the exe being one kilobyte smaller : we're now under 32k ) Last edited by meynaf; 12 May 2011 at 08:32. |
||
04 February 2008, 15:11 | #87 | ||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
|
Quote:
Quote:
Anyway, that was the ONLY problem, and it works like a charm. Thanks again |
||
04 February 2008, 15:22 | #88 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
|
If you spot something in the code that you want to modify and check, now you can do it. Happy crashi... errrhhh, happy playing !
Maybe I've missed something in the compiled part that can be simplified a lot, please let me know whatever you find. And remember : that C code has to get out ! |
06 February 2008, 15:18 | #89 | ||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
|
Quote:
Quote:
|
||
06 February 2008, 16:11 | #90 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
|
Quote:
Quote:
My work on this is restricted too : I won't be home this week-end and my side of the code isn't going to evolve until the next week-end. |
||
07 February 2008, 16:42 | #91 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
|
Quote:
|
|
07 February 2008, 16:54 | #92 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
|
Well, ok, I won't have my miggy around, but there are others things apart the miggy in life
What do you call the wrapper ? |
18 February 2008, 02:06 | #93 | ||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
|
Quote:
Quote:
|
||
21 February 2008, 09:12 | #94 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
|
Quote:
Quote:
I have some code for that but it simply won't integrate |
||
22 February 2008, 09:17 | #95 | |||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
|
Quote:
Quote:
Quote:
|
|||
23 February 2008, 09:06 | #96 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
|
Quote:
For me if the woman wants a cuddle or such, then the computer will remain turned off. But if it's her out or computer out, then she's probably not the right person Quote:
I'm not doing the things the same as they did. My huffman tables are incompatible with theirs, I'm not reading bits the same way, not to mention the whole thing still being a work in progress. Anyway it looks like that : Code:
; get the value from a huffman code get_huffcode moveq #8,d5 bsr readnbits ; returns d1 move.w (a1,d1.w*2),d5 bpl.s .norm ; >=0 = bits ok, <0=n°extra-table-2 ; more than 8 bits needed (according to jdhuff.c it's only 5% cases) .re neg.w d5 subq.w #2,d5 ; ffff=invalid code bmi.s .invalid lea (a2,d5.w*2),a3 moveq #1,d5 bsr readnbits ; chose between the two combinations move.w (a3,d1.w*2),d5 bmi.s .re .norm move.b d5,d1 ; final value (yep it's only a byte) lsr.w #8,d5 add.b d5,d2 ; reinject unused bits in d2 bmi .hit ; if still negative : not enough data ! rts ; here it ain't funny anymore : the file is corrupt ; instead of gently inserting zeroes in the stream and emitting a warning like ; the jpeg lib does, we go into an error ; (if the file is broken then fixing it is none of our business) .hit lea jerr15(pc),a3 bra failure .invalid lea jerr16(pc),a3 bra failure |
||
25 February 2008, 09:30 | #97 | ||||||||||||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Last edited by Thorham; 25 February 2008 at 09:45. |
||||||||||||
26 February 2008, 09:51 | #98 | |||||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
|
Quote:
Unsure, as I'm working on a rewrite right now... Quote:
Note : the code I posted here is (already) obsolete. I used the fact that A2 always points A1+$200 to use A1 instead (I've added $100 to the values which indicate we should peek in the second part of the table). Not sure if it's clear, but that means you can replace lea (a2,d5.w*2),a3 / move.w (a3,d1.w*2),d5 by lea (a1,d5.w*2),a2 / move.w (a2,d1.w*2),d5. And, yes, once started I can't stop too. I started that rewrite to see how far I could get ; it's not the first time I try it but with my actual code and knowledge I think I can do it all. Quote:
And which will be already outdated by the time you get it ? Quote:
Sure I will need it. But it also means you'll see me less often here. Quote:
Quote:
Quote:
You even cut'n paste code that wasn't yours at first place ? |
|||||||
26 February 2008, 11:47 | #99 | |||||||||||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
|||||||||||
28 February 2008, 08:57 | #100 | ||||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
|
They could have thought "what's the point ?" if they had enough knowledge about computers, but they hadn't
Quote:
Quote:
Alternatively if you want to see some bit reading stuff for inspiration, you can find some in flac.s of my sound player. Apparently yes. I have successfully displayed a grayscale picture. Now it does a little bit more but it's not much more useful. Quote:
That's right ! Quote:
Quote:
Quote:
|
||||||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
JPEG to IFF Coverter | W4r3DeV1L | request.Apps | 15 | 14 February 2020 17:21 |
Overzealous Kickstart ROM - address decoding? | robinsonb5 | Hardware mods | 3 | 30 June 2013 11:09 |
JPEG to PNG (via CLI) | amiga_user | support.Apps | 3 | 28 November 2011 11:50 |
Decoding algorithm(s) for encoded disk sectors (ADOS) | andreas | Coders. General | 10 | 02 November 2009 22:18 |
Blitter MFM decoding | Photon | Coders. General | 14 | 16 March 2006 11:24 |
|
|