Hi.
When resizing artifacts occur. What could be the problem?
static Uint8 resizer_in_frame_buffer[IMAGE_DATA_SIZE];
static Uint8 resizer_out_frame_buffer[IMAGE_DATA_SIZE];
static Uint8 croped_frame[IMAGE_DATA_SIZE];
#pragma DATA_ALIGN(resizer_in_frame_buffer, 32);
#pragma DATA_ALIGN(resizer_out_frame_buffer, 32);
#pragma DATA_ALIGN(croped_frame, 32);
Bool hardware_resize_param(uint8_t *src, uint8_t *out, const int in_width, const int in_height, const int out_width, const int out_height)
{
Bool result = FALSE;
Bool empty_out = (out == 0);
memcpy(resizer_in_frame_buffer, src, in_width*in_height);
if(empty_out)
{
out = src;
}
memset(out, 0x80, out_width*out_height);
RSZ_params params = {
640, /* Input image width */
480, /* Input image height */
640, /* Input image pitch */
PSP_RSZ_INTYPE_PLANAR_8BIT, /* Input image type */
0, /* Vertical starting pixel */
0, /* Horizontal starting pixel */
0, /* Chroma position */
PSP_RSZ_PIX_FMT_PLANAR, /* Image format */
320, /* Intermediate image width */
240, /* Intermediate image height */
320, /* Intermediate image pitch */
0, /* Horizontal starting phase */
0, /* Vertical starting phase */
gRDRV_reszFilter4TapHighQuality,/* Horizontal filter coefficients */
gRDRV_reszFilter4TapHighQuality,/* Vertical filter coefficients */
PSP_RSZ_YENH_DISABLE /* Luma enhancement options */
};
params.inHsize = in_width;
params.inVsize = in_height;
params.inPitch = in_width;
params.outHsize = out_width;
params.outVsize = out_height;
params.outPitch = out_width;
resizer_params = params;
apply_params();
resizer_features.inBuf = resizer_in_frame_buffer;
resizer_features.inBufSize = in_width*in_height;
resizer_features.outBuf = resizer_out_frame_buffer;
resizer_features.outBufSize = out_width*out_height;
result = resize();
if(result)
{
memcpy(out, resizer_out_frame_buffer, out_width*out_height);
}
memset(resizer_in_frame_buffer, 0, IMAGE_DATA_SIZE);
memset(resizer_out_frame_buffer, 0, IMAGE_DATA_SIZE);
return result;
}