Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Ryan_Wong
Beginner
98 Views

UIC sample JPEG: meaning of JPEGDecoderParams::SetDCTType

Jump to solution
Inside the UIC JPEG sample, (uic_jpeg_dec.h), the classJPEGDecoderParams has the following field:
[bash]ExcStatus SetDCTType(int dctType)
{
    m_dctType = dctType;
    return ExcStatusOk;
}
int GetDCTType(void)
{
    return m_dctType;
}
[/bash]
However, after careful searching, it appears the field is unused. Is it safe to remove this field? Is there reference to either JPEG specification or IJG documentation regarding the meaning of this field?
Thank you.
0 Kudos
1 Solution
SergeyKostrov
Valued Contributor II
98 Views
1.
It is similar to 'use_qdct' param but due to some reason a consistency was lost. Take a look at
'JPGViewDoc.h' header:

...

class CJPGViewDoc : public CDocument
{
...
void SetDCTType( int use_qdct ) { m_param_jpeg.use_qdct = use_qdct; return; }
...
};
...

2.
In 'JPGView.rc' there is a control 'IDC_USE_QDCT'with a text 'Use fast DCT for not complete blocks'
and it looks like a letter'q' in the 'use_qdct'stands for 'quick'.

Best regards,
Sergey


View solution in original post

5 Replies
Sergey_K_Intel
Employee
98 Views
Hi Ryan,
You are right, this field can be safely removed. It might be a duplicate of m_use_qdct data member of CJPEGDecoder class, but abandoned for some reason.
We'll inspect the functions and data members to get rid of unused codes.
Thank you,
Sergey
ILevi1
Valued Contributor I
98 Views
I guess that this DCT type parameter was meant to be used to chose whether to use integer or float DCT.
SergeyKostrov
Valued Contributor II
99 Views
1.
It is similar to 'use_qdct' param but due to some reason a consistency was lost. Take a look at
'JPGViewDoc.h' header:

...

class CJPGViewDoc : public CDocument
{
...
void SetDCTType( int use_qdct ) { m_param_jpeg.use_qdct = use_qdct; return; }
...
};
...

2.
In 'JPGView.rc' there is a control 'IDC_USE_QDCT'with a text 'Use fast DCT for not complete blocks'
and it looks like a letter'q' in the 'use_qdct'stands for 'quick'.

Best regards,
Sergey


View solution in original post

SergeyKostrov
Valued Contributor II
98 Views
Quoting Igor Levicki
I guess that this DCT type parameter was meant to be used to chose whether to use integer or float DCT.


It looks like no.

Even ifan integer-based DCT implementations could be done results, compared to float-based
implementations,will be less accurate( roundoff problems ) but they can be calculatedfaster.

Best regards,
Sergey

ILevi1
Valued Contributor I
98 Views
I do agree that avoiding floating points today has no speed benefits -- I was just pointing out that IJG has those two modes and similarily named variable.

Reply