快速逆离散余弦变换代码实现(FIDCT)

下面的二维快速逆离散余弦变换是在Thomas G. Lane 的代码的基础上,修改而成。可直接用于图像或视频处理。
测试代码是玄机逸士写的。
// fidct.h
void fidct(short *const block);
void fidct_init();
// fidct.cpp
/*****************************************************************************
 *
 *  XVID MPEG-4 VIDEO CODEC
 *  - Inverse DCT  -
 *
 *  These routines are from Independent JPEG Group's free JPEG software
 *  Copyright (C) 1991-1998, Thomas G. Lane (see the file README.IJG)
 ****************************************************************************/
/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
#include "fidct.h"
#define W1 2841     /* 2048*sqrt(2)*cos(1*pi/16) */
#define W2 2676     /* 2048*sqrt(2)*cos(2*pi/16) */
#define W3 2408     /* 2048*sqrt(2)*cos(3*pi/16) */
#define W5 1609     /* 2048*sqrt(2)*cos(5*pi/16) */
#define W6 1108     /* 2048*sqrt(2)*cos(6*pi/16) */
#define W7 565       /* 2048*sqrt(2)*cos(7*pi/16) */
/* private data */
static short iclip[1024];  /* clipping table */
static short *iclp;

                
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值