LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Cvs-checkins > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: cvs at opencores.org<cvs@o...>
    Date: Sat Jul 29 01:08:54 CEST 2006
    Subject: [cvs-checkins] MODIFIED: mb-jpeg ...
    Top
    Date: 00/06/07 29:01:08

    Modified: mb-jpeg/bmp2jpg_mb bmp2jpg_mb.c huffman.c
    Log:
    Fix bug:

    1. in bmp2jpg_mb.c put_char() set input parameter type 'unsigned char'

    2. in huffman.c HuffmanEncodeFinishSend() solve endian problem


    Revision Changes Path
    1.3 mb-jpeg/bmp2jpg_mb/bmp2jpg_mb.c

    http://www.opencores.org/cvsweb.shtml/mb-jpeg/bmp2jpg_mb/bmp2jpg_mb.c.diff?r1=1.2&r2=1.3

    (In the diff below, changes in quantity of whitespace are not shown.)

    Index: bmp2jpg_mb.c
    ===================================================================
    RCS file: /cvsroot/quickwayne/mb-jpeg/bmp2jpg_mb/bmp2jpg_mb.c,v
    retrieving revision 1.2
    retrieving revision 1.3
    diff -u -b -r1.2 -r1.3
    --- bmp2jpg_mb.c 28 Jul 2006 22:19:13 -0000 1.2
    +++ bmp2jpg_mb.c 28 Jul 2006 23:08:54 -0000 1.3
    @@ -66,7 +66,7 @@

    }

    -void put_char(unsigned c) {
    +void put_char(unsigned char c) {

    sysace_fwrite(&c, 1, 1, outfile);




    1.3 mb-jpeg/bmp2jpg_mb/huffman.c

    http://www.opencores.org/cvsweb.shtml/mb-jpeg/bmp2jpg_mb/huffman.c.diff?r1=1.2&r2=1.3

    (In the diff below, changes in quantity of whitespace are not shown.)

    Index: huffman.c
    ===================================================================
    RCS file: /cvsroot/quickwayne/mb-jpeg/bmp2jpg_mb/huffman.c,v
    retrieving revision 1.2
    retrieving revision 1.3
    diff -u -b -r1.2 -r1.3
    --- huffman.c 28 Jul 2006 22:19:13 -0000 1.2
    +++ huffman.c 28 Jul 2006 23:08:54 -0000 1.3
    @@ -676,12 +676,12 @@
    if (vlc_amount_remaining >= 8) //2 bytes to send, send first byte
    {
    send=vlc_remaining>>(vlc_amount_remaining-8); //shift so that first byte is ready to send
    - vlc_output_byte(send);
    + vlc_output_byte(send&0xff);
    // fwrite(&send,1,1,file);
    if (send==0xFF) //is this still needed????
    {
    send=0x00;
    - vlc_output_byte(send);
    + vlc_output_byte(send&0xff);
    // fwrite(&send,1,1,file);
    }
    vlc_amount_remaining=vlc_amount_remaining -8; // lower the value to the amount of bits that still needs to be send
    @@ -692,7 +692,7 @@
    mask=0x00; //init mask
    for (count=(8-vlc_amount_remaining); count>0; count--) mask=(mask<<1)|0x01; //create mask to fill byte up with ones
    send=send | mask; //add the ones to the byte
    - vlc_output_byte(send);
    + vlc_output_byte(send&0xff);
    // fwrite(&send,1,1,file);
    vlc_amount_remaining=0x00; //is this needed?
    }
    @@ -726,13 +726,15 @@
    char difference;
    unsigned char magnitude,zerorun,ii,ert;
    unsigned int bits;
    + unsigned char bit_char;
    char last_dc_value;
    //init
    // PrintMatrix(dataunit) ;
    last_dc_value = dcvalue[color];
    difference = dataunit[0] - last_dc_value;
    last_dc_value=dataunit[0];
    - ReverseExtend(difference, &magnitude,&bits);
    + ReverseExtend(difference, &magnitude,&bit_char);
    + bits = bit_char;
    HuffmanEncodeUsingDCTable(magnitude);
    WriteRawBits16(magnitude,bits);
    zerorun=0;
    @@ -747,7 +749,8 @@
    zerorun=zerorun-16;
    // printf("16 zeros: %d\n",zerorun);
    }
    - ReverseExtend(dataunit[ii],&magnitude,&bits);
    + ReverseExtend(dataunit[ii],&magnitude,&bit_char);
    + bits=bit_char;
    ert= ((int)zerorun *16); //ERROR !!!!!!!!!!!
    ert=ert + magnitude;
    HuffmanEncodeUsingACTable(ert);

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.