Click here to Skip to main content
15,892,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: VC++ -- Minimize all windows within MDI Pin
David Crow13-Jul-09 9:08
David Crow13-Jul-09 9:08 
GeneralRe: VC++ -- Minimize all windows within MDI Pin
blueflame21313-Jul-09 9:30
blueflame21313-Jul-09 9:30 
QuestionRe: VC++ -- Minimize all windows within MDI Pin
David Crow13-Jul-09 9:33
David Crow13-Jul-09 9:33 
AnswerRe: VC++ -- Minimize all windows within MDI Pin
blueflame21313-Jul-09 9:42
blueflame21313-Jul-09 9:42 
GeneralRe: VC++ -- Minimize all windows within MDI Pin
David Crow13-Jul-09 9:52
David Crow13-Jul-09 9:52 
GeneralRe: VC++ -- Minimize all windows within MDI Pin
blueflame21313-Jul-09 10:36
blueflame21313-Jul-09 10:36 
GeneralRe: VC++ -- Minimize all windows within MDI Pin
David Crow13-Jul-09 10:40
David Crow13-Jul-09 10:40 
Questionneed help on Bmp to jpeg conversion Pin
umangv213-Jul-09 7:31
umangv213-Jul-09 7:31 
I am writing a c++ code for converting bmp file into jpeg....
The algorithm i have followed is:
1)Convert RGB color space to Y,Cb,Cr..
2)Down sample Cb and Cr by 2..that means for each square block of 2*2 there is 4 different Y
value but 1 Cb and 1 Cr value..
3)Apply DCT to data units of each 8*8 pixels...
4)Then apply quantization on DCT coefficient by using standard quantization table of Cb and Cr.
5)Do zigzag ordering.
6)Encode the DC and AC coefficient separately using huffman encoding.
7)Write proper header and write huffman encoded value to the file...
By doing all this things correctly(cross checked for various imaged and values) I am still not getting
the jpeg image correctly displayed.
Then i made a small 8*8 24 bit(color depth) bmp file completly filled with color value R=10 B=10
and G=100...all 64 pixels are of same color..
The data that i m getting at every step is as follows...
Bmp Image Header:
size of header 40
width 8
height 8
no of planes 1
no of bits per pixel 24
image size 194
x resolution pixel per meter 2834
y resolution pixel per meter 2834
no of colors 0
no of imp colors 0
The Y Cb Cr conversion of (R,B,G)=(10,10,100) is (62,-29,-37)
so lets consider Y component first..
The DCT coefficient for Y component is :
495 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
After Quantization, the zig zag ordering of single data unit that i m getting is this, for Y component.
30 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0
Now the huffman coding of above zig zag order array is :
Y dc coding: 00111110
Y ac coding: 1010 (for ac huffman table(luminance Y) EOB value is 1010)
Similary huffman coding of Cb and Cr components is as follows:
cb dc coding: 11000010
cb ac coding: 01 (for ac huffman table(chrominance Cb,Cr) EOB value is 01)
cr dc coding: 110101110
cr ac coding: 01
Final Huffman code that i get is:
001111101010110000100111010111001 Length 33
so to make it divisible by 8 padding of 1 is done.
0011111010101100001001110101110011111111 Length 40.
Here each single 0 or 1 is actually a bit that needs to be stored as it is in the jpeg file but since we
cant write bit by bit into file, a total of 8 bit is taken and converted into a integer value in base 10
and stored that into a character which now takes 1 byte.
So this is all procedure and some specific data that i have shown here...but still i m not getting my
image shown correctly..
can somebody help me out on this!!!!!!!!!
AnswerRe: need help on Bmp to jpeg conversion Pin
Rozis13-Jul-09 13:58
Rozis13-Jul-09 13:58 
AnswerRe: need help on Bmp to jpeg conversion Pin
kilt15-Jul-09 5:40
kilt15-Jul-09 5:40 
QuestionMoveWindow() causing crash on closing maximized child window with listbox Pin
Sharath C V13-Jul-09 6:47
professionalSharath C V13-Jul-09 6:47 
QuestionRe: MoveWindow() causing crash on closing maximized child window with listbox Pin
«_Superman_»13-Jul-09 17:19
professional«_Superman_»13-Jul-09 17:19 
AnswerRe: MoveWindow() causing crash on closing maximized child window with listbox Pin
Sharath C V13-Jul-09 18:10
professionalSharath C V13-Jul-09 18:10 
GeneralRe: MoveWindow() causing crash on closing maximized child window with listbox Pin
«_Superman_»13-Jul-09 18:13
professional«_Superman_»13-Jul-09 18:13 
QuestionRe: MoveWindow() causing crash on closing maximized child window with listbox Pin
Sharath C V13-Jul-09 18:22
professionalSharath C V13-Jul-09 18:22 
AnswerRe: MoveWindow() causing crash on closing maximized child window with listbox Pin
«_Superman_»13-Jul-09 18:31
professional«_Superman_»13-Jul-09 18:31 
GeneralRe: MoveWindow() causing crash on closing maximized child window with listbox Pin
Sharath C V13-Jul-09 18:44
professionalSharath C V13-Jul-09 18:44 
AnswerRe: MoveWindow() causing crash on closing maximized child window with listbox Pin
Sharath C V13-Jul-09 20:24
professionalSharath C V13-Jul-09 20:24 
QuestionImprove the program Pin
CSawant13-Jul-09 5:53
CSawant13-Jul-09 5:53 
QuestionRe: Improve the program Pin
David Crow13-Jul-09 6:15
David Crow13-Jul-09 6:15 
AnswerI will not do what you ask. Pin
Maximilien13-Jul-09 6:19
Maximilien13-Jul-09 6:19 
QuestionOpenGL window creation within a DLL - Possible threading problem Pin
Dustin Henry13-Jul-09 4:44
Dustin Henry13-Jul-09 4:44 
QuestionHow to create and maintain HTML file? Pin
fujoey13-Jul-09 4:35
fujoey13-Jul-09 4:35 
AnswerRe: How to create and maintain HTML file? Pin
khb13-Jul-09 4:44
khb13-Jul-09 4:44 
QuestionBest way to convert text to a picture Pin
1scouser13-Jul-09 4:19
1scouser13-Jul-09 4:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.