TMCCJPEGEncGetQFactor

Syntax

#include <revolution/tmcc_jpeg.h>

s32 TMCCJPEGEncGetQFactor(
        void *pWorkArea,
        void *pTex,
        u16 srcWidth,
        u16 srcHeight,
        GXTexFmt texFormat,
        u32 TargetSize,
        u32 *poutputSize,
        u32 *pQFactor
);

Arguments

*pWorkArea Configure the starting address of the work area.
*pTex Configure the starting address of the input texture data.
srcWidth Specify the effective image width of the input texture.
(When the texture size does not match the effective image region, fill the remaining parts with dummy data. A TMCC_JPEG_OPT_ERR error code is returned for input that exceeds the range of 1 to 65,535.)
srcHeight Specify the effective image height of the input texture.
(When the texture size does not match the effective image region, fill the remaining parts with dummy data. A TMCC_JPEG_OPT_ERR error code is returned for input that exceeds the range of 1 to 65,535.)
texFormat Specify the texture format.
(A TMCC_JPEG_TEXT_ERR error code is returned for input that is neither GX_TF_RGB565 nor GX_TF_RGBA8.)
TargetSize Specify the output size after compression.
*poutputSize Size that is possible to output, given pQFactor.
*pQFactor Image quality factor that can get poutputSize bytes of data.

Return Values

0 Function completed successfully.
Negative Abnormal exit (error code).

Description

To achieve JPEG output of an arbitrary data size, this function decides the image quality factor and the actual output size. Gets the actual output size (*poutputSize) and the image quality factor (*pQFactor) that is used to compress the input texture image data to the specified target size (TargetSize). The margin of error between the target size and the actual output size that was obtained will differ, depending on the input image.

See Also

Error Codes

Revision History

2009/10/19 Made changes to the description of the include file in line with integration into the Revolution SDK.
2008/03/11 Changed the type for the srcWidth and srcHeight arguments.
2007/02/02 Initial version.


CONFIDENTIAL