OpenCores
URL https://opencores.org/ocsvn/mpdma/mpdma/trunk

Subversion Repositories mpdma

[/] [mpdma/] [trunk/] [mb-bmp2jpg/] [dct.c] - Diff between revs 13 and 18

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 13 Rev 18
Line 1... Line 1...
 
 
#include "xparameters.h"
#include "xparameters.h"
#include "xutil.h"
#include "xutil.h"
#include "mb_interface.h"
#include "mb_interface.h"
#include "fifo_link.h"
#include "fifo_link.h"
 
 
#include "ejpgl.h"
#include "ejpgl.h"
 
 
 
#define XPAR_FSL_FIFO_LINK_0_INPUT_SLOT_ID 0
 
#define  XPAR_FSL_FIFO_LINK_0_OUTPUT_SLOT_ID 0
 
 
 
 
int dct_init_start() {
int dct_init_start() {
 
 
        return 0;
        return 0;
 
 
}
}
 
 
signed short dctresult[MATRIX_SIZE][MATRIX_SIZE];
int dct_end_done() {
 
        int msg;
 
 
#define XPAR_FSL_FIFO_LINK_0_INPUT_SLOT_ID 0
        msg=0xff;
#define  XPAR_FSL_FIFO_LINK_0_OUTPUT_SLOT_ID 0
 
 
        write_into_fsl(msg, XPAR_FSL_FIFO_LINK_0_OUTPUT_SLOT_ID);
 
        return 0;
 
 
 
}
 
 
 
void put_char(unsigned char c);
 
 
 
void check_fsl() {
 
        unsigned long result;
 
        unsigned long status;
 
        unsigned char ch;
 
 
 
        for (;;) {
 
        microblaze_nbread_datafsl(result, 0);
 
        asm volatile ("mfs %0, rmsr" : "=d" (status));
 
        if (status & 0x80000000) return;
 
//              xil_printf("-->%x-%x\r\n", result, status);
 
        ch = result;
 
        put_char(ch);
 
                }
 
        return;
 
 
 
}
 
 
 
void dct(signed char pixels[8][8], int color)
 
{
 
        int i;
 
        long result;
 
 
 
        check_fsl();
 
        write_into_fsl(color, XPAR_FSL_FIFO_LINK_0_OUTPUT_SLOT_ID);
 
 
 
       for (i=0; i<64; i++) {
 
                check_fsl();
 
        write_into_fsl(((char*)pixels)[i], XPAR_FSL_FIFO_LINK_0_OUTPUT_SLOT_ID);
 
        }
 
 
 
/*      for (i=0; i<64; i++){
 
        read_from_fsl(result, XPAR_FSL_FIFO_LINK_0_INPUT_SLOT_ID);
 
                ((short*)dctresult)[i] = result;
 
                } */
 
 
 
// Read from FSL in non-blocking mode
 
        check_fsl();
 
 
 
}
 
 
 
 
 
 
 
#if 0
 
signed short dctresult[MATRIX_SIZE][MATRIX_SIZE];
 
 
void dct(signed char pixels[8][8], int color)
void dct(signed char pixels[8][8], int color)
{
{
        int i;
        int i;
        long result;
        long result;
Line 35... Line 90...
 
 
        zzq_encode(dctresult, color);
        zzq_encode(dctresult, color);
 
 
}
}
 
 
 
#endif
 
 
#if 0
#if 0
#include <stdio.h>
#include <stdio.h>
#include "dct.h"
#include "dct.h"
#include "weights.h"
#include "weights.h"
 
 
Line 180... Line 237...
 
 
}
}
*/
*/
#endif
#endif
 
 
 No newline at end of file
 No newline at end of file
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.