convert M bit buffer to N bit buffer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • runcyclexcski@yahoo.com

    #1

    convert M bit buffer to N bit buffer

    Hi all,

    I don't have basic training in programming, so I apologize for this
    naiive question. I have a camera that outputs 14 bit data. I need to
    collect and store movies of thousands of frames. I found that my
    signal rarely exceeds 1024. So I can considerably reduce the movie
    size if I store the data in 10 bit and don't allocate all 14 bits. How
    do I specify a 10 bit data type (or N bit) and convert short data type
    to 10 bit and back (my app is in Visual C++)? Thanks in advance.

  • Sarath

    #2
    Re: convert M bit buffer to N bit buffer

    On Mar 26, 9:15 am, runcyclexc...@y ahoo.com wrote:
    Hi all,
    >
    I don't have basic training in programming, so I apologize for this
    naiive question. I have a camera that outputs 14 bit data. I need to
    collect and store movies of thousands of frames. I found that my
    signal rarely exceeds 1024. So I can considerably reduce the movie
    size if I store the data in 10 bit and don't allocate all 14 bits. How
    do I specify a 10 bit data type (or N bit) and convert short data type
    to 10 bit and back (my app is in Visual C++)? Thanks in advance.
    You can make use of bitfields in C++ to declare less storage capacity
    than an integral data type

    Check
    http://msdn2.microsoft.com/en-us/library/ewwyfdbe.aspx

    Regards,
    Sarath - htpp://sarathc.wordpre ss.com/

    Comment

    • sergejusz

      #3
      Re: convert M bit buffer to N bit buffer

      On Mar 26, 1:15 am, runcyclexc...@y ahoo.com wrote:
      Hi all,
      >
      I don't have basic training in programming, so I apologize for this
      naiive question. I have a camera that outputs 14 bit data. I need to
      collect and store movies of thousands of frames. I found that my
      signal rarely exceeds 1024. So I can considerably reduce the movie
      size if I store the data in 10 bit and don't allocate all 14 bits. How
      do I specify a 10 bit data type (or N bit) and convert short data type
      to 10 bit and back (my app is in Visual C++)? Thanks in advance.
      Hi,
      If I've understood you correctly:
      It means that 16 short numbers (160 significant data bits) may be
      saved in 10 shorts. So, make working buffer, containing 16 short
      numbers and counter of frames. When counter reaches 16, reset it and
      pack data to 10 shorts.
      Or you may save 8 frames (80 bits) in 10 element array of unsigned
      chars. And so on .....

      HTH
      Serge


      Comment

      Working...