LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Sponsors
  • Mirrors
  • Logos
  • Contact us
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Overview :: News :: Downloads :: Tracker :: Discussions (cores)    

    Discrete Cosine Transform core: Tracker : Important details missing in docs

    Monitor this item

    You will be notified via email when status of this item is changed or if somebody adds a comment.

    Your email

      Important details missing in docs

    Type IDEA
    Status OPENED
    Top
    This core works very well, I've tested it thoroughly to implement it as part of a JPEG compressor. But there are some things which I consider very important but are missing in the documentation:

    1. The core does internally a level_shift (substract 128 from input). I don't think a DCT core should do level shift (i.e. MatLab's dct2 function doesn't). The code in DCT1D.vhd can be modified to avoid it by changing every "SIGNED('0' & dcti) - LEVEL_SHIFT" to "SIGNED(dcti(dcti'High) & dcti)"

    2. If you want output to be row-wise, input must be column-wise, that is, output is the transposed 2D-DCT of the input.

    3. I am going to try to see if the DCT is compliant with the JPEG standard in terms of calculation precision. To this moment, it looks fine (I've seen rounding errors of around abs(err)<3 in the 12 bit coefficients, not bad).

    4. This is said in the docs, but if you were wondering: yes, you can continuously feed data in to the core and get continuous output.

    Great job and very readable code. Many thanks to the author!

     
    Stats

    Nobody is monitoring this item

    Progress
     
    Submited date 01-Jun-2008
    Submited by Victor Lopez Lorenzo
     
    Assigned date
    Assigned to
     
    Closed date
    Closed by

    Top

    Comments

    by victor.lopez@o... on 02-Jun-2008
    Hi, I agree that a level shift is necessary before DCT, I just prefer to do it outside and I didn't know it was being done inside (it isn't said in the docs) until I browsed the source. The level shift I use takes advantage of another shift done during pixel conversion (from RGB to YCbCr), and the level shift becomes 112 instead of 128, so I do it before the DCT. :)
     
    by Michal Krepa on 01-Jun-2008
    Hi Victor, glad core works for you. Answers to your questions: 1. (DC) level shift is necessary to have dynamic range symetrically distributed around zero. Otherwise, if you enter 8x8 block of unsigned data from 0-255 range, DC component output range could be few bits higher than accumulator can hold. For this purpose level shift is applied so that dynamic range stays within accumulator/output limits. A lot of technical papers on 2D DCT actually assume DCT level shifting is incorporated to calculation, but you are right - from purely mathematical point of view it is not. If I find some time it will be fixed, although at current time I am not sure if this could not create an overflow because of bit growth on DC component when unsigned pixels are feed through. 2. Yes, that information is missing and will be added. 3. Good, if you find it is not good enough let me know. Maybe I can do something about it. 4. True. Core was designed with the intention to deliver maximum performance in terms that no wait-states shall be required ever. Thank you for comments, Michal K
     

    Add your comment

    Your email:

    Retype key:
    Top

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