OSDN Git Service

add device driver for yccrgbs. change dmjpeg using IPcore and device driver
[fpga-leon-mjpeg/leon-mjpeg.git] / snapgear-2.6-p42 / user / jpeg-6b / jdcolor.c
index e6f014e..df211d8 100644 (file)
@@ -12,6 +12,7 @@
 #include "jinclude.h"
 #include "jpeglib.h"
 
+#include "kmjpeg.h"
 static int call_num = 0;
 
 
@@ -144,6 +145,7 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
   unsigned int pixcoldata;
   unsigned int temppix;
   long int location;
+  struct ioctl_cmdwrite writedata;
 
   while (--num_rows >= 0) {
     inptr0 = input_buf[0][input_row];
@@ -156,20 +158,24 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
       cb = GETJSAMPLE(inptr1[col]);
       cr = GETJSAMPLE(inptr2[col]);
       /* Range-limiting is essential due to noise introduced by DCT losses. */
-      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];
+      /* outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];
       outptr[RGB_GREEN] = range_limit[y +
                              ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
                                                 SCALEBITS))];
       outptr[RGB_BLUE] =  range_limit[y + Cbbtab[cb]];
-
+      */
       /* V1 LEON-motionJPEG project */
-      if(col%2 == 0){
+      /*     if(col%2 == 0){
         temppix =( ((outptr[RGB_RED]&0xf8)<<8) | ((outptr[RGB_GREEN]&0xfc)<<3) | ((outptr[RGB_BLUE]&0xf8)>>3));
       }else{
         pixcoldata = temppix << 16 |( ((outptr[RGB_RED]&0xf8)<<8) | ((outptr[RGB_GREEN]&0xfc)<<3) | ((outptr[RGB_BLUE]&0xf8)>>3));
         location = ((col-1) * cinfo->fb_yinc) + (call_num) * cinfo->fb_finfo.line_length ;
-        *((unsigned int *)(cinfo->fbptr + location)) = pixcoldata;
-      }
+       *((unsigned int *)(cinfo->fbptr + location)) = pixcoldata;
+       }*/
+      /*LEON-motionJPEG prj  for hard IP : yccrgbs*/
+      pixcoldata =(unsigned int)( y <<16 | cb <<8 | cr);
+      writedata.pixeldata = pixcoldata;
+      ioctl(cinfo->dev_fd, IOCTL_WRITE, &writedata); 
       outptr += RGB_PIXELSIZE;
     }
   }