?? main.c
字號:
/*
* Copyright (c) 1995,2000 TriMedia Technologies Inc.
*
* +------------------------------------------------------------------+
* | This software is furnished under a license and may only be used |
* | and copied in accordance with the terms and conditions of such |
* | a license and with the inclusion of this copyright notice. This |
* | software or any other copies of this software may not be provided|
* | or otherwise made available to any other person. The ownership |
* | and title of this software is not transferred. |
* | |
* | The information in this software is subject to change without |
* | any prior notice and should not be construed as a commitment by |
* | TriMedia Technologies. |
* | |
* | this code and information is provided "as is" without any |
* | warranty of any kind, either expressed or implied, including but |
* | not limited to the implied warranties of merchantability and/or |
* | fitness for any particular purpose. |
* +------------------------------------------------------------------+
*
* Module name : main.c 1.2
*
* Last update : 14:26:51 - 2000/05/12
*
* Description :
*
* IDCT example program:
*
*
* COD Feb 21, 2000 Added little endian support, input reader,
* fixed bug for customer support
*
* COD Apr 17, 2000 Added transposition, shuffling of
* input data to improve clarity for customer,
* added code to print intermediate results
*/
#include <stdlib.h>
#include <stdio.h>
#include "tc.h"
extern void idct8x8fix(short *restrict, short *restrict, int);
#define S 8
short data[64] ;
short result[64];
main(int argc, char **argv)
{
int i, j, dataword;
int shift = 3, clip = 1000, inshift = 0;
while (argc > 1) {
if (!strcmp(argv[1], "-inshift")) {
inshift = atoi(argv[2]);
argc--;
argv++;
} else if (!strcmp(argv[1], "-clip")) {
clip = atoi(argv[2]);
argc--;
argv++;
}
argc--;
argv++;
}
for (i=0; i<8; i++) {
for (j=0; j<8; j++) {
scanf("%d", &dataword);
data[8*i+j] = dataword << inshift;
}
}
idct8x8fix(data, result, clip);
for (i=0; i<8; i++) {
for (j=0; j<8; j++)
printf("%5d ", result[8*i+j]);
printf("\n");
}
exit(EXIT_SUCCESS);
}
void idctprint(a, b, c, d)
{
int vec[8];
static int map[8] = { 0, 2, 4, 6, 1, 3, 5, 7 } ;
vec[!LITTLE_ENDIAN] = (short)a; vec[ LITTLE_ENDIAN] = a>>16;
vec[2+!LITTLE_ENDIAN] = (short)b; vec[2+LITTLE_ENDIAN] = b>>16;
vec[4+!LITTLE_ENDIAN] = (short)c; vec[4+LITTLE_ENDIAN] = c>>16;
vec[6+!LITTLE_ENDIAN] = (short)d; vec[6+LITTLE_ENDIAN] = d>>16;
printf("%-5d %-5d %-5d %-5d %-5d %-5d %-5d %-5d\n",
vec[0], vec[1], vec[2], vec[3],
vec[4], vec[5], vec[6], vec[7]);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -