Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6012821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:27:34+00:00 2026-05-23T02:27:34+00:00

im writing the DHT Segment in a jpeg file. I write Bytes into a

  • 0

im writing the DHT Segment in a jpeg file. I write Bytes into a Byte Array.

byte[] huffman_Info = {
                        //Mark as DHT Segment
                        (byte)0xff, (byte) 0xc4,
                        //length (has to be calculated later)
                        (byte)0x00, (byte) 0x15,
                        /*
                         * Info Byte:
                         * - HT information (1 byte):
                                bit 0..3: number of HT (0..3, otherwise error)
                                bit 4   : type of HT, 0 = DC table, 1 = AC table
                                bit 5..7: not used, must be 0
                         */
                        (byte)0x08


                        };

Im writing (for testing) a 0x08 in the Info Byte.
This is 0000 for the first 4 Bits. Here my first questions: What does this “bit 0..3: number of HT (0..3, otherwise error)” mean? I googled it but all I find is the same specification over and over again.
the 5th Bit is a 1 for a DC table and the the 3 last bits have to be 0
0x08 = 00001000.

However, JPEGSnoop, a decoding tool, says my Destination ID is 15, this is wrong, so its aborting the progress. Why is my Info Byte wrong?

As Always, thanks a lot in advance for your help

regards, Daniel

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:27:35+00:00Added an answer on May 23, 2026 at 2:27 am

    The first nibble should be either 0 or 1, the second should be a number between 0 and 3. Any other values are illegal. So the only legal values for that byte would be:

    0x00 0x01 0x02 0x03 0x10 0x11 0x12 0x13

    The best way to learn JPEG is to read the standard, it’s actually not that hard to understand. Google for “itu-1150.pdf” and you’ll find it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Writing some test scripts in IronPython, I want to verify whether a window is
Writing the code for the user authentication portion of a web site (including account
Writing a JSP page, what exactly does the <c:out> do? I've noticed that the
Writing something like this using the loki library , typedef Functor<void> BitButtonPushHandler; throws a
Writing my first Linq application, and I'm trying to find the best way to
When writing a switch statement, there appears to be two limitations on what you
When writing multi-threaded applications, one of the most common problems experienced are deadlocks. My
When writing multithreaded applications, one of the most common problems experienced is race conditions.
I writing a report in Visual Studio that takes a user input parameter and
When writing production-quality VC++ code, is the use of recursion acceptable? Why or why

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.