00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "contributors.h"
00016 #include "global.h"
00017 #include "image.h"
00018 #include "img_process.h"
00019
00020
00021 static inline void CPImage(ImageData *imgOut, ImageData *imgIn)
00022 {
00023 memcpy(imgOut->frm_data[0][0], imgIn->frm_data[0][0], img->height * img->width * sizeof (imgpel));
00024
00025 if (img->yuv_format != YUV400)
00026 {
00027 memcpy(imgOut->frm_data[1][0], imgIn->frm_data[1][0], img->height_cr * img->width_cr * sizeof (imgpel));
00028 memcpy(imgOut->frm_data[2][0], imgIn->frm_data[2][0], img->height_cr * img->width_cr * sizeof (imgpel));
00029 }
00030 }
00031
00032
00033 static inline void FilterImage(ImageData *imgOut, ImageData *imgIn)
00034 {
00035 memcpy(imgOut->frm_data[0][0], imgIn->frm_data[0][0], img->height * img->width * sizeof (imgpel));
00036
00037 if (img->yuv_format != YUV400)
00038 {
00039 memcpy(imgOut->frm_data[1][0], imgIn->frm_data[1][0], img->height_cr * img->width_cr * sizeof (imgpel));
00040 memcpy(imgOut->frm_data[2][0], imgIn->frm_data[2][0], img->height_cr * img->width_cr * sizeof (imgpel));
00041 }
00042 }
00043
00044 static inline void YV12toYUV(ImageData *imgOut, ImageData *imgIn)
00045 {
00046 memcpy(imgOut->frm_data[0][0], imgIn->frm_data[0][0], img->height * img->width * sizeof (imgpel));
00047
00048 if (img->yuv_format != YUV400)
00049 {
00050 memcpy(imgOut->frm_data[1][0], imgIn->frm_data[2][0], img->height_cr * img->width_cr * sizeof (imgpel));
00051 memcpy(imgOut->frm_data[2][0], imgIn->frm_data[1][0], img->height_cr * img->width_cr * sizeof (imgpel));
00052 }
00053 }
00054
00055 void ProcessImage( InputParameters *params)
00056 {
00057 switch( params->ProcessInput )
00058 {
00059 default:
00060 case 0:
00061 CPImage(&imgData, &imgData1);
00062 break;
00063 case 1:
00064 FilterImage(&imgData, &imgData1);
00065 break;
00066 case 2:
00067 YV12toYUV(&imgData, &imgData1);
00068 break;
00069 }
00070 }
00071
00072