OSDN Git Service

add dct hardware with device driver
[fpga-leon-mjpeg/leon-mjpeg.git] / snapgear-2.6-p42 / user / jpeg-6b / dmjpeg.c
index e019cf3..1ffbb66 100644 (file)
@@ -121,6 +121,8 @@ void setup_hardware(j_decompress_ptr cinfo)
   int h_samp[3];
   int v_samp[3];
   int qtbl_no[3];
+  struct ioctl_cmdq ioctl_dataq;
+  JQUANT_TBL *qtbl;
 
 
   /** V1 framebuffer & motionJPEG support **/
@@ -215,6 +217,18 @@ void setup_hardware(j_decompress_ptr cinfo)
 #endif
 
   ioctl(cinfo->dev_fd, IOCTL_REGSET, &regset);
+
+  compptr = cinfo->comp_info;
+  for(j=0;j<3;j++,compptr++){
+    qtbl = cinfo->quant_tbl_ptrs[qtbl_no[j]];
+    for(i=0;i<64;i++){
+      //         printf(".%x.",(int)qtbl->quantval[i]);
+          ioctl_dataq.quant[j*64+i] = qtbl->quantval[i];
+    }
+    //    printf("\n");
+  }
+  ioctl(cinfo->dev_fd, IOCTL_QTBL, &ioctl_dataq);
+
 }