vitasdk
Documentation of the vitasdk

Detailed Description

Exports for Kernel.


Using this library in your project

Include the header file in your project:

#include <psp2kern/avcodec/jpegenc.h>


Link the library to the executable:

SceAvcodecForDriver_stub



Functions

int ksceJpegEncoderInit (SceJpegEncoderContext context, int inWidth, int inHeight, SceJpegEncoderPixelFormat pixelformat, void *outBuffer, SceSize outSize)
 Initialize a jpeg encoder. More...
 
int ksceJpegEncoderEnd (SceJpegEncoderContext context)
 Terminate a jpeg encoder. More...
 
int ksceJpegEncoderEncode (SceJpegEncoderContext context, const void *inBuffer)
 Execute a jpeg encode. More...
 
int ksceJpegEncoderSetCompressionRatio (SceJpegEncoderContext context, int ratio)
 Set encoder compression ratio. More...
 
int ksceJpegEncoderSetOutputAddr (SceJpegEncoderContext context, void *outBuffer, SceSize outSize)
 Set encoder output address. More...
 
int ksceJpegEncoderCsc (SceJpegEncoderContext context, void *outBuffer, const void *inBuffer, int inPitch, SceJpegEncoderPixelFormat inPixelFormat)
 Execute a color conversion from ARGB to YCbCr. More...
 
int ksceJpegEncoderGetContextSize (void)
 Return required free size to allocate a jpeg encoder. More...
 
int ksceJpegEncoderSetValidRegion (SceJpegEncoderContext context, int inWidth, int inHeight)
 Set encoder valid region (?) More...
 
int ksceJpegEncoderSetHeaderMode (SceJpegEncoderContext context, int mode)
 Set header used for output file. More...
 

Function Documentation

◆ ksceJpegEncoderInit()

int ksceJpegEncoderInit ( SceJpegEncoderContext  context,
int  inWidth,
int  inHeight,
SceJpegEncoderPixelFormat  pixelformat,
void *  outBuffer,
SceSize  outSize 
)

Initialize a jpeg encoder.

Parameters
[in]context- A pointer to a big enough allocated memory block
[in]inWidth- Input width in pixels
[in]inHeight- Input height in pixels
[in]pixelformat- A valid SceJpegEncoderPixelFormat set of values
[in]outBuffer- A physically continuous memory block 256 bytes aligned
[in]outSize- Output size in bytes
Returns
0 on success, < 0 on error.

◆ ksceJpegEncoderEnd()

int ksceJpegEncoderEnd ( SceJpegEncoderContext  context)

Terminate a jpeg encoder.

Parameters
[in]context- A pointer to an already initialized SceJpegEncoderContext
Returns
0 on success, < 0 on error.

◆ ksceJpegEncoderEncode()

int ksceJpegEncoderEncode ( SceJpegEncoderContext  context,
const void *  inBuffer 
)

Execute a jpeg encode.

Parameters
[in]context- A pointer to an already initialized SceJpegEncoderContext
[in]inBuffer- A physically continuous memory block 256 bytes aligned
Returns
0 on success, < 0 on error.

◆ ksceJpegEncoderSetCompressionRatio()

int ksceJpegEncoderSetCompressionRatio ( SceJpegEncoderContext  context,
int  ratio 
)

Set encoder compression ratio.

Parameters
[in]context- A pointer to an already initialized SceJpegEncoderContext
[in]ratio- A value between 0 and 255 (higher = better compression, lower = better speed)
Returns
0 on success, < 0 on error.

◆ ksceJpegEncoderSetOutputAddr()

int ksceJpegEncoderSetOutputAddr ( SceJpegEncoderContext  context,
void *  outBuffer,
SceSize  outSize 
)

Set encoder output address.

Parameters
[in]context- A pointer to an already initialized SceJpegEncoderContext
[in]outBuffer- A physically continuous memory block 256 bytes aligned
[in]outSize- Output buffer size in bytes
Returns
0 on success, < 0 on error.

◆ ksceJpegEncoderCsc()

int ksceJpegEncoderCsc ( SceJpegEncoderContext  context,
void *  outBuffer,
const void *  inBuffer,
int  inPitch,
SceJpegEncoderPixelFormat  inPixelFormat 
)

Execute a color conversion from ARGB to YCbCr.

Parameters
[in]context- A pointer to an already initialized SceJpegEncoderContext
[in]outBuffer- A physical continuous memory block 256 bytes aligned
[in]inBuffer- A pointer to a valid ARGB buffer
[in]inPitch- Input pitch value in pixels
[in]inPixelFormat- A valid SceJpegEncoderPixelFormat set of values
Returns
0 on success, < 0 on error.

◆ ksceJpegEncoderGetContextSize()

int ksceJpegEncoderGetContextSize ( void  )

Return required free size to allocate a jpeg encoder.

Returns
Required free memory size in bytes, < 0 on error.

◆ ksceJpegEncoderSetValidRegion()

int ksceJpegEncoderSetValidRegion ( SceJpegEncoderContext  context,
int  inWidth,
int  inHeight 
)

Set encoder valid region (?)

Parameters
[in]context- A pointer to an already initialized SceJpegEncoderContext
[in]inWidth- Input width in pixels
[in]inHeight- Input height in pixels
Returns
0 on success, < 0 on error.

◆ ksceJpegEncoderSetHeaderMode()

int ksceJpegEncoderSetHeaderMode ( SceJpegEncoderContext  context,
int  mode 
)

Set header used for output file.

Parameters
[in]context- A pointer to an already initialized SceJpegEncoderContext
[in]mode- One of SceJpegEncoderHeaderMode
Returns
0 on success, < 0 on error.