vitasdk
Documentation of the vitasdk

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceJpegEncArm_stub


Load the required module:

int sceSysmoduleLoadModuleInternal(SceSysmoduleInternalModuleId id)
Load an internal module.
@ SCE_SYSMODULE_INTERNAL_JPEG_ENC_ARM
sceJpegEncArm module
Definition: sysmodule.h:117



Note
The maximum supported image width and height is 65520 for YCbCr420, and 65528 for YCbCr422.

The width and height of YCbCr422 images must be a multiple of 8. The width and height of YCbCr420 images must be a multiple of 16.

Functions

 VITASDK_BUILD_ASSERT_EQ (4, SceJpegArmEncoderContext)
 
SceSize sceJpegArmEncoderGetContextSize (void)
 Get required size of context memory. More...
 
int sceJpegArmEncoderInit (SceJpegArmEncoderContext context, SceUInt16 inWidth, SceUInt16 inHeight, SceJpegArmEncoderPixelFormat pixelformat, void *outBuffer, SceSize outSize)
 Initialize a JPEG encoder. More...
 
int sceJpegArmEncoderEnd (SceJpegArmEncoderContext context)
 Terminate a JPEG encoder. More...
 
int sceJpegArmEncoderEncode (SceJpegArmEncoderContext context, const void *inBuffer)
 Execute a JPEG encode. More...
 
int sceJpegArmEncoderSetCompressionRatio (SceJpegArmEncoderContext context, SceUInt8 ratio)
 Set the encoder compression ratio. More...
 
int sceJpegArmEncoderSetOutputAddr (SceJpegArmEncoderContext context, void *outBuffer, SceSize outSize)
 Set encoder output address. More...
 
int sceJpegArmEncoderSetValidRegion (SceJpegArmEncoderContext context, SceUInt16 regionWidth, SceUInt16 regionHeight)
 Set the region of the image to be encoded as JPEG. More...
 
int sceJpegArmEncoderSetHeaderMode (SceJpegArmEncoderContext context, SceJpegArmEncoderHeaderMode mode)
 Set header used for output file. More...
 

Typedefs

typedef void * SceJpegArmEncoderContext
 Dynamically allocated encoder context. More...
 

Macros

#define SCE_JPEGENCARM_MIN_COMP_RATIO   1
 Lowest compression ratio, best quality. More...
 
#define SCE_JPEGENCARM_DEFAULT_COMP_RATIO   64
 Default compression ratio. More...
 
#define SCE_JPEGENCARM_MAX_COMP_RATIO   255
 Highest compression ratio, lowest quality. More...
 

Macro Definition Documentation

◆ SCE_JPEGENCARM_MIN_COMP_RATIO

#define SCE_JPEGENCARM_MIN_COMP_RATIO   1

Lowest compression ratio, best quality.

◆ SCE_JPEGENCARM_DEFAULT_COMP_RATIO

#define SCE_JPEGENCARM_DEFAULT_COMP_RATIO   64

Default compression ratio.

◆ SCE_JPEGENCARM_MAX_COMP_RATIO

#define SCE_JPEGENCARM_MAX_COMP_RATIO   255

Highest compression ratio, lowest quality.

Typedef Documentation

◆ SceJpegArmEncoderContext

typedef void* SceJpegArmEncoderContext

Dynamically allocated encoder context.

See sceJpegArmEncoderGetContextSize() for required allocation size. The address must be 4 byte aligned.

Enumeration Type Documentation

◆ SceJpegEncArmErrorCode

Error Codes.

Enumerator
SCE_JPEGENCARM_ERROR_IMAGE_SIZE 

The image dimensions given are not supported, or are larger than those set at initialization.

SCE_JPEGENCARM_ERROR_INSUFFICIENT_BUFFER 

The output buffer provided is not of sufficient size.

SCE_JPEGENCARM_ERROR_INVALID_COMP_RATIO 

The compression ratio given is not within the valid range.

SCE_JPEGENCARM_ERROR_INVALID_PIXELFORMAT 

The pixelformat given is not one of SceJpegArmEncoderPixelFormat.

SCE_JPEGENCARM_ERROR_INVALID_HEADER_MODE 

The headerMode given is not one of SceJpegArmEncoderHeaderMode.

SCE_JPEGENCARM_ERROR_INVALID_POINTER 

A null or badly aligned pointer was given.

◆ SceJpegArmEncoderPixelFormat

Pixel Formats.

Enumerator
SCE_JPEGENCARM_PIXELFORMAT_YCBCR420 

YCbCr420 format.

SCE_JPEGENCARM_PIXELFORMAT_YCBCR422 

YCbCr422 format.

◆ SceJpegArmEncoderHeaderMode

JPEG Header Modes.

Enumerator
SCE_JPEGENCARM_HEADER_MODE_JPEG 

JPEG header mode.

SCE_JPEGENCARM_HEADER_MODE_MJPEG 

MJPEG header mode.

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ()

VITASDK_BUILD_ASSERT_EQ ( ,
SceJpegArmEncoderContext   
)

◆ sceJpegArmEncoderGetContextSize()

SceSize sceJpegArmEncoderGetContextSize ( void  )

Get required size of context memory.

Returns
Required size of allocated memory.

◆ sceJpegArmEncoderInit()

int sceJpegArmEncoderInit ( SceJpegArmEncoderContext  context,
SceUInt16  inWidth,
SceUInt16  inHeight,
SceJpegArmEncoderPixelFormat  pixelformat,
void *  outBuffer,
SceSize  outSize 
)

Initialize a JPEG encoder.

Parameters
[in]context- An allocated encoder context of appropriate size.
[in]inWidth- Input width in pixels.
[in]inHeight- Input height in pixels.
[in]pixelformat- One of SceJpegArmEncoderPixelFormat.
[in]outBuffer- A sufficiently sized 8 byte aligned output buffer.
[in]outSize- Output buffer size in bytes.
Returns
0 on success, < 0 on error.

◆ sceJpegArmEncoderEnd()

int sceJpegArmEncoderEnd ( SceJpegArmEncoderContext  context)

Terminate a JPEG encoder.

Parameters
[in]context- An already initialized SceJpegArmEncoderContext.
Returns
0 on success, < 0 on error.

◆ sceJpegArmEncoderEncode()

int sceJpegArmEncoderEncode ( SceJpegArmEncoderContext  context,
const void *  inBuffer 
)

Execute a JPEG encode.

Parameters
[in]context- An already initialized SceJpegArmEncoderContext.
[in]inBuffer- An 8 byte aligned memory block of color data.
Returns
Encoded JPEG size on success, < 0 on error.

◆ sceJpegArmEncoderSetCompressionRatio()

int sceJpegArmEncoderSetCompressionRatio ( SceJpegArmEncoderContext  context,
SceUInt8  ratio 
)

Set the encoder compression ratio.

Parameters
[in]context- An already initialized SceJpegArmEncoderContext.
[in]ratio- A value between 1 and 255 (higher = better compression, lower = better speed).

See SCE_JPEGENCARM_DEFAULT_COMP_RATIO for the default compression ratio.

Returns
0 on success, < 0 on error.

◆ sceJpegArmEncoderSetOutputAddr()

int sceJpegArmEncoderSetOutputAddr ( SceJpegArmEncoderContext  context,
void *  outBuffer,
SceSize  outSize 
)

Set encoder output address.

Parameters
[in]context- An already initialized SceJpegArmEncoderContext.
[in]outBuffer- A sufficiently sized 8 byte aligned output buffer.
[in]outSize- Output buffer size in bytes.
Returns
0 on success, < 0 on error.

◆ sceJpegArmEncoderSetValidRegion()

int sceJpegArmEncoderSetValidRegion ( SceJpegArmEncoderContext  context,
SceUInt16  regionWidth,
SceUInt16  regionHeight 
)

Set the region of the image to be encoded as JPEG.

The encoded region starts from (0,0), which is the top left of the image, and expands outward by regionWidth and regionHeight.

Parameters
[in]context- An already initialized SceJpegArmEncoderContext.
[in]regionWidth- Width of the region in pixels.
[in]regionHeight- Height of the region in pixels.
Returns
0 on success, < 0 on error.

◆ sceJpegArmEncoderSetHeaderMode()

int sceJpegArmEncoderSetHeaderMode ( SceJpegArmEncoderContext  context,
SceJpegArmEncoderHeaderMode  mode 
)

Set header used for output file.

Parameters
[in]context- An already initialized SceJpegArmEncoderContext.
[in]mode- One of SceJpegArmEncoderHeaderMode.
Returns
0 on success, < 0 on error.