Skip to content

Commit

Permalink
OMAP3: SKIAHW: support baseline sequential non-interleaved
Browse files Browse the repository at this point in the history
In case of RGB output of Baseline Sequential Non-Interleaved image,
it is needed to set ProgressiveDec flag to 1 when the number of
scan components(Ns) in scan header(SOS) and the number of components
(Nf) in frame header(SOF0) usually is not same.

Change-Id: Ie9b2b2f97e97d370ee5d4747f83586f821136a8f
Signed-off-by: Poornima Puttojirao <x0142524@ti.com>
Signed-off-by: keun-o.park <sahara@ti.com>
  • Loading branch information
keun-o.park committed Apr 18, 2011
1 parent 32ab988 commit 7205d02
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libskiahw-omap3/SkImageDecoder_libtijpeg.cpp
Expand Up @@ -273,6 +273,8 @@ OMX_S32 SkTIJPEGImageDecoder::ParseJpegHeader (SkStream* stream, JPEG_HEADER_INF
lSize = stream->getLength();
stream->rewind();
JpgHdrInfo->nProgressive = 0; /*Default value is non progressive*/
JpgHdrInfo->SOF0_Nf = 0;
JpgHdrInfo->SOS_Ns = 0;

a = stream->readU8();
if ( a != 0xff || stream->readU8() != M_SOI ) {
Expand Down Expand Up @@ -351,6 +353,8 @@ OMX_S32 SkTIJPEGImageDecoder::ParseJpegHeader (OMX_U8* JpgBuffer, OMX_S32 lSize,
OMX_U8 a = 0;
OMX_U32 pos = 0;
JpgHdrInfo->nProgressive = 0; /*Default value is non progressive*/
JpgHdrInfo->SOF0_Nf = 0;
JpgHdrInfo->SOS_Ns = 0;

a = JpgBuffer[pos++];
if ( a != 0xff || JpgBuffer[pos++] != M_SOI ) {
Expand Down Expand Up @@ -404,6 +408,11 @@ OMX_U32 SkTIJPEGImageDecoder::JpegHeader_GetMarkerInfo (OMX_U32 Marker, OMX_U8*
switch ( Marker )
{
case M_SOS:
JpgHdrInfo->SOS_Ns = *(OMX_U8 *)(MarkerData+2);
if (( JpgHdrInfo->SOF0_Nf != 0 )
&& ( JpgHdrInfo->SOS_Ns != JpgHdrInfo->SOF0_Nf )) {
JpgHdrInfo->nProgressive = 1;
}
return M_SOS;

case M_EOI:
Expand All @@ -419,6 +428,9 @@ OMX_U32 SkTIJPEGImageDecoder::JpegHeader_GetMarkerInfo (OMX_U32 Marker, OMX_U8*
PRINTF("nProgressive IMAGE!\n");
JpgHdrInfo->nProgressive=1;
case M_SOF0:
if ( Marker == M_SOF0 ) {
JpgHdrInfo->SOF0_Nf = *(OMX_U8 *)(MarkerData+7);
}
case M_SOF1:
case M_SOF3:
case M_SOF5:
Expand Down
2 changes: 2 additions & 0 deletions libskiahw-omap3/SkImageDecoder_libtijpeg.h
Expand Up @@ -140,6 +140,8 @@ class SkTIJPEGImageDecoder
int nHeight ;
int nFormat;
int nProgressive;
OMX_U8 SOF0_Nf;
OMX_U8 SOS_Ns;
} JPEG_HEADER_INFO;

OMX_HANDLETYPE pOMXHandle;
Expand Down

0 comments on commit 7205d02

Please sign in to comment.