⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 block.h

📁 H.263的编码程序,加了CPU指令优化,VC版.
💻 H
字号:
/*!
********************************************************
*\file
*    block.h
*\brief
*    interface for 8x8 block level functions.
*\date
*    12/6/2002
*
********************************************************/
#ifndef BLOCK_H
#define BLOCK_H

#include "HEnc.h"

//! Zigzag Matrix
static int MixZig[64] = {0, 1,  5,  6,  14, 15, 27, 28,
                         2, 4,  7,  13, 16, 26, 29, 42,
		                 3, 8,  12, 17, 25, 30, 41, 43,
		                 9, 11, 18, 24, 31, 40, 44, 53,
		                10, 19, 23, 32, 39, 45, 52, 54,
		                20, 22, 33, 38, 46, 51, 55, 60, 
		                21, 34, 37, 47, 50, 56, 59, 61,
		                35, 36, 48, 49, 57, 58, 62, 63};

//! Matrices for obmc prediction
static  int Mc[8][8] = 
{
    {4,5,5,5,5,5,5,4},
    {5,5,5,5,5,5,5,5},
    {5,5,6,6,6,6,5,5},
    {5,5,6,6,6,6,5,5},
    {5,5,6,6,6,6,5,5},
    {5,5,6,6,6,6,5,5},
    {5,5,5,5,5,5,5,5},
    {4,5,5,5,5,5,5,4},
};
static  int Mt[8][8] =
{
    {2,2,2,2,2,2,2,2},
    {1,1,2,2,2,2,1,1},
    {1,1,1,1,1,1,1,1},
    {1,1,1,1,1,1,1,1},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
};
static  int Mb[8][8] = 
{
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {1,1,1,1,1,1,1,1},
    {1,1,1,1,1,1,1,1},
    {1,1,2,2,2,2,1,1},
    {2,2,2,2,2,2,2,2},
};
static  int Mr[8][8] = 
{
    {0,0,0,0,1,1,1,2},
    {0,0,0,0,1,1,2,2},
    {0,0,0,0,1,1,2,2},
    {0,0,0,0,1,1,2,2},
    {0,0,0,0,1,1,2,2},
    {0,0,0,0,1,1,2,2},
    {0,0,0,0,1,1,2,2},
    {0,0,0,0,1,1,1,2},
};
static  int Ml[8][8] =
{
    {2,1,1,1,0,0,0,0},
    {2,2,1,1,0,0,0,0},
    {2,2,1,1,0,0,0,0},
    {2,2,1,1,0,0,0,0},
    {2,2,1,1,0,0,0,0},
    {2,2,1,1,0,0,0,0},
    {2,2,1,1,0,0,0,0},
    {2,1,1,1,0,0,0,0},
};



void fdct_mmx (INT16 *curr_blk, INT16 *rsltblk);
void idct_mmx (INT16 *curr_blk, INT16 *des_blk);
void IDCTMMX(INT16 *block, INT16 *out);
void fdct_c (INT16 *curr_blk, INT16 *rsltblk);
void idct_c (INT16 *curr_blk, INT16 *des_blk);
void pred_lum_c(int pix_x, int pix_y, MotionVector *MV, unsigned char *ipol, 
    		  int lx, unsigned char *pred_block);
void pred_lum_sse(int pix_x, int pix_y, MotionVector *MV, unsigned char *ipol, 
			  int lx, unsigned char *pred_block);
void pred_lum_bid_c(int pix_x, int pix_y, int dxf, int dyf, int dxb, int dyb, 
					unsigned char *prev_ipol, unsigned char *next_ipol, int lx, 
					unsigned char *pred_block);
void pred_lum_bid_sse(int pix_x, int pix_y, int dxf, int dyf, int dxb, int dyb, 
					unsigned char *prev_ipol, unsigned char *next_ipol, int lx, 
					unsigned char *pred_block);
void pred_obmc_c (int x, int y, MotionVector *MV[6][MBR+1][MBC+2], int pic_width, 
		   unsigned char *prev_ipol, int lx, int block, unsigned char *pred_block);
void pred_obmc_sse (int x, int y, MotionVector *MV[6][MBR+1][MBC+2], int pic_width, 
	   unsigned char *prev_ipol, int lx, int block, unsigned char *pred_block);
void pred_chrom_c(int pix_x, int pix_y, unsigned char *prev, 	int lx, 
				int dx, int dy, unsigned char *pred_block);
void pred_chrom_mmx(int pix_x, int pix_y, unsigned char *prev, 	int lx, 
				int dx, int dy, unsigned char *pred_block);
void pred_chrom_sse(int pix_x, int pix_y, unsigned char *prev, 	int lx, 
				int dx, int dy, unsigned char *pred_block);
void pred_chrom_bid_c(int pix_x, int pix_y, unsigned char *prev, 	unsigned char *next, int lx, 
				int dxf, int dyf, int dxb, int dyb, unsigned char *pred_block);
void pred_chrom_bid_mmx(int pix_x, int pix_y, unsigned char *prev, 	unsigned char *next, int lx, 
				int dxf, int dyf, int dxb, int dyb, unsigned char *pred_block);
void pred_chrom_bid_sse(int pix_x, int pix_y, unsigned char *prev, 	unsigned char *next, int lx, 
				int dxf, int dyf, int dxb, int dyb, unsigned char *pred_block);
void make_diff_c(unsigned char* curr_block, int pic_width, unsigned char *pred_block, INT16 *diff_block);
void make_diff_mmx(unsigned char* curr_block, int pic_width, unsigned char *pred_block, INT16 *diff_block);
void recon_pic_c(unsigned char* recon_block, int pic_width, unsigned char *pred_block, INT16 *diff_block);
void recon_pic_sse(unsigned char* recon_block, int pic_width, unsigned char *pred_block, INT16 *diff_block);
int  Quant_blk_I_c (INT16 *curr_blk,INT16 *qun_blk, int QP);
int  Quant_blk_I_sse (INT16 *curr_blk,INT16 *qun_blk, int QP);
void DeQuant_blk_I_c (INT16 *curr_blk, INT16 *recn_blk, int QP);
void DeQuant_blk_I_mmx (INT16 *curr_blk, INT16 *recn_blk, int QP);
int  Quant_blk_P_c (INT16 *curr_blk,INT16 *qun_blk, int QP);
int  Quant_blk_P_sse (INT16 *curr_blk,INT16 *qun_blk, int QP);
void DeQuant_blk_P_c (INT16 *curr_blk, INT16 *recn_blk, int QP);
void DeQuant_blk_P_mmx (INT16 *curr_blk, INT16 *recn_blk, int QP);
void block_copy1_c( unsigned char *des_block, unsigned char *src_block, int lx_des);
void block_copy1_mmx( unsigned char *des_block, unsigned char *src_block, int lx_des);
void block_copy2_c( INT16 *des_block, unsigned char *src_block, int lx_des);
void block_copy2_mmx( INT16 *des_block, unsigned char *src_block, int lx_des);
void block_copy3_c( unsigned char *des_block, INT16 *src_block, int lx_des);
void block_copy3_mmx( unsigned char *des_block, INT16 *src_block, int lx_des);
int  block_SAD(INT16 *block);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -